Changeset 10395 for trunk/psLib/src/math/psStats.c
- Timestamp:
- Dec 1, 2006, 12:41:33 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psStats.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psStats.c
r10274 r10395 16 16 * use ->min and ->max (PS_STAT_USE_RANGE) 17 17 * 18 * @version $Revision: 1.19 1$ $Name: not supported by cvs2svn $19 * @date $Date: 2006-1 1-29 17:55:25$18 * @version $Revision: 1.192 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2006-12-01 22:41:33 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1090 1090 tmpScalar.type.type = PS_TYPE_F32; 1091 1091 1092 // construct a histogram with (sigma/10 < binsize < sigma) 1093 // set roughly so that the lowest bins have about 2 cnts 1094 // Nsmallest ~ N50 / (4*dN)) 1095 psF32 dN = PS_MAX (1, PS_MIN (10, stats->robustN50 / 8)); 1096 psF32 newBinSize = stats->fittedStdev / dN; 1092 psF32 binSize = 1; 1093 if (stats->options & PS_STAT_USE_BINSIZE) { 1094 // Set initial bin size to the specified value. 1095 binSize = stats->binsize; 1096 psTrace("psLib.math", 6, "Setting initial robust bin size to %.2f\n", binSize); 1097 } else { 1098 // construct a histogram with (sigma/10 < binsize < sigma) 1099 // set roughly so that the lowest bins have about 2 cnts 1100 // Nsmallest ~ N50 / (4*dN)) 1101 psF32 dN = PS_MAX (1, PS_MIN (10, stats->robustN50 / 8)); 1102 binSize = stats->fittedStdev / dN; 1103 } 1097 1104 1098 1105 // Determine the min/max of the vector (which prior outliers masked out) … … 1108 1115 1109 1116 // Calculate the number of bins. 1110 long numBins = (max - min) / newBinSize;1117 long numBins = (max - min) / binSize; 1111 1118 psTrace("psLib.math", 6, "The new min/max values are (%f, %f).\n", min, max); 1112 psTrace("psLib.math", 6, "The new bin size is %f.\n", newBinSize);1119 psTrace("psLib.math", 6, "The new bin size is %f.\n", binSize); 1113 1120 psTrace("psLib.math", 6, "The numBins is %ld\n", numBins); 1114 1121
Note:
See TracChangeset
for help on using the changeset viewer.
