Open CASCADE Technology  7.7.0.dev
Public Member Functions

math_FunctionRoots Class Reference

This class implements an algorithm which finds all the real roots of a function with derivative within a given range. Knowledge of the derivative is required. More...

#include <math_FunctionRoots.hxx>

Public Member Functions

 math_FunctionRoots (math_FunctionWithDerivative &F, const Standard_Real A, const Standard_Real B, const Standard_Integer NbSample, const Standard_Real EpsX=0.0, const Standard_Real EpsF=0.0, const Standard_Real EpsNull=0.0, const Standard_Real K=0.0)
 Calculates all the real roots of a function F-K within the range A..B. without conditions on A and B A solution X is found when abs(Xi - Xi-1) <= Epsx and abs(F(Xi)-K) <= EpsF. The function is considered as null between A and B if abs(F-K) <= EpsNull within this range. More...
 
Standard_Boolean IsDone () const
 Returns true if the computations are successful, otherwise returns false. More...
 
Standard_Boolean IsAllNull () const
 returns true if the function is considered as null between A and B. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false). More...
 
Standard_Integer NbSolutions () const
 Returns the number of solutions found. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false). More...
 
Standard_Real Value (const Standard_Integer Nieme) const
 Returns the Nth value of the root of function F. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false). More...
 
Standard_Integer StateNumber (const Standard_Integer Nieme) const
 returns the StateNumber of the Nieme root. 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. More...
 

Detailed Description

This class implements an algorithm which finds all the real roots of a function with derivative within a given range. Knowledge of the derivative is required.

Constructor & Destructor Documentation

◆ math_FunctionRoots()

math_FunctionRoots::math_FunctionRoots ( math_FunctionWithDerivative F,
const Standard_Real  A,
const Standard_Real  B,
const Standard_Integer  NbSample,
const Standard_Real  EpsX = 0.0,
const Standard_Real  EpsF = 0.0,
const Standard_Real  EpsNull = 0.0,
const Standard_Real  K = 0.0 
)

Calculates all the real roots of a function F-K within the range A..B. without conditions on A and B A solution X is found when abs(Xi - Xi-1) <= Epsx and abs(F(Xi)-K) <= EpsF. The function is considered as null between A and B if abs(F-K) <= EpsNull within this range.

Member Function Documentation

◆ Dump()

void math_FunctionRoots::Dump ( Standard_OStream o) const

Prints on the stream o information on the current state of the object.

◆ IsAllNull()

Standard_Boolean math_FunctionRoots::IsAllNull ( ) const

returns true if the function is considered as null between A and B. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false).

◆ IsDone()

Standard_Boolean math_FunctionRoots::IsDone ( ) const

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

◆ NbSolutions()

Standard_Integer math_FunctionRoots::NbSolutions ( ) const

Returns the number of solutions found. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false).

◆ StateNumber()

Standard_Integer math_FunctionRoots::StateNumber ( const Standard_Integer  Nieme) const

returns the StateNumber of the Nieme root. Exception RangeError is raised if Nieme is < 1 or Nieme > NbSolutions.

◆ Value()

Standard_Real math_FunctionRoots::Value ( const Standard_Integer  Nieme) const

Returns the Nth value of the root of function F. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false).


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