C2.Intervals(anIntervals2, aContinuity);
// Lipchitz constant computation.
+ const Standard_Real aMaxLC = 10000.;
Standard_Real aLC = 9.0; // Default value.
const Standard_Real aMaxDer1 = 1.0 / C1.Resolution(1.0);
const Standard_Real aMaxDer2 = 1.0 / C2.Resolution(1.0);
{
isConstLockedFlag = Standard_True;
}
+ if (aMaxDer > aMaxLC)
+ {
+ aLC = aMaxLC;
+ isConstLockedFlag = Standard_True;
+ }
if (C1.GetType() == GeomAbs_Line)
{
aMaxDer = 1.0 / C2.Resolution(1.0);
//=======================================================================
void math_GlobOptMin::computeInitialValues()
{
+ const Standard_Real aMinLC = 0.01;
+ const Standard_Real aMaxLC = 1000.;
+ const Standard_Real aMinEps = 0.1;
+ const Standard_Real aMaxEps = 100.;
Standard_Integer i;
math_Vector aCurrPnt(1, myN);
math_Vector aBestPnt(1, myN);
myC = myInitC;
aLipConst *= Sqrt(myN) / aStep;
- if (aLipConst < myC * 0.1)
- myC = Max(aLipConst * 0.1, 0.01);
- else if (aLipConst > myC * 5)
- myC = Min(myC * 5, 50.0);
+ if (aLipConst < myC * aMinEps)
+ myC = Max(aLipConst * aMinEps, aMinLC);
+ else if (aLipConst > myC * aMaxEps)
+ myC = Min(myC * aMaxEps, aMaxLC);
// Clear all solutions except one.
if (myY.Size() != myN)
--- /dev/null
+puts "========"
+puts "OCC28856"
+puts "========"
+puts ""
+########################################
+# Extrema between two curves gives wrong result
+########################################
+
+# Restore the initial shape
+restore [locate_data_file bug28856_shapes.brep] e
+explode e
+distmini dd e_1 e_2
+checkprops dd -l 0.101881