OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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. More...

    #include <math_NewtonFunctionSetRoot.hxx>

    Public Member Functions

     math_NewtonFunctionSetRoot (math_FunctionSetWithDerivatives &theFunction, const math_Vector &theXTolerance, const double theFTolerance, const int theNbIterations=100)
     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 &theFunction, const double theFTolerance, const int theNbIterations=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.
    virtual ~math_NewtonFunctionSetRoot ()
     Destructor.
    void SetTolerance (const math_Vector &XTol)
     Initializes the tolerance values for the unknowns.
    void Perform (math_FunctionSetWithDerivatives &theFunction, const math_Vector &theStartingPoint)
     The Newton method is done to improve the root of the function from the initial guess point. The solution is found when: abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;.
    void Perform (math_FunctionSetWithDerivatives &theFunction, const math_Vector &theStartingPoint, const math_Vector &theInfBound, const math_Vector &theSupBound)
     The Newton method is done to improve the root of the function from the initial guess point. Bounds may be given, to constrain the solution. The solution is found when: abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;.
    virtual bool 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.
    bool 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.
    int 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.
    int 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
    double TolF
    math_IntegerVector Indx
    math_Vector Scratch
    math_Vector Sol
    math_Vector DeltaX
    math_Vector FValues
    math_Matrix Jacobian

    Detailed Description

    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.

    Constructor & Destructor Documentation

    ◆ math_NewtonFunctionSetRoot() [1/2]

    math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives & theFunction,
    const math_Vector & theXTolerance,
    const double theFTolerance,
    const int theNbIterations = 100 )

    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() [2/2]

    math_NewtonFunctionSetRoot::math_NewtonFunctionSetRoot ( math_FunctionSetWithDerivatives & theFunction,
    const double theFTolerance,
    const int theNbIterations = 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()

    virtual math_NewtonFunctionSetRoot::~math_NewtonFunctionSetRoot ( )
    virtual

    Destructor.

    Member Function Documentation

    ◆ Derivative() [1/2]

    const math_Matrix & math_NewtonFunctionSetRoot::Derivative ( ) const

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

    ◆ Derivative() [2/2]

    void math_NewtonFunctionSetRoot::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.

    ◆ Dump()

    void math_NewtonFunctionSetRoot::Dump ( Standard_OStream & o) const

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

    ◆ FunctionSetErrors() [1/2]

    const math_Vector & math_NewtonFunctionSetRoot::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.

    ◆ FunctionSetErrors() [2/2]

    void math_NewtonFunctionSetRoot::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.

    ◆ IsDone()

    bool math_NewtonFunctionSetRoot::IsDone ( ) const

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

    ◆ IsSolutionReached()

    virtual bool math_NewtonFunctionSetRoot::IsSolutionReached ( math_FunctionSetWithDerivatives & F)
    virtual

    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.

    ◆ NbIterations()

    int math_NewtonFunctionSetRoot::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.

    ◆ Perform() [1/2]

    void math_NewtonFunctionSetRoot::Perform ( math_FunctionSetWithDerivatives & theFunction,
    const math_Vector & theStartingPoint )

    The Newton method is done to improve the root of the function from the initial guess point. The solution is found when: abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;.

    ◆ Perform() [2/2]

    void math_NewtonFunctionSetRoot::Perform ( math_FunctionSetWithDerivatives & theFunction,
    const math_Vector & theStartingPoint,
    const math_Vector & theInfBound,
    const math_Vector & theSupBound )

    The Newton method is done to improve the root of the function from the initial guess point. Bounds may be given, to constrain the solution. The solution is found when: abs(Xj - Xj-1)(i) <= XTol(i) and abs(Fi) <= FTol for all i;.

    ◆ Root() [1/2]

    const math_Vector & math_NewtonFunctionSetRoot::Root ( ) const

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

    ◆ Root() [2/2]

    void math_NewtonFunctionSetRoot::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.

    ◆ SetTolerance()

    void math_NewtonFunctionSetRoot::SetTolerance ( const math_Vector & XTol)

    Initializes the tolerance values for the unknowns.

    ◆ StateNumber()

    int math_NewtonFunctionSetRoot::StateNumber ( ) const

    Outputs the state number associated with the solution vector root.

    Field Documentation

    ◆ DeltaX

    math_Vector math_NewtonFunctionSetRoot::DeltaX
    protected

    ◆ FValues

    math_Vector math_NewtonFunctionSetRoot::FValues
    protected

    ◆ Indx

    math_IntegerVector math_NewtonFunctionSetRoot::Indx
    protected

    ◆ Jacobian

    math_Matrix math_NewtonFunctionSetRoot::Jacobian
    protected

    ◆ Scratch

    math_Vector math_NewtonFunctionSetRoot::Scratch
    protected

    ◆ Sol

    math_Vector math_NewtonFunctionSetRoot::Sol
    protected

    ◆ TolF

    double math_NewtonFunctionSetRoot::TolF
    protected

    ◆ TolX

    math_Vector math_NewtonFunctionSetRoot::TolX
    protected

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