[mlpack] How to keep object when searching neighbors?

Ryan Curtin gth671b at mail.gatech.edu
Wed Jan 15 21:12:06 EST 2014


On Thu, Jan 16, 2014 at 09:10:06AM +0800, Li Dong wrote:
> Hi Ryan,
> 
> Thank you for your thorough explanation! I will give MLPACK a try. In
> my simulation, I need two kinds of neighbor searching:
> 
> Transferring information between Tracer and MeshCell. The MeshCell is
> fixed, so I think the tree is fixed too.
> Communication among tracers (e.g., compute physical diffusion). The
> tree for Tracer will be changed each time step.

Yes, you can build a tree on the MeshCell points and then use it
repeatedly for searching.  In this situation I would suggest using the
NeighborSearch object in single-tree mode, so that no tree is built on
the query points (the Tracer points), which will change each iteration.

Or am I misunderstanding?  Are you trying to find the Tracer neighbors
of the MeshCell points or the MeshCell neighbors of the Tracer points?

> In addition, I need the mesh cell neighbors of a tracer that are
> within a specified radius (say R). Actually, after finding them, I
> also need to use some shape (or kernel) function to calculate weights.
> Does MLPACK provide such searching without just returning K nearest
> neighbors? Or do I need to make some changes on the template parameter
> (NearestNeighborSearch)? Could I use the shape function directly
> (There may be problem, since the shape function depends on the
> tracer’s properties.)?

You can use the RangeSearch class to find all the neighbors of a tracer
in a specified radius.

If the shape function is a metric then you can create a metric class
using your shape function and use that, but if the shape function is
different for each tracer that won't work.

Thanks,

Ryan

-- 
Ryan Curtin    | "Reprogram him!"
ryan at ratml.org |   - Master Control Program


More information about the mlpack mailing list