5506
|
1 /* |
|
2 |
|
3 Copyright (C) 2005 David Bateman |
|
4 Copyright (C) 1998-2005 Andy Adler |
|
5 |
|
6 Octave is free software; you can redistribute it and/or modify it |
|
7 under the terms of the GNU General Public License as published by the |
|
8 Free Software Foundation; either version 2, or (at your option) any |
|
9 later version. |
|
10 |
|
11 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 for more details. |
|
15 |
|
16 You should have received a copy of the GNU General Public License |
|
17 along with this program; see the file COPYING. If not, write to the |
|
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
19 Boston, MA 02110-1301, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_sparse_complex_CHOL_h) |
|
24 #define octave_sparse_complex_CHOL_h 1 |
|
25 |
|
26 #include "sparse-base-chol.h" |
|
27 #include "dSparse.h" |
|
28 #include "CSparse.h" |
|
29 |
|
30 class |
6108
|
31 OCTAVE_API |
5506
|
32 SparseComplexCHOL : |
|
33 public sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> |
|
34 { |
|
35 public: |
|
36 |
|
37 SparseComplexCHOL (void) : |
|
38 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> () { } |
|
39 |
|
40 SparseComplexCHOL (const SparseComplexMatrix& a, bool natural = true) : |
|
41 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
|
42 (a, natural) { } |
|
43 |
|
44 SparseComplexCHOL (const SparseComplexMatrix& a, octave_idx_type& info, |
|
45 bool natural = true) : |
|
46 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
|
47 (a, info, natural) { } |
|
48 |
|
49 SparseComplexCHOL (const SparseComplexCHOL& a) : |
|
50 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> (a) { } |
|
51 |
|
52 ~SparseComplexCHOL (void) { } |
|
53 |
|
54 SparseComplexCHOL& operator = (const SparseComplexCHOL& a) |
|
55 { |
|
56 if (this != &a) |
|
57 sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> :: |
|
58 operator = (a); |
|
59 |
|
60 return *this; |
|
61 } |
|
62 |
|
63 SparseComplexMatrix chol_matrix (void) const { return R(); } |
|
64 |
|
65 SparseComplexMatrix L (void) const |
|
66 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
67 SparseMatrix>:: L (); } |
|
68 |
|
69 SparseComplexMatrix R (void) const |
|
70 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
71 SparseMatrix>:: R (); } |
|
72 |
|
73 octave_idx_type P (void) const |
|
74 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
75 SparseMatrix>:: P (); } |
|
76 |
|
77 ColumnVector perm (void) const |
|
78 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
79 SparseMatrix>:: perm (); } |
|
80 |
|
81 SparseMatrix Q (void) const |
|
82 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
83 SparseMatrix>:: Q (); } |
|
84 |
|
85 double rcond (void) const |
|
86 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
87 SparseMatrix>:: rcond (); } |
|
88 |
|
89 // Compute the inverse of a matrix using the Cholesky factorization. |
|
90 SparseComplexMatrix inverse (void) const |
|
91 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
92 SparseMatrix>:: inverse (); } |
|
93 }; |
|
94 |
6108
|
95 SparseComplexMatrix OCTAVE_API chol2inv (const SparseComplexMatrix& r); |
5506
|
96 |
|
97 #endif |
|
98 |
|
99 /* |
|
100 ;;; Local Variables: *** |
|
101 ;;; mode: C++ *** |
|
102 ;;; End: *** |
|
103 */ |