Skip to content

Instantly share code, notes, and snippets.

@ivangolo
Last active August 3, 2016 20:53
Show Gist options
  • Save ivangolo/fab77e74fd2b6f427d3d235a43f1b4ec to your computer and use it in GitHub Desktop.
Save ivangolo/fab77e74fd2b6f427d3d235a43f1b4ec to your computer and use it in GitHub Desktop.
Pareto front domination
bool dominates(const std::vector<double> &v, const std::vector<double> &w) {
if (v == w) {
return false;
}
size_t sum = 0;
for (size_t i = 0; i < v.size(); ++i) {
sum += v[i] <= w[i];
}
return sum == v.size();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment