26 #ifndef __SYNFIG_POLYNOMIAL_ROOT_H
27 #define __SYNFIG_POLYNOMIAL_ROOT_H
39 template <
typename T =
float,
typename F =
float >
45 void degree(
unsigned int d,
const T & def = (T)0) { resize(d+1,def); }
46 unsigned int degree()
const {
return this->size() - 1; }
50 if(p.size() > this->size())
51 resize(p.size(), (T)0);
53 for(
int i = 0; i < p.size(); ++i)
62 if(p.size() > this->size())
63 resize(p.size(), (T)0);
65 for(
int i = 0; i < p.size(); ++i)
81 std::vector<T> nc(*
this);
84 for(i = 0; i < nc.size(); ++i)
89 if(p.size() < 2)
return *
this;
91 this->resize(this->size() + p.
degree());
92 for(i = 0; i < nc.size(); ++i)
94 for(j = 1; j < p.size(); ++j)
96 nc[i+j] += nc[i]*p[j];
106 std::vector< std::complex<float> > workcoefs;
110 std::vector< std::complex<float> >
coefs;
112 std::vector< std::complex<float> >
roots;