%
% N must be odd for bottom to have center
%

function bigrun

for N=5:4:21,
   
S = bignet(N);
[m,n]=size(S);
f = zeros(m,1);
f(2:2:2*N) = 1e-3/N;
p = zeros(100,2);
S = sparse(S);

tic

Si = inv(S);

for j=1:100,

    f(N+1) = f(N+1) + 1/100/100/N;

    x = Si*f;
    
    %p(j,:) = [f(N+1) x(N+1)];

end

dir((N-1)/4) = toc;

%plot(p(:,1),p(:,2),'x-')
%hold on

f = zeros(m,1);
f(2:2:2*N) = 1e-3/N;

tic

[L U] = lu(S);

for j=1:100,

    f(N+1) = f(N+1) + 1/100/100/N;

    x = U \ (L\f);

    %p(j,:) = [f(N+1) x(N+1)];

end

dim((N-1)/4) = size(S,1);
indir((N-1)/4) = toc;

end

%plot(p(:,1),p(:,2),'o-')
%hold off

plot(dim,dir,'x-')
hold on
plot(dim,indir,'ro-')
hold off
xlabel('degrees of freedom','fontsize',16)
ylabel('elapsed time','fontsize',16)
legend('inv','lu',2)
