function multiperm_enum_test ( )

%*****************************************************************************80
%
%% multiperm_enum_test() tests multiperm_enum().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 August 2021
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  test_num = 5;
  
  fprintf ( 1, '\n' );
  fprintf ( 1, 'multiperm_enum_test():\n' );
  fprintf ( 1, '  multiperm_enum() enumerates multipermutations.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  N is the number of objects to be permuted.\n' );
  fprintf ( 1, '  K is the number of distinct types of objects.\n' );
  fprintf ( 1, '  COUNTS is the number of objects of each type.\n' );
  fprintf ( 1, '  NUMBER is the number of multipermutations.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number       N       K       Counts(1:K)\n' );
  fprintf ( 1, '\n' );

  for test = 1 : test_num

    k = randi ( [ 1, n ], 1 );

    counts = compnz_random ( n, k );

    number = multiperm_enum ( n, k, counts );

    fprintf ( 1, '  %6d  %6d  %6d', number, n, k );
    for i = 1 : k
      fprintf ( 1, '  %4d', counts(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
