Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

NUM::PolyRootSolver_Direct Class Reference

Direct polynomial root solver based on explicit formulas. More...

#include <rootsolve.h>

Inheritance diagram for NUM::PolyRootSolver_Direct:

Inheritance graph
[legend]
Collaboration diagram for NUM::PolyRootSolver_Direct:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PolyRootSolver_Direct ()
 ~PolyRootSolver_Direct ()
int solve (int order, const dbl *c, dbl *r)
 [overriding a virtual]; returns -2 for invalid order

int Solve_1 (const dbl *c, dbl *r)
int Solve_2 (const dbl *c, dbl *r)
int Solve_3 (const dbl *c, dbl *r)
int Solve_4 (const dbl *c, dbl *r)

Public Attributes

Params par

Static Public Attributes

const Params defaults
 Default values of the parameters.


Detailed Description

Direct polynomial root solver based on explicit formulas.

Author:
Wolfgang Wieser ] wwieser (a) gmx <*> de [
This class implements direct polynomial root solvers based on explicit formulas which are available for orders up to 4. This cannot be used for polynomials of order larger than 4.

This class is completely thread-save; several threads may execute the solve() function at the same time.

Definition at line 68 of file rootsolve.h.


Constructor & Destructor Documentation

NUM::PolyRootSolver_Direct::PolyRootSolver_Direct  ) 
 

Definition at line 403 of file direct.cc.

NUM::PolyRootSolver_Direct::~PolyRootSolver_Direct  ) 
 

Definition at line 410 of file direct.cc.


Member Function Documentation

int NUM::PolyRootSolver_Direct::solve int  order,
const dbl c,
dbl r
[virtual]
 

[overriding a virtual]; returns -2 for invalid order

Reimplemented from NUM::PolyRootSolver.

Definition at line 388 of file direct.cc.

References dbl, Solve_1(), Solve_2(), Solve_3(), and Solve_4().

int NUM::PolyRootSolver_Direct::Solve_1 const dbl c,
dbl r
 

Direct access to the root solving function for orders 1..4: Solve_D(): Solve roots of polynomial of degree D, i.e.
0 = c[0] + c[1]*x + c[2]*x^2 + ... + c[D]*x^D
Roots returned in r[0..D-1]; number of roots returned as return value.

Definition at line 37 of file direct.cc.

References dbl.

Referenced by solve(), and Solve_2().

int NUM::PolyRootSolver_Direct::Solve_2 const dbl c,
dbl r
 

Definition at line 52 of file direct.cc.

References dbl, NUM::fabs(), NUM::PolyRootSolver_Direct::Params::nearly_zero, par, Solve_1(), and NUM::sqr().

Referenced by solve(), Solve_3(), and Solve_4().

int NUM::PolyRootSolver_Direct::Solve_3 const dbl c,
dbl r
 

Definition at line 122 of file direct.cc.

References NUM::cbrt(), CritAssert, dbl, NUM::fabs(), NUM::PolyRootSolver_Direct::Params::nearly_zero, par, Solve_2(), and NUM::sqr().

Referenced by solve(), and Solve_4().

int NUM::PolyRootSolver_Direct::Solve_4 const dbl c,
dbl r
 

Definition at line 216 of file direct.cc.

References NUM::cbrt(), dbl, NUM::fabs(), NUM::PolyRootSolver_Direct::Params::nearly_zero, par, Solve_2(), Solve_3(), and NUM::sqr().

Referenced by solve().


Member Data Documentation

const PolyRootSolver_Direct::Params NUM::PolyRootSolver_Direct::defaults [static]
 

Initial value:

 
{
    INIT_FIELD(nearly_zero) 1e-10  
}
Default values of the parameters.

Definition at line 28 of file direct.cc.

Params NUM::PolyRootSolver_Direct::par
 

Definition at line 77 of file rootsolve.h.

Referenced by Solve_2(), Solve_3(), and Solve_4().


The documentation for this class was generated from the following files:
Generated on Sat Feb 19 22:35:58 2005 for Ray by doxygen 1.3.5