0001 function x=ilss(A,b,p,lam)
0002
0003 global L U gmcount;
0004 flag=1;
0005 while(flag~=0)
0006 if(size(L,1)~=size(A,1)) fprintf('new LU ...'); tic;[L,U]=luinc(A,1e-6);toc; gmcount=0;end
0007 figure(4);spy(A); figure(6);spy(L);pause
0008 tic;[x,flag,rr]=gmres(A,b,5,1e-6,10,L,U);s1=toc; gmcount=gmcount+1;
0009 fprintf('flag=%i, res=%g, gmresc=%i, time=%g\n',flag, rr, gmcount,s1);
0010 if(flag~=0) fprintf('gmres, flag=%i, res=%g\n', flag, rr);
0011 fprintf('new LU ...'); tic;[L,U]=luinc(A,1e-5); toc; gmcount=0;
0012 end
0013 end
0014
0015
0016
0017
0018
0019