stdvector - Fast searching of Point2f vector in C++ -
i have point2f
vector, std::vector<point2f> vxy;
. length 70000 in rows. have point2f
variable point2f var;
. implement fast searching var
in vxy verctor
, return matched index of vector. consider std::lower_bound
, normal data type int. how implement searching algorithm point2f type? thanks
with operator ==
overloaded in point2f
, can use std::find
algorithm.
std::vector<point2f>::iterator = std::find(vxy.begin(), vxy.end(), var); if (it != vxy.end()) { int index; index = - vxy.begin(); }
Comments
Post a Comment