[mlpack-git] master: Add a new TreeTraits's member: HasDuplicatedPoints. (cccf0aa)

gitdub at mlpack.org gitdub at mlpack.org
Tue Aug 23 15:58:25 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/1148f1652e139c9037eb3813550090313d089a30...a8a8a1381b529a01420de6e792a4a1e7bd58a626

>---------------------------------------------------------------

commit cccf0aa19d145927e352fee68bdd2bff90ab4352
Author: MarcosPividori <marcos.pividori at gmail.com>
Date:   Mon Aug 1 01:01:41 2016 -0300

    Add a new TreeTraits's member: HasDuplicatedPoints.


>---------------------------------------------------------------

cccf0aa19d145927e352fee68bdd2bff90ab4352
 src/mlpack/core/tree/binary_space_tree/traits.hpp |  8 ++++----
 src/mlpack/core/tree/cover_tree/traits.hpp        |  6 ++++++
 src/mlpack/core/tree/rectangle_tree/traits.hpp    | 10 ++++++++++
 src/mlpack/core/tree/tree_traits.hpp              |  5 +++++
 4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/core/tree/binary_space_tree/traits.hpp b/src/mlpack/core/tree/binary_space_tree/traits.hpp
index f5dc4ac..b47e192 100644
--- a/src/mlpack/core/tree/binary_space_tree/traits.hpp
+++ b/src/mlpack/core/tree/binary_space_tree/traits.hpp
@@ -37,14 +37,14 @@ class TreeTraits<BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
   static const bool HasOverlappingChildren = false;
 
   /**
-   * There is no guarantee that the first point in a node is its centroid.
+   * Each binary space tree node doesn't share points with any other node.
    */
-  static const bool FirstPointIsCentroid = false;
+  static const bool HasDuplicatedPoints = false;
 
   /**
-   * The tree has not got duplicated points.
+   * There is no guarantee that the first point in a node is its centroid.
    */
-  static const bool HasDuplicatedPoints = false;
+  static const bool FirstPointIsCentroid = false;
 
   /**
    * Points are not contained at multiple levels of the binary space tree.
diff --git a/src/mlpack/core/tree/cover_tree/traits.hpp b/src/mlpack/core/tree/cover_tree/traits.hpp
index 9f2fb80..1e3aefa 100644
--- a/src/mlpack/core/tree/cover_tree/traits.hpp
+++ b/src/mlpack/core/tree/cover_tree/traits.hpp
@@ -33,6 +33,12 @@ class TreeTraits<CoverTree<MetricType, StatisticType, MatType, RootPointPolicy>>
   static const bool HasOverlappingChildren = true;
 
   /**
+   * Cover trees do have self-children, so points can be included in more than
+   * one node.
+   */
+  static const bool HasDuplicatedPoints = true;
+
+  /**
    * Each cover tree node contains only one point, and that point is its
    * centroid.
    */
diff --git a/src/mlpack/core/tree/rectangle_tree/traits.hpp b/src/mlpack/core/tree/rectangle_tree/traits.hpp
index 72bb737..e592b5d 100644
--- a/src/mlpack/core/tree/rectangle_tree/traits.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/traits.hpp
@@ -34,6 +34,11 @@ class TreeTraits<RectangleTree<MetricType, StatisticType, MatType, SplitType,
   static const bool HasOverlappingChildren = true;
 
   /**
+   * An R-tree node doesn't share points with another node.
+   */
+  static const bool HasDuplicatedPoints = false;
+
+  /**
    * There is no guarantee that the first point in a node is its centroid.
    */
   static const bool FirstPointIsCentroid = false;
@@ -88,6 +93,11 @@ class TreeTraits<RectangleTree<MetricType,
   static const bool HasOverlappingChildren = false;
 
   /**
+   * An R-tree node doesn't share points with another node.
+   */
+  static const bool HasDuplicatedPoints = false;
+
+  /**
    * There is no guarantee that the first point in a node is its centroid.
    */
   static const bool FirstPointIsCentroid = false;
diff --git a/src/mlpack/core/tree/tree_traits.hpp b/src/mlpack/core/tree/tree_traits.hpp
index c44b985..b00a186 100644
--- a/src/mlpack/core/tree/tree_traits.hpp
+++ b/src/mlpack/core/tree/tree_traits.hpp
@@ -79,6 +79,11 @@ class TreeTraits
   static const bool HasOverlappingChildren = true;
 
   /**
+   * This is true if a point can be included in more than one node.
+   */
+  static const bool HasDuplicatedPoints = false;
+
+  /**
    * This is true if the first point of each node is the centroid of its bound.
    */
   static const bool FirstPointIsCentroid = false;




More information about the mlpack-git mailing list