
%%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] = steep(A, b, x, 100,tol);
[x2, r2] = fom (A, b, x, nits, tol) 
[x3, r3] = CG(A, b, x, nits, tol);
[x4, r4] = sorR(A, b, x, 100, 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,'m-.', 'linewidth',2) 
h=legend('steep','FOM','cg','sor');
%%
set(h,'fontsize',20)
