11#ifndef EIGEN_RETURNBYVALUE_H
12#define EIGEN_RETURNBYVALUE_H
18template<
typename Derived>
20 :
public traits<typename traits<Derived>::ReturnType>
38template<
typename Derived,
int n,
typename PlainObject>
59 template<
typename Dest>
61 inline void evalTo(
Dest&
dst)
const
62 {
static_cast<const Derived*
>(
this)->evalTo(
dst); }
63 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
64 inline Index rows()
const EIGEN_NOEXCEPT {
return static_cast<const Derived*
>(
this)->rows(); }
65 EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
66 inline Index cols()
const EIGEN_NOEXCEPT {
return static_cast<const Derived*
>(
this)->cols(); }
68#ifndef EIGEN_PARSED_BY_DOXYGEN
69#define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT
75 const Unusable& coeff(
Index,
Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
76 Unusable& coeffRef(
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
77 Unusable& coeffRef(
Index,
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
82template<
typename Derived>
83template<
typename OtherDerived>
84EIGEN_DEVICE_FUNC Derived& DenseBase<Derived>::operator=(
const ReturnByValue<OtherDerived>& other)
86 other.evalTo(derived());
96template<
typename Derived>
97struct evaluator<ReturnByValue<Derived> >
98 :
public evaluator<typename internal::traits<Derived>::ReturnType>
100 typedef ReturnByValue<Derived> XprType;
101 typedef typename internal::traits<Derived>::ReturnType PlainObject;
102 typedef evaluator<PlainObject> Base;
104 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr)
105 : m_result(xpr.rows(), xpr.cols())
107 ::new (
static_cast<Base*
>(
this)) Base(m_result);
108 xpr.evalTo(m_result);
112 PlainObject m_result;
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
Definition ReturnByValue.h:70
Definition ReturnByValue.h:52
Definition XprHelper.h:110
const unsigned int EvalBeforeNestingBit
means the expression should be evaluated by the calling expression
Definition Constants.h:70
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array.
Definition Constants.h:155
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition XprHelper.h:484
Definition XprHelper.h:458
Definition ForwardDeclarations.h:17