![]() |
|
Template functor for scalar/packet assignment with swapping. More...
#include <AssignmentFunctors.h>
Public Member Functions | |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void | assignCoeff (Scalar &a, const Scalar &b) const |
Template functor for scalar/packet assignment with swapping.
It works as follow. For a non-vectorized evaluation loop, we have: for(i) func(A.coeffRef(i), B.coeff(i)); where B is a SwapWrapper expression. The trick is to make SwapWrapper::coeff behaves like a non-const coeffRef. Actually, SwapWrapper might not even be needed since even if B is a plain expression, since it has to be writable B.coeff already returns a const reference to the underlying scalar value.
The case of a vectorized loop is more tricky: for(i,j) func.assignPacket<A_Align>(&A.coeffRef(i,j), B.packet<B_Align>(i,j)); Here, B must be a SwapWrapper whose packet function actually returns a proxy object holding a Scalar*, the actual alignment and Packet type.
|
inline |
References a, b, swap(), Eigen::internal::swap(), and plotPSD::t.