cartesian-matrix-map ( matrix quot: ( ... pair matrix -- ... matrix' ) -- matrix-seq )


Vocabulary
math.matrices.extras

Inputs
matrixa matrix
quota quotation with stack effect ( ... pair matrix -- ... matrix' )


Outputs
matrix-seqa sequence of matrixs


Word description
Calls the quotation with the matrix and the coordinate pair of the current element on the stack, with the matrix on the top of the stack.

Examples
USING: arrays math.matrices.extras prettyprint ; { { 21 22 } { 23 24 } } [ 2array ] cartesian-matrix-map .
{ { { { 0 0 } { { 21 22 } { 23 24 } } } { { 0 1 } { { 21 22 } { 23 24 } } } } { { { 1 0 } { { 21 22 } { 23 24 } } } { { 1 1 } { { 21 22 } { 23 24 } } } } }


Notes
This word is the orthogonal variant of cartesian-column-map.
This word is the two-dimensional variant of map-index.
This word is intended for use with "flat" (2-dimensional) matrices.


Definition