[mlpack-svn] r14400 - mlpack/trunk/src/mlpack/core/tree
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Feb 26 17:54:08 EST 2013
Author: rcurtin
Date: 2013-02-26 17:54:07 -0500 (Tue, 26 Feb 2013)
New Revision: 14400
Modified:
mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.cpp
mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp
Log:
Adapt to new statistic API.
Modified: mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.cpp
===================================================================
--- mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.cpp 2013-02-26 22:50:34 UTC (rev 14399)
+++ mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.cpp 2013-02-26 22:54:07 UTC (rev 14400)
@@ -18,6 +18,16 @@
parentStat(NULL)
{ }
+template<typename TreeType>
+MRKDStatistic::MRKDStatistic(const TreeType& /* node */) :
+ dataset(NULL),
+ begin(0),
+ count(0),
+ leftStat(NULL),
+ rightStat(NULL),
+ parentStat(NULL)
+{ }
+
/**
* Returns a string representation of this object.
*/
Modified: mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp 2013-02-26 22:50:34 UTC (rev 14399)
+++ mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp 2013-02-26 22:54:07 UTC (rev 14400)
@@ -22,35 +22,14 @@
MRKDStatistic();
/**
- * This constructor is called when a leaf is created.
+ * This constructor is called when a node is finished initializing.
*
- * @param dataset Matrix that the tree is being built on.
- * @param begin Starting index corresponding to this leaf.
- * @param count Number of points held in this leaf.
+ * @param node The node that has been finished.
*/
- template<typename MatType>
- MRKDStatistic(const MatType& dataset,
- const size_t begin,
- const size_t count);
+ template<typename TreeType>
+ MRKDStatistic(const TreeType& /* node */);
/**
- * This constructor is called when a non-leaf node is created.
- * This lets you build fast bottom-up statistics when building trees.
- *
- * @param dataset Matrix that the tree is being built on.
- * @param begin Starting index corresponding to this leaf.
- * @param count Number of points held in this leaf.
- * @param leftStat MRKDStatistic object of the left child node.
- * @param rightStat MRKDStatistic object of the right child node.
- */
- template<typename MatType>
- MRKDStatistic(const MatType& dataset,
- const size_t begin,
- const size_t count,
- MRKDStatistic& leftStat,
- MRKDStatistic& rightStat);
-
- /**
* Returns a string representation of this object.
*/
std::string ToString() const;
@@ -97,7 +76,7 @@
// Computed statistics.
//! The center of mass for this dataset.
arma::colvec centerOfMass;
- //! The sum of the squared Euclidian norms for this dataset.
+ //! The sum of the squared Euclidean norms for this dataset.
double sumOfSquaredNorms;
// There may be a better place to store this -- HRectBound?
More information about the mlpack-svn
mailing list