Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions M2/Macaulay2/e/basic-mutable-matrices/dmat-lu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ bool DMatLinAlg<RingType>::inverse(Mat& X)
for (size_t i = 0; i < LU.numRows(); i++)
ring().set_from_long(id.entry(i, i), 1);

solve(id, X);
return true;
return solve(id, X);
}

template <class RingType>
Expand Down
3 changes: 3 additions & 0 deletions M2/Macaulay2/tests/normal/inverse.m2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ assert try x^-1 else true
F = matrix {{1.,2,3},{4,6,9},{2,4,8}}
F * F^-1 == 1.

assert(try (inverse matrix{{1., 2.}, {2., 4.}}; false) else true)
assert(try (inverse matrix{{ii, 2*ii}, {2*ii, 4*ii}}; false) else true)

--- bug found in inverse, originally noticed in a Schubert2 computation.
--- this is from github issue #2051 (May 2021)
kk = ZZ/32003
Expand Down
Loading