function maxwell_cdf_test ( )

%*****************************************************************************80
%
%% MAXWELL_CDF_TEST tests MAXWELL_CDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    27 March 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'MAXWELL_CDF_TEST\n' );
  fprintf ( 1, '  MAXWELL_CDF evaluates the Maxwell CDF.\n' );
  fprintf ( 1, '  MAXWELL_CDF_INV inverts the Maxwell CDF.\n' );
  fprintf ( 1, '  MAXWELL_PDF evaluates the Maxwell PDF.\n' );

  a = 2.0;

  if ( ~ maxwell_check ( a ) );
    fprintf ( 1, '\n' );
    fprintf ( 1, 'MAXWELL_CDF_TEST - Fatal error!\n' );
    fprintf ( 1, '  The parameters are not legal.\n' );
    return
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF parameter A = %14g\n', a );

  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, '       X            PDF           CDF            CDF_INV\n' );
  fprintf ( 1, '\n' );

  for i = 1 : 10

    [ x, seed ] = maxwell_sample ( a, seed );

    pdf = maxwell_pdf ( x, a );

    cdf = maxwell_cdf ( x, a );

    x2 = maxwell_cdf_inv ( cdf, a );

    fprintf ( 1, ' %14g  %14g  %14g  %14g\n', x, pdf, cdf, x2 );

  end

  return
end
