10 #ifndef EIGEN_POLYNOMIAL_UTILS_H
11 #define EIGEN_POLYNOMIAL_UTILS_H
26 template <
typename Polynomials,
typename T>
30 T val=poly[poly.size()-1];
32 val = val*
x + poly[i]; }
44 template <
typename Polynomials,
typename T>
57 val = val*inv_x + poly[i]; }
73 template <
typename Polynomial>
82 const Scalar inv_leading_coeff =
Scalar(1)/poly[poly.size()-1];
86 cb +=
abs(poly[i]*inv_leading_coeff); }
96 template <
typename Polynomial>
105 while( i<poly.size()-1 &&
Scalar(0) == poly(i) ){ ++i; }
106 if( poly.size()-1 == i ){
112 cb +=
abs(poly[j]*inv_min_coeff); }
126 template <
typename RootVector,
typename Polynomial>
132 poly.setZero( rv.size()+1 );
133 poly[0] = -rv[0]; poly[1] =
Scalar(1);
136 for(
DenseIndex j=i+1; j>0; --j ){ poly[j] = poly[j-1] - rv[i]*poly[j]; }
137 poly[0] = -rv[i]*poly[0];
143 #endif // EIGEN_POLYNOMIAL_UTILS_H