function lmax = lebesgue_constant ( n, x, xfun )

%*****************************************************************************80
%
%% lebesgue_constant() estimates the Lebesgue constant for a set of points.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 January 2014
%
%  Author:
%
%    John Burkardt.
%
%  Reference:
%
%    Jean-Paul Berrut, Lloyd Trefethen,
%    Barycentric Lagrange Interpolation,
%    SIAM Review,
%    Volume 46, Number 3, September 2004, pages 501-517.
%
%  Input:
%
%    integer N, the number of interpolation points.
%
%    real X(N), the interpolation points.
%
%    real XFUN(*), the evaluation points.
%
%  Output:
%
%    real LMAX, an estimate of the Lebesgue constant for the points.
%
  lfun = lebesgue_function ( n, x, xfun );

  lmax = max ( lfun );

  return
end
  
