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_CHOL_h) |
|
24 #define octave_sparse_CHOL_h 1 |
|
25 |
|
26 #include "sparse-base-chol.h" |
|
27 #include "dSparse.h" |
|
28 |
|
29 class |
|
30 SparseCHOL : public sparse_base_chol <SparseMatrix, double, SparseMatrix> |
|
31 { |
|
32 public: |
|
33 |
|
34 SparseCHOL (void) : sparse_base_chol<SparseMatrix, double, SparseMatrix> () { } |
|
35 |
|
36 SparseCHOL (const SparseMatrix& a, bool natural = true) : |
|
37 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, natural) { } |
|
38 |
|
39 SparseCHOL (const SparseMatrix& a, octave_idx_type& info, |
|
40 bool natural = true) : |
|
41 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a, info, natural) { } |
|
42 |
|
43 SparseCHOL (const SparseCHOL& a) : |
|
44 sparse_base_chol<SparseMatrix, double, SparseMatrix> (a) { } |
|
45 |
|
46 ~SparseCHOL (void) { } |
|
47 |
|
48 SparseCHOL& operator = (const SparseCHOL& a) |
|
49 { |
|
50 if (this != &a) |
|
51 sparse_base_chol <SparseMatrix, double, SparseMatrix> :: operator = (a); |
|
52 |
|
53 return *this; |
|
54 } |
|
55 |
|
56 SparseMatrix chol_matrix (void) const { return R(); } |
|
57 |
|
58 SparseMatrix L (void) const |
|
59 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: L (); } |
|
60 |
|
61 SparseMatrix R (void) const |
|
62 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: R (); } |
|
63 |
|
64 octave_idx_type P (void) const |
|
65 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: P (); } |
|
66 |
|
67 ColumnVector perm (void) const |
|
68 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: perm (); } |
|
69 |
|
70 SparseMatrix Q (void) const |
|
71 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: Q (); } |
|
72 |
|
73 double rcond (void) const |
|
74 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: rcond (); } |
|
75 |
|
76 // Compute the inverse of a matrix using the Cholesky factorization. |
|
77 SparseMatrix inverse (void) const |
|
78 { return sparse_base_chol<SparseMatrix, double, SparseMatrix>:: |
|
79 inverse (); } |
|
80 }; |
|
81 |
|
82 SparseMatrix chol2inv (const SparseMatrix& r); |
|
83 |
|
84 #endif |
|
85 |
|
86 /* |
|
87 ;;; Local Variables: *** |
|
88 ;;; mode: C++ *** |
|
89 ;;; End: *** |
|
90 */ |