function cycle_to_perm_test ( )

%*****************************************************************************80
%
%% CYCLE_TO_PERM_TEST tests CYCLE_TO_PERM.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 January 2011
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'CYCLE_TO_PERM_TEST\n' );
  fprintf ( 1, '  CYCLE_TO_PERM converts a permutation from\n' );
  fprintf ( 1, '  cycle to array form;\n' );

  n = 7;
  ncycle = 3;
  t = [ 4, 2, 5, 3, 1, 6, 7 ];
  index = [ 5, 1, 1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Cycle form:\n' );
  fprintf ( 1, '  Number of cycles is %d\n', ncycle );
  fprintf ( 1, '\n' );
  jlo = 0;
  for i = 1 : ncycle
    fprintf ( 1, '    ' );
    for j = jlo+1 : jlo+index(i)
      fprintf ( 1, '%4d', t(j) );
    end
    fprintf ( 1, '\n' );
    jlo = jlo + index(i);
  end

  p = cycle_to_perm ( n, ncycle, t, index );

  perm_print ( n, p, '  Corresponding permutation form:' );

  return
end
