g = @(x) Q*x - b; % The gradient of q at x.
% The step size algorithm to use in the steepest descent method.
-step_size = @(x) step_length_positive_definite(g(x), Q);
+step_size = @(x) step_length_positive_definite(g(x), Q, -g(x));
sd = steepest_descent(g, x0, step_size, tolerance, max_iterations);
diff = norm(cgm - sd, 'inf');
g = @(x) Q*x - b; % The gradient of q at x.
% The step size algorithm to use in the steepest descent method.
- step_size = @(x) step_length_positive_definite(g(x), Q);
+ step_size = @(x) step_length_positive_definite(g(x), Q, -g(x));
## pcg() stops when the /relative/ norm falls below tolerance. To
## eliminate the relativity, we divide the tolerance by the