matrix-set-nths ( obj pairs matrix -- )
Matrix operations

Prev:matrix-set-nth ( obj pair matrix -- )
Next:row ( n matrix -- row )


Vocabulary
math.matrices

Inputs
objan object
pairsan assoc
matrixa matrix


Outputs
None

Word description
Applies matrix-set-nth to matrix for each row, column pair in pairs, setting the elements to obj.

Side effects
Modifies matrix

Notes
This word is the multiplexing variant of matrix-set-nth.
This word is intended for use with "flat" (2-dimensional) matrices.


Errors
bounds-error if the first element of a pair in pairs is greater than the maximum row index in matrix
bounds-error if the second element of a pair in pairs is greater than the maximum column index in matrix
Throws an error if the sequence cannot hold elements of the given type.


Examples
Change both entries on row 1.
USING: math.matrices kernel prettyprint ; { { 0 1 } { 2 3 } } "a" { { 1 0 } { 1 1 } } pick matrix-set-nths .
{ { 0 1 } { "a" "a" } }


Definition