File indexing completed on 2025-01-18 09:56:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef EIGEN_NESTBYVALUE_H
0012 #define EIGEN_NESTBYVALUE_H
0013
0014 namespace Eigen {
0015
0016 namespace internal {
0017 template<typename ExpressionType>
0018 struct traits<NestByValue<ExpressionType> > : public traits<ExpressionType>
0019 {
0020 enum {
0021 Flags = traits<ExpressionType>::Flags & ~NestByRefBit
0022 };
0023 };
0024 }
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 template<typename ExpressionType> class NestByValue
0039 : public internal::dense_xpr_base< NestByValue<ExpressionType> >::type
0040 {
0041 public:
0042
0043 typedef typename internal::dense_xpr_base<NestByValue>::type Base;
0044 EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue)
0045
0046 EIGEN_DEVICE_FUNC explicit inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
0047
0048 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index rows() const EIGEN_NOEXCEPT { return m_expression.rows(); }
0049 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index cols() const EIGEN_NOEXCEPT { return m_expression.cols(); }
0050
0051 EIGEN_DEVICE_FUNC operator const ExpressionType&() const { return m_expression; }
0052
0053 EIGEN_DEVICE_FUNC const ExpressionType& nestedExpression() const { return m_expression; }
0054
0055 protected:
0056 const ExpressionType m_expression;
0057 };
0058
0059
0060
0061 template<typename Derived>
0062 EIGEN_DEVICE_FUNC inline const NestByValue<Derived>
0063 DenseBase<Derived>::nestByValue() const
0064 {
0065 return NestByValue<Derived>(derived());
0066 }
0067
0068 namespace internal {
0069
0070
0071 template<typename ArgType>
0072 struct evaluator<NestByValue<ArgType> >
0073 : public evaluator<ArgType>
0074 {
0075 typedef evaluator<ArgType> Base;
0076
0077 EIGEN_DEVICE_FUNC explicit evaluator(const NestByValue<ArgType>& xpr)
0078 : Base(xpr.nestedExpression())
0079 {}
0080 };
0081 }
0082
0083 }
0084
0085 #endif