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

Polynomial definition for surface normal computation at singular points. More...

#include <CSLib_NormalPolyDef.hxx>

Inheritance diagram for CSLib_NormalPolyDef:
Inheritance graph
[legend]

Public Member Functions

 CSLib_NormalPolyDef (int theK0, const NCollection_Array1< double > &theLi)
 Constructs a polynomial definition for normal computation.
 
bool Value (const double theX, double &theF) override
 Computes the value of the function for the given variable.
 
bool Derivative (const double theX, double &theD) override
 Computes the derivative of the function for the given variable.
 
bool Values (const double theX, double &theF, double &theD) override
 Computes both the value and derivative of the function.
 
- Public Member Functions inherited from math_FunctionWithDerivative
 ~math_FunctionWithDerivative () override
 
- Public Member Functions inherited from math_Function
virtual ~math_Function ()=default
 Virtual destructor, for safe inheritance.
 
virtual int GetStateNumber ()
 returns the state of the function corresponding to the latest call of any methods associated with the function. This function is called by each of the algorithms described later which defined 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.
 

Detailed Description

Polynomial definition for surface normal computation at singular points.

This class defines a polynomial function F(X) and its derivative for use with numerical root-finding algorithms. The function represents a trigonometric polynomial in terms of cos(X) and sin(X) with binomial coefficients.

The polynomial has the form: F(X) = Sum_{i=0}^{k0} C(k0,i) * cos^i(X) * sin^(k0-i)(X) * li(i)

where C(k0,i) is the binomial coefficient and li(i) are user-provided coefficients.

This is used internally by CSLib::Normal() to find the normal direction at singular surface points by solving for zeros of this polynomial.

Constructor & Destructor Documentation

◆ CSLib_NormalPolyDef()

CSLib_NormalPolyDef::CSLib_NormalPolyDef ( int theK0,
const NCollection_Array1< double > & theLi )

Constructs a polynomial definition for normal computation.

Parameters
[in]theK0Polynomial degree (must be >= 0)
[in]theLiArray of coefficients with indices 0 to theK0

Member Function Documentation

◆ Derivative()

bool CSLib_NormalPolyDef::Derivative ( const double theX,
double & theD )
overridevirtual

Computes the derivative of the function for the given variable.

Evaluates dF/dX using the chain rule on the trigonometric polynomial.

Parameters
[in]theXInput variable (angle in radians)
[out]theDComputed derivative value
Returns
true if calculation was successful, false otherwise

Implements math_FunctionWithDerivative.

◆ Value()

bool CSLib_NormalPolyDef::Value ( const double theX,
double & theF )
overridevirtual

Computes the value of the function for the given variable.

Evaluates F(X) = Sum_{i=0}^{k0} C(k0,i) * cos^i(X) * sin^(k0-i)(X) * li(i)

Parameters
[in]theXInput variable (angle in radians)
[out]theFComputed function value
Returns
true if calculation was successful, false otherwise

Implements math_FunctionWithDerivative.

◆ Values()

bool CSLib_NormalPolyDef::Values ( const double theX,
double & theF,
double & theD )
overridevirtual

Computes both the value and derivative of the function.

More efficient than calling Value() and Derivative() separately as common subexpressions are computed only once.

Parameters
[in]theXInput variable (angle in radians)
[out]theFComputed function value
[out]theDComputed derivative value
Returns
true if calculation was successful, false otherwise

Implements math_FunctionWithDerivative.


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