Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
math_FunctionRoot Class Reference

This class implements the computation of a root of a function of a single variable which is near an initial guess using a minimization algorithm.Knowledge of the derivative is required. The algorithm used is the same as in. More...

#include <math_FunctionRoot.hxx>

Public Member Functions

 math_FunctionRoot (math_FunctionWithDerivative &F, const double Guess, const double Tolerance, const int NbIterations=100)
 The Newton-Raphson method is done to find the root of the function F from the initial guess Guess.The tolerance required on the root is given by Tolerance. Iterations are stopped if the expected solution does not stay in the range A..B. The solution is found when abs(Xi - Xi-1) <= Tolerance; The maximum number of iterations allowed is given by NbIterations.
 
 math_FunctionRoot (math_FunctionWithDerivative &F, const double Guess, const double Tolerance, const double A, const double B, const int NbIterations=100)
 The Newton-Raphson method is done to find the root of the function F from the initial guess Guess. The tolerance required on the root is given by Tolerance. Iterations are stopped if the expected solution does not stay in the range A..B The solution is found when abs(Xi - Xi-1) <= Tolerance; The maximum number of iterations allowed is given by NbIterations.
 
bool IsDone () const
 Returns true if the computations are successful, otherwise returns false.
 
double Root () const
 returns the value of the root. Exception NotDone is raised if the root was not found.
 
double Derivative () const
 returns the value of the derivative at the root. Exception NotDone is raised if the root was not found.
 
double Value () const
 returns the value of the function at the root. Exception NotDone is raised if the root was not found.
 
int NbIterations () const
 returns the number of iterations really done on the computation of the Root. Exception NotDone is raised if the root was not found.
 
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 <<.
 

Detailed Description

This class implements the computation of a root of a function of a single variable which is near an initial guess using a minimization algorithm.Knowledge of the derivative is required. The algorithm used is the same as in.

Constructor & Destructor Documentation

◆ math_FunctionRoot() [1/2]

math_FunctionRoot::math_FunctionRoot ( math_FunctionWithDerivative & F,
const double Guess,
const double Tolerance,
const int NbIterations = 100 )

The Newton-Raphson method is done to find the root of the function F from the initial guess Guess.The tolerance required on the root is given by Tolerance. Iterations are stopped if the expected solution does not stay in the range A..B. The solution is found when abs(Xi - Xi-1) <= Tolerance; The maximum number of iterations allowed is given by NbIterations.

◆ math_FunctionRoot() [2/2]

math_FunctionRoot::math_FunctionRoot ( math_FunctionWithDerivative & F,
const double Guess,
const double Tolerance,
const double A,
const double B,
const int NbIterations = 100 )

The Newton-Raphson method is done to find the root of the function F from the initial guess Guess. The tolerance required on the root is given by Tolerance. Iterations are stopped if the expected solution does not stay in the range A..B The solution is found when abs(Xi - Xi-1) <= Tolerance; The maximum number of iterations allowed is given by NbIterations.

Member Function Documentation

◆ Derivative()

double math_FunctionRoot::Derivative ( ) const

returns the value of the derivative at the root. Exception NotDone is raised if the root was not found.

◆ Dump()

void math_FunctionRoot::Dump ( Standard_OStream & o) const

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

◆ IsDone()

bool math_FunctionRoot::IsDone ( ) const

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

◆ NbIterations()

int math_FunctionRoot::NbIterations ( ) const

returns the number of iterations really done on the computation of the Root. Exception NotDone is raised if the root was not found.

◆ Root()

double math_FunctionRoot::Root ( ) const

returns the value of the root. Exception NotDone is raised if the root was not found.

◆ Value()

double math_FunctionRoot::Value ( ) const

returns the value of the function at the root. Exception NotDone is raised if the root was not found.


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