Home | History | Annotate | Download | only in Polynomials

Lines Matching refs:poly

18  * \param[in] poly : the vector of coefficients of the polynomial ordered
19 * by degrees i.e. poly[i] is the coefficient of degree i of the polynomial
28 T poly_eval_horner( const Polynomials& poly, const T& x )
30 T val=poly[poly.size()-1];
31 for(DenseIndex i=poly.size()-2; i>=0; --i ){
32 val = val*x + poly[i]; }
39 * \param[in] poly : the vector of coefficients of the polynomial ordered
40 * by degrees i.e. poly[i] is the coefficient of degree i of the polynomial
46 T poly_eval( const Polynomials& poly, const T& x )
51 return poly_eval_horner( poly, x ); }
54 T val=poly[0];
56 for( DenseIndex i=1; i<poly.size(); ++i ){
57 val = val*inv_x + poly[i]; }
59 return std::pow(x,(T)(poly.size()-1)) * val;
66 * \param[in] poly : the vector of coefficients of the polynomial ordered
67 * by degrees i.e. poly[i] is the coefficient of degree i of the polynomial
71 * <dd> the leading coefficient of the input polynomial poly must be non zero </dd>
75 typename NumTraits<typename Polynomial::Scalar>::Real cauchy_max_bound( const Polynomial& poly )
81 eigen_assert( Scalar(0) != poly[poly.size()-1] );
82 const Scalar inv_leading_coeff = Scalar(1)/poly[poly.size()-1];
85 for( DenseIndex i=0; i<poly.size()-1; ++i ){
86 cb += abs(poly[i]*inv_leading_coeff); }
92 * \param[in] poly : the vector of coefficients of the polynomial ordered
93 * by degrees i.e. poly[i] is the coefficient of degree i of the polynomial
98 typename NumTraits<typename Polynomial::Scalar>::Real cauchy_min_bound( const Polynomial& poly )
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];
111 for( DenseIndex j=i+1; j<poly.size(); ++j ){
112 cb += abs(poly[j]*inv_min_coeff); }
122 * \param[out] poly : the vector of coefficients of the polynomial ordered
123 * by degrees i.e. poly[i] is the coefficient of degree i of the polynomial
127 void roots_to_monicPolynomial( const RootVector& rv, Polynomial& poly )
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];