diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-04-19 11:21:39 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-04-19 11:21:39 +0200 |
commit | 9cd2d14005def8e7df0b0bf5fd6eb51f8a6591e9 (patch) | |
tree | ca4df13b58e923bdebd9d5f59aecda9d1e30ca58 /Eigen/src/Core/SelfCwiseBinaryOp.h | |
parent | 4e2e615a7c2c719d2d708ab32840bad353322d8c (diff) | |
parent | 46755648ec341aa5e0283b47456108bb2897b1b3 (diff) |
merge with default branch
Diffstat (limited to 'Eigen/src/Core/SelfCwiseBinaryOp.h')
-rw-r--r-- | Eigen/src/Core/SelfCwiseBinaryOp.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h index 40f9eb618..53ac6c387 100644 --- a/Eigen/src/Core/SelfCwiseBinaryOp.h +++ b/Eigen/src/Core/SelfCwiseBinaryOp.h @@ -196,7 +196,10 @@ inline Derived& DenseBase<Derived>::operator/=(const Scalar& other) internal::scalar_product_op<Scalar> >::type 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); + Scalar actual_other; + if(NumTraits<Scalar>::IsInteger) actual_other = other; + else actual_other = Scalar(1)/other; + tmp = PlainObject::Constant(rows(),cols(), actual_other); return derived(); } |