New Statistic API.

This commit is contained in:
Ryan Curtin
2011-12-14 08:04:33 +00:00
parent 069684470c
commit 69ce9b8ff2
2 changed files with 23 additions and 13 deletions
+6 -4
View File
@@ -57,14 +57,16 @@ class DTBStat
/**
* 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
/**
+17 -9
View File
@@ -48,7 +48,10 @@ DTBStat::DTBStat()
/**
* 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 @@ DTBStat::DTBStat(const arma::mat& dataset, size_t start, size_t count)
/**
* 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,11 +87,12 @@ DTBStat::DTBStat(const arma::mat& dataset, size_t start, size_t count,
}
}
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 @@ void DualTreeBoruvka::ComputeMST(arma::mat& results)
#endif
#endif