# FoundationClasses
TKMath
math

# math_FunctionSetRoot Class Reference

The math_FunctionSetRoot class calculates the root
of a set of N functions of M variables (N<M, N=M or N>M). Knowing
an initial guess of the solution and using a minimization algorithm, a search
is made in the Newton direction and then in the Gradient direction if there
is no success in the Newton direction. This algorithm can also be
used for functions minimization. Knowledge of all the partial
derivatives (the Jacobian) is required.
.

`#include <math_FunctionSetRoot.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_FunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &Tolerance, const Standard_Integer NbIterations=100)
| is 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_FunctionSetRoot (math_FunctionSetWithDerivatives &F, const Standard_Integer NbIterations=100)
| is 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 after this constructor.
Standard_EXPORT | math_FunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &StartingPoint, const math_Vector &Tolerance, const Standard_Integer NbIterations=100)
| is used to improve the root of the function F from the initial guess StartingPoint. The maximum number of iterations allowed is given by NbIterations. In this case, the solution is found when: abs(Xi - Xi-1)(j) <= Tolerance(j) for all unknowns.
Standard_EXPORT | math_FunctionSetRoot (math_FunctionSetWithDerivatives &F, const math_Vector &StartingPoint, const math_Vector &Tolerance, const math_Vector &infBound, const math_Vector &supBound, const Standard_Integer NbIterations=100)
| is used to improve the root of the function F from the initial guess StartingPoint. The maximum number of iterations allowed is given by NbIterations. In this case, the solution is found when: abs(Xi - Xi-1) <= Tolerance for all unknowns.
virtual Standard_EXPORT void | Delete ()
virtual Standard_EXPORT | ~math_FunctionSetRoot ()
Standard_EXPORT void | SetTolerance (const math_Vector &Tolerance)
| Initializes the tolerance values. .
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 is called when computation of the solution is not performed by the constructors. .
virtual Standard_EXPORT Standard_Boolean | IsSolutionReached (math_FunctionSetWithDerivatives &F)
| This routine is called at the end of each iteration to check if the solution was found. It can be redefined in a sub-class to implement a specific test to stop the iterations. In this case, the solution is found when: abs(Xi - Xi-1) <= Tolerance for all unknowns. .
Standard_Boolean | IsDone () const
| Returns true if the computations are successful, otherwise returns false. .
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_Integer | StateNumber () const
| returns the stateNumber (as returned by F.GetStateNumber()) associated to the root found.
const math_Vector & | Root () const
| Returns the value of the root of function F. Exception NotDone is raised if the root was not found. .
Standard_EXPORT 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. .
const math_Matrix & | Derivative () 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 column range of <der> is not equal to the range of the startingPoint.
const math_Vector & | FunctionSetErrors () 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.
Standard_EXPORT 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_EXPORT 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 <<. .

## Protected Attributes

math_Vector | Delta
math_Vector | Sol
math_Matrix | DF
math_Vector | Tol

## Private Attributes

Standard_Boolean | Done
Standard_Integer | Kount
Standard_Integer | State
Standard_Integer | Itermax
math_Vector | InfBound
math_Vector | SupBound
math_Vector | SolSave
math_Vector | GH
math_Vector | DH
math_Vector | DHSave
math_Vector | FF
math_Vector | PreviousSolution
math_Vector | Save
math_IntegerVector | Constraints
math_Vector | Temp1
math_Vector | Temp2
math_Vector | Temp3
math_Vector | Temp4

## Constructor & Destructor Documentation

Standard_EXPORT math_FunctionSetRoot::math_FunctionSetRoot | ( | math_FunctionSetWithDerivatives & | F,
|  | const math_Vector & | Tolerance,
|  | const Standard_Integer | NbIterations = `100`
| ) |

Standard_EXPORT math_FunctionSetRoot::math_FunctionSetRoot | ( | math_FunctionSetWithDerivatives & | F,
|  | const Standard_Integer | NbIterations = `100`
| ) |

Standard_EXPORT math_FunctionSetRoot::math_FunctionSetRoot | ( | math_FunctionSetWithDerivatives & | F,
|  | const math_Vector & | StartingPoint,
|  | const math_Vector & | Tolerance,
|  | const Standard_Integer | NbIterations = `100`
| ) |

Standard_EXPORT math_FunctionSetRoot::math_FunctionSetRoot | ( | math_FunctionSetWithDerivatives & | F,
|  | const math_Vector & | StartingPoint,
|  | const math_Vector & | Tolerance,
|  | const math_Vector & | infBound,
|  | const math_Vector & | supBound,
|  | const Standard_Integer | NbIterations = `100`
| ) |

virtual Standard_EXPORT math_FunctionSetRoot::~math_FunctionSetRoot | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual Standard_EXPORT void math_FunctionSetRoot::Delete | ( |  | ) | `[virtual]`

void math_FunctionSetRoot::Derivative | ( | math_Matrix & | Der | ) | const`[inline]`

const math_Matrix & math_FunctionSetRoot::Derivative | ( |  | ) | const`[inline]`

Standard_EXPORT void math_FunctionSetRoot::Dump | ( | Standard_OStream & | o | ) | const

Standard_EXPORT void math_FunctionSetRoot::FunctionSetErrors | ( | math_Vector & | Err | ) | const

const math_Vector & math_FunctionSetRoot::FunctionSetErrors | ( |  | ) | const`[inline]`

Standard_Boolean math_FunctionSetRoot::IsDone | ( |  | ) | const`[inline]`

virtual Standard_EXPORT Standard_Boolean math_FunctionSetRoot::IsSolutionReached | ( | math_FunctionSetWithDerivatives & | F | ) | `[virtual]`

Standard_Integer math_FunctionSetRoot::NbIterations | ( |  | ) | const`[inline]`

void math_FunctionSetRoot::operator delete | ( | void * | anAddress | ) | `[inline]`

void* math_FunctionSetRoot::operator new | ( | size_t | size | ) | `[inline]`

void* math_FunctionSetRoot::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Standard_EXPORT void math_FunctionSetRoot::Perform | ( | math_FunctionSetWithDerivatives & | F,
|  | const math_Vector & | StartingPoint,
|  | const math_Vector & | infBound,
|  | const math_Vector & | supBound
| ) |

Standard_EXPORT void math_FunctionSetRoot::Root | ( | math_Vector & | Root | ) | const

const math_Vector & math_FunctionSetRoot::Root | ( |  | ) | const`[inline]`

Standard_EXPORT void math_FunctionSetRoot::SetTolerance | ( | const math_Vector & | Tolerance | ) |

Standard_Integer math_FunctionSetRoot::StateNumber | ( |  | ) | const`[inline]`

## Field Documentation

math_IntegerVector math_FunctionSetRoot::Constraints `[private]`

math_Vector math_FunctionSetRoot::Delta `[protected]`

math_Matrix math_FunctionSetRoot::DF `[protected]`

math_Vector math_FunctionSetRoot::DH `[private]`

math_Vector math_FunctionSetRoot::DHSave `[private]`

Standard_Boolean math_FunctionSetRoot::Done `[private]`

math_Vector math_FunctionSetRoot::FF `[private]`

math_Vector math_FunctionSetRoot::GH `[private]`

math_Vector math_FunctionSetRoot::InfBound `[private]`

Standard_Integer math_FunctionSetRoot::Itermax `[private]`

Standard_Integer math_FunctionSetRoot::Kount `[private]`

math_Vector math_FunctionSetRoot::PreviousSolution `[private]`

math_Vector math_FunctionSetRoot::Save `[private]`

math_Vector math_FunctionSetRoot::Sol `[protected]`

math_Vector math_FunctionSetRoot::SolSave `[private]`

Standard_Integer math_FunctionSetRoot::State `[private]`

math_Vector math_FunctionSetRoot::SupBound `[private]`

math_Vector math_FunctionSetRoot::Temp1 `[private]`

math_Vector math_FunctionSetRoot::Temp2 `[private]`

math_Vector math_FunctionSetRoot::Temp3 `[private]`

math_Vector math_FunctionSetRoot::Temp4 `[private]`

math_Vector math_FunctionSetRoot::Tol `[protected]`

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

- math_FunctionSetRoot.hxx
- math_FunctionSetRoot.lxx