Next: , Previous: Space-Filling Curves, Up: Space-Filling Curves


7.2.7.1 Multidimensional Space-Filling Curves

(require 'space-filling) The algorithms and cell properties are described in http://people.csail.mit.edu/jaffer/Geometry/RMDSFF.pdf

— Function: make-cell type rank side precession
— Function: make-cell type rank side
— Function: make-cell type rank

type must be the symbol diagonal, adjacent, or centered. rank must be an integer larger than 1. side, if present, must be an even integer larger than 1 if type is adjacent or an odd integer larger than 2 otherwise; side defaults to the smallest value. precession, if present, must be an integer between 0 and side^rank-1; it is relevant only when type is diagonal or centered.

— Function: make-cell Hamiltonian-path-vector precession
— Function: make-cell Hamiltonian-path-vector

type must be a vector of side^rank lists of rank of integers encoding the coordinate positions of a Hamiltonian path on the rank-dimensional grid of points starting and ending on corners of the grid. The starting corner must be the origin (all-zero coordinates). If the side-length is even, then the ending corner must be non-zero in only one coordinate; otherwise, the ending corner must be the furthest diagonally opposite corner from the origin.

make-cell returns a data object suitable for passing as the first argument to integer->coordinates or coordinates->integer.

Hilbert, Peano, and centered Peano cells are generated respectively by:

     (make-cell 'adjacent rank 2)   ; Hilbert
     (make-cell 'diagonal rank 3)   ; Peano
     (make-cell 'centered rank 3)   ; centered Peano

In the conversion procedures, if the cell is diagonal or adjacent, then the coordinates and scalar must be nonnegative integers. If centered, then the integers can be negative.

— Function: integer->coordinates cell u

integer->coordinates converts the integer u to a list of coordinates according to cell.

— Function: coordinates->integer cell v

coordinates->integer converts the list of coordinates v to an integer according to cell.

coordinates->integer and integer->coordinates are inverse functions when passed the same cell argument.