function perm1_rank_test ( )

%*****************************************************************************80
%
%% perm1_rank_test() tests perm1_rank().
%
%  Licensing:
%
%    This code is distributed under the MIT 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
