]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/steepest_descent.m
Fix an inline #-comment.
[octave.git] / optimization / steepest_descent.m
index 1eea7bc1b13a5c39511608248f6ea8ece4490029..4fb332950b26c055a237ec34c1e04a9a249c0fd4 100644 (file)
@@ -53,8 +53,8 @@ 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)
-      # This catches the k=0 case, too.
+    if (norm(gk) < tolerance)
+      % This catches the k=0 case, too.
       x = xk;
       return;
     end