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 ){
109 const Scalar inv_min_coeff =
Scalar(1)/poly[
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);
137 poly[0] = -rv[
i]*poly[0];
143 #endif // EIGEN_POLYNOMIAL_UTILS_H
T poly_eval_horner(const Polynomials &poly, const T &x)
T poly_eval(const Polynomials &poly, const T &x)
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void roots_to_monicPolynomial(const RootVector &rv, Polynomial &poly)
Eigen::Triplet< double > T
EIGEN_DEVICE_FUNC internal::pow_impl< ScalarX, ScalarY >::result_type pow(const ScalarX &x, const ScalarY &y)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
mp::number< mp::cpp_dec_float< 100 >, mp::et_on > Real
NumTraits< typename Polynomial::Scalar >::Real cauchy_min_bound(const Polynomial &poly)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC bool abs2(bool x)
NumTraits< typename Polynomial::Scalar >::Real cauchy_max_bound(const Polynomial &poly)