00001 00022 #ifndef __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP 00023 #define __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP 00024 00025 #include <mlpack/core.hpp> 00026 00027 namespace mlpack { 00028 namespace tree { 00029 00033 class MRKDStatistic 00034 { 00035 public: 00037 MRKDStatistic(); 00038 00044 template<typename TreeType> 00045 MRKDStatistic(const TreeType& /* node */); 00046 00050 std::string ToString() const; 00051 00053 size_t Begin() const { return begin; } 00055 size_t& Begin() { return begin; } 00056 00058 size_t Count() const { return count; } 00060 size_t& Count() { return count; } 00061 00063 const arma::colvec& CenterOfMass() const { return centerOfMass; } 00065 arma::colvec& CenterOfMass() { return centerOfMass; } 00066 00068 size_t DominatingCentroid() const { return dominatingCentroid; } 00070 size_t& DominatingCentroid() { return dominatingCentroid; } 00071 00073 const std::vector<size_t>& Whitelist() const { return whitelist; } 00075 std::vector<size_t>& Whitelist() { return whitelist; } 00076 00077 private: 00079 const arma::mat* dataset; 00081 size_t begin; 00083 size_t count; 00085 const MRKDStatistic* leftStat; 00087 const MRKDStatistic* rightStat; 00089 const MRKDStatistic* parentStat; 00090 00091 // Computed statistics. 00093 arma::colvec centerOfMass; 00095 double sumOfSquaredNorms; 00096 00097 // There may be a better place to store this -- HRectBound? 00099 size_t dominatingCentroid; 00100 00102 std::vector<size_t> whitelist; 00104 bool isWhitelistValid; 00105 }; 00106 00107 }; // namespace tree 00108 }; // namespace mlpack 00109 00110 // Include implementation. 00111 #include "mrkd_statistic_impl.hpp" 00112 00113 #endif // __MLPACK_CORE_TREE_MRKD_STATISTIC_HPP