0025616: Avoid Classes using "new" to allocate Instances but not defining a copy...
[occt.git] / src / PLib / PLib_HermitJacobi.cdl
CommitLineData
b311480e 1-- Created on: 1997-10-22
2-- Created by: Philippe MANGIN
3-- Copyright (c) 1997-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 8-- This library is free software; you can redistribute it and/or modify it under
9-- the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10-- by the Free Software Foundation, with special exception defined in the file
11-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
7fd59977 16
17class HermitJacobi from PLib
18
19inherits Base from PLib
20
21--- Purpose: This class provides method to work with Jacobi Polynomials
22-- relativly to an order of constraint
23-- q = myWorkDegree-2*(myNivConstr+1)
24-- Jk(t) for k=0,q compose the Jacobi Polynomial base relativly to the weigth W(t)
25-- iorder is the integer value for the constraints:
26-- iorder = 0 <=> ConstraintOrder = GeomAbs_C0
27-- iorder = 1 <=> ConstraintOrder = GeomAbs_C1
28-- iorder = 2 <=> ConstraintOrder = GeomAbs_C2
29-- P(t) = H(t) + W(t) * Q(t) Where W(t) = (1-t**2)**(2*iordre+2)
30-- the coefficients JacCoeff represents P(t) JacCoeff are stored as follow:
31--
32-- c0(1) c0(2) .... c0(Dimension)
33-- c1(1) c1(2) .... c1(Dimension)
34--
35--
36--
37-- cDegree(1) cDegree(2) .... cDegree(Dimension)
38--
39-- The coefficients
40-- c0(1) c0(2) .... c0(Dimension)
41-- c2*ordre+1(1) ... c2*ordre+1(dimension)
42--
43-- represents the part of the polynomial in the
44-- Hermit's base: H(t)
45-- H(t) = c0H00(t) + c1H01(t) + ...c(iordre)H(0 ;iorder)+ c(iordre+1)H10(t)+...
46-- The following coefficients represents the part of the
47-- polynomial in the Jacobi base ie Q(t)
48-- Q(t) = c2*iordre+2 J0(t) + ...+ cDegree JDegree-2*iordre-2
49
50uses
51 Array2OfReal from TColStd,
52 Array1OfReal from TColStd,
53 Shape from GeomAbs,
54 Matrix from math,
55 JacobiPolynomial from PLib
56
57raises
58 ConstructionError from Standard
59
60is
61
62 Create ( WorkDegree : Integer ;
63 ConstraintOrder : Shape from GeomAbs)
64 returns HermitJacobi from PLib
65
66
67---Purpose:
68-- Initialize the polynomial class
69-- Degree has to be <= 30
70-- ConstraintOrder has to be GeomAbs_C0
71-- GeomAbs_C1
72-- GeomAbs_C2
73
74 raises ConstructionError from Standard;
75-- if Degree or ConstraintOrder is non valid
76
77
78--
79-- Work in HermitJacobi base
80
81 MaxError ( me ; Dimension : Integer ;
82 HermJacCoeff : in out Real;
83 NewDegree : Integer )
84 returns Real;
85
86---Purpose:
87-- This method computes the maximum error on the polynomial
88-- W(t) Q(t) obtained by missing the coefficients of JacCoeff from
89-- NewDegree +1 to Degree
90
91 ReduceDegree ( me ; Dimension , MaxDegree : Integer ; Tol : Real ;
92 HermJacCoeff : in out Real;
93 NewDegree : out Integer ;
94 MaxError : out Real);
95
96---Purpose:
97-- Compute NewDegree <= MaxDegree so that MaxError is lower
98-- than Tol.
99-- MaxError can be greater than Tol if it is not possible
100-- to find a NewDegree <= MaxDegree.
101-- In this case NewDegree = MaxDegree
102--
103 AverageError ( me ; Dimension : Integer ;
104 HermJacCoeff : in out Real;
105 NewDegree : Integer )
106-- This method computes the average error on the polynomial W(t)Q(t)
107-- obtained by missing the
108-- coefficients JacCoeff from NewDegree +1 to Degree
109 returns Real;
110
111
112 ToCoefficients ( me ; Dimension, Degree : Integer ;
113 HermJacCoeff : Array1OfReal from TColStd ;
114 Coefficients : out Array1OfReal from TColStd );
115
116---Purpose:
117-- Convert the polynomial P(t) = H(t) + W(t) Q(t) in the canonical base.
118--
119
120 D0123 (me : mutable; NDerive : Integer; U : Real;
121 BasisValue : out Array1OfReal from TColStd;
122 BasisD1 : out Array1OfReal from TColStd;
123 BasisD2 : out Array1OfReal from TColStd;
124 BasisD3 : out Array1OfReal from TColStd)
125---Purpose: Compute the values and the derivatives values of
126-- the basis functions in u
127 is private;
128
129 D0 (me : mutable; U : Real;
130 BasisValue : out Array1OfReal from TColStd);
131---Purpose: Compute the values of the basis functions in u
132--
133
134 D1 (me : mutable; U : Real;
135 BasisValue : out Array1OfReal from TColStd;
136 BasisD1 : out Array1OfReal from TColStd);
137---Purpose: Compute the values and the derivatives values of
138-- the basis functions in u
139
140 D2 (me : mutable; U : Real;
141 BasisValue : out Array1OfReal from TColStd;
142 BasisD1 : out Array1OfReal from TColStd;
143 BasisD2 : out Array1OfReal from TColStd);
144---Purpose: Compute the values and the derivatives values of
145-- the basis functions in u
146
147 D3 (me : mutable; U : Real;
148 BasisValue : out Array1OfReal from TColStd;
149 BasisD1 : out Array1OfReal from TColStd;
150 BasisD2 : out Array1OfReal from TColStd;
151 BasisD3 : out Array1OfReal from TColStd);
152---Purpose: Compute the values and the derivatives values of
153-- the basis functions in u
154
155 WorkDegree (me)
156 --- Purpose: returns WorkDegree
157 ---C++: inline
158 returns Integer;
159
160 NivConstr (me)
161 ---Purpose: returns NivConstr
162 ---C++: inline
163 returns Integer;
164
165fields
166 myH : Matrix from math;
167 myJacobi : JacobiPolynomial from PLib;
168 myWCoeff : Array1OfReal; -- The cannonical Coefficients of W(t).
169
170end HermitJacobi;