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

Ryan Curtin notifications at github.com
Fri Aug 19 15:04:24 EDT 2016


> +  template<typename VecType>
> +  BinarySpaceTree& GetFurthestChild(
> +      const VecType& point,
> +      typename boost::enable_if<IsVector<VecType> >::type* = 0);
> +
> +  /**
> +   * Return the nearest child node to the given query node.  If it can't decide
> +   * it will return a null pointer.
> +   */
> +  BinarySpaceTree* GetNearestChild(const BinarySpaceTree& queryNode);
> +
> +  /**
> +   * Return the furthest child node to the given query node.  If it can't decide
> +   * it will return a null pointer.
> +   */
> +  BinarySpaceTree* GetFurthestChild(const BinarySpaceTree& queryNode);

I don't think you're using these overloads anywhere. Can I suggest returning a `size_t` instead of a reference or pointer? You can return `NumChildren()` to indicate an invalid child. This avoids the issues with returning `*this` and there's never a need to return `NULL`. The user can check on their own whether or not the results are valid and we also manage to keep our TreeType API simpler. What do you think?

-- 
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/f8ddd58ece06362024944a6533f68074a6b27ef7#r75535801
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160819/2be44429/attachment.html>


More information about the mlpack-git mailing list