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