function r8vec_scale_ab_test ( )

%*****************************************************************************80
%
%% r8vec_scale_ab_test() tests r8vec_scale_ab().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 October 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_SCALE_AB_TEST\n' );
  fprintf ( 1, '  R8VEC_SCALE_AB shifts and scales an R8VEC so that\n' );
  fprintf ( 1, '  it has min A and max B\n' );

  n = 10;
  a = -5.0;
  b = 15.0;
  x = a + ( b - a ) * rand ( n, 1 );
 
  r8vec_print ( n, x, '  Vector X:' );
  mu = mean ( x );
  sigma = std ( x );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  mean(X) = %g\n', mu );
  fprintf ( 1, '  std(X)  = %g\n', sigma );
  fprintf ( 1, '  max(X)  = %g\n', max ( x ) );
  fprintf ( 1, '  min(X)  = %g\n', min ( x ) );

  a = -1.0;
  b = +1.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Rescale to [%g,%g]\n', a, b );

  xs = r8vec_scale_ab ( n, x, a, b );

  r8vec_print ( n, xs, '  Vector XS:' );
  mu = mean ( xs );
  sigma = std ( xs );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  mean(XS) = %g\n', mu );
  fprintf ( 1, '  std(XS)  = %g\n', sigma );
  fprintf ( 1, '  max(XS)  = %g\n', max ( xs ) );
  fprintf ( 1, '  min(XS)  = %g\n', min ( xs ) );

  return
end
