function konvergencePCG()

h = 0.01;
[A,b] = mkd1d('sin',h);
x = linspace(0,1,length(b)+2);

u0 = zeros(length(b),1);

n = length(b);
N = 20;

rel_presnost = 1e-6;

'konvergence metody sdruz. gradientu bez predpodminenim'
B = speye(n,n);
[u,it] = PredpodmineneSdruzeneGradienty(A,b,u0,rel_presnost,100000,B);
it

'konvergence metody sdruz. gradientu s predpodminenim Jacobiho metodou'
B = diag(1./diag(A));
[u,it] = PredpodmineneSdruzeneGradienty(A,b,u0,rel_presnost,100000,B);
it

'konvergence metody sdruz. gradientu s predpodminenim symetrickou Gauss-Seidelovou metodou'
D = diag(diag(A));
DU = triu(A);
DL = tril(A);
B = inv(full(DU))*D*inv(full(DL));
[u,it] = PredpodmineneSdruzeneGradienty(A,b,u0,rel_presnost,100000,B);
it

'konvergence metody sdruz. gradientu s predpodminenim neuplnym LU-rozkladem ILU(0)'
[L,U] = luinc(A,'0');
B = inv(full(U))*inv(full(L));
[u,it] = PredpodmineneSdruzeneGradienty(A,b,u0,rel_presnost,100000,B);
it
