File indexing completed on 2024-11-15 09:36:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef EIGEN_MISC_IMAGE_H
0011 #define EIGEN_MISC_IMAGE_H
0012
0013 namespace Eigen {
0014
0015 namespace internal {
0016
0017
0018
0019
0020 template<typename DecompositionType>
0021 struct traits<image_retval_base<DecompositionType> >
0022 {
0023 typedef typename DecompositionType::MatrixType MatrixType;
0024 typedef Matrix<
0025 typename MatrixType::Scalar,
0026 MatrixType::RowsAtCompileTime,
0027
0028 Dynamic,
0029 MatrixType::Options,
0030 MatrixType::MaxRowsAtCompileTime,
0031 MatrixType::MaxColsAtCompileTime
0032 > ReturnType;
0033 };
0034
0035 template<typename _DecompositionType> struct image_retval_base
0036 : public ReturnByValue<image_retval_base<_DecompositionType> >
0037 {
0038 typedef _DecompositionType DecompositionType;
0039 typedef typename DecompositionType::MatrixType MatrixType;
0040 typedef ReturnByValue<image_retval_base> Base;
0041
0042 image_retval_base(const DecompositionType& dec, const MatrixType& originalMatrix)
0043 : m_dec(dec), m_rank(dec.rank()),
0044 m_cols(m_rank == 0 ? 1 : m_rank),
0045 m_originalMatrix(originalMatrix)
0046 {}
0047
0048 inline Index rows() const { return m_dec.rows(); }
0049 inline Index cols() const { return m_cols; }
0050 inline Index rank() const { return m_rank; }
0051 inline const DecompositionType& dec() const { return m_dec; }
0052 inline const MatrixType& originalMatrix() const { return m_originalMatrix; }
0053
0054 template<typename Dest> inline void evalTo(Dest& dst) const
0055 {
0056 static_cast<const image_retval<DecompositionType>*>(this)->evalTo(dst);
0057 }
0058
0059 protected:
0060 const DecompositionType& m_dec;
0061 Index m_rank, m_cols;
0062 const MatrixType& m_originalMatrix;
0063 };
0064
0065 }
0066
0067 #define EIGEN_MAKE_IMAGE_HELPERS(DecompositionType) \
0068 typedef typename DecompositionType::MatrixType MatrixType; \
0069 typedef typename MatrixType::Scalar Scalar; \
0070 typedef typename MatrixType::RealScalar RealScalar; \
0071 typedef Eigen::internal::image_retval_base<DecompositionType> Base; \
0072 using Base::dec; \
0073 using Base::originalMatrix; \
0074 using Base::rank; \
0075 using Base::rows; \
0076 using Base::cols; \
0077 image_retval(const DecompositionType& dec, const MatrixType& originalMatrix) \
0078 : Base(dec, originalMatrix) {}
0079
0080 }
0081
0082 #endif