MLPACK
1.0.11
|
A binary space partitioning tree, such as a KD-tree or a ball tree. More...
Classes | |
class | DualTreeTraverser |
A dual-tree traverser for binary space trees; see dual_tree_traverser.hpp. More... | |
class | SingleTreeTraverser |
A single-tree traverser for binary space trees; see single_tree_traverser.hpp for implementation. More... | |
Public Types | |
typedef MatType | Mat |
So other classes can use TreeType::Mat. More... | |
Public Member Functions | |
BinarySpaceTree (MatType &data, const size_t maxLeafSize=20) | |
Construct this as the root node of a binary space tree using the given dataset. More... | |
BinarySpaceTree (MatType &data, std::vector< size_t > &oldFromNew, const size_t maxLeafSize=20) | |
Construct this as the root node of a binary space tree using the given dataset. More... | |
BinarySpaceTree (MatType &data, std::vector< size_t > &oldFromNew, std::vector< size_t > &newFromOld, const size_t maxLeafSize=20) | |
Construct this as the root node of a binary space tree using the given dataset. More... | |
BinarySpaceTree (MatType &data, const size_t begin, const size_t count, BinarySpaceTree *parent=NULL, const size_t maxLeafSize=20) | |
Construct this node on a subset of the given matrix, starting at column begin and using count points. More... | |
BinarySpaceTree (MatType &data, const size_t begin, const size_t count, std::vector< size_t > &oldFromNew, BinarySpaceTree *parent=NULL, const size_t maxLeafSize=20) | |
Construct this node on a subset of the given matrix, starting at column begin_in and using count_in points. More... | |
BinarySpaceTree (MatType &data, const size_t begin, const size_t count, std::vector< size_t > &oldFromNew, std::vector< size_t > &newFromOld, BinarySpaceTree *parent=NULL, const size_t maxLeafSize=20) | |
Construct this node on a subset of the given matrix, starting at column begin_in and using count_in points. More... | |
BinarySpaceTree (const BinarySpaceTree &other) | |
Create a binary space tree by copying the other tree. More... | |
~BinarySpaceTree () | |
Deletes this node, deallocating the memory for the children and calling their destructors in turn. More... | |
size_t | Begin () const |
Return the index of the beginning point of this subset. More... | |
size_t & | Begin () |
Modify the index of the beginning point of this subset. More... | |
const BoundType & | Bound () const |
Return the bound object for this node. More... | |
BoundType & | Bound () |
Return the bound object for this node. More... | |
void | Centroid (arma::vec ¢roid) |
Get the centroid of the node and store it in the given vector. More... | |
BinarySpaceTree & | Child (const size_t child) const |
Return the specified child (0 will be left, 1 will be right). More... | |
size_t | Count () const |
Return the number of points in this subset. More... | |
size_t & | Count () |
Modify the number of points in this subset. More... | |
const MatType & | Dataset () const |
Get the dataset which the tree is built on. More... | |
MatType & | Dataset () |
Modify the dataset which the tree is built on. Be careful! More... | |
size_t | Descendant (const size_t index) const |
Return the index (with reference to the dataset) of a particular descendant of this node. More... | |
size_t | End () const |
Gets the index one beyond the last index in the subset. More... | |
size_t | ExtendTree (const size_t level) |
Fills the tree to the specified level. More... | |
const BinarySpaceTree * | FindByBeginCount (size_t begin, size_t count) const |
Find a node in this tree by its begin and count (const). More... | |
BinarySpaceTree * | FindByBeginCount (size_t begin, size_t count) |
Find a node in this tree by its begin and count. More... | |
double | FurthestDescendantDistance () const |
Return the furthest possible descendant distance. More... | |
double | FurthestPointDistance () const |
Return the furthest distance to a point held in this node. More... | |
size_t | GetSplitDimension () const |
Returns the dimension this parent's children are split on. More... | |
bool | IsLeaf () const |
Return whether or not this node is a leaf (true if it has no children). More... | |
BinarySpaceTree * | Left () const |
Gets the left child of this node. More... | |
BinarySpaceTree *& | Left () |
Modify the left child of this node. More... | |
double | MaxDistance (const BinarySpaceTree *other) const |
Return the maximum distance to another node. More... | |
template<typename VecType > | |
double | MaxDistance (const VecType &point, typename boost::enable_if< IsVector< VecType > >::type *=0) const |
Return the maximum distance to another point. More... | |
size_t | MaxLeafSize () const |
Return the max leaf size. More... | |
size_t & | MaxLeafSize () |
Modify the max leaf size. More... | |
BoundType::MetricType | Metric () const |
Get the metric which the tree uses. More... | |
double | MinDistance (const BinarySpaceTree *other) const |
Return the minimum distance to another node. More... | |
template<typename VecType > | |
double | MinDistance (const VecType &point, typename boost::enable_if< IsVector< VecType > >::type *=0) const |
Return the minimum distance to another point. More... | |
double | MinimumBoundDistance () const |
Return the minimum distance from the center of the node to any bound edge. More... | |
size_t | NumChildren () const |
Return the number of children in this node. More... | |
size_t | NumDescendants () const |
Return the number of descendants of this node. More... | |
size_t | NumPoints () const |
Return the number of points in this node (0 if not a leaf). More... | |
BinarySpaceTree * | Parent () const |
Gets the parent of this node. More... | |
BinarySpaceTree *& | Parent () |
Modify the parent of this node. More... | |
double | ParentDistance () const |
Return the distance from the center of this node to the center of the parent node. More... | |
double & | ParentDistance () |
Modify the distance from the center of this node to the center of the parent node. More... | |
size_t | Point (const size_t index) const |
Return the index (with reference to the dataset) of a particular point in this node. More... | |
math::Range | RangeDistance (const BinarySpaceTree *other) const |
Return the minimum and maximum distance to another node. More... | |
template<typename VecType > | |
math::Range | RangeDistance (const VecType &point, typename boost::enable_if< IsVector< VecType > >::type *=0) const |
Return the minimum and maximum distance to another point. More... | |
BinarySpaceTree * | Right () const |
Gets the right child of this node. More... | |
BinarySpaceTree *& | Right () |
Modify the right child of this node. More... | |
size_t | SplitDimension () const |
Get the split dimension for this node. More... | |
size_t & | SplitDimension () |
Modify the split dimension for this node. More... | |
const StatisticType & | Stat () const |
Return the statistic object for this node. More... | |
StatisticType & | Stat () |
Return the statistic object for this node. More... | |
std::string | ToString () const |
Returns a string representation of this object. More... | |
size_t | TreeDepth () const |
Obtains the number of levels below this node in the tree, starting with this. More... | |
size_t | TreeSize () const |
Obtains the number of nodes in the tree, starting with this. More... | |
Static Public Member Functions | |
static bool | HasSelfChildren () |
Returns false: this tree type does not have self children. More... | |
Private Member Functions | |
BinarySpaceTree (const size_t begin, const size_t count, BoundType bound, StatisticType stat, const int maxLeafSize=20) | |
Private copy constructor, available only to fill (pad) the tree to a specified level. More... | |
BinarySpaceTree * | CopyMe () |
void | SplitNode (MatType &data) |
Splits the current node, assigning its left and right children recursively. More... | |
void | SplitNode (MatType &data, std::vector< size_t > &oldFromNew) |
Splits the current node, assigning its left and right children recursively. More... | |
Private Attributes | |
size_t | begin |
The index of the first point in the dataset contained in this node (and its children). More... | |
BoundType | bound |
The bound object for this node. More... | |
size_t | count |
The number of points of the dataset contained in this node (and its children). More... | |
MatType & | dataset |
The dataset. More... | |
double | furthestDescendantDistance |
The worst possible distance to the furthest descendant, cached to speed things up. More... | |
BinarySpaceTree * | left |
The left child node. More... | |
size_t | maxLeafSize |
The max leaf size. More... | |
double | minimumBoundDistance |
The minimum distance from the center to any edge of the bound. More... | |
BinarySpaceTree * | parent |
The parent node (NULL if this is the root of the tree). More... | |
double | parentDistance |
The distance from the centroid of this node to the centroid of the parent. More... | |
BinarySpaceTree * | right |
The right child node. More... | |
size_t | splitDimension |
The dimension this node split on if it is a parent. More... | |
StatisticType | stat |
Any extra data contained in the node. More... | |
A binary space partitioning tree, such as a KD-tree or a ball tree.
Once the bound and type of dataset is defined, the tree will construct itself. Call the constructor with the dataset to build the tree on, and the entire tree will be built.
This particular tree does not allow growth, so you cannot add or delete nodes from it. If you need to add or delete a node, the better procedure is to rebuild the tree entirely.
This tree does take one runtime parameter in the constructor, which is the max leaf size to be used.
BoundType | The bound used for each node. The valid types of bounds and the necessary skeleton interface for this class can be found in bounds/. |
StatisticType | Extra data contained in the node. See statistic.hpp for the necessary skeleton interface. |
MatType | The dataset class. |
SplitType | The class that partitions the dataset/points at a particular node into two parts. Its definition decides the way this split is done. |
Definition at line 59 of file binary_space_tree.hpp.
typedef MatType mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Mat |
So other classes can use TreeType::Mat.
Definition at line 94 of file binary_space_tree.hpp.
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
const size_t | maxLeafSize = 20 |
||
) |
Construct this as the root node of a binary space tree using the given dataset.
This will modify the ordering of the points in the dataset!
data | Dataset to create tree from. This will be modified! |
maxLeafSize | Size of each leaf in the tree. |
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe().
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
std::vector< size_t > & | oldFromNew, | ||
const size_t | maxLeafSize = 20 |
||
) |
Construct this as the root node of a binary space tree using the given dataset.
This will modify the ordering of points in the dataset! A mapping of the old point indices to the new point indices is filled.
data | Dataset to create tree from. This will be modified! |
oldFromNew | Vector which will be filled with the old positions for each new point. |
maxLeafSize | Size of each leaf in the tree. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
std::vector< size_t > & | oldFromNew, | ||
std::vector< size_t > & | newFromOld, | ||
const size_t | maxLeafSize = 20 |
||
) |
Construct this as the root node of a binary space tree using the given dataset.
This will modify the ordering of points in the dataset! A mapping of the old point indices to the new point indices is filled, as well as a mapping of the new point indices to the old point indices.
data | Dataset to create tree from. This will be modified! |
oldFromNew | Vector which will be filled with the old positions for each new point. |
newFromOld | Vector which will be filled with the new positions for each old point. |
maxLeafSize | Size of each leaf in the tree. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
const size_t | begin, | ||
const size_t | count, | ||
BinarySpaceTree< BoundType, StatisticType, MatType, SplitType > * | parent = NULL , |
||
const size_t | maxLeafSize = 20 |
||
) |
Construct this node on a subset of the given matrix, starting at column begin and using count points.
The ordering of that subset of points will be modified! This is used for recursive tree-building by the other constructors which don't specify point indices.
data | Dataset to create tree from. This will be modified! |
begin | Index of point to start tree construction with. |
count | Number of points to use to construct tree. |
maxLeafSize | Size of each leaf in the tree. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
const size_t | begin, | ||
const size_t | count, | ||
std::vector< size_t > & | oldFromNew, | ||
BinarySpaceTree< BoundType, StatisticType, MatType, SplitType > * | parent = NULL , |
||
const size_t | maxLeafSize = 20 |
||
) |
Construct this node on a subset of the given matrix, starting at column begin_in and using count_in points.
The ordering of that subset of points will be modified! This is used for recursive tree-building by the other constructors which don't specify point indices.
A mapping of the old point indices to the new point indices is filled, but it is expected that the vector is already allocated with size greater than or equal to (begin_in + count_in), and if that is not true, invalid memory reads (and writes) will occur.
data | Dataset to create tree from. This will be modified! |
begin | Index of point to start tree construction with. |
count | Number of points to use to construct tree. |
oldFromNew | Vector which will be filled with the old positions for each new point. |
maxLeafSize | Size of each leaf in the tree. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | MatType & | data, |
const size_t | begin, | ||
const size_t | count, | ||
std::vector< size_t > & | oldFromNew, | ||
std::vector< size_t > & | newFromOld, | ||
BinarySpaceTree< BoundType, StatisticType, MatType, SplitType > * | parent = NULL , |
||
const size_t | maxLeafSize = 20 |
||
) |
Construct this node on a subset of the given matrix, starting at column begin_in and using count_in points.
The ordering of that subset of points will be modified! This is used for recursive tree-building by the other constructors which don't specify point indices.
A mapping of the old point indices to the new point indices is filled, as well as a mapping of the new point indices to the old point indices. It is expected that the vector is already allocated with size greater than or equal to (begin_in + count_in), and if that is not true, invalid memory reads (and writes) will occur.
data | Dataset to create tree from. This will be modified! |
begin | Index of point to start tree construction with. |
count | Number of points to use to construct tree. |
oldFromNew | Vector which will be filled with the old positions for each new point. |
newFromOld | Vector which will be filled with the new positions for each old point. |
maxLeafSize | Size of each leaf in the tree. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree | ( | const BinarySpaceTree< BoundType, StatisticType, MatType, SplitType > & | other | ) |
Create a binary space tree by copying the other tree.
Be careful! This can take a long time and use a lot of memory.
other | Tree to be replicated. |
mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::~BinarySpaceTree | ( | ) |
Deletes this node, deallocating the memory for the children and calling their destructors in turn.
This will invalidate any pointers or references to any nodes which are children of this one.
|
inlineprivate |
Private copy constructor, available only to fill (pad) the tree to a specified level.
Definition at line 460 of file binary_space_tree.hpp.
|
inline |
Return the index of the beginning point of this subset.
Definition at line 438 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::begin.
|
inline |
Modify the index of the beginning point of this subset.
Definition at line 440 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::begin.
|
inline |
Return the bound object for this node.
Definition at line 260 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MaxDistance(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MinDistance(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::RangeDistance().
|
inline |
Return the bound object for this node.
Definition at line 262 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
|
inline |
Get the centroid of the node and store it in the given vector.
Definition at line 309 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
BinarySpaceTree& mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Child | ( | const size_t | child | ) | const |
Return the specified child (0 will be left, 1 will be right).
If the index is greater than 1, this will return the right child.
child | Index of child to return. |
|
inlineprivate |
Definition at line 473 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::begin, mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::BinarySpaceTree(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound, mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::count, mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::maxLeafSize, and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::stat.
|
inline |
Return the number of points in this subset.
Definition at line 448 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::count.
|
inline |
Modify the number of points in this subset.
Definition at line 450 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::count.
|
inline |
Get the dataset which the tree is built on.
Definition at line 301 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::dataset.
|
inline |
Modify the dataset which the tree is built on. Be careful!
Definition at line 303 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::dataset.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Descendant | ( | const size_t | index | ) | const |
Return the index (with reference to the dataset) of a particular descendant of this node.
The index should be greater than zero but less than the number of descendants.
index | Index of the descendant. |
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::End | ( | ) | const |
Gets the index one beyond the last index in the subset.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::ExtendTree | ( | const size_t | level | ) |
Fills the tree to the specified level.
const BinarySpaceTree* mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::FindByBeginCount | ( | size_t | begin, |
size_t | count | ||
) | const |
Find a node in this tree by its begin and count (const).
Every node is uniquely identified by these two numbers. This is useful for communicating position over the network, when pointers would be invalid.
BinarySpaceTree* mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::FindByBeginCount | ( | size_t | begin, |
size_t | count | ||
) |
Find a node in this tree by its begin and count.
Every node is uniquely identified by these two numbers. This is useful for communicating position over the network, when pointers would be invalid.
double mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::FurthestDescendantDistance | ( | ) | const |
Return the furthest possible descendant distance.
This returns the maximum distance from the centroid to the edge of the bound and not the empirical quantity which is the actual furthest descendant distance. So the actual furthest descendant distance may be less than what this method returns (but it will never be greater than this).
double mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::FurthestPointDistance | ( | ) | const |
Return the furthest distance to a point held in this node.
If this is not a leaf node, then the distance is 0 because the node holds no points.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::GetSplitDimension | ( | ) | const |
Returns the dimension this parent's children are split on.
|
inlinestatic |
Returns false: this tree type does not have self children.
Definition at line 453 of file binary_space_tree.hpp.
bool mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::IsLeaf | ( | ) | const |
Return whether or not this node is a leaf (true if it has no children).
|
inline |
Gets the left child of this node.
Definition at line 281 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::left.
|
inline |
Modify the left child of this node.
Definition at line 283 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::left.
|
inline |
Return the maximum distance to another node.
Definition at line 383 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound, and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Bound().
|
inline |
Return the maximum distance to another point.
Definition at line 405 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
|
inline |
Return the max leaf size.
Definition at line 273 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::maxLeafSize.
|
inline |
Modify the max leaf size.
Definition at line 275 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::maxLeafSize.
|
inline |
Get the metric which the tree uses.
Definition at line 306 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
|
inline |
Return the minimum distance to another node.
Definition at line 377 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound, and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Bound().
|
inline |
Return the minimum distance to another point.
Definition at line 396 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
double mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MinimumBoundDistance | ( | ) | const |
Return the minimum distance from the center of the node to any bound edge.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::NumChildren | ( | ) | const |
Return the number of children in this node.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::NumDescendants | ( | ) | const |
Return the number of descendants of this node.
For a non-leaf in a binary space tree, this is the number of points at the descendant leaves. For a leaf, this is the number of points in the leaf.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::NumPoints | ( | ) | const |
Return the number of points in this node (0 if not a leaf).
|
inline |
Gets the parent of this node.
Definition at line 291 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::parent.
|
inline |
Modify the parent of this node.
Definition at line 293 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::parent.
|
inline |
Return the distance from the center of this node to the center of the parent node.
Definition at line 334 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::parentDistance.
|
inline |
Modify the distance from the center of this node to the center of the parent node.
Definition at line 337 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::parentDistance.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Point | ( | const size_t | index | ) | const |
Return the index (with reference to the dataset) of a particular point in this node.
This will happily return invalid indices if the given index is greater than the number of points in this node (obtained with NumPoints()) – be careful.
index | Index of point for which a dataset index is wanted. |
|
inline |
Return the minimum and maximum distance to another node.
Definition at line 389 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound, and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Bound().
|
inline |
Return the minimum and maximum distance to another point.
Definition at line 415 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::bound.
|
inline |
Gets the right child of this node.
Definition at line 286 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::right.
|
inline |
Modify the right child of this node.
Definition at line 288 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::right.
|
inline |
Get the split dimension for this node.
Definition at line 296 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::splitDimension.
|
inline |
Modify the split dimension for this node.
Definition at line 298 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::splitDimension.
|
private |
Splits the current node, assigning its left and right children recursively.
data | Dataset which we are using. |
|
private |
Splits the current node, assigning its left and right children recursively.
Also returns a list of the changed indices.
data | Dataset which we are using. |
oldFromNew | Vector holding permuted indices. |
|
inline |
Return the statistic object for this node.
Definition at line 265 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::stat.
|
inline |
Return the statistic object for this node.
Definition at line 267 of file binary_space_tree.hpp.
References mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::stat.
std::string mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::ToString | ( | ) | const |
Returns a string representation of this object.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::TreeDepth | ( | ) | const |
Obtains the number of levels below this node in the tree, starting with this.
size_t mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::TreeSize | ( | ) | const |
Obtains the number of nodes in the tree, starting with this.
|
private |
The index of the first point in the dataset contained in this node (and its children).
Definition at line 70 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Begin(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe().
|
private |
The bound object for this node.
Definition at line 77 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Bound(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Centroid(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MaxDistance(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Metric(), mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MinDistance(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::RangeDistance().
|
private |
The number of points of the dataset contained in this node (and its children).
Definition at line 73 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Count().
|
private |
The dataset.
Definition at line 90 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Dataset().
|
private |
The worst possible distance to the furthest descendant, cached to speed things up.
Definition at line 86 of file binary_space_tree.hpp.
|
private |
The left child node.
Definition at line 63 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Left().
|
private |
The max leaf size.
Definition at line 75 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::MaxLeafSize().
|
private |
The minimum distance from the center to any edge of the bound.
Definition at line 88 of file binary_space_tree.hpp.
|
private |
The parent node (NULL if this is the root of the tree).
Definition at line 67 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Parent().
|
private |
The distance from the centroid of this node to the centroid of the parent.
Definition at line 83 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::ParentDistance().
|
private |
The right child node.
Definition at line 65 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Right().
|
private |
The dimension this node split on if it is a parent.
Definition at line 81 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::SplitDimension().
|
private |
Any extra data contained in the node.
Definition at line 79 of file binary_space_tree.hpp.
Referenced by mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::CopyMe(), and mlpack::tree::BinarySpaceTree< BoundType, StatisticType, MatType, SplitType >::Stat().