Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:29

0001 // Created on: 2014-06-23
0002 // Created by: Alexander Malyshev
0003 // Copyright (c) 2014-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement
0015 
0016 #ifndef _Extrema_GlobOptFuncCS_HeaderFile
0017 #define _Extrema_GlobOptFuncCS_HeaderFile
0018 
0019 
0020 #include <Adaptor3d_Surface.hxx>
0021 #include <math_Matrix.hxx>
0022 #include <math_Vector.hxx>
0023 #include <math_MultipleVarFunctionWithHessian.hxx>
0024 
0025 //! This class implements function which calculate square Eucluidean distance
0026 //! between point on curve and point on surface in case of continuity is C2.
0027 class Extrema_GlobOptFuncCS : public math_MultipleVarFunctionWithHessian
0028 {
0029 public:
0030 
0031   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncCS.
0032   Standard_EXPORT  Extrema_GlobOptFuncCS(const Adaptor3d_Curve   *C,
0033                                          const Adaptor3d_Surface *S);
0034 
0035   Standard_EXPORT virtual Standard_Integer NbVariables() const;
0036 
0037   Standard_EXPORT virtual Standard_Boolean Value(const math_Vector &theX,
0038                                                  Standard_Real     &theF);
0039 
0040   Standard_EXPORT virtual Standard_Boolean Gradient(const math_Vector &theX,
0041                                                     math_Vector       &theG);
0042 
0043   Standard_EXPORT virtual Standard_Boolean Values(const math_Vector &theX,
0044                                                   Standard_Real     &theF,
0045                                                   math_Vector       &theG);
0046 
0047   Standard_EXPORT virtual Standard_Boolean Values(const math_Vector &theX,
0048                                                   Standard_Real     &theF,
0049                                                   math_Vector       &theG,
0050                                                   math_Matrix       &theH);
0051 
0052 private:
0053 
0054   Standard_Boolean checkInputData(const math_Vector   &X,
0055                                   Standard_Real       &cu,
0056                                   Standard_Real       &su,
0057                                   Standard_Real       &sv);
0058 
0059   void value(Standard_Real cu,
0060              Standard_Real su,
0061              Standard_Real sv,
0062              Standard_Real &F);
0063 
0064   void gradient(Standard_Real cu,
0065                 Standard_Real su,
0066                 Standard_Real sv,
0067                 math_Vector   &G);
0068 
0069   void hessian(Standard_Real cu,
0070                Standard_Real su,
0071                Standard_Real sv,
0072                math_Matrix   &H);
0073 
0074   Extrema_GlobOptFuncCS & operator = (const Extrema_GlobOptFuncCS & theOther);
0075 
0076   const Adaptor3d_Curve   *myC;
0077   const Adaptor3d_Surface *myS;
0078 };
0079 
0080 #endif