[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)

Ryan Curtin notifications at github.com
Thu Aug 25 11:35:41 EDT 2016


> @@ -877,7 +879,43 @@ template<typename MetricType,
>           template<typename BoundMetricType, typename...> class BoundType,
>           template<typename SplitBoundType, typename SplitMatType>
>               class SplitType>
> +size_t BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
> +    SplitType>::PerformSplit(
> +    MatType& data,
> +    const size_t begin,
> +    const size_t count,
> +    const typename UBTreeSplit<BoundType<MetricType>,
> +                               MatType>::SplitInfo& splitInfo)
> +{
> +  return SplitType<BoundType<MetricType>, MatType>::PerformSplit(data, begin,
> +      count, splitInfo);
> +}

Instead of having a specific overload for `UBTreeSplit`, what do you think of this approach instead:

 * Move `BinarySpaceTree::PerformSplit()` (the non-specific version) into the `math` namespace somewhere as an auxiliary standalone function.
 * In `BinarySpaceTree::SplitNode()`, don't call `BinarySpaceTree::PerformSplit()` but instead call `SplitType::PerformSplit()`.
 * In each `SplitType`, `PerformSplit()` can just be a call to the function in the `math` namespace, or in the case of `UBTreeSplit`, it can be the custom strategy you are using there.

What do you think?  If you like it, we can do it.  If you do like it, I can do the refactoring or you can, it's your choice. :)

-- 
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/746/files/f17843fc8e8ef2b1c4b04d572c521575f20a1f3c#r76267351
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160825/898bb785/attachment-0001.html>


More information about the mlpack-git mailing list