00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_QR_h)
00024 #define octave_QR_h 1
00025
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029
00030 #include <iostream>
00031
00032 #include "dMatrix.h"
00033
00034 class
00035 QR
00036 {
00037 public:
00038
00039 enum type
00040 {
00041 std,
00042 raw,
00043 economy
00044 };
00045
00046 QR (void) : q (), r () { }
00047
00048 QR (const Matrix&, QR::type = QR::std);
00049
00050 QR (const QR& a) : q (a.q), r (a.r) { }
00051
00052 QR& operator = (const QR& a)
00053 {
00054 if (this != &a)
00055 {
00056 q = a.q;
00057 r = a.r;
00058 }
00059 return *this;
00060 }
00061
00062 ~QR (void) { }
00063
00064 void init (const Matrix&, QR::type);
00065
00066 Matrix Q (void) const { return q; }
00067
00068 Matrix R (void) const { return r; }
00069
00070 friend std::ostream& operator << (std::ostream&, const QR&);
00071
00072 protected:
00073
00074 Matrix q;
00075 Matrix r;
00076 };
00077
00078 #endif
00079
00080
00081
00082
00083
00084