% Num. Math. - FS 2014 - Serie 8 Aufgabe 3 - solve Ax+b=0 with CG

for k=[40 100]
    A=...%%%
    b=...%%%
    TOL=...%%%
    MAXIT=...%%%
    x0=...%%%
    %repeat N times to get a better timing
    N=10;
    time1=zeros(N,1);
    time2=zeros(N,1);
    time3=zeros(N,1);
    for n=1:N
        tic;
        ...%%% %use cg => iter1 
        time1(n)=toc;
        
        tic;
        ...%%% %use pcg without preconditioner => iter2         
        time2(n)=...%%%
        
        ...%%%
        tic;
        ...%%% %use pcg with preconditioner => iter3         
        time3(n)=...%%%
    end
    k
    [iter1 iter2 iter3]
    [mean(time1) mean(time2) mean(time3)]
    ...%%% estimate condition number
end
