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
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class SimpleApprox from AdvApprox
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
26 uses HArray1OfReal from TColStd,
27 HArray2OfReal from TColStd,
28 Array1OfReal from TColStd,
29 Array1OfInteger from TColStd,
32 EvaluatorFunction from AdvApprox,
33 JacobiPolynomial from PLib
37 OutOfRange from Standard,
38 ConstructionError from Standard
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)
49 returns SimpleApprox from AdvApprox
50 raises ConstructionError;
53 LocalDimension : Array1OfInteger from TColStd;
54 LocalTolerancesArray: Array1OfReal from TColStd ;
58 raises ConstructionError;
59 ---Purpose: Constructs approximator tool.
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;
74 ---Purpose: returns the coefficients in the Jacobi Base
75 returns HArray1OfReal from TColStd;
78 ---Purpose: returns the constraints at First
79 returns HArray2OfReal from TColStd;
82 ---Purpose: returns the constraints at Last
83 returns HArray2OfReal from TColStd;
86 returns HArray1OfReal from TColStd;
89 returns HArray1OfReal from TColStd;
91 MaxError (me; Index : Integer)
94 AverageError (me; Index : Integer)
97 Dump(me; o: in out OStream);
98 ---Purpose: display information on approximation
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;
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;