I'm looking to have a reverse lookup of a 2D table i.e. Table: F(x,y), given F, find x and y
My current method uses a nested for loop to search the table for all x's and y's to find F within some error. The complication here is that the queried "F" may not be a perfect match for the "F" in my lookup table. I also have NaNs in my table. I'm hoping to have this program find the nearest "F" to the queried "F".
The table is currently a 2D array, but I'm thinking a map may be more appropriate here. I know how to create a multidimensional map from this: https://www.geeksforgeeks.org/implementing-multidimensional-map-in-c/
I also found some great answers (@Rob's specifically) on how to have a reverse map lookup for a 1D map using Boost here: Reverse map lookup
I'm having some trouble combining the two methods, as well as having a findNearest feature.