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

PLib means Polynomial functions library. This pk provides basic computation functions for polynomial functions. Note: weight arrays can be passed by pointer for some functions so that NULL pointer is valid. That means no weights passed. More...

#include <PLib.hxx>

Static Public Member Functions

static NCollection_Array1< double > * NoWeights ()
 Used as argument for a non rational functions.
 
static NCollection_Array2< double > * NoWeights2 ()
 Used as argument for a non rational functions.
 
static void SetPoles (const NCollection_Array1< gp_Pnt > &Poles, NCollection_Array1< double > &FP)
 Copy in FP the coordinates of the poles.
 
static void SetPoles (const NCollection_Array1< gp_Pnt > &Poles, const NCollection_Array1< double > &Weights, NCollection_Array1< double > &FP)
 Copy in FP the coordinates of the poles.
 
static void GetPoles (const NCollection_Array1< double > &FP, NCollection_Array1< gp_Pnt > &Poles)
 Get from FP the coordinates of the poles.
 
static void GetPoles (const NCollection_Array1< double > &FP, NCollection_Array1< gp_Pnt > &Poles, NCollection_Array1< double > &Weights)
 Get from FP the coordinates of the poles.
 
static void SetPoles (const NCollection_Array1< gp_Pnt2d > &Poles, NCollection_Array1< double > &FP)
 Copy in FP the coordinates of the poles.
 
static void SetPoles (const NCollection_Array1< gp_Pnt2d > &Poles, const NCollection_Array1< double > &Weights, NCollection_Array1< double > &FP)
 Copy in FP the coordinates of the poles.
 
static void GetPoles (const NCollection_Array1< double > &FP, NCollection_Array1< gp_Pnt2d > &Poles)
 Get from FP the coordinates of the poles.
 
static void GetPoles (const NCollection_Array1< double > &FP, NCollection_Array1< gp_Pnt2d > &Poles, NCollection_Array1< double > &Weights)
 Get from FP the coordinates of the poles.
 
static double Bin (const int N, const int P)
 Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
 
static void RationalDerivative (const int Degree, const int N, const int Dimension, double &Ders, double &RDers, const bool All=true)
 Computes the derivatives of a ratio at order <N> in dimension <Dimension>.
 
static void RationalDerivatives (const int DerivativesRequest, const int Dimension, double &PolesDerivatives, double &WeightsDerivatives, double &RationalDerivates)
 Computes DerivativesRequest derivatives of a ratio at of a BSpline function of degree <Degree> dimension <Dimension>.
 
static void EvalPolynomial (const double U, const int DerivativeOrder, const int Degree, const int Dimension, const double &PolynomialCoeff, double &Results)
 Performs Horner method with synthetic division for derivatives parameter , with <Degree> and <Dimension>. PolynomialCoeff are stored in the following fashion.
 
static void NoDerivativeEvalPolynomial (const double U, const int Degree, const int Dimension, const int DegreeDimension, const double &PolynomialCoeff, double &Results)
 Same as above with DerivativeOrder = 0;.
 
static void EvalPoly2Var (const double U, const double V, const int UDerivativeOrder, const int VDerivativeOrder, const int UDegree, const int VDegree, const int Dimension, double &PolynomialCoeff, double &Results)
 Applies EvalPolynomial twice to evaluate the derivative of orders UDerivativeOrder in U, VDerivativeOrder in V at parameters U,V.
 
static int EvalLagrange (const double U, const int DerivativeOrder, const int Degree, const int Dimension, double &ValueArray, double &ParameterArray, double &Results)
 Performs the Lagrange Interpolation of given series of points with given parameters with the requested derivative order Results will store things in the following format with d = DerivativeOrder.
 
static int EvalCubicHermite (const double U, const int DerivativeOrder, const int Dimension, double &ValueArray, double &DerivativeArray, double &ParameterArray, double &Results)
 Performs the Cubic Hermite Interpolation of given series of points with given parameters with the requested derivative order. ValueArray stores the value at the first and last parameter. It has the following format :
 
static bool HermiteCoefficients (const double FirstParameter, const double LastParameter, const int FirstOrder, const int LastOrder, math_Matrix &MatrixCoefs)
 This build the coefficient of Hermite's polynomes on [FirstParameter, LastParameter].
 
static void CoefficientsPoles (const NCollection_Array1< gp_Pnt > &Coefs, const NCollection_Array1< double > *WCoefs, NCollection_Array1< gp_Pnt > &Poles, NCollection_Array1< double > *WPoles)
 
