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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -