function r8vec_amax_index_test ( )

%*****************************************************************************80
%
%% r8vec_amax_index_test() tests r8vec_amax_index();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 August 2018
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_AMAX_INDEX_TEST\n' );
  fprintf ( 1, '  R8VEC_AMAX_INDEX: index of maximum magnitude entry;\n' );
 
  b = -n;
  c = n;
  a = b + ( c - b ) * rand ( n, 1 );
 
  r8vec_print ( n, a, '  Input vector:' );

  fprintf ( 1, '\n' );

  index = r8vec_amax_index ( n, a );
  fprintf ( 1, '  Maximum absolute occurs at a[%d]\n', index );

  return
end
