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

# mlpack\_emst\_DTBRules(3)

## NAME

mlpack::emst::DTBRules\< MetricType, TreeType \> -

## SYNOPSIS

### Public Types

typedef \
 **neighbor::NeighborSearchTraversalInfo**\
 \< TreeType \> **TraversalInfoType**"\

### Public Member Functions

**DTBRules** (const arma::mat &**dataSet**, **UnionFind** &**connections**, arma::vec &**neighborsDistances**, arma::Col\< size\_t \> &**neighborsInComponent**, arma::Col\< size\_t \> &**neighborsOutComponent**, MetricType &**metric**)\
 double **BaseCase** (const size\_t queryIndex, const size\_t referenceIndex)\
 size\_t **BaseCases** () const \
 *Get the number of base cases performed.*  size\_t & **BaseCases** ()\
 *Modify the number of base cases performed.*  double **Rescore** (const size\_t queryIndex, TreeType &referenceNode, const double oldScore)\
 *Re-evaluate the score for recursion order.*  double **Rescore** (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const \
 *Re-evaluate the score for recursion order.*  double **Score** (const size\_t queryIndex, TreeType &referenceNode)\
 *Get the score for recursion order.*  double **Score** (const size\_t queryIndex, TreeType &referenceNode, const double baseCaseResult)\
 *Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order).*  double **Score** (TreeType &queryNode, TreeType &referenceNode)\
 *Get the score for recursion order.*  double **Score** (TreeType &queryNode, TreeType &referenceNode, const double baseCaseResult)\
 *Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order).*  size\_t **Scores** () const \
 *Get the number of node combinations that have been scored.*  size\_t & **Scores** ()\
 *Modify the number of node combinations that have been scored.*  const **TraversalInfoType** & **TraversalInfo** () const \
 **TraversalInfoType** & **TraversalInfo** ()\

### Private Member Functions

double **CalculateBound** (TreeType &queryNode) const \
 *Update the bound for the given query node.*

### Private Attributes

size\_t **baseCases**\
 *The number of base cases calculated.*  **UnionFind** & **connections**\
 *Stores the tree structure so far.*  const arma::mat & **dataSet**\
 *The data points.*  MetricType & **metric**\
 *The instantiated metric.*  arma::vec & **neighborsDistances**\
 *The distance to the candidate nearest neighbor for each component.*  arma::Col\< size\_t \> & **neighborsInComponent**\
 *The index of the point in the component that is an endpoint of the candidate edge.*  arma::Col\< size\_t \> & **neighborsOutComponent**\
 *The index of the point outside of the component that is an endpoint of the candidate edge.*  size\_t **scores**\
 *The number of node combinations that have been scored.*  **TraversalInfoType** **traversalInfo**\

## Detailed Description

### template\<typename MetricType, typename TreeType\>class mlpack::emst::DTBRules\< MetricType, TreeType \>

Definition at line 33 of file dtb\_rules.hpp.

## Member Typedef Documentation

### template\<typename MetricType , typename TreeType \> typedef neighbor::NeighborSearchTraversalInfo\<TreeType\> mlpack::emst::DTBRules\< MetricType, TreeType \>::TraversalInfoType

Definition at line 123 of file dtb\_rules.hpp.

## Constructor & Destructor Documentation

### template\<typename MetricType , typename TreeType \> mlpack::emst::DTBRules\< MetricType, TreeType \>::DTBRules (const arma::mat &dataSet, UnionFind &connections, arma::vec &neighborsDistances, arma::Col\< size\_t \> &neighborsInComponent, arma::Col\< size\_t \> &neighborsOutComponent, MetricType &metric)

## Member Function Documentation

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::BaseCase (const size\_tqueryIndex, const size\_treferenceIndex)

### template\<typename MetricType , typename TreeType \> size\_t mlpack::emst::DTBRules\< MetricType, TreeType \>::BaseCases () const` [inline]`

Get the number of base cases performed.

Definition at line 129 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::baseCases.

### template\<typename MetricType , typename TreeType \> size\_t& mlpack::emst::DTBRules\< MetricType, TreeType \>::BaseCases ()` [inline]`

Modify the number of base cases performed.

Definition at line 131 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::baseCases.

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::CalculateBound (TreeType &queryNode) const` [inline]`, ` [private]`

Update the bound for the given query node.

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Rescore (const size\_tqueryIndex, TreeType &referenceNode, const doubleoldScore)

Re-evaluate the score for recursion order. A low score indicates priority for recursion, while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.

**Parameters:**

*queryIndex* Index of query point. \
 *referenceNode* Candidate node to be recursed into. \
 *oldScore* Old score produced by **Score()** (or **Rescore()**).

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Rescore (TreeType &queryNode, TreeType &referenceNode, const doubleoldScore) const

Re-evaluate the score for recursion order. A low score indicates priority for recursion, while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.

**Parameters:**

