[mlpack-git] [mlpack/mlpack] Vantage point tree (#708)

Ryan Curtin notifications at github.com
Thu Jul 21 19:13:44 EDT 2016


> @@ -492,6 +492,10 @@ class RectangleTree
>    //! Returns false: this tree type does not have self children.
>    static bool HasSelfChildren() { return false; }
>  
> +  //! Returns false: The first point of this node is not the centroid
> +  //! of its bound.
> +  static constexpr bool IsFirstPointCentroid() { return false; }

The idea I had here for `IsFirstPointCentroid()` was to leave it a part of `TreeTraits`, but just to make it a function:

```
template<typename TreeType>
struct TreeTraits
{
  static constexpr bool FirstPointIsCentroid(TreeType*) { return false; }
  ...
}
```

and then for the VP tree we can specialize and make it non-constexpr:

```
template<>
struct TreeTraits<VPTree>
{
  static bool FirstPointIsCentroid(VPTree* v) { ... }
}
```

It changes the syntax of all of the traits, but it keeps them out of the definition of each tree itself, and we are guaranteed that there is a value for these even if the person who wrote the tree did not specify them.  Does that seem reasonable to you?

---
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/708/files/300882ac96e7a663e3e303ca0c45c14c6fafe1a6#r71804116
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160721/9124838b/attachment.html>


More information about the mlpack-git mailing list