pfsum=0;
sumn=20;  % number of tests of each accuracy
tolerdigits=[1:14];
n=30;
for i=1:sumn,
normpforig=[];
normdforig=[];
normpf0=[];
normdf0=[];
iter0=[];
iterorig=[];
residualstd=[];
residualmean=[];
disp(['starting dimension: ',num2str(n)]);
for digits=tolerdigits,
disp(' ');
disp(' ');
density=1/(2*n);
L=sprandsym(n,density);
L(1,:)=randn(1,n);
L(:,1)=L(1,:)';
[normpf, normdf, phi, X, y, iter] = mc0( L,digits);
normpf0=[normpf0 normpf];
normdf0=[normdf0 normdf];
iter0=[iter0 iter];
[normpf, normdf, phi, X, y, iter, primalres] = mc( L,digits);
normpforig=[normpforig normpf];
normdforig=[normdforig normdf];
iterorig=[iterorig iter];
residualmean=[residualmean primalres(1)];
residualstd=[residualstd primalres(2)];
save testmc0 iter0 iterorig residualstd residualmean
end
pfsum=pfsum+normpforig;
end
figure(1)
plot(tolerdigits,normpforig,'go',tolerdigits,normpforig,'y-')
figure(2)
plot(tolerdigits,normdforig,'go',tolerdigits,normdforig,'y-')
disp(['avg normpfs is: ',num2str(pfsum/sumn)]);
figure(3)
plot(tolerdigits,pfsum/sumn,'go',tolerdigits,pfsum/sumn,'y-')
