function vector_sumlex_next_test ( )

%*****************************************************************************80
%
%% vector_sumlex_next_test() tests vector_sumlex_next_next().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 September 2022
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'vector_sumlex_next_test():\n' );
  fprintf ( 1, '  vector_sumlex_next() generates integer vectors of dimension n.\n' );
  fprintf ( 1, '  The vectors are listed in order by the sum of their entries.\n' );
  fprintf ( 1, '  For a given sum, vectors are listed in lexicographic order.\n' );

  n = 4;
  x = zeros ( 1, n );
  
  for i = 0 : 30

    fprintf ( 1, '  %2d:  (', i );
    for j = 1 : n
      fprintf ( 1, '%d', x(j) );
      if ( j < n )
        fprintf ( 1, ',' );
      else
        fprintf ( 1, ')\n' );
      end
    end

    x = vector_sumlex_next ( x );

  end

  return
end
