[mlpack-git] [mlpack/mlpack] General greedy traverser. (#762)

Ryan Curtin notifications at github.com
Fri Aug 19 09:11:44 EDT 2016


> +    RuleType& rule) :
> +    rule(rule),
> +    numPrunes(0)
> +{ /* Nothing to do. */ }
> +
> +template<typename TreeType, typename RuleType>
> +void GreedySingleTreeTraverser<TreeType, RuleType>::Traverse(
> +    const size_t queryIndex,
> +    TreeType& referenceNode)
> +{
> +  // If we have reached a leaf node, run the base case as necessary.
> +  if (referenceNode.IsLeaf())
> +  {
> +    for (size_t i = 0; i < referenceNode.NumPoints(); ++i)
> +      rule.BaseCase(queryIndex, referenceNode.Point(i));
> +  }

I think we should do all base cases regardless of whether or not we are a leaf, since some nodes may hold points in non-leaf nodes. Of the trees we have implemented now I believe that only applies to the cover tree, but more may be implemented in the future that also have that property.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/762/files/0484cfda36ef33e7b8ca5db46b7360369af161cc#r75478487
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160819/943707e3/attachment.html>


More information about the mlpack-git mailing list