[mlpack] How to keep object when searching neighbors?

Li Dong dongli at lasg.iap.ac.cn
Thu Jan 16 19:04:36 EST 2014


Thanks! That helps me!

> 在 2014年1月16日,下午11:10,Ryan Curtin <gth671b at mail.gatech.edu> 写道:
> 
>> On Thu, Jan 16, 2014 at 01:15:42PM +0800, Li Dong wrote:
>> So the constructor should look like this?
>> 
>> RangeSearch (referenceTree, NULL, referenceSet, querySet, true)
>> 
>> where ‘querySet' is used as the query dataset?
>> 
>> It would be convenient that the reference dataset can be kept across the call of Search(…), and we can pass query dataset when calling Search(…).
> 
> I'm still not sure why you're not calling the constructor I suggested,
> but what you wrote will work.  The RangeSearch object holds a reference
> to the querySet matrix (it does not copy it), so you can modify the
> querySet matrix between runs and then call Search() and it will still
> work.  However note that this will *only* work in single-tree mode,
> because it does not build a tree on the query points.  If a tree was
> built on the query points it would be incorrect when you updated the
> query points.
> 
> Does that help?
> 
> -- 
> Ryan Curtin    | "Exterminate all rational thought."
> ryan at ratml.org |   - Bill Lee



More information about the mlpack mailing list