function vector_lex_rank_test ( )

%*****************************************************************************80
%
%% vector_lex_rank_test() tests vector_lex_rank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 October 2022
%
%  Author:
%
%    John Burkardt
%
  d = 3;
  b = 3;
  more = false;
  fprintf ( 1, '\n' );
  fprintf ( 1, 'vector_lex_rank_test():\n' );
  fprintf ( 1, '  vector_lex_rank() ranks an integer vectors o length D\n' );
  fprintf ( 1, '  with entries between 1 and B.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The dimension d = %d\n', d );
  fprintf ( 1, '  The base b =      %d\n', b );
  fprintf ( 1, '\n' );
  
  a = [];
  i = 0;
  
  while ( true )

    [ a, more ] = vector_lex_next ( d, b, a, more );

    if ( ~ more )
      break
    end

    i = i + 1;
    fprintf ( 1, '  %d:  ', i );
    disp ( a )
    r = vector_lex_rank ( d, b, a );
    fprintf ( 1, '  Computed rank is %d\n', r );

  end

  return
end
