MLPACK  1.0.11
mrkd_statistic.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP
23 #define __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace tree {
29 
34 {
35  public:
37  MRKDStatistic();
38 
44  template<typename TreeType>
45  MRKDStatistic(const TreeType& /* node */);
46 
50  std::string ToString() const;
51 
53  size_t Begin() const { return begin; }
55  size_t& Begin() { return begin; }
56 
58  size_t Count() const { return count; }
60  size_t& Count() { return count; }
61 
63  const arma::colvec& CenterOfMass() const { return centerOfMass; }
65  arma::colvec& CenterOfMass() { return centerOfMass; }
66 
68  size_t DominatingCentroid() const { return dominatingCentroid; }
70  size_t& DominatingCentroid() { return dominatingCentroid; }
71 
73  const std::vector<size_t>& Whitelist() const { return whitelist; }
75  std::vector<size_t>& Whitelist() { return whitelist; }
76 
77  private:
79  const arma::mat* dataset;
81  size_t begin;
83  size_t count;
90 
91  // Computed statistics.
93  arma::colvec centerOfMass;
96 
97  // There may be a better place to store this -- HRectBound?
100 
102  std::vector<size_t> whitelist;
105 };
106 
107 }; // namespace tree
108 }; // namespace mlpack
109 
110 // Include implementation.
111 #include "mrkd_statistic_impl.hpp"
112 
113 #endif // __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP
MRKDStatistic()
Initialize an empty statistic.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:31
std::vector< size_t > whitelist
The list of centroids that cannot own this hyperrectangle.
size_t begin
The initial item in the dataset, so we don&#39;t have to make a copy.
size_t DominatingCentroid() const
Get the index of the dominating centroid.
const arma::colvec & CenterOfMass() const
Get the center of mass.
size_t Begin() const
Get the index of the initial item in the dataset.
const MRKDStatistic * rightStat
The right child.
const MRKDStatistic * leftStat
The left child.
Statistic for multi-resolution kd-trees.
const std::vector< size_t > & Whitelist() const
Access the whitelist.
arma::colvec & CenterOfMass()
Modify the center of mass.
size_t & DominatingCentroid()
Modify the index of the dominating centroid.
size_t & Count()
Modify the number of items in the dataset.
bool isWhitelistValid
Whether or not the whitelist is valid.
size_t & Begin()
Modify the index of the initial item in the dataset.
std::vector< size_t > & Whitelist()
Modify the whitelist.
arma::colvec centerOfMass
The center of mass for this dataset.
size_t dominatingCentroid
The index of the dominating centroid of the associated hyperrectangle.
size_t Count() const
Get the number of items in the dataset.
double sumOfSquaredNorms
The sum of the squared Euclidean norms for this dataset.
std::string ToString() const
Returns a string representation of this object.
const MRKDStatistic * parentStat
A link to the parent node; NULL if this is the root.
size_t count
The number of items in the dataset.
const arma::mat * dataset
The data points this object contains.