[mlpack] 25/35: Fix TreeTrait for BallTree.
Barak A. Pearlmutter
barak+git at pearlmutter.net
Thu Sep 15 23:29:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
bap pushed a commit to branch master
in repository mlpack.
commit 58523f0c4bc78e110ca337b9e6014407f40e2611
Author: MarcosPividori <marcos.pividori at gmail.com>
Date: Tue Jul 19 10:09:49 2016 -0300
Fix TreeTrait for BallTree.
---
src/mlpack/core/tree/binary_space_tree/traits.hpp | 24 +++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/mlpack/core/tree/binary_space_tree/traits.hpp b/src/mlpack/core/tree/binary_space_tree/traits.hpp
index 2a1dc21..ced4aea 100644
--- a/src/mlpack/core/tree/binary_space_tree/traits.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/traits.hpp
@@ -15,6 +15,7 @@
#define MLPACK_CORE_TREE_BINARY_SPACE_TREE_TRAITS_HPP
#include <mlpack/core/tree/tree_traits.hpp>
+#include <mlpack/core/tree/ballbound.hpp>
namespace mlpack {
namespace tree {
@@ -63,6 +64,29 @@ class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
static const bool BinaryTree = true;
};
+/**
+ * This is a specialization of the TreeType class to the BallTree tree type.
+ * The only difference with general BinarySpaceTree is that BallTree can have
+ * overlapping children.
+ * See mlpack/core/tree/tree_traits.hpp for more information.
+ */
+template<typename MetricType,
+ typename StatisticType,
+ typename MatType,
+ template<typename SplitBoundType, typename SplitMatType>
+ class SplitType>
+class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType,
+ bound::BallBound, SplitType>>
+{
+ public:
+ static const bool HasOverlappingChildren = true;
+ static const bool HasDuplicatedPoints = false;
+ static const bool FirstPointIsCentroid = false;
+ static const bool HasSelfChildren = false;
+ static const bool RearrangesDataset = true;
+ static const bool BinaryTree = true;
+};
+
} // namespace tree
} // namespace mlpack
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git
More information about the debian-science-commits
mailing list