<square-rows> ( desc -- matrix )
Matrix operations

Prev:<coordinate-matrix> ( dim -- coordinates )
Next:<square-cols> ( desc -- matrix )


Vocabulary
math.matrices

Inputs and outputs
desca sequence, an integer, or a matrix
matrixa matrix


Generic word contract
Generate a square-matrix from a descriptor.

Word description
If the descriptor is an integer, it is used to generate square rows within that range.

If it is a 1-dimensional sequence, it is replicated to create each row.

If it is a matrix, it is cropped into a square-matrix.

If it is a square-matrix, it is returned unchanged.

Examples
USING: math.matrices prettyprint ; 3 <square-rows> .
{ { 0 1 2 } { 0 1 2 } { 0 1 2 } }

USING: math.matrices prettyprint ; { 2 3 5 } <square-rows> .
{ { 2 3 5 } { 2 3 5 } { 2 3 5 } }


Definition


Methods