[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]
![]() |
Polynomials and root determination | ![]() |
---|
Classes | |
class | Polynomial |
class | PolynomialView |
class | StaticPolynomial |
Functions | |
template<...> bool | polynomialRoots (POLYNOMIAL const &poriginal, VECTOR &roots, bool polishRoots) |
template<...> bool | polynomialRealRoots (POLYNOMIAL const &p, VECTOR &roots, bool polishRoots) |
Detailed Description |
bool polynomialRealRoots (...) |
Determine the real roots of the polynomial
This function simply calls polynomialRoots() and than throws away all complex roots. Accordingly, Declaration: pass arguments explicitly: namespace vigra { template <class POLYNOMIAL, class VECTOR> bool polynomialRealRoots(POLYNOMIAL const & p, VECTOR & roots, bool polishRoots = true); } Usage:
#include "vigra/polynomial.hxx"
// encode the polynomial x^4 - 1 Polynomial<double> poly(4); poly[0] = -1.0; poly[4] = 1.0; ArrayVector<double> roots; polynomialRealRoots(poly, roots); |
bool polynomialRoots (...) |
Determine the roots of the polynomial
The roots are appended to the vector
false if an iteration fails to converge within 80 steps. The type POLYNOMIAL must be compatible to vigra::PolynomialView, VECTOR must be compatible to std::vector with a value_type compatible to the type POLYNOMIAL::Complex .
Declaration: pass arguments explicitly: namespace vigra { template <class POLYNOMIAL, class VECTOR> bool polynomialRoots(POLYNOMIAL const & poriginal, VECTOR & roots, bool polishRoots = true); } Usage:
#include "vigra/polynomial.hxx"
// encode the polynomial x^4 - 1 Polynomial<double> poly(4); poly[0] = -1.0; poly[4] = 1.0; ArrayVector<std::complex<double> > roots; polynomialRoots(poly, roots); |
© Ullrich Köthe (koethe@informatik.uni-hamburg.de) |
html generated using doxygen and Python
|