Open CASCADE Technology 6.6.0
Public Member Functions | Protected Attributes
math_NewtonFunctionSetRoot Class Reference

This class computes the root of a set of N functions of N variables,
knowing an initial guess at the solution and using the
Newton Raphson algorithm. Knowledge of all the partial
derivatives (Jacobian) is required.

#include <math_NewtonFunctionSetRoot.hxx>

Public Member Functions

 math_NewtonFunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &XTol, const Standard_Real FTol, const Standard_Integer NbIterations=100)
 This constructor should be used in a sub-class to initialize
correctly all the fields of this class.
The range (1, F.NbVariables()) must be especially respected for
all vectors and matrix declarations.

 math_NewtonFunctionSetRoot (math_FunctionSetWithDerivatives &F, const Standard_Real FTol, const Standard_Integer NbIterations=100)
 This constructor should be used in a sub-class to initialize
correctly all the fields of this class.
The range (1, F.NbVariables()) must be especially respected for
all vectors and matrix declarations.
The method SetTolerance must be called before performing the
algorithm.

 math_NewtonFunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &StartingPoint, const math_Vector &XTol, const Standard_Real FTol, const Standard_Integer NbIterations=100)
 The Newton method is done to improve the root of the function F
from the initial guess StartingPoint.
The tolerance required on the root is given by Tolerance.
The solution is found when :
abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;
The maximum number of iterations allowed is given by NbIterations.

 math_NewtonFunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &StartingPoint, const math_Vector &InfBound, const math_Vector &SupBound, const math_Vector &XTol, const Standard_Real FTol, const Standard_Integer NbIterations=100)
 The Newton method is done to improve the root of the function F
from the initial guess StartingPoint.
The tolerance required on the root is given by Tolerance.
The solution is found when :
abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;
The maximum number of iterations allowed is given by NbIterations.

virtual void Delete ()
virtual ~math_NewtonFunctionSetRoot ()
void SetTolerance (const math_Vector &XTol)
 Initializes the tolerance values for the unknowns.

void Perform (math_FunctionSetWithDerivatives &F, const math_Vector &StartingPoint, const math_Vector &InfBound, const math_Vector &SupBound)
 Improves the root of function F from the initial guess
StartingPoint. infBound and supBound may be given, to constrain the solution.
Warning
This method must be called when the solution is not computed by the constructors.

virtual Standard_Boolean IsSolutionReached (math_FunctionSetWithDerivatives &F)
 This method is called at the end of each iteration to check if the
solution is found.
Vectors DeltaX, Fvalues and Jacobian Matrix are consistent with the
possible solution Vector Sol and can be inspected to decide whether
the solution is reached or not.

Standard_Boolean IsDone () const
 Returns true if the computations are successful, otherwise returns false.

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

void Root (math_Vector &Root) const
 outputs the root vector in Root.
Exception NotDone is raised if the root was not found.
Exception DimensionError is raised if the range of Root is
not equal to the range of the StartingPoint.

Standard_Integer StateNumber () const
 Outputs the state number associated with the solution
vector root.

const math_MatrixDerivative () const
 Returns the matrix value of the derivative at the root.
Exception NotDone is raised if the root was not found.

void Derivative (math_Matrix &Der) const
 Outputs the matrix value of the derivative at the root in
Der.
Exception NotDone is raised if the root was not found.
Exception DimensionError is raised if the range of Der is
not equal to the range of the StartingPoint.

const math_VectorFunctionSetErrors () const
 Returns the vector value of the error done on the
functions at the root.
Exception NotDone is raised if the root was not found.

void FunctionSetErrors (math_Vector &Err) const
 Outputs the vector value of the error done on the
functions at the root in Err.
Exception NotDone is raised if the root was not found.
Exception DimensionError is raised if the range of Err is
not equal to the range of the StartingPoint.

Standard_Integer NbIterations () const
 Returns the number of iterations really done
during the computation of the Root.
Exception NotDone is raised if the root was not found.

void Dump (Standard_OStream &o) const
 Prints information on the current state of the object.
Is used to redefine the operator <<.

Protected Attributes

math_Vector TolX
Standard_Real TolF
math_IntegerVector Indx
math_Vector Scratch
math_Vector Sol
math_Vector DeltaX
math_Vector FValues
math_Matrix Jacobian

Constructor & Destructor Documentation

math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives F,
const math_Vector XTol,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100 
)
math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives F,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100 
)
math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives F,
const math_Vector StartingPoint,
const math_Vector XTol,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100 
)
math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives F,
const math_Vector StartingPoint,
const math_Vector InfBound,
const math_Vector SupBound,
const math_Vector XTol,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100 
)
virtual math_NewtonFunctionSetRoot::~math_NewtonFunctionSetRoot ( ) [inline, virtual]

Member Function Documentation

virtual void math_NewtonFunctionSetRoot::Delete ( ) [virtual]
const math_Matrix& math_NewtonFunctionSetRoot::Derivative ( ) const
void math_NewtonFunctionSetRoot::Derivative ( math_Matrix Der) const
void math_NewtonFunctionSetRoot::Dump ( Standard_OStream o) const
const math_Vector& math_NewtonFunctionSetRoot::FunctionSetErrors ( ) const
void math_NewtonFunctionSetRoot::FunctionSetErrors ( math_Vector Err) const
Standard_Boolean math_NewtonFunctionSetRoot::IsDone ( ) const
virtual Standard_Boolean math_NewtonFunctionSetRoot::IsSolutionReached ( math_FunctionSetWithDerivatives F) [virtual]
Standard_Integer math_NewtonFunctionSetRoot::NbIterations ( ) const
void math_NewtonFunctionSetRoot::Perform ( math_FunctionSetWithDerivatives F,
const math_Vector StartingPoint,
const math_Vector InfBound,
const math_Vector SupBound 
)
void math_NewtonFunctionSetRoot::Root ( math_Vector Root) const
const math_Vector& math_NewtonFunctionSetRoot::Root ( ) const
void math_NewtonFunctionSetRoot::SetTolerance ( const math_Vector XTol)
Standard_Integer math_NewtonFunctionSetRoot::StateNumber ( ) const

Field Documentation


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines