Changeset 7164 for trunk/psLib/src/math/psStats.c
- Timestamp:
- May 22, 2006, 12:46:12 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r7139 r7164 16 16 * use ->min and ->max (PS_STAT_USE_RANGE) 17 17 * 18 * @version $Revision: 1.17 3$ $Name: not supported by cvs2svn $19 * @date $Date: 2006-05- 18 03:10:06$18 * @version $Revision: 1.174 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2006-05-22 22:46:12 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 832 832 833 833 // 5. Repeat N (stats->clipIter) times: 834 long numClipped = LONG_MAX; // Number of values clipped in this iteration 835 for (int iter = 0; iter < stats->clipIter && numClipped > 0; iter++) { 836 numClipped = 0; 834 long numClipped = 0; // Number of values clipped 835 bool clipped = true; // Have we clipped anything in this iteration 836 for (int iter = 0; iter < stats->clipIter && clipped; iter++) { 837 clipped = false; 837 838 psTrace(__func__, 6, "------------ Iteration %d ------------\n", iter); 838 839 // a) Exclude all values x_i for which |x_i - x| > K * stdev … … 844 845 myVector->data.F32[j], errors->data.F32[j]); 845 846 numClipped++; 847 clipped = true; 846 848 } 847 849 } … … 852 854 psTrace(__func__, 10, "Clipped %d: %f\n", j, myVector->data.F32[j]); 853 855 numClipped++; 856 clipped = true; 854 857 } 855 858 } … … 875 878 } 876 879 } 880 881 // Number of values used in calculation is the total number of data values, minus those we clipped 882 stats->clippedNvalues = myVector->n - numClipped; 877 883 878 884 // 7. The last calcuated value of x is the clipped mean.
Note:
See TracChangeset
for help on using the changeset viewer.
