function r8vec_sorted_merge_a_test ( )

%*****************************************************************************80
%
%% r8vec_sorted_merge_a_test() tests r8vec_sorted_merge_a();
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  na = 10;
  nb = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8vec_sorted_merge_a_test():\n' );
  fprintf ( 1, '  r8vec_sorted_merge_a() merges two sorted DVEC''s;\n' );
  fprintf ( 1, '\n' );

  a = rand ( na, 1 );
  b = rand ( nb, 1 );
  
  a = r8vec_sort_heap_a ( na, a );
 
  b = r8vec_sort_heap_a ( nb, b );

  r8vec_print ( na, a, '  Sorted vector A:' );

  r8vec_print ( nb, b, '  Sorted vector B:' );
 
  [ nc, c ] = r8vec_sorted_merge_a ( na, a, nb, b );

  r8vec_print ( nc, c, '  Merged vector C:' );

  return
end
