	function [A] = kahan(c,n)
%
%       this function generates a scaled kahan matrix.
%
	s = sqrt((1-c) * (1+c));
        scale = 1;
        A= -c * triu(ones(n)) + (1+c) * eye(n);
        for j = 1:n
            A(j,1:n) = A(j,1:n) * scale;
            scale = scale * s;
        end
%
%       scale the columns of kahan matrix.
%
        for j = 1:n
            A(:,j) = A(:,j)/j;
        end
%
%       for n = 100 and c = 0.285, if one does the following in matlab:
%           A = kahan(c,n); [Q,S,V] = svd(A); [L,U,P] = lu(V);
%       then the matrices L and U are ill conditioned (~1e9). Hence
%       GEPP gives a large growth factor for orthogonal matrices as well.
%
%


