base-lu.h

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