1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

View File

@@ -1,2 +1,15 @@
PLib.cxx
PLib.hxx
PLib.lxx
PLib_Base.cxx
PLib_Base.hxx
PLib_DoubleJacobiPolynomial.cxx
PLib_DoubleJacobiPolynomial.hxx
PLib_DoubleJacobiPolynomial.lxx
PLib_HermitJacobi.cxx
PLib_HermitJacobi.hxx
PLib_HermitJacobi.lxx
PLib_JacobiPolynomial.cxx
PLib_JacobiPolynomial.hxx
PLib_JacobiPolynomial.lxx
PLib_JacobiPolynomial_0.hxx
PLib_CMPLRS.edl

View File

@@ -1,494 +0,0 @@
-- Created on: 1995-08-28
-- Created by: Laurent BOURESCHE
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- Modified: 28/02/1996 by PMN : HermiteCoefficients added
-- Modified: 19/02/1997 by JCT : EvalPoly2Var added
-- Modified: 05/09/97 by JPI for SSV : JacobiPolynomial --
-- DoubleJacobiPolynomial, HermiteInterpolate, JacobiParameters
package PLib
---Purpose: PLib means Polynomial functions library. This pk
-- provides basic computation functions for
-- polynomial functions.
--
uses Standard, math, TColStd, gp, TColgp, GeomAbs
is
deferred class Base from PLib;
class JacobiPolynomial from PLib;
class HermitJacobi from PLib;
class DoubleJacobiPolynomial from PLib;
NoWeights returns Array1OfReal from TColStd;
---Purpose: Used as argument for a non rational functions
--
---C++: return &
---C++: inline
NoWeights2 returns Array2OfReal from TColStd;
---Purpose: Used as argument for a non rational functions
--
---C++: return &
---C++: inline
SetPoles(Poles : Array1OfPnt from TColgp;
FP : out Array1OfReal from TColStd);
---Purpose: Copy in FP the coordinates of the poles.
SetPoles(Poles : Array1OfPnt from TColgp;
Weights : Array1OfReal from TColStd;
FP : out Array1OfReal from TColStd);
---Purpose: Copy in FP the coordinates of the poles.
GetPoles(FP : Array1OfReal from TColStd;
Poles : out Array1OfPnt from TColgp);
---Purpose: Get from FP the coordinates of the poles.
GetPoles(FP : Array1OfReal from TColStd;
Poles : out Array1OfPnt from TColgp;
Weights : out Array1OfReal from TColStd);
---Purpose: Get from FP the coordinates of the poles.
SetPoles(Poles : Array1OfPnt2d from TColgp;
FP : out Array1OfReal from TColStd);
---Purpose: Copy in FP the coordinates of the poles.
SetPoles(Poles : Array1OfPnt2d from TColgp;
Weights : Array1OfReal from TColStd;
FP : out Array1OfReal from TColStd);
---Purpose: Copy in FP the coordinates of the poles.
GetPoles(FP : Array1OfReal from TColStd;
Poles : out Array1OfPnt2d from TColgp);
---Purpose: Get from FP the coordinates of the poles.
GetPoles(FP : Array1OfReal from TColStd;
Poles : out Array1OfPnt2d from TColgp;
Weights : out Array1OfReal from TColStd);
---Purpose: Get from FP the coordinates of the poles.
Bin(N,P : Integer) returns Real;
---Purpose: Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
RationalDerivative(Degree : Integer;
N : Integer;
Dimension : Integer;
Ders : in out Real;
RDers : in out Real;
All : Boolean = Standard_True);
---Purpose: 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 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 dimensionned properly.
RationalDerivatives(DerivativesRequest : Integer;
Dimension : Integer;
PolesDerivatives : in out Real;
WeightsDerivatives : in out Real;
RationalDerivates : in out Real) ;
---Purpose: 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 dimensionned properly.
EvalPolynomial(U : Real;
DerivativeOrder : Integer ;
Degree : Integer ;
Dimension : Integer ;
PolynomialCoeff : in out Real ;
Results : in out Real) ;
---Purpose: Performs Horner method with synthethic division
-- for derivatives
-- parameter <U>, 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)
--
-- (DerivativeRequest) (DerivativeRequest)
-- f (1) f (Dimension)
--
-- this just evaluates the point at parameter U
--
-- Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
--
--
NoDerivativeEvalPolynomial(U : Real;
Degree : Integer ;
Dimension : Integer ;
DegreeDimension : Integer ;
PolynomialCoeff : in out Real ;
Results : in out Real) ;
---Purpose: Same as above with DerivativeOrder = 0;
EvalPoly2Var(U,V : Real;
UDerivativeOrder,VDerivativeOrder : Integer ;
UDegree,VDegree,Dimension : Integer ;
PolynomialCoeff : in out Real;
Results : in out Real) ;
---Purpose: 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)
--
-- Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
--
--
EvalLagrange(U : Real ;
DerivativeOrder : Integer ;
Degree : Integer ;
Dimension : Integer ;
ValueArray : in out Real;
ParameterArray : in out Real;
Results : in out Real) returns Integer ;
---Purpose: 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
EvalCubicHermite(U : Real ;
DerivativeOrder : Integer ;
Dimension : Integer ;
ValueArray : in out Real;
DerivativeArray : in out Real;
ParameterArray : in out Real;
Results : in out Real) returns Integer ;
---Purpose: 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
-- 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 :
-- [0] : first parameter
-- [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
HermiteCoefficients(FirstParameter : in Real;
LastParameter : in Real;
FirstOrder : in Integer;
LastOrder : in Integer;
MatrixCoefs : in out Matrix from math)
---Purpose: 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
returns Boolean;
----------------------------------------------------------------
-- The following functions computes poles corresponding to --
-- given coefficients. --
-- PLib::NoWeights() must be given for non rational functions--
----------------------------------------------------------------
CoefficientsPoles(Coefs : in Array1OfPnt from TColgp;
WCoefs : in Array1OfReal from TColStd;
Poles : in out Array1OfPnt from TColgp;
WPoles : in out Array1OfReal from TColStd);
CoefficientsPoles(Coefs : in Array1OfPnt2d from TColgp;
WCoefs : in Array1OfReal from TColStd;
Poles : in out Array1OfPnt2d from TColgp;
WPoles : in out Array1OfReal from TColStd);
CoefficientsPoles(Coefs : in Array1OfReal from TColStd;
WCoefs : in Array1OfReal from TColStd;
Poles : in out Array1OfReal from TColStd;
WPoles : in out Array1OfReal from TColStd);
CoefficientsPoles(dim : in Integer from Standard;
Coefs : in Array1OfReal from TColStd;
WCoefs : in Array1OfReal from TColStd;
Poles : in out Array1OfReal from TColStd;
WPoles : in out Array1OfReal from TColStd);
----------------------------------------------------------------
-- The following functions trim the Bezier curve between two --
-- parametric values U1, U2. --
-- Can be used to extend the curve : --
-- Parameters U1<0. or U2>1. can be given. --
-- PLib::NoWeights() must be given for non rational functions--
----------------------------------------------------------------
Trimming (U1, U2 : in Real;
Coeffs : in out Array1OfPnt from TColgp;
WCoeffs : in out Array1OfReal from TColStd);
Trimming (U1, U2 : in Real;
Coeffs : in out Array1OfPnt2d from TColgp;
WCoeffs : in out Array1OfReal from TColStd);
Trimming (U1, U2 : in Real;
Coeffs : in out Array1OfReal from TColStd;
WCoeffs : in out Array1OfReal from TColStd);
Trimming (U1, U2 : in Real;
dim : in Integer;
Coeffs : in out Array1OfReal from TColStd;
WCoeffs : in out Array1OfReal from TColStd);
----------------------------------------------------------------
-- The following functions computes poles corresponding to --
-- given coefficients. --
-- PLib::NoWeights2() must be given for non rational --
-- functions. --
----------------------------------------------------------------
CoefficientsPoles(Coefs : in Array2OfPnt from TColgp;
WCoefs : in Array2OfReal from TColStd;
Poles : in out Array2OfPnt from TColgp;
WPoles : in out Array2OfReal from TColStd);
----------------------------------------------------------------
-- The following functions trim the Bezier surface between --
-- two parametric values. --
-- Can be used to extend the surface : --
-- Parameters U1(V1)<0. or U2(V2)>1. can be given. --
-- PLib::NoWeights2() must be given for non rational --
-- functions. --
----------------------------------------------------------------
UTrimming (U1, U2 : in Real;
Coeffs : in out Array2OfPnt from TColgp;
WCoeffs : in out Array2OfReal from TColStd);
VTrimming (V1, V2 : in Real;
Coeffs : in out Array2OfPnt from TColgp;
WCoeffs : in out Array2OfReal from TColStd);
HermiteInterpolate(Dimension : in Integer;
FirstParameter,LastParameter : in Real;
FirstOrder,LastOrder : in Integer;
FirstConstr,LastConstr : Array2OfReal from TColStd;
Coefficients : out Array1OfReal from TColStd)
returns Boolean from Standard;
---Purpose : 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 (ConstraintOrder: Shape from GeomAbs;
MaxDegree, Code: in Integer;
NbGaussPoints: out Integer;
WorkDegree: out Integer)
---Purpose : 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.
raises ConstructionError from Standard;
-- if ConstraintOrder or Code is not valid
-- MaxDegree < 2*NivConstr+2 or MaxDegree > 50
--
---------- new
NivConstr(ConstraintOrder : Shape from GeomAbs)
---Purpose: translates from GeomAbs_Shape to Integer
returns Integer
raises ConstructionError from Standard;
ConstraintOrder(NivConstr : Integer)
---Purpose: translates from Integer to GeomAbs_Shape
returns Shape from GeomAbs
raises ConstructionError from Standard;
EvalLength(Degree : Integer;
Dimension : Integer;
PolynomialCoeff : in out Real;
U1, U2 : Real;
Length : out Real);
EvalLength(Degree : Integer;
Dimension : Integer;
PolynomialCoeff : in out Real;
U1, U2 : Real;
Tol : Real;
Length : out Real;
Error : out Real);
end PLib;

View File

@@ -18,24 +18,20 @@
// Modified: 18/06/1996 by PMN : NULL reference.
// Modified: 19/02/1997 by JCT : EvalPoly2Var added
#include <PLib.ixx>
#include <NCollection_LocalArray.hxx>
#include <math_Matrix.hxx>
#include <math_Gauss.hxx>
#include <Standard_ConstructionError.hxx>
#include <GeomAbs_Shape.hxx>
#include <math_Gauss.hxx>
#include <math.hxx>
#include <math_Gauss.hxx>
#include <math_Matrix.hxx>
#include <NCollection_LocalArray.hxx>
#include <PLib.hxx>
#include <Standard_ConstructionError.hxx>
// To convert points array into Real ..
// *********************************
//=======================================================================
//function : SetPoles
//purpose :
//=======================================================================
void PLib::SetPoles(const TColgp_Array1OfPnt2d& Poles,
TColStd_Array1OfReal& FP)
{

359
src/PLib/PLib.hxx Normal file
View File

@@ -0,0 +1,359 @@
// Created on: 1995-08-28
// Created by: Laurent BOURESCHE
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _PLib_HeaderFile
#define _PLib_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <GeomAbs_Shape.hxx>
class math_Matrix;
class PLib_Base;
class PLib_JacobiPolynomial;
class PLib_HermitJacobi;
class PLib_DoubleJacobiPolynomial;
//! PLib means Polynomial functions library. This pk
//! provides basic computation functions for
//! polynomial functions.
class PLib
{
public:
DEFINE_STANDARD_ALLOC
//! Used as argument for a non rational functions
static TColStd_Array1OfReal& NoWeights();
//! Used as argument for a non rational functions
static TColStd_Array2OfReal& NoWeights2();
//! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& FP);
//! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, TColStd_Array1OfReal& FP);
//! Get from FP the coordinates of the poles.
Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array1OfPnt& Poles);
//! Get from FP the coordinates of the poles.
Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& Weights);
//! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt2d& Poles, TColStd_Array1OfReal& FP);
//! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, TColStd_Array1OfReal& FP);
//! Get from FP the coordinates of the poles.
Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array1OfPnt2d& Poles);
//! Get from FP the coordinates of the poles.
Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array1OfPnt2d& Poles, TColStd_Array1OfReal& Weights);
//! Returns the Binomial Cnp. N should be <= BSplCLib::MaxDegree().
Standard_EXPORT static Standard_Real Bin (const Standard_Integer N, const Standard_Integer P);
//! 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 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 dimensionned properly.
Standard_EXPORT static void RationalDerivative (const Standard_Integer Degree, const Standard_Integer N, const Standard_Integer Dimension, Standard_Real& Ders, Standard_Real& RDers, const Standard_Boolean All = Standard_True);
//! 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 dimensionned properly.
Standard_EXPORT static void RationalDerivatives (const Standard_Integer DerivativesRequest, const Standard_Integer Dimension, Standard_Real& PolesDerivatives, Standard_Real& WeightsDerivatives, Standard_Real& RationalDerivates);
//! Performs Horner method with synthethic division
//! for derivatives
//! parameter <U>, 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)
//!
//! (DerivativeRequest) (DerivativeRequest)
//! f (1) f (Dimension)
//!
//! this just evaluates the point at parameter U
//!
//! Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
Standard_EXPORT static void EvalPolynomial (const Standard_Real U, const Standard_Integer DerivativeOrder, const Standard_Integer Degree, const Standard_Integer Dimension, Standard_Real& PolynomialCoeff, Standard_Real& Results);
//! Same as above with DerivativeOrder = 0;
Standard_EXPORT static void NoDerivativeEvalPolynomial (const Standard_Real U, const Standard_Integer Degree, const Standard_Integer Dimension, const Standard_Integer DegreeDimension, Standard_Real& PolynomialCoeff, Standard_Real& Results);
//! 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)
//!
//! Warning: <Results> and <PolynomialCoeff> must be dimensioned properly
Standard_EXPORT static void EvalPoly2Var (const Standard_Real U, const Standard_Real V, const Standard_Integer UDerivativeOrder, const Standard_Integer VDerivativeOrder, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Integer Dimension, Standard_Real& PolynomialCoeff, Standard_Real& 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
//!
//! [0], [Dimension-1] : value
//! [Dimension], [Dimension + Dimension-1] : first derivative
//!
//! [d *Dimension], [d*Dimension + Dimension-1]: dth derivative
Standard_EXPORT static Standard_Integer EvalLagrange (const Standard_Real U, const Standard_Integer DerivativeOrder, const Standard_Integer Degree, const Standard_Integer Dimension, Standard_Real& ValueArray, Standard_Real& ParameterArray, Standard_Real& 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 :
//! [0], [Dimension-1] : value at first param
//! [Dimension], [Dimension + Dimension-1] : value at last param
//! 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 :
//! [0] : first parameter
//! [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
Standard_EXPORT static Standard_Integer EvalCubicHermite (const Standard_Real U, const Standard_Integer DerivativeOrder, const Standard_Integer Dimension, Standard_Real& ValueArray, Standard_Real& DerivativeArray, Standard_Real& ParameterArray, Standard_Real& Results);
//! 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
Standard_EXPORT static Standard_Boolean HermiteCoefficients (const Standard_Real FirstParameter, const Standard_Real LastParameter, const Standard_Integer FirstOrder, const Standard_Integer LastOrder, math_Matrix& MatrixCoefs);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt& Coefs, const TColStd_Array1OfReal& WCoefs, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& WPoles);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs, const TColStd_Array1OfReal& WCoefs, TColgp_Array1OfPnt2d& Poles, TColStd_Array1OfReal& WPoles);
Standard_EXPORT static void CoefficientsPoles (const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal& WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& WPoles);
Standard_EXPORT static void CoefficientsPoles (const Standard_Integer dim, const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal& WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& WPoles);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt& Coeffs, TColStd_Array1OfReal& WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt2d& Coeffs, TColStd_Array1OfReal& WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal& WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, const Standard_Integer dim, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal& WCoeffs);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, const TColStd_Array2OfReal& WCoefs, TColgp_Array2OfPnt& Poles, TColStd_Array2OfReal& WPoles);
Standard_EXPORT static void UTrimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal& WCoeffs);
Standard_EXPORT static void VTrimming (const Standard_Real V1, const Standard_Real V2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal& WCoeffs);
//! 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
Standard_EXPORT static Standard_Boolean HermiteInterpolate (const Standard_Integer Dimension, const Standard_Real FirstParameter, const Standard_Real LastParameter, const Standard_Integer FirstOrder, const Standard_Integer LastOrder, const TColStd_Array2OfReal& FirstConstr, const TColStd_Array2OfReal& LastConstr, TColStd_Array1OfReal& Coefficients);
//! 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.
Standard_EXPORT static void JacobiParameters (const GeomAbs_Shape ConstraintOrder, const Standard_Integer MaxDegree, const Standard_Integer Code, Standard_Integer& NbGaussPoints, Standard_Integer& WorkDegree);
//! translates from GeomAbs_Shape to Integer
Standard_EXPORT static Standard_Integer NivConstr (const GeomAbs_Shape ConstraintOrder);
//! translates from Integer to GeomAbs_Shape
Standard_EXPORT static GeomAbs_Shape ConstraintOrder (const Standard_Integer NivConstr);
Standard_EXPORT static void EvalLength (const Standard_Integer Degree, const Standard_Integer Dimension, Standard_Real& PolynomialCoeff, const Standard_Real U1, const Standard_Real U2, Standard_Real& Length);
Standard_EXPORT static void EvalLength (const Standard_Integer Degree, const Standard_Integer Dimension, Standard_Real& PolynomialCoeff, const Standard_Real U1, const Standard_Real U2, const Standard_Real Tol, Standard_Real& Length, Standard_Real& Error);
protected:
private:
friend class PLib_Base;
friend class PLib_JacobiPolynomial;
friend class PLib_HermitJacobi;
friend class PLib_DoubleJacobiPolynomial;
};
#include <PLib.lxx>
#endif // _PLib_HeaderFile

