Fix /= when using evaluator as in changeset 2d90484450

This commit is contained in:
Gael Guennebaud
2014-09-14 18:27:48 +02:00
parent 749b56f6af
commit dfc54e1bbf
2 changed files with 16 additions and 12 deletions

View File

@@ -212,17 +212,7 @@ template<typename Derived>
inline Derived& DenseBase<Derived>::operator/=(const Scalar& other)
{
typedef typename Derived::PlainObject PlainObject;
typedef typename internal::conditional<NumTraits<Scalar>::IsInteger,
internal::div_assign_op<Scalar>,
internal::mul_assign_op<Scalar> >::type AssignOp;
Scalar actual_other;
if(NumTraits<Scalar>::IsInteger) actual_other = other;
else actual_other = Scalar(1)/other;
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),actual_other), AssignOp());
internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar>());
return derived();
}
#else