allow for negative integer matrices as well

This commit is contained in:
Lukasz M 2022-08-24 13:15:03 +02:00
parent a680f4bbd9
commit 70851add1d

View File

@ -7,7 +7,7 @@ errs = (ValueError, TypeError)
def genmatrix(rowcol, intmax, dif) :
# generate a random matrices
a = sp.randMatrix(rowcol, rowcol, 0, intmax)
a = sp.randMatrix(rowcol, rowcol, -intmax, intmax)
# if determinant non-zero, radnom value less than difficulty, set a to its inverse
if a.det() != 0 and random.random() <= dif :
a = a.inv()