Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:53

0001 // Created on: 1996-10-14
0002 // Created by: Jeannine PANTIATICI
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AdvApprox_SimpleApprox_HeaderFile
0018 #define _AdvApprox_SimpleApprox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TColStd_HArray1OfReal.hxx>
0026 #include <TColStd_HArray2OfReal.hxx>
0027 #include <GeomAbs_Shape.hxx>
0028 #include <AdvApprox_EvaluatorFunction.hxx>
0029 #include <TColStd_Array1OfInteger.hxx>
0030 #include <TColStd_Array1OfReal.hxx>
0031 #include <Standard_OStream.hxx>
0032 class PLib_JacobiPolynomial;
0033 
0034 
0035 //! Approximate  a function on   an intervall [First,Last]
0036 //! The result  is  a simple  polynomial  whose  degree is  as low as
0037 //! possible  to   satisfy  the required  tolerance  and  the
0038 //! maximum degree.  The maximum  error and the averrage error
0039 //! resulting from  approximating the function by the polynomial are computed
0040 class AdvApprox_SimpleApprox 
0041 {
0042 public:
0043 
0044   DEFINE_STANDARD_ALLOC
0045 
0046   
0047   Standard_EXPORT AdvApprox_SimpleApprox(const Standard_Integer TotalDimension, const Standard_Integer TotalNumSS, const GeomAbs_Shape Continuity, const Standard_Integer WorkDegree, const Standard_Integer NbGaussPoints, const Handle(PLib_JacobiPolynomial)& JacobiBase, const AdvApprox_EvaluatorFunction& Func);
0048   
0049   //! Constructs approximator tool.
0050   //!
0051   //! Warning:
0052   //! the Func should be valid reference to object of type
0053   //! inherited from class EvaluatorFunction from Approx
0054   //! with life time longer than that of the approximator tool;
0055   Standard_EXPORT void Perform (const TColStd_Array1OfInteger& LocalDimension, const TColStd_Array1OfReal& LocalTolerancesArray, const Standard_Real First, const Standard_Real Last, const Standard_Integer MaxDegree);
0056   
0057   Standard_EXPORT Standard_Boolean IsDone() const;
0058   
0059   Standard_EXPORT Standard_Integer Degree() const;
0060   
0061   //! returns the coefficients in the Jacobi Base
0062   Standard_EXPORT Handle(TColStd_HArray1OfReal) Coefficients() const;
0063   
0064   //! returns the constraints at First
0065   Standard_EXPORT Handle(TColStd_HArray2OfReal) FirstConstr() const;
0066   
0067   //! returns the constraints at Last
0068   Standard_EXPORT Handle(TColStd_HArray2OfReal) LastConstr() const;
0069   
0070   Standard_EXPORT Handle(TColStd_HArray1OfReal) SomTab() const;
0071   
0072   Standard_EXPORT Handle(TColStd_HArray1OfReal) DifTab() const;
0073   
0074   Standard_EXPORT Standard_Real MaxError (const Standard_Integer Index) const;
0075   
0076   Standard_EXPORT Standard_Real AverageError (const Standard_Integer Index) const;
0077   
0078   //! display information on approximation
0079   Standard_EXPORT void Dump (Standard_OStream& o) const;
0080 
0081 
0082 
0083 
0084 protected:
0085 
0086 
0087 
0088 
0089 
0090 private:
0091 
0092 
0093 
0094   Standard_Integer myTotalNumSS;
0095   Standard_Integer myTotalDimension;
0096   Standard_Integer myNbGaussPoints;
0097   Standard_Integer myWorkDegree;
0098   Standard_Integer myNivConstr;
0099   Handle(PLib_JacobiPolynomial) myJacPol;
0100   Handle(TColStd_HArray1OfReal) myTabPoints;
0101   Handle(TColStd_HArray2OfReal) myTabWeights;
0102   Standard_Address myEvaluator;
0103   Standard_Integer myDegree;
0104   Handle(TColStd_HArray1OfReal) myCoeff;
0105   Handle(TColStd_HArray2OfReal) myFirstConstr;
0106   Handle(TColStd_HArray2OfReal) myLastConstr;
0107   Handle(TColStd_HArray1OfReal) mySomTab;
0108   Handle(TColStd_HArray1OfReal) myDifTab;
0109   Handle(TColStd_HArray1OfReal) myMaxError;
0110   Handle(TColStd_HArray1OfReal) myAverageError;
0111   Standard_Boolean done;
0112 
0113 
0114 };
0115 
0116 
0117 
0118 
0119 
0120 
0121 
0122 #endif // _AdvApprox_SimpleApprox_HeaderFile