View File

@@ -1,81 +0,0 @@
-- Created on: 1997-10-22
-- Created by: Philippe MANGIN / Sergey SOKOLOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
deferred class Base from PLib inherits TShared from MMgt
---Purpose: To work with different polynomial's Bases
uses
Array1OfReal from TColStd
is
ToCoefficients (me ; Dimension, Degree : Integer;
CoeffinBase : Array1OfReal from TColStd ;
Coefficients : out Array1OfReal from TColStd)
---Purpose:
-- Convert the polynomial P(t) in the canonical base.
is deferred;
D0 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd)
---Purpose: Compute the values of the basis functions in u
--
is deferred;
D1 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd)
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
is deferred;
D2 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd)
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
is deferred;
D3 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd;
BasisD3 : out Array1OfReal from TColStd)
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
is deferred;
WorkDegree (me) returns Integer
--- Purpose: returns WorkDegree
is deferred;
ReduceDegree ( me ; Dimension , MaxDegree : Integer ; Tol : Real ;
BaseCoeff : in out Real;
NewDegree : out Integer ;
MaxError : out Real)
---Purpose:
-- Compute NewDegree <= MaxDegree so that MaxError is lower
-- than Tol.
-- MaxError can be greater than Tol if it is not possible
-- to find a NewDegree <= MaxDegree.
-- In this case NewDegree = MaxDegree
--
is deferred;
end Base;

