#include <vnl_rpoly_roots.h>
Uses algorithm 493 from ACM Trans. Math. Software - the Jenkins-Traub algorithm, described by Numerical Recipes under "Other sure-fire techniques" as "practically a standard in black-box polynomial rootfinders". (See M.A. Jenkins, ACM TOMS 1 (1975) pp. 178-189.).
This class is not very const-correct as it is intended as a compute object rather than a data object.
Definition at line 36 of file vnl_rpoly_roots.h.
Public Member Functions | |
| vnl_rpoly_roots (const vnl_vector< double > &a) | |
| The constructor calculates the roots. | |
| vnl_rpoly_roots (const vnl_real_polynomial &poly) | |
| Calculate roots of a vnl_real_polynomial. Same comments apply. | |
| vcl_complex< double > | operator[] (int i) const |
| Return i'th complex root. | |
| vnl_vector< vcl_complex< double > > | roots () const |
| Complex vector of all roots. | |
| const double & | real (int i) const |
| Real part of root I. | |
| const double & | imag (int i) const |
| Imaginary part of root I. | |
| vnl_vector< double > & | real () |
| Vector of real parts of roots. | |
| vnl_vector< double > & | imag () |
| Vector of imaginary parts of roots. | |
| vnl_vector< double > | realroots (double tol=1e-12) const |
| Return real roots only. | |
| bool | compute () |
| Compute roots using Jenkins-Traub algorithm. | |
| bool | compute_qr () |
| Compute roots using QR decomposition of companion matrix. [unimplemented]. | |
| bool | compute_laguerre () |
| Compute roots using Laguerre algorithm. [unimplemented]. | |
Protected Attributes | |
| vnl_vector< double > | coeffs_ |
| vnl_vector< double > | r_ |
| vnl_vector< double > | i_ |
| int | num_roots_found_ |
|
|
The constructor calculates the roots.
This is the most efficient interface as all the result variables are initialized to the correct size. The polynomial is Note that if the routine fails, not all roots will be found. In this case, the "realroots" and "roots" functions will return fewer than n roots. Definition at line 25 of file vnl_rpoly_roots.cxx. |
|
|
Calculate roots of a vnl_real_polynomial. Same comments apply.
Definition at line 36 of file vnl_rpoly_roots.cxx. |
|
|
Compute roots using Jenkins-Traub algorithm. Calls rpoly and interprets failure codes. Definition at line 74 of file vnl_rpoly_roots.cxx. |
|
|
Compute roots using Laguerre algorithm. [unimplemented].
|
|
|
Compute roots using QR decomposition of companion matrix. [unimplemented].
|
|
|
Vector of imaginary parts of roots.
Definition at line 72 of file vnl_rpoly_roots.h. |
|
|
Imaginary part of root I.
Definition at line 66 of file vnl_rpoly_roots.h. |
|
|
Return i'th complex root.
Definition at line 57 of file vnl_rpoly_roots.h. |
|
|
Vector of real parts of roots.
Definition at line 69 of file vnl_rpoly_roots.h. |
|
|
Real part of root I.
Definition at line 63 of file vnl_rpoly_roots.h. |
|
|
Return real roots only. Roots are real if the absolute value of their imaginary part is less than the optional argument TOL. TOL defaults to 1e-12 [untested] Definition at line 56 of file vnl_rpoly_roots.cxx. |
|
|
Complex vector of all roots.
Definition at line 45 of file vnl_rpoly_roots.cxx. |
|
|
Definition at line 92 of file vnl_rpoly_roots.h. |
|
|
Definition at line 95 of file vnl_rpoly_roots.h. |
|
|
Definition at line 97 of file vnl_rpoly_roots.h. |
|
|
Definition at line 94 of file vnl_rpoly_roots.h. |
1.4.4