function r8vec_unique_count_test ( )

%*****************************************************************************80
%
%% r8vec_unique_count_test() tests r8vec_unique_count().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_UNIQUE_COUNT_TEST\n' );
  fprintf ( 1, '  R8VEC_UNIQUE_COUNT counts the unique elements in\n' );;
  fprintf ( 1, '  an R8VEC, witha tolerance.\n' );

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

  tol = 0.0;
  unique_num = r8vec_unique_count ( n, x, tol );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using a tolerance of %g, number of unique entries is %d\n', tol, unique_num );

  tol = 0.0001;
  unique_num = r8vec_unique_count ( n, x, tol );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using a tolerance of %g, number of unique entries is %d\n', tol, unique_num );

  tol = 0.2;
  unique_num = r8vec_unique_count ( n, x, tol );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Using a tolerance of %g, number of unique entries is %d\n', tol, unique_num );

  return
end
