comparison scripts/sparse/cgs.m @ 13076:59def8890992

codesprint: avoid crash after running tests * cgs.m: Use anonymous function for test.
author John W. Eaton <jwe@octave.org>
date Sat, 03 Sep 2011 16:25:48 -0400
parents 4b110dd204b9
children 1bf456b4e51c
comparison
equal deleted inserted replaced
13075:386024135ce6 13076:59def8890992
201 %! 201 %!
202 %!test 202 %!test
203 %! tol = 1e-8; 203 %! tol = 1e-8;
204 %! maxit = 15; 204 %! maxit = 15;
205 %! 205 %!
206 %! function y = afun (x, a) 206 %! [x, flag, relres, iter, resvec] = cgs (@(x) A * x, b, tol, maxit, M);
207 %! y = a * x;
208 %! endfunction
209 %!
210 %! [x, flag, relres, iter, resvec] = cgs (@(x) afun (x, A), b, tol, maxit, M);
211 %! assert (x, ones (size (b)), 1e-7); 207 %! assert (x, ones (size (b)), 1e-7);
212 208
213 %!test 209 %!test
214 %! n = 100; 210 %! n = 100;
215 %! tol = 1e-8; 211 %! tol = 1e-8;