[mlpack-svn] r16319 - mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Feb 19 19:32:18 EST 2014


Author: rcurtin
Date: Wed Feb 19 19:32:17 2014
New Revision: 16319

Log:
Templatize arguments for BestPointToNodeDistance().


Modified:
   mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp
   mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp	Wed Feb 19 19:32:17 2014
@@ -97,8 +97,8 @@
    * this is the maximum distance between the tree node and the point using the
    * given distance function.
    */
-  template<typename TreeType>
-  static double BestPointToNodeDistance(const arma::vec& queryPoint,
+  template<typename VecType, typename TreeType>
+  static double BestPointToNodeDistance(const VecType& queryPoint,
                                         const TreeType* referenceNode);
 
   /**
@@ -107,8 +107,8 @@
    * calculated.  This is used in conjunction with trees that have
    * self-children (like cover trees).
    */
-  template<typename TreeType>
-  static double BestPointToNodeDistance(const arma::vec& queryPoint,
+  template<typename VecType, typename TreeType>
+  static double BestPointToNodeDistance(const VecType& queryPoint,
                                         const TreeType* referenceNode,
                                         const double pointToCenterDistance);
 

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp	Wed Feb 19 19:32:17 2014
@@ -41,9 +41,9 @@
       referenceChildNode->ParentDistance();
 }
 
-template<typename TreeType>
+template<typename VecType, typename TreeType>
 inline double FurthestNeighborSort::BestPointToNodeDistance(
-    const arma::vec& point,
+    const VecType& point,
     const TreeType* referenceNode)
 {
   // This is not implemented yet for the general case because the trees do not
@@ -51,9 +51,9 @@
   return referenceNode->MaxDistance(point);
 }
 
-template<typename TreeType>
+template<typename VecType, typename TreeType>
 inline double FurthestNeighborSort::BestPointToNodeDistance(
-    const arma::vec& point,
+    const VecType& point,
     const TreeType* referenceNode,
     const double pointToCenterDistance)
 {

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp	Wed Feb 19 19:32:17 2014
@@ -100,8 +100,8 @@
    * this is the minimum distance between the tree node and the point using the
    * given distance function.
    */
-  template<typename TreeType>
-  static double BestPointToNodeDistance(const arma::vec& queryPoint,
+  template<typename VecType, typename TreeType>
+  static double BestPointToNodeDistance(const VecType& queryPoint,
                                         const TreeType* referenceNode);
 
   /**
@@ -110,8 +110,8 @@
    * calculated.  This is used in conjunction with trees that have
    * self-children (like cover trees).
    */
-  template<typename TreeType>
-  static double BestPointToNodeDistance(const arma::vec& queryPoint,
+  template<typename VecType, typename TreeType>
+  static double BestPointToNodeDistance(const VecType& queryPoint,
                                         const TreeType* referenceNode,
                                         const double pointToCenterDistance);
 

Modified: mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp	Wed Feb 19 19:32:17 2014
@@ -41,9 +41,9 @@
       referenceChildNode->ParentDistance();
 }
 
-template<typename TreeType>
+template<typename VecType, typename TreeType>
 inline double NearestNeighborSort::BestPointToNodeDistance(
-    const arma::vec& point,
+    const VecType& point,
     const TreeType* referenceNode)
 {
   // This is not implemented yet for the general case because the trees do not
@@ -51,9 +51,9 @@
   return referenceNode->MinDistance(point);
 }
 
-template<typename TreeType>
+template<typename VecType, typename TreeType>
 inline double NearestNeighborSort::BestPointToNodeDistance(
-    const arma::vec& point,
+    const VecType& point,
     const TreeType* referenceNode,
     const double pointToCenterDistance)
 {



More information about the mlpack-svn mailing list