aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/PlainObjectBase.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-02-17 16:11:55 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-02-17 16:11:55 +0100
commitd595fd31f544009e62a55d6ffc26e0b62f3147d5 (patch)
treed65354f2693e90a686ba6f31a4a57a5dbec7b9c8 /Eigen/src/Core/PlainObjectBase.h
parentbffa15142c4271313a70801e6bb7d01365a00bc9 (diff)
Deal with automatic transposition in call_assignment, fix a few shortcomings
Diffstat (limited to 'Eigen/src/Core/PlainObjectBase.h')
-rw-r--r--Eigen/src/Core/PlainObjectBase.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h
index 0305066ba..8eccbfbd0 100644
--- a/Eigen/src/Core/PlainObjectBase.h
+++ b/Eigen/src/Core/PlainObjectBase.h
@@ -639,6 +639,18 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
*
* \internal
*/
+#ifdef EIGEN_TEST_EVALUATORS
+ // aliasing is dealt once in internall::call_assignment
+ // so at this stage we have to assume aliasing... and resising has to be done later.
+ template<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
+ EIGEN_STRONG_INLINE Derived& _set(const DenseBase<OtherDerived>& other)
+ {
+ internal::call_assignment(this->derived(), other.derived());
+ return this->derived();
+ return this->derived();
+ }
+#else
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Derived& _set(const DenseBase<OtherDerived>& other)
@@ -654,7 +666,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::false_type&) { _set_noalias(other); }
-
+#endif
/** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which
* is the case when creating a new matrix) so one can enforce lazy evaluation.
*
@@ -669,7 +681,12 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
//_resize_to_match(other);
// the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because
// it wouldn't allow to copy a row-vector into a column-vector.
+#ifdef EIGEN_TEST_EVALUATORS
+ internal::call_assignment(this->noalias(), other.derived());
+ return this->derived();
+#else
return internal::assign_selector<Derived,OtherDerived,false>::run(this->derived(), other.derived());
+#endif
}
template<typename T0, typename T1>