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

A = fd3d(30,30,1,0,0,0,0);
n = size(A,1);
b = A*ones(n,1);
x = randn(n,1);
nits = 200;
tol = 1.e-06
[x1, r1] = mr(A, x, b, nits,tol);
[x2, r2] = fom (A, b, x, tol, 80) 
[x3, r3] = sorR(A, x, b, nits, tol, 1.8);
[x4, r4] = gmres0(A, b, x, tol, 80, 80) 

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,'m-.', 'linewidth',2) 
h=legend('MR','FOM','sor','gmres');
%%
set(h,'fontsize',20)
