The following functions were created while implementing the high-level functions, but we found that they could be useful outside of our functions, too. You can find the specifications of the functions and some small examples here.
‣ IsMatrixInRREF ( mat ) | ( function ) |
Returns: bool
Checks whether the matrix mat is in RREF
gap> M := RandomMat( 3, 3 );; gap> Display( M ); [ [ 1, 0, -1 ], [ -1, -1, 1 ], [ -1, 1, -2 ] ] gap> IsMatrixInRREF( M ); false gap> L := [ [ 1, 0, 3 ], [ 0, 1, 5 ] ];; gap> Display( L ); [ [ 1, 0, 3 ], [ 0, 1, 5 ] ] gap> IsMatrixInRREF( L ); true
‣ RandomEchelonMat ( height, width, rank, randomSeed, field ) | ( function ) |
Returns: mat
Constructs a random matrix in RREF of the given height (number of rows), width (number of columns) and rank over the given field. Using the same random seed will recreate the same matrix.
gap> # We use Mersenne twister as a random seed here. gap> randomSeed := RandomSource(IsMersenneTwister, 42);; gap> M := RandomEchelonMat(10, 10, 5, randomSeed, GF(5));; gap> Display(M); 1 . . . . . 1 4 4 . . 1 . . . 1 3 2 4 3 . . 1 . . . 3 . 1 . . . . 1 . 2 2 3 4 2 . . . . 1 2 2 4 1 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
generated by GAPDoc2HTML