Mercurial > hg > octave-lyh
annotate liboctave/SparseCmplxCHOL.h @ 15264:94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
* chol.cc (Fchol): New variable, force. Always pass natural
and force to SparseCHOL and SparseComplexCHOL constructors.
* SparsedbleCHOL.h, SparsedbleCHOL.cc (SparseCHOL::SparseCHOL):
New arg, force. Pass it to sparse_base_chol constructor.
* SparseCmplxCHOL.h, SparseCmplxCHOL.cc
(SparseComplexCHOL::SparseComplexCHOL): Likewise.
* sparse-base-chol.h (sparse_base_chol<>::sparse_base_chol_rep::init):
* sparse-base-chol.h, sparse-base-chol.cc
(sparse_base_chol<>::sparse_base_chol_rep::init): Replace nargout
argument with force. Check force, not nargout > 1.
* sparse-base-chol.h
(sparse_base_chol::sparse_base_chol_rep::sparse_base_chol_rep):
New arg, force. Pass it to init.
(sparse_base_chol::sparse_base_chol): New arg force. Pass it to rep
constructor.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 30 Aug 2012 16:57:24 -0400 |
parents | 460a3c6d8bf1 |
children |
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_complex_CHOL_h) | |
25 #define octave_sparse_complex_CHOL_h 1 | |
26 | |
27 #include "sparse-base-chol.h" | |
28 #include "dSparse.h" | |
29 #include "CSparse.h" | |
30 | |
31 class | |
6108 | 32 OCTAVE_API |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
33 SparseComplexCHOL : |
5506 | 34 public sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> |
35 { | |
36 public: | |
37 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
38 SparseComplexCHOL (void) : |
5506 | 39 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> () { } |
40 | |
15264
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
41 SparseComplexCHOL (const SparseComplexMatrix& a, bool natural = true, |
94cdf82d4a0c
don't overload meaning of info in Sparse Cholesky factorization functions
John W. Eaton <jwe@octave.org>
parents:
14846
diff
changeset
|
42 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<SparseComplexMatrix, Complex, SparseMatrix> (a, natural, force) { } |
5506 | 44 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
45 SparseComplexCHOL (const SparseComplexMatrix& 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
|
46 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
|
47 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> (a, info, natural, force) { } |
5506 | 48 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
49 SparseComplexCHOL (const SparseComplexCHOL& a) : |
5506 | 50 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> (a) { } |
51 | |
52 ~SparseComplexCHOL (void) { } | |
53 | |
54 SparseComplexCHOL& operator = (const SparseComplexCHOL& a) | |
55 { | |
56 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> :: |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
58 operator = (a); |
5506 | 59 |
60 return *this; | |
61 } | |
62 | |
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
|
63 SparseComplexMatrix chol_matrix (void) const { return R (); } |
5506 | 64 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
65 SparseComplexMatrix L (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
66 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
67 SparseMatrix>:: L (); } |
5506 | 68 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
69 SparseComplexMatrix R (void) const |
5506 | 70 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
71 SparseMatrix>:: R (); } |
5506 | 72 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
73 octave_idx_type P (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
74 { return sparse_base_chol<SparseComplexMatrix, Complex, |
5506 | 75 SparseMatrix>:: P (); } |
76 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
77 ColumnVector perm (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
78 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
79 SparseMatrix>:: perm (); } |
5506 | 80 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
81 SparseMatrix Q (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
82 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
83 SparseMatrix>:: Q (); } |
5506 | 84 |
85 double rcond (void) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
86 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
87 SparseMatrix>:: rcond (); } |
5506 | 88 |
89 // Compute the inverse of a matrix using the Cholesky factorization. | |
90 SparseComplexMatrix inverse (void) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
91 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
92 SparseMatrix>:: inverse (); } |
5506 | 93 }; |
94 | |
6108 | 95 SparseComplexMatrix OCTAVE_API chol2inv (const SparseComplexMatrix& r); |
5506 | 96 |
97 #endif |