function [H] = householder(v)
%QR     Householder reflec
%   H = HOUSEHOLDER(v), where v is a m-vector, produces an m-by-m 
%   Householder reflector H = I_m - 2vv^t / (v^tv) if v is a column vector
% H = I_m - 2v^tv / (vv^t) if v is a row vector


[m,n] = size(v);
if m==1 
    w = v/norm(v);
    H= eye(n)- 2*w'*w;
elseif  n==1
    w = v/norm(v);
    H= eye(m)- 2*w*w';
else return 
end;

    
