Lines 513-554
EIGEN_STRONG_INLINE Derived& DenseBase<D
Link Here
|
513 |
checkTransposeAliasing(other.derived()); |
513 |
checkTransposeAliasing(other.derived()); |
514 |
#endif |
514 |
#endif |
515 |
return derived(); |
515 |
return derived(); |
516 |
} |
516 |
} |
517 |
|
517 |
|
518 |
namespace internal { |
518 |
namespace internal { |
519 |
|
519 |
|
520 |
template<typename Derived, typename OtherDerived, |
520 |
template<typename Derived, typename OtherDerived, |
|
|
521 |
bool NeedEvaluator = !is_same<OtherDerived, typename evaluator<OtherDerived>::type >::value, |
521 |
bool EvalBeforeAssigning = (int(OtherDerived::Flags) & EvalBeforeAssigningBit) != 0, |
522 |
bool EvalBeforeAssigning = (int(OtherDerived::Flags) & EvalBeforeAssigningBit) != 0, |
522 |
bool NeedToTranspose = Derived::IsVectorAtCompileTime |
523 |
bool NeedToTranspose = Derived::IsVectorAtCompileTime |
523 |
&& OtherDerived::IsVectorAtCompileTime |
524 |
&& OtherDerived::IsVectorAtCompileTime |
524 |
&& ((int(Derived::RowsAtCompileTime) == 1 && int(OtherDerived::ColsAtCompileTime) == 1) |
525 |
&& ((int(Derived::RowsAtCompileTime) == 1 && int(OtherDerived::ColsAtCompileTime) == 1) |
525 |
| // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&". |
526 |
| // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&". |
526 |
// revert to || as soon as not needed anymore. |
527 |
// revert to || as soon as not needed anymore. |
527 |
(int(Derived::ColsAtCompileTime) == 1 && int(OtherDerived::RowsAtCompileTime) == 1)) |
528 |
(int(Derived::ColsAtCompileTime) == 1 && int(OtherDerived::RowsAtCompileTime) == 1)) |
528 |
&& int(Derived::SizeAtCompileTime) != 1> |
529 |
&& int(Derived::SizeAtCompileTime) != 1> |
529 |
struct assign_selector; |
530 |
struct assign_selector; |
530 |
|
531 |
|
531 |
template<typename Derived, typename OtherDerived> |
532 |
template<typename Derived, typename OtherDerived> |
532 |
struct assign_selector<Derived,OtherDerived,false,false> { |
533 |
struct assign_selector<Derived,OtherDerived,false,false,false> { |
533 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.derived()); } |
534 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.derived()); } |
534 |
}; |
535 |
}; |
535 |
template<typename Derived, typename OtherDerived> |
536 |
template<typename Derived, typename OtherDerived> |
536 |
struct assign_selector<Derived,OtherDerived,true,false> { |
537 |
struct assign_selector<Derived,OtherDerived,false,true,false> { |
537 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.eval()); } |
538 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.eval()); } |
538 |
}; |
539 |
}; |
539 |
template<typename Derived, typename OtherDerived> |
540 |
template<typename Derived, typename OtherDerived> |
540 |
struct assign_selector<Derived,OtherDerived,false,true> { |
541 |
struct assign_selector<Derived,OtherDerived,false,false,true> { |
541 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose()); } |
542 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose()); } |
542 |
}; |
543 |
}; |
543 |
template<typename Derived, typename OtherDerived> |
544 |
template<typename Derived, typename OtherDerived> |
544 |
struct assign_selector<Derived,OtherDerived,true,true> { |
545 |
struct assign_selector<Derived,OtherDerived,false,true,true> { |
545 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose().eval()); } |
546 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose().eval()); } |
546 |
}; |
547 |
}; |
|
|
548 |
template<typename Derived, typename OtherDerived> |
549 |
struct assign_selector<Derived,OtherDerived,true,false,false> { |
550 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(evaluator<OtherDerived>(other).result); } |
551 |
}; |
552 |
template<typename Derived, typename OtherDerived> |
553 |
struct assign_selector<Derived,OtherDerived,true,true,false> { |
554 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(evaluator<OtherDerived>(other).result.eval()); } |
555 |
}; |
556 |
template<typename Derived, typename OtherDerived> |
557 |
struct assign_selector<Derived,OtherDerived,true,false,true> { |
558 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(evaluator<OtherDerived>(other.transpose()).result); } |
559 |
}; |
560 |
template<typename Derived, typename OtherDerived> |
561 |
struct assign_selector<Derived,OtherDerived,true,true,true> { |
562 |
EIGEN_STRONG_INLINE static Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(evaluator<OtherDerived>(other.transpose()).result.eval()); } |
563 |
}; |
547 |
|
564 |
|
548 |
} // end namespace internal |
565 |
} // end namespace internal |
549 |
|
566 |
|
550 |
template<typename Derived> |
567 |
template<typename Derived> |
551 |
template<typename OtherDerived> |
568 |
template<typename OtherDerived> |
552 |
EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase<OtherDerived>& other) |
569 |
EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator=(const DenseBase<OtherDerived>& other) |
553 |
{ |
570 |
{ |
554 |
return internal::assign_selector<Derived,OtherDerived>::run(derived(), other.derived()); |
571 |
return internal::assign_selector<Derived,OtherDerived>::run(derived(), other.derived()); |