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