regular-matrix? ( object -- ? )


Vocabulary
math.matrices

Inputs
objectan object


Outputs
?a boolean


Word description
Tests if the object is a regular (well-formed, rectangular, etc) matrix. A regular matrix is a sequence with an equal number of elements in every row, and an equal number of elements in every column, such that there are no empty slots.

Notes
The null-matrix is considered regular, because of semantic requirements of the matrix implementation.

Examples
The example is an irregular matrix, because the rows have an unequal number of elements.
USING: math.matrices prettyprint ; { { 1 } { } } regular-matrix? .
f

The example is a regular matrix, because the rows have an equal number of elements.
USING: math.matrices prettyprint ; { { 1 } { 2 } } regular-matrix? .
t


Definition