function dirichlet_pdf_test ( )

%*****************************************************************************80
%
%% DIRICHLET_PDF_TEST() tests DIRICHLET_PDF().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2016
%
%  Author:
%
%    John Burkardt
%
  n = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DIRICHLET_PDF_TEST():\n' );
  fprintf ( 1, '  DIRICHLET_PDF() evaluates the Dirichlet PDF.\n' );

  x(1:3) = [ 0.500, 0.125, 0.375 ];

  a(1:3) = [ 0.250, 0.500, 1.250 ];

  check = dirichlet_check ( n, a );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of components N = %6d\n', n );

  r8vec_print ( n, a, '  PDF parameters A:' );
  r8vec_print ( n, x, '  PDF arguments X:' );

  pdf = dirichlet_pdf ( x, n, a );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PDF value = %14g\n', pdf );

  return
end
