From e773a81bcbc2df6b214497f4359e79356d19e5b2 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 18 Jul 2016 18:24:12 -0700 Subject: [PATCH] clean up --- web/app/math/optim.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/app/math/optim.js b/web/app/math/optim.js index 5cfaab36..1dae8179 100644 --- a/web/app/math/optim.js +++ b/web/app/math/optim.js @@ -411,15 +411,13 @@ optim.dog_leg = function (subsys, rough) { // break; // } - // see if we are already finished - if (stop) + if (stop) { break; - - // get the new values - var err_new; + } + x_new = n.add(x, h_dl); subsys.setParams(x_new); - err_new = subsys.calcResidual(fx_new); + var err_new = subsys.calcResidual(fx_new); subsys.fillJacobian(Jx_new); // calculate the linear model and the update ratio