Next: , Previous: row, Up: Composition functions


4.3.4.9 slice

— Function: grid:slice grid index-selection &key destination drop

Select slice(s) from a grid. The index-selection is a list with length equal to the rank of grid. Each element should be one of: an index, indicating the index to be selected, :all, indicating the entire range if indices are to be selected, :rev, indicating the entire range if indices are to be selected in reverse order,

(:range start end stride), indicating a range of indices to be
selected; if stride is omitted, it is presumed to be 1,

(:select value ...), indicating explicit values to be selected.

A slice is a subgrid selected by specifying index values. They can be specified as a single value, range of values, or reversed values.
     (grid::test-grid-double-float 'array '(3 4))
     #2A((0.0 1.0 2.0 3.0) (10.0 11.0 12.0 13.0) (20.0 21.0 22.0 23.0))
     (slice (grid::test-grid-double-float 'array '(3 4)) '(1 (:range 0 2)) :drop nil)
     #2A((10.0d0 11.0d0 12.0d0))