| 196 | } |
| 197 | |
| 198 | std::pair<double, double> minmax(const std::vector<double> &x) { |
| 199 | if (x.empty()) { |
| 200 | return std::make_pair(min(x), max(x)); |
| 201 | } else { |
| 202 | auto [min_it, max_it] = std::minmax_element(x.begin(), x.end()); |
| 203 | return std::make_pair(*min_it, *max_it); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | double mean(const std::vector<double> &x) { |
| 208 | double sum = 0; |