Hi, folks. I've run into another case of matrix::solve() failing.
This time it seems like the division-free elimination doesn't
handle un-normal zeros properly: currently it only does expand()
(instead of normal()) on the results of it's calculations, but
then uses matrix::pivot() to find the pivot, and that routine
also uses expand().is_zero() for zero testing. This breaks when
fractions are present in the initial matrix. Not every time, but
at least in one example.
Note that this problem also affects matrix::solve() with 'algo'
set to solve_algo::automatic, which is how I encountered it.
I'm attaching the example added to the tests, and also the fix
that makes matrix::division_free_elimination() use normal() in
stead of expand(). An alternative would be to use normal() in
the matrix::pivot() routine, but I decided against it because:
1) that way the results of the normal() call would be discarded;
2) that could slow down e.g. matrix::gauss_elimination() which
also uses matrix::pivot(), but normalizes expressions itself.
Of course, using normal() makes division_free_elimination only
truly "division-free" if the input matrix didn't have fractions.
In other cases, GCDs will be computed.