Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:17:26

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 #include <Adaptor3d_Surface.hxx>
0020 #include <math_Matrix.hxx>
0021 #include <math_Vector.hxx>
0022 #include <math_MultipleVarFunctionWithHessian.hxx>
0023 
0024 //! This class implements function which calculate square Eucluidean distance
0025 //! between point on curve and point on surface in case of continuity is C2.
0026 class Extrema_GlobOptFuncCS : public math_MultipleVarFunctionWithHessian
0027 {
0028 public:
0029   //! Curve and surface should exist during all the lifetime of Extrema_GlobOptFuncCS.
0030   Standard_EXPORT Extrema_GlobOptFuncCS(const Adaptor3d_Curve* C, const Adaptor3d_Surface* S);
0031 
0032   Standard_EXPORT int NbVariables() const override;
0033 
0034   Standard_EXPORT bool Value(const math_Vector& theX, double& theF) override;
0035 
0036   Standard_EXPORT bool Gradient(const math_Vector& theX, math_Vector& theG) override;
0037 
0038   Standard_EXPORT bool Values(const math_Vector& theX, double& theF, math_Vector& theG) override;
0039 
0040   Standard_EXPORT bool Values(const math_Vector& theX,
0041                               double&            theF,
0042                               math_Vector&       theG,
0043                               math_Matrix&       theH) override;
0044 
0045 private:
0046   bool checkInputData(const math_Vector& X, double& cu, double& su, double& sv);
0047 
0048   void value(double cu, double su, double sv, double& F);
0049 
0050   void gradient(double cu, double su, double sv, math_Vector& G);
0051 
0052   void hessian(double cu, double su, double sv, math_Matrix& H);
0053 
0054   Extrema_GlobOptFuncCS& operator=(const Extrema_GlobOptFuncCS& theOther) = delete;
0055 
0056   const Adaptor3d_Curve*   myC;
0057   const Adaptor3d_Surface* myS;
0058 };
0059 
0060 #endif