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