up previous next
RandomUnimodularMat

random unimodular matrix

Syntax
RandomUnimodularMat(R: RING, N: INT): MAT
RandomUnimodularMat(R: RING, N: INT, Niters: INT): MAT

Description
The function returns a random unimodular ``N``-by-``N`` matrix with integer entries. The matrix is over the ring ``R``. The optional 3rd argument says how many internal iterations to perform: the algorithm starts with an identity matrix, then on each iteration simply adds or substracts one random row to another random row; the default number of iterations is currently ``25*N``.

Example
/**/ RandomUnimodularMat(ZZ, 3);
matrix(ZZ,
 [[-684, -2919, -769],
  [1054, 4498, 1185],
  [-519, -2215, -584]])

See Also