You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 18, 2023. It is now read-only.
Hi -- hope this is the right way to report bugs for the Data.Matrix package!
There are two issues showing up when matrix inversion runs into problems (e.g. for nearly singular matrices):
in function ref:
goodRow = case listToMaybe (filter significantRow [1..ncols mtx]) of
Nothing -> error "Attempt to invert a non-invertible matrix"
Just x -> x
ncol needs to be nrows, current code crashes with access error instead of returning error.
as ref is called from inverse (and rref), which promises to return Either String (Matrix a), calling error in case of non-invertible matrices is not a very nice thing to do. ref should be modified to also return Either String (Matrix a), so inverse can return Left "can't invert". It's important that user code can handle singular or numerically unstable matrices themselves.
Thanks for your consideration (and thanks for providing Data.Matrix, which is otherwise a joy to use).