X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..b801cf366c7671a99bdcef84d1e9c0ec64b36723:/icuSources/test/perf/howExpensiveIs/sieve.cpp diff --git a/icuSources/test/perf/howExpensiveIs/sieve.cpp b/icuSources/test/perf/howExpensiveIs/sieve.cpp index ce626d7e..0db51218 100644 --- a/icuSources/test/perf/howExpensiveIs/sieve.cpp +++ b/icuSources/test/perf/howExpensiveIs/sieve.cpp @@ -1,6 +1,6 @@ /* ********************************************************************** - * Copyright (c) 2011,International Business Machines + * Copyright (c) 2011-2012,International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ @@ -108,9 +108,9 @@ double qs(double *times, int n, double *q1, double *q2, double *q3) { return *q3-*q1; } -U_CAPI double uprv_getMeanTime(double *times, uint32_t timeCount, double *marginOfError) { +U_CAPI double uprv_getMeanTime(double *times, uint32_t *timeCount, double *marginOfError) { double q1,q2,q3; - int n = timeCount; + int n = *timeCount; /* calculate medians */ qsort(times,n,sizeof(times[0]),comdoub); @@ -126,18 +126,23 @@ U_CAPI double uprv_getMeanTime(double *times, uint32_t timeCount, double *margin for(int i=0;irangeMax) { #if U_DEBUG - printf("Knocking out: %.9f from [%.9f:%.9f]\n", times[i], rangeMin, rangeMax); + printf("Removing outlier: %.9f outside [%.9f:%.9f]\n", times[i], rangeMin, rangeMax); #endif times[i--] = times[--newN]; // bring down a new value } } +#if U_DEBUG + UBool didRemove = false; +#endif /* if we removed any outliers, recalculate iqr */ if(newN