function [V,d]=Vconj_ext_lag(dig,n)
%VCONJ_EXT_LAG The matrix V of the extended Stenger conjecture 
%and its eigenvalues for a Laguerre weight function
%   [V,D]=VCONJ_EXT_LAG(DIG,N,A) generates, partly in DIG-digit
%   arithmetic, the NxN matrix V and its eigenvalues D for
%   generalized Laguerre polynomials with parameter A. The 
%   elements of V are computed in terms of those of U and by 
%   Gauss_Laguerre quadrature. 

global a ab sab0 
eps0=.5e-03; ng=ceil(n/2);
V=zeros(n);
abn=ab(1:n,:); 
xwn=gauss(n,abn); xn=xwn(:,1);
err=1; d1=zeros(n,1); m=0;
while err>eps0
  d0=d1; m=m+20; if m>500, error('m exceeds 500'); end
  sab0m=sab0(1:m,:); sxw0m=sgauss(dig,m,sab0m); xw0m=double(sxw0m);
  x0m=xw0m(:,1); w0m=xw0m(:,2);
  for j=1:n
    cn=xn(j);
    const=exp(-cn);
    for k=1:n
      s1=0;
      for i=1:m
        x=cn+x0m(i);
        lag=lagrange(n,xn,x);
        s1=s1+w0m(i)*lag(k)*x^a;
      end
      V(j,k)=const*s1;
    end
  end
  digits(dig);
  sV=vpa(V); d=eig(sV);
  d1=double(d);
  err=errd(n,d1,d0);
%  [m err]
end
d=d1; V=double(sV);
[m err]
