function ab=r_marchenko_pastur_mod(dig,N,alpha,beta,c)
%R_MARCHENKO_PASTUR_MOD Recurrence coefficients for
%the generalized Marchenko-Pastur probability measure.
%   R_MARCHENKO_PASTUR_MOD(DIG,N,ALPHA,BETA,C) uses a
%   modification algorithm to generate in DIG-digit 
%   arithmetic the first N recurrence coefficients for
%   the monic orthogonal polynomials relative to the
%   generalized Marchenko-Pastur probability measure
%   (without Dirac function) having parameters ALPHA,
%   BETA, and C.

global ab0 
digits(dig)
sal=vpa(alpha); sbe=vpa(beta); sc=vpa(c); 
ssqrc=sqrt(sc); s1=vpa(1); s4=vpa(4); s16=vpa(16); 
sz=-(ssqrc-s1)^2/(s4*ssqrc);
if c<=0
  error('the parameter c is out of range');
elseif c==1
  ab=sr_jacobi01(dig,N,sal,sbe-s1); ab(1,2)=s1;
else
  ab0=sr_jacobi01(dig,N,sal,sbe);
  sr=srcauchy(dig,N,sz,sal,sbe,sc); double(sr)
  ab_star=smod_lindiv(dig,N,ab0,sz,sr);
end
if c~=1
  ab=vpa(zeros(N,2));
  for n=1:N
    ab(n,1)=s4*ssqrc*ab_star(n,1)+(ssqrc-s1)^2;
  end
  ab(1,2)=s1;
  for n=2:N 
    ab(n,2)=s16*sc*ab_star(n,2);
  end
end
