]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/steepest_descent.m
Fix a variable name (missed in the last renaming).
[octave.git] / optimization / steepest_descent.m
index 1eea7bc1b13a5c39511608248f6ea8ece4490029..7a437d36ad529c7f47bc1d2674bf75fb074e3beb 100644 (file)
@@ -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;