Mercurial > hg > octave-nkf
annotate liboctave/SparseCmplxCHOL.h @ 15161:ad9523348676 gui
Make resource_manager a singleton with Octave conventions
* resource-manager.cc (resource_manager::instance_ok): New function.
* resource-manager.h (resource_manager::instance): Call instance_ok.
(resource_manager::instance_ok, resource_manager::cleanup_instance):
New functions.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sun, 12 Aug 2012 14:36:23 -0400 |
parents | 460a3c6d8bf1 |
children | 94cdf82d4a0c |
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 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
41 SparseComplexCHOL (const SparseComplexMatrix& a, bool natural = true) : |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
42 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
5506 | 43 (a, natural) { } |
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, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
46 bool natural = true) : |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
47 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
5506 | 48 (a, info, natural) { } |
49 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
50 SparseComplexCHOL (const SparseComplexCHOL& a) : |
5506 | 51 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> (a) { } |
52 | |
53 ~SparseComplexCHOL (void) { } | |
54 | |
55 SparseComplexCHOL& operator = (const SparseComplexCHOL& a) | |
56 { | |
57 if (this != &a) | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
58 sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> :: |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
59 operator = (a); |
5506 | 60 |
61 return *this; | |
62 } | |
63 | |
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
|
64 SparseComplexMatrix chol_matrix (void) const { return R (); } |
5506 | 65 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
66 SparseComplexMatrix L (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
67 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
68 SparseMatrix>:: L (); } |
5506 | 69 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
70 SparseComplexMatrix R (void) const |
5506 | 71 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
72 SparseMatrix>:: R (); } |
5506 | 73 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
74 octave_idx_type P (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
75 { return sparse_base_chol<SparseComplexMatrix, Complex, |
5506 | 76 SparseMatrix>:: P (); } |
77 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
78 ColumnVector perm (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
79 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
80 SparseMatrix>:: perm (); } |
5506 | 81 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
82 SparseMatrix Q (void) const |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
83 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
84 SparseMatrix>:: Q (); } |
5506 | 85 |
86 double rcond (void) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
87 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
88 SparseMatrix>:: rcond (); } |
5506 | 89 |
90 // Compute the inverse of a matrix using the Cholesky factorization. | |
91 SparseComplexMatrix inverse (void) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
92 { return sparse_base_chol<SparseComplexMatrix, Complex, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
93 SparseMatrix>:: inverse (); } |
5506 | 94 }; |
95 | |
6108 | 96 SparseComplexMatrix OCTAVE_API chol2inv (const SparseComplexMatrix& r); |
5506 | 97 |
98 #endif |