11 #ifndef EIGEN_RETURNBYVALUE_H 12 #define EIGEN_RETURNBYVALUE_H 18 template<
typename Derived>
19 struct traits<ReturnByValue<Derived> >
20 :
public traits<typename traits<Derived>::ReturnType>
26 Flags = (traits<typename traits<Derived>::ReturnType>::Flags
38 template<
typename Derived,
int n,
typename PlainObject>
39 struct nested_eval<ReturnByValue<Derived>, n, PlainObject>
41 typedef typename traits<Derived>::ReturnType type;
50 template<
typename Derived>
class ReturnByValue
51 :
public internal::dense_xpr_base< ReturnByValue<Derived> >::type, internal::no_assignment_operator
54 typedef typename internal::traits<Derived>::ReturnType ReturnType;
56 typedef typename internal::dense_xpr_base<ReturnByValue>::type Base;
57 EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue)
59 template<
typename Dest>
61 inline void evalTo(Dest& dst)
const 62 {
static_cast<const Derived*
>(
this)->evalTo(dst); }
63 EIGEN_DEVICE_FUNC
inline Index rows()
const {
return static_cast<const Derived*
>(
this)->rows(); }
64 EIGEN_DEVICE_FUNC
inline Index cols()
const {
return static_cast<const Derived*
>(
this)->cols(); }
66 #ifndef EIGEN_PARSED_BY_DOXYGEN 67 #define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT 69 Unusable(
const Unusable&) {}
70 Unusable& operator=(
const Unusable&) {
return *
this;}
72 const Unusable& coeff(
Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
73 const Unusable& coeff(
Index,
Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
74 Unusable& coeffRef(
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
75 Unusable& coeffRef(
Index,
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
80 template<
typename Derived>
81 template<
typename OtherDerived>
84 other.evalTo(derived());
94 template<
typename Derived>
95 struct evaluator<ReturnByValue<Derived> >
96 :
public evaluator<typename internal::traits<Derived>::ReturnType>
98 typedef ReturnByValue<Derived> XprType;
99 typedef typename internal::traits<Derived>::ReturnType PlainObject;
100 typedef evaluator<PlainObject> Base;
102 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr)
103 : m_result(xpr.rows(), xpr.cols())
105 ::new (static_cast<Base*>(
this)) Base(m_result);
106 xpr.evalTo(m_result);
110 PlainObject m_result;
117 #endif // EIGEN_RETURNBYVALUE_H const unsigned int DirectAccessBit
Definition: Constants.h:150
Namespace containing all symbols from the Eigen library.
Definition: Core:287
Derived & operator=(const DenseBase< OtherDerived > &other)
Definition: Assign.h:39
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: Eigen_Colamd.h:50
const unsigned int EvalBeforeNestingBit
Definition: Constants.h:65