Changeset 40751
- Timestamp:
- May 25, 2019, 8:56:56 AM (7 years ago)
- Location:
- branches/eam_branches/ohana.20190329/src/libohana
- Files:
-
- 2 edited
-
include/ohana_sort.h (modified) (1 diff)
-
src/sorts.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/libohana/include/ohana_sort.h
r40291 r40751 83 83 void isortfour (int *X, int *Y, int *Z, int *W, int N); 84 84 85 void dsort_indexonly (double *X, off_t *S, off_t N); 86 85 87 #endif -
branches/eam_branches/ohana.20190329/src/libohana/src/sorts.c
r40291 r40751 196 196 } 197 197 198 /* sort the index of a vector (vector stays unsorted) */ 199 void dsort_indexonly (double *X, off_t *S, off_t N) { 200 201 # define SWAPFUNC(A,B){ off_t itmp; \ 202 itmp = S[A]; S[A] = S[B]; S[B] = itmp; \ 203 } 204 # define COMPARE(A,B)((!isfinite(X[S[A]]) && isfinite(X[S[B]])) || (X[S[A]] < X[S[B]])) 205 206 OHANA_SORT (N, COMPARE, SWAPFUNC); 207 208 # undef SWAPFUNC 209 # undef COMPARE 210 211 } 212 213
Note:
See TracChangeset
for help on using the changeset viewer.
