* This routine multiplies each ExpectedCount histogram entry * by NewSampleCount/OldSampleCount so that the histogram * is now adjusted to the new sample count. * @param Buckets histogram data structure to adjust * @param NewSampleCount new sample count to adjust to * @return none * @note Exceptions: none * @note History: Thu Aug 3 14:31:14 1989, DSJ, Created. */
| 2264 | * @note History: Thu Aug 3 14:31:14 1989, DSJ, Created. |
| 2265 | */ |
| 2266 | void AdjustBuckets(BUCKETS *Buckets, uinT32 NewSampleCount) { |
| 2267 | int i; |
| 2268 | FLOAT64 AdjustFactor; |
| 2269 | |
| 2270 | AdjustFactor = (((FLOAT64) NewSampleCount) / |
| 2271 | ((FLOAT64) Buckets->SampleCount)); |
| 2272 | |
| 2273 | for (i = 0; i < Buckets->NumberOfBuckets; i++) { |
| 2274 | Buckets->ExpectedCount[i] *= AdjustFactor; |
| 2275 | } |
| 2276 | |
| 2277 | Buckets->SampleCount = NewSampleCount; |
| 2278 | |
| 2279 | } // AdjustBuckets |
| 2280 | |
| 2281 | /** |
| 2282 | * This routine sets the bucket counts in the specified histogram |