Greeting to all,
Currently I'm using std::sort on boost points on x-coordinte as follows
typedef bg::model::point<long long, 2, bg::cs::cartesian> point;
typedef std::pair<point, long long> value_type;
std::vector<value_type> values;
// for single attribute sort on point data sets
// std::sort needs custom comparison operator
struct PointLessX {
bool operator()(const value_type& p, const value_type& q) const
{
return bg::get<0>(p.first) < bg::get<0>(q.first);
}
};
std::cout << "Sorting the data " << std::endl;
PointLessX x;
std::sort(values.begin(), values.end(), x);
The above code is working fine but a bit slow when the # of points exceeds 10M.