]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/vanilla_cgm.m
Replace step_length_cgm() with a direct call to step_length_positive_definite().
[octave.git] / optimization / vanilla_cgm.m
index c4d8f0796bd6721c96bb8c593dfbc3b8fa37d230..b511b484dfaab2ecba7fa6b8702be5080f977ba9 100644 (file)
@@ -45,7 +45,7 @@ function [x, k] = vanilla_cgm(A, b, x0, tolerance, max_iterations)
   pk = -rk;
 
   while (k <= max_iterations && norm(rk, 'inf') > tolerance)
-    alpha_k = step_length_cgm(rk, A, pk);
+    alpha_k = step_length_positive_definite(rk, A, pk);
     x_next = xk + alpha_k*pk;
 
     % Avoid accumulated roundoff errors.