function ksub_to_comp_test ( )

%*****************************************************************************80
%
%% KSUB_TO_COMP_TEST tests KSUB_TO_COMP.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    04 December 2013
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'KSUB_TO_COMP_TEST\n' );
  fprintf ( 1, '  KSUB_TO_COMP returns the composition corresponding to a K subset.\n' );

  nc = 10;
  kc = 5;
  seed = 123456789;

  for i = 1 : 5

    fprintf ( 1, '\n' );

    [ ac, seed ] = comp_random ( nc, kc, seed );
    fprintf ( '  COMP:' );
    for j = 1 : kc
      fprintf ( 1, '  %2d', ac(j) );
    end
    fprintf ( 1, '\n' );

    [ ns, ks, as ] = comp_to_ksub ( nc, kc, ac );
    fprintf ( '  KSUB:' );
    for j = 1 : ks
      fprintf ( 1, '  %2d', as(j) );
    end
    fprintf ( 1, '\n' );

    [ nc, kc, ac ] = ksub_to_comp ( ns, ks, as );
    fprintf ( '  COMP:' );
    for j = 1 : kc
      fprintf ( 1, '  %2d', ac(j) );
    end
    fprintf ( 1, '\n' );
    
  end

  return
end
