simplifications in the ei_solve_impl system, factor out some boilerplate code

This commit is contained in:
Benoit Jacob
2009-11-08 16:51:41 -05:00
parent ba7bfe110c
commit e4e58e8337
16 changed files with 189 additions and 175 deletions

View File

@@ -264,14 +264,16 @@ LDLT<MatrixType>& LDLT<MatrixType>::compute(const MatrixType& a)
return *this;
}
template<typename MatrixType, typename Rhs, typename Dest>
struct ei_solve_impl<LDLT<MatrixType>, Rhs, Dest>
: ei_solve_return_value<LDLT<MatrixType>, Rhs>
template<typename _MatrixType, typename Rhs>
struct ei_solve_impl<LDLT<_MatrixType>, Rhs>
: ei_solve_return_value<LDLT<_MatrixType>, Rhs>
{
void evalTo(Dest& dst) const
EIGEN_MAKE_SOLVE_HELPERS(LDLT<_MatrixType>,Rhs)
template<typename Dest> void evalTo(Dest& dst) const
{
dst = this->m_rhs;
this->m_dec.solveInPlace(dst);
dst = rhs();
dec().solveInPlace(dst);
}
};

View File

@@ -258,14 +258,17 @@ LLT<MatrixType,_UpLo>& LLT<MatrixType,_UpLo>::compute(const MatrixType& a)
return *this;
}
template<typename MatrixType, int UpLo, typename Rhs, typename Dest>
struct ei_solve_impl<LLT<MatrixType, UpLo>, Rhs, Dest>
: ei_solve_return_value<LLT<MatrixType, UpLo>, Rhs>
template<typename _MatrixType, int UpLo, typename Rhs>
struct ei_solve_impl<LLT<_MatrixType, UpLo>, Rhs>
: ei_solve_return_value<LLT<_MatrixType, UpLo>, Rhs>
{
void evalTo(Dest& dst) const
typedef LLT<_MatrixType,UpLo> LLTType;
EIGEN_MAKE_SOLVE_HELPERS(LLTType,Rhs)
template<typename Dest> void evalTo(Dest& dst) const
{
dst = this->m_rhs;
this->m_dec.solveInPlace(dst);
dst = rhs();
dec().solveInPlace(dst);
}
};