/ Hello. I've got some quick sort code that is now reading in data from /
/ GSl vectors, and so I was wondering if there is a GSL implementation of /
/ the quick sort algorithm given below:/
/ /
/ --quick_sort.c/
/ /
/ #include "common.h"/
/ /
/ void quick_sort (DATA_TYPE *list, int *index, int n){/
/ /
/ int i;/
/ void quick_sort_1();/
/ /
/ for ( i = 0; i < n; i++ ) index [i]=i;/
/ quick_sort_1 ( list , index , 0 , n-1 );/
/ /
/ return;/
/ /
/ }/
/ /
/ -- quick_sort_1.c/
/ /
/ #include "common.h"/
/ /
/ void quick_sort_1(DATA_TYPE *list, int *index, int left_end, int right_end)/
/ /
/ {/
/ /
/ int i, j, temp;/
/ DATA_TYPE chosen;/
/ /
/ chosen = list[ index[ (left_end + right_end) / 2 ] ];/
/ i = (left_end - 1);/
/ j = (right_end + 1);/
/ /
/ for (;;)/
/ /
/ {/
/ /
/ while (list [index[++i]] < chosen);/
/ while (list [index[--j]] > chosen);/
/ /
/ if (i < j)/
/ /
/ {/
/ /
/ temp = index [j];/
/ index [j] = index [i];/
/ index [i] = temp;/
/ /
/ }/
/ /
/ else if (i==j)/
/ /
/ {/
/ /
/ ++i;/
/ break;/
/ /
/ }/
/ /
/ else break;/
/ /
/ }/
/ /
/ if (left_end < j) quick_sort_1 (list, index, left_end, j);/
/ if (i < right_end) quick_sort_1 (list, index, i, right_end);/
/ /
/ return;/
/ /
/ }/
/ /
/ which looks like a fairly standard quick sort algorithm. If there is no /
/ GSL quick sort algorithm, then would the GSL heapsort algorithm easily /
/ take the place of the above quick sort function?/
/ /
/ Kind Regards,/
/ /
/ Matt/
/ /
/ /
/ /
/ _______________________________________________/
/ Help-gsl mailing list/
/ address@hidden/
/ http://lists.gnu.org/mailman/listinfo/help-gsl/
/ /