--- trunk/src/math/Polynomial.hpp 2005/11/16 23:10:02 749 +++ trunk/src/math/Polynomial.hpp 2006/02/01 17:26:43 877 @@ -204,6 +204,7 @@ namespace oopse { for (i = p.begin(); i != p.end(); ++i) { this->addCoefficient(i->first, -i->second); } + return *this; } PolynomialType& operator *= (const PolynomialType& p) { @@ -245,6 +246,30 @@ namespace oopse { return p; } + template + Polynomial operator *(const Polynomial& p, const ElemType v) { + typename Polynomial::const_iterator i; + Polynomial result; + + for (i = p.begin(); i !=p.end(); ++i) { + result.addCoefficient( i->first , i->second * v); + } + + return result; + } + + template + Polynomial operator *( const ElemType v, const Polynomial& p) { + typename Polynomial::const_iterator i; + Polynomial result; + + for (i = p.begin(); i !=p.end(); ++i) { + result.addCoefficient( i->first , i->second * v); + } + + return result; + } + /** * Generates and returns the sum of two given Polynomials. * @param p1 the first polynomial