function [lam,x] = ord_power(A, x0, nsteps,displ)
%
%  call: [lam,x] = ord_power(A, x0, nsteps,displ)
%
%  Ordinary power iteration with A, starting with vector x0.
%  Returns approximation to eigenvalue and eigenvector.
%
x = x0;
for i = 1:nsteps
   y = A*x;
   x = y/norm(y);
   lam = x'*A*x;
   if displ
      lam
      pause
   end
end
