mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024608: Development of methods of global optimization of multivariable function
math_GlobOptMin - new global optimization minimization algorithm Extrema_GlobOptFuncCC, Extrema_ExtCC, Extrema_ExtCC2d - implementation of GlobOptMin algorithm to extrema curve / curve Extrema_CurveCache - deleted as obsolete code ChFi3d_Builder.cxx - fixed processing of extrema math_NewtonMinimum.cxx - fixed step to avoid incorrect behavior Test cases modification to meet new behavior.
This commit is contained in:
101
src/math/math_GlobOptMin.hxx
Normal file
101
src/math/math_GlobOptMin.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 2014-01-20
|
||||
// Created by: Alexaner Malyshev
|
||||
// Copyright (c) 2014-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _math_GlobOptMin_HeaderFile
|
||||
#define _math_GlobOptMin_HeaderFile
|
||||
|
||||
#include <math_MultipleVarFunction.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//! This class represents Evtushenko's algorithm of global optimization based on nonuniform mesh.<br>
|
||||
//! Article: Yu. Evtushenko. Numerical methods for finding global extreme (case of a non-uniform mesh). <br>
|
||||
//! U.S.S.R. Comput. Maths. Math. Phys., Vol. 11, N 6, pp. 38-54.
|
||||
|
||||
class math_GlobOptMin
|
||||
{
|
||||
public:
|
||||
|
||||
Standard_EXPORT math_GlobOptMin(math_MultipleVarFunction* theFunc,
|
||||
const math_Vector& theA,
|
||||
const math_Vector& theB,
|
||||
Standard_Real theC = 9);
|
||||
|
||||
Standard_EXPORT void SetGlobalParams(math_MultipleVarFunction* theFunc,
|
||||
const math_Vector& theA,
|
||||
const math_Vector& theB,
|
||||
Standard_Real theC = 9);
|
||||
|
||||
Standard_EXPORT void SetLocalParams(const math_Vector& theLocalA,
|
||||
const math_Vector& theLocalB);
|
||||
|
||||
Standard_EXPORT ~math_GlobOptMin();
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
//! Get best functional value.
|
||||
Standard_EXPORT Standard_Real GetF();
|
||||
|
||||
//! Return count of global extremas. NbExtrema <= MAX_SOLUTIONS.
|
||||
Standard_EXPORT Standard_Integer NbExtrema();
|
||||
|
||||
//! Return solution i, 1 <= i <= NbExtrema.
|
||||
Standard_EXPORT void Points(const Standard_Integer theIndex, math_Vector& theSol);
|
||||
|
||||
private:
|
||||
|
||||
math_GlobOptMin & operator = (const math_GlobOptMin & theOther);
|
||||
|
||||
Standard_Boolean computeLocalExtremum(const math_Vector& thePnt, Standard_Real& theVal, math_Vector& theOutPnt);
|
||||
|
||||
void computeGlobalExtremum(Standard_Integer theIndex);
|
||||
|
||||
//! Check that myA <= pnt <= myB
|
||||
Standard_Boolean isInside(const math_Vector& thePnt);
|
||||
|
||||
Standard_Boolean isStored(const math_Vector &thePnt);
|
||||
|
||||
Standard_Boolean isDone();
|
||||
|
||||
// Input.
|
||||
math_MultipleVarFunction* myFunc;
|
||||
Standard_Integer myN;
|
||||
math_Vector myA; // Left border on current C2 interval.
|
||||
math_Vector myB; // Right border on current C2 interval.
|
||||
math_Vector myGlobA; // Global left border.
|
||||
math_Vector myGlobB; // Global right border.
|
||||
|
||||
// Output.
|
||||
Standard_Boolean myDone;
|
||||
NCollection_Sequence<Standard_Real> myY;// Current solutions.
|
||||
Standard_Integer mySolCount; // Count of solutions.
|
||||
|
||||
// Algorithm data.
|
||||
Standard_Real myZ;
|
||||
Standard_Real myC; //Lipschitz constant
|
||||
Standard_Real myE1; // Border coeff.
|
||||
Standard_Real myE2; // Minimum step size.
|
||||
Standard_Real myE3; // Local extrema starting parameter.
|
||||
|
||||
math_Vector myX; // Current modified solution
|
||||
math_Vector myTmp; // Current modified solution
|
||||
math_Vector myV; // Steps array.
|
||||
|
||||
Standard_Real myF; // Current value of Global optimum.
|
||||
};
|
||||
|
||||
const Handle(Standard_Type)& TYPE(math_GlobOptMin);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user