function perm1_to_equiv_test ( )

%*****************************************************************************80
%
%% perm1_to_equiv_test() tests perm1_to_equiv().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
  n = 9;
  p = [ 2,3,9,6,7,8,5,4,1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm1_to_equiv_test():\n' );
  fprintf ( 1, '  perm1_to_equiv() returns the set partition\n' );
  fprintf ( 1, '  or equivalence classes determined by a\n' );
  fprintf ( 1, '  permutation of (1,...,N).\n' );

  perm1_print ( n, p, '  The input permutation:' );
 
  [ npart, jarray, a ] = perm1_to_equiv ( n, p );

  equiv_print ( n, a, '  The partition:' );

  return
end
