Changeset 26641 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Jan 20, 2010, 12:57:12 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r26615 r26641 751 751 psTrace(TRACE, 6, "-------------------- Iterating on Bin size. Iteration number %d --------------------\n", iterate); 752 752 753 if (iterate >= PS_ROBUST_MAX_ITERATIONS) { 754 // This occurs when a large number of the values are identical --- a bin size cannot be found 755 // that will spread out the distribution. Therefore, set what we can, and fall over 756 // gracefully. 757 COUNT_WARNING(10, 100, "Maximum number of iterations (%d) exceeded.", PS_ROBUST_MAX_ITERATIONS); 758 goto escape; 759 } 760 753 761 // Get the minimum and maximum values 754 762 int numValid = vectorMinMax(myVector, mask, maskVal, statsMinMax); // Number of valid values … … 835 843 if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & maskVal) continue; 836 844 bool invalid = false; 837 invalid |= (myVector->data.F32[i] < minKeep);838 invalid |= (myVector->data.F32[i] > maxKeep);845 invalid |= (myVector->data.F32[i] <= minKeep); 846 invalid |= (myVector->data.F32[i] >= maxKeep); 839 847 invalid |= (!isfinite(myVector->data.F32[i])); 840 848 if (!invalid) continue; … … 842 850 nInvalid ++; 843 851 } 844 psTrace(TRACE, 6, "data is concentrated in a single bin, masking %d extreme outliers and retrying\n", nInvalid); 845 psFree(histogram); 846 psFree(cumulative); 847 continue; 852 853 if (nInvalid) { 854 psTrace(TRACE, 6, "data is concentrated in a single bin, masking %d extreme outliers and retrying\n", nInvalid); 855 psFree(histogram); 856 psFree(cumulative); 857 histogram = NULL; 858 cumulative = NULL; 859 continue; 860 } 861 // if we did not mask anything, give up. 848 862 } 849 863
Note:
See TracChangeset
for help on using the changeset viewer.
