25 #ifndef EIGEN_MISC_SOLVE_H
26 #define EIGEN_MISC_SOLVE_H
35 template<
typename DecompositionType,
typename Rhs>
36 struct traits<solve_retval_base<DecompositionType, Rhs> >
38 typedef typename DecompositionType::MatrixType MatrixType;
39 typedef Matrix<
typename Rhs::Scalar,
40 MatrixType::ColsAtCompileTime,
41 Rhs::ColsAtCompileTime,
42 Rhs::PlainObject::Options,
43 MatrixType::MaxColsAtCompileTime,
44 Rhs::MaxColsAtCompileTime> ReturnType;
47 template<
typename _DecompositionType,
typename Rhs>
struct solve_retval_base
48 :
public ReturnByValue<solve_retval_base<_DecompositionType, Rhs> >
50 typedef typename remove_all<typename Rhs::Nested>::type RhsNestedCleaned;
51 typedef _DecompositionType DecompositionType;
52 typedef ReturnByValue<solve_retval_base>
Base;
53 typedef typename Base::Index Index;
55 solve_retval_base(
const DecompositionType& dec,
const Rhs& rhs)
56 : m_dec(dec), m_rhs(rhs)
59 inline Index
rows()
const {
return m_dec.cols(); }
60 inline Index
cols()
const {
return m_rhs.cols(); }
61 inline const DecompositionType& dec()
const {
return m_dec; }
62 inline const RhsNestedCleaned& rhs()
const {
return m_rhs; }
64 template<
typename Dest>
inline void evalTo(Dest& dst)
const
66 static_cast<const solve_retval<DecompositionType,Rhs>*
>(
this)->
evalTo(dst);
70 const DecompositionType& m_dec;
71 typename Rhs::Nested m_rhs;
76 #define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \
77 typedef typename DecompositionType::MatrixType MatrixType; \
78 typedef typename MatrixType::Scalar Scalar; \
79 typedef typename MatrixType::RealScalar RealScalar; \
80 typedef typename MatrixType::Index Index; \
81 typedef Eigen::internal::solve_retval_base<DecompositionType,Rhs> Base; \
86 solve_retval(const DecompositionType& dec, const Rhs& rhs) \
91 #endif // EIGEN_MISC_SOLVE_H