Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-12-02
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1991-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 _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
0018 #define _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 #include <math_Matrix.hxx>
0026 #include <math_Vector.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <TColStd_Array1OfInteger.hxx>
0029 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
0030 class Standard_OutOfRange;
0031 class AppDef_MultiLine;
0032 class AppDef_MyLineTool;
0033 class AppParCurves_MultiCurve;
0034 class math_Matrix;
0035 
0036 
0037 
0038 class AppDef_ResConstraintOfMyGradientOfCompute 
0039 {
0040 public:
0041 
0042   DEFINE_STANDARD_ALLOC
0043 
0044   
0045   //! Given a MultiLine SSP with constraints points, this
0046   //! algorithm finds the best curve solution to approximate it.
0047   //! The poles from SCurv issued for example from the least
0048   //! squares are used as a guess solution for the uzawa
0049   //! algorithm. The tolerance used in the Uzawa algorithms
0050   //! is Tolerance.
0051   //! A is the Bernstein matrix associated to the MultiLine
0052   //! and DA is the derivative bernstein matrix.(They can come
0053   //! from an approximation with ParLeastSquare.)
0054   //! The MultiCurve is modified. New MultiPoles are given.
0055   Standard_EXPORT AppDef_ResConstraintOfMyGradientOfCompute(const AppDef_MultiLine& SSP, AppParCurves_MultiCurve& SCurv, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& Constraints, const math_Matrix& Bern, const math_Matrix& DerivativeBern, const Standard_Real Tolerance = 1.0e-10);
0056   
0057   //! returns True if all has been correctly done.
0058   Standard_EXPORT Standard_Boolean IsDone() const;
0059   
0060   //! returns the maximum difference value between the curve
0061   //! and the given points.
0062   Standard_EXPORT Standard_Real Error() const;
0063   
0064   Standard_EXPORT const math_Matrix& ConstraintMatrix() const;
0065   
0066   //! returns the duale variables of the system.
0067   Standard_EXPORT const math_Vector& Duale() const;
0068   
0069   //! Returns the derivative of the constraint matrix.
0070   Standard_EXPORT const math_Matrix& ConstraintDerivative (const AppDef_MultiLine& SSP, const math_Vector& Parameters, const Standard_Integer Deg, const math_Matrix& DA);
0071   
0072   //! returns the Inverse of Cont*Transposed(Cont), where
0073   //! Cont is the constraint matrix for the algorithm.
0074   Standard_EXPORT const math_Matrix& InverseMatrix() const;
0075 
0076 
0077 
0078 
0079 protected:
0080 
0081   
0082   //! is used internally to create the fields.
0083   Standard_EXPORT Standard_Integer NbConstraints (const AppDef_MultiLine& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints) const;
0084   
0085   //! is internally used for the fields creation.
0086   Standard_EXPORT Standard_Integer NbColumns (const AppDef_MultiLine& SSP, const Standard_Integer Deg) const;
0087 
0088 
0089 
0090 
0091 private:
0092 
0093 
0094 
0095   Standard_Boolean Done;
0096   Standard_Real Err;
0097   math_Matrix Cont;
0098   math_Matrix DeCont;
0099   math_Vector Secont;
0100   math_Matrix CTCinv;
0101   math_Vector Vardua;
0102   Standard_Integer IncPass;
0103   Standard_Integer IncTan;
0104   Standard_Integer IncCurv;
0105   TColStd_Array1OfInteger IPas;
0106   TColStd_Array1OfInteger ITan;
0107   TColStd_Array1OfInteger ICurv;
0108 
0109 
0110 };
0111 
0112 
0113 
0114 
0115 
0116 
0117 
0118 #endif // _AppDef_ResConstraintOfMyGradientOfCompute_HeaderFile