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

Function for search of cylinder canonic parameters: coordinates of center local coordinate system, direction of axis and radius from set of points by least square method. More...

#include <GeomConvert_FuncCylinderLSDist.hxx>

Inheritance diagram for GeomConvert_FuncCylinderLSDist:
Inheritance graph
[legend]

Public Member Functions

 GeomConvert_FuncCylinderLSDist ()=default
 Constructor.
 
 GeomConvert_FuncCylinderLSDist (const occ::handle< NCollection_HArray1< gp_XYZ > > &thePoints, const gp_Dir &theDir)
 
void SetPoints (const occ::handle< NCollection_HArray1< gp_XYZ > > &thePoints)
 
void SetDir (const gp_Dir &theDir)
 
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 cylinder canonic parameters: coordinates of center local coordinate system, direction of axis and radius from set of points by least square method.

The class inherits math_MultipleVarFunctionWithGradient and thus is intended for use in math_BFGS algorithm.

Parametrisation: Cylinder is defined by its axis and radius. Axis is defined by 3 cartesian coordinates at location x0, y0, z0 and direction, which is constant and set by user: dir.x, dir.y, dir.z The criteria is: F(x0, y0, z0, theta, phi, R) = Sum[|(P(i) - Loc)^dir|^2 - R^2]^2 => min P(i) is i-th sample point, Loc, dir - axis location and direction, R - radius

The square vector product |(P(i) - Loc)^dir|^2 is:

[(y - y0)*dir.z - (z - z0)*dir.y]^2 + [(z - z0)*dir.x - (x - x0)*dir.z]^2 + [(x - x0)*dir.y - (y - y0)*dir.x]^2

First derivative of square vector product are: Dx0 = 2*[(z - z0)*dir.x - (x - x0)*dir.z]*dir.z -2*[(x - x0)*dir.y - (y - y0)*dir.x]*dir.y Dy0 = -2*[(y - y0)*dir.z - (z - z0)*dir.y]*dir.z +2*[(x - x0)*dir.y - (y - y0)*dir.x]*dir.x Dz0 = 2*[(y - y0)*dir.z - (z - z0)*dir.y]*dir.y -2*[(z - z0)*dir.x - (x - x0)*dir.z]*dir.x

dF/dx0 : G1(...) = 2*Sum{[...]*Dx0} dF/dy0 : G2(...) = 2*Sum{[...]*Dy0} dF/dz0 : G3(...) = 2*Sum{[...]*Dz0} dF/dR : G4(...) = -4*R*Sum[...] [...] = [|(P(i) - Loc)^dir|^2 - R^2]

Constructor & Destructor Documentation

◆ GeomConvert_FuncCylinderLSDist() [1/2]

GeomConvert_FuncCylinderLSDist::GeomConvert_FuncCylinderLSDist ( )
default

Constructor.

◆ GeomConvert_FuncCylinderLSDist() [2/2]

GeomConvert_FuncCylinderLSDist::GeomConvert_FuncCylinderLSDist ( const occ::handle< NCollection_HArray1< gp_XYZ > > & thePoints,
const gp_Dir & theDir )

Member Function Documentation

◆ Gradient()

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

Gradient.

Implements math_MultipleVarFunctionWithGradient.

◆ NbVariables()

int GeomConvert_FuncCylinderLSDist::NbVariables ( ) const
overridevirtual

Number of variables.

Implements math_MultipleVarFunctionWithGradient.

◆ SetDir()

void GeomConvert_FuncCylinderLSDist::SetDir ( const gp_Dir & theDir)
inline

◆ SetPoints()

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

◆ Value()

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

◆ Values()

bool GeomConvert_FuncCylinderLSDist::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: