function inversion_to_perm1_test ( )

%*****************************************************************************80
%
%% INVERSION_TO_PERM1_TEST tests INVERSION_TO_PERM1.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    05 June 2015
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'INVERSION_TO_PERM1_TEST\n' );
  fprintf ( 1, '  INVERSION_TO_PERM1: inversion => permutation (1,...,N).\n' );
  fprintf ( 1, '\n' );

  perm(1:n) = [ 3, 5, 1, 4, 2 ];

  ins = perm1_to_inversion ( n, perm );

  perm2 = inversion_to_perm1 ( n, ins );

  for i = 1 : n
    fprintf ( 1, '  %3d', i );
  end
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %3d', perm(i) );
  end
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %3d', ins(i) );
  end
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %3d', perm2(i) );
  end
  fprintf ( 1, '\n' );
 
  return
end
