[mlpack-svn] r12692 - mlpack/trunk/src/mlpack/core/tree
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed May 16 14:46:38 EDT 2012
Author: rcurtin
Date: 2012-05-16 14:46:38 -0400 (Wed, 16 May 2012)
New Revision: 12692
Modified:
mlpack/trunk/src/mlpack/core/tree/cover_tree.hpp
Log:
Add a preferred dual tree traverser.
Modified: mlpack/trunk/src/mlpack/core/tree/cover_tree.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/tree/cover_tree.hpp 2012-05-16 18:44:38 UTC (rev 12691)
+++ mlpack/trunk/src/mlpack/core/tree/cover_tree.hpp 2012-05-16 18:46:38 UTC (rev 12692)
@@ -11,7 +11,9 @@
#include <mlpack/core/metrics/lmetric.hpp>
#include "first_point_is_root.hpp"
#include "traversers/single_tree_breadth_first_traverser.hpp"
+#include "traversers/dual_cover_tree_traverser.hpp"
#include "statistic.hpp"
+#include <mlpack/methods/neighbor_search/neighbor_search_cover_rules.hpp>
namespace mlpack {
namespace tree {
@@ -158,6 +160,25 @@
> Type;
};
+ template<typename RuleType>
+ struct PreferredDualTraverser
+ {
+ typedef DualCoverTreeTraverser<
+ CoverTree<MetricType, RootPointPolicy, StatisticType>,
+ RuleType
+ > Type;
+ };
+
+ template<typename SortPolicy, typename Metric2Type, typename TreeType>
+ struct PreferredRules
+ {
+ typedef neighbor::NeighborSearchCoverRules<
+ SortPolicy,
+ Metric2Type,
+ TreeType
+ > Type;
+ };
+
//! Get a reference to the dataset.
const arma::mat& Dataset() const { return dataset; }
@@ -183,6 +204,11 @@
//! Get the number of children.
size_t NumChildren() const { return children.size(); }
+ //! Get the children.
+ const std::vector<CoverTree*>& Children() const { return children; }
+ //! Modify the children manually (maybe not a great idea).
+ std::vector<CoverTree*>& Children() { return children; }
+
//! Get the scale of this node.
int Scale() const { return scale; }
//! Modify the scale of this node. Be careful...
More information about the mlpack-svn
mailing list