function perm_lex_rank_test ( )

%*****************************************************************************80
%
%% perm_lex_rank_test() tests perm_lex_rank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 December 2015
%
%  Author:
%
%    John Burkardt
%
  n = 4;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm_lex_rank_test():\n' );
  fprintf ( 1, '  perm_lex_rank() ranks\n' );
  fprintf ( 1, '  permutations using the lexicographic ordering:\n' );

  p = [ 3, 1, 2, 4 ];
  perm_print ( n, p, '  Element to be ranked:' )

  rank = perm_lex_rank ( n, p );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  is computed to be %d.\n', rank );

  return
end
