
%%addpath ../general;
addpath ../iters;
close;

A = lap2D(30,30);
n = size(A,1);
b = A*ones(n,1);
x = randn(n,1);
nits = 300;
tol = 1.e-06
[x1, r1] = steep(A, x, b, nits,tol);
[x2, r2] = mr(A, x, b, nits,tol);
[x3, r3] = rnsteep(A, x, b, nits,tol);
[x4, r4] = sorR(A, x, b,nits,tol,1.8);

semilogy([1:length(r1)], r1, 'linewidth',2)
hold on 
semilogy([1:length(r2)], r2,'r--', 'linewidth',2) 
semilogy([1:length(r3)], r3,'k:', 'linewidth',2) 
semilogy([1:length(r4)], r4,'k--', 'linewidth',2) 
h=legend('Steep. desc.','min. res.', 'rn-steep. desc','sor');
%%
set(h,'fontsize',20)
