0001 function [Gua,Gun]=jaccheck(p)
0002
0003
0004 jsws=p.jsw; r=resi(p,p.u,p.lam);
0005 p.jsw=3;tic;Gun=getGu(p,p.u,p.lam,r); t1=toc;
0006 figure(6); spy(Gun); title('numerical G_{u,n}');
0007 p.jsw=0;tic;Gua=getGu(p,p.u,p.lam,r); t2=toc;
0008 figure(4); spy(Gua); title('assembled G_{u,a}');
0009 fprintf('time for numjac=%g, time for assembling=%g\n',t1,t2);
0010 m1=full(max(max(abs(Gun)))); m2=full(max(max(abs(Gun-Gua))));
0011 m3=full(max(sum(abs(Gun))));m4=full(max(sum(abs(Gun-Gua))));
0012 fprintf('max(Gun)=%g, max(Gun-Gua)=%g, infinity-norm(Gun)=%g, relerr=%g\n',...
0013 m1,m2,m3,m4/m3);