Changeset 40928 for branches/eam_branches/ohana.20190329
- Timestamp:
- Oct 8, 2019, 9:19:57 PM (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
r40751 r40928 84 84 85 85 void dsort_indexonly (double *X, off_t *S, off_t N); 86 void dsort_int_indexonly (double *X, int *S, int N); 86 87 87 88 #endif -
branches/eam_branches/ohana.20190329/src/libohana/src/sorts.c
r40751 r40928 211 211 } 212 212 213 213 /* sort the index of a vector (vector stays unsorted) */ 214 void dsort_int_indexonly (double *X, int *S, int N) { 215 216 # define SWAPFUNC(A,B){ int itmp; \ 217 itmp = S[A]; S[A] = S[B]; S[B] = itmp; \ 218 } 219 # define COMPARE(A,B)((!isfinite(X[S[A]]) && isfinite(X[S[B]])) || (X[S[A]] < X[S[B]])) 220 221 OHANA_SORT (N, COMPARE, SWAPFUNC); 222 223 # undef SWAPFUNC 224 # undef COMPARE 225 226 } 227 228
Note:
See TracChangeset
for help on using the changeset viewer.
