function [ u ] = get_householder( r, c, A )
%GET_HOUSEHOLDER( r, c, A ) Get the HH u for clearing column c below row r.
%   r and c should be integers (1<=r<m, 1<=c<=m).
%   A is the (square!) matrix we wish to clear
%   u (returned) is the normal to the plane of the Householder reflection
    
    % Construct u
    [m,~]=size(A);
    if floor(c)==c && floor(r)==r && and(c>=1,c<=m) && and(r>=1,r<m)
        colnorm=norm(A(r:m,c));
        pm=sign(A(r,c));
        if pm == 0
            pm = 1;
        end
        u = [zeros(r-1,1); ...
            (A(r,c) + pm*colnorm);...
             A(r+1:m,c)];
    else
        u = zeros(m,1);
    end
end

