X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=optimization%2Fconjugate_gradient_method.m;h=2fab666b7794ccb1d583dcc56057e11362bb9307;hp=a6401e5ec21ff963883368576deb59ff0e1b36d0;hb=c40bbb2f7d9073193f107bbe252d4e9c8509a203;hpb=5ef96eb244b2a52886a31fc9873db479f52a6483 diff --git a/optimization/conjugate_gradient_method.m b/optimization/conjugate_gradient_method.m index a6401e5..2fab666 100644 --- a/optimization/conjugate_gradient_method.m +++ b/optimization/conjugate_gradient_method.m @@ -35,15 +35,18 @@ function [x, k] = conjugate_gradient_method(A, b, x0, tolerance, max_iterations) % % All vectors are assumed to be *column* vectors. % + % The rather verbose name of this function was chosen to avoid + % conflicts with other implementations. + % n = length(x0); M = eye(n); % The standard CGM is equivalent to the preconditioned CGM is you % use the identity matrix as your preconditioner. - [x, k] = preconditioned_conjugate_gradient_method(A, - M, - b, - x0, - tolerance, + [x, k] = preconditioned_conjugate_gradient_method(A, ... + M, ... + b, ... + x0, ... + tolerance, ... max_iterations); end