%% TEST03 tests R82VEC_SORT_QUICK_A. % n = 12; ndim = 2; b = 0.0; c = 10.0; seed = 123456789; fprintf ( 1, '\n' ); fprintf ( 1, 'TEST03\n' ); fprintf ( 1, ' R82VEC_SORT_QUICK_A sorts a D2 vector\n' ); fprintf ( 1, ' as part of a quick sort.\n' ); fprintf ( 1, ' Using initial random number seed = %d\n', seed ); [ a, seed ] = r8mat_uniform ( ndim, n, b, c, seed ); % % For better testing, give a few elements the same first component. % a(1,3) = a(1,5); a(1,4) = a(1,12); % % Make two entries equal. % a(1:2,7) = a(1:2,11); r8mat_transpose_print ( ndim, n, a, ' Before sorting:' ); a = r82vec_sort_quick_a ( n, a ); r8mat_transpose_print ( ndim, n, a, ' Sorted array:' );