up previous next
random unimodular matrix
RandomUnimodularMat(R: RING, N: INT): MAT
RandomUnimodularMat(R: RING, N: INT, Niters: INT): MAT
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``.
/**/ RandomUnimodularMat(ZZ, 3);
[[-684, -2919, -769],
[1054, 4498, 1185],
[-519, -2215, -584]])