Mercurial > hg > octave-max
diff liboctave/floatQR.h @ 9713:7918eb15040c
refactor the QR classes onto a templated base
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 12 Oct 2009 10:42:49 +0200 |
parents | d865363208d6 |
children | 4c0cdbe0acca |
line wrap: on
line diff
--- a/liboctave/floatQR.h +++ b/liboctave/floatQR.h @@ -30,41 +30,24 @@ #include "fMatrix.h" #include "fColVector.h" #include "fRowVector.h" -#include "dbleQR.h" +#include "base-qr.h" class OCTAVE_API -FloatQR +FloatQR : public base_qr<FloatMatrix> { public: - FloatQR (void) : q (), r () { } - - FloatQR (const FloatMatrix&, QR::type = QR::std); + FloatQR (void) : base_qr<FloatMatrix> () { } - FloatQR (const FloatMatrix& q, const FloatMatrix& r); - - FloatQR (const FloatQR& a) : q (a.q), r (a.r) { } + FloatQR (const FloatMatrix&, qr_type_t = qr_type_std); - FloatQR& operator = (const FloatQR& a) - { - if (this != &a) - { - q = a.q; - r = a.r; - } - return *this; - } + FloatQR (const FloatMatrix& qx, const FloatMatrix& rx) + : base_qr<FloatMatrix> (qx, rx) { } - ~FloatQR (void) { } - - void init (const FloatMatrix&, QR::type); + FloatQR (const FloatQR& a) : base_qr<FloatMatrix> (a) { } - FloatMatrix Q (void) const { return q; } - - FloatMatrix R (void) const { return r; } - - QR::type get_type (void) const; + void init (const FloatMatrix&, qr_type_t); void update (const FloatColumnVector& u, const FloatColumnVector& v); @@ -84,15 +67,10 @@ void shift_cols (octave_idx_type i, octave_idx_type j); - friend std::ostream& operator << (std::ostream&, const FloatQR&); - protected: void form (octave_idx_type n, FloatMatrix& afact, - float *tau, QR::type qr_type); - - FloatMatrix q; - FloatMatrix r; + float *tau, qr_type_t qr_type); }; #endif