24 : coeffs_(a), r_(coeffs_.size()-1), i_(coeffs_.size()-1)
35 : coeffs_(poly.coefficients()), r_(poly.degree()), i_(poly.degree())
47 ret[i] = std::complex<double>(
r_[i],
i_[i]);
58 if (std::fabs(
i_[i]) < tol)
64 if (std::fabs(
i_[i]) < tol)
76 v3p_netlib_rpoly_global_t rpoly_global;
88 std::cerr <<
"vnl_rpoly_roots: Leading coefficient is zero. Not allowed.\n";
90 std::cerr <<
"vnl_rpoly_roots: Calculation failed, only " << n <<
" roots found\n";
size_t size() const
Return the length, number of elements, dimension of this vector.
T const * data_block() const
Access the contiguous block storing the elements in the vector. O(1).
vnl_rpoly_roots(const vnl_vector< double > &a)
The constructor calculates the roots.
vnl_vector< double > coeffs_
const vnl_vector< double > & coefficients() const
Return the vector of coefficients.
Evaluation of real polynomials at real and complex points.
Declare in a central place the list of symbols from netlib.
void assert_finite() const
Check that this is finite if not, abort();.
Finds roots of a real polynomial.
vnl_vector< double > realroots(double tol=1e-12) const
Return real roots only.
bool compute()
Compute roots using Jenkins-Traub algorithm.
vnl_vector< std::complex< double > > roots() const
Complex vector of all roots.
Evaluation of real polynomials.