[mlpack] 20/324: more R tree stuff. Still no build

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit c9963e9e5fdf541763b3214ab177e91554f6696c
Author: andrewmw94 <andrewmw94 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Mon May 26 15:33:19 2014 +0000

    more R tree stuff.  Still no build
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16551 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 .../tree/rectangle_tree/rectangle_tree_impl.hpp    | 113 ++++++++++++++++++++-
 1 file changed, 111 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
index df48dcb..ed18b46 100644
--- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
+++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree_impl.hpp
@@ -77,8 +77,8 @@ size_t RectangleTree<StatisticType, MatType, SplitType>::
 }
 
 template<typename StatisticType,
-         	typename MatType,
-         	typename SplitType>
+         typename MatType,
+         typename SplitType>
 inline bool BinarySpaceTree<StatisticType, MatType, SplitType>::
     IsLeaf() const
 {
@@ -86,6 +86,115 @@ inline bool BinarySpaceTree<StatisticType, MatType, SplitType>::
 }
 
 /**
+ * Returns the number of children in this node.
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline size_t RectangleTree<StatisticType, MatType, SplitType>::
+    NumChildren() const
+{
+  return NumChildren;
+}
+
+/**
+ * Return a bound on the furthest point in the node form the centroid.
+ * This returns 0 unless the node is a leaf.
+ */
+template<typename StatisticType,
+         typename MatType,
+         typename SplitType>
+inline double RectangleTree<StatisticType, MatType, SplitType>::
+FurthestPointDistance() const
+{
+  if(!IsLeaf())
+    return 0.0;
+
+  // Otherwise return the distance from the centroid to a corner of the bound.
+  return 0.5 * bound.Diameter();
+}
+
+/**
+ * Return the furthest possible descendant distance.  This returns the maximum
+ * distance from the centroid to the edge of the bound and not the empirical
+ * quantity which is the actual furthest descendant distance.  So the actual
+ * furthest descendant distance may be less than what this method returns (but
+ * it will never be greater than this).
+ */
+template<typename StatisiticType,
+	 typename MatType,
+	 typename SplitType>
+inline double RectangleTree<StatisticType, MatType, SplitType>::
+    FurthestDescendantDistance() const
+{
+  return furthestDescendantDistance;
+}
+
+/**
+ * Return the specified child.
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline RectangleTree<StatisticType, MatType, SplitType>&
+    RectangleTree<StatisticType, MatType, SplitType>::
+        Child(const size_t child) const
+{
+  return children[child];
+}
+
+/**
+ * Return the number of points contained in this node.  Zero if it is not a leaf.
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline size_t RectangleTree<StatisticType, MatType, SplitType>::
+    NumPoints() const
+{
+  if(numChildren == 0)
+    return 0;
+
+  return count;
+}
+
+/**
+ * Return the number of descendants contained in this node.  MEANINIGLESS AS IT CURRENTLY STANDS.
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline size_t RectangleTree<StatisticType, MatType, SplitType>::
+    NumDescendants() const
+{
+  return count;
+}
+
+/**
+ * Return the index of a particular descendant contained in this node.  SEE OTHER WARNINGS
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline size_t RectangleTree<StatisticType, MatType, SplitType>::
+    Descendant(const size_t index> const
+{
+  return (begin + index);
+}
+
+/**
+ * Return the index of a particular point contained in this node.  SEE OTHER WARNINGS
+ */
+template<typename StatisticType,
+	 typename MatType,
+	 typename SplitType>
+inline size_t RectangleTree<StatisticType, MatType, SplitType>::
+    Point(const size_t index> const
+{
+  return (begin + index);
+}
+
+/**
  * Return the last point in the tree.  SINCE THE TREE STORES DATA SEPARATELY IN EACH LEAF
  * THIS IS CURRENTLY MEANINGLESS.
  */

-- 
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