Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

yes, you can use partition with a distance functor

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());