diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 3b9dfee7a..3568cb85f 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -178,9 +178,9 @@ protected: const Scalar *m_data; // We do not need to know the outer stride for vectors - variable_if_dynamic m_outerStride; + variable_if_dynamic m_outerStride; }; template @@ -1114,143 +1114,6 @@ private: EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; } }; - -// ---------- SwapWrapper ---------- - -template -struct evaluator_impl > - : evaluator_impl_base > -{ - typedef SwapWrapper XprType; - - evaluator_impl(const XprType& swapWrapper) - : m_argImpl(swapWrapper.expression()) - { } - - typedef typename XprType::Index Index; - typedef typename XprType::Scalar Scalar; - typedef typename XprType::Packet Packet; - - // This function and the next one are needed by assign to correctly align loads/stores - // TODO make Assign use .data() - Scalar& coeffRef(Index row, Index col) - { - return m_argImpl.coeffRef(row, col); - } - - inline Scalar& coeffRef(Index index) - { - return m_argImpl.coeffRef(index); - } - - template - void copyCoeff(Index row, Index col, const OtherEvaluatorType& other) - { - OtherEvaluatorType& nonconst_other = const_cast(other); - Scalar tmp = m_argImpl.coeff(row, col); - m_argImpl.coeffRef(row, col) = nonconst_other.coeff(row, col); - nonconst_other.coeffRef(row, col) = tmp; - } - - template - void copyCoeff(Index index, const OtherEvaluatorType& other) - { - OtherEvaluatorType& nonconst_other = const_cast(other); - Scalar tmp = m_argImpl.coeff(index); - m_argImpl.coeffRef(index) = nonconst_other.coeff(index); - nonconst_other.coeffRef(index) = tmp; - } - - template - void copyPacket(Index row, Index col, const OtherEvaluatorType& other) - { - OtherEvaluatorType& nonconst_other = const_cast(other); - Packet tmp = m_argImpl.template packet(row, col); - m_argImpl.template writePacket - (row, col, nonconst_other.template packet(row, col)); - nonconst_other.template writePacket(row, col, tmp); - } - - template - void copyPacket(Index index, const OtherEvaluatorType& other) - { - OtherEvaluatorType& nonconst_other = const_cast(other); - Packet tmp = m_argImpl.template packet(index); - m_argImpl.template writePacket - (index, nonconst_other.template packet(index)); - nonconst_other.template writePacket(index, tmp); - } - -protected: - typename evaluator::nestedType m_argImpl; -}; - - -// ---------- SelfCwiseBinaryOp ---------- - -template -struct evaluator_impl > - : evaluator_impl_base > -{ - typedef SelfCwiseBinaryOp XprType; - - evaluator_impl(const XprType& selfCwiseBinaryOp) - : m_argImpl(selfCwiseBinaryOp.expression()), - m_functor(selfCwiseBinaryOp.functor()) - { } - - typedef typename XprType::Index Index; - typedef typename XprType::Scalar Scalar; - typedef typename XprType::Packet Packet; - - // This function and the next one are needed by assign to correctly align loads/stores - // TODO make Assign use .data() - Scalar& coeffRef(Index row, Index col) - { - return m_argImpl.coeffRef(row, col); - } - - inline Scalar& coeffRef(Index index) - { - return m_argImpl.coeffRef(index); - } - - template - void copyCoeff(Index row, Index col, const OtherEvaluatorType& other) - { - Scalar& tmp = m_argImpl.coeffRef(row, col); - tmp = m_functor(tmp, other.coeff(row, col)); - } - - template - void copyCoeff(Index index, const OtherEvaluatorType& other) - { - Scalar& tmp = m_argImpl.coeffRef(index); - tmp = m_functor(tmp, other.coeff(index)); - } - - template - void copyPacket(Index row, Index col, const OtherEvaluatorType& other) - { - const Packet res = m_functor.packetOp(m_argImpl.template packet(row, col), - other.template packet(row, col)); - m_argImpl.template writePacket(row, col, res); - } - - template - void copyPacket(Index index, const OtherEvaluatorType& other) - { - const Packet res = m_functor.packetOp(m_argImpl.template packet(index), - other.template packet(index)); - m_argImpl.template writePacket(index, res); - } - -protected: - typename evaluator::nestedType m_argImpl; - const BinaryOp m_functor; -}; - - } // namespace internal } // end namespace Eigen