[mlpack-git] master, mlpack-1.0.x: Revert commit by unknown contributor. (f6d4008)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:43:35 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 f6d4008b6f3ac45b234c735c9ad3dbaef54426be
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Feb 11 15:08:25 2014 +0000
Revert commit by unknown contributor.
>---------------------------------------------------------------
f6d4008b6f3ac45b234c735c9ad3dbaef54426be
src/mlpack/core/tree/ballbound.hpp | 13 +--------
src/mlpack/core/tree/ballbound_impl.hpp | 47 +++++++++++++++++----------------
src/mlpack/tests/CMakeLists.txt | 5 ----
3 files changed, 25 insertions(+), 40 deletions(-)
diff --git a/src/mlpack/core/tree/ballbound.hpp b/src/mlpack/core/tree/ballbound.hpp
index eb966bc..581b37a 100644
--- a/src/mlpack/core/tree/ballbound.hpp
+++ b/src/mlpack/core/tree/ballbound.hpp
@@ -19,13 +19,10 @@ namespace bound {
*
* @tparam VecType Type of vector (arma::vec or arma::spvec).
*/
-template<typename VecType = arma::vec , int Power = 2, bool TakeRoot = true>
+template<typename VecType = arma::vec>
class BallBound
{
public:
- //! This is the metric type that this bound is using.
- typedef metric::LMetric<Power, TakeRoot> MetricType;
-
typedef VecType Vec;
private:
@@ -42,14 +39,6 @@ class BallBound
*/
BallBound(const size_t dimension) : radius(0), center(dimension) { }
-
- /**
- * Return the metric associated with this bound. Because it is an LMetric, it
- * cannot store state, so we can make it on the fly. It is also static
- * because the metric is only dependent on the template arguments.
- */
- static MetricType Metric() { return metric::LMetric<Power, TakeRoot>(); }
-
/**
* Create the ball bound with the specified radius and center.
*
diff --git a/src/mlpack/core/tree/ballbound_impl.hpp b/src/mlpack/core/tree/ballbound_impl.hpp
index 7f5bf89..649e094 100644
--- a/src/mlpack/core/tree/ballbound_impl.hpp
+++ b/src/mlpack/core/tree/ballbound_impl.hpp
@@ -18,8 +18,8 @@ namespace mlpack {
namespace bound {
//! Get the range in a certain dimension.
-template<typename VecType , int Power, bool TakeRoot>
-math::Range BallBound<VecType, Power , TakeRoot>::operator[](const size_t i) const
+template<typename VecType>
+math::Range BallBound<VecType>::operator[](const size_t i) const
{
if (radius < 0)
return math::Range();
@@ -30,8 +30,8 @@ math::Range BallBound<VecType, Power , TakeRoot>::operator[](const size_t i) con
/**
* Determines if a point is within the bound.
*/
-template<typename VecType, int Power, bool TakeRoot>
-bool BallBound<VecType,Power,TakeRoot>::Contains(const VecType& point) const
+template<typename VecType>
+bool BallBound<VecType>::Contains(const VecType& point) const
{
if (radius < 0)
return false;
@@ -46,8 +46,8 @@ bool BallBound<VecType,Power,TakeRoot>::Contains(const VecType& point) const
* with DHrectBound, so it can plug in more directly if a "centroid"
* is needed.
*/
-template<typename VecType,int Power, bool TakeRoot>
-void BallBound<VecType, Power, TakeRoot>::CalculateMidpoint(VecType& centroid) const
+template<typename VecType>
+void BallBound<VecType>::CalculateMidpoint(VecType& centroid) const
{
centroid = center;
}
@@ -55,8 +55,8 @@ void BallBound<VecType, Power, TakeRoot>::CalculateMidpoint(VecType& centroid) c
/**
* Calculates minimum bound-to-point squared distance.
*/
-template<typename VecType, int Power, bool TakeRoot>
-double BallBound<VecType, Power , TakeRoot>::MinDistance(const VecType& point) const
+template<typename VecType>
+double BallBound<VecType>::MinDistance(const VecType& point) const
{
if (radius < 0)
return DBL_MAX;
@@ -68,8 +68,8 @@ double BallBound<VecType, Power , TakeRoot>::MinDistance(const VecType& point) c
/**
* Calculates minimum bound-to-bound squared distance.
*/
-template<typename VecType, int Power, bool TakeRoot>
-double BallBound<VecType, Power , TakeRoot>::MinDistance(const BallBound& other) const
+template<typename VecType>
+double BallBound<VecType>::MinDistance(const BallBound& other) const
{
if (radius < 0)
return DBL_MAX;
@@ -84,8 +84,8 @@ double BallBound<VecType, Power , TakeRoot>::MinDistance(const BallBound& other)
/**
* Computes maximum distance.
*/
-template<typename VecType, int Power, bool TakeRoot>
-double BallBound<VecType, Power , TakeRoot>::MaxDistance(const VecType& point) const
+template<typename VecType>
+double BallBound<VecType>::MaxDistance(const VecType& point) const
{
if (radius < 0)
return DBL_MAX;
@@ -96,8 +96,8 @@ double BallBound<VecType, Power , TakeRoot>::MaxDistance(const VecType& point) c
/**
* Computes maximum distance.
*/
-template<typename VecType, int Power, bool TakeRoot>
-double BallBound<VecType, Power , TakeRoot>::MaxDistance(const BallBound& other) const
+template<typename VecType>
+double BallBound<VecType>::MaxDistance(const BallBound& other) const
{
if (radius < 0)
return DBL_MAX;
@@ -111,8 +111,8 @@ double BallBound<VecType, Power , TakeRoot>::MaxDistance(const BallBound& other)
*
* Example: bound1.MinDistanceSq(other) for minimum squared distance.
*/
-template<typename VecType, int Power, bool TakeRoot>
-math::Range BallBound<VecType, Power, TakeRoot>::RangeDistance(const VecType& point)
+template<typename VecType>
+math::Range BallBound<VecType>::RangeDistance(const VecType& point)
const
{
if (radius < 0)
@@ -124,8 +124,9 @@ math::Range BallBound<VecType, Power, TakeRoot>::RangeDistance(const VecType& po
dist + radius);
}
}
-template<typename VecType, int Power, bool TakeRoot>
-math::Range BallBound<VecType, Power, TakeRoot>::RangeDistance(
+
+template<typename VecType>
+math::Range BallBound<VecType>::RangeDistance(
const BallBound& other) const
{
if (radius < 0)
@@ -159,10 +160,10 @@ BallBound<VecType>::operator|=(
/**
* Expand the bound to include the given point.
*/
-template<typename VecType , int Power, bool TakeRoot>
+template<typename VecType>
template<typename MatType>
-const BallBound<VecType,Power,TakeRoot>&
-BallBound<VecType,Power, TakeRoot>::operator|=(const MatType& data)
+const BallBound<VecType>&
+BallBound<VecType>::operator|=(const MatType& data)
{
if (radius < 0)
{
@@ -192,8 +193,8 @@ BallBound<VecType,Power, TakeRoot>::operator|=(const MatType& data)
/**
* Returns a string representation of this object.
*/
-template<typename VecType, int Power, bool TakeRoot>
-std::string BallBound<VecType,Power, TakeRoot>::ToString() const
+template<typename VecType>
+std::string BallBound<VecType>::ToString() const
{
std::ostringstream convert;
convert << "BallBound [" << this << "]" << std::endl;
diff --git a/src/mlpack/tests/CMakeLists.txt b/src/mlpack/tests/CMakeLists.txt
index 3d662f3..2bdac06 100644
--- a/src/mlpack/tests/CMakeLists.txt
+++ b/src/mlpack/tests/CMakeLists.txt
@@ -1,9 +1,4 @@
# MLPACK test executable.
-INCLUDE_DIRECTORIES(
- $/usr/include/libxml2/libxml
-)
-
-
add_executable(mlpack_test
mlpack_test.cpp
allkfn_test.cpp
More information about the mlpack-git
mailing list