25 #ifndef EIGEN_SELFCWISEBINARYOP_H
26 #define EIGEN_SELFCWISEBINARYOP_H
46 template<
typename BinaryOp,
typename Lhs,
typename Rhs>
47 struct traits<SelfCwiseBinaryOp<BinaryOp,Lhs,Rhs> >
48 :
traits<CwiseBinaryOp<BinaryOp,Lhs,Rhs> >
54 OuterStrideAtCompileTime = Lhs::OuterStrideAtCompileTime,
55 InnerStrideAtCompileTime = Lhs::InnerStrideAtCompileTime
61 :
public internal::dense_xpr_base< SelfCwiseBinaryOp<BinaryOp, Lhs, Rhs> >::type
65 typedef typename internal::dense_xpr_base<SelfCwiseBinaryOp>::type
Base;
68 typedef typename internal::packet_traits<Scalar>::type
Packet;
83 return m_matrix.const_cast_derived().coeffRef(row, col);
95 return m_matrix.const_cast_derived().coeffRef(index);
97 inline const Scalar&
coeffRef(Index index)
const
99 return m_matrix.const_cast_derived().coeffRef(index);
102 template<
typename OtherDerived>
105 OtherDerived& _other = other.const_cast_derived();
107 && col >= 0 && col <
cols());
108 Scalar& tmp =
m_matrix.coeffRef(row,col);
109 tmp =
m_functor(tmp, _other.coeff(row,col));
112 template<
typename OtherDerived>
115 OtherDerived& _other = other.const_cast_derived();
117 Scalar& tmp =
m_matrix.coeffRef(index);
118 tmp =
m_functor(tmp, _other.coeff(index));
121 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
124 OtherDerived& _other = other.const_cast_derived();
126 && col >= 0 && col <
cols());
128 m_functor.packetOp(
m_matrix.template packet<StoreMode>(row, col),_other.template packet<LoadMode>(row, col)) );
131 template<
typename OtherDerived,
int StoreMode,
int LoadMode>
134 OtherDerived& _other = other.const_cast_derived();
136 m_matrix.template writePacket<StoreMode>(index,
137 m_functor.packetOp(
m_matrix.template packet<StoreMode>(index),_other.template packet<LoadMode>(index)) );
142 template<
typename RhsDerived>
148 #ifdef EIGEN_DEBUG_ASSIGN
149 internal::assign_traits<SelfCwiseBinaryOp, RhsDerived>::debug();
152 internal::assign_impl<SelfCwiseBinaryOp, RhsDerived>::run(*
this,rhs.derived());
153 #ifndef EIGEN_NO_DEBUG
154 this->checkTransposeAliasing(rhs.derived());
164 typename internal::nested<Rhs>::type rhs(_rhs);
186 template<
typename Derived>
189 typedef typename Derived::PlainObject PlainObject;
191 tmp = PlainObject::Constant(rows(),cols(),other);
195 template<
typename Derived>
198 typedef typename internal::conditional<NumTraits<Scalar>::IsInteger,
199 internal::scalar_quotient_op<Scalar>,
200 internal::scalar_product_op<Scalar> >::type BinOp;
201 typedef typename Derived::PlainObject PlainObject;
209 #endif // EIGEN_SELFCWISEBINARYOP_H