11#ifndef EIGEN_RETURNBYVALUE_H
12#define EIGEN_RETURNBYVALUE_H
15#include "./InternalHeaderCheck.h"
21template <
typename Derived>
22struct traits<ReturnByValue<Derived> > :
public traits<typename traits<Derived>::ReturnType> {
38template <
typename Derived,
int n,
typename PlainObject>
39struct nested_eval<ReturnByValue<Derived>, n, PlainObject> {
40 typedef typename traits<Derived>::ReturnType type;
49template <
typename Derived>
50class ReturnByValue :
public internal::dense_xpr_base<ReturnByValue<Derived> >::type, internal::no_assignment_operator {
52 typedef typename internal::traits<Derived>::ReturnType ReturnType;
54 typedef typename internal::dense_xpr_base<ReturnByValue>::type Base;
55 EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue)
57 template <
typename Dest>
58 EIGEN_DEVICE_FUNC
inline void evalTo(Dest& dst)
const {
59 static_cast<const Derived*
>(
this)->evalTo(dst);
61 EIGEN_DEVICE_FUNC
constexpr Index rows() const noexcept {
return static_cast<const Derived*
>(
this)->rows(); }
62 EIGEN_DEVICE_FUNC
constexpr Index cols() const noexcept {
return static_cast<const Derived*
>(
this)->cols(); }
64#ifndef EIGEN_PARSED_BY_DOXYGEN
66 YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT
68 Unusable(
const Unusable&) {}
69 Unusable& operator=(
const Unusable&) {
return *
this; }
71 const Unusable& coeff(
Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
72 const Unusable& coeff(
Index,
Index)
const {
return *
reinterpret_cast<const Unusable*
>(
this); }
73 Unusable& coeffRef(
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
74 Unusable& coeffRef(
Index,
Index) {
return *
reinterpret_cast<Unusable*
>(
this); }
79template <
typename Derived>
80template <
typename OtherDerived>
82 other.evalTo(derived());
92template <
typename Derived>
93struct evaluator<ReturnByValue<Derived> > :
public evaluator<typename internal::traits<Derived>::ReturnType> {
94 typedef ReturnByValue<Derived> XprType;
95 typedef typename internal::traits<Derived>::ReturnType PlainObject;
96 typedef evaluator<PlainObject> Base;
98 EIGEN_DEVICE_FUNC
explicit evaluator(
const XprType& xpr) : m_result(xpr.rows(), xpr.cols()) {
99 internal::construct_at<Base>(
this, m_result);
100 xpr.evalTo(m_result);
104 PlainObject m_result;
Derived & operator=(const DenseBase< OtherDerived > &other)
Definition Assign.h:39
const unsigned int EvalBeforeNestingBit
Definition Constants.h:74
const unsigned int DirectAccessBit
Definition Constants.h:159
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