matrix icon indicating copy to clipboard operation
matrix copied to clipboard

inverse fails for invertible matrices with zero diagonal elements

Open ezag opened this issue 8 years ago • 3 comments

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))

ezag avatar Aug 06 '16 17:08 ezag

The inverse function needs a revision. I'll add the tests you proposed.

Daniel-Diaz avatar Sep 18 '16 03:09 Daniel-Diaz

@Daniel-Diaz please consider pull request #39 - perhaps it fixes this?

ezag avatar Sep 18 '16 08:09 ezag

Indeed, the tests are now passing.

Daniel-Diaz avatar Sep 18 '16 13:09 Daniel-Diaz