25 #ifndef EIGEN_MISC_IMAGE_H
26 #define EIGEN_MISC_IMAGE_H
35 template<
typename DecompositionType>
36 struct traits<image_retval_base<DecompositionType> >
38 typedef typename DecompositionType::MatrixType MatrixType;
40 typename MatrixType::Scalar,
41 MatrixType::RowsAtCompileTime,
45 MatrixType::MaxRowsAtCompileTime,
46 MatrixType::MaxColsAtCompileTime
50 template<
typename _DecompositionType>
struct image_retval_base
51 :
public ReturnByValue<image_retval_base<_DecompositionType> >
53 typedef _DecompositionType DecompositionType;
54 typedef typename DecompositionType::MatrixType MatrixType;
55 typedef ReturnByValue<image_retval_base>
Base;
56 typedef typename Base::Index Index;
58 image_retval_base(
const DecompositionType& dec,
const MatrixType& originalMatrix)
59 : m_dec(dec), m_rank(dec.rank()),
60 m_cols(m_rank == 0 ? 1 : m_rank),
61 m_originalMatrix(originalMatrix)
64 inline Index
rows()
const {
return m_dec.rows(); }
65 inline Index
cols()
const {
return m_cols; }
66 inline Index rank()
const {
return m_rank; }
67 inline const DecompositionType& dec()
const {
return m_dec; }
68 inline const MatrixType& originalMatrix()
const {
return m_originalMatrix; }
70 template<
typename Dest>
inline void evalTo(Dest& dst)
const
72 static_cast<const image_retval<DecompositionType>*
>(
this)->
evalTo(dst);
76 const DecompositionType& m_dec;
78 const MatrixType& m_originalMatrix;
83 #define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \
84 typedef typename DecompositionType::MatrixType MatrixType; \
85 typedef typename MatrixType::Scalar Scalar; \
86 typedef typename MatrixType::RealScalar RealScalar; \
87 typedef typename MatrixType::Index Index; \
88 typedef Eigen::internal::image_retval_base<DecompositionType> Base; \
90 using Base::originalMatrix; \
94 image_retval(const DecompositionType& dec, const MatrixType& originalMatrix) \
95 : Base(dec, originalMatrix) {}
99 #endif // EIGEN_MISC_IMAGE_H