I have the vector of Edges. I need to sort those edges by y-coordinate of the point of crossing vertical line x==(a+b)/2 and those edges. The problem is the that a and b are not constant and they have to change from one array of edgges to another one. How can I sent the a and b parameters to the comparator?
struct vertex
{
double x,y;
bool operator==(const vertex &o)const {
return x == o.x && y == o.y;
}
bool operator<(const vertex &o) const{
return x < o.x || (x == o.x && y < o.y);
}
};
typedef vector<vertex> vertList;
typedef vector <pair<vertex,vertex>> Edge;
Aucun commentaire:
Enregistrer un commentaire