mlpack  master
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::neighbor::BiSearchVisitor< SortPolicy > Class Template Reference

BiSearchVisitor executes a bichromatic neighbor search on the given NSType. More...

Inheritance diagram for mlpack::neighbor::BiSearchVisitor< SortPolicy >:
Inheritance graph
[legend]

Public Types

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using NSTypeT = NSType< SortPolicy, TreeType >
 Alias template necessary for visual c++ compiler. More...
 

Public Member Functions

 BiSearchVisitor (const arma::mat &querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances, const size_t leafSize, const double tau, const double rho)
 Construct the BiSearchVisitor. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (NSTypeT< TreeType > *ns) const
 Default Bichromatic neighbor search on the given NSType instance. More...
 
void operator() (NSTypeT< tree::KDTree > *ns) const
 Bichromatic neighbor search on the given NSType specialized for KDTrees. More...
 
void operator() (NSTypeT< tree::BallTree > *ns) const
 Bichromatic neighbor search on the given NSType specialized for BallTrees. More...
 
void operator() (SpillKNN *ns) const
 Bichromatic neighbor search specialized for SPTrees. More...
 
void operator() (NSTypeT< tree::Octree > *ns) const
 Bichromatic neighbor search specialized for octrees. More...
 

Private Member Functions

template<typename NSType >
void SearchLeaf (NSType *ns) const
 Bichromatic neighbor search on the given NSType considering the leafSize. More...
 

Private Attributes

arma::mat & distances
 The result matrix for distances. More...
 
const size_t k
 The number of neighbors to search for. More...
 
const size_t leafSize
 The number of points in a leaf (for BinarySpaceTrees). More...
 
arma::Mat< size_t > & neighbors
 The result matrix for neighbors. More...
 
const arma::mat & querySet
 The query set for the bichromatic search. More...
 
const double rho
 Balance threshold (for spill trees). More...
 
const double tau
 Overlapping size (for spill trees). More...
 

Detailed Description

template<typename SortPolicy>
class mlpack::neighbor::BiSearchVisitor< SortPolicy >

BiSearchVisitor executes a bichromatic neighbor search on the given NSType.

We use template specialization to differentiate those tree types that accept leafSize as a parameter. In these cases, before doing neighbor search, a query tree with proper leafSize is built from the querySet.

Definition at line 98 of file ns_model.hpp.

Member Typedef Documentation

template<typename SortPolicy >
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using mlpack::neighbor::BiSearchVisitor< SortPolicy >::NSTypeT = NSType<SortPolicy, TreeType>

Alias template necessary for visual c++ compiler.

Definition at line 125 of file ns_model.hpp.

Constructor & Destructor Documentation

template<typename SortPolicy >
mlpack::neighbor::BiSearchVisitor< SortPolicy >::BiSearchVisitor ( const arma::mat &  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances,
const size_t  leafSize,
const double  tau,
const double  rho 
)

Construct the BiSearchVisitor.

Member Function Documentation

template<typename SortPolicy >
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::operator() ( NSTypeT< TreeType > *  ns) const

Default Bichromatic neighbor search on the given NSType instance.

template<typename SortPolicy >
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::operator() ( NSTypeT< tree::KDTree > *  ns) const

Bichromatic neighbor search on the given NSType specialized for KDTrees.

template<typename SortPolicy >
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::operator() ( NSTypeT< tree::BallTree > *  ns) const

Bichromatic neighbor search on the given NSType specialized for BallTrees.

template<typename SortPolicy >
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::operator() ( SpillKNN ns) const

Bichromatic neighbor search specialized for SPTrees.

template<typename SortPolicy >
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::operator() ( NSTypeT< tree::Octree > *  ns) const

Bichromatic neighbor search specialized for octrees.

template<typename SortPolicy >
template<typename NSType >
void mlpack::neighbor::BiSearchVisitor< SortPolicy >::SearchLeaf ( NSType ns) const
private

Bichromatic neighbor search on the given NSType considering the leafSize.

Member Data Documentation

template<typename SortPolicy >
arma::mat& mlpack::neighbor::BiSearchVisitor< SortPolicy >::distances
private

The result matrix for distances.

Definition at line 108 of file ns_model.hpp.

template<typename SortPolicy >
const size_t mlpack::neighbor::BiSearchVisitor< SortPolicy >::k
private

The number of neighbors to search for.

Definition at line 104 of file ns_model.hpp.

template<typename SortPolicy >
const size_t mlpack::neighbor::BiSearchVisitor< SortPolicy >::leafSize
private

The number of points in a leaf (for BinarySpaceTrees).

Definition at line 110 of file ns_model.hpp.

template<typename SortPolicy >
arma::Mat<size_t>& mlpack::neighbor::BiSearchVisitor< SortPolicy >::neighbors
private

The result matrix for neighbors.

Definition at line 106 of file ns_model.hpp.

template<typename SortPolicy >
const arma::mat& mlpack::neighbor::BiSearchVisitor< SortPolicy >::querySet
private

The query set for the bichromatic search.

Definition at line 102 of file ns_model.hpp.

template<typename SortPolicy >
const double mlpack::neighbor::BiSearchVisitor< SortPolicy >::rho
private

Balance threshold (for spill trees).

Definition at line 114 of file ns_model.hpp.

template<typename SortPolicy >
const double mlpack::neighbor::BiSearchVisitor< SortPolicy >::tau
private

Overlapping size (for spill trees).

Definition at line 112 of file ns_model.hpp.


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