SparseLU.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 //
00006 // Eigen is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 3 of the License, or (at your option) any later version.
00010 //
00011 // Alternatively, you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License as
00013 // published by the Free Software Foundation; either version 2 of
00014 // the License, or (at your option) any later version.
00015 //
00016 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00017 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00018 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00019 // GNU General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License and a copy of the GNU General Public License along with
00023 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00024 
00025 #ifndef EIGEN_SPARSELU_H
00026 #define EIGEN_SPARSELU_H
00027 
00028 enum {
00029     SvNoTrans   = 0,
00030     SvTranspose = 1,
00031     SvAdjoint   = 2
00032 };
00033 
00044 template<typename _MatrixType, typename Backend = DefaultBackend>
00045 class SparseLU
00046   {
00047   protected:
00048     typedef typename _MatrixType::Scalar Scalar;
00049     typedef typename NumTraits<typename _MatrixType::Scalar>::Real RealScalar;
00050     typedef SparseMatrix<Scalar> LUMatrixType;
00051 
00052     enum {
00053       MatrixLUIsDirty             = 0x10000
00054     };
00055 
00056   public:
00057     typedef _MatrixType MatrixType;
00058 
00060     SparseLU(int flags = 0)
00061       : m_flags(flags), m_status(0)
00062     {
00063       m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision();
00064     }
00065 
00068     SparseLU(const _MatrixType& matrix, int flags = 0)
00069       : /*m_matrix(matrix.rows(), matrix.cols()),*/ m_flags(flags), m_status(0)
00070     {
00071       m_precision = RealScalar(0.1) * Eigen::NumTraits<RealScalar>::dummy_precision();
00072       compute(matrix);
00073     }
00074 
00085     void setPrecision(RealScalar v) { m_precision = v; }
00086 
00090     RealScalar precision() const { return m_precision; }
00091 
00100     void setFlags(int f) { m_flags = f; }
00102     int flags() const { return m_flags; }
00103 
00104     void setOrderingMethod(int m)
00105     {
00106       eigen_assert( (m&~OrderingMask) == 0 && m!=0 && "invalid ordering method");
00107       m_flags = m_flags&~OrderingMask | m&OrderingMask;
00108     }
00109 
00110     int orderingMethod() const
00111     {
00112       return m_flags&OrderingMask;
00113     }
00114 
00116     void compute(const _MatrixType& matrix);
00117 
00119     //inline const _MatrixType& matrixL() const { return m_matrixL; }
00120 
00122     //inline const _MatrixType& matrixU() const { return m_matrixU; }
00123 
00124     template<typename BDerived, typename XDerived>
00125     bool solve(const MatrixBase<BDerived> &b, MatrixBase<XDerived>* x,
00126                const int transposed = SvNoTrans) const;
00127 
00129     inline bool succeeded(void) const { return m_succeeded; }
00130 
00131   protected:
00132     RealScalar m_precision;
00133     int m_flags;
00134     mutable int m_status;
00135     bool m_succeeded;
00136 };
00137 
00141 template<typename _MatrixType, typename Backend>
00142 void SparseLU<_MatrixType,Backend>::compute(const _MatrixType& )
00143 {
00144   eigen_assert(false && "not implemented yet");
00145 }
00146 
00155 template<typename _MatrixType, typename Backend>
00156 template<typename BDerived, typename XDerived>
00157 bool SparseLU<_MatrixType,Backend>::solve(const MatrixBase<BDerived> &, MatrixBase<XDerived>* , const int ) const
00158 {
00159   eigen_assert(false && "not implemented yet");
00160   return false;
00161 }
00162 
00163 #endif // EIGEN_SPARSELU_H


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:32:53