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 |
|
31 SparseComplexCHOL : |
|
32 public sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> |
|
33 { |
|
34 public: |
|
35 |
|
36 SparseComplexCHOL (void) : |
|
37 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> () { } |
|
38 |
|
39 SparseComplexCHOL (const SparseComplexMatrix& a, bool natural = true) : |
|
40 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
|
41 (a, natural) { } |
|
42 |
|
43 SparseComplexCHOL (const SparseComplexMatrix& a, octave_idx_type& info, |
|
44 bool natural = true) : |
|
45 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> |
|
46 (a, info, natural) { } |
|
47 |
|
48 SparseComplexCHOL (const SparseComplexCHOL& a) : |
|
49 sparse_base_chol<SparseComplexMatrix, Complex, SparseMatrix> (a) { } |
|
50 |
|
51 ~SparseComplexCHOL (void) { } |
|
52 |
|
53 SparseComplexCHOL& operator = (const SparseComplexCHOL& a) |
|
54 { |
|
55 if (this != &a) |
|
56 sparse_base_chol <SparseComplexMatrix, Complex, SparseMatrix> :: |
|
57 operator = (a); |
|
58 |
|
59 return *this; |
|
60 } |
|
61 |
|
62 SparseComplexMatrix chol_matrix (void) const { return R(); } |
|
63 |
|
64 SparseComplexMatrix L (void) const |
|
65 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
66 SparseMatrix>:: L (); } |
|
67 |
|
68 SparseComplexMatrix R (void) const |
|
69 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
70 SparseMatrix>:: R (); } |
|
71 |
|
72 octave_idx_type P (void) const |
|
73 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
74 SparseMatrix>:: P (); } |
|
75 |
|
76 ColumnVector perm (void) const |
|
77 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
78 SparseMatrix>:: perm (); } |
|
79 |
|
80 SparseMatrix Q (void) const |
|
81 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
82 SparseMatrix>:: Q (); } |
|
83 |
|
84 double rcond (void) const |
|
85 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
86 SparseMatrix>:: rcond (); } |
|
87 |
|
88 // Compute the inverse of a matrix using the Cholesky factorization. |
|
89 SparseComplexMatrix inverse (void) const |
|
90 { return sparse_base_chol<SparseComplexMatrix, Complex, |
|
91 SparseMatrix>:: inverse (); } |
|
92 }; |
|
93 |
|
94 SparseComplexMatrix chol2inv (const SparseComplexMatrix& r); |
|
95 |
|
96 #endif |
|
97 |
|
98 /* |
|
99 ;;; Local Variables: *** |
|
100 ;;; mode: C++ *** |
|
101 ;;; End: *** |
|
102 */ |