matrix
matrix copied to clipboard
inverse fails for invertible matrices with zero diagonal elements
inversre
function fails with "Ratio has zero denominator" error for following test cases:
, testEquality "inverse (3)"
( inverse $ fromList 2 2 [0,1, 1,0]
, Right $ fromList 2 2 [0,1, 1,0] :: Either String (Matrix Rational))
, testEquality "inverse (4)"
( inverse $ fromList 3 3 [1,0,0, 0,0,1, 0,1,0]
, Right $ fromList 3 3 [1,0,0, 0,0,1, 0,1,0] :: Either String (Matrix Rational))
The inverse function needs a revision. I'll add the tests you proposed.
@Daniel-Diaz please consider pull request #39 - perhaps it fixes this?
Indeed, the tests are now passing.