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 876 by tim, Mon Jan 30 22:25:27 2006 UTC vs.
Revision 1230 by cpuglis, Fri Mar 7 19:37:14 2008 UTC

# Line 53 | Line 53
53   #include <list>
54   #include <map>
55   #include <utility>
56 <
56 > #include "config.h"
57   namespace oopse {
58  
59    template<typename ElemType> ElemType pow(ElemType x, int N) {
# Line 189 | Line 189 | namespace oopse {
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) {
209          typename Polynomial<ElemType>::const_iterator i;
210  
# Line 204 | Line 220 | namespace oopse {
220          for (i =  p.begin(); i  != p.end(); ++i) {
221            this->addCoefficient(i->first, -i->second);
222          }        
223 +        return *this;
224      }
225  
226      PolynomialType& operator *= (const PolynomialType& p) {
# Line 310 | Line 327 | namespace oopse {
327  
328    /**
329     * Tests if two polynomial have the same exponents
330 <   * @return true if these all of the exponents in these Polynomial are identical
330 >   * @return true if all of the exponents in these Polynomial are identical
331     * @param p1 the first polynomial
332     * @param p2 the second polynomial
333     * @note this function does not compare the coefficient
# Line 334 | Line 351 | namespace oopse {
351      return true;
352    }
353  
354 <  typedef Polynomial<double> DoublePolynomial;
354 >  typedef Polynomial<RealType> DoublePolynomial;
355  
356   } //end namespace oopse
357   #endif //MATH_POLYNOMIAL_HPP

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines