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 |
|
24 #if !defined (octave_QR_h) |
|
25 #define octave_QR_h 1 |
|
26 |
3503
|
27 #include <iostream> |
457
|
28 |
|
29 #include "dMatrix.h" |
|
30 |
1881
|
31 class |
6108
|
32 OCTAVE_API |
1881
|
33 QR |
457
|
34 { |
|
35 public: |
|
36 |
539
|
37 enum type |
|
38 { |
|
39 std, |
|
40 raw, |
2802
|
41 economy |
539
|
42 }; |
|
43 |
1927
|
44 QR (void) : q (), r () { } |
457
|
45 |
2763
|
46 QR (const Matrix&, QR::type = QR::std); |
457
|
47 |
1881
|
48 QR (const QR& a) : q (a.q), r (a.r) { } |
457
|
49 |
1528
|
50 QR& operator = (const QR& a) |
|
51 { |
1881
|
52 if (this != &a) |
|
53 { |
|
54 q = a.q; |
|
55 r = a.r; |
|
56 } |
1528
|
57 return *this; |
|
58 } |
|
59 |
1927
|
60 ~QR (void) { } |
1921
|
61 |
2763
|
62 void init (const Matrix&, QR::type); |
|
63 |
1528
|
64 Matrix Q (void) const { return q; } |
|
65 |
|
66 Matrix R (void) const { return r; } |
457
|
67 |
3504
|
68 friend std::ostream& operator << (std::ostream&, const QR&); |
457
|
69 |
539
|
70 protected: |
457
|
71 |
|
72 Matrix q; |
|
73 Matrix r; |
|
74 }; |
|
75 |
|
76 #endif |
|
77 |
|
78 /* |
|
79 ;;; Local Variables: *** |
|
80 ;;; mode: C++ *** |
|
81 ;;; End: *** |
|
82 */ |