From: Michael Orlitzky Date: Tue, 26 Mar 2013 00:48:04 +0000 (-0400) Subject: Put back the redundant step_length_positive_definite() parameter. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=commitdiff_plain;h=2607d0ce1289b34ecce0a82b11e9935e239fe708 Put back the redundant step_length_positive_definite() parameter. --- diff --git a/tests/steepest_descent_tests.m b/tests/steepest_descent_tests.m index 93b2782..d6de1cc 100644 --- a/tests/steepest_descent_tests.m +++ b/tests/steepest_descent_tests.m @@ -23,7 +23,7 @@ q = @(x) (1/2)*x'*Q*x - b'*x; 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'); @@ -46,7 +46,7 @@ for n = [ 5, 10, 25, 50, 100 ] 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