% Skript zur Musterlösung
%
% Numerische Mathematik, SS 2013
%
% Test der Cholsky-Zerlegung (Vergleich mit LR)
%
% Ingolf Busch, Juni 2013

n = 1:100:1001;
time_lr = zeros(size(n));
time_chol = zeros(size(n));

time = zeros(5,1);

for i=1:length(n)
    for j=1:length(time)
        A = randn(n(i));
        tic;
        [L,R] = my_lr_fast(A);
        time(j)=toc;
    end
    time_lr(i)=mean(time);
    for j=1:length(time)
        A = randn(n(i));
        tic;
        L = my_cholesky(A);
        time(j)=toc;
    end
    time_chol(i)=mean(time);
end

plot(n,time_lr,n,time_chol);