44 std::pair<T, T> getMinMax(
47 const size_t & valueCount)
49 if (valueCount == 0) {
50 throw std::invalid_argument(
"You cannot compute min max on an empty array.");
53 std::pair<T, T> minMax(noValue, noValue);
55 while (i < valueCount && (values[i] != values[i] || values[i] == noValue)) ++i;
58 minMax.first = values[i];
59 minMax.second = values[i];
61 for (; i < valueCount; ++i)
63 if (values[i] == values[i] && values[i] != noValue)
65 if (values[i] > minMax.second)
66 minMax.second = values[i];
67 else if (values[i] < minMax.first)
68 minMax.first = values[i];
Definition: Statistics.h:40