Utilities for creating 1-d grids storing number sequences
Common Lisp
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
ChangeLog
README.org
float-sequences.lisp
integer-sequences.lisp
sequence-grid-package-def.lisp
sequence-grid.asd
setup.lisp

README.org

sequence-grids package

Introduction

Functions in this package create 1-dimensional grids holding sequences of numbers as specified by some mathematical rules. The functions are a thin veneer over Liam Healy’s grid package from his antik library.

There are two main sequence types:

  • sequences of evenly spaced integers
  • sequences of real numbers

The integer sequences can store integers in various representations: bytes, integers, and floats.

The real number sequences always store the numbers as floats.

grid-sequences dictionary

ci-seq, sequences of consecutive integers

Syntax

  • ci-seq kind count &key len step type

Arguments and values

  • kind - a keyword specifying the type of sequence
  • count - a positive integer
  • len - a symbol
  • type - a symbol
  • step - a positive integer

Description

CI-SEQ generates a 1-D grid storing a sequence of consecutive integers, such as 0, 1, 2, … COUNT-1. COUNT determines the number of integers. STEP specifies the difference between successive integers. KIND determines the type of number that the grid will store. KIND can be one of

  • :CONSTANT All grid elements store the same integer
  • :INTEGER Grid is of type integer storing values 0, 1, etc
  • :COUNT Grid is of type signed byte storing values 0, 1, etc
  • :NATURAL Grid of type signed byte storing values 1, 2, etc
  • :FLOAT Grid is of floating type storing values 0, 1, . TYPE can be float or double-float
  • :COMPLEX Grid is of complex type storing values 0, 1, . TYPE can be float or double-float

ci-seq is a generic function with methods selected on kind. All of the methods use grid’s map-grid.

progression, general sequences of numbers

Syntax

  • progression type begin end &key count

Arguments and values

  • type - a keyword
  • begin - a number
  • end - a number
  • count - a positive integer

Description

PROGRESSION generates a sequence of numbers between BEGIN and END in some kind of progression, such as linear or geometric (exponential).

TYPE determines the progression type. Allowed values for TYPE are

  • :linear
  • :geometric
  • (:power, not implemented yet)
  • (:logarithmic, not implemented yet)

To-do

  • Extend ci-seq with the step keyword to allow for sequences such as 1 3 5