View File

@@ -14,4 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PLib_Base.ixx>
#include <PLib_Base.hxx>
#include <Standard_Type.hxx>

92
src/PLib/PLib_Base.hxx Normal file
View File

@@ -0,0 +1,92 @@
// Created on: 1997-10-22
// Created by: Philippe MANGIN / Sergey SOKOLOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _PLib_Base_HeaderFile
#define _PLib_Base_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <Standard_Real.hxx>
class PLib_Base;
DEFINE_STANDARD_HANDLE(PLib_Base, MMgt_TShared)
//! To work with different polynomial's Bases
class PLib_Base : public MMgt_TShared
{
public:
//! Convert the polynomial P(t) in the canonical base.
Standard_EXPORT virtual void ToCoefficients (const Standard_Integer Dimension, const Standard_Integer Degree, const TColStd_Array1OfReal& CoeffinBase, TColStd_Array1OfReal& Coefficients) const = 0;
//! Compute the values of the basis functions in u
Standard_EXPORT virtual void D0 (const Standard_Real U, TColStd_Array1OfReal& BasisValue) = 0;
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT virtual void D1 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1) = 0;
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT virtual void D2 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2) = 0;
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT virtual void D3 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3) = 0;
//! returns WorkDegree
Standard_EXPORT virtual Standard_Integer WorkDegree() const = 0;
//! Compute NewDegree <= MaxDegree so that MaxError is lower
//! than Tol.
//! MaxError can be greater than Tol if it is not possible
//! to find a NewDegree <= MaxDegree.
//! In this case NewDegree = MaxDegree
Standard_EXPORT virtual void ReduceDegree (const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Standard_Real Tol, Standard_Real& BaseCoeff, Standard_Integer& NewDegree, Standard_Real& MaxError) const = 0;
DEFINE_STANDARD_RTTI(PLib_Base,MMgt_TShared)
protected:
private:
};
#endif // _PLib_Base_HeaderFile

