function r8vec_unique_index_test ( )

%*****************************************************************************80
%
%% R8VEC_UNIQUE_INDEX_TEST tests R8VEC_UNIQUE_INDEX.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_UNIQUE_INDEX_TEST\n' );
  fprintf ( 1, '  R8VEC_UNIQUE_INDEX indexes the unique elements in\n' );;
  fprintf ( 1, '  an R8VEC, with a tolerance.\n' );

  n = 10;
  a = [ 1.0, 2.0, 3.0, 2.0, 1.1, 2.01, 3.00001, 99.0, 2.1, 99.1 ];
  r8vec_print ( n, a, '  Vector A:' );

  tol = 0.0;
  unique_index = r8vec_unique_index ( n, a, tol );
  r8vec2_print ( n, a, unique_index, '  Using tolerance of 0.0:' );

  tol = 0.0001;
  unique_index = r8vec_unique_index ( n, a, tol );
  r8vec2_print ( n, a, unique_index, '  Using a tolerance of 0.0001:' );

  tol = 0.2;
  unique_index = r8vec_unique_index ( n, a, tol );
  r8vec2_print ( n, a, unique_index, '  Using a tolerance of 0.2:' );

  return
end
