function r8vec_sorted_unique_test ( )

%*****************************************************************************80
%
%% r8vec_sorted_unique_test() tests r8vec_sorted_unique();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  n = 30;
  tol = 0.25;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_SORTED_UNIQUE_TEST\n' );
  fprintf ( 1, '  R8VEC_SORTED_UNIQUE finds the unique entries in\n' );
  fprintf ( 1, '  a sorted R8VEC;\n' );

  b = 0.0;
  c = n;
  a = b + ( c - b ) * rand ( n, 1 );

  a(1:n) = floor ( a(1:n) );

  r8vec_print_part ( n, a, 1, 10, '  Unsorted array:' );

  a = r8vec_sort_heap_a ( n, a );
 
  [ unique_num, a ] = r8vec_sorted_unique ( n, a, tol );
 
  r8vec_print ( unique_num, a, '  Unique entries' );

  return
end
