function lebesgue_constant_test ( )

%*****************************************************************************80
%
%% lebesgue_constant_test() tests lebesgue_constant() for a simple case.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 December 2025
%
%  Author:
%
%    John Burkardt
%
  a = -1.0;
  b = +1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'lebesgue_constant_test()\n' );
  fprintf ( 1, '  Test lebesgue_constant() for a simple case of\n' );
  fprintf ( 1, '  equally spaced points in [ %g, %g]\n', a, b );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  NI  = number of interpolating points.\n' );
  fprintf ( 1, '  NF = number of sample points\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Case 1: fix NI, try sequence of NF values\n' );
  fprintf ( 1, '\n' );

  ni = 11;
  xi = linspace ( a, b, ni );

  nf = 2;
  for loop = 1 : 10
    xf = linspace ( a, b, nf );
    lmax = lebesgue_constant ( ni, xi, xf );
    fprintf ( 1, '  %3d  %4d  %14.6g\n', ni, nf, lmax );
    nf = 2 * nf - 1;
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Case 2: fix NF, try sequence of NI values\n' );
  fprintf ( 1, '\n' );

  nf = 1001;
  xf = linspace ( a, b, nf );

  for ni = 1 : 11
    xi = linspace ( a, b, ni );
    lmax = lebesgue_constant ( ni, xi, xf );
    fprintf ( 1, '  %3d  %4d  %14.6g\n', ni, nf, lmax );
  end

  return
end

