This is /Users/gilbert/219/Matlab/startup.m Starting diary file diary-25-Apr-2018.txt A = grid5(100); n = length(A) n = 10000 spy(A) b = rand(n,1); [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n); flag flag = 0 iter iter = 301 semilogy(resvec / resvec(1)) hold on help ichol ichol Sparse Incomplete Cholesky factorization ... opt1.type = 'nofill' opt1 = type: 'nofill' L = ichol(A,opt1); nnz(L) ans = 29800 nnz(tril(A)) ans = 29800 figure,spy(L) [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n,L,L'); flag flag = 0 iter iter = 98 figure(1),hold on semilogy(resvec / resvec(1),'r') opt2.type = 'ict' opt2 = type: 'ict' opt2.droptol = 1; L = ichol(A,opt2); nnz(L) ans = 10000 [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n,L,L'); iter iter = 301 max(diag(L)) ans = (1,1) 2 min(diag(L)) ans = (1,1) 2 opt2.droptol = .01; L = ichol(A,opt2); nnz(L) ans = 49303 nnz(tril(A)) ans = 29800 figure,spy(L) [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n,L,L'); iter iter = 51 figure(1),hold on semilogy(resvec / resvec(1),'g') load bcsstk08 A = BCSSTK08; n = length(A) n = 1074 b = rand(n,1); [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n); semilogy(resvec / resvec(1)); L = ichol(A,opt1); [x, flag, relres, iter, resvec] = pcg(A,b,1e-8,10*n,L,L'); figure(1),hold on semilogy(resvec / resvec(1),'r') iter iter = 33 cond(full(A)) ans = 2.5988e+07 cond (full((L\A)/L')) ans = 82.8415 nnz(L) ans = 7017 nnz(tril(A)) ans = 7017 nnz(chol(A)) ans = 234160 clear load nonsymmats.mat whos Name Size Bytes Class Attributes arc130 130x130 17640 double sparse badA 100x100 2552 double sparse badb 100x1 800 double mult_dcop_03 25187x25187 3292960 double sparse sinc12 7500x7500 4603880 double sparse watt1 1856x1856 196616 double sparse west0479 479x479 34400 double sparse A = badA; spy(A) n = length(A) n = 100 b = badb; spy(A) badb badb = 1 0 0 0 ... 0 0 x = A \ b x = 0 0 0 0 ... 0 1 [x, flag, relres, iter, resvec] = gmres(A,b,[],1e-8,n); x x = 0 0 0 0 ... 0 1 iter iter = 1 100 figure semilogy(resvec / resvec(1),'r') [x, flag, relres, iter, resvec] = bicgstab(A,b,1e-8,n); x x = 0 0 0 0 ... 0 0 flag flag = 4 iter iter = 0 spy(west0479) diary off