457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_QR_h) |
|
25 #define octave_QR_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
457
|
31 class ostream; |
|
32 |
|
33 #include "dMatrix.h" |
|
34 |
|
35 class QR |
|
36 { |
|
37 public: |
|
38 |
539
|
39 enum type |
|
40 { |
|
41 std, |
|
42 raw, |
|
43 economy, |
|
44 }; |
|
45 |
457
|
46 QR (void) {} |
|
47 |
539
|
48 QR (const Matrix& A, type qr_type = QR::std); |
457
|
49 |
|
50 QR (const QR& a); |
|
51 |
|
52 QR& operator = (const QR& a); |
|
53 |
|
54 Matrix Q (void) const; |
|
55 Matrix R (void) const; |
|
56 |
|
57 friend ostream& operator << (ostream& os, const QR& a); |
|
58 |
539
|
59 protected: |
457
|
60 |
|
61 Matrix q; |
|
62 Matrix r; |
|
63 }; |
|
64 |
|
65 inline QR::QR (const QR& a) |
|
66 { |
|
67 q = a.q; |
|
68 r = a.r; |
|
69 } |
|
70 |
|
71 inline QR& QR::operator = (const QR& a) |
|
72 { |
|
73 q = a.q; |
|
74 r = a.r; |
|
75 return *this; |
|
76 } |
|
77 |
|
78 inline Matrix QR::Q (void) const |
|
79 { |
|
80 return q; |
|
81 } |
|
82 |
|
83 inline Matrix QR::R (void) const |
|
84 { |
|
85 return r; |
|
86 } |
|
87 |
|
88 #endif |
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; page-delimiter: "^/\\*" *** |
|
94 ;;; End: *** |
|
95 */ |