Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef EIGEN_SPARSE_SOLVE_H
00026 #define EIGEN_SPARSE_SOLVE_H
00027
00028 namespace internal {
00029
00030 template<typename _DecompositionType, typename Rhs> struct sparse_solve_retval_base;
00031 template<typename _DecompositionType, typename Rhs> struct sparse_solve_retval;
00032
00033 template<typename DecompositionType, typename Rhs>
00034 struct traits<sparse_solve_retval_base<DecompositionType, Rhs> >
00035 {
00036 typedef typename DecompositionType::MatrixType MatrixType;
00037 typedef SparseMatrix<typename Rhs::Scalar, Rhs::Options, typename Rhs::Index> ReturnType;
00038 };
00039
00040 template<typename _DecompositionType, typename Rhs> struct sparse_solve_retval_base
00041 : public ReturnByValue<sparse_solve_retval_base<_DecompositionType, Rhs> >
00042 {
00043 typedef typename remove_all<typename Rhs::Nested>::type RhsNestedCleaned;
00044 typedef _DecompositionType DecompositionType;
00045 typedef ReturnByValue<sparse_solve_retval_base> Base;
00046 typedef typename Base::Index Index;
00047
00048 sparse_solve_retval_base(const DecompositionType& dec, const Rhs& rhs)
00049 : m_dec(dec), m_rhs(rhs)
00050 {}
00051
00052 inline Index rows() const { return m_dec.cols(); }
00053 inline Index cols() const { return m_rhs.cols(); }
00054 inline const DecompositionType& dec() const { return m_dec; }
00055 inline const RhsNestedCleaned& rhs() const { return m_rhs; }
00056
00057 template<typename Dest> inline void evalTo(Dest& dst) const
00058 {
00059 static_cast<const sparse_solve_retval<DecompositionType,Rhs>*>(this)->evalTo(dst);
00060 }
00061
00062 protected:
00063 const DecompositionType& m_dec;
00064 const typename Rhs::Nested m_rhs;
00065 };
00066
00067 #define EIGEN_MAKE_SPARSE_SOLVE_HELPERS(DecompositionType,Rhs) \
00068 typedef typename DecompositionType::MatrixType MatrixType; \
00069 typedef typename MatrixType::Scalar Scalar; \
00070 typedef typename MatrixType::RealScalar RealScalar; \
00071 typedef typename MatrixType::Index Index; \
00072 typedef Eigen::internal::sparse_solve_retval_base<DecompositionType,Rhs> Base; \
00073 using Base::dec; \
00074 using Base::rhs; \
00075 using Base::rows; \
00076 using Base::cols; \
00077 sparse_solve_retval(const DecompositionType& dec, const Rhs& rhs) \
00078 : Base(dec, rhs) {}
00079
00080 }
00081
00082 #endif // EIGEN_SPARSE_SOLVE_H