Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:14:31

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