Mercurial > octave-nkf
annotate doc/interpreter/linalg.txi @ 8817:03b7f618ab3d
include docstrings for new functions in the manual
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 19 Feb 2009 15:39:19 -0500 |
parents | cdb4788879b3 |
children | eb63fbe60fab |
rev | line source |
---|---|
6778 | 1 @c Copyright (C) 1996, 1997, 2007 John W. Eaton |
7018 | 2 @c |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
3294 | 18 |
4167 | 19 @node Linear Algebra |
3294 | 20 @chapter Linear Algebra |
21 | |
22 This chapter documents the linear algebra functions of Octave. | |
23 Reference material for many of these functions may be found in | |
24 Golub and Van Loan, @cite{Matrix Computations, 2nd Ed.}, Johns Hopkins, | |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
7984
diff
changeset
|
25 1989, and in the @cite{@sc{Lapack} Users' Guide}, SIAM, 1992. |
3294 | 26 |
27 @menu | |
6531 | 28 * Techniques used for Linear Algebra:: |
3294 | 29 * Basic Matrix Functions:: |
30 * Matrix Factorizations:: | |
31 * Functions of a Matrix:: | |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
32 * Specialized Solvers:: |
3294 | 33 @end menu |
34 | |
6531 | 35 @node Techniques used for Linear Algebra |
36 @section Techniques used for Linear Algebra | |
37 | |
8488
cdb4788879b3
[docs] poly-morphic => polymorphic
Brian Gough <bjg@gnu.org>
parents:
8347
diff
changeset
|
38 Octave includes a polymorphic solver, that selects an appropriate |
6531 | 39 matrix factorization depending on the properties of the matrix itself. |
40 Generally, the cost of determining the matrix type is small relative to | |
41 the cost of factorizing the matrix itself, but in any case the matrix | |
42 type is cached once it is calculated, so that it is not re-determined | |
43 each time it is used in a linear equation. | |
44 | |
45 The selection tree for how the linear equation is solve or a matrix | |
46 inverse is form is given by | |
47 | |
48 @enumerate 1 | |
49 @item If the matrix is upper or lower triangular sparse a forward or | |
6939 | 50 backward substitution using the @sc{Lapack} xTRTRS function, and goto 4. |
6531 | 51 |
52 @c Permuted triangular matrices currently disabled in the code | |
53 @c | |
54 @c @item If the matrix is a upper triangular matrix with column permutations | |
55 @c or lower triangular matrix with row permutations, perform a forward or | |
56 @c backward substitution, and goto 5. | |
57 | |
58 @item If the matrix is square, hermitian with a real positive diagonal, | |
59 attempt Cholesky factorization using the @sc{Lapack} xPOTRF function. | |
60 | |
61 @item If the Cholesky factorization failed or the matrix is not | |
62 hermitian with a real positive diagonal, and the matrix is square, factorize | |
63 using the @sc{Lapack} xGETRF function. | |
64 | |
65 @item If the matrix is not square, or any of the previous solvers flags | |
66 a singular or near singular matrix, find a least squares solution using | |
7072 | 67 the @sc{Lapack} xGELSD function. |
6531 | 68 @end enumerate |
69 | |
70 The user can force the type of the matrix with the @code{matrix_type} | |
71 function. This overcomes the cost of discovering the type of the matrix. | |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
7984
diff
changeset
|
72 However, it should be noted that identifying the type of the matrix incorrectly |
6531 | 73 will lead to unpredictable results, and so @code{matrix_type} should be |
74 used with care. | |
75 | |
76 It should be noted that the test for whether a matrix is a candidate for | |
77 Cholesky factorization, performed above and by the @code{matrix_type} | |
78 function, does not give a certainty that the matrix is | |
79 Hermitian. However, the attempt to factorize the matrix will quickly | |
80 flag a non-Hermitian matrix. | |
81 | |
4167 | 82 @node Basic Matrix Functions |
3294 | 83 @section Basic Matrix Functions |
84 | |
3373 | 85 @DOCSTRING(balance) |
3294 | 86 |
3373 | 87 @DOCSTRING(cond) |
3294 | 88 |
3373 | 89 @DOCSTRING(det) |
3294 | 90 |
3428 | 91 @DOCSTRING(dmult) |
92 | |
93 @DOCSTRING(dot) | |
94 | |
3373 | 95 @DOCSTRING(eig) |
3294 | 96 |
3373 | 97 @DOCSTRING(givens) |
3294 | 98 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
99 @DOCSTRING(planerot) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
100 |
3373 | 101 @DOCSTRING(inv) |
3294 | 102 |
6531 | 103 @DOCSTRING(matrix_type) |
104 | |
3373 | 105 @DOCSTRING(norm) |
3294 | 106 |
3373 | 107 @DOCSTRING(null) |
3294 | 108 |
3373 | 109 @DOCSTRING(orth) |
3294 | 110 |
3373 | 111 @DOCSTRING(pinv) |
3294 | 112 |
3373 | 113 @DOCSTRING(rank) |
3294 | 114 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
115 @DOCSTRING(rcond) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
116 |
3373 | 117 @DOCSTRING(trace) |
3294 | 118 |
6502 | 119 @DOCSTRING(rref) |
120 | |
4167 | 121 @node Matrix Factorizations |
3294 | 122 @section Matrix Factorizations |
123 | |
3373 | 124 @DOCSTRING(chol) |
3294 | 125 |
6502 | 126 @DOCSTRING(cholinv) |
127 | |
128 @DOCSTRING(chol2inv) | |
129 | |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
130 @DOCSTRING(cholupdate) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
131 |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
132 @DOCSTRING(cholinsert) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
133 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
134 @DOCSTRING(choldelete) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
135 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
136 @DOCSTRING(cholshift) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
137 |
3373 | 138 @DOCSTRING(hess) |
3294 | 139 |
3373 | 140 @DOCSTRING(lu) |
3294 | 141 |
3373 | 142 @DOCSTRING(qr) |
3294 | 143 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
144 @DOCSTRING(qrupdate) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
145 |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
146 @DOCSTRING(qrinsert) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
147 |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
148 @DOCSTRING(qrdelete) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
149 |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
150 @DOCSTRING(qrshift) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
151 |
3373 | 152 @DOCSTRING(qz) |
3372 | 153 |
3373 | 154 @DOCSTRING(qzhess) |
3294 | 155 |
3373 | 156 @DOCSTRING(schur) |
3294 | 157 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
158 @DOCSTRING(subspace) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
159 |
3373 | 160 @DOCSTRING(svd) |
3294 | 161 |
5775 | 162 @c FIXME -- should there be a new section here? |
3428 | 163 |
164 @DOCSTRING(housh) | |
165 | |
166 @DOCSTRING(krylov) | |
167 | |
4167 | 168 @node Functions of a Matrix |
3294 | 169 @section Functions of a Matrix |
170 | |
3373 | 171 @DOCSTRING(expm) |
3294 | 172 |
3373 | 173 @DOCSTRING(logm) |
3294 | 174 |
3373 | 175 @DOCSTRING(sqrtm) |
3294 | 176 |
3373 | 177 @DOCSTRING(kron) |
3294 | 178 |
3373 | 179 @DOCSTRING(syl) |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
180 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
181 @node Specialized Solvers |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
182 @section Specialized Solvers |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
183 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
184 @DOCSTRING(bicgstab) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
185 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
186 @DOCSTRING(cgs) |