% given an m-by-n matrix A and a nonzero m-vector v with v(1) = 1, the
% following algorithm returns PA where P = I - 2*v*v'/(v'*v)
% (this is row.house(A,v) in Golub and Van Loan, page 197)

function A = lefthouse(v,A)

beta = -2/(v'*v);
w = beta*A'*v;
A = A + v*w';
