Problem:
I've 2 vectors of Points3d, where 'd' stay for double type;
The second vector is a sub-set of the first (es. "points" is the first and "consensus" is the second);
I want find te complement of "consensus" subset into "points" (pratically the element that are into "points" but not in "consensus").
Hello and Tanks.
I've a problem during compile. The excerpt code follow:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
void DrawFeatures(std::vector<Point3d>& points, std::vector<Point3d>& consensus){
std::vector<Point3d> v(points.size());
std::vector<Point3d>::iterator it;
sort (points, points.end(), sort_by_modulo);
sort (consensus, consensus.end(), sort_by_modulo);
it=set_difference (points, points.end(), consensus, consensus.end(), v.begin());
cout << "The difference betwean points and consensus has " << int(it-v.begin()) << "elements.\n";
}
bool sort_by_modulo (Point3d i, Point3d j) {return (i.lenght() < j.lenght());}
// the method .lenght return te module of the vector 3D
The error that i recive tell me
"no match function for call to "sort(std::vector<Point3<double>,std::allocator<Point3<double>>>&, __gnu_cx::__normal_iterator<Point3<double>*, std::<vector<Point3<double>,std::allocator<Point3<double>>>>,<unresolved function type>>"
and i don't understand why?
sort (points, points.end(), sort_by_modulo);
That should be points.begin() as first parameter
bool sort_by_modulo (Point3d i, Point3d j)
That sould be const reference parameters.