  function [v,U] = HessLU(A)
%
% Pre:
%    A      n-by-n upper Hessenberg
% Post:
%    v      column n-vector
%    U      n-by-n upper triangular U 
%           H = LU where L = I + diag(v(2:n),-1)
%
   [n,n] = size(A);
   v = zeros(n,1);
   for k=1:n-1
      v(k+1) = A(k+1,k)/A(k,k);
      A(k+1,k:n) = A(k+1,k:n) - v(k+1)*A(k,k:n);
   end
   U = triu(A);
