%
%  A test on Symmetric Lanczos.   B/L 7/23/2009
%
% cd c:\working@PC\tex\Beijing2009\MATLAB

n=1000; alleig=randn(n,1);
A=diag(alleig);

v0=ones(n,1); k=30;
[V, T]=symlanz(A, v0, k);

plot((k+1)*ones(n,1), alleig,'r+'); hold on
for i=1:k,
    if round(i/2)==i/2,
       plot(i*ones(i,1), eig(T(1:i,1:i)),'b+');
    else
       plot(i*ones(i,1), eig(T(1:i,1:i)),'g+');
    end
end
hold off
