function legendre_weight_test ( )

%*****************************************************************************80
%
%% LEGENDRE_WEIGHT_TEST tests LEGENDRE_WEIGHT.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    05 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Ignace Bogaert,
%    Iteration-free computation of Gauss-Legendre quadrature nodes and weights,
%    SIAM Journal on Scientific Computing,
%    Volume 36, Number 3, 2014, pages A1008-1026.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'LEGENDRE_WEIGHT_TEST:\n' );
  fprintf ( 1, '  LEGENDRE_WEIGHT returns the K-th weight for\n' );
  fprintf ( 1, '  a Gauss Legendre rule of order L.\n' );

  for l = 1 : 10
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Gauss Legendre rule of order %d\n', l );
    fprintf ( 1, '\n' );
    fprintf ( 1, '   K      Weight\n' );
    fprintf ( 1, '\n' );
    for k = 1 : l
      weight = legendre_weight ( l, k );
      fprintf ( 1, '  %2d  %14.6g\n', k, weight );
    end
  end

  return
end
