[mlpack-git] master, mlpack-1.0.x: Templatize arguments for BestPointToNodeDistance(). (3437ce4)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:44:26 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 3437ce4eb9bbccb64ccf655a78984df3d1c4b50f
Author: Ryan Curtin <ryan at ratml.org>
Date: Thu Feb 20 00:32:17 2014 +0000
Templatize arguments for BestPointToNodeDistance().
>---------------------------------------------------------------
3437ce4eb9bbccb64ccf655a78984df3d1c4b50f
.../neighbor_search/sort_policies/furthest_neighbor_sort.hpp | 8 ++++----
.../neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp | 8 ++++----
.../neighbor_search/sort_policies/nearest_neighbor_sort.hpp | 8 ++++----
.../neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp | 8 ++++----
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp b/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp
index a267af2..677a59f 100644
--- a/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp
+++ b/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort.hpp
@@ -97,8 +97,8 @@ class FurthestNeighborSort
* 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 @@ class FurthestNeighborSort
* 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);
diff --git a/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp b/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp
index 1518f7c..dc2fb3f 100644
--- a/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/sort_policies/furthest_neighbor_sort_impl.hpp
@@ -41,9 +41,9 @@ inline double FurthestNeighborSort::BestNodeToNodeDistance(
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 @@ inline double FurthestNeighborSort::BestPointToNodeDistance(
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)
{
diff --git a/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp b/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp
index 5bc127b..02f4ee7 100644
--- a/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp
+++ b/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort.hpp
@@ -100,8 +100,8 @@ class NearestNeighborSort
* 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 @@ class NearestNeighborSort
* 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);
diff --git a/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp b/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp
index 6161b58..7028f8a 100644
--- a/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/sort_policies/nearest_neighbor_sort_impl.hpp
@@ -41,9 +41,9 @@ inline double NearestNeighborSort::BestNodeToNodeDistance(
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 @@ inline double NearestNeighborSort::BestPointToNodeDistance(
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-git
mailing list