Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/polynomial.h
- Timestamp:
- 03/02/07 19:04:28 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/polynomial.h
r2207 r2386 51 51 template<class U> Polynomial(const Polynomial<U> &u) : _coeff(u.deg()+1) 52 52 { 53 for(int i=0;i< (int)_coeff.size();i++) _coeff[i]=u[i];53 for(int i=0;i<int(_coeff.size());i++) _coeff[i]=u[i]; 54 54 } 55 55 ///Query the degree of the polynomial. … … 112 112 Polynomial &derivateMyself() 113 113 { 114 for(int i=1;i< (int)_coeff.size();i++) _coeff[i-1]=i*_coeff[i];114 for(int i=1;i<int(_coeff.size());i++) _coeff[i-1]=i*_coeff[i]; 115 115 _coeff.pop_back(); 116 116 return *this; … … 121 121 { 122 122 Polynomial tmp(deg()-1); 123 for(int i=1;i< (int)_coeff.size();i++) tmp[i-1]=i*_coeff[i];123 for(int i=1;i<int(_coeff.size());i++) tmp[i-1]=i*_coeff[i]; 124 124 return tmp; 125 125 } … … 139 139 Polynomial tmp(deg()+1); 140 140 tmp[0]=0; 141 for(int i=0;i< (int)_coeff.size();i++) tmp[i+1]=_coeff[i]/(i+1);141 for(int i=0;i<int(_coeff.size());i++) tmp[i+1]=_coeff[i]/(i+1); 142 142 return tmp; 143 143 } … … 148 148 { 149 149 if(p.deg()>deg()) _coeff.resize(p.deg()+1); 150 for(int i=0;i<= (int)std::min(deg(),p.deg());i++)150 for(int i=0;i<=int(std::min(deg(),p.deg()));i++) 151 151 _coeff[i]+=p[i]; 152 152 return *this;
Note: See TracChangeset
for help on using the changeset viewer.