![]() Registered Member ![]()
|
Cannot compile the following code,
After insertion, I may need to get the index of the matching pair. This should be performed really fast and I have no clue right now. CXXFLAGS = -std=c++1y -O3 -ffast-math -fno-cx-limited-range -funroll-loops --param max-unroll-times=2 -march=native gcc version: 8.3.0 (Debian 8.3.0-6) eigen version: 3.3.7-1
Last edited by -jomegaA on Thu May 09, 2019 9:46 am, edited 1 time in total.
|
![]() Registered Member ![]()
|
All the pairs are added once. It is the searching of a pair that is performed millions of times.
A fast searching method is also I am looking forward... |
![]() Registered Member ![]()
|
If you can allow some more up-front calculations, then after creating the set:
sort it (std::sort) then lookup using binary search, http://www.cplusplus.com/reference/algorithm/binary_search/ |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell