finite fields and gaussian elimination



An alternative (using 5.12.0):

(%i1) modulus : 2$
(%i2) m : matrix([1,2,3],[4,5,6],[7,8,10])$
(%i3) lu_factor(m,crering);
(%o3) [matrix([1,0,1],[0,1,0],[1,0,1]),[1,2,3],crering]
(%i4) get_lu_factors(%);
(%o4)
[matrix([1,0,0],[0,1,0],[0,0,1]),matrix([1,0,0],[0,1,0],[1,0,1]),matrix([1,0,1],[0,1,0],[0,0,1])]

(%i5) %[1] . %[2] . %[3];
(%o5) matrix([1,0,1],[0,1,0],[1,0,0])
(%i6) rat(m);
(%o6) matrix([1,0,1],[0,1,0],[1,0,0])
(%i7) b : matrix([2],[5],[9])$
(%i8) linsolve_by_lu(m, b);
(%o8) [matrix([1],[-1],[1]),false]
(%i9) m.first(%) - b;
(%o9) matrix([0],[0],[0])

Barton