]> gitweb.factorcode.org Git - factor.git/blob - basis/math/matrices/elimination/elimination-docs.factor
Docs: fixed doc example errors triggered by help-lint and added with-disposal where...
[factor.git] / basis / math / matrices / elimination / elimination-docs.factor
1 USING: help.markup help.syntax math sequences ;
2
3 IN: math.matrices.elimination
4
5 HELP: inverse
6 { $values { "matrix" sequence } }
7 { $description "Computes the multiplicative inverse of a matrix. Assuming the matrix is invertible." }
8 { $examples
9   "A matrix multiplied by its inverse is the identity matrix."
10   { $example
11     "USING: kernel math.matrices math.matrices.elimination prettyprint ;"
12     "{ { 3 4 } { 7 9 } } dup inverse m. 2 identity-matrix = ."
13     "t"
14   }
15 } ;
16
17 HELP: echelon
18 { $values { "matrix" sequence } { "matrix'" sequence } }
19 { $description "Computes the reduced row-echelon form of the matrix." } ;
20
21 HELP: nonzero-rows
22 { $values { "matrix" sequence } { "matrix'" sequence } }
23 { $description "Removes all all-zero rows from the matrix" }
24 { $examples
25   { $example
26     "USING: math.matrices.elimination prettyprint ;"
27     "{ { 0 0 } { 5 6 } { 0 0 } { 4 0 } } nonzero-rows ."
28     "{ { 5 6 } { 4 0 } }"
29   }
30 } ;
31
32 HELP: leading
33 { $values
34   { "seq" sequence }
35   { "n" "the index of the first match, or " { $snippet f } "." }
36   { "elt" "the first non-zero element, or " { $snippet f } "." }
37 }
38 { $description "Find the first non-zero element of a sequence." } ;