function cvt_1d_lumping_test ( )

%*****************************************************************************80
%
%% cvt_1d_lumping_test() tests cvt_1d_lumping().
%
%  Discussion:
%
%    This test takes a lot of time!  
%    I have reduced it_num from 1000 to 250, 
%    and s_num from 4,000,000 to 400,000.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 December 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../cvt_1d_lumping' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'cvt_1d_lumping_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s.\n', version ( ) );
  fprintf ( 1, '  Test cvt_1d_lumping().\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Many computations are to be run.\n' );
  fprintf ( 1, '  Each computation is recorded in a separate output file.\n' );

  it_num = 250;
% s_num = 400000;
  s_num = 100000;
  fprintf ( 1, '  Number of iterations will be %d\n', it_num );
  fprintf ( 1, '  Number of sample points will be %d\n', s_num );
%
%  Random initialization.
%
  filename = 'output_005_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 5, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_009_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 9, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_017_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 17, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_033_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 33, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_065_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 65, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_129_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 129, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_257_r.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 257, it_num, s_num, @mu_chebyzero, 1 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
%  Chebyshev initialization.
%
  filename = 'output_005_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 5, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_009_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 9, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_017_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 17, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_033_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 33, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_065_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 65, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_129_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 129, it_num, s_num, @mu_chebyzero, 2 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_257_c.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 257, it_num, s_num, @mu_chebyzero, 2 )
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
%  Uniform initialization
%
  filename = 'output_005_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 5, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_009_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 9, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_017_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 17, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_033_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 33, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_065_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 65, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_129_u.txt';
   if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 129, it_num, s_num, @mu_chebyzero, 3 );
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
  filename = 'output_257_u.txt';
  if ( isfile ( filename ) )
    delete ( filename );
  end
  diary ( filename )
  cvt_1d_lumping ( 257, it_num, s_num, @mu_chebyzero, 3 )
  fprintf ( 1, '  Output saved in "%s"\n', filename );
  diary ( 'off' );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'cvt_1d_lumping_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../cvt_1d_lumping' )

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

