Commit e0b659f1 authored by gsell's avatar gsell
Browse files

Merge branch '476-missing-include-of-algorithms-and-usage-of-std-minmax' into 'master'

Resolve "missing include of <algorithm> and usage of std::minmax()"

Closes #476

See merge request OPAL/src!290
parents ccebd9e7 71abb55f
......@@ -9,6 +9,7 @@
#include <cmath>
#include <string>
#include <cstdio>
#include <algorithm>
#include <gsl/gsl_integration.h>
#include <gsl/gsl_errno.h>
......@@ -193,11 +194,12 @@ double Profile::get(double xa, Interpol_type /*tp*/) {
low = k;
}
}
std::pair<double, double> y_minmax = std::minmax({y[low], y[high]});
if (val < y_minmax.first) {
val = y_minmax.first;
} else if (val > y_minmax.second) {
val = y_minmax.second;
double y_min = std::min (y[low], y[high]);
double y_max = std::max (y[low], y[high]);
if (val < y_min) {
val = y_min;
} else if (val > y_max) {
val = y_max;
}
return (sf * val);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment