#include #include #include "mex.h" /* Input Arguments */ #define IN prhs[0] /* Output Arguments */ #define SORTED plhs[0] #define INDEX plhs[1] /// In-place quicksort for conventional C-style vector /// This should not be called directly. It should be called by mySort() only. template void quickSort(T *vec, int low, int up, int *index){ int i, j, temp1; T pkey, temp2; if(lowpkey)&&(j>low)); if (i void mySort(const T *vec, int vecSize, T *sorted, int *index){ for (int i=0; i