function [ab,Mcap,kount]=r_cBspline_dis(N,m)
%R_CBSPLINE_DIS Recurrence coefficients for the B-spline measure.
%   AB=R_CBSPLINE_DIS(N,M) uses a multicomponent discretization
%   procedure to generate the first N recurrence coefficients for 
%   the Mth-order B-spline weight function PHI_M. The latter
%   is computed recursively in terms of lower-order B-splines.

global mc mp iq idelta irout xw_cBspline
Nm=N+ceil(m/2)-1;
xw_cBspline=zeros(Nm,2,m);
ab=r_jacobi01(Nm);
for i=1:m
  xw=gauss(Nm,ab);
  for k=1:Nm
    y=cBspline(xw(k,1),m);
    xw(k,2)=xw(k,2)*y(i);
  end
  for k=1:Nm
    xw(k,1)=xw(k,1)+i-1;
  end
  xw_cBspline(:,:,i)=xw;
end
mc=m; mp=0; iq=1; idelta=2; irout=0; Mmax=1000;
eps0=1;
[abm,Mcap,kount]=mcdis(N+ceil(m/2)-1,eps0,@quad_cBspline,Mmax);
ab=abm(1:N,:);
ab(:,1)=(m/2)*ones(N,1);