static void CoefficientsPoles (const NCollection_Array1< gp_Pnt2d > &Coefs, const NCollection_Array1< double > *WCoefs, NCollection_Array1< gp_Pnt2d > &Poles, NCollection_Array1< double > *WPoles)
 
static void CoefficientsPoles (const NCollection_Array1< double > &Coefs, const NCollection_Array1< double > *WCoefs, NCollection_Array1< double > &Poles, NCollection_Array1< double > *WPoles)
 
static void CoefficientsPoles (const int dim, const NCollection_Array1< double > &Coefs, const NCollection_Array1< double > *WCoefs, NCollection_Array1< double > &Poles, NCollection_Array1< double > *WPoles)
 
static void Trimming (const double U1, const double U2, NCollection_Array1< gp_Pnt > &Coeffs, NCollection_Array1< double > *WCoeffs)
 
static void Trimming (const double U1, const double U2, NCollection_Array1< gp_Pnt2d > &Coeffs, NCollection_Array1< double > *WCoeffs)
 
static void Trimming (const double U1, const double U2, NCollection_Array1< double > &Coeffs, NCollection_Array1< double > *WCoeffs)
 
static void Trimming (const double U1, const double U2, const int dim, NCollection_Array1< double > &Coeffs, NCollection_Array1< double > *WCoeffs)
 
static void CoefficientsPoles (const NCollection_Array2< gp_Pnt > &Coefs, const NCollection_Array2< double > *WCoefs, NCollection_Array2< gp_Pnt > &Poles, NCollection_Array2< double > *WPoles)
 
static void UTrimming (const double U1, const double U2, NCollection_Array2< gp_Pnt > &Coeffs, NCollection_Array2< double > *WCoeffs)
 
static void VTrimming (const double V1, const double V2, NCollection_Array2< gp_Pnt > &Coeffs, NCollection_Array2< double > *WCoeffs)
 
static bool HermiteInterpolate (const int Dimension, const double FirstParameter, const double LastParameter, const int FirstOrder, const int LastOrder, const NCollection_Array2< double > &FirstConstr, const NCollection_Array2< double > &LastConstr, NCollection_Array1< double > &Coefficients)
 Compute the coefficients in the canonical base of the polynomial satisfying the given constraints at the given parameters The array FirstContr(i,j) i=1,Dimension j=0,FirstOrder contains the values of the constraint at parameter FirstParameter idem for LastConstr.
 
static void JacobiParameters (const GeomAbs_Shape ConstraintOrder, const int MaxDegree, const int Code, int &NbGaussPoints, int &WorkDegree)
 Compute the number of points used for integral computations (NbGaussPoints) and the degree of Jacobi Polynomial (WorkDegree). ConstraintOrder has to be GeomAbs_C0, GeomAbs_C1 or GeomAbs_C2 Code: Code d' init. des parametres de discretisation. = -5 = -4 = -3 = -2 = -1 = 1 calcul rapide avec precision moyenne. = 2 calcul rapide avec meilleure precision. = 3 calcul un peu plus lent avec bonne precision. = 4 calcul lent avec la meilleure precision possible.
 
static int NivConstr (const GeomAbs_Shape ConstraintOrder)
 translates from GeomAbs_Shape to Integer
 
static GeomAbs_Shape ConstraintOrder (const int NivConstr)
 translates from Integer to GeomAbs_Shape
 
static void EvalLength (const int Degree, const int Dimension, double &PolynomialCoeff, const double U1, const double U2, double &Length)
 
static void EvalLength (const int Degree, const int Dimension, double &PolynomialCoeff, const double U1, const double U2, const double Tol, double &Length, double &Error)
 

Detailed Description

PLib means Polynomial functions library. This pk provides basic computation functions for polynomial functions. Note: weight arrays can be passed by pointer for some functions so that NULL pointer is valid. That means no weights passed.

Member Function Documentation

◆ Bin()

static double PLib::Bin ( const int N,
const int P )
static

Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().

◆ CoefficientsPoles() [1/5]

static void PLib::CoefficientsPoles ( const int dim,
const NCollection_Array1< double > & Coefs,
const NCollection_Array1< double > * WCoefs,
NCollection_Array1< double > & Poles,
NCollection_Array1< double > * WPoles )
static

◆ CoefficientsPoles() [2/5]

static void PLib::CoefficientsPoles ( const NCollection_Array1< double > & Coefs,
const NCollection_Array1< double > * WCoefs,
NCollection_Array1< double > & Poles,
NCollection_Array1< double > * WPoles )
static

◆ CoefficientsPoles() [3/5]

