diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-10-25 10:15:22 -0400 |
commit | 4716040703be1ee906439385d20475dcddad5ce3 (patch) | |
tree | 8efd3cf3007d8360e66f38e2d280127cbb70daa6 /Eigen/src/Core/SelfCwiseBinaryOp.h | |
parent | ca85a1f6c5fc33ac382aa2d7ba2da63d55d3223e (diff) |
bug #86 : use internal:: namespace instead of ei_ prefix
Diffstat (limited to 'Eigen/src/Core/SelfCwiseBinaryOp.h')
-rw-r--r-- | Eigen/src/Core/SelfCwiseBinaryOp.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h index f77589747..9a649c1ee 100644 --- a/Eigen/src/Core/SelfCwiseBinaryOp.h +++ b/Eigen/src/Core/SelfCwiseBinaryOp.h @@ -39,28 +39,31 @@ * * \sa class SwapWrapper for a similar trick. */ + +namespace internal { template<typename BinaryOp, typename Lhs, typename Rhs> -struct ei_traits<SelfCwiseBinaryOp<BinaryOp,Lhs,Rhs> > - : ei_traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> > +struct traits<SelfCwiseBinaryOp<BinaryOp,Lhs,Rhs> > + : traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> > { enum { // Note that it is still a good idea to preserve the DirectAccessBit // so that assign can correctly align the data. - Flags = ei_traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >::Flags | (Lhs::Flags&DirectAccessBit) | (Lhs::Flags&LvalueBit), + Flags = traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >::Flags | (Lhs::Flags&DirectAccessBit) | (Lhs::Flags&LvalueBit), OuterStrideAtCompileTime = Lhs::OuterStrideAtCompileTime, InnerStrideAtCompileTime = Lhs::InnerStrideAtCompileTime }; }; +} template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp - : public ei_dense_xpr_base< SelfCwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type + : public internal::dense_xpr_base< SelfCwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type { public: - typedef typename ei_dense_xpr_base<SelfCwiseBinaryOp>::type Base; + typedef typename internal::dense_xpr_base<SelfCwiseBinaryOp>::type Base; EIGEN_DENSE_PUBLIC_INTERFACE(SelfCwiseBinaryOp) - typedef typename ei_packet_traits<Scalar>::type Packet; + typedef typename internal::packet_traits<Scalar>::type Packet; inline SelfCwiseBinaryOp(Lhs& xpr, const BinaryOp& func = BinaryOp()) : m_matrix(xpr), m_functor(func) {} @@ -88,7 +91,7 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp void copyCoeff(Index row, Index col, const DenseBase<OtherDerived>& other) { OtherDerived& _other = other.const_cast_derived(); - ei_internal_assert(row >= 0 && row < rows() + eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); Scalar& tmp = m_matrix.coeffRef(row,col); tmp = m_functor(tmp, _other.coeff(row,col)); @@ -98,7 +101,7 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp void copyCoeff(Index index, const DenseBase<OtherDerived>& other) { OtherDerived& _other = other.const_cast_derived(); - ei_internal_assert(index >= 0 && index < m_matrix.size()); + eigen_internal_assert(index >= 0 && index < m_matrix.size()); Scalar& tmp = m_matrix.coeffRef(index); tmp = m_functor(tmp, _other.coeff(index)); } @@ -107,7 +110,7 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp void copyPacket(Index row, Index col, const DenseBase<OtherDerived>& other) { OtherDerived& _other = other.const_cast_derived(); - ei_internal_assert(row >= 0 && row < rows() + eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); m_matrix.template writePacket<StoreMode>(row, col, m_functor.packetOp(m_matrix.template packet<StoreMode>(row, col),_other.template packet<LoadMode>(row, col)) ); @@ -117,7 +120,7 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp void copyPacket(Index index, const DenseBase<OtherDerived>& other) { OtherDerived& _other = other.const_cast_derived(); - ei_internal_assert(index >= 0 && index < m_matrix.size()); + eigen_internal_assert(index >= 0 && index < m_matrix.size()); m_matrix.template writePacket<StoreMode>(index, m_functor.packetOp(m_matrix.template packet<StoreMode>(index),_other.template packet<LoadMode>(index)) ); } @@ -131,10 +134,10 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename RhsDerived::Scalar); #ifdef EIGEN_DEBUG_ASSIGN - ei_assign_traits<SelfCwiseBinaryOp, RhsDerived>::debug(); + internal::assign_traits<SelfCwiseBinaryOp, RhsDerived>::debug(); #endif - ei_assert(rows() == rhs.rows() && cols() == rhs.cols()); - ei_assign_impl<SelfCwiseBinaryOp, RhsDerived>::run(*this,rhs.derived()); + eigen_assert(rows() == rhs.rows() && cols() == rhs.cols()); + internal::assign_impl<SelfCwiseBinaryOp, RhsDerived>::run(*this,rhs.derived()); #ifndef EIGEN_NO_DEBUG this->checkTransposeAliasing(rhs.derived()); #endif @@ -146,7 +149,7 @@ template<typename BinaryOp, typename Lhs, typename Rhs> class SelfCwiseBinaryOp // at first... SelfCwiseBinaryOp& operator=(const Rhs& _rhs) { - typename ei_nested<Rhs>::type rhs(_rhs); + typename internal::nested<Rhs>::type rhs(_rhs); return Base::operator=(rhs); } @@ -162,7 +165,7 @@ template<typename Derived> inline Derived& DenseBase<Derived>::operator*=(const Scalar& other) { typedef typename Derived::PlainObject PlainObject; - SelfCwiseBinaryOp<ei_scalar_product_op<Scalar>, Derived, typename PlainObject::ConstantReturnType> tmp(derived()); + SelfCwiseBinaryOp<internal::scalar_product_op<Scalar>, Derived, typename PlainObject::ConstantReturnType> tmp(derived()); tmp = PlainObject::Constant(rows(),cols(),other); return derived(); } @@ -170,9 +173,9 @@ inline Derived& DenseBase<Derived>::operator*=(const Scalar& other) template<typename Derived> inline Derived& DenseBase<Derived>::operator/=(const Scalar& other) { - typedef typename ei_meta_if<NumTraits<Scalar>::IsInteger, - ei_scalar_quotient_op<Scalar>, - ei_scalar_product_op<Scalar> >::ret BinOp; + typedef typename internal::meta_if<NumTraits<Scalar>::IsInteger, + internal::scalar_quotient_op<Scalar>, + internal::scalar_product_op<Scalar> >::ret BinOp; typedef typename Derived::PlainObject PlainObject; SelfCwiseBinaryOp<BinOp, Derived, typename PlainObject::ConstantReturnType> tmp(derived()); tmp = PlainObject::Constant(rows(),cols(), NumTraits<Scalar>::IsInteger ? other : Scalar(1)/other); |