27 template <
typename P, std::
size_t D>
28 std::size_t
Median(
const std::vector<P>& points)
33 using C = std::pair<decltype(points[0].
template Get<D>()), std::size_t>;
34 std::vector<C> sorting;
35 for (std::size_t i = 0; i < points.size(); i++) {
36 sorting.emplace_back(points[i].
template Get<D>(), i);
38 std::sort(sorting.begin(), sorting.end());
39 return sorting[sorting.size() / 2].second;
std::size_t Median(const std::vector< P > &points)
Namespace for the geographic and demograhic classes.