[mlpack-svn] r10762 - mlpack/trunk/src/mlpack/methods/emst
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Dec 14 03:04:33 EST 2011
Author: rcurtin
Date: 2011-12-14 03:04:33 -0500 (Wed, 14 Dec 2011)
New Revision: 10762
Modified:
mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp
Log:
New Statistic API.
Modified: mlpack/trunk/src/mlpack/methods/emst/dtb.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb.hpp 2011-12-14 08:04:13 UTC (rev 10761)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb.hpp 2011-12-14 08:04:33 UTC (rev 10762)
@@ -57,14 +57,16 @@
/**
* An initializer for leaves.
*/
- DTBStat(const arma::mat& dataset, size_t start, size_t count);
+ template<typename MatType>
+ DTBStat(const MatType& dataset, const size_t start, const size_t count);
/**
* An initializer for non-leaves. Simply calls the leaf initializer.
*/
- DTBStat(const arma::mat& dataset, size_t start, size_t count,
- const DTBStat& left_stat, const DTBStat& right_stat);
-
+ template<typename MatType>
+ DTBStat(const MatType& dataset, const size_t start, const size_t count,
+ const DTBStat& leftStat, const DTBStat& rightStat);
+
}; // class DTBStat
/**
Modified: mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp 2011-12-14 08:04:13 UTC (rev 10761)
+++ mlpack/trunk/src/mlpack/methods/emst/dtb_impl.hpp 2011-12-14 08:04:33 UTC (rev 10762)
@@ -48,7 +48,10 @@
/**
* An initializer for leaves.
*/
-DTBStat::DTBStat(const arma::mat& dataset, size_t start, size_t count)
+template<typename MatType>
+DTBStat::DTBStat(const MatType& dataset,
+ const size_t start,
+ const size_t count)
{
if (count == 1)
{
@@ -65,8 +68,12 @@
/**
* An initializer for non-leaves. Simply calls the leaf initializer.
*/
-DTBStat::DTBStat(const arma::mat& dataset, size_t start, size_t count,
- const DTBStat& left_stat, const DTBStat& right_stat)
+template<typename MatType>
+DTBStat::DTBStat(const MatType& dataset,
+ const size_t start,
+ const size_t count,
+ const DTBStat& leftStat,
+ const DTBStat& right_stat)
{
if (count == 1)
{
@@ -80,12 +87,13 @@
}
}
- DualTreeBoruvka::~DualTreeBoruvka()
- {
- if (tree_ != NULL)
- delete tree_;
- }
+DualTreeBoruvka::~DualTreeBoruvka()
+{
+ if (tree_ != NULL)
+ delete tree_;
+}
+
/**
* Adds a single edge to the edge list
*/
@@ -555,4 +563,4 @@
-#endif
\ No newline at end of file
+#endif
More information about the mlpack-svn
mailing list