]> gitweb.factorcode.org Git - factor.git/blob - extra/math/matrices/elimination/elimination-docs.factor
factor: trim using lists
[factor.git] / extra / math / matrices / elimination / elimination-docs.factor
1 USING: help.markup help.syntax 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 prettyprint ;"
12     "FROM: math.matrices.elimination => inverse ;"
13     "{ { 3 4 } { 7 9 } } dup inverse mdot 2 <identity-matrix> = ."
14     "t"
15   }
16 } ;
17
18 HELP: echelon
19 { $values { "matrix" sequence } { "matrix'" sequence } }
20 { $description "Computes the reduced row-echelon form of the matrix." } ;
21
22 HELP: nonzero-rows
23 { $values { "matrix" sequence } { "matrix'" sequence } }
24 { $description "Removes all all-zero rows from the matrix" }
25 { $examples
26   { $example
27     "USING: math.matrices.elimination prettyprint ;"
28     "{ { 0 0 } { 5 6 } { 0 0 } { 4 0 } } nonzero-rows ."
29     "{ { 5 6 } { 4 0 } }"
30   }
31 } ;
32
33 HELP: leading
34 { $values
35   { "seq" sequence }
36   { "n" "the index of the first match, or " { $link f } "." }
37   { "elt" "the first non-zero element, or " { $link f } "." }
38 }
39 { $description "Find the first non-zero element of a sequence." } ;