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 }}
Repository navigation
The reduced row echelon form of a symbolic matrix is NaN, and the rank of [[a, b], [2a, 2b]] is 2 #2345
The row echelon forms divide by a pivot without first checking whether it is identically zero. In a symbolic matrix the pivot can be an expression like c + -c / a * a, which is 0 but is not recognised as 0. On master (d41933e):
The last row is a wrong answer: the second row is twice the first. Rank counts the rows of the reduced form whose leading element is not null. That form is not simplified, and its second row leads with 2 * a + -2 * a / a * a, which is not null.
The elimination itself shows it. [[a, b], [c, d]].RowEchelonForm is [[a, b], [c + -c / a * a, d + -c / a * b]]. The reduced form goes on to divide by c + -c / a * a. Matrices of numbers are right, since #2279 made the elimination divide exactly. This is the symbolic sibling of #2270.
What it should do.
Simplify each candidate pivot before choosing it, and pass over one that simplifies to 0. That alone gives the rank of 1 above.
A pivot like a or a d - b c can be 0 for some values, so the form holds only where it is not. That is either a condition to carry, as provided, or the place to decline. NaN is neither.
Found while building browser demos of the library (a matrix view).
Activity
Decide a symbolic pivot before choosing it (#2350)