Open CASCADE Technology 7.8.2.dev
|
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>
Public Member Functions | |
GeomConvert_FuncCylinderLSDist () | |
Constructor. | |
GeomConvert_FuncCylinderLSDist (const Handle< TColgp_HArray1OfXYZ > &thePoints, const gp_Dir &theDir) | |
void | SetPoints (const Handle< TColgp_HArray1OfXYZ > &thePoints) |
void | SetDir (const gp_Dir &theDir) |
Standard_Integer | NbVariables () const override |
Number of variables. | |
Standard_Boolean | Value (const math_Vector &X, Standard_Real &F) override |
Value. | |
Standard_Boolean | Gradient (const math_Vector &X, math_Vector &G) override |
Gradient. | |
Standard_Boolean | Values (const math_Vector &X, Standard_Real &F, math_Vector &G) override |
Value and gradient. | |
Public Member Functions inherited from math_MultipleVarFunctionWithGradient | |
Public Member Functions inherited from math_MultipleVarFunction | |
virtual Standard_Integer | 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 () |
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]
|
inline |
Constructor.
GeomConvert_FuncCylinderLSDist::GeomConvert_FuncCylinderLSDist | ( | const Handle< TColgp_HArray1OfXYZ > & | thePoints, |
const gp_Dir & | theDir ) |
|
overridevirtual |
Gradient.
Implements math_MultipleVarFunctionWithGradient.
|
overridevirtual |
Number of variables.
Implements math_MultipleVarFunctionWithGradient.
|
inline |
|
inline |
|
overridevirtual |
Value.
Implements math_MultipleVarFunctionWithGradient.
|
overridevirtual |
Value and gradient.
Implements math_MultipleVarFunctionWithGradient.