+ try to make the SQP solver in the Sketcher more robust

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5148 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
logari81 2011-11-17 19:58:45 +00:00
parent ee8242d22d
commit aaea1b933c

View File

@ -984,11 +984,15 @@ int System::solve(SubSystem *subsysA, SubSystem *subsysB, bool isFine)
break;
}
alpha = tau * alpha;
if (alpha < 1e-8) // let the linesearch fail
alpha = 0.;
x = x0 + alpha * xdir;
subsysA->setParams(plist,x);
subsysB->setParams(plist,x);
subsysA->calcResidual(resA);
f = subsysB->error() + mu * resA.lpNorm<1>();
if (alpha < 1e-8) // let the linesearch fail
break;
}
lambda = lambda0 + alpha * lambdadir;