#include <rootsolve.h>
Inheritance diagram for NUM::PolyRootSolver_Sturm:
Public Member Functions | |
PolyRootSolver_Sturm () | |
~PolyRootSolver_Sturm () | |
int | solve (int order, const dbl *c, dbl *r) |
Public Attributes | |
Params | par |
Static Public Attributes | |
const Params | defaults |
Default values of the parameters. | |
Private Member Functions | |
int | modrf (int ord, dbl *coef, dbl a, dbl b, dbl *val) |
int | modp (poly *u, poly *v, poly *r) |
int | buildsturm (int ord, poly *sseq) |
int | numroots (int np, poly *sseq, int *atneg, int *atpos) |
int | numchanges (int np, poly *sseq, dbl a) |
int | sbisect (int np, poly *sseq, dbl min, dbl max, int atmin, int atmax, dbl *roots) |
This class is completely thread-save; several threads may execute the solve() function at the same time.
Definition at line 113 of file rootsolve.h.
|
|
|
|
|
For internal use only. Build Sturm sequence. Definition at line 167 of file sturm.cc. References NUM::PolyRootSolver_Sturm::poly::coef, dbl, NUM::fabs(), modp(), and NUM::PolyRootSolver_Sturm::poly::ord. Referenced by solve(). |
|
For internal use only. Polynomial modulus. Definition at line 121 of file sturm.cc. References NUM::PolyRootSolver_Sturm::poly::coef, dbl, NUM::fabs(), NUM::PolyRootSolver_Sturm::Params::nearly_zero, NUM::PolyRootSolver_Sturm::poly::ord, and par. Referenced by buildsturm(). |
|
For internal use only. Modified regula falsa. Definition at line 51 of file sturm.cc. References dbl, NUM::fabs(), NUM::PolyRootSolver_Sturm::Params::modrf_maxit, par, and NUM::PolyRootSolver_Sturm::Params::relerror. Referenced by sbisect(). |
|
For internal use only. Return the number of sign changes in the Sturm sequence. Definition at line 296 of file sturm.cc. References NUM::PolyRootSolver_Sturm::poly::coef, dbl, NUM::PolyRootSolver_Sturm::poly::ord, and NUM::PolvEval(). |
|
For internal use only. Return the number of distinct real roots. Definition at line 201 of file sturm.cc. References NUM::PolyRootSolver_Sturm::poly::coef, dbl, and NUM::PolyRootSolver_Sturm::poly::ord. Referenced by solve(). |
|
For internal use only. Uses a bisection to isolate intervals in which roots occur. Definition at line 344 of file sturm.cc. References Assert, NUM::PolyRootSolver_Sturm::poly::coef, dbl, NUM::fabs(), NUM::max(), NUM::min(), modrf(), numchanges(), NUM::PolyRootSolver_Sturm::poly::ord, par, NUM::PolvEval(), NUM::PolyRootSolver_Sturm::Params::relerror, and NUM::PolyRootSolver_Sturm::Params::sbisect_maxit. Referenced by solve(). |
|
[overriding a virtual]; Actually solve the roots of the polynomial using the Sturm sequence. Returns the number of roots; the roots will be returned in r[0..<=n-1]. c[0..n] holds the coefficiants of the polynomial
Reimplemented from NUM::PolyRootSolver. Definition at line 462 of file sturm.cc. References Assert, buildsturm(), NUM::PolyRootSolver_Sturm::poly::coef, dbl, NUM::max(), MAXPOW, NUM::min(), numchanges(), numroots(), NUM::PolyRootSolver_Sturm::poly::ord, and sbisect(). |
|
Initial value: { INIT_FIELD(nearly_zero) 1.0e-10, INIT_FIELD(relerror) 1.0e-14, INIT_FIELD(sbisect_maxit) 64, INIT_FIELD(modrf_maxit) 64, }
|
|
Definition at line 128 of file rootsolve.h. |