Here is one way to compute the Reduced Row Echelon Form (RREF) of an augmented matrix in Python, without using numpy:
main.py735 chars25 lines
The rref
function takes a matrix in the form of a list of lists (each inner list representing a row), and returns the matrix in RREF form.
This implementation of Gaussian Elimination algorithm uses partial pivoting to find the maximum coefficient in the column as the pivot for the elimination. Then, it performs the elimination to arrive at the RREF form.
gistlibby LogSnag