Mercurial > hg > octave-nkf
annotate liboctave/numeric/SparsedbleCHOL.h @ 17296:3a9efb68272d ss-3-7-6
snapshot 3.7.6
* configure.ac (OCTAVE_VERSION): Bump to 3.7.6.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Aug 2013 15:17:54 -0400 |
parents | 648dabbb4c6b |
children | d63878346099 |
rev | line source |
---|---|
5506 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
3 Copyright (C) 2005-2012 David Bateman |
11523 | 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 | |
15264
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
38 SparseCHOL (const SparseMatrix& a, bool natural = true, bool force = false) : |
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
39 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, natural, force) { } |
5506 | 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, |
15264
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
42 bool natural = false, bool force = false) : |
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
43 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, info, natural, force) { } |
5506 | 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 | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
58 SparseMatrix chol_matrix (void) const { return R (); } |
5506 | 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 |