mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 17:04:58 +01:00
rollback an accidental commit
This commit is contained in:
parent
8100cb758f
commit
4c9bb84d77
1 changed files with 4 additions and 15 deletions
|
|
@ -326,7 +326,7 @@ var dog_leg = function (subsys, rough) {
|
||||||
var g_inf = n.norminf(g);
|
var g_inf = n.norminf(g);
|
||||||
var fx_inf = n.norminf(fx);
|
var fx_inf = n.norminf(fx);
|
||||||
|
|
||||||
var iterLimit = rough ? 100 : 50000;
|
var iterLimit = rough ? 100 : 500;
|
||||||
var divergenceLimit = 1e6 * (err + 1e6);
|
var divergenceLimit = 1e6 * (err + 1e6);
|
||||||
|
|
||||||
var delta = 10;
|
var delta = 10;
|
||||||
|
|
@ -339,6 +339,8 @@ var dog_leg = function (subsys, rough) {
|
||||||
|
|
||||||
if (fx_inf <= tolf) {
|
if (fx_inf <= tolf) {
|
||||||
returnCode = SUCCESS;
|
returnCode = SUCCESS;
|
||||||
|
} else if (g_inf <= tolg) {
|
||||||
|
returnCode = SUCCESS;
|
||||||
} else if (iter >= iterLimit) {
|
} else if (iter >= iterLimit) {
|
||||||
returnCode = ITER_LIMIT;
|
returnCode = ITER_LIMIT;
|
||||||
} else if (delta <= tolx * (tolx + n.norm2(x))) {
|
} else if (delta <= tolx * (tolx + n.norm2(x))) {
|
||||||
|
|
@ -440,7 +442,7 @@ var dog_leg = function (subsys, rough) {
|
||||||
}
|
}
|
||||||
//log.push([stepKind,err, delta,rho]);
|
//log.push([stepKind,err, delta,rho]);
|
||||||
|
|
||||||
const step = () => {
|
if (acceptCandidate) {
|
||||||
x = n.clone(x_new);
|
x = n.clone(x_new);
|
||||||
J = n.clone(J_new);
|
J = n.clone(J_new);
|
||||||
fx = n.clone(fx_new);
|
fx = n.clone(fx_new);
|
||||||
|
|
@ -451,25 +453,12 @@ var dog_leg = function (subsys, rough) {
|
||||||
// get infinity norms
|
// get infinity norms
|
||||||
g_inf = n.norminf(g);
|
g_inf = n.norminf(g);
|
||||||
fx_inf = n.norminf(fx);
|
fx_inf = n.norminf(fx);
|
||||||
};
|
|
||||||
|
|
||||||
if (acceptCandidate) {
|
|
||||||
step();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_inf <= tolg) {
|
|
||||||
for (let i = 0; i < x_new.length; ++i) {
|
|
||||||
x_new[i] += 1;
|
|
||||||
}
|
|
||||||
err_new = subsys.calcResidual(fx_new);
|
|
||||||
step();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
//log.push(returnCode);
|
//log.push(returnCode);
|
||||||
//window.___log(log);
|
//window.___log(log);
|
||||||
console.log("DOGLE: " + iter)
|
|
||||||
return _result(iter, err, returnCode);
|
return _result(iter, err, returnCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue