function [H]=rmat(A,u,gama);
% This function computes the product of a reflector matrix with a
% rectangular matrix. The reflector is of the form H=Q-v*v' where
v is a column vector.
% NOTE the product is of the form A*H, where Q the first
% column of Q is zero and the others form an identity matrix.
% A is (q-1)*p and H is p*q
% HvB/USC/Spring 97
[m,n]=size(A);nn=n+1;
v=u(2:nn)./gama;
H=-(A*v)*u';
H(1:m,2:nn)=H(1:m,2:nn)+A;