%R_MARCHENKO_PASTUR_CHEB

function ab=r_marchenko_pastur_cheb(dig,N,c,a,b,mu)
%tic
if c==1
  ab=r_jacobi(N,a,b-1);
else
  digits(dig); 
  abm=vpa(zeros(2*N-1,2)); abm(:,1)=vpa(-ones(2*N-1,1));
  gam=(c+1)/(2*sqrt(c));
  mom=smom_marchenko_pastur(dig,N,a,b,gam,mu); mom=mom';
  ab_trans=schebyshev(dig,N,mom,abm);
  ab_trans=double(ab_trans)
end
ab=zeros(N,2);
for n=1:N
  ab(n,1)=2*sqrt(c)*ab_trans(n,1)+c+1;
end
ab(1,2)=(2*sqrt(c))^(a+b)*ab_trans(1,2);
for n=2:N 
  ab(n,2)=4*c*ab_trans(n,2);
end
%time_cheb=toc
