Open CASCADE Technology  7.3.0
Public Member Functions
math_BracketMinimum Class Reference

Given two distinct initial points, BracketMinimum implements the computation of three points (a, b, c) which bracket the minimum of the function and verify A less than B, B less than C and F(B) less than F(A), F(B) less than F(C). More...

#include <math_BracketMinimum.hxx>

Public Member Functions

 math_BracketMinimum (const Standard_Real A, const Standard_Real B)
 Constructor preparing A and B parameters only. It does not perform the job. More...
 
 math_BracketMinimum (math_Function &F, const Standard_Real A, const Standard_Real B)
 Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F. More...
 
 math_BracketMinimum (math_Function &F, const Standard_Real A, const Standard_Real B, const Standard_Real FA)
 Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F. This constructor has to be used if F(A) is known. More...
 
 math_BracketMinimum (math_Function &F, const Standard_Real A, const Standard_Real B, const Standard_Real FA, const Standard_Real FB)
 Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F. This constructor has to be used if F(A) and F(B) are known. More...
 
void SetLimits (const Standard_Real theLeft, const Standard_Real theRight)
 Set limits of the parameter. By default no limits are applied to the parameter change. If no minimum is found in limits then IsDone() will return false. The user is in charge of providing A and B to be in limits. More...
 
void SetFA (const Standard_Real theValue)
 Set function value at A. More...
 
void SetFB (const Standard_Real theValue)
 Set function value at B. More...
 
void Perform (math_Function &F)
 The method performing the job. It is called automatically by constructors with the function. More...
 
Standard_Boolean IsDone () const
 Returns true if the computations are successful, otherwise returns false. More...
 
void Values (Standard_Real &A, Standard_Real &B, Standard_Real &C) const
 Returns the bracketed triplet of abscissae. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false). More...
 
void FunctionValues (Standard_Real &FA, Standard_Real &FB, Standard_Real &FC) const
 returns the bracketed triplet function values. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false). More...
 
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 <<. More...
 

Detailed Description

Given two distinct initial points, BracketMinimum implements the computation of three points (a, b, c) which bracket the minimum of the function and verify A less than B, B less than C and F(B) less than F(A), F(B) less than F(C).

The algorithm supports conditional optimization. By default no limits are applied to the parameter change. The method SetLimits defines the allowed range. If no minimum is found in limits then IsDone() will return false. The user is in charge of providing A and B to be in limits.

Constructor & Destructor Documentation

◆ math_BracketMinimum() [1/4]

math_BracketMinimum::math_BracketMinimum ( const Standard_Real  A,
const Standard_Real  B 
)

Constructor preparing A and B parameters only. It does not perform the job.

◆ math_BracketMinimum() [2/4]

math_BracketMinimum::math_BracketMinimum ( math_Function F,
const Standard_Real  A,
const Standard_Real  B 
)

Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F.

◆ math_BracketMinimum() [3/4]

math_BracketMinimum::math_BracketMinimum ( math_Function F,
const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  FA 
)

Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F. This constructor has to be used if F(A) is known.

◆ math_BracketMinimum() [4/4]

math_BracketMinimum::math_BracketMinimum ( math_Function F,
const Standard_Real  A,
const Standard_Real  B,
const Standard_Real  FA,
const Standard_Real  FB 
)

Given two initial values this class computes a bracketing triplet of abscissae Ax, Bx, Cx (such that Bx is between Ax and Cx, F(Bx) is less than both F(Bx) and F(Cx)) the Brent minimization is done on the function F. This constructor has to be used if F(A) and F(B) are known.

Member Function Documentation

◆ Dump()

void math_BracketMinimum::Dump ( Standard_OStream o) const

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

◆ FunctionValues()

void math_BracketMinimum::FunctionValues ( Standard_Real FA,
Standard_Real FB,
Standard_Real FC 
) const

returns the bracketed triplet function values. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false).

◆ IsDone()

Standard_Boolean math_BracketMinimum::IsDone ( ) const

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

◆ Perform()

void math_BracketMinimum::Perform ( math_Function F)

The method performing the job. It is called automatically by constructors with the function.

◆ SetFA()

void math_BracketMinimum::SetFA ( const Standard_Real  theValue)

Set function value at A.

◆ SetFB()

void math_BracketMinimum::SetFB ( const Standard_Real  theValue)

Set function value at B.

◆ SetLimits()

void math_BracketMinimum::SetLimits ( const Standard_Real  theLeft,
const Standard_Real  theRight 
)

Set limits of the parameter. By default no limits are applied to the parameter change. If no minimum is found in limits then IsDone() will return false. The user is in charge of providing A and B to be in limits.

◆ Values()

void math_BracketMinimum::Values ( Standard_Real A,
Standard_Real B,
Standard_Real C 
) const

Returns the bracketed triplet of abscissae. Exceptions StdFail_NotDone if the algorithm fails (and IsDone returns false).


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