I need to store points from [0, 1)^d and query the data structure for either the k-nearest points or all points with difference less than a given epsilon; both relative to some reference point y.
Now the crucial thing is that I do not want to use Euclidean distance, but a toroidal distance (i.e. with a wrap arround occurring at the borders of [0, 1)^d.
I‘ve previously used boost::geometry::index::rtree for that, but I need to query this with boost::geometry::index::satisfies and that is really slow. The only thing which is fast is boost::geometry::index::nearest, but this is relative to Euclidean distance.
I guess I really need a data structure which is designed to store points with the toroidal topology. Is there already somethinh out there or do I need to implement this on my own?