mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027299: Incorrect result of the normal projection algorithm
Curve splitting is added to handle seam passing by initial curve. test cases are added. Minor corrections.
This commit is contained in:
@@ -48,7 +48,8 @@ math_GlobOptMin::math_GlobOptMin(math_MultipleVarFunction* theFunc,
|
||||
myMaxV(1, myN),
|
||||
myExpandCoeff(1, myN),
|
||||
myCellSize(0, myN - 1),
|
||||
myFilter(theFunc->NbVariables())
|
||||
myFilter(theFunc->NbVariables()),
|
||||
myCont(2)
|
||||
{
|
||||
Standard_Integer i;
|
||||
|
||||
@@ -278,7 +279,8 @@ Standard_Boolean math_GlobOptMin::computeLocalExtremum(const math_Vector& thePnt
|
||||
Standard_Integer i;
|
||||
|
||||
//Newton method
|
||||
if (dynamic_cast<math_MultipleVarFunctionWithHessian*>(myFunc))
|
||||
if (myCont >= 2 &&
|
||||
dynamic_cast<math_MultipleVarFunctionWithHessian*>(myFunc))
|
||||
{
|
||||
math_MultipleVarFunctionWithHessian* aTmp =
|
||||
dynamic_cast<math_MultipleVarFunctionWithHessian*> (myFunc);
|
||||
@@ -295,7 +297,8 @@ Standard_Boolean math_GlobOptMin::computeLocalExtremum(const math_Vector& thePnt
|
||||
} else
|
||||
|
||||
// BFGS method used.
|
||||
if (dynamic_cast<math_MultipleVarFunctionWithGradient*>(myFunc))
|
||||
if (myCont >= 1 &&
|
||||
dynamic_cast<math_MultipleVarFunctionWithGradient*>(myFunc))
|
||||
{
|
||||
math_MultipleVarFunctionWithGradient* aTmp =
|
||||
dynamic_cast<math_MultipleVarFunctionWithGradient*> (myFunc);
|
||||
|
@@ -152,6 +152,12 @@ public:
|
||||
//! Get functional minimal value.
|
||||
Standard_EXPORT Standard_Real GetFunctionalMinimalValue();
|
||||
|
||||
//! Get continuity of local borders splits.
|
||||
inline Standard_Integer GetContinuity() const {return myCont; }
|
||||
|
||||
//! Set continuity of local borders splits.
|
||||
inline void SetContinuity(const Standard_Integer theCont) { myCont = theCont; }
|
||||
|
||||
private:
|
||||
|
||||
// Compute cell size.
|
||||
@@ -223,6 +229,9 @@ private:
|
||||
Standard_Boolean isFirstCellFilterInvoke;
|
||||
NCollection_CellFilter<NCollection_CellFilter_Inspector> myFilter;
|
||||
|
||||
// Continuity of local borders.
|
||||
Standard_Integer myCont;
|
||||
|
||||
Standard_Real myF; // Current value of Global optimum.
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user