mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 18:36:30 +01:00
splitup is mistaken
This commit is contained in:
parent
b95ad3dfd2
commit
fc792a64f2
2 changed files with 26 additions and 13 deletions
|
|
@ -29,17 +29,18 @@ public class GlobalSolver {
|
|||
double eps = 0.0001;
|
||||
java.lang.System.out.println("Solve system with error: " + subSystem.value());
|
||||
int count = 0;
|
||||
while (subSystem.valueSquared() > eps && (count++ < 100)) {
|
||||
while (subSystem.valueSquared() > eps && (count++ < 1)) {
|
||||
solveLM_COMMONS(subSystem);
|
||||
// Solver.solve_BFGS(subSystem, false);
|
||||
// Solver.solve_DL(subSystem);
|
||||
// Solver.solve_LM(subSystem);
|
||||
if (Math.abs(subSystem.valueSquared()) > eps) {
|
||||
// solveWorse(subSystem, eps);
|
||||
if(subSystem.constraints.size() > 1) {
|
||||
Solver.SubSystem shrunk = shrink(subSystem);
|
||||
globalSolve(shrunk, linearSolvedCallback);
|
||||
}
|
||||
}
|
||||
// if (Math.abs(subSystem.valueSquared()) > eps) {
|
||||
//// solveWorse(subSystem, eps);
|
||||
// if(subSystem.constraints.size() > 1) {
|
||||
// Solver.SubSystem shrunk = shrink(subSystem);
|
||||
// globalSolve(shrunk, linearSolvedCallback);
|
||||
// }
|
||||
// }
|
||||
linearSolvedCallback.run();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,12 +102,24 @@ public class Solver {
|
|||
}
|
||||
|
||||
boolean success = true;
|
||||
try {
|
||||
h_gn = new LUDecomposition(A).getSolver().solve(gg);
|
||||
} catch (Exception ssse) {
|
||||
java.lang.System.out.println(ssse.getMessage());
|
||||
success = false;
|
||||
|
||||
|
||||
for (int _ = 0; _ < 1000; _++) {
|
||||
try {
|
||||
h_gn = new LUDecomposition(A).getSolver().solve(gg);
|
||||
} catch (Exception ssse) {
|
||||
mu *= 1./3.;
|
||||
for (int i = 0; i < xsize; ++i) {
|
||||
A.setEntry(i, i, diag_A[i] * mu);
|
||||
}
|
||||
if (_ == 999) {
|
||||
return SolveStatus.Success;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (success) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue