Mercurial > hg > octave-nkf
annotate liboctave/dbleQR.h @ 7893:eb9ccb44ea41
make regexp(...,'once') matlab compatible
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 18 Jun 2008 21:00:06 +0200 |
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 | |
7553
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
24 // updating/downdating by Jaroslav Hajek 2008 |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
25 |
457 | 26 #if !defined (octave_QR_h) |
27 #define octave_QR_h 1 | |
28 | |
3503 | 29 #include <iostream> |
457 | 30 |
31 #include "dMatrix.h" | |
7553
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
32 #include "dColVector.h" |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
33 #include "dRowVector.h" |
457 | 34 |
1881 | 35 class |
6108 | 36 OCTAVE_API |
1881 | 37 QR |
457 | 38 { |
39 public: | |
40 | |
539 | 41 enum type |
42 { | |
43 std, | |
44 raw, | |
2802 | 45 economy |
539 | 46 }; |
47 | |
1927 | 48 QR (void) : q (), r () { } |
457 | 49 |
2763 | 50 QR (const Matrix&, QR::type = QR::std); |
457 | 51 |
7553
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
52 QR (const Matrix& q, const Matrix& r); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
53 |
1881 | 54 QR (const QR& a) : q (a.q), r (a.r) { } |
457 | 55 |
1528 | 56 QR& operator = (const QR& a) |
57 { | |
1881 | 58 if (this != &a) |
59 { | |
60 q = a.q; | |
61 r = a.r; | |
62 } | |
1528 | 63 return *this; |
64 } | |
65 | |
1927 | 66 ~QR (void) { } |
1921 | 67 |
2763 | 68 void init (const Matrix&, QR::type); |
69 | |
1528 | 70 Matrix Q (void) const { return q; } |
71 | |
72 Matrix R (void) const { return r; } | |
457 | 73 |
7553
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
74 void update (const Matrix& u, const Matrix& v); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
75 |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
76 void insert_col (const Matrix& u, octave_idx_type j); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
77 |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
78 void delete_col (octave_idx_type j); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
79 |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
80 void insert_row (const Matrix& u, octave_idx_type j); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
81 |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
82 void delete_row (octave_idx_type j); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
83 |
7700
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7553
diff
changeset
|
84 void shift_cols (octave_idx_type i, octave_idx_type j); |
efccca5f2ad7
more QR & Cholesky updating functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7553
diff
changeset
|
85 |
7553
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
86 void economize (void); |
56be6f31dd4e
implementation of QR factorization updating
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
87 |
3504 | 88 friend std::ostream& operator << (std::ostream&, const QR&); |
457 | 89 |
539 | 90 protected: |
457 | 91 |
92 Matrix q; | |
93 Matrix r; | |
94 }; | |
95 | |
96 #endif | |
97 | |
98 /* | |
99 ;;; Local Variables: *** | |
100 ;;; mode: C++ *** | |
101 ;;; End: *** | |
102 */ |