function mom=smom_prudnikov_type(dig,N,nu,type)
%SMOM_PRUDNIKOV_TYPE Moments of a Prudnikov-type weight function.
%   MOM=SMOM_PRUDNIKOV_TYPE(DIG,N,NU,TYPE) generates in DIG-digit 
%   arithmetic the first 2N moments (the first moment if N=0) of a
%   Prudnikov-type weight function W(X), where W(X)=exp(-X)*RHO_NU(X)
%   when TYPE=1, and W(X)=EXP(-1/X)*(1/X)*RHO_NU(X) when TYPE=2.
%   Here,
%
%          RHO_NU(X)=2*X^(NU/2)*K_NU(2*sqrt(X))  on [0,INF],
%
%   where K_NU is the modified Bessel function of real order NU.

if type==1 & nu<=-1
  error('parameter out of range')
end
if N>0 
  mom=vpa(zeros(2*N,1));
end
digits(dig); 
vnu=vpa(nu); v0=vpa(0); v1=vpa(1); vm1=vpa(-1); v1h=vpa(1/2);
vpi=vpa(pi); vpis=vpa(pi^2);
if type==1
  if N==0
    mom=gamma(vnu+v1)*hypergeom([vnu+v1,v1],[],vm1);
  else
    for k=1:2*N
      km1=k-1; vkm1=vpa(km1);
      mom(k)=gamma(vkm1+v1)*gamma(vkm1+vnu+v1)*hypergeom([vkm1+vnu+v1, ...
      vkm1+v1],[],vm1);
    end
  end
elseif type==2
  if N==0
    mom=meijerG([],[],[v0,v0,vnu],[],v1);
  else
    for k=1:2*N
      km1=k-1; vkm1=vpa(k-1);
      mom(k)=meijerG([],[],[v0,vkm1,vkm1+vnu],[],v1);
    end
  end
else
  disp('wrong type')
end
