Mercurial > octave-nkf
annotate doc/interpreter/linalg.txi @ 19630:0e1f5a750d00
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Jan 2015 10:24:46 -0500 |
parents | 0f9c5a15c8fa 446c46af4b42 |
children | 4197fc428c7d |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17500
diff
changeset
|
1 @c Copyright (C) 1996-2013 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. | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18406
diff
changeset
|
9 @c |
7018 | 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. | |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18406
diff
changeset
|
14 @c |
7018 | 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 |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
21 @cindex linear algebra |
3294 | 22 |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
23 This chapter documents the linear algebra functions provided in Octave. |
19074
0850b5212619
doc: Add @nospell macro around proper names in documentation.
Rik <rik@octave.org>
parents:
18938
diff
changeset
|
24 Reference material for many of these functions may be found in |
0850b5212619
doc: Add @nospell macro around proper names in documentation.
Rik <rik@octave.org>
parents:
18938
diff
changeset
|
25 @nospell{Golub and Van Loan}, @cite{Matrix Computations, 2nd Ed.}, |
0850b5212619
doc: Add @nospell macro around proper names in documentation.
Rik <rik@octave.org>
parents:
18938
diff
changeset
|
26 Johns Hopkins, 1989, and in the @cite{@sc{lapack} Users' Guide}, SIAM, 1992. |
0850b5212619
doc: Add @nospell macro around proper names in documentation.
Rik <rik@octave.org>
parents:
18938
diff
changeset
|
27 The @cite{@sc{lapack} Users' Guide} is available at: |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
28 @cite{http://www.netlib.org/lapack/lug/} |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
29 |
18855
e275d15c27b5
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
18854
diff
changeset
|
30 A common text for engineering courses is @nospell{G. Strang}, |
e275d15c27b5
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
18854
diff
changeset
|
31 @cite{Linear Algebra and Its Applications, 4th Edition}. It has become a |
19186
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
19099
diff
changeset
|
32 widespread reference for linear algebra. An alternative is P. Lax |
18855
e275d15c27b5
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
18854
diff
changeset
|
33 @cite{Linear Algebra and Its Applications}, and also is a good choice. It |
e275d15c27b5
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
18854
diff
changeset
|
34 claims to be suitable for high school students with substantial mathematical |
e275d15c27b5
doc: Periodic spellcheck of documentation.
Rik <rik@octave.org>
parents:
18854
diff
changeset
|
35 interests as well as first-year undergraduates. |
3294 | 36 |
37 @menu | |
11255
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
10828
diff
changeset
|
38 * Techniques Used for Linear Algebra:: |
17152
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
39 * Basic Matrix Functions:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
40 * Matrix Factorizations:: |
f2a8592b8fbd
doc: Shorten some long subsection names in Manual.
Rik <rik@octave.org>
parents:
14138
diff
changeset
|
41 * Functions of a Matrix:: |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
42 * Specialized Solvers:: |
3294 | 43 @end menu |
44 | |
11255
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
10828
diff
changeset
|
45 @node Techniques Used for Linear Algebra |
d682cd6669ac
Update info-based documentation menus to include new nodes.
Rik <octave@nomad.inbox5.com>
parents:
10828
diff
changeset
|
46 @section Techniques Used for Linear Algebra |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
47 @cindex linear algebra, techniques |
6531 | 48 |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
49 Octave includes a polymorphic solver that selects an appropriate matrix |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
50 factorization depending on the properties of the matrix itself. |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
51 Generally, the cost of determining the matrix type is small relative to |
18854
19a140e93b1f
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18406
diff
changeset
|
52 the cost of factorizing the matrix itself. In any case the matrix type |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
53 is cached once it is calculated so that it is not re-determined each |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
54 time it is used in a linear equation. |
6531 | 55 |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
56 The selection tree for how the linear equation is solved or a matrix |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
57 inverse is formed is given by: |
6531 | 58 |
59 @enumerate 1 | |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
60 @item If the matrix is upper or lower triangular sparse use a forward or |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9065
diff
changeset
|
61 backward substitution using the @sc{lapack} xTRTRS function, and goto 4. |
6531 | 62 |
63 @c Permuted triangular matrices currently disabled in the code | |
64 @c | |
65 @c @item If the matrix is a upper triangular matrix with column permutations | |
66 @c or lower triangular matrix with row permutations, perform a forward or | |
67 @c backward substitution, and goto 5. | |
68 | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
9709
diff
changeset
|
69 @item If the matrix is square, Hermitian with a real positive diagonal, |
11593
1577c6f80926
Use non-breaking spaces between certain adjectives and their nouns in docstrings.
Rik <octave@nomad.inbox5.com>
parents:
11533
diff
changeset
|
70 attempt Cholesky@tie{}factorization using the @sc{lapack} xPOTRF function. |
6531 | 71 |
11593
1577c6f80926
Use non-breaking spaces between certain adjectives and their nouns in docstrings.
Rik <octave@nomad.inbox5.com>
parents:
11533
diff
changeset
|
72 @item If the Cholesky@tie{}factorization failed or the matrix is not |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18406
diff
changeset
|
73 Hermitian with a real positive diagonal, and the matrix is square, factorize |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9065
diff
changeset
|
74 using the @sc{lapack} xGETRF function. |
6531 | 75 |
9065
8207b833557f
Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
76 @item If the matrix is not square, or any of the previous solvers flags |
6531 | 77 a singular or near singular matrix, find a least squares solution using |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9065
diff
changeset
|
78 the @sc{lapack} xGELSD function. |
6531 | 79 @end enumerate |
80 | |
81 The user can force the type of the matrix with the @code{matrix_type} | |
9065
8207b833557f
Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
82 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
|
83 However, it should be noted that identifying the type of the matrix incorrectly |
6531 | 84 will lead to unpredictable results, and so @code{matrix_type} should be |
85 used with care. | |
86 | |
87 It should be noted that the test for whether a matrix is a candidate for | |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
88 Cholesky@tie{}factorization, performed above, and by the @code{matrix_type} |
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
89 function, does not make certain that the matrix is |
9065
8207b833557f
Cleanup documentation for arith.texi, linalg.texi, nonlin.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
90 Hermitian. However, the attempt to factorize the matrix will quickly |
18406
a4b4cf4c6ece
doc: update linear algebra chapter
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
18330
diff
changeset
|
91 detect a non-Hermitian matrix. |
6531 | 92 |
4167 | 93 @node Basic Matrix Functions |
3294 | 94 @section Basic Matrix Functions |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
95 @cindex matrix functions, basic |
3294 | 96 |
3373 | 97 @DOCSTRING(balance) |
3294 | 98 |
18938
9addb5ad9426
bandwidth.m: Add new function.
Massimiliano Fasi <massimiliano.fasi@gmail.com>
parents:
18855
diff
changeset
|
99 @DOCSTRING(bandwidth) |
9addb5ad9426
bandwidth.m: Add new function.
Massimiliano Fasi <massimiliano.fasi@gmail.com>
parents:
18855
diff
changeset
|
100 |
3373 | 101 @DOCSTRING(cond) |
3294 | 102 |
3373 | 103 @DOCSTRING(det) |
3294 | 104 |
3373 | 105 @DOCSTRING(eig) |
3294 | 106 |
3373 | 107 @DOCSTRING(givens) |
3294 | 108 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
109 @DOCSTRING(planerot) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
110 |
3373 | 111 @DOCSTRING(inv) |
3294 | 112 |
17500
b66f068e4468
linsolve.m: Use Octave coding conventions.
Rik <rik@octave.org>
parents:
17152
diff
changeset
|
113 @DOCSTRING(linsolve) |
b66f068e4468
linsolve.m: Use Octave coding conventions.
Rik <rik@octave.org>
parents:
17152
diff
changeset
|
114 |
6531 | 115 @DOCSTRING(matrix_type) |
116 | |
3373 | 117 @DOCSTRING(norm) |
3294 | 118 |
3373 | 119 @DOCSTRING(null) |
3294 | 120 |
3373 | 121 @DOCSTRING(orth) |
3294 | 122 |
12509
e742720c5e71
Add mgorth and gmres functions from Octave Forge
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12188
diff
changeset
|
123 @DOCSTRING(mgorth) |
e742720c5e71
Add mgorth and gmres functions from Octave Forge
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12188
diff
changeset
|
124 |
3373 | 125 @DOCSTRING(pinv) |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
126 @cindex pseudoinverse |
3294 | 127 |
3373 | 128 @DOCSTRING(rank) |
3294 | 129 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
130 @DOCSTRING(rcond) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
131 |
3373 | 132 @DOCSTRING(trace) |
3294 | 133 |
6502 | 134 @DOCSTRING(rref) |
135 | |
4167 | 136 @node Matrix Factorizations |
3294 | 137 @section Matrix Factorizations |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
138 @cindex matrix factorizations |
3294 | 139 |
3373 | 140 @DOCSTRING(chol) |
3294 | 141 |
6502 | 142 @DOCSTRING(cholinv) |
143 | |
144 @DOCSTRING(chol2inv) | |
145 | |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
146 @DOCSTRING(cholupdate) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
147 |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
148 @DOCSTRING(cholinsert) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
149 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
150 @DOCSTRING(choldelete) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
151 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
152 @DOCSTRING(cholshift) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
153 |
3373 | 154 @DOCSTRING(hess) |
3294 | 155 |
3373 | 156 @DOCSTRING(lu) |
3294 | 157 |
9709 | 158 @DOCSTRING(luupdate) |
159 | |
3373 | 160 @DOCSTRING(qr) |
3294 | 161 |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
162 @DOCSTRING(qrupdate) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
163 |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
164 @DOCSTRING(qrinsert) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
165 |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
166 @DOCSTRING(qrdelete) |
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7072
diff
changeset
|
167 |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
168 @DOCSTRING(qrshift) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
169 |
3373 | 170 @DOCSTRING(qz) |
3372 | 171 |
3373 | 172 @DOCSTRING(qzhess) |
3294 | 173 |
3373 | 174 @DOCSTRING(schur) |
3294 | 175 |
12188
1e206c8713a7
Add function rsf2csf to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11593
diff
changeset
|
176 @DOCSTRING(rsf2csf) |
1e206c8713a7
Add function rsf2csf to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11593
diff
changeset
|
177 |
7984
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
178 @DOCSTRING(subspace) |
bbaa5d7d0143
Some documentation updates
David Bateman <dbateman@free.fr>
parents:
7638
diff
changeset
|
179 |
3373 | 180 @DOCSTRING(svd) |
3294 | 181 |
11533
06c80c90a246
Add undocumented function svd_driver to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
182 @DOCSTRING(svd_driver) |
06c80c90a246
Add undocumented function svd_driver to documentation.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
183 |
5775 | 184 @c FIXME -- should there be a new section here? |
3428 | 185 |
186 @DOCSTRING(housh) | |
187 | |
188 @DOCSTRING(krylov) | |
189 | |
4167 | 190 @node Functions of a Matrix |
3294 | 191 @section Functions of a Matrix |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
192 @cindex matrix, functions of |
3294 | 193 |
3373 | 194 @DOCSTRING(expm) |
3294 | 195 |
3373 | 196 @DOCSTRING(logm) |
3294 | 197 |
3373 | 198 @DOCSTRING(sqrtm) |
3294 | 199 |
3373 | 200 @DOCSTRING(kron) |
3294 | 201 |
12572
dffd30f12752
Add blkmm function to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12520
diff
changeset
|
202 @DOCSTRING(blkmm) |
dffd30f12752
Add blkmm function to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12520
diff
changeset
|
203 |
19099
d20c81d3cd21
Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
19074
diff
changeset
|
204 @DOCSTRING(sylvester) |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
205 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
206 @node Specialized Solvers |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
207 @section Specialized Solvers |
18330
200851c87444
Edits to Manual and indicies
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17744
diff
changeset
|
208 @cindex matrix, specialized solvers |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
209 |
13021
d55d396a9a55
Add an implementation of the biconjugate gradient iterative method
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12572
diff
changeset
|
210 @DOCSTRING(bicg) |
d55d396a9a55
Add an implementation of the biconjugate gradient iterative method
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12572
diff
changeset
|
211 |
8817
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
212 @DOCSTRING(bicgstab) |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
213 |
03b7f618ab3d
include docstrings for new functions in the manual
John W. Eaton <jwe@octave.org>
parents:
8488
diff
changeset
|
214 @DOCSTRING(cgs) |
12509
e742720c5e71
Add mgorth and gmres functions from Octave Forge
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12188
diff
changeset
|
215 |
e742720c5e71
Add mgorth and gmres functions from Octave Forge
Carlo de Falco <kingcrimson@tiscali.it>
parents:
12188
diff
changeset
|
216 @DOCSTRING(gmres) |
18854
19a140e93b1f
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18406
diff
changeset
|
217 |