fix scalar - matrix

This commit is contained in:
Gael Guennebaud 2010-01-18 22:56:47 +01:00
parent 0158d78906
commit 9f899808d7

View File

@ -245,10 +245,10 @@ operator-(const Scalar& scalar) const
return *this + (-scalar); 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) 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. /** Substracts the given \a scalar from each coeff of this expression.