25 #ifndef EIGEN_MISC_KERNEL_H
26 #define EIGEN_MISC_KERNEL_H
35 template<
typename DecompositionType>
36 struct traits<kernel_retval_base<DecompositionType> >
38 typedef typename DecompositionType::MatrixType MatrixType;
40 typename MatrixType::Scalar,
41 MatrixType::ColsAtCompileTime,
46 MatrixType::MaxColsAtCompileTime,
47 MatrixType::MaxColsAtCompileTime
52 template<
typename _DecompositionType>
struct kernel_retval_base
53 :
public ReturnByValue<kernel_retval_base<_DecompositionType> >
55 typedef _DecompositionType DecompositionType;
56 typedef ReturnByValue<kernel_retval_base>
Base;
57 typedef typename Base::Index Index;
59 kernel_retval_base(
const DecompositionType& dec)
62 m_cols(m_rank==dec.
cols() ? 1 : dec.
cols() - m_rank)
65 inline Index
rows()
const {
return m_dec.cols(); }
66 inline Index
cols()
const {
return m_cols; }
67 inline Index rank()
const {
return m_rank; }
68 inline const DecompositionType& dec()
const {
return m_dec; }
70 template<
typename Dest>
inline void evalTo(Dest& dst)
const
72 static_cast<const kernel_retval<DecompositionType>*
>(
this)->
evalTo(dst);
76 const DecompositionType& m_dec;
82 #define EIGEN_MAKE_KERNEL_HELPERS(DecompositionType) \
83 typedef typename DecompositionType::MatrixType MatrixType; \
84 typedef typename MatrixType::Scalar Scalar; \
85 typedef typename MatrixType::RealScalar RealScalar; \
86 typedef typename MatrixType::Index Index; \
87 typedef Eigen::internal::kernel_retval_base<DecompositionType> Base; \
92 kernel_retval(const DecompositionType& dec) : Base(dec) {}
96 #endif // EIGEN_MISC_KERNEL_H