STK++ 1.0
STK_Qr.h
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------*/
00002 /*     Copyright (C) 2004-2007  Serge Iovleff
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as
00006     published by the Free Software Foundation; either version 2 of the
00007     License, or (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this program; if not, write to the
00016     Free Software Foundation, Inc.,
00017     59 Temple Place,
00018     Suite 330,
00019     Boston, MA 02111-1307
00020     USA
00021 
00022     Contact : Serge.Iovleff@stkpp.org
00023 */
00024 
00025 /*
00026  * Project:  Algebra
00027  * Purpose:  Define the Qr Class.
00028  * Author:   Serge Iovleff, serge.iovleff@stkpp.org
00029  *
00030  **/
00031 
00036 #ifndef STK_QR_H
00037 #define STK_QR_H
00038 
00039 #include "../../Arrays/include/STK_Matrix.h"
00040 #include "../../Arrays/include/STK_MatrixUpperTriangular.h"
00041 
00042 namespace STK
00043 {
00044 
00061 class Qr
00062 {
00063   protected :
00065     Matrix Q_;
00067     MatrixUpperTriangular R_;
00069     Integer  ncolr_;
00071     Integer  ncolq_;
00073     Integer  nrowq_;
00075     bool compq_;
00076 
00077   public :
00082     Qr( Matrix const&  A = Matrix(), bool ref = false);
00083 
00085     virtual ~Qr();
00086 
00088     Qr& operator=(const Qr &S);
00089 
00093     inline bool  isCompQ() const
00094     { return compq_;}
00098     inline Matrix const& Q() const  { return Q_;}
00102     inline const MatrixUpperTriangular& R() const { return R_;}
00103 
00105     void clear();
00106 
00108     void run();
00109 
00115     void compQ();
00116 
00120     void popBackCols(Integer const& n =1);
00121 
00125     void eraseCol(Integer const& pos);
00126 
00130     void pushBackCol(Vector const& T);
00131 
00137     void insertCol(Vector const& T, Integer const& pos);
00138 
00139     /* TODO : Delete the ith row and update the QR decomposition :
00140      *  default is the last row.
00141      **/    
00142     //Qr& popBackRows();
00143     //Qr& eraseRows(Integer i);
00144 
00145     /* TODO : Add a row with value T and update th QR decomposition :
00146      *  default is the last column position.
00147      **/
00148     //Qr& pushBackRows(const ArrayHo<double> &T);
00149     //Qr& insertRows(const ArrayHo<double> &T, Integer i);
00150 
00151   private:
00153     void qr();
00154 };
00155 
00156 } // Namespace STK
00157 
00158 #endif
00159 // STK_QR_H
00160