There used to be a rref
function to put a matrix in reduced row echelon form, but it is not available anymore.
Is it in some package, or has it been renamed?
https://github.com/blegat/RowEchelon.jl seems to be what you need
Thanks, that works. Also thanks to B. Legat from Belgium who saved rref
from the ongoing slimming of Base.
This code does not work properly under all situations. DO NOT reply on it. I have tested it against Mathematica and with back substitution and it fails occasionally.
This is a pretty old thread but such a comment is probably better suited as an issue on the associated repo, showing actual cases where the package computes the wrong result. I doubt much will be fixed without an actual example
rref form without partial pivoting is well known to be numerically unstable — you can easily contrive cases where roundoff errors blow up (for inexact arithmetic, e.g. standard floating-point arithmetic). (The RowEchelon.jl documentation acknowledges that it’s “sensitive to numerical imprecision”.) rref form is really only useful for pedagogy in comparison to hand calculations for simple cases.
Never use rref form for “serious” numerical calculations — that’s why it’s not included in the LinearAlgebra standard library or in similar libraries (numpy, LAPACK, …). Use LU and other factorizations instead.
On the other hand, if the exact rref is necessary, AFAIK AbstractAlgebra.jl and/or Nemo.jl provide such functionality.