1 USING: help.markup help.syntax math sequences ;
3 IN: math.matrices.elimination
6 { $values { "matrix" sequence } }
7 { $description "Computes the multiplicative inverse of a matrix. Assuming the matrix is invertible." }
9 "A matrix multiplied by its inverse is the identity matrix."
11 "USING: kernel math.matrices math.matrices.elimination prettyprint ;"
12 "{ { 3 4 } { 7 9 } } dup inverse m. 2 identity-matrix = ."
18 { $values { "matrix" sequence } { "matrix'" sequence } }
19 { $description "Computes the reduced row-echelon form of the matrix." } ;
22 { $values { "matrix" sequence } { "matrix'" sequence } }
23 { $description "Removes all all-zero rows from the matrix" }
26 "USING: math.matrices.elimination prettyprint ;"
27 "{ { 0 0 } { 5 6 } { 0 0 } { 4 0 } } nonzero-rows ."
35 { "n" "the index of the first match, or " { $snippet f } "." }
36 { "elt" "the first non-zero element, or " { $snippet f } "." }
38 { $description "Find the first non-zero element of a sequence." } ;