Map on multiple source grids. The arguments are: sources: A list of (grid-or-function affi), each one representing either a grid or function from which data will be drawn. If it is a grid, the grid values are used. If it is a function of the appropriate number of non-negative integer arguments, values will be created by calling that function on the indices. If affi is not specified and grid-or-function is a grid, the affi will default to the
affiof that grid.
- destination:
- A grid in which to put the results, or nil if one is to be created.
- destination-affi:
- An
affifor the destinattion.- destination-specification:
- A specification for the destination, if destination-affi is not given.
- initial-element: Initial value to give to the destination grid.
- element-functions:
- A list of functions or nil, one for each source. This function is applied to the source element before combination.
- combination-function:
- A function that combines each of the source values after being passed through the element-functions. If nil, then just take the value from the first source.
- combine-destination:
- If true, pass as the first argument to the combination-function the prior value of the destination grid. Defaults to
tif :desination is specified; otherwise nil.
map-grid which can take multiple
source grids, instead of only one.
For example, combine arrays a and b as a+2b:
(map-n-grids :sources `((,#31m(1 2 3) nil) (,#31m(9 8 7) nil))
:combination-function (lambda (a b) (+ a (* 2 b))))