[mlpack-svn] r16631 - mlpack/trunk/src/mlpack/core/tree/rectangle_tree

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jun 4 14:20:24 EDT 2014


Author: andrewmw94
Date: Wed Jun  4 14:20:24 2014
New Revision: 16631

Log:
add the missed files.

Added:
   mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp
   mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp

Added: mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp
==============================================================================
--- (empty file)
+++ mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp	Wed Jun  4 14:20:24 2014
@@ -0,0 +1,42 @@
+/**
+ * @file r_tree_descent_heuristic.hpp
+ * @author Andrew Wells
+ *
+ * Definition of RTreeDescentHeuristic, a class that chooses the best child of a node in
+ * an R tree when inserting a new point.
+ */
+#ifndef __MLPACK_CORE_TREE_RECTANGLE_TREE_R_TREE_DESCENT_HEURISTIC.HPP
+#define __MLPACK_CORE_TREE_RECTANGLE_TREE_R_TREE_DESCENT_HEURISTIC.HPP
+
+#include <mlpack/core.hpp>
+
+namespace mlpack {
+namespace tree /** Trees and tree-building procedures. */ {
+
+/**
+ * A binary space partitioning tree node is split into its left and right child.
+ * The split is done in the dimension that has the maximum width. The points are
+ * divided into two parts based on the mean in this dimension.
+ */
+template<typename BoundType, typename MatType = arma::mat>
+class RTreeDescentHueristic
+{
+ public:
+  /**
+   * Evaluate the node using a hueristic.  The heuristic guarantees two things:
+   * 1.  If point is contained in (or on) bound, the value returned is zero.
+   * 2.  If the point is not contained in (or on) bound, the value returned is greater than zero. 
+   *
+   * @param bound The bound used for the node that is being evaluated.
+   * @param point The point that is being inserted.
+   */
+  static double EvalNode(const BoundType& bound, const arma::vec& point);
+};
+
+}; // namespace tree
+}; // namespace mlpack
+
+// Include implementation.
+#include "r_tree_descent_heuristic_impl.hpp"
+
+#endif
\ No newline at end of file

Added: mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp
==============================================================================
--- (empty file)
+++ mlpack/trunk/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp	Wed Jun  4 14:20:24 2014
@@ -0,0 +1,30 @@
+/**
+ * @file r_tree_descent_heuristic_impl.hpp
+ * @author Andrew Wells
+ *
+ * Definition of RTreeDescentHeuristic, a class that chooses the best child of a node in
+ * an R tree when inserting a new point.
+ */
+#ifndef __MLPACK_CORE_TREE_RECTANGLE_TREE_R_TREE_DESCENT_HEURISTIC_IMPL.HPP
+#define __MLPACK_CORE_TREE_RECTANGLE_TREE_R_TREE_DESCENT_HEURISTIC_IMPL.HPP
+
+#include "r_tree_descent_heuristic.hpp"
+
+namespace mlpack {
+namespace tree {
+
+/**
+ * A binary space partitioning tree node is split into its left and right child.
+ * The split is done in the dimension that has the maximum width. The points are
+ * divided into two parts based on the mean in this dimension.
+ */
+template<typename BoundType, typename MatType = arma::mat>
+double RTreeDescentHeuristic<BoundType, MatType>::EvalNode(const BoundType& bound, const arma::vec& point)
+{
+  return bound.contains(point) ? 0 : bound.minDistance(point);
+}
+
+}; // namespace tree
+}; // namespace mlpack
+
+#endif



More information about the mlpack-svn mailing list