11#ifndef EIGEN_NESTBYVALUE_H
12#define EIGEN_NESTBYVALUE_H
15#include "./InternalHeaderCheck.h"
20template <
typename ExpressionType>
21struct traits<NestByValue<ExpressionType> > :
public traits<ExpressionType> {
22 enum { Flags = traits<ExpressionType>::Flags & ~NestByRefBit };
38template <
typename ExpressionType>
39class NestByValue :
public internal::dense_xpr_base<NestByValue<ExpressionType> >::type {
41 typedef typename internal::dense_xpr_base<NestByValue>::type Base;
42 static constexpr bool HasDirectAccess = internal::has_direct_access<ExpressionType>::ret;
44 EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue)
46 EIGEN_DEVICE_FUNC
explicit inline NestByValue(
const ExpressionType& matrix) : m_expression(matrix) {}
48 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
inline Index rows() const EIGEN_NOEXCEPT {
return m_expression.rows(); }
49 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
inline Index cols() const EIGEN_NOEXCEPT {
return m_expression.cols(); }
51 EIGEN_DEVICE_FUNC
operator const ExpressionType&()
const {
return m_expression; }
53 EIGEN_DEVICE_FUNC
const ExpressionType& nestedExpression()
const {
return m_expression; }
55 EIGEN_DEVICE_FUNC
typename std::enable_if<HasDirectAccess, const Scalar*>::type data()
const {
56 return m_expression.data();
59 EIGEN_DEVICE_FUNC
typename std::enable_if<HasDirectAccess, Index>::type innerStride()
const {
60 return m_expression.innerStride();
63 EIGEN_DEVICE_FUNC
typename std::enable_if<HasDirectAccess, Index>::type outerStride()
const {
64 return m_expression.outerStride();
68 const ExpressionType m_expression;
73template <
typename Derived>
81template <
typename ArgType>
82struct evaluator<
NestByValue<ArgType> > :
public evaluator<ArgType> {
83 typedef evaluator<ArgType> Base;
85 EIGEN_DEVICE_FUNC
explicit evaluator(
const NestByValue<ArgType>& xpr) : Base(xpr.nestedExpression()) {}
const NestByValue< Derived > nestByValue() const
Definition NestByValue.h:74
Expression which must be nested by value.
Definition ForwardDeclarations.h:82
Namespace containing all symbols from the Eigen library.
Definition B01_Experimental.dox:1
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:82