80c8fe945c5173258bdb787c67f6396716910459
[occt.git] / src / AdvApprox / AdvApprox_SimpleApprox.cdl
1 -- Created on: 1996-10-14
2 -- Created by: Jeannine PANTIATICI
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public version 2.1 as published
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class SimpleApprox from AdvApprox
18
19 ---Purpose: Approximate  a function on   an intervall [First,Last] 
20 --          The result  is  a simple  polynomial  whose  degree is  as low as
21 --          possible  to   satisfy  the required  tolerance  and  the
22 --          maximum degree.  The maximum  error and the averrage error
23 --          resulting from  approximating the function by the polynomial are computed
24           
25
26 uses HArray1OfReal     from TColStd, 
27      HArray2OfReal     from TColStd, 
28      Array1OfReal      from TColStd, 
29      Array1OfInteger   from TColStd,
30      Shape             from GeomAbs,
31      Vector            from math,
32      EvaluatorFunction from AdvApprox,
33      JacobiPolynomial  from PLib     
34
35 raises 
36
37     OutOfRange        from Standard,
38     ConstructionError from Standard
39
40 is   
41     Create(TotalDimension  : Integer ;
42            TotalNumSS      : Integer ;
43            Continuity    : Shape from GeomAbs ; 
44            WorkDegree    : Integer ;
45            NbGaussPoints : Integer ;
46            JacobiBase    : JacobiPolynomial from PLib;
47            Func          : EvaluatorFunction from AdvApprox) 
48            
49     returns SimpleApprox from AdvApprox 
50     raises ConstructionError;     
51
52     Perform(me:in  out  ;
53            LocalDimension  : Array1OfInteger  from TColStd;         
54            LocalTolerancesArray: Array1OfReal from TColStd ;
55            First         : Real ;
56            Last          : Real ;
57            MaxDegree     : Integer) 
58     raises ConstructionError; 
59     ---Purpose: Constructs approximator tool.
60     --
61     --  Warning:
62     --     the Func should be valid reference to object of type 
63     --     inherited from class EvaluatorFunction from Approx 
64     --     with life time longer than that of the approximator tool;
65     --     
66
67     IsDone(me) 
68     returns  Boolean; 
69     
70     Degree (me)
71     returns Integer;
72     
73     Coefficients (me)
74     ---Purpose: returns the coefficients in the Jacobi Base
75     returns HArray1OfReal from TColStd;
76
77     FirstConstr (me)
78     ---Purpose: returns the constraints at First
79     returns HArray2OfReal from TColStd;
80
81     LastConstr (me)
82     ---Purpose: returns the constraints at Last
83     returns HArray2OfReal from TColStd;
84
85     SomTab (me)
86     returns HArray1OfReal from TColStd;
87
88     DifTab (me)
89     returns HArray1OfReal from TColStd;
90
91     MaxError    (me; Index : Integer)
92     returns Real;
93     
94     AverageError (me;   Index : Integer) 
95     returns Real;   
96
97     Dump(me; o: in out OStream); 
98     ---Purpose: display information on approximation
99
100 fields 
101      
102     myTotalNumSS     : Integer; 
103     myTotalDimension : Integer; 
104     myNbGaussPoints  : Integer;  
105     myWorkDegree     : Integer;     
106     myNivConstr      : Integer  ;
107     myJacPol         : JacobiPolynomial from PLib; 
108     myTabPoints      : HArray1OfReal from TColStd; 
109     myTabWeights     : HArray2OfReal from TColStd;
110     myEvaluator      : Address from Standard;
111     myDegree         : Integer;
112     myCoeff          : HArray1OfReal from TColStd; 
113     myFirstConstr    : HArray2OfReal from TColStd; 
114     myLastConstr     : HArray2OfReal from TColStd; 
115     mySomTab         : HArray1OfReal from TColStd; 
116     myDifTab         : HArray1OfReal from TColStd; 
117     myMaxError       : HArray1OfReal from TColStd;
118     myAverageError   : HArray1OfReal from TColStd;  
119     done             : Boolean;
120
121 end SimpleApprox;
122
123