mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fix swap in DenseBase
This commit is contained in:
parent
c15c65990f
commit
d0261bd26c
@ -388,6 +388,28 @@ template<typename Derived> class DenseBase
|
|||||||
return typename internal::eval<Derived>::type(derived());
|
return typename internal::eval<Derived>::type(derived());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EIGEN_TEST_EVALUATORS
|
||||||
|
/** swaps *this with the expression \a other.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
template<typename OtherDerived>
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
|
void swap(const DenseBase<OtherDerived>& other,
|
||||||
|
int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
|
||||||
|
{
|
||||||
|
swap_using_evaluator(derived(), other.derived());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** swaps *this with the matrix or array \a other.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
template<typename OtherDerived>
|
||||||
|
EIGEN_DEVICE_FUNC
|
||||||
|
void swap(PlainObjectBase<OtherDerived>& other)
|
||||||
|
{
|
||||||
|
swap_using_evaluator(derived(), other.derived());
|
||||||
|
}
|
||||||
|
#else // EIGEN_TEST_EVALUATORS
|
||||||
/** swaps *this with the expression \a other.
|
/** swaps *this with the expression \a other.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -408,7 +430,7 @@ template<typename Derived> class DenseBase
|
|||||||
{
|
{
|
||||||
SwapWrapper<Derived>(derived()).lazyAssign(other.derived());
|
SwapWrapper<Derived>(derived()).lazyAssign(other.derived());
|
||||||
}
|
}
|
||||||
|
#endif // EIGEN_TEST_EVALUATORS
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
|
EIGEN_DEVICE_FUNC inline const NestByValue<Derived> nestByValue() const;
|
||||||
EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
|
EIGEN_DEVICE_FUNC inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user