mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-27 19:06:16 +01:00
fix hanging
This commit is contained in:
parent
c5d053635a
commit
d55f941450
1 changed files with 8 additions and 3 deletions
|
|
@ -27,17 +27,22 @@ public class GlobalSolver {
|
|||
|
||||
double eps = 0.0001;
|
||||
java.lang.System.out.println("Solve system with error: " + subSystem.errorSquared());
|
||||
while (subSystem.errorSquared() > eps) {
|
||||
boolean triedShrink = false;
|
||||
while (subSystem.value() > eps && !triedShrink) {
|
||||
solveLM_COMMONS(subSystem);
|
||||
// Solver.solve_LM(subSystem);
|
||||
if (Math.abs(subSystem.errorSquared()) > eps) {
|
||||
linearSolvedCallback.run();
|
||||
if (Math.abs(subSystem.value()) > eps) {
|
||||
// solveWorse(subSystem, eps);
|
||||
if(subSystem.constraints.size() > 1) {
|
||||
Solver.SubSystem shrunk = shrink(subSystem);
|
||||
triedShrink = true;
|
||||
globalSolve(shrunk, linearSolvedCallback);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
linearSolvedCallback.run();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue