Mercurial > octave-nkf
annotate liboctave/SparsedbleCHOL.h @ 11542:695141f1c05c ss-3-3-55
snapshot 3.3.55
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 15 Jan 2011 04:53:04 -0500 |
parents | fd0a3ac60b0e |
children | 12df7854fa7c |
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 | |
38 SparseCHOL (const SparseMatrix& a, bool natural = true) : | |
39 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, natural) { } | |
40 | |
41 SparseCHOL (const SparseMatrix& a, octave_idx_type& info, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
42 bool natural = true) : |
5506 | 43 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, info, natural) { } |
44 | |
45 SparseCHOL (const SparseCHOL& a) : | |
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 | |
60 SparseMatrix L (void) const | |
61 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: L (); } | |
62 | |
63 SparseMatrix R (void) const | |
64 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: R (); } | |
65 | |
66 octave_idx_type P (void) const | |
67 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: P (); } | |
68 | |
69 ColumnVector perm (void) const | |
70 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: perm (); } | |
71 | |
72 SparseMatrix Q (void) const | |
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 | |
80 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: | |
81 inverse (); } | |
82 }; | |
83 | |
6108 | 84 SparseMatrix OCTAVE_API chol2inv (const SparseMatrix& r); |
5506 | 85 |
86 #endif |