aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/plugins/ArrayCwiseBinaryOps.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h
index dc17284e2..87d1d4145 100644
--- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h
@@ -245,10 +245,10 @@ operator-(const Scalar& scalar) const
return *this + (-scalar);
}
-friend inline const CwiseUnaryOp<ei_scalar_add_op<Scalar>, Derived>
+friend inline const CwiseUnaryOp<ei_scalar_add_op<Scalar>, CwiseUnaryOp<ei_scalar_opposite_op<Scalar>,Derived> >
operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& other)
{
- return other + (-scalar);
+ return (-other) + scalar;
}
/** Substracts the given \a scalar from each coeff of this expression.