Mercurial > octave-nkf
annotate liboctave/dbleCHOL.h @ 7961:a5d1e27ee1f4 ss-3-1-51
3.1.51 snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 22 Jul 2008 11:40:48 -0400 |
parents | efccca5f2ad7 |
children | d66c9b6e506a |
rev | line source |
---|---|
457 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, |
4 2007 John W. Eaton | |
457 | 5 |
6 This file is part of Octave. | |
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. | |
457 | 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/>. | |
457 | 21 |
22 */ | |
23 | |
7554
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
24 // updating/downdating by Jaroslav Hajek 2008 |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
25 |
457 | 26 #if !defined (octave_CHOL_h) |
27 #define octave_CHOL_h 1 | |
28 | |
3503 | 29 #include <iostream> |
457 | 30 |
31 #include "dMatrix.h" | |
32 | |
1881 | 33 class |
6108 | 34 OCTAVE_API |
1881 | 35 CHOL |
457 | 36 { |
37 public: | |
38 | |
1881 | 39 CHOL (void) : chol_mat () { } |
1528 | 40 |
6486 | 41 CHOL (const Matrix& a, bool calc_cond = false) { init (a, calc_cond); } |
457 | 42 |
6486 | 43 CHOL (const Matrix& a, octave_idx_type& info, bool calc_cond = false) |
44 { info = init (a, calc_cond); } | |
1528 | 45 |
6486 | 46 CHOL (const CHOL& a) : chol_mat (a.chol_mat), xrcond (a.xrcond) { } |
457 | 47 |
1528 | 48 CHOL& operator = (const CHOL& a) |
49 { | |
1881 | 50 if (this != &a) |
6486 | 51 { |
52 chol_mat = a.chol_mat; | |
53 xrcond = a.xrcond; | |
54 } | |
1528 | 55 return *this; |
56 } | |
57 | |
58 Matrix chol_matrix (void) const { return chol_mat; } | |
59 | |
6486 | 60 double rcond (void) const { return xrcond; } |
61 | |
5340 | 62 // Compute the inverse of a matrix using the Cholesky factorization. |
63 Matrix inverse (void) const; | |
64 | |
7554
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
65 void set (const Matrix& R); |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
66 |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
67 void update (const Matrix& u); |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
68 |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
69 octave_idx_type downdate (const Matrix& u); |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
70 |
7700
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
71 octave_idx_type insert_sym (const Matrix& u, octave_idx_type j); |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
72 |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
73 void delete_sym (octave_idx_type j); |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
74 |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
75 void shift_sym (octave_idx_type i, octave_idx_type j); |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
76 |
6108 | 77 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const CHOL& a); |
457 | 78 |
79 private: | |
80 | |
1881 | 81 Matrix chol_mat; |
457 | 82 |
6486 | 83 double xrcond; |
84 | |
85 octave_idx_type init (const Matrix& a, bool calc_cond); | |
457 | 86 }; |
87 | |
6108 | 88 Matrix OCTAVE_API chol2inv (const Matrix& r); |
5340 | 89 |
457 | 90 #endif |
91 | |
92 /* | |
93 ;;; Local Variables: *** | |
94 ;;; mode: C++ *** | |
95 ;;; End: *** | |
96 */ |