X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=optimization%2Fsteepest_descent.m;h=7a437d36ad529c7f47bc1d2674bf75fb074e3beb;hp=1eea7bc1b13a5c39511608248f6ea8ece4490029;hb=8c8536a4a03dfdc5975b9f668305a89d1cd56e79;hpb=8df0aa3b8e47b596626cf0f833d9e0c0143bf4d5 diff --git a/optimization/steepest_descent.m b/optimization/steepest_descent.m index 1eea7bc..7a437d3 100644 --- a/optimization/steepest_descent.m +++ b/optimization/steepest_descent.m @@ -53,7 +53,7 @@ function [x, k] = steepest_descent(g, x0, step_size, tolerance, max_iterations) % loop finishes, we have implicitly met the second stopping % condition (number of iterations). - if (norm(g_k) < tolerance) + if (norm(gk) < tolerance) # This catches the k=0 case, too. x = xk; return;