function perm1_rank_test ( )

%*****************************************************************************80
%
%% PERM1_RANK_TEST tests PERM1_RANK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    13 June 2015
%
%  Author:
%
%    John Burkardt
%
  n = 4;
  p = [ 1, 4, 2, 3 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'PERM1_RANK_TEST\n' );
  fprintf ( 1, '  PERM1_RANK ranks a permutation of (1,...,N).\n' );

  perm1_print ( n, p, '  The permutation:' );
 
  rank = perm1_rank ( n, p );
 
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The rank is: %d\n', rank );

  return
end
