function [U,d,xn,flxn]=Uconj_ext_hahn(dig,n)
%CONJ_JAC The matrix U of the extended Stenger conjecture 
%and its eigenvalues for a Hahn discrete (N+1)-point weight 
%function
%   [U,D]=UCONJ_EXT_HAHN(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 N a b ab w
U=zeros(n); 
abn=ab(1:n,:); 
xwn=gauss(n,abn); xn=xwn(:,1); 
if (2*floor(N/2)==N)&(2*floor(n/2)~=n) xn((n+1)/2)=N/2; end
flxn=floor(xn); 
if flxn(1)<0, flxn(1)=0; end
if flxn(n)==N, flxn(n)=N-1; end
for j=1:n
  xj=xn(j); flxj=flxn(j);
  for k=1:n
    s=0;
    for i=0:flxj
      lag=lagrange(n,xn,i);
      s=s+w(i+1)*lag(k);
    end
    U(j,k)=s;
  end
end
digits(dig);
sU=vpa(U); sd=eig(sU);
d=double(sd); 
