[mlpack-svn] r16315 - mlpack/trunk/src/mlpack/core/tree/binary_space_tree

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


Author: rcurtin
Date: Wed Feb 19 19:21:29 2014
New Revision: 16315

Log:
Refactor MinDistance(), MaxDistance(), and RangeDistance() to accept any
Armadillo vector type.


Modified:
   mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree.hpp

Modified: mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/tree/binary_space_tree/binary_space_tree.hpp	Wed Feb 19 19:21:29 2014
@@ -364,19 +364,28 @@
   }
 
   //! Return the minimum distance to another point.
-  double MinDistance(const arma::vec& point) const
+  template<typename VecType>
+  double MinDistance(const VecType& point,
+                     typename boost::enable_if<IsVector<VecType> >::type* = 0)
+      const
   {
     return bound.MinDistance(point);
   }
 
   //! Return the maximum distance to another point.
-  double MaxDistance(const arma::vec& point) const
+  template<typename VecType>
+  double MaxDistance(const VecType& point,
+                     typename boost::enable_if<IsVector<VecType> >::type* = 0)
+      const
   {
     return bound.MaxDistance(point);
   }
 
   //! Return the minimum and maximum distance to another point.
-  math::Range RangeDistance(const arma::vec& point) const
+  template<typename VecType>
+  math::Range
+  RangeDistance(const VecType& point,
+                typename boost::enable_if<IsVector<VecType> >::type* = 0) const
   {
     return bound.RangeDistance(point);
   }



More information about the mlpack-svn mailing list