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

TrainVisitor sets the reference set to a new reference set on the given RSType. More...

Inheritance diagram for mlpack::range::TrainVisitor:
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

 TrainVisitor (arma::mat &&referenceSet, const size_t leafSize)
 Construct the TrainVisitor object with the given reference set, leafSize. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (RSTypeT< TreeType > *rs) const
 Default Train on the given RSType instance. More...
 
void operator() (RSTypeT< tree::KDTree > *rs) const
 Train on the given RSType specialized for KDTrees. More...
 
void operator() (RSTypeT< tree::BallTree > *rs) const
 Train on the given RSType specialized for BallTrees. More...
 
void operator() (RSTypeT< tree::Octree > *rs) const
 Train specialized for octrees. More...
 

Private Member Functions

template<typename RSType >
void TrainLeaf (RSType *rs) const
 Train on the given RsType considering the leafSize. More...
 

Private Attributes

size_t leafSize
 The leaf size, used only by BinarySpaceTree. More...
 
arma::mat && referenceSet
 The reference set to use for training. More...
 

Detailed Description

TrainVisitor sets the reference set to a new reference set on the given RSType.

We use template specialization to differentiate those tree types that accept leafSize as a parameter. In these cases, a reference tree with proper leafSize is built from the referenceSet.

Definition at line 130 of file rs_model.hpp.

Member Typedef Documentation

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

Alias template necessary for visual c++ compiler.

Definition at line 146 of file rs_model.hpp.

Constructor & Destructor Documentation

mlpack::range::TrainVisitor::TrainVisitor ( arma::mat &&  referenceSet,
const size_t  leafSize 
)

Construct the TrainVisitor object with the given reference set, leafSize.

Member Function Documentation

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

Default Train on the given RSType instance.

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

Train on the given RSType specialized for KDTrees.

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

Train on the given RSType specialized for BallTrees.

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

Train specialized for octrees.

template<typename RSType >
void mlpack::range::TrainVisitor::TrainLeaf ( RSType rs) const
private

Train on the given RsType considering the leafSize.

Member Data Documentation

size_t mlpack::range::TrainVisitor::leafSize
private

The leaf size, used only by BinarySpaceTree.

Definition at line 136 of file rs_model.hpp.

arma::mat&& mlpack::range::TrainVisitor::referenceSet
private

The reference set to use for training.

Definition at line 134 of file rs_model.hpp.


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