aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/ArrayCwiseBinaryOps.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-01-18 22:56:47 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-01-18 22:56:47 +0100
commit9f899808d716474a758c6b31f1b0102a379ab1f4 (patch)
tree3728e526753d7feb5b29f7d2bd301bcd44e22290 /Eigen/src/plugins/ArrayCwiseBinaryOps.h
parent0158d789067613b256cafc1f52790a2bb6df39c2 (diff)
fix scalar - matrix
Diffstat (limited to 'Eigen/src/plugins/ArrayCwiseBinaryOps.h')
-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.