10 #ifndef EIGEN_POLYNOMIAL_UTILS_H
11 #define EIGEN_POLYNOMIAL_UTILS_H
28 template <
typename Polynomials,
typename T>
32 T val=poly[poly.size()-1];
34 val = val*
x + poly[
i]; }
46 template <
typename Polynomials,
typename T>
59 val = val*inv_x + poly[
i]; }
75 template <
typename Polynomial>
80 typedef typename Polynomial::Scalar Scalar;
84 const Scalar inv_leading_coeff = Scalar(1)/poly[poly.size()-1];
88 cb +=
abs(poly[
i]*inv_leading_coeff); }
98 template <
typename Polynomial>
103 typedef typename Polynomial::Scalar Scalar;
107 while(
i<poly.size()-1 && Scalar(0) == poly(
i) ){ ++
i; }
108 if( poly.size()-1 ==
i ){
111 const Scalar inv_min_coeff = Scalar(1)/poly[
i];
114 cb +=
abs(poly[
j]*inv_min_coeff); }
128 template <
typename RootVector,
typename Polynomial>
132 typedef typename Polynomial::Scalar Scalar;
134 poly.setZero( rv.size()+1 );
135 poly[0] = -rv[0]; poly[1] = Scalar(1);
139 poly[0] = -rv[
i]*poly[0];
NumTraits< typename Polynomial::Scalar >::Real cauchy_max_bound(const Polynomial &poly)
T poly_eval_horner(const Polynomials &poly, const T &x)
NumTraits< typename Polynomial::Scalar >::Real cauchy_min_bound(const Polynomial &poly)
T poly_eval(const Polynomials &poly, const T &x)
void roots_to_monicPolynomial(const RootVector &rv, Polynomial &poly)
internal::pow_impl< ScalarX, ScalarY >::result_type pow(const ScalarX &x, const ScalarY &y)
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)
adouble abs(const adouble &x)