---
name: "mlpack_tree_BinarySpaceTree_SingleTreeTraverser"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_tree_BinarySpaceTree_SingleTreeTraverser"
---

# mlpack\_tree\_BinarySpaceTree\_SingleTreeTraverser(3)

A single-tree traverser for binary space trees; see single\_tree\_traverser.hpp for implementation.

## NAME

mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \> -

A single-tree traverser for binary space trees; see single\_tree\_traverser.hpp for implementation.

## SYNOPSIS

### Public Member Functions

**SingleTreeTraverser** (RuleType &**rule**)\
 *Instantiate the single tree traverser with the given rule set.*  size\_t **NumPrunes** () const \
 *Get the number of prunes.*  size\_t & **NumPrunes** ()\
 *Modify the number of prunes.*  void **Traverse** (const size\_t queryIndex, **BinarySpaceTree** &referenceNode)\
 *Traverse the tree with the given point.*

### Private Attributes

size\_t **numPrunes**\
 *The number of nodes which have been pruned during traversal.*  RuleType & **rule**\
 *Reference to the rules with which the tree will be traversed.*

## Detailed Description

### template\<typename BoundType, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\>template\<typename RuleType\>class mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>

A single-tree traverser for binary space trees; see single\_tree\_traverser.hpp for implementation.

Definition at line 99 of file binary\_space\_tree.hpp.

## Constructor & Destructor Documentation

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::SingleTreeTraverser (RuleType &rule)

Instantiate the single tree traverser with the given rule set.

## Member Function Documentation

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> size\_t mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::NumPrunes () const` [inline]`

Get the number of prunes.

Definition at line 58 of file single\_tree\_traverser.hpp.

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> size\_t& mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::NumPrunes ()` [inline]`

Modify the number of prunes.

Definition at line 60 of file single\_tree\_traverser.hpp.

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> void mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::Traverse (const size\_tqueryIndex, BinarySpaceTree &referenceNode)

Traverse the tree with the given point.

**Parameters:**

*queryIndex* The index of the point in the query set which is being used as the query point. \
 *referenceNode* The tree node to be traversed.

## Member Data Documentation

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> size\_t mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::numPrunes` [private]`

The number of nodes which have been pruned during traversal.

Definition at line 67 of file single\_tree\_traverser.hpp.

### template\<typename BoundType , typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = MeanSplit\<BoundType, MatType\>\> template\<typename RuleType \> RuleType& mlpack::tree::BinarySpaceTree\< BoundType, StatisticType, MatType, SplitType \>::SingleTreeTraverser\< RuleType \>::rule` [private]`

Reference to the rules with which the tree will be traversed.

Definition at line 64 of file single\_tree\_traverser.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
