From 9f899808d716474a758c6b31f1b0102a379ab1f4 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 18 Jan 2010 22:56:47 +0100 Subject: [PATCH] fix scalar - matrix --- Eigen/src/plugins/ArrayCwiseBinaryOps.h | 4 ++-- 1 file 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, Derived> +friend inline const CwiseUnaryOp, CwiseUnaryOp,Derived> > operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& other) { - return other + (-scalar); + return (-other) + scalar; } /** Substracts the given \a scalar from each coeff of this expression.