function [H] = QRM(A,ITER)
%
% shifted QR Method for find one eigenvalue,
% using Wilkinson shift
%

n = size(A,1);
[Q,H] = hess(A); 
for k =1:ITER
   E = eig(H(n-1:n,n-1:n));
   shift = E(2);
   if (abs(H(n,n)-E(1))< abs(H(n,n)-E(2)))
       shift = E(1);
   end
   [Q, R] = qr((H-shift*eye(n)));
   H      = R * Q + shift*eye(n);
end


