[mlpack-svn] r11927 - mlpack/trunk/src/mlpack/core/tree
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Mar 20 23:04:40 EDT 2012
Author: jcline3
Date: 2012-03-20 23:04:40 -0400 (Tue, 20 Mar 2012)
New Revision: 11927
Modified:
mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp
Log:
Add more fields to the mrkd statistic
Modified: mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp 2012-03-21 03:04:13 UTC (rev 11926)
+++ mlpack/trunk/src/mlpack/core/tree/mrkd_statistic.hpp 2012-03-21 03:04:40 UTC (rev 11927)
@@ -41,7 +41,8 @@
:
dataset(&dataset),
begin(begin),
- count(count)
+ count(count),
+ parentStat(NULL)
{
centerOfMass = dataset.col(begin);
for(size_t i = begin+1; i < begin+count; ++i)
@@ -66,14 +67,15 @@
MRKDStatistic(const MatType& dataset,
const size_t begin,
const size_t count,
- const MRKDStatistic& leftStat,
- const MRKDStatistic& rightStat)
+ MRKDStatistic& leftStat,
+ MRKDStatistic& rightStat)
:
dataset(&dataset),
begin(begin),
count(count),
leftStat(&leftStat),
- rightStat(&rightStat)
+ rightStat(&rightStat),
+ parentStat(NULL)
{
sumOfSquaredNorms = leftStat.sumOfSquaredNorms + rightStat.sumOfSquaredNorms;
@@ -83,6 +85,11 @@
(leftStat.count + rightStat.count);
*/
centerOfMass = leftStat.centerOfMass + rightStat.centerOfMass;
+
+ isWhiteListValid = false;
+
+ leftStat.parentStat = this;
+ rightStat.parentStat = this;
}
//! The data points this object contains
@@ -95,6 +102,8 @@
const MRKDStatistic* leftStat;
//! The right child
const MRKDStatistic* rightStat;
+ //! A link to my parent node, null if I am the root
+ const MRKDStatistic* parentStat;
// Computed statistics
//! The center of mass for this dataset
@@ -105,6 +114,11 @@
// There may be a better place to store this -- HRectBound?
//! The index of the dominating centroid of the associated hyperrectangle
size_t dominatingCentroid;
+
+ //! The list of centroids that cannot own this hyperrectangle
+ std::vector<size_t> whiteList;
+ //! Whether or not the whitelist is valid
+ bool isWhiteListValid;
};
}; // namespace tree
More information about the mlpack-svn
mailing list