12 #ifndef MLPACK_METHODS_KMEANS_DTNN_STATISTIC_HPP 13 #define MLPACK_METHODS_KMEANS_DTNN_STATISTIC_HPP 31 staticUpperBoundMovement(0.0),
32 staticLowerBoundMovement(0.0),
39 template<
typename TreeType>
47 staticUpperBoundMovement(0.0),
48 staticLowerBoundMovement(0.0),
49 trueParent(node.Parent())
52 centroid.zeros(node.Dataset().n_rows);
53 for (
size_t i = 0; i < node.NumPoints(); ++i)
58 node.NumChildren() > 0)
60 centroid += node.Dataset().col(node.Point(i));
63 for (
size_t i = 0; i < node.NumChildren(); ++i)
64 centroid += node.Child(i).NumDescendants() *
65 node.Child(i).Stat().Centroid();
67 centroid /= node.NumDescendants();
70 trueChildren.resize(node.NumChildren());
71 for (
size_t i = 0; i < node.NumChildren(); ++i)
72 trueChildren[i] = &node.Child(i);
75 double UpperBound()
const {
return upperBound; }
76 double& UpperBound() {
return upperBound; }
78 double LowerBound()
const {
return lowerBound; }
79 double& LowerBound() {
return lowerBound; }
81 const arma::vec& Centroid()
const {
return centroid; }
82 arma::vec& Centroid() {
return centroid; }
84 size_t Owner()
const {
return owner; }
85 size_t& Owner() {
return owner; }
87 size_t Pruned()
const {
return pruned; }
88 size_t& Pruned() {
return pruned; }
90 bool StaticPruned()
const {
return staticPruned; }
91 bool& StaticPruned() {
return staticPruned; }
93 double StaticUpperBoundMovement()
const {
return staticUpperBoundMovement; }
94 double& StaticUpperBoundMovement() {
return staticUpperBoundMovement; }
96 double StaticLowerBoundMovement()
const {
return staticLowerBoundMovement; }
97 double& StaticLowerBoundMovement() {
return staticLowerBoundMovement; }
99 void* TrueParent()
const {
return trueParent; }
100 void*& TrueParent() {
return trueParent; }
102 void* TrueChild(
const size_t i)
const {
return trueChildren[i]; }
103 void*& TrueChild(
const size_t i) {
return trueChildren[i]; }
105 size_t NumTrueChildren()
const {
return trueChildren.size(); }
113 double staticUpperBoundMovement;
114 double staticLowerBoundMovement;
117 std::vector<void*> trueChildren;
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
Extra data for each node in the tree.
Definition: neighbor_search_stat.hpp:26
The TreeTraits class provides compile-time information on the characteristics of a given tree type...
Definition: tree_traits.hpp:77
Definition: dual_tree_kmeans_statistic.hpp:20