static void PLib::CoefficientsPoles ( const NCollection_Array1< gp_Pnt > & Coefs,
const NCollection_Array1< double > * WCoefs,
NCollection_Array1< gp_Pnt > & Poles,
NCollection_Array1< double > * WPoles )
static

◆ CoefficientsPoles() [4/5]

static void PLib::CoefficientsPoles ( const NCollection_Array1< gp_Pnt2d > & Coefs,
const NCollection_Array1< double > * WCoefs,
NCollection_Array1< gp_Pnt2d > & Poles,
NCollection_Array1< double > * WPoles )
static

◆ CoefficientsPoles() [5/5]

static void PLib::CoefficientsPoles ( const NCollection_Array2< gp_Pnt > & Coefs,
const NCollection_Array2< double > * WCoefs,
NCollection_Array2< gp_Pnt > & Poles,
NCollection_Array2< double > * WPoles )
static

◆ ConstraintOrder()

static GeomAbs_Shape PLib::ConstraintOrder ( const int NivConstr)
static

translates from Integer to GeomAbs_Shape

◆ EvalCubicHermite()

static int PLib::EvalCubicHermite ( const double U,
const int DerivativeOrder,
const int Dimension,
double & ValueArray,
double & DerivativeArray,
double & ParameterArray,
double & Results )
static

Performs the Cubic Hermite Interpolation of given series of points with given parameters with the requested derivative order. ValueArray stores the value at the first and last parameter. It has the following format :

[0], [Dimension-1] : value at first param
[Dimension], [Dimension + Dimension-1] : value at last param
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142

Derivative array stores the value of the derivatives at the first parameter and at the last parameter in the following format

[0], [Dimension-1] : derivative at

first param

[Dimension], [Dimension + Dimension-1] : derivative at

last param

ParameterArray stores the first and last parameter in the following format :

[1] : last parameter

Results will store things in the following format with d = DerivativeOrder

[0], [Dimension-1] : value
[Dimension], [Dimension + Dimension-1] : first derivative
[d *Dimension], [d*Dimension + Dimension-1]: dth derivative

◆ EvalLagrange()

static int PLib::EvalLagrange ( const double U,
const int DerivativeOrder,
const int Degree,
const int Dimension,
double & ValueArray,
double & ParameterArray,
double & Results )
static

Performs the Lagrange Interpolation of given series of points with given parameters with the requested derivative order Results will store things in the following format with d = DerivativeOrder.

[0], [Dimension-1] : value
[Dimension], [Dimension + Dimension-1] : first derivative
[d *Dimension], [d*Dimension + Dimension-1]: dth derivative

◆ EvalLength() [1/2]

static void PLib::EvalLength ( const int Degree,
const int Dimension,
double & PolynomialCoeff,
const double U1,
const double U2,
const double Tol,
double & Length,
double & Error )
static

◆ EvalLength() [2/2]

static void PLib::EvalLength ( const int Degree,
const int Dimension,
double & PolynomialCoeff,
const double U1,
const double U2,
double & Length )
static

◆ EvalPoly2Var()

static void PLib::EvalPoly2Var ( const double U,
const double V,
const int UDerivativeOrder,
const int VDerivativeOrder,
const int UDegree,
const int VDegree,
const int Dimension,
double & PolynomialCoeff,
double & Results )
static

Applies EvalPolynomial twice to evaluate the derivative of orders UDerivativeOrder in U, VDerivativeOrder in V at parameters U,V.

PolynomialCoeff are stored in the following fashion

c00(1) .... c00(Dimension)
c10(1) .... c10(Dimension)
....
cm0(1) .... cm0(Dimension)
....
c01(1) .... c01(Dimension)
c11(1) .... c11(Dimension)
....
cm1(1) .... cm1(Dimension)
....
c0n(1) .... c0n(Dimension)
c1n(1) .... c1n(Dimension)
....
cmn(1) .... cmn(Dimension)

where the polynomial is defined as :

2 m
c00 + c10 U + c20 U + .... + cm0 U
2 m
+ c01 V + c11 UV + c21 U V + .... + cm1 U V
n m n
+ .... + c0n V + .... + cmn U V

with m = UDegree and n = VDegree

Results stores the result in the following format

f(1) f(2) .... f(Dimension)
GLfloat f
Definition OpenGl_glext.h:2667

Warning: <Results> and <PolynomialCoeff> must be dimensioned properly

◆ EvalPolynomial()

static void PLib::EvalPolynomial ( const double U,
const int DerivativeOrder,
const int Degree,
const int Dimension,
const double & PolynomialCoeff,
double & Results )
static

