Mercurial > hg > octave-nkf
changeset 13861:4d8317915db9
fix extra output parameters in gmres
* gmres.m: fix behaviour of output parameters iter and resvec
author | Carlo de Falco <kingcrimson@tiscali.it> |
---|---|
date | Sat, 12 Nov 2011 23:45:51 +0100 |
parents | 9326fc1f0c71 |
children | 6d7e133a4bed |
files | scripts/sparse/gmres.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/sparse/gmres.m +++ b/scripts/sparse/gmres.m @@ -65,7 +65,7 @@ ## @seealso{bicg, bicgstab, cgs, pcg} ## @end deftypefn -function [x, flag, presn, it] = gmres (A, b, restart, rtol, maxit, M1, M2, x0) +function [x, flag, presn, it, resids] = gmres (A, b, restart, rtol, maxit, M1, M2, x0) if (nargin < 2 || nargin > 8) print_usage (); @@ -182,7 +182,7 @@ endif resids = resids(1:iter-1); - it = [floor(maxit/restart), rem(maxit, restart)]; + it = [ceil(iter / restart), rem(iter, restart)]; endfunction