29 std::pair<T, T> getMinMax(
32 const size_t & valueCount)
34 if (valueCount == 0) {
35 throw std::invalid_argument(
"You cannot compute min max on an empty array.");
38 std::pair<T, T> minMax(noValue, noValue);
40 while (i < valueCount && (values[i] != values[i] || values[i] == noValue)) ++i;
43 minMax.first = values[i];
44 minMax.second = values[i];
46 for (; i < valueCount; ++i)
48 if (values[i] == values[i] && values[i] != noValue)
50 if (values[i] > minMax.second)
51 minMax.second = values[i];
52 else if (values[i] < minMax.first)
53 minMax.first = values[i];
Definition: Statistics.h:25