Performs Horner method with synthetic division for derivatives parameter , with <Degree> and <Dimension>. PolynomialCoeff are stored in the following fashion.

c0(1) c0(2) .... c0(Dimension)
c1(1) c1(2) .... c1(Dimension)
cDegree(1) cDegree(2) .... cDegree(Dimension)

where the polynomial is defined as :

2 Degree
c0 + c1 X + c2 X + .... cDegree X

Results stores the result in the following format

f(1) f(2) .... f(Dimension)
(1) (1) (1)
f (1) f (2) .... f (Dimension)
f (1) f (Dimension)

this just evaluates the point at parameter U

Warning: <Results> and <PolynomialCoeff> must be dimensioned properly

◆ GetPoles() [1/4]

static void PLib::GetPoles ( const NCollection_Array1< double > & FP,
NCollection_Array1< gp_Pnt > & Poles )
static

Get from FP the coordinates of the poles.

◆ GetPoles() [2/4]

static void PLib::GetPoles ( const NCollection_Array1< double > & FP,
NCollection_Array1< gp_Pnt > & Poles,
NCollection_Array1< double > & Weights )
static

Get from FP the coordinates of the poles.

◆ GetPoles() [3/4]

static void PLib::GetPoles ( const NCollection_Array1< double > & FP,
NCollection_Array1< gp_Pnt2d > & Poles )
static

Get from FP the coordinates of the poles.

◆ GetPoles() [4/4]

static void PLib::GetPoles ( const NCollection_Array1< double > & FP,
NCollection_Array1< gp_Pnt2d > & Poles,
NCollection_Array1< double > & Weights )
static

Get from FP the coordinates of the poles.

◆ HermiteCoefficients()

static bool PLib::HermiteCoefficients ( const double FirstParameter,
const double LastParameter,
const int FirstOrder,
const int LastOrder,
math_Matrix & MatrixCoefs )
static

This build the coefficient of Hermite's polynomes on [FirstParameter, LastParameter].

if j <= FirstOrder+1 then

MatrixCoefs[i, j] = ith coefficient of the polynome H0,j-1

else

MatrixCoefs[i, j] = ith coefficient of the polynome H1,k with k = j - FirstOrder - 2

return false if

  • |FirstParameter| > 100
  • |LastParameter| > 100
  • |FirstParameter| +|LastParameter| < 1/100
  • |LastParameter - FirstParameter| / (|FirstParameter| +|LastParameter|) < 1/100

◆ HermiteInterpolate()

static bool PLib::HermiteInterpolate ( const int Dimension,
const double FirstParameter,
const double LastParameter,
const int FirstOrder,
const int LastOrder,
const NCollection_Array2< double > & FirstConstr,
const NCollection_Array2< double > & LastConstr,
NCollection_Array1< double > & Coefficients )
static

Compute the coefficients in the canonical base of the polynomial satisfying the given constraints at the given parameters The array FirstContr(i,j) i=1,Dimension j=0,FirstOrder contains the values of the constraint at parameter FirstParameter idem for LastConstr.

◆ JacobiParameters()

static void PLib::JacobiParameters ( const GeomAbs_Shape ConstraintOrder,
const int MaxDegree,
const int Code,
int & NbGaussPoints,
int & WorkDegree )
static

Compute the number of points used for integral computations (NbGaussPoints) and the degree of Jacobi Polynomial (WorkDegree). ConstraintOrder has to be GeomAbs_C0, GeomAbs_C1 or GeomAbs_C2 Code: Code d' init. des parametres de discretisation. = -5 = -4 = -3 = -2 = -1 = 1 calcul rapide avec precision moyenne. = 2 calcul rapide avec meilleure precision. = 3 calcul un peu plus lent avec bonne precision. = 4 calcul lent avec la meilleure precision possible.

◆ NivConstr()

static int PLib::NivConstr ( const GeomAbs_Shape ConstraintOrder)
static

translates from GeomAbs_Shape to Integer

◆ NoDerivativeEvalPolynomial()

static void PLib::NoDerivativeEvalPolynomial ( const double U,
const int Degree,
const int Dimension,
const int DegreeDimension,
const double & PolynomialCoeff,
double & Results )
static

Same as above with DerivativeOrder = 0;.

◆ NoWeights()

static NCollection_Array1< double > * PLib::NoWeights ( )
inlinestatic

Used as argument for a non rational functions.

◆ NoWeights2()

static NCollection_Array2< double > * PLib::NoWeights2 ( )
inlinestatic

Used as argument for a non rational functions.

◆ RationalDerivative()

