[mlpack-svn] r16278 - in mlpack/trunk/src/mlpack: core/tree tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 11 10:08:25 EST 2014
Author: rcurtin
Date: Tue Feb 11 10:08:25 2014
New Revision: 16278
Log:
Revert commit by unknown contributor.
Modified:
mlpack/trunk/src/mlpack/core/tree/ballbound.hpp
mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp
mlpack/trunk/src/mlpack/tests/CMakeLists.txt
Modified: mlpack/trunk/src/mlpack/core/tree/ballbound.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/ballbound.hpp (original)
+++ mlpack/trunk/src/mlpack/core/tree/ballbound.hpp Tue Feb 11 10:08:25 2014
@@ -19,13 +19,10 @@
*
* @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:
@@ -41,15 +38,7 @@
* @param dimension Dimensionality of ball bound.
*/
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.
*
Modified: mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp (original)
+++ mlpack/trunk/src/mlpack/core/tree/ballbound_impl.hpp Tue Feb 11 10:08:25 2014
@@ -18,8 +18,8 @@
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 @@
/**
* 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 @@
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
*
* 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 @@
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 @@
/**
* 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 @@
/**
* 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;
Modified: mlpack/trunk/src/mlpack/tests/CMakeLists.txt
==============================================================================
--- mlpack/trunk/src/mlpack/tests/CMakeLists.txt (original)
+++ mlpack/trunk/src/mlpack/tests/CMakeLists.txt Tue Feb 11 10:08:25 2014
@@ -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-svn
mailing list