base-qr.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2009-2012 Jaroslav Hajek
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_base_qr_h)
00024 #define octave_base_qr_h 1
00025 
00026 #include "MArray.h"
00027 #include "dColVector.h"
00028 #include "PermMatrix.h"
00029 
00030 enum qr_type_t
00031 {
00032   qr_type_std,
00033   qr_type_raw,
00034   qr_type_economy
00035 };
00036 
00037 template <class qr_type>
00038 class
00039 base_qr
00040 {
00041 public:
00042 
00043   typedef typename qr_type::element_type qr_elt_type;
00044 
00045   base_qr (void) : q (), r () { }
00046 
00047   base_qr (const qr_type& q, const qr_type& r);
00048 
00049   base_qr (const base_qr& a) : q (a.q), r (a.r) { }
00050 
00051   base_qr& operator = (const base_qr& a)
00052     {
00053       if (this != &a)
00054         {
00055           q = a.q;
00056           r = a.r;
00057         }
00058       return *this;
00059     }
00060 
00061   virtual ~base_qr (void) { }
00062 
00063   qr_type Q (void) const { return q; }
00064 
00065   qr_type R (void) const { return r; }
00066 
00067   qr_type_t get_type (void) const;
00068 
00069   bool regular (void) const;
00070 
00071 protected:
00072 
00073   qr_type q;
00074   qr_type r;
00075 };
00076 
00077 #ifndef HAVE_QRUPDATE
00078 void warn_qrupdate_once (void);
00079 #endif
00080 
00081 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines