function vec_lex_next_test ( )

%*****************************************************************************80
%
%% vec_lex_next_test() tests vec_lex_next().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
  dim_num = 3;
  base = 3;
  more = 0;
  fprintf ( 1, '\n' );
  fprintf ( 1, 'vec_lex_next_test():\n' );
  fprintf ( 1, '  vec_lex_next() generates all DIM_NUM-vectors\n' );
  fprintf ( 1, '  in lex order in a given base BASE.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The spatial dimension DIM_NUM = %d\n', dim_num );
  fprintf ( 1, '  The base BASE =                 %d\n', base );
  fprintf ( 1, '\n' );
  
  a = [];
  
  while ( true )

    [ a, more ] = vec_lex_next ( dim_num, base, a, more );

    if ( ~more )
      break
    end

    for i = 1 : dim_num
      fprintf ( 1, '  %2d', a(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
