62 const float fX = pValues[(nLow + nHigh) / 2];
66 while (pValues[i] < fX) i++;
67 while (pValues[j] > fX) j--;
71 float fTemp = pValues[i];
72 pValues[i] = pValues[j];
80 if (nLow < j)
Quicksort(pValues, nLow, j);
81 if (i < nHigh)
Quicksort(pValues, i, nHigh);
91 const float fX = pValues[(nLow + nHigh) / 2];
95 while (pValues[i] > fX) i++;
96 while (pValues[j] < fX) j--;
100 float fTemp = pValues[i];
101 pValues[i] = pValues[j];
119 const float fX = pValues[(nLow + nHigh) / 2];
123 while (pValues[i] < fX) i++;
124 while (pValues[j] > fX) j--;
128 const float fTemp = pValues[i];
129 pValues[i] = pValues[j];
132 void *pMetaTemp = ppMeta[i];
133 ppMeta[i] = ppMeta[j];
134 ppMeta[j] = pMetaTemp;
150 const float fX = pValues[(nLow + nHigh) / 2];
154 while (pValues[i] > fX) i++;
155 while (pValues[j] < fX) j--;
159 float fTemp = pValues[i];
160 pValues[i] = pValues[j];
163 void *pMetaTemp = ppMeta[i];
164 ppMeta[i] = ppMeta[j];
165 ppMeta[j] = pMetaTemp;
184 const float fX = ppValues[(nLow + nHigh) / 2][nSortByDimension];
188 while (ppValues[i][nSortByDimension] < fX) i++;
189 while (ppValues[j][nSortByDimension] > fX) j--;
193 float *pfTemp = ppValues[i];
194 ppValues[i]=ppValues[j];
static void QuicksortInverse(int *pOffsets, const int *pValues, int nLow, int nHigh)
void QuicksortByElementOfVector(float **ppValues, int nLow, int nHigh, int nSortByDimension)
void Quicksort(float *pValues, int nLow, int nHigh)
void QuicksortInverse(float *pValues, int nLow, int nHigh)
void QuicksortInverseWithMeta(float *pValues, void **ppMeta, int nLow, int nHigh)
void QuicksortWithMeta(float *pValues, void **ppMeta, int nLow, int nHigh)