11#ifndef EIGEN_RETURNBYVALUE_H
12#define EIGEN_RETURNBYVALUE_H
23template<
typename Derived>
25 :
public traits<typename traits<Derived>::ReturnType>
43template<
typename Derived,
int n,
typename PlainObject>
60 template<
typename Dest>
62 inline void evalTo(
Dest&
dst)
const
63 {
static_cast<const Derived*
>(
this)->evalTo(
dst); }
64 EIGEN_DEVICE_FUNC inline Index rows()
const {
return static_cast<const Derived*
>(
this)->rows(); }
65 EIGEN_DEVICE_FUNC inline Index cols()
const {
return static_cast<const Derived*
>(
this)->cols(); }
67#ifndef EIGEN_PARSED_BY_DOXYGEN
68#define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT
73 const Unusable& coeff(Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
74 const Unusable& coeff(Index,Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
75 Unusable& coeffRef(Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
76 Unusable& coeffRef(Index,Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
81template<
typename Derived>
82template<
typename OtherDerived>
83Derived& DenseBase<Derived>::operator=(
const ReturnByValue<OtherDerived>& other)
85 other.evalTo(derived());
95template<
typename Derived>
96struct evaluator<ReturnByValue<Derived> >
97 :
public evaluator<typename internal::traits<Derived>::ReturnType>
99 typedef ReturnByValue<Derived> XprType;
100 typedef typename internal::traits<Derived>::ReturnType PlainObject;
101 typedef evaluator<PlainObject> Base;
103 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr)
104 : m_result(xpr.rows(), xpr.cols())
106 ::new (
static_cast<Base*
>(
this)) Base(m_result);
107 xpr.evalTo(m_result);
111 PlainObject m_result;
Definition ReturnByValue.h:69
Definition ReturnByValue.h:53
Pseudo expression representing a solving operation.
Definition Solve.h:63
Definition XprHelper.h:50
const unsigned int EvalBeforeNestingBit
means the expression should be evaluated by the calling expression
Definition Constants.h:65
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array.
Definition Constants.h:149
Definition XprHelper.h:428
Definition XprHelper.h:398
Definition ForwardDeclarations.h:17