View File

@@ -1,25 +0,0 @@
-- Created on: 1996-02-19
-- Created by: Jean GAUTIER
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
@if ( %Station == "sil" ) then
@if ( %DebugMode == "False" ) then
@set %ModeOpt = "-O1";
@set %CMPLRS_F77_ModeOpt = "-O1";
@endif;
@endif;

View File

@@ -1,79 +0,0 @@
-- Created on: 1997-05-27
-- Created by: Sergey SOKOLOV
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class DoubleJacobiPolynomial from PLib
---Purpose:
uses Array1OfReal,HArray1OfReal from TColStd,
JacobiPolynomial from PLib
is
Create returns DoubleJacobiPolynomial;
Create ( JacPolU, JacPolV : JacobiPolynomial from PLib)
returns DoubleJacobiPolynomial;
MaxErrorU ( me; Dimension, DegreeU, DegreeV, dJacCoeff : Integer;
JacCoeff : Array1OfReal from TColStd ) returns Real;
MaxErrorV ( me; Dimension, DegreeU, DegreeV, dJacCoeff : Integer;
JacCoeff : Array1OfReal from TColStd ) returns Real;
MaxError ( me; Dimension, MinDegreeU, MaxDegreeU,
MinDegreeV, MaxDegreeV, dJacCoeff : Integer;
JacCoeff : Array1OfReal from TColStd; Error : Real ) returns Real;
ReduceDegree ( me; Dimension, MinDegreeU, MaxDegreeU,
MinDegreeV, MaxDegreeV, dJacCoeff : Integer;
JacCoeff : Array1OfReal from TColStd; EpmsCut : Real;
MaxError : in out Real; NewDegreeU, NewDegreeV : in out Integer);
AverageError ( me; Dimension, DegreeU, DegreeV, dJacCoeff : Integer;
JacCoeff : Array1OfReal from TColStd ) returns Real;
WDoubleJacobiToCoefficients ( me; Dimension, DegreeU, DegreeV : Integer;
JacCoeff : Array1OfReal from TColStd;
Coefficients : out Array1OfReal from TColStd );
U (me)
--- Purpose: returns myJacPolU;
---C++: inline
returns JacobiPolynomial from PLib;
V (me)
--- Purpose: returns myJacPolV;
---C++: inline
returns JacobiPolynomial from PLib;
TabMaxU (me)
--- Purpose: returns myTabMaxU;
---C++: inline
returns HArray1OfReal from TColStd;
TabMaxV (me)
--- Purpose: returns myTabMaxV;
---C++: inline
returns HArray1OfReal from TColStd;
fields
myJacPolU : JacobiPolynomial from PLib;
myJacPolV : JacobiPolynomial from PLib;
myTabMaxU : HArray1OfReal from TColStd;
myTabMaxV : HArray1OfReal from TColStd;
end DoubleJacobiPolynomial;

View File

