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

%*****************************************************************************80
%
%% R8VEC_NORMAL_01_SORTED returns a sorted normal 01 random vector.
%
%  Discussion:
%
%    The Normal 01 distribution has mean 0 and standard deviation 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 normal 01 random values
%    in ascending order.
%
%    Output, integer SEED, the updated seed.
%
  [ cdfvec, seed ] = r8vec_uniform_01_sorted1 ( n, seed );
  
  r8vec = zeros ( n, 1 );

  for i = 1 : n
    r8vec(i) = normal_01_cdf_inv ( cdfvec(i) );
  end

  return
end

  