aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/SelfCwiseBinaryOp.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-02-23 20:13:21 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-02-23 20:13:21 +0100
commit274c24c26295735011df381df5fb270e59b378c1 (patch)
tree738fd58c8faf270444b14403c85af36f69aa8322 /Eigen/src/Core/SelfCwiseBinaryOp.h
parent74438f8aa9bfef7f1e609daa7e972cb5d82967c8 (diff)
Avoid problematic ternary operator (http://forum.kde.org/viewtopic.php?f=74&t=109486)
Diffstat (limited to 'Eigen/src/Core/SelfCwiseBinaryOp.h')
-rw-r--r--Eigen/src/Core/SelfCwiseBinaryOp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Eigen/src/Core/SelfCwiseBinaryOp.h b/Eigen/src/Core/SelfCwiseBinaryOp.h
index 0caf2bab1..22f3047b4 100644
--- a/Eigen/src/Core/SelfCwiseBinaryOp.h
+++ b/Eigen/src/Core/SelfCwiseBinaryOp.h
@@ -185,7 +185,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();
}