function [R]=hessen(A)
% Hessenberg Reduction by using Householder Method
n=size(A,1);
R=A;
for j=1:n-2
    x=R(j+1:n, j);
    vj=house(x);
    R(j+1:n, j:n) = R(j+1:n, j:n) - 2 * vj * (vj'*R(j+1:n, j:n));
    R(1:n, j+1:n) = R(1:n, j+1:n) - 2 * (R(1:n, j+1:n) * vj) * vj';
end