[mlpack-git] master,mlpack-1.0.x: add the missed files. (b6f9e01)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:48:31 EST 2015


Repository : https://github.com/mlpack/mlpack

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit b6f9e01c51921e05140ab0ab7b6114c10c409251
Author: andrewmw94 <andrewmw94 at gmail.com>
Date:   Wed Jun 4 18:20:24 2014 +0000

    add the missed files.


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

b6f9e01c51921e05140ab0ab7b6114c10c409251
 .../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



More information about the mlpack-git mailing list