1 | initial version |
yes, you can use partition with a distance functor
2 | No.2 Revision |
yes, you can use partition with a distance functorfunctor:
struct Dist {
bool operator()(const Point& a, const Point &b) {
return sqrt((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y)) < 15;
}
};
vector<Point> input = ...;
vector<int> labels;
partition(input, labels, Dist());