Add missing operator*

This commit is contained in:
Gael Guennebaud 2017-01-18 10:49:01 +01:00
parent 198507141b
commit e4f8dd860a

View File

@ -87,6 +87,8 @@ public:
{ return AddExpr<Derived,ValueExpr >(derived(), b); }
AddExpr<Derived,ValueExpr> operator-(Index a) const
{ return AddExpr<Derived,ValueExpr >(derived(), -a); }
ProductExpr<Derived,ValueExpr> operator*(Index a) const
{ return ProductExpr<Derived,ValueExpr>(derived(),a); }
QuotientExpr<Derived,ValueExpr> operator/(Index a) const
{ return QuotientExpr<Derived,ValueExpr>(derived(),a); }
@ -94,8 +96,10 @@ public:
{ return AddExpr<Derived,ValueExpr>(b.derived(), a); }
friend AddExpr<NegateExpr<Derived>,ValueExpr> operator-(Index a, const BaseExpr& b)
{ return AddExpr<NegateExpr<Derived>,ValueExpr>(-b.derived(), a); }
friend AddExpr<ValueExpr,Derived> operator/(Index a, const BaseExpr& b)
{ return AddExpr<ValueExpr,Derived>(a,b.derived()); }
friend ProductExpr<ValueExpr,Derived> operator*(Index a, const BaseExpr& b)
{ return ProductExpr<ValueExpr,Derived>(a,b.derived()); }
friend QuotientExpr<ValueExpr,Derived> operator/(Index a, const BaseExpr& b)
{ return QuotientExpr<ValueExpr,Derived>(a,b.derived()); }
template<typename OtherDerived>
AddExpr<Derived,OtherDerived> operator+(const BaseExpr<OtherDerived> &b) const
@ -105,6 +109,10 @@ public:
AddExpr<Derived,NegateExpr<OtherDerived> > operator-(const BaseExpr<OtherDerived> &b) const
{ return AddExpr<Derived,NegateExpr<OtherDerived> >(derived(), -b.derived()); }
template<typename OtherDerived>
ProductExpr<Derived,OtherDerived> operator*(const BaseExpr<OtherDerived> &b) const
{ return ProductExpr<Derived,OtherDerived>(derived(), b.derived()); }
template<typename OtherDerived>
QuotientExpr<Derived,OtherDerived> operator/(const BaseExpr<OtherDerived> &b) const
{ return QuotientExpr<Derived,OtherDerived>(derived(), b.derived()); }