457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1881
|
4 Copyright (C) 1996 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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
457
|
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 |
1881
|
35 class |
|
36 QR |
457
|
37 { |
|
38 public: |
|
39 |
539
|
40 enum type |
|
41 { |
|
42 std, |
|
43 raw, |
|
44 economy, |
|
45 }; |
|
46 |
1881
|
47 QR (void) : q (), r () { } |
457
|
48 |
539
|
49 QR (const Matrix& A, type qr_type = QR::std); |
457
|
50 |
1881
|
51 QR (const QR& a) : q (a.q), r (a.r) { } |
457
|
52 |
1528
|
53 QR& operator = (const QR& a) |
|
54 { |
1881
|
55 if (this != &a) |
|
56 { |
|
57 q = a.q; |
|
58 r = a.r; |
|
59 } |
1528
|
60 return *this; |
|
61 } |
|
62 |
|
63 Matrix Q (void) const { return q; } |
|
64 |
|
65 Matrix R (void) const { return r; } |
457
|
66 |
|
67 friend ostream& operator << (ostream& os, const QR& a); |
|
68 |
539
|
69 protected: |
457
|
70 |
|
71 Matrix q; |
|
72 Matrix r; |
|
73 }; |
|
74 |
|
75 #endif |
|
76 |
|
77 /* |
|
78 ;;; Local Variables: *** |
|
79 ;;; mode: C++ *** |
|
80 ;;; page-delimiter: "^/\\*" *** |
|
81 ;;; End: *** |
|
82 */ |