function P4Grade()
% Checks out SpecialEig
n = 1000;
d = randn(n,1);
v = randn(n,1);
ev = diag(schur(diag(d)+v*v'));
ev = sort(ev);
[z,idx] = sort(abs(ev));
for k = [20 40 100 200 400]
   tic
   evSA = SpecialEig(d,v,k,'SA');
   tSA = toc;
   errSA = norm(evSA-sort(ev(1:k)));
   fprintf('n=%1d  k = %3d  errSA = %10.3e  tSA = %6.3f\n',n,k,errSA,tSA)
   tic
   evLA = SpecialEig(d,v,k,'LA');
   tLA = toc;
   errLA = norm(evLA-sort(ev(n-k+1:n)));
   fprintf('n=%1d  k = %3d  errLA = %10.3e  tLA = %6.3f\n',n,k,errLA,tLA)
   tic
   evSM = SpecialEig(d,v,k,'SM');
   tSM = toc;
   errSM = norm(evSM-sort(ev(idx(1:k))));
   fprintf('n=%1d  k = %3d  errSM = %10.3e  tSM = %6.3f\n',n,k,errSM,tSM)
   tic
   evLM = SpecialEig(d,v,k,'LM');
   tLM = toc;
   errLM = norm(evLM-sort(ev(idx(n-k+1:n))));
   fprintf('n=%1d  k = %3d  errLA = %10.3e  tLM = %6.3f\n\n',n,k,errLM,tLM)
end
