--- trunk/src/math/Polynomial.hpp 2006/05/17 21:51:42 963 +++ trunk/src/math/Polynomial.hpp 2008/03/07 19:37:14 1230 @@ -187,6 +187,22 @@ namespace oopse { size_t size() { return polyPairMap_.size(); + } + + PolynomialType& operator = (const PolynomialType& p) { + + if (this != &p) // protect against invalid self-assignment + { + typename Polynomial::const_iterator i; + + polyPairMap_.clear(); // clear out the old map + + for (i = p.begin(); i != p.end(); ++i) { + this->setCoefficient(i->first, i->second); + } + } + // by convention, always return *this + return *this; } PolynomialType& operator += (const PolynomialType& p) {