@@ -14,15 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PLib_DoubleJacobiPolynomial.ixx>
#include <PLib_JacobiPolynomial.hxx>
#include <math_Vector.hxx>
#include <PLib_DoubleJacobiPolynomial.hxx>
#include <PLib_JacobiPolynomial.hxx>
//=======================================================================
//function : PLib_DoubleJacobiPolynomial
//purpose :
//=======================================================================
PLib_DoubleJacobiPolynomial::PLib_DoubleJacobiPolynomial()
{

View File

@@ -0,0 +1,95 @@
// Created on: 1997-05-27
// Created by: Sergey SOKOLOV
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _PLib_DoubleJacobiPolynomial_HeaderFile
#define _PLib_DoubleJacobiPolynomial_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_Array1OfReal.hxx>
class PLib_JacobiPolynomial;
class PLib_DoubleJacobiPolynomial
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT PLib_DoubleJacobiPolynomial();
Standard_EXPORT PLib_DoubleJacobiPolynomial(const Handle(PLib_JacobiPolynomial)& JacPolU, const Handle(PLib_JacobiPolynomial)& JacPolV);
Standard_EXPORT Standard_Real MaxErrorU (const Standard_Integer Dimension, const Standard_Integer DegreeU, const Standard_Integer DegreeV, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const;
Standard_EXPORT Standard_Real MaxErrorV (const Standard_Integer Dimension, const Standard_Integer DegreeU, const Standard_Integer DegreeV, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const;
Standard_EXPORT Standard_Real MaxError (const Standard_Integer Dimension, const Standard_Integer MinDegreeU, const Standard_Integer MaxDegreeU, const Standard_Integer MinDegreeV, const Standard_Integer MaxDegreeV, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff, const Standard_Real Error) const;
Standard_EXPORT void ReduceDegree (const Standard_Integer Dimension, const Standard_Integer MinDegreeU, const Standard_Integer MaxDegreeU, const Standard_Integer MinDegreeV, const Standard_Integer MaxDegreeV, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff, const Standard_Real EpmsCut, Standard_Real& MaxError, Standard_Integer& NewDegreeU, Standard_Integer& NewDegreeV) const;
Standard_EXPORT Standard_Real AverageError (const Standard_Integer Dimension, const Standard_Integer DegreeU, const Standard_Integer DegreeV, const Standard_Integer dJacCoeff, const TColStd_Array1OfReal& JacCoeff) const;
Standard_EXPORT void WDoubleJacobiToCoefficients (const Standard_Integer Dimension, const Standard_Integer DegreeU, const Standard_Integer DegreeV, const TColStd_Array1OfReal& JacCoeff, TColStd_Array1OfReal& Coefficients) const;
//! returns myJacPolU;
Handle(PLib_JacobiPolynomial) U() const;
//! returns myJacPolV;
Handle(PLib_JacobiPolynomial) V() const;
//! returns myTabMaxU;
Handle(TColStd_HArray1OfReal) TabMaxU() const;
//! returns myTabMaxV;
Handle(TColStd_HArray1OfReal) TabMaxV() const;
protected:
private:
Handle(PLib_JacobiPolynomial) myJacPolU;
Handle(PLib_JacobiPolynomial) myJacPolV;
Handle(TColStd_HArray1OfReal) myTabMaxU;
Handle(TColStd_HArray1OfReal) myTabMaxV;
};
#include <PLib_DoubleJacobiPolynomial.lxx>
#endif // _PLib_DoubleJacobiPolynomial_HeaderFile

View File

@@ -1,170 +0,0 @@
-- Created on: 1997-10-22
-- Created by: Philippe MANGIN
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class HermitJacobi from PLib
inherits Base from PLib
--- Purpose: This class provides method to work with Jacobi Polynomials
-- relativly to an order of constraint
-- q = myWorkDegree-2*(myNivConstr+1)
-- Jk(t) for k=0,q compose the Jacobi Polynomial base relativly to the weigth W(t)
-- iorder is the integer value for the constraints:
-- iorder = 0 <=> ConstraintOrder = GeomAbs_C0
-- iorder = 1 <=> ConstraintOrder = GeomAbs_C1
-- iorder = 2 <=> ConstraintOrder = GeomAbs_C2
-- P(t) = H(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)
-- the coefficients JacCoeff represents P(t) JacCoeff are stored as follow:
--
-- c0(1) c0(2) .... c0(Dimension)
-- c1(1) c1(2) .... c1(Dimension)
--
--
--
-- cDegree(1) cDegree(2) .... cDegree(Dimension)
--
-- The coefficients
-- c0(1) c0(2) .... c0(Dimension)
-- c2*ordre+1(1) ... c2*ordre+1(dimension)
--
-- represents the part of the polynomial in the
-- Hermit's base: H(t)
-- H(t) = c0H00(t) + c1H01(t) + ...c(iordre)H(0 ;iorder)+ c(iordre+1)H10(t)+...
-- The following coefficients represents the part of the
-- polynomial in the Jacobi base ie Q(t)
-- Q(t) = c2*iordre+2 J0(t) + ...+ cDegree JDegree-2*iordre-2
uses
Array2OfReal from TColStd,
Array1OfReal from TColStd,
Shape from GeomAbs,
Matrix from math,
JacobiPolynomial from PLib
raises
ConstructionError from Standard
is
Create ( WorkDegree : Integer ;
ConstraintOrder : Shape from GeomAbs)
returns HermitJacobi from PLib
---Purpose:
-- Initialize the polynomial class
-- Degree has to be <= 30
-- ConstraintOrder has to be GeomAbs_C0
-- GeomAbs_C1
-- GeomAbs_C2
raises ConstructionError from Standard;
-- if Degree or ConstraintOrder is non valid
--
-- Work in HermitJacobi base
MaxError ( me ; Dimension : Integer ;
HermJacCoeff : in out Real;
NewDegree : Integer )
returns Real;
---Purpose:
-- This method computes the maximum error on the polynomial
-- W(t) Q(t) obtained by missing the coefficients of JacCoeff from
-- NewDegree +1 to Degree
ReduceDegree ( me ; Dimension , MaxDegree : Integer ; Tol : Real ;
HermJacCoeff : in out Real;
NewDegree : out Integer ;
MaxError : out Real);
---Purpose:
-- Compute NewDegree <= MaxDegree so that MaxError is lower
-- than Tol.
-- MaxError can be greater than Tol if it is not possible
-- to find a NewDegree <= MaxDegree.
-- In this case NewDegree = MaxDegree
--
AverageError ( me ; Dimension : Integer ;
HermJacCoeff : in out Real;
NewDegree : Integer )
-- This method computes the average error on the polynomial W(t)Q(t)
-- obtained by missing the
-- coefficients JacCoeff from NewDegree +1 to Degree
returns Real;
ToCoefficients ( me ; Dimension, Degree : Integer ;
HermJacCoeff : Array1OfReal from TColStd ;
Coefficients : out Array1OfReal from TColStd );
---Purpose:
-- Convert the polynomial P(t) = H(t) + W(t) Q(t) in the canonical base.
--
D0123 (me : mutable; NDerive : Integer; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd;
BasisD3 : out Array1OfReal from TColStd)
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
is private;
D0 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd);
---Purpose: Compute the values of the basis functions in u
--
D1 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
D2 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
D3 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd;
BasisD3 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
WorkDegree (me)
--- Purpose: returns WorkDegree
---C++: inline
returns Integer;
NivConstr (me)
---Purpose: returns NivConstr
---C++: inline
returns Integer;
fields
myH : Matrix from math;
myJacobi : JacobiPolynomial from PLib;
myWCoeff : Array1OfReal; -- The cannonical Coefficients of W(t).
end HermitJacobi;

View File

@@ -14,16 +14,19 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PLib_HermitJacobi.ixx>
#include <PLib.hxx>
#include <NCollection_LocalArray.hxx>
#include <PLib.hxx>
#include <PLib_HermitJacobi.hxx>
#include <PLib_JacobiPolynomial.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : PLib_HermitJacobi
//purpose :
//=======================================================================
PLib_HermitJacobi::PLib_HermitJacobi(const Standard_Integer WorkDegree,
const GeomAbs_Shape ConstraintOrder) :
myH(1,2*(PLib::NivConstr(ConstraintOrder)+1),

View File

@@ -0,0 +1,148 @@
// Created on: 1997-10-22
// Created by: Philippe MANGIN
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _PLib_HermitJacobi_HeaderFile
#define _PLib_HermitJacobi_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <math_Matrix.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <PLib_Base.hxx>
#include <Standard_Integer.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Real.hxx>
class PLib_JacobiPolynomial;
class Standard_ConstructionError;
class PLib_HermitJacobi;
DEFINE_STANDARD_HANDLE(PLib_HermitJacobi, PLib_Base)
//! This class provides method to work with Jacobi Polynomials
//! relativly to an order of constraint
//! q = myWorkDegree-2*(myNivConstr+1)
//! Jk(t) for k=0,q compose the Jacobi Polynomial base relativly to the weigth W(t)
//! iorder is the integer value for the constraints:
//! iorder = 0 <=> ConstraintOrder = GeomAbs_C0
//! iorder = 1 <=> ConstraintOrder = GeomAbs_C1
//! iorder = 2 <=> ConstraintOrder = GeomAbs_C2
//! P(t) = H(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)
//! the coefficients JacCoeff represents P(t) JacCoeff are stored as follow:
//!
//! c0(1) c0(2) .... c0(Dimension)
//! c1(1) c1(2) .... c1(Dimension)
//!
//! cDegree(1) cDegree(2) .... cDegree(Dimension)
//!
//! The coefficients
//! c0(1) c0(2) .... c0(Dimension)
//! c2*ordre+1(1) ... c2*ordre+1(dimension)
//!
//! represents the part of the polynomial in the
//! Hermit's base: H(t)
//! H(t) = c0H00(t) + c1H01(t) + ...c(iordre)H(0 ;iorder)+ c(iordre+1)H10(t)+...
//! The following coefficients represents the part of the
//! polynomial in the Jacobi base ie Q(t)
//! Q(t) = c2*iordre+2 J0(t) + ...+ cDegree JDegree-2*iordre-2
class PLib_HermitJacobi : public PLib_Base
{
public:
//! Initialize the polynomial class
//! Degree has to be <= 30
//! ConstraintOrder has to be GeomAbs_C0
//! GeomAbs_C1
//! GeomAbs_C2
Standard_EXPORT PLib_HermitJacobi(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder);
//! This method computes the maximum error on the polynomial
//! W(t) Q(t) obtained by missing the coefficients of JacCoeff from
//! NewDegree +1 to Degree
Standard_EXPORT Standard_Real MaxError (const Standard_Integer Dimension, Standard_Real& HermJacCoeff, const Standard_Integer NewDegree) const;
//! Compute NewDegree <= MaxDegree so that MaxError is lower
//! than Tol.
//! MaxError can be greater than Tol if it is not possible
//! to find a NewDegree <= MaxDegree.
//! In this case NewDegree = MaxDegree
Standard_EXPORT void ReduceDegree (const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Standard_Real Tol, Standard_Real& HermJacCoeff, Standard_Integer& NewDegree, Standard_Real& MaxError) const;
Standard_EXPORT Standard_Real AverageError (const Standard_Integer Dimension, Standard_Real& HermJacCoeff, const Standard_Integer NewDegree) const;
//! Convert the polynomial P(t) = H(t) + W(t) Q(t) in the canonical base.
Standard_EXPORT void ToCoefficients (const Standard_Integer Dimension, const Standard_Integer Degree, const TColStd_Array1OfReal& HermJacCoeff, TColStd_Array1OfReal& Coefficients) const;
//! Compute the values of the basis functions in u
Standard_EXPORT void D0 (const Standard_Real U, TColStd_Array1OfReal& BasisValue);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D1 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D2 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D3 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3);
//! returns WorkDegree
Standard_Integer WorkDegree() const;
//! returns NivConstr
Standard_Integer NivConstr() const;
DEFINE_STANDARD_RTTI(PLib_HermitJacobi,PLib_Base)
protected:
private:
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D0123 (const Standard_Integer NDerive, const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3);
math_Matrix myH;
Handle(PLib_JacobiPolynomial) myJacobi;
TColStd_Array1OfReal myWCoeff;
};
#include <PLib_HermitJacobi.lxx>
#endif // _PLib_HermitJacobi_HeaderFile

View File

@@ -1,222 +0,0 @@
-- Created on: 1996-10-08
-- Created by: Jeannine PANTIATICI
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class JacobiPolynomial from PLib
inherits Base from PLib
--- Purpose: This class provides method to work with Jacobi Polynomials
-- relativly to an order of constraint
-- q = myWorkDegree-2*(myNivConstr+1)
-- Jk(t) for k=0,q compose the Jacobi Polynomial base relativly to the weigth W(t)
-- iorder is the integer value for the constraints:
-- iorder = 0 <=> ConstraintOrder = GeomAbs_C0
-- iorder = 1 <=> ConstraintOrder = GeomAbs_C1
-- iorder = 2 <=> ConstraintOrder = GeomAbs_C2
-- P(t) = R(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)
-- the coefficients JacCoeff represents P(t) JacCoeff are stored as follow:
--
-- c0(1) c0(2) .... c0(Dimension)
-- c1(1) c1(2) .... c1(Dimension)
--
--
--
-- cDegree(1) cDegree(2) .... cDegree(Dimension)
--
-- The coefficients
-- c0(1) c0(2) .... c0(Dimension)
-- c2*ordre+1(1) ... c2*ordre+1(dimension)
--
-- represents the part of the polynomial in the
-- canonical base: R(t)
-- R(t) = c0 + c1 t + ...+ c2*iordre+1 t**2*iordre+1
-- The following coefficients represents the part of the
-- polynomial in the Jacobi base ie Q(t)
-- Q(t) = c2*iordre+2 J0(t) + ...+ cDegree JDegree-2*iordre-2
uses
Array2OfReal from TColStd,
Array1OfReal from TColStd,
HArray1OfReal from TColStd,
Shape from GeomAbs
raises
ConstructionError from Standard
is
-- Create returns JacobiPolynomial from PLib;
Create ( WorkDegree : Integer ;
ConstraintOrder : Shape from GeomAbs)
returns JacobiPolynomial from PLib
---Purpose:
-- Initialize the polynomial class
-- Degree has to be <= 30
-- ConstraintOrder has to be GeomAbs_C0
-- GeomAbs_C1
-- GeomAbs_C2
raises ConstructionError from Standard;
-- if Degree or ConstraintOrder is non valid
--
-- Jacobi characteristics
--
Points ( me ; NbGaussPoints : Integer ;
TabPoints : out Array1OfReal from TColStd )
---Purpose:
-- returns the Jacobi Points for Gauss integration ie
-- the positive values of the Legendre roots by increasing values
-- NbGaussPoints is the number of points choosen for the integral
-- computation.
-- TabPoints (0,NbGaussPoints/2)
-- TabPoints (0) is loaded only for the odd values of NbGaussPoints
-- The possible values for NbGaussPoints are : 8, 10,
-- 15, 20, 25, 30, 35, 40, 50, 61
-- NbGaussPoints must be greater than Degree
raises ConstructionError from Standard;
-- Invalid NbGaussPoints
Weights (me ; NbGaussPoints : Integer ;
TabWeights : out Array2OfReal from TColStd )
--- Purpose:
-- returns the Jacobi weigths for Gauss integration only for
-- the positive values of the Legendre roots in the order they
--- are given by the method Points
-- NbGaussPoints is the number of points choosen for the integral
-- computation.
-- TabWeights (0,NbGaussPoints/2,0,Degree)
-- TabWeights (0,.) are only loaded for the odd values of NbGaussPoints
-- The possible values for NbGaussPoints are : 8 , 10 , 15 ,20 ,25 , 30,
-- 35 , 40 , 50 , 61 NbGaussPoints must be greater than Degree
raises ConstructionError from Standard;
-- Invalid NbGaussPoints
MaxValue ( me ; TabMax : out Array1OfReal from TColStd );
---Purpose:
-- this method loads for k=0,q the maximum value of
-- abs ( W(t)*Jk(t) )for t bellonging to [-1,1]
-- This values are loaded is the array TabMax(0,myWorkDegree-2*(myNivConst+1))
-- MaxValue ( me ; TabMaxPointer : in out Real );
--
-- Work in Jacobi base
MaxError ( me ; Dimension : Integer ;
JacCoeff : in out Real;
NewDegree : Integer )
returns Real;
---Purpose:
-- This method computes the maximum error on the polynomial
-- W(t) Q(t) obtained by missing the coefficients of JacCoeff from
-- NewDegree +1 to Degree
ReduceDegree ( me ; Dimension , MaxDegree : Integer ; Tol : Real ;
JacCoeff : in out Real;
NewDegree : out Integer ;
MaxError : out Real);
---Purpose:
-- Compute NewDegree <= MaxDegree so that MaxError is lower
-- than Tol.
-- MaxError can be greater than Tol if it is not possible
-- to find a NewDegree <= MaxDegree.
-- In this case NewDegree = MaxDegree
--
AverageError ( me ; Dimension : Integer ;
JacCoeff : in out Real;
NewDegree : Integer )
-- This method computes the average error on the polynomial W(t)Q(t)
-- obtained by missing the
-- coefficients JacCoeff from NewDegree +1 to Degree
returns Real;
ToCoefficients ( me ; Dimension, Degree : Integer ;
JacCoeff : Array1OfReal from TColStd ;
Coefficients : out Array1OfReal from TColStd );
---Purpose:
-- Convert the polynomial P(t) = R(t) + W(t) Q(t) in the canonical base.
--
D0123 (me : mutable; NDerive : Integer; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd;
BasisD3 : out Array1OfReal from TColStd)
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
is private;
D0 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd);
---Purpose: Compute the values of the basis functions in u
--
D1 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
D2 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
D3 (me : mutable; U : Real;
BasisValue : out Array1OfReal from TColStd;
BasisD1 : out Array1OfReal from TColStd;
BasisD2 : out Array1OfReal from TColStd;
BasisD3 : out Array1OfReal from TColStd);
---Purpose: Compute the values and the derivatives values of
-- the basis functions in u
WorkDegree (me)
---Purpose: returns WorkDegree
---C++: inline
returns Integer;
NivConstr (me)
---Purpose: returns NivConstr
---C++: inline
returns Integer;
fields
myWorkDegree : Integer;
myNivConstr : Integer;
myDegree : Integer;
-- the following arrays are used for an optimization of computation in D0-D3
myTNorm : HArray1OfReal from TColStd;
myCofA : HArray1OfReal from TColStd;
myCofB : HArray1OfReal from TColStd;
myDenom : HArray1OfReal from TColStd;
end;

