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

@@ -64,9 +64,16 @@ template<typename _DecompositionType> struct ei_image_return_value
template<typename Dest> inline void evalTo(Dest& dst) const
{
static_cast<const ei_image_impl<DecompositionType, Dest> *>
(this)->evalTo(dst);
static_cast<const ei_image_impl<DecompositionType>*>(this)->evalTo(dst);
}
};
#define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \
typedef typename DecompositionType::MatrixType MatrixType; \
typedef typename MatrixType::Scalar Scalar; \
typedef typename MatrixType::RealScalar RealScalar; \
inline const DecompositionType& dec() const { return this->m_dec; } \
inline const MatrixType& originalMatrix() const { return this->m_originalMatrix; } \
inline int rank() const { return this->m_rank; }
#endif // EIGEN_MISC_IMAGE_H

View File

@@ -63,9 +63,15 @@ template<typename _DecompositionType> struct ei_kernel_return_value
template<typename Dest> inline void evalTo(Dest& dst) const
{
static_cast<const ei_kernel_impl<DecompositionType, Dest> *>
(this)->evalTo(dst);
static_cast<const ei_kernel_impl<DecompositionType>*>(this)->evalTo(dst);
}
};
#define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \
typedef typename DecompositionType::MatrixType MatrixType; \
typedef typename MatrixType::Scalar Scalar; \
typedef typename MatrixType::RealScalar RealScalar; \
inline const DecompositionType& dec() const { return this->m_dec; } \
inline int rank() const { return this->m_rank; }
#endif // EIGEN_MISC_KERNEL_H

View File

@@ -57,9 +57,16 @@ template<typename _DecompositionType, typename Rhs> struct ei_solve_return_value
template<typename Dest> inline void evalTo(Dest& dst) const
{
static_cast<const ei_solve_impl<DecompositionType, RhsNestedCleaned, Dest> *>
(this)->evalTo(dst);
static_cast<const ei_solve_impl<DecompositionType,Rhs>*>(this)->evalTo(dst);
}
};
#define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \
typedef typename DecompositionType::MatrixType MatrixType; \
typedef typename MatrixType::Scalar Scalar; \
typedef typename MatrixType::RealScalar RealScalar; \
typedef typename ei_cleantype<typename Rhs::Nested>::type RhsNestedCleaned; \
inline const DecompositionType& dec() const { return this->m_dec; } \
inline const RhsNestedCleaned& rhs() const { return this->m_rhs; }
#endif // EIGEN_MISC_SOLVE_H