function [U,d,xn]=Uconj_restr_hahn(dig,n)
%CONJ_RESTR_HAHN The matrix U of the restricted Stenger conjecture 
%and its eigenvalues for a Hahn discrete (N+1)-point weight 
%function
%   [U,D]=UCONJ_RESTR(DIG,n) generates, partly in DIG-digit
%   arithmetic, the nxn matrix U, n <= N, and its eigenvalues
%   D for Hahn polynomials of degree n with parameters A and B.

global ab ab0 
U=zeros(n); ng=ceil(n/2);
abn=ab(1:n,:); ab0ng=ab0(1:ng,:);
xwn=gauss(n,abn); xn=xwn(:,1); 
xw0ng=gauss(ng,ab0ng); x=xw0ng(:,1); w=xw0ng(:,2);
for j=1:n
  xj=xn(j); 
  for k=1:n
    s=0;
    for i=1:ng
      lag=lagrange(n,xn,xj*x(i));
      s=s+w(i)*lag(k);
    end
    U(j,k)=xj*s;
  end
end
digits(dig);
sU=vpa(U); sd=eig(sU);
d=double(sd); 
