mlpack  master
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::range::BiSearchVisitor Class Reference

BiSearchVisitor executes a bichromatic range search on the given RSType. More...

Inheritance diagram for mlpack::range::BiSearchVisitor:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

 BiSearchVisitor (const arma::mat &querySet, const math::Range &range, std::vector< std::vector< size_t >> &neighbors, std::vector< std::vector< double >> &distances, const size_t leafSize)
 Construct the BiSearchVisitor. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (RSTypeT< TreeType > *rs) const
 Default Bichromatic range search on the given RSType instance. More...
 
void operator() (RSTypeT< tree::KDTree > *rs) const
 Bichromatic range search on the given RSType specialized for KDTrees. More...
 
void operator() (RSTypeT< tree::BallTree > *rs) const
 Bichromatic range search on the given RSType specialized for BallTrees. More...
 
void operator() (RSTypeT< tree::Octree > *rs) const
 Bichromatic range search specialized for octrees. More...
 

Private Member Functions

template<typename RSType >
void SearchLeaf (RSType *rs) const
 Bichromatic range search on the given RSType considering the leafSize. More...
 

Private Attributes

std::vector< std::vector< double > > & distances
 The result vector for distances. More...
 
const size_t leafSize
 The number of points in a leaf (for BinarySpaceTrees). More...
 
std::vector< std::vector< size_t > > & neighbors
 The result vector for neighbors. More...
 
const arma::mat & querySet
 The query set for the bichromatic search. More...
 
const math::Rangerange
 Range to search neighbours for. More...
 

Detailed Description

BiSearchVisitor executes a bichromatic range search on the given RSType.

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

Definition at line 76 of file rs_model.hpp.

Member Typedef Documentation

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using mlpack::range::BiSearchVisitor::RSTypeT = RSType<TreeType>

Alias template necessary for visual c++ compiler.

Definition at line 99 of file rs_model.hpp.

Constructor & Destructor Documentation

mlpack::range::BiSearchVisitor::BiSearchVisitor ( const arma::mat &  querySet,
const math::Range range,
std::vector< std::vector< size_t >> &  neighbors,
std::vector< std::vector< double >> &  distances,
const size_t  leafSize 
)

Construct the BiSearchVisitor.

Member Function Documentation

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void mlpack::range::BiSearchVisitor::operator() ( RSTypeT< TreeType > *  rs) const

Default Bichromatic range search on the given RSType instance.

void mlpack::range::BiSearchVisitor::operator() ( RSTypeT< tree::KDTree > *  rs) const

Bichromatic range search on the given RSType specialized for KDTrees.

void mlpack::range::BiSearchVisitor::operator() ( RSTypeT< tree::BallTree > *  rs) const

Bichromatic range search on the given RSType specialized for BallTrees.

void mlpack::range::BiSearchVisitor::operator() ( RSTypeT< tree::Octree > *  rs) const

Bichromatic range search specialized for octrees.

template<typename RSType >
void mlpack::range::BiSearchVisitor::SearchLeaf ( RSType rs) const
private

Bichromatic range search on the given RSType considering the leafSize.

Member Data Documentation

std::vector<std::vector<double> >& mlpack::range::BiSearchVisitor::distances
private

The result vector for distances.

Definition at line 86 of file rs_model.hpp.

const size_t mlpack::range::BiSearchVisitor::leafSize
private

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

Definition at line 88 of file rs_model.hpp.

std::vector<std::vector<size_t> >& mlpack::range::BiSearchVisitor::neighbors
private

The result vector for neighbors.

Definition at line 84 of file rs_model.hpp.

const arma::mat& mlpack::range::BiSearchVisitor::querySet
private

The query set for the bichromatic search.

Definition at line 80 of file rs_model.hpp.

const math::Range& mlpack::range::BiSearchVisitor::range
private

Range to search neighbours for.

Definition at line 82 of file rs_model.hpp.


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