function [ r8vec, seed ] = r8vec_uniform_01_sorted2 ( n, seed )

%*****************************************************************************80
%
%% R8VEC_UNIFORM_01_SORTED2 returns a sorted real random vector in [0,1].
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    26 March 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Jon Bentley, James Saxe,
%    Generating sorted lists of random numbers,
%    ACM Transactions on Mathematical Software,
%    Volume 6, Number 3, September 1980, pages 359-364.
%
%  Parameters:
%
%    Input, integer N, the number of values to generate.
%
%    Input, integer SEED, the integer "seed" used to generate
%    the output random number.  SEED should not be 0.
%
%    Output, real R8VEC(N), a real vector of random values
%    in ascending order.
%
%    Output, integer SEED, the updated seed.
%
  r8vec = zeros ( n, 1 );
  [ r, seed ] = r8vec_uniform_01 ( n, seed );

  curmax = 1.0;
  for i = n : -1 : 1
    curmax = curmax * exp ( log ( r(i) ) / i );
    r8vec(i) = curmax;
  end

  return
end

  