OCC Main Page | FoundationClasses | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

FoundationClasses
TKMath
math


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

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT 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.
.
Standard_EXPORT 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.
.
Standard_EXPORT 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.
.
Standard_EXPORT 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 Standard_EXPORT void Delete ()
virtual Standard_EXPORT ~math_NewtonFunctionSetRoot ()
Standard_EXPORT void SetTolerance (const math_Vector &XTol)
 Initializes the tolerance values for the unknowns.
.
Standard_EXPORT 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_EXPORT 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.
.
Standard_EXPORT 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

Private Attributes

Standard_Boolean Done
Standard_Integer State
Standard_Integer Iter
Standard_Integer Itermax


Constructor & Destructor Documentation

Standard_EXPORT math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot math_FunctionSetWithDerivatives F,
const math_Vector XTol,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100
 

Standard_EXPORT math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot math_FunctionSetWithDerivatives F,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100
 

Standard_EXPORT math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot math_FunctionSetWithDerivatives F,
const math_Vector StartingPoint,
const math_Vector XTol,
const Standard_Real  FTol,
const Standard_Integer  NbIterations = 100
 

Standard_EXPORT 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 Standard_EXPORT math_NewtonFunctionSetRoot::~math_NewtonFunctionSetRoot  )  [inline, virtual]
 


Member Function Documentation

virtual Standard_EXPORT void math_NewtonFunctionSetRoot::Delete  )  [virtual]
 

void math_NewtonFunctionSetRoot::Derivative math_Matrix Der  )  const [inline]
 

const math_Matrix & math_NewtonFunctionSetRoot::Derivative  )  const [inline]
 

Standard_EXPORT void math_NewtonFunctionSetRoot::Dump Standard_OStream o  )  const
 

void math_NewtonFunctionSetRoot::FunctionSetErrors math_Vector Err  )  const [inline]
 

const math_Vector & math_NewtonFunctionSetRoot::FunctionSetErrors  )  const [inline]
 

Standard_Boolean math_NewtonFunctionSetRoot::IsDone  )  const [inline]
 

virtual Standard_EXPORT Standard_Boolean math_NewtonFunctionSetRoot::IsSolutionReached math_FunctionSetWithDerivatives F  )  [virtual]
 

Standard_Integer math_NewtonFunctionSetRoot::NbIterations  )  const [inline]
 

void math_NewtonFunctionSetRoot::operator delete void *  anAddress  )  [inline]
 

void* math_NewtonFunctionSetRoot::operator new size_t  size  )  [inline]
 

void* math_NewtonFunctionSetRoot::operator new size_t  ,
void *  anAddress
[inline]
 

Standard_EXPORT 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 [inline]
 

const math_Vector & math_NewtonFunctionSetRoot::Root  )  const [inline]
 

Standard_EXPORT void math_NewtonFunctionSetRoot::SetTolerance const math_Vector XTol  ) 
 

Standard_Integer math_NewtonFunctionSetRoot::StateNumber  )  const
 


Field Documentation

math_Vector math_NewtonFunctionSetRoot::DeltaX [protected]
 

Standard_Boolean math_NewtonFunctionSetRoot::Done [private]
 

math_Vector math_NewtonFunctionSetRoot::FValues [protected]
 

math_IntegerVector math_NewtonFunctionSetRoot::Indx [protected]
 

Standard_Integer math_NewtonFunctionSetRoot::Iter [private]
 

Standard_Integer math_NewtonFunctionSetRoot::Itermax [private]
 

math_Matrix math_NewtonFunctionSetRoot::Jacobian [protected]
 

math_Vector math_NewtonFunctionSetRoot::Scratch [protected]
 

math_Vector math_NewtonFunctionSetRoot::Sol [protected]
 

Standard_Integer math_NewtonFunctionSetRoot::State [private]
 

Standard_Real math_NewtonFunctionSetRoot::TolF [protected]
 

math_Vector math_NewtonFunctionSetRoot::TolX [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Aug 25 13:12:46 2008 for OpenCASCADE by  doxygen 1.4.1