MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / minmax

Function minmax

source/matplot/util/common.cpp:198–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers 1

network.cppFile · 0.85

Calls 5

emptyMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
minFunction · 0.70
maxFunction · 0.70

Tested by

no test coverage detected