[mlpack-git] [mlpack/mlpack] Universal B tree implementation (#746)
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlpack-git