Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
GeomConvert_FuncSphereLSDist Class Reference

Function for search of sphere canonic parameters: coordinates of center and radius from set of moints by least square method. //! The class inherits math_MultipleVarFunctionWithGradient and thus is intended for use in math_BFGS algorithm. More...

#include <GeomConvert_FuncSphereLSDist.hxx>

Inheritance diagram for GeomConvert_FuncSphereLSDist:
Inheritance graph
[legend]

Public Member Functions

 GeomConvert_FuncSphereLSDist ()=default
 Constructor.
 
 GeomConvert_FuncSphereLSDist (const occ::handle< NCollection_HArray1< gp_XYZ > > &thePoints)
 
void SetPoints (const occ::handle< NCollection_HArray1< gp_XYZ > > &thePoints)
 
int NbVariables () const override
 Number of variables.
 
bool Value (const math_Vector &X, double &F) override
 Value.
 
bool Gradient (const math_Vector &X, math_Vector &G) override
 Gradient.
 
bool Values (const math_Vector &X, double &F, math_Vector &G) override
 Value and gradient.
 
- Public Member Functions inherited from math_MultipleVarFunction
virtual int GetStateNumber ()
 return the state of the function corresponding to the latestt call of any methods associated to the function. This function is called by each of the algorithms described later which define the function Integer Algorithm::StateNumber(). The algorithm has the responsibility to call this function when it has found a solution (i.e. a root or a minimum) and has to maintain the association between the solution found and this StateNumber. Byu default, this method returns 0 (which means for the algorithm: no state has been saved). It is the responsibility of the programmer to decide if he needs to save the current state of the function and to return an Integer that allows retrieval of the state.
 
virtual ~math_MultipleVarFunction ()
 

Detailed Description

Function for search of sphere canonic parameters: coordinates of center and radius from set of moints by least square method. //! The class inherits math_MultipleVarFunctionWithGradient and thus is intended for use in math_BFGS algorithm.

The criteria is: F(x0, y0, z0, R) = Sum[(x(i) - x0)^2 + (y(i) - y0)^2 + (z(i) - z0)^2 - R^2]^2 => min, x(i), y(i), z(i) - coordinates of sample points, x0, y0, z0, R - coordinates of center and radius of sphere, which must be defined

The first derivative are: dF/dx0 : G1(x0, y0, z0, R) = -4*Sum{[...]*(x(i) - x0)} dF/dy0 : G2(x0, y0, z0, R) = -4*Sum{[...]*(y(i) - y0)} dF/dz0 : G3(x0, y0, z0, R) = -4*Sum{[...]*(z(i) - z0)} dF/dR : G4(x0, y0, z0, R) = -4*R*Sum[...] [...] = [(x(i) - x0)^2 + (y(i) - y0)^2 + (z(i) - z0)^2 - R^2]

Constructor & Destructor Documentation

◆ GeomConvert_FuncSphereLSDist() [1/2]

GeomConvert_FuncSphereLSDist::GeomConvert_FuncSphereLSDist ( )
default

Constructor.

◆ GeomConvert_FuncSphereLSDist() [2/2]

GeomConvert_FuncSphereLSDist::GeomConvert_FuncSphereLSDist ( const occ::handle< NCollection_HArray1< gp_XYZ > > & thePoints)

Member Function Documentation

◆ Gradient()

bool GeomConvert_FuncSphereLSDist::Gradient ( const math_Vector & X,
math_Vector & G )
overridevirtual

Gradient.

Implements math_MultipleVarFunctionWithGradient.

◆ NbVariables()

int GeomConvert_FuncSphereLSDist::NbVariables ( ) const
overridevirtual

Number of variables.

Implements math_MultipleVarFunctionWithGradient.

◆ SetPoints()

void GeomConvert_FuncSphereLSDist::SetPoints ( const occ::handle< NCollection_HArray1< gp_XYZ > > & thePoints)
inline

◆ Value()

bool GeomConvert_FuncSphereLSDist::Value ( const math_Vector & X,
double & F )
overridevirtual

◆ Values()

bool GeomConvert_FuncSphereLSDist::Values ( const math_Vector & X,
double & F,
math_Vector & G )
overridevirtual

Value and gradient.

Implements math_MultipleVarFunctionWithGradient.


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