View File

@@ -12,15 +12,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <PLib_JacobiPolynomial.ixx>
#include <math.hxx>
#include <math_Vector.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <PLib.hxx>
#include <Standard_ConstructionError.hxx>
#include <PLib_JacobiPolynomial.hxx>
#include <PLib_JacobiPolynomial_0.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_Type.hxx>
#include <TColStd_Array2OfReal.hxx>
// The possible values for NbGaussPoints
const Standard_Integer NDEG8=8, NDEG10=10, NDEG15=15, NDEG20=20, NDEG25=25,

View File

@@ -0,0 +1,183 @@
// Created on: 1996-10-08
// Created by: Jeannine PANTIATICI
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _PLib_JacobiPolynomial_HeaderFile
#define _PLib_JacobiPolynomial_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <PLib_Base.hxx>
#include <GeomAbs_Shape.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <Standard_Real.hxx>
class Standard_ConstructionError;
class PLib_JacobiPolynomial;
DEFINE_STANDARD_HANDLE(PLib_JacobiPolynomial, PLib_Base)
//! This class provides method to work with Jacobi Polynomials
//! relativly to an order of constraint
//! q = myWorkDegree-2*(myNivConstr+1)
//! Jk(t) for k=0,q compose the Jacobi Polynomial base relativly to the weigth W(t)
//! iorder is the integer value for the constraints:
//! iorder = 0 <=> ConstraintOrder = GeomAbs_C0
//! iorder = 1 <=> ConstraintOrder = GeomAbs_C1
//! iorder = 2 <=> ConstraintOrder = GeomAbs_C2
//! P(t) = R(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)
//! the coefficients JacCoeff represents P(t) JacCoeff are stored as follow:
//!
//! c0(1) c0(2) .... c0(Dimension)
//! c1(1) c1(2) .... c1(Dimension)
//!
//! cDegree(1) cDegree(2) .... cDegree(Dimension)
//!
//! The coefficients
//! c0(1) c0(2) .... c0(Dimension)
//! c2*ordre+1(1) ... c2*ordre+1(dimension)
//!
//! represents the part of the polynomial in the
//! canonical base: R(t)
//! R(t) = c0 + c1 t + ...+ c2*iordre+1 t**2*iordre+1
//! The following coefficients represents the part of the
//! polynomial in the Jacobi base ie Q(t)
//! Q(t) = c2*iordre+2 J0(t) + ...+ cDegree JDegree-2*iordre-2
class PLib_JacobiPolynomial : public PLib_Base
{
public:
//! Initialize the polynomial class
//! Degree has to be <= 30
//! ConstraintOrder has to be GeomAbs_C0
//! GeomAbs_C1
//! GeomAbs_C2
Standard_EXPORT PLib_JacobiPolynomial(const Standard_Integer WorkDegree, const GeomAbs_Shape ConstraintOrder);
//! returns the Jacobi Points for Gauss integration ie
//! the positive values of the Legendre roots by increasing values
//! NbGaussPoints is the number of points choosen for the integral
//! computation.
//! TabPoints (0,NbGaussPoints/2)
//! TabPoints (0) is loaded only for the odd values of NbGaussPoints
//! The possible values for NbGaussPoints are : 8, 10,
//! 15, 20, 25, 30, 35, 40, 50, 61
//! NbGaussPoints must be greater than Degree
Standard_EXPORT void Points (const Standard_Integer NbGaussPoints, TColStd_Array1OfReal& TabPoints) const;
//! returns the Jacobi weigths for Gauss integration only for
//! the positive values of the Legendre roots in the order they
//! are given by the method Points
//! NbGaussPoints is the number of points choosen for the integral
//! computation.
//! TabWeights (0,NbGaussPoints/2,0,Degree)
//! TabWeights (0,.) are only loaded for the odd values of NbGaussPoints
//! The possible values for NbGaussPoints are : 8 , 10 , 15 ,20 ,25 , 30,
//! 35 , 40 , 50 , 61 NbGaussPoints must be greater than Degree
Standard_EXPORT void Weights (const Standard_Integer NbGaussPoints, TColStd_Array2OfReal& TabWeights) const;
//! this method loads for k=0,q the maximum value of
//! abs ( W(t)*Jk(t) )for t bellonging to [-1,1]
//! This values are loaded is the array TabMax(0,myWorkDegree-2*(myNivConst+1))
//! MaxValue ( me ; TabMaxPointer : in out Real );
Standard_EXPORT void MaxValue (TColStd_Array1OfReal& TabMax) const;
//! This method computes the maximum error on the polynomial
//! W(t) Q(t) obtained by missing the coefficients of JacCoeff from
//! NewDegree +1 to Degree
Standard_EXPORT Standard_Real MaxError (const Standard_Integer Dimension, Standard_Real& JacCoeff, const Standard_Integer NewDegree) const;
//! Compute NewDegree <= MaxDegree so that MaxError is lower
//! than Tol.
//! MaxError can be greater than Tol if it is not possible
//! to find a NewDegree <= MaxDegree.
//! In this case NewDegree = MaxDegree
Standard_EXPORT void ReduceDegree (const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Standard_Real Tol, Standard_Real& JacCoeff, Standard_Integer& NewDegree, Standard_Real& MaxError) const;
Standard_EXPORT Standard_Real AverageError (const Standard_Integer Dimension, Standard_Real& JacCoeff, const Standard_Integer NewDegree) const;
//! Convert the polynomial P(t) = R(t) + W(t) Q(t) in the canonical base.
Standard_EXPORT void ToCoefficients (const Standard_Integer Dimension, const Standard_Integer Degree, const TColStd_Array1OfReal& JacCoeff, TColStd_Array1OfReal& Coefficients) const;
//! Compute the values of the basis functions in u
Standard_EXPORT void D0 (const Standard_Real U, TColStd_Array1OfReal& BasisValue);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D1 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D2 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2);
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D3 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3);
//! returns WorkDegree
Standard_Integer WorkDegree() const;
//! returns NivConstr
Standard_Integer NivConstr() const;
DEFINE_STANDARD_RTTI(PLib_JacobiPolynomial,PLib_Base)
protected:
private:
//! Compute the values and the derivatives values of
//! the basis functions in u
Standard_EXPORT void D0123 (const Standard_Integer NDerive, const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3);
Standard_Integer myWorkDegree;
Standard_Integer myNivConstr;
Standard_Integer myDegree;
Handle(TColStd_HArray1OfReal) myTNorm;
Handle(TColStd_HArray1OfReal) myCofA;
Handle(TColStd_HArray1OfReal) myCofB;
Handle(TColStd_HArray1OfReal) myDenom;
};
#include <PLib_JacobiPolynomial.lxx>
#endif // _PLib_JacobiPolynomial_HeaderFile