| 71 | |
| 72 | template <typename T> |
| 73 | std::pair<T, T> GetMinMax(const ChunkedArray& arr) { |
| 74 | T min = std::numeric_limits<T>::max(); |
| 75 | T max = std::numeric_limits<T>::lowest(); |
| 76 | |
| 77 | for (const auto& chunk : arr.chunks()) { |
| 78 | T local_min, local_max; |
| 79 | std::tie(local_min, local_max) = GetMinMax<T>(*chunk->data()); |
| 80 | min = std::min(min, local_min); |
| 81 | max = std::max(max, local_max); |
| 82 | } |
| 83 | |
| 84 | return std::make_pair(min, max); |
| 85 | } |
| 86 | |
| 87 | // Count value occurrences of an array, ignore nulls. |
| 88 | // 'counts' must be zeroed and with enough size. |