function [U,d,xn]=Uconj_restr_blockhahn(dig,n)
%CONJ_RESTR_BLOCKHAHN The matrix U of the restricted Stenger 
%conjecture and its eigenvalues for the (N+1)-block Hahn weight 
%function
%   [U,D,XN]=UCONJ_RESTR_BLOCKHAHN(DIG,n) generates, partly in
%   DIG-digit arithmetic, the nxn matrix U and its eigenvalues
%   D for the (N+1)-block Hahn weight function w(x;N+1,a,b). The 
%   elements of U are computed exactly by ceil(n/2)-point
%   Gauss-Legendre quadrature on [0,1]. The output variable XN
%   is the vector of the DIG-digit zeros of the nth-degree
%   orthogonal polynomial. 

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); x0ng=xw0ng(:,1); w0ng=xw0ng(:,2);
for j=1:n
  xj=xn(j); 
  for k=1:n
    s=0;
    for i=1:ng
      lag=lagrange(n,xn,xj*x0ng(i));
      s=s+w0ng(i)*lag(k);
    end
    U(j,k)=xj*s;
  end
end
digits(dig);
sU=vpa(U); d=eig(sU);
d=double(d);
