X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/4388f060552cc537e71e957d32f35e9d75a61233..refs/heads/master:/icuSources/test/perf/howExpensiveIs/sieve.cpp diff --git a/icuSources/test/perf/howExpensiveIs/sieve.cpp b/icuSources/test/perf/howExpensiveIs/sieve.cpp index ce626d7e..6190de75 100644 --- a/icuSources/test/perf/howExpensiveIs/sieve.cpp +++ b/icuSources/test/perf/howExpensiveIs/sieve.cpp @@ -1,8 +1,12 @@ /* - ********************************************************************** - * Copyright (c) 2011,International Business Machines + *********************************************************************** + * © 2016 and later: Unicode, Inc. and others. + * License & terms of use: http://www.unicode.org/copyright.html#License + *********************************************************************** + *********************************************************************** + * Copyright (c) 2011-2012,International Business Machines * Corporation and others. All Rights Reserved. - ********************************************************************** + *********************************************************************** */ #include "unicode/utimer.h" @@ -108,9 +112,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 +130,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