mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 02:13:58 +01:00
improved performance of dogleg
This commit is contained in:
parent
ff89d478e7
commit
3d2fe14426
1 changed files with 1 additions and 5 deletions
|
|
@ -371,7 +371,6 @@ optim.dog_leg = function (subsys, rough) {
|
|||
stop = 6;
|
||||
}
|
||||
else {
|
||||
var Jt = n.transpose(Jx);
|
||||
|
||||
// get the gauss-newton step
|
||||
//h_gn = n.solve(Jx, n.mul(fx, -1));
|
||||
|
|
@ -386,10 +385,6 @@ optim.dog_leg = function (subsys, rough) {
|
|||
//solve linear problem using svd formula to get the gauss-newton step
|
||||
//h_gn = lls(Jx, n.mul(fx, -1));
|
||||
|
||||
var rel_error = n.norm2(n.add(n.dot(Jx, h_gn), fx)) / n.norm2(fx);
|
||||
if (rel_error > 1e15)
|
||||
break;
|
||||
|
||||
var hitBoundary = false;
|
||||
|
||||
var stepKind;
|
||||
|
|
@ -404,6 +399,7 @@ optim.dog_leg = function (subsys, rough) {
|
|||
stepKind = 1;
|
||||
}
|
||||
else {
|
||||
var Jt = n.transpose(Jx);
|
||||
var B = n.dot(Jt, Jx);
|
||||
var gBg = n.dot(g, n.dot(B, g));
|
||||
alpha = n.norm2Squared(g) / gBg;
|
||||
|
|
|
|||
Loading…
Reference in a new issue