[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
Polynomials and root determination |
Classes | |
class | Polynomial< T > |
class | PolynomialView< T > |
class | StaticPolynomial< MAXORDER, T > |
Functions | |
template<class POLYNOMIAL , class VECTOR > | |
bool | polynomialRealRoots (POLYNOMIAL const &p, VECTOR &roots, bool polishRoots) |
template<class POLYNOMIAL , class VECTOR > | |
bool | polynomialRoots (POLYNOMIAL const &poriginal, VECTOR &roots, bool polishRoots) |
Classes to represent polynomials and functions to find polynomial roots.
bool vigra::polynomialRoots | ( | POLYNOMIAL const & | poriginal, |
VECTOR & | roots, | ||
bool | polishRoots | ||
) |
Determine the roots of the polynomial poriginal
.
The roots are appended to the vector roots
, with optional root polishing as specified by polishRoots
(default: do polishing). The function uses an improved version of Laguerre's algorithm. The improvements are as follows:
The algorithm has been successfully used for polynomials up to order 80. The function stops and returns 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:
Usage:
#include <vigra/polynomial.hxx>
Namespace: vigra
bool vigra::polynomialRealRoots | ( | POLYNOMIAL const & | p, |
VECTOR & | roots, | ||
bool | polishRoots | ||
) |
Determine the real roots of the polynomial p
.
This function simply calls polynomialRoots() and than throws away all complex roots. Accordingly, VECTOR
must be compatible to std::vector
with a value_type
compatible to the type POLYNOMIAL::Real
.
Declaration:
pass arguments explicitly:
Usage:
#include <vigra/polynomial.hxx>
Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|