function ksub_to_compnz_test ( )

%*****************************************************************************80
%
%% KSUB_TO_COMPNZ_TEST tests KSUB_TO_COMPNZ.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    24 May 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'KSUB_TO_COMPNZ_TEST\n' );
  fprintf ( 1, '  KSUB_TO_COMPNZ returns the nonzero composition \n' );
  fprintf ( 1, '  corresponding to a K subset.\n' );

  ns = 14;
  ks = 4;
  seed = 123456789;

  for i = 1 : 5

    fprintf ( 1, '\n' );

    [ as, seed ] = ksub_random2 ( ns, ks, seed );
    fprintf ( '  KSUB:  ' );
    for j = 1 : ks
      fprintf ( 1, '  %2d', as(j) );
    end
    fprintf ( 1, '\n' );

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

  return
end
