Mercurial > hg > octave-nkf
annotate liboctave/SparsedbleCHOL.h @ 14101:ff5588774680 stable ss-3-5-91
snapshot 3.5.91
* configure.ac (AC_INIT): Version is now 3.5.91.
(OCTAVE_RELEASE_DATE): Now 2011-12-23.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 23 Dec 2011 19:24:41 -0500 |
parents | 12df7854fa7c |
children | 72c96de7a403 |
rev | line source |
---|---|
5506 | 1 /* |
2 | |
11523 | 3 Copyright (C) 2005-2011 David Bateman |
4 Copyright (C) 1998-2005 Andy Adler | |
7016 | 5 |
6 This file is part of Octave. | |
5506 | 7 |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5506 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5506 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_sparse_CHOL_h) | |
25 #define octave_sparse_CHOL_h 1 | |
26 | |
27 #include "sparse-base-chol.h" | |
28 #include "dSparse.h" | |
29 | |
30 class | |
6108 | 31 OCTAVE_API |
5506 | 32 SparseCHOL : public sparse_base_chol <SparseMatrix, double, SparseMatrix> |
33 { | |
34 public: | |
35 | |
36 SparseCHOL (void) : sparse_base_chol<SparseMatrix, double, SparseMatrix> () { } | |
37 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
38 SparseCHOL (const SparseMatrix& a, bool natural = true) : |
5506 | 39 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, natural) { } |
40 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
41 SparseCHOL (const SparseMatrix& a, octave_idx_type& info, |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
42 bool natural = true) : |
5506 | 43 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, info, natural) { } |
44 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 SparseCHOL (const SparseCHOL& a) : |
5506 | 46 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a) { } |
47 | |
48 ~SparseCHOL (void) { } | |
49 | |
50 SparseCHOL& operator = (const SparseCHOL& a) | |
51 { | |
52 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
53 sparse_base_chol <SparseMatrix, double, SparseMatrix> :: operator = (a); |
5506 | 54 |
55 return *this; | |
56 } | |
57 | |
58 SparseMatrix chol_matrix (void) const { return R(); } | |
59 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
60 SparseMatrix L (void) const |
5506 | 61 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: L (); } |
62 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
63 SparseMatrix R (void) const |
5506 | 64 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: R (); } |
65 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
66 octave_idx_type P (void) const |
5506 | 67 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: P (); } |
68 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
69 ColumnVector perm (void) const |
5506 | 70 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: perm (); } |
71 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
72 SparseMatrix Q (void) const |
5506 | 73 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: Q (); } |
74 | |
75 double rcond (void) const | |
76 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: rcond (); } | |
77 | |
78 // Compute the inverse of a matrix using the Cholesky factorization. | |
79 SparseMatrix inverse (void) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
80 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: |
5506 | 81 inverse (); } |
82 }; | |
83 | |
6108 | 84 SparseMatrix OCTAVE_API chol2inv (const SparseMatrix& r); |
5506 | 85 |
86 #endif |