[mlpack] 44/324: add the missed files.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:54 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 c7539000849e2fb0a5fa745c0028508ce71bff1a
Author: andrewmw94 <andrewmw94 at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Wed Jun 4 18:20:24 2014 +0000

    add the missed files.
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16631 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 .../rectangle_tree/r_tree_descent_heuristic.hpp    | 42 ++++++++++++++++++++++
 .../r_tree_descent_heuristic_impl.hpp              | 30 ++++++++++++++++
 2 files changed, 72 insertions(+)

diff --git a/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp b/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp
new file mode 100644
index 0000000..40e07b4
--- /dev/null
+++ b/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic.hpp
@@ -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
diff --git a/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp b/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp
new file mode 100644
index 0000000..0df3110
--- /dev/null
+++ b/src/mlpack/core/tree/rectangle_tree/r_tree_descent_heuristic_impl.hpp
@@ -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

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