ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/math/Polynomial.hpp
(Generate patch)

Comparing trunk/src/math/Polynomial.hpp (file contents):
Revision 1229 by tim, Wed May 17 21:51:42 2006 UTC vs.
Revision 1230 by cpuglis, Fri Mar 7 19:37:14 2008 UTC

# Line 187 | Line 187 | namespace oopse {
187  
188      size_t size() {
189        return polyPairMap_.size();
190 +    }
191 +
192 +    PolynomialType& operator = (const PolynomialType& p) {
193 +
194 +      if (this != &p)  // protect against invalid self-assignment
195 +      {
196 +        typename Polynomial<ElemType>::const_iterator i;
197 +
198 +        polyPairMap_.clear();  // clear out the old map
199 +      
200 +        for (i =  p.begin(); i != p.end(); ++i) {
201 +          this->setCoefficient(i->first, i->second);
202 +        }
203 +      }
204 +      // by convention, always return *this
205 +      return *this;
206      }
207  
208      PolynomialType& operator += (const PolynomialType& p) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines