[mlpack] Range search with periodic boundary conditions

Ryan Curtin ryan at ratml.org
Mon May 11 22:45:58 EDT 2015


On Tue, May 12, 2015 at 06:45:43AM +0800, 董理 wrote:
> Dear Ryan,
> 
> Thanks for your reply! I searched out on the internet, and found the following question:
> 
> http://stackoverflow.com/questions/6917664/nearest-neighbor-search-with-periodic-boundary-conditions <http://stackoverflow.com/questions/6917664/nearest-neighbor-search-with-periodic-boundary-conditions>
> 
> It seems ‘cover tree’ can be used for periodic boundary condition. I see there already is an implementation of cover tree. Could I use it?

Yes, you could do that also; I didn't think of that.  If you write a
periodic metric (and it satisfies the conditions of a metric,
importantly, the triangle inequality; I haven't thought about this),
then you can plug that in as the MetricType template parameter to the
CoverTree class, and then use that with the NeighborSearch class and you
will get your results correctly.

-- 
Ryan Curtin    | "No... not without incident."
ryan at ratml.org |   - John Preston



More information about the mlpack mailing list