% EXAMPLE3_24 Computations for Example 3.24.
%
fprintf('\n\n')
disp('           Gauss-Turan formulae for the Laguerre measure')
%disp('           Gauss-Turan formulae for the Hermite measure')  
fprintf('\n')
f1='%22.16f %20.16f %20.16f\n';
f2='%22.16f\n';
hom=1;
eps0=1.e-14;
ab0=r_laguerre(12);
%ab0=r_hermite(21);
for n=1:4
%for n=2:7
  for s=1:2
    xw=turan(n,s,eps0,ab0,hom);
    if s==1
      fprintf('                               s= %1.0f\n',s)
      disp('          nodes              weights0             weights1')
      for k=1:n
        fprintf(f1,xw(k,1),xw(k,2),xw(k,3))
      end
      disp('         weights2')
      for k=1:n
        fprintf(f2,xw(k,4))
      end
    else
      fprintf('                               s= %1.0f\n',s)
      disp('          nodes              weights0             weights1')
      for k=1:n
        fprintf(f1,xw(k,1),xw(k,2),xw(k,3))
      end
      disp('        weights2             weights3             weights4')
      for k=1:n
        fprintf(f1,xw(k,4),xw(k,5),xw(k,6))
      end
    end
  end
end
