Mercurial > hg > octave-nkf
annotate liboctave/CmplxCHOL.h @ 10396:a0b51ac0f88a
optimize accumdim with summation
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 05 Mar 2010 12:31:30 +0100 |
parents | cbc402e64d83 |
children | 367bfee35ba0 |
rev | line source |
---|---|
457 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, |
4 2007 John W. Eaton | |
8547
d66c9b6e506a
imported patch qrupdate.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
7700
diff
changeset
|
5 Copyright (C) 2008, 2009 Jaroslav Hajek |
457 | 6 |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
7016 | 11 Free Software Foundation; either version 3 of the License, or (at your |
12 option) any later version. | |
457 | 13 |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
7016 | 20 along with Octave; see the file COPYING. If not, see |
21 <http://www.gnu.org/licenses/>. | |
457 | 22 |
23 */ | |
24 | |
25 #if !defined (octave_ComplexCHOL_h) | |
26 #define octave_ComplexCHOL_h 1 | |
27 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8562
diff
changeset
|
28 #include <iosfwd> |
457 | 29 |
30 #include "CMatrix.h" | |
8547
d66c9b6e506a
imported patch qrupdate.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
7700
diff
changeset
|
31 #include "CColVector.h" |
457 | 32 |
1881 | 33 class |
6108 | 34 OCTAVE_API |
1881 | 35 ComplexCHOL |
457 | 36 { |
37 public: | |
38 | |
1881 | 39 ComplexCHOL (void) : chol_mat () { } |
1528 | 40 |
6486 | 41 ComplexCHOL (const ComplexMatrix& a, bool calc_cond = false) { init (a, calc_cond); } |
1528 | 42 |
6486 | 43 ComplexCHOL (const ComplexMatrix& a, octave_idx_type& info, bool calc_cond = false) |
1528 | 44 { |
6486 | 45 info = init (a, calc_cond); |
1528 | 46 } |
47 | |
4055 | 48 ComplexCHOL (const ComplexCHOL& a) |
6486 | 49 : chol_mat (a.chol_mat), xrcond (a.xrcond) { } |
1528 | 50 |
4055 | 51 ComplexCHOL& operator = (const ComplexCHOL& a) |
1528 | 52 { |
1881 | 53 if (this != &a) |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
54 { |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
55 chol_mat = a.chol_mat; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
56 xrcond = a.xrcond; |
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
57 } |
1528 | 58 |
59 return *this; | |
60 } | |
61 | |
5340 | 62 ComplexMatrix chol_matrix (void) const { return chol_mat; } |
63 | |
6486 | 64 double rcond (void) const { return xrcond; } |
65 | |
5340 | 66 ComplexMatrix inverse (void) const; |
457 | 67 |
7554
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
68 void set (const ComplexMatrix& R); |
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
69 |
8547
d66c9b6e506a
imported patch qrupdate.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
7700
diff
changeset
|
70 void update (const ComplexColumnVector& u); |
7554
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
71 |
8547
d66c9b6e506a
imported patch qrupdate.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
7700
diff
changeset
|
72 octave_idx_type downdate (const ComplexColumnVector& u); |
7554
40574114c514
implement Cholesky factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
73 |
8547
d66c9b6e506a
imported patch qrupdate.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
7700
diff
changeset
|
74 octave_idx_type insert_sym (const ComplexColumnVector& u, octave_idx_type j); |
7700
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
75 |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
76 void delete_sym (octave_idx_type j); |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
77 |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7554
diff
changeset
|
78 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
|
79 |
6108 | 80 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const ComplexCHOL& a); |
457 | 81 |
82 private: | |
83 | |
1881 | 84 ComplexMatrix chol_mat; |
457 | 85 |
6486 | 86 double xrcond; |
87 | |
88 octave_idx_type init (const ComplexMatrix& a, bool calc_cond); | |
457 | 89 }; |
90 | |
6108 | 91 ComplexMatrix OCTAVE_API chol2inv (const ComplexMatrix& r); |
5340 | 92 |
457 | 93 #endif |