Open CASCADE Technology  7.7.0
Public Member Functions | Protected Member Functions
math_DirectPolynomialRoots Class Reference

This class implements the calculation of all the real roots of a real polynomial of degree <= 4 using a direct method. Once found, the roots are polished using the Newton method. More...

#include <math_DirectPolynomialRoots.hxx>

Public Member Functions

 math_DirectPolynomialRoots (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D, const Standard_Real E)
 computes all the real roots of the polynomial Ax4 + Bx3 + Cx2 + Dx + E using a direct method. More...
 
 math_DirectPolynomialRoots (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D)
 computes all the real roots of the polynomial Ax3 + Bx2 + Cx + D using a direct method. More...
 
 math_DirectPolynomialRoots (const Standard_Real A, const Standard_Real B, const Standard_Real C)
 computes all the real roots of the polynomial Ax2 + Bx + C using a direct method. More...
 
 math_DirectPolynomialRoots (const Standard_Real A, const Standard_Real B)
 computes the real root of the polynomial Ax + B. More...
 
Standard_Boolean IsDone () const
 Returns true if the computations are successful, otherwise returns false. More...
 
Standard_Boolean InfiniteRoots () const
 Returns true if there is an infinity of roots, otherwise returns false. More...
 
Standard_Integer NbSolutions () const
 returns the number of solutions. An exception is raised if there are an infinity of roots. More...
 
Standard_Real Value (const Standard_Integer Nieme) const
 returns the value of the Nieme root. An exception is raised if there are an infinity of roots. Exception RangeError is raised if Nieme is < 1 or Nieme > NbSolutions. More...
 
void Dump (Standard_OStream &o) const
 Prints on the stream o information on the current state of the object. Is used to redefine the operator <<. More...
 

Protected Member Functions

void Solve (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D, const Standard_Real E)
 
void Solve (const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D)
 
void Solve (const Standard_Real A, const Standard_Real B, const Standard_Real C)
 
void Solve (const Standard_Real A, const Standard_Real B)
 

Detailed Description

This class implements the calculation of all the real roots of a real polynomial of degree <= 4 using a direct method. Once found, the roots are polished using the Newton method.

Constructor & Destructor Documentation

◆ math_DirectPolynomialRoots() [1/4]

math_DirectPolynomialRoots::math_DirectPolynomialRoots ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C,
const Standard_Real  D,
const Standard_Real  E 
)

computes all the real roots of the polynomial Ax4 + Bx3 + Cx2 + Dx + E using a direct method.

◆ math_DirectPolynomialRoots() [2/4]

math_DirectPolynomialRoots::math_DirectPolynomialRoots ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C,
const Standard_Real  D 
)

computes all the real roots of the polynomial Ax3 + Bx2 + Cx + D using a direct method.

◆ math_DirectPolynomialRoots() [3/4]

math_DirectPolynomialRoots::math_DirectPolynomialRoots ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C 
)

computes all the real roots of the polynomial Ax2 + Bx + C using a direct method.

◆ math_DirectPolynomialRoots() [4/4]

math_DirectPolynomialRoots::math_DirectPolynomialRoots ( const Standard_Real  A,
const Standard_Real  B 
)

computes the real root of the polynomial Ax + B.

Member Function Documentation

◆ Dump()

void math_DirectPolynomialRoots::Dump ( Standard_OStream o) const

Prints on the stream o information on the current state of the object. Is used to redefine the operator <<.

◆ InfiniteRoots()

Standard_Boolean math_DirectPolynomialRoots::InfiniteRoots ( ) const

Returns true if there is an infinity of roots, otherwise returns false.

◆ IsDone()

Standard_Boolean math_DirectPolynomialRoots::IsDone ( ) const

Returns true if the computations are successful, otherwise returns false.

◆ NbSolutions()

Standard_Integer math_DirectPolynomialRoots::NbSolutions ( ) const

returns the number of solutions. An exception is raised if there are an infinity of roots.

◆ Solve() [1/4]

void math_DirectPolynomialRoots::Solve ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C,
const Standard_Real  D,
const Standard_Real  E 
)
protected

◆ Solve() [2/4]

void math_DirectPolynomialRoots::Solve ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C,
const Standard_Real  D 
)
protected

◆ Solve() [3/4]

void math_DirectPolynomialRoots::Solve ( const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  C 
)
protected

◆ Solve() [4/4]

void math_DirectPolynomialRoots::Solve ( const Standard_Real  A,
const Standard_Real  B 
)
protected

◆ Value()

Standard_Real math_DirectPolynomialRoots::Value ( const Standard_Integer  Nieme) const

returns the value of the Nieme root. An exception is raised if there are an infinity of roots. Exception RangeError is raised if Nieme is < 1 or Nieme > NbSolutions.


The documentation for this class was generated from the following file: