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

Prev:<square-rows> ( desc -- matrix )
Next:<upper-matrix> ( object m n -- matrix )


Vocabulary
math.matrices

Inputs
desca sequence, an integer, or a matrix


Outputs
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 columns within that range.

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

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-cols> .
{ { 0 0 0 } { 1 1 1 } { 2 2 2 } }

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


Definition


Methods