mlpack  2.0.1
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > Class Template Reference

A binary space partitioning tree, such as a KD-tree or a ball tree. More...

Classes

class  BreadthFirstDualTreeTraverser
 
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 (const MatType &data, const size_t maxLeafSize=20)
 Construct this as the root node of a binary space tree using the given dataset. More...
 
 BinarySpaceTree (const 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 (const 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 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 (BinarySpaceTree *parent, const size_t begin, const size_t count, SplitType< BoundType< MetricType >, MatType > &splitter, const size_t maxLeafSize=20)
 Construct this node as a child of the given parent, starting at column begin and using count points. More...
 
 BinarySpaceTree (BinarySpaceTree *parent, const size_t begin, const size_t count, std::vector< size_t > &oldFromNew, SplitType< BoundType< MetricType >, MatType > &splitter, const size_t maxLeafSize=20)
 Construct this node as a child of the given parent, starting at column begin and using count points. More...
 
 BinarySpaceTree (BinarySpaceTree *parent, const size_t begin, const size_t count, std::vector< size_t > &oldFromNew, std::vector< size_t > &newFromOld, SplitType< BoundType< MetricType >, MatType > &splitter, const size_t maxLeafSize=20)
 Construct this node as a child of the given parent, starting at column begin and using count points. More...
 
 BinarySpaceTree (const BinarySpaceTree &other)
 Create a binary space tree by copying the other tree. More...
 
 BinarySpaceTree (BinarySpaceTree &&other)
 Move constructor for a BinarySpaceTree; possess all the members of the given tree. More...
 
template<typename Archive >
 BinarySpaceTree (Archive &ar, const typename boost::enable_if< typename Archive::is_loading >::type *=0)
 Initialize the tree from a boost::serialization archive. 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< MetricType > & Bound () const
 Return the bound object for this node. More...
 
BoundType< MetricType > & Bound ()
 Return the bound object for this node. More...
 
void Center (arma::vec &center)
 Store the center of the bounding region in the given vector. More...
 
BinarySpaceTreeChild (const size_t child) const
 Return the specified child (0 will be left, 1 will be right). More...
 
BinarySpaceTree *& ChildPtr (const size_t child)
 
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...
 
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...
 
bool IsLeaf () const
 Return whether or not this node is a leaf (true if it has no children). More...
 
BinarySpaceTreeLeft () 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...
 
MetricType Metric () const
 Get the metric that 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...
 
BinarySpaceTreeParent () 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...
 
BinarySpaceTreeRight () const
 Gets the right child of this node. More...
 
BinarySpaceTree *& Right ()
 Modify the right child of this node. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int version)
 Serialize the tree. More...
 
const StatisticType & Stat () const
 Return the statistic object for this node. More...
 
StatisticType & Stat ()
 Return the statistic object for this node. More...
 

Static Public Member Functions

static bool HasSelfChildren ()
 Returns false: this tree type does not have self children. More...
 

Protected Member Functions

 BinarySpaceTree ()
 A default constructor. More...
 

Private Member Functions

void SplitNode (const size_t maxLeafSize, SplitType< BoundType< MetricType >, MatType > &splitter)
 Splits the current node, assigning its left and right children recursively. More...
 
void SplitNode (std::vector< size_t > &oldFromNew, const size_t maxLeafSize, SplitType< BoundType< MetricType >, MatType > &splitter)
 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< MetricType > 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...
 
BinarySpaceTreeleft
 The left child node. More...
 
double minimumBoundDistance
 The minimum distance from the center to any edge of the bound. More...
 
BinarySpaceTreeparent
 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...
 
BinarySpaceTreeright
 The right child node. More...
 
StatisticType stat
 Any extra data contained in the node. More...
 

Detailed Description

template<typename MetricType, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
class mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >

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.

Template Parameters
MetricTypeThe metric used for tree-building. The BoundType may place restrictions on the metrics that can be used.
StatisticTypeExtra data contained in the node. See statistic.hpp for the necessary skeleton interface.
MatTypeThe dataset class.
BoundTypeThe bound used for each node. HRectBound, the default, requires that an LMetric<> is used for MetricType (so, EuclideanDistance, ManhattanDistance, etc.).
SplitTypeThe 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 55 of file binary_space_tree.hpp.

Member Typedef Documentation

◆ Mat

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
typedef MatType mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Mat

So other classes can use TreeType::Mat.

Definition at line 87 of file binary_space_tree.hpp.

Constructor & Destructor Documentation

◆ BinarySpaceTree() [1/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( const MatType &  data,
const size_t  maxLeafSize = 20 
)

Construct this as the root node of a binary space tree using the given dataset.

This will copy the input matrix; if you don't want this, consider using the constructor that takes an rvalue reference and use std::move().

Parameters
dataDataset to create tree from. This will be copied!
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [2/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( const 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 copy the input matrix and modify its ordering; a mapping of the old point indices to the new point indices is filled. If you don't want the matrix to be copied, consider using the constructor that takes an rvalue reference and use std::move().

Parameters
dataDataset to create tree from. This will be copied!
oldFromNewVector which will be filled with the old positions for each new point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [3/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( const 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 copy the input matrix and modify its ordering; 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. If you don't want the matrix to be copied, consider using the constructor that takes an rvalue reference and use std::move().

Parameters
dataDataset to create tree from. This will be copied!
oldFromNewVector which will be filled with the old positions for each new point.
newFromOldVector which will be filled with the new positions for each old point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [4/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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 take ownership of the data matrix; if you don't want this, consider using the constructor that takes a const reference to a dataset.

Parameters
dataDataset to create tree from.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [5/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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 take ownership of the data matrix; a mapping of the old point indices to the new point indices is filled. If you don't want the matrix to have its ownership taken, consider using the constructor that takes a const reference to a dataset.

Parameters
dataDataset to create tree from.
oldFromNewVector which will be filled with the old positions for each new point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [6/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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 take ownership of the data matrix; 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. If you don't want the matrix to have its ownership taken, consider using the constructor that takes a const reference to a dataset.

Parameters
dataDataset to create tree from.
oldFromNewVector which will be filled with the old positions for each new point.
newFromOldVector which will be filled with the new positions for each old point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [7/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  parent,
const size_t  begin,
const size_t  count,
SplitType< BoundType< MetricType >, MatType > &  splitter,
const size_t  maxLeafSize = 20 
)

Construct this node as a child of the given parent, starting at column begin and using count points.

The ordering of that subset of points in the parent's data matrix will be modified! This is used for recursive tree-building by the other constructors which don't specify point indices.

Parameters
parentParent of this node. Its dataset will be modified!
beginIndex of point to start tree construction with.
countNumber of points to use to construct tree.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [8/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  parent,
const size_t  begin,
const size_t  count,
std::vector< size_t > &  oldFromNew,
SplitType< BoundType< MetricType >, MatType > &  splitter,
const size_t  maxLeafSize = 20 
)

Construct this node as a child of the given parent, starting at column begin and using count points.

The ordering of that subset of points in the parent's data matrix 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.

Parameters
parentParent of this node. Its dataset will be modified!
beginIndex of point to start tree construction with.
countNumber of points to use to construct tree.
oldFromNewVector which will be filled with the old positions for each new point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [9/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  parent,
const size_t  begin,
const size_t  count,
std::vector< size_t > &  oldFromNew,
std::vector< size_t > &  newFromOld,
SplitType< BoundType< MetricType >, MatType > &  splitter,
const size_t  maxLeafSize = 20 
)

Construct this node as a child of the given parent, starting at column begin and using count points.

The ordering of that subset of points in the parent's data matrix 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.

Parameters
parentParent of this node. Its dataset will be modified!
beginIndex of point to start tree construction with.
countNumber of points to use to construct tree.
oldFromNewVector which will be filled with the old positions for each new point.
newFromOldVector which will be filled with the new positions for each old point.
maxLeafSizeSize of each leaf in the tree.

◆ BinarySpaceTree() [10/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( const BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Parameters
otherTree to be replicated.

◆ BinarySpaceTree() [11/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > &&  other)

Move constructor for a BinarySpaceTree; possess all the members of the given tree.

◆ BinarySpaceTree() [12/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
template<typename Archive >
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( Archive &  ar,
const typename boost::enable_if< typename Archive::is_loading >::type *  = 0 
)

Initialize the tree from a boost::serialization archive.

Parameters
arArchive to load tree from. Must be an iarchive, not an oarchive.

◆ ~BinarySpaceTree()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

◆ BinarySpaceTree() [13/13]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::BinarySpaceTree ( )
protected

A default constructor.

This is meant to only be used with boost::serialization, which is allowed with the friend declaration below. This does not return a valid tree! The method must be protected, so that the serialization shim can work with the default constructor.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Center().

Member Function Documentation

◆ Begin() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Begin ( ) const
inline

Return the index of the beginning point of this subset.

Definition at line 447 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::begin.

◆ Begin() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Begin ( )
inline

Modify the index of the beginning point of this subset.

Definition at line 449 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::begin.

◆ Bound() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
const BoundType<MetricType>& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Bound ( ) const
inline

◆ Bound() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BoundType<MetricType>& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Bound ( )
inline

Return the bound object for this node.

Definition at line 300 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::bound.

◆ Center()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
void mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Center ( arma::vec &  center)
inline

◆ Child()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Parameters
childIndex of child to return.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ParentDistance().

◆ ChildPtr()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree*& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ChildPtr ( const size_t  child)
inline

◆ Count() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Count ( ) const
inline

Return the number of points in this subset.

Definition at line 452 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::count.

◆ Count() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Count ( )
inline

Modify the number of points in this subset.

Definition at line 454 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::count.

◆ Dataset() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
const MatType& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Dataset ( ) const
inline

Get the dataset which the tree is built on.

Definition at line 326 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::dataset.

◆ Dataset() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
MatType& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Dataset ( )
inline

Modify the dataset which the tree is built on. Be careful!

Definition at line 328 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::dataset.

◆ Descendant()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Parameters
indexIndex of the descendant.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ChildPtr().

◆ FurthestDescendantDistance()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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).

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Metric().

◆ FurthestPointDistance()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Metric().

◆ HasSelfChildren()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
static bool mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::HasSelfChildren ( )
inlinestatic

Returns false: this tree type does not have self children.

Definition at line 457 of file binary_space_tree.hpp.

◆ IsLeaf()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
bool mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::IsLeaf ( ) const

Return whether or not this node is a leaf (true if it has no children).

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Stat().

◆ Left() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Left ( ) const
inline

◆ Left() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree*& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Left ( )
inline

Modify the left child of this node.

Definition at line 313 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::left.

◆ MaxDistance() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::MaxDistance ( const BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  other) const
inline

Return the maximum distance to another node.

Definition at line 408 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Bound().

◆ MaxDistance() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
template<typename VecType >
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::MaxDistance ( const VecType &  point,
typename boost::enable_if< IsVector< VecType > >::type *  = 0 
) const
inline

Return the maximum distance to another point.

Definition at line 430 of file binary_space_tree.hpp.

◆ Metric()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
MetricType mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Metric ( ) const
inline

◆ MinDistance() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::MinDistance ( const BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  other) const
inline

Return the minimum distance to another node.

Definition at line 402 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Bound().

◆ MinDistance() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
template<typename VecType >
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::MinDistance ( const VecType &  point,
typename boost::enable_if< IsVector< VecType > >::type *  = 0 
) const
inline

Return the minimum distance to another point.

Definition at line 421 of file binary_space_tree.hpp.

◆ MinimumBoundDistance()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::MinimumBoundDistance ( ) const

Return the minimum distance from the center of the node to any bound edge.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Metric().

◆ NumChildren()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::NumChildren ( ) const

◆ NumDescendants()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ChildPtr().

◆ NumPoints()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::NumPoints ( ) const

Return the number of points in this node (0 if not a leaf).

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ChildPtr().

◆ Parent() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Parent ( ) const
inline

◆ Parent() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree*& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Parent ( )
inline

◆ ParentDistance() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ParentDistance ( ) const
inline

Return the distance from the center of this node to the center of the parent node.

Definition at line 356 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::parentDistance.

◆ ParentDistance() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ParentDistance ( )
inline

◆ Point()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, 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.

Parameters
indexIndex of point for which a dataset index is wanted.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ChildPtr().

◆ RangeDistance() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
math::Range mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::RangeDistance ( const BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType > *  other) const
inline

Return the minimum and maximum distance to another node.

Definition at line 414 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Bound().

◆ RangeDistance() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
template<typename VecType >
math::Range mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::RangeDistance ( const VecType &  point,
typename boost::enable_if< IsVector< VecType > >::type *  = 0 
) const
inline

Return the minimum and maximum distance to another point.

Definition at line 440 of file binary_space_tree.hpp.

◆ Right() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Right ( ) const
inline

◆ Right() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree*& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Right ( )
inline

Modify the right child of this node.

Definition at line 318 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::right.

◆ Serialize()

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
template<typename Archive >
void mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Serialize ( Archive &  ar,
const unsigned int  version 
)

Serialize the tree.

◆ SplitNode() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
void mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::SplitNode ( const size_t  maxLeafSize,
SplitType< BoundType< MetricType >, MatType > &  splitter 
)
private

Splits the current node, assigning its left and right children recursively.

Parameters
maxLeafSizeMaximum number of points held in a leaf.
splitterInstantiated SplitType object.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Center().

◆ SplitNode() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
void mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::SplitNode ( std::vector< size_t > &  oldFromNew,
const size_t  maxLeafSize,
SplitType< BoundType< MetricType >, MatType > &  splitter 
)
private

Splits the current node, assigning its left and right children recursively.

Also returns a list of the changed indices.

Parameters
oldFromNewVector holding permuted indices.
maxLeafSizeMaximum number of points held in a leaf.
splitterInstantiated SplitType object.

◆ Stat() [1/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
const StatisticType& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Stat ( ) const
inline

Return the statistic object for this node.

Definition at line 303 of file binary_space_tree.hpp.

References mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::stat.

◆ Stat() [2/2]

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
StatisticType& mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Stat ( )
inline

Member Data Documentation

◆ begin

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::begin
private

The index of the first point in the dataset contained in this node (and its children).

Definition at line 66 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Begin().

◆ bound

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BoundType<MetricType> mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::bound
private

◆ count

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
size_t mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::count
private

The number of points of the dataset contained in this node (and its children).

Definition at line 69 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Count().

◆ dataset

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
MatType* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::dataset
private

The dataset.

If we are the root of the tree, we own the dataset and must delete it.

Definition at line 83 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Dataset().

◆ furthestDescendantDistance

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::furthestDescendantDistance
private

The worst possible distance to the furthest descendant, cached to speed things up.

Definition at line 78 of file binary_space_tree.hpp.

◆ left

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::left
private

◆ minimumBoundDistance

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::minimumBoundDistance
private

The minimum distance from the center to any edge of the bound.

Definition at line 80 of file binary_space_tree.hpp.

◆ parent

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::parent
private

The parent node (NULL if this is the root of the tree).

Definition at line 63 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Parent().

◆ parentDistance

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
double mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::parentDistance
private

The distance from the centroid of this node to the centroid of the parent.

Definition at line 75 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::ParentDistance().

◆ right

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
BinarySpaceTree* mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::right
private

◆ stat

template<typename MetricType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, template< typename BoundMetricType > class BoundType = bound::HRectBound, template< typename SplitBoundType, typename SplitMatType > class SplitType = MidpointSplit>
StatisticType mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::stat
private

Any extra data contained in the node.

Definition at line 73 of file binary_space_tree.hpp.

Referenced by mlpack::tree::BinarySpaceTree< MetricType, StatisticType, MatType, BoundType, SplitType >::Stat().


The documentation for this class was generated from the following file: