| 164 | } |
| 165 | |
| 166 | double max(const std::vector<double> &x) { |
| 167 | if (x.empty()) { |
| 168 | return -std::numeric_limits<double>::max(); |
| 169 | } else { |
| 170 | return *std::max_element(x.begin(), x.end()); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | double min(const std::vector<double> &x) { |
| 175 | if (x.empty()) { |