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);
81 const arma::vec&
Centroid()
const {
return centroid; }
84 size_t Owner()
const {
return owner; }
85 size_t&
Owner() {
return owner; }
87 size_t Pruned()
const {
return pruned; }
102 void*
TrueChild(
const size_t i)
const {
return trueChildren[i]; }
103 void*&
TrueChild(
const size_t i) {
return trueChildren[i]; }
113 double staticUpperBoundMovement;
114 double staticLowerBoundMovement;
117 std::vector<void*> trueChildren;
bool StaticPruned() const
Linear algebra utility functions, generally performed on matrices or vectors.
double UpperBound() const
DualTreeKMeansStatistic()
Extra data for each node in the tree.
void *& TrueChild(const size_t i)
double StaticUpperBoundMovement() const
double StaticLowerBoundMovement() const
size_t NumTrueChildren() const
double & StaticLowerBoundMovement()
void * TrueChild(const size_t i) const
NearestNS NearestNeighborSort
double & StaticUpperBoundMovement()
void * TrueParent() const
The TreeTraits class provides compile-time information on the characteristics of a given tree type...
const arma::vec & Centroid() const
DualTreeKMeansStatistic(TreeType &node)
double LowerBound() const
NeighborSearchStat()
Initialize the statistic with the worst possible distance according to our sorting policy...