function normalize_test ( )

%*****************************************************************************80
%
%% NORMALIZE_TEST tests NORMALIZE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    21 February 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'NORMALIZE_TEST\n' );
  fprintf ( 1, '  NORMALIZE normalizes entries 1 through N of a vector\n' );
  fprintf ( 1, '  of length N+2.\n' );

  n = 5;
  seed = 123456789;
  [ x, seed ] = r8vec_uniform_01 ( n + 2, seed );
  r8vec_print ( n + 2, x, '  Initial X:' );

  x_norm = sum ( abs ( x(2:n+1) ) );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Initial L1 norm of X(1:N) = %g\n', x_norm );

  x = normalize ( n, x );

  r8vec_print ( n + 2, x, '  Normalized X:' );

  x_norm = sum ( abs ( x(2:n+1) ) );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Final L1 norm of X(1:N) = %g\n', x_norm );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'NORMALIZE_TEST\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end

