function dirichlet_mix_pdf_test ( )

%*****************************************************************************80
%
%% DIRICHLET_MIX_PDF_TEST() tests DIRICHLET_MIX_PDF().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2016
%
%  Author:
%
%    John Burkardt
%
  comp_num = 2;
  elem_num = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DIRICHLET_MIX_PDF_TEST():\n' );
  fprintf ( 1, '  DIRICHLET_MIX_PDF() evaluates the Dirichlet Mix PDF.\n' );

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

  a(1:3,1:2) = [ 0.250, 1.500; ...
                 0.500, 0.500; ...
                 1.250, 2.000 ];

  comp_weight(1:2) = [ 1.0, 2.0 ];

  check = dirichlet_mix_check ( comp_num, elem_num, a, comp_weight );

  if ( ~ check );
    fprintf ( 1, '\n' );
    fprintf ( 1, 'DIRICHLET_MIX_PDF_TEST(): Fatal error!\n' );
    fprintf ( 1, '  The parameters are not legal.\n' );
    return
  end
  
  fprintf ( 1, '  Number of elements ELEM_NUM =   %6d\n', elem_num );
  fprintf ( 1, '  Number of components COMP_NUM = %6d\n', comp_num );

  r8mat_print ( elem_num, comp_num, a, '  PDF parameters A(ELEM,COMP):' );

  r8vec_print ( comp_num, comp_weight, '  Component weights:' );

  pdf = dirichlet_mix_pdf ( x, comp_num, elem_num, a, comp_weight );

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

  return
end