static void PLib::RationalDerivative ( const int Degree,
const int N,
const int Dimension,
double & Ders,
double & RDers,
const bool All = true )
static

Computes the derivatives of a ratio at order <N> in dimension <Dimension>.

<Ders> is an array containing the values of the input derivatives from 0 to std::min(<N>,<Degree>). For orders higher than <Degree> the inputcd /s2d1/BMDL/ derivatives are assumed to be 0.

Content of <Ders>:

x(1),x(2),...,x(Dimension),w x'(1),x'(2),...,x'(Dimension),w' x''(1),x''(2),...,x''(Dimension),w''

If <All> is false, only the derivative at order <N> is computed. <RDers> is an array of length Dimension which will contain the result:

x(1)/w , x(2)/w , ... derivated <N> times

If <All> is true all the derivatives up to order <N> are computed. <RDers> is an array of length Dimension * (N+1) which will contains:

x(1)/w , x(2)/w , ... x(1)/w , x(2)/w , ... derivated <1> times x(1)/w , x(2)/w , ... derivated <2> times ... x(1)/w , x(2)/w , ... derivated <N> times

Warning: <RDers> must be dimensioned properly.

◆ RationalDerivatives()

static void PLib::RationalDerivatives ( const int DerivativesRequest,
const int Dimension,
double & PolesDerivatives,
double & WeightsDerivatives,
double & RationalDerivates )
static

Computes DerivativesRequest derivatives of a ratio at of a BSpline function of degree <Degree> dimension <Dimension>.

<PolesDerivatives> is an array containing the values of the input derivatives from 0 to <DerivativeRequest> For orders higher than <Degree> the input derivatives are assumed to be 0.

Content of <PoleasDerivatives> :

x(1),x(2),...,x(Dimension) x'(1),x'(2),...,x'(Dimension) x''(1),x''(2),...,x''(Dimension)

WeightsDerivatives is an array that contains derivatives from 0 to <DerivativeRequest> After returning from the routine the array RationalDerivatives contains the following x(1)/w , x(2)/w , ... x(1)/w , x(2)/w , ... derivated once x(1)/w , x(2)/w , ... twice x(1)/w , x(2)/w , ... derivated <DerivativeRequest> times

The array RationalDerivatives and PolesDerivatives can be same since the overwrite is non destructive within the algorithm

Warning: <RationalDerivates> must be dimensioned properly.

◆ SetPoles() [1/4]

static void PLib::SetPoles ( const NCollection_Array1< gp_Pnt > & Poles,
const NCollection_Array1< double > & Weights,
NCollection_Array1< double > & FP )
static

Copy in FP the coordinates of the poles.

◆ SetPoles() [2/4]

static void PLib::SetPoles ( const NCollection_Array1< gp_Pnt > & Poles,
NCollection_Array1< double > & FP )
static

Copy in FP the coordinates of the poles.

◆ SetPoles() [3/4]

static void PLib::SetPoles ( const NCollection_Array1< gp_Pnt2d > & Poles,
const NCollection_Array1< double > & Weights,
NCollection_Array1< double > & FP )
static

Copy in FP the coordinates of the poles.

◆ SetPoles() [4/4]

static void PLib::SetPoles ( const NCollection_Array1< gp_Pnt2d > & Poles,
NCollection_Array1< double > & FP )
static

Copy in FP the coordinates of the poles.

◆ Trimming() [1/4]

static void PLib::Trimming ( const double U1,
const double U2,
const int dim,
NCollection_Array1< double > & Coeffs,
NCollection_Array1< double > * WCoeffs )
static

◆ Trimming() [2/4]

static void PLib::Trimming ( const double U1,
const double U2,
NCollection_Array1< double > & Coeffs,
NCollection_Array1< double > * WCoeffs )
static

◆ Trimming() [3/4]

static void PLib::Trimming ( const double U1,
const double U2,
NCollection_Array1< gp_Pnt > & Coeffs,
NCollection_Array1< double > * WCoeffs )
static

◆ Trimming() [4/4]

static void PLib::Trimming ( const double U1,
const double U2,
NCollection_Array1< gp_Pnt2d > & Coeffs,
NCollection_Array1< double > * WCoeffs )
static

◆ UTrimming()

static void PLib::UTrimming ( const double U1,
const double U2,
NCollection_Array2< gp_Pnt > & Coeffs,
NCollection_Array2< double > * WCoeffs )
static

◆ VTrimming()

static void PLib::VTrimming ( const double V1,
const double V2,
NCollection_Array2< gp_Pnt > & Coeffs,
NCollection_Array2< double > * WCoeffs )
static

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