Next: , Previous: Operations, Up: Operations


4.3.1 Elements

— Generic Function: grid:aref grid &rest indices

Select the element from the grid.

— Generic Function: grid:aref* grid linearized-index

Select the element from the grid using a linearized index.

— Generic Function: (setf grid:aref)

Set the element from the grid.

— Generic Function: (setf grid:aref*)

Set the element from the grid using a linearized index.

Individual elements are obtained using grid:aref (analogous to Lisp's cl:aref), and are set with setf grid:aref. For example,
     ANTIK-USER> (setf *default-grid-type* 'foreign-array)
     ANTIK-USER> (defparameter *array* #m(2.0d0 1.0d0 -1.0d0))
     ANTIK-USER> *array*
     #m(2.000000000000000d0 1.000000000000000d0 -1.000000000000000d0)
     ANTIK-USER> (grid:aref *array* 1)
     1.0
     ANTIK-USER> (setf (grid:aref *array* 1) 77.0d0)
     77.0
     ANTIK-USER> (grid:aref *array* 1)
     77.0
     ANTIK-USER> *array*
     #m(2.000000000000000d0 77.000000000000000d0 -1.000000000000000d0)