*queryNode* Candidate query node to recurse into. \
 *referenceNode* Candidate reference node to recurse into. \
 *oldScore* Old score produced by Socre() (or **Rescore()**).

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Score (const size\_tqueryIndex, TreeType &referenceNode)

Get the score for recursion order. A low score indicates priority for recursion, while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned).

**Parameters:**

*queryIndex* Index of query point. \
 *referenceNode* Candidate node to be recursed into.

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Score (const size\_tqueryIndex, TreeType &referenceNode, const doublebaseCaseResult)

Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). A low score indicates priority for recursion, while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned).

**Parameters:**

*queryIndex* Index of query point. \
 *referenceNode* Candidate node to be recursed into. \
 *baseCaseResult* Result of BaseCase(queryIndex, referenceNode).

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Score (TreeType &queryNode, TreeType &referenceNode)

Get the score for recursion order. A low score indicates priority for recursionm while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned).

**Parameters:**

*queryNode* Candidate query node to recurse into. \
 *referenceNode* Candidate reference node to recurse into.

### template\<typename MetricType , typename TreeType \> double mlpack::emst::DTBRules\< MetricType, TreeType \>::Score (TreeType &queryNode, TreeType &referenceNode, const doublebaseCaseResult)

Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). A low score indicates priority for recursion, while DBL\_MAX indicates that the node should not be recursed into at all (it should be pruned).

**Parameters:**

*queryNode* Candidate query node to recurse into. \
 *referenceNode* Candidate reference node to recurse into. \
 *baseCaseResult* Result of BaseCase(queryIndex, referenceNode).

### template\<typename MetricType , typename TreeType \> size\_t mlpack::emst::DTBRules\< MetricType, TreeType \>::Scores () const` [inline]`

Get the number of node combinations that have been scored.

Definition at line 134 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::scores.

### template\<typename MetricType , typename TreeType \> size\_t& mlpack::emst::DTBRules\< MetricType, TreeType \>::Scores ()` [inline]`

Modify the number of node combinations that have been scored.

Definition at line 136 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::scores.

### template\<typename MetricType , typename TreeType \> const TraversalInfoType& mlpack::emst::DTBRules\< MetricType, TreeType \>::TraversalInfo () const` [inline]`

Definition at line 125 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::traversalInfo.

### template\<typename MetricType , typename TreeType \> TraversalInfoType& mlpack::emst::DTBRules\< MetricType, TreeType \>::TraversalInfo ()` [inline]`

Definition at line 126 of file dtb\_rules.hpp.

References mlpack::emst::DTBRules\< MetricType, TreeType \>::traversalInfo.

## Member Data Documentation

### template\<typename MetricType , typename TreeType \> size\_t mlpack::emst::DTBRules\< MetricType, TreeType \>::baseCases` [private]`

The number of base cases calculated.

Definition at line 167 of file dtb\_rules.hpp.

Referenced by mlpack::emst::DTBRules\< MetricType, TreeType \>::BaseCases().

### template\<typename MetricType , typename TreeType \> UnionFind& mlpack::emst::DTBRules\< MetricType, TreeType \>::connections` [private]`

Stores the tree structure so far.

Definition at line 143 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> const arma::mat& mlpack::emst::DTBRules\< MetricType, TreeType \>::dataSet` [private]`

The data points.

Definition at line 140 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> MetricType& mlpack::emst::DTBRules\< MetricType, TreeType \>::metric` [private]`

The instantiated metric.

Definition at line 157 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> arma::vec& mlpack::emst::DTBRules\< MetricType, TreeType \>::neighborsDistances` [private]`

The distance to the candidate nearest neighbor for each component.

Definition at line 146 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> arma::Col\<size\_t\>& mlpack::emst::DTBRules\< MetricType, TreeType \>::neighborsInComponent` [private]`

The index of the point in the component that is an endpoint of the candidate edge.

Definition at line 150 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> arma::Col\<size\_t\>& mlpack::emst::DTBRules\< MetricType, TreeType \>::neighborsOutComponent` [private]`

The index of the point outside of the component that is an endpoint of the candidate edge.

Definition at line 154 of file dtb\_rules.hpp.

### template\<typename MetricType , typename TreeType \> size\_t mlpack::emst::DTBRules\< MetricType, TreeType \>::scores` [private]`

The number of node combinations that have been scored.

Definition at line 169 of file dtb\_rules.hpp.

Referenced by mlpack::emst::DTBRules\< MetricType, TreeType \>::Scores().

### template\<typename MetricType , typename TreeType \> TraversalInfoType mlpack::emst::DTBRules\< MetricType, TreeType \>::traversalInfo` [private]`

Definition at line 164 of file dtb\_rules.hpp.

Referenced by mlpack::emst::DTBRules\< MetricType, TreeType \>::TraversalInfo().

## Author

Generated automatically by Doxygen for MLPACK from the source code.
