Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
MathUtils::Sphere Class Reference

Sphere function functor (for testing optimization). f(x) = sum(x[i]^2) for all i. Global minimum at origin with f = 0. More...

#include <MathUtils_FunctorVector.hxx>

Public Member Functions

bool Value (const math_Vector &theX, double &theY) const
 Evaluates the sphere function.
 
bool Gradient (const math_Vector &theX, math_Vector &theG) const
 Evaluates the gradient of the sphere function.
 
bool Values (const math_Vector &theX, double &theY, math_Vector &theG) const
 Evaluates both value and gradient.
 

Detailed Description

Sphere function functor (for testing optimization). f(x) = sum(x[i]^2) for all i. Global minimum at origin with f = 0.

Usage:

aStart.Init(1.0); // Start at (1, 1, 1)
// Should converge to (0, 0, 0)
Sphere function functor (for testing optimization). f(x) = sum(x[i]^2) for all i. Global minimum at o...
Definition MathUtils_FunctorVector.hxx:320
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
VectorResult Powell(Function &theFunc, const math_Vector &theStartingPoint, const Config &theConfig=Config())
Powell's conjugate direction method for N-dimensional minimization. A gradient-free optimization algo...
Definition MathOpt_Powell.hxx:52

Member Function Documentation

◆ Gradient()

bool MathUtils::Sphere::Gradient ( const math_Vector & theX,
math_Vector & theG ) const
inline

Evaluates the gradient of the sphere function.

Parameters
[in]theXinput vector
[out]theGgradient vector
Returns
true (always succeeds)

◆ Value()

bool MathUtils::Sphere::Value ( const math_Vector & theX,
double & theY ) const
inline

Evaluates the sphere function.

Parameters
[in]theXinput vector
[out]theYfunction value
Returns
true (always succeeds)

◆ Values()

bool MathUtils::Sphere::Values ( const math_Vector & theX,
double & theY,
math_Vector & theG ) const
inline

Evaluates both value and gradient.

Parameters
[in]theXinput vector
[out]theYfunction value
[out]theGgradient vector
Returns
true (always succeeds)

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