Changeset 13006 for trunk/psphot/src/psphotSortBySN.c
- Timestamp:
- Apr 24, 2007, 1:43:47 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSortBySN.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSortBySN.c
r12792 r13006 1 1 # include "psphotInternal.h" 2 2 3 3 4 // sort by SN (descending) 4 int psphotSortBySN (const void **a, const void **b) 5 int pmPeakSortBySN (const void **a, const void **b) 6 { 7 pmPeak *A = *(pmPeak **)a; 8 pmPeak *B = *(pmPeak **)b; 9 10 psF32 fA = A->SN; 11 psF32 fB = B->SN; 12 if (isnan (fA)) fA = 0; 13 if (isnan (fB)) fB = 0; 14 15 psF32 diff = fA - fB; 16 if (diff > FLT_EPSILON) return (-1); 17 if (diff < FLT_EPSILON) return (+1); 18 return (0); 19 } 20 21 // sort by Y (ascending) 22 int pmPeakSortByY (const void **a, const void **b) 23 { 24 pmPeak *A = *(pmPeak **)a; 25 pmPeak *B = *(pmPeak **)b; 26 27 psF32 fA = A->y; 28 psF32 fB = B->y; 29 30 psF32 diff = fA - fB; 31 if (diff > FLT_EPSILON) return (+1); 32 if (diff < FLT_EPSILON) return (-1); 33 return (0); 34 } 35 36 // sort by SN (descending) 37 int pmSourceSortBySN (const void **a, const void **b) 5 38 { 6 39 pmSource *A = *(pmSource **)a; … … 19 52 20 53 // sort by Y (ascending) 21 int p sphotSortByY (const void **a, const void **b)54 int pmSourceSortByY (const void **a, const void **b) 22 55 { 23 56 pmSource *A = *(pmSource **)a;
Note:
See TracChangeset
for help on using the changeset viewer.
