Solve.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) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
00005 //
00006 // This Source Code Form is subject to the terms of the Mozilla
00007 // Public License v. 2.0. If a copy of the MPL was not distributed
00008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00009 
00010 #ifndef EIGEN_MISC_SOLVE_H
00011 #define EIGEN_MISC_SOLVE_H
00012 
00013 namespace Eigen { 
00014 
00015 namespace internal {
00016 
00020 template<typename DecompositionType, typename Rhs>
00021 struct traits<solve_retval_base<DecompositionType, Rhs> >
00022 {
00023   typedef typename DecompositionType::MatrixType MatrixType;
00024   typedef Matrix<typename Rhs::Scalar,
00025                  MatrixType::ColsAtCompileTime,
00026                  Rhs::ColsAtCompileTime,
00027                  Rhs::PlainObject::Options,
00028                  MatrixType::MaxColsAtCompileTime,
00029                  Rhs::MaxColsAtCompileTime> ReturnType;
00030 };
00031 
00032 template<typename _DecompositionType, typename Rhs> struct solve_retval_base
00033  : public ReturnByValue<solve_retval_base<_DecompositionType, Rhs> >
00034 {
00035   typedef typename remove_all<typename Rhs::Nested>::type RhsNestedCleaned;
00036   typedef _DecompositionType DecompositionType;
00037   typedef ReturnByValue<solve_retval_base> Base;
00038   typedef typename Base::Index Index;
00039 
00040   solve_retval_base(const DecompositionType& dec, const Rhs& rhs)
00041     : m_dec(dec), m_rhs(rhs)
00042   {}
00043 
00044   inline Index rows() const { return m_dec.cols(); }
00045   inline Index cols() const { return m_rhs.cols(); }
00046   inline const DecompositionType& dec() const { return m_dec; }
00047   inline const RhsNestedCleaned& rhs() const { return m_rhs; }
00048 
00049   template<typename Dest> inline void evalTo(Dest& dst) const
00050   {
00051     static_cast<const solve_retval<DecompositionType,Rhs>*>(this)->evalTo(dst);
00052   }
00053 
00054   protected:
00055     const DecompositionType& m_dec;
00056     typename Rhs::Nested m_rhs;
00057 };
00058 
00059 } // end namespace internal
00060 
00061 #define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \
00062   typedef typename DecompositionType::MatrixType MatrixType; \
00063   typedef typename MatrixType::Scalar Scalar; \
00064   typedef typename MatrixType::RealScalar RealScalar; \
00065   typedef typename MatrixType::Index Index; \
00066   typedef Eigen::internal::solve_retval_base<DecompositionType,Rhs> Base; \
00067   using Base::dec; \
00068   using Base::rhs; \
00069   using Base::rows; \
00070   using Base::cols; \
00071   solve_retval(const DecompositionType& dec, const Rhs& rhs) \
00072     : Base(dec, rhs) {}
00073 
00074 } // end namespace Eigen
00075 
00076 #endif // EIGEN_MISC_SOLVE_H


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:00:24