mlpack 3.4.2
Public Types | Public Member Functions | List of all members
TrainVisitor< SortPolicy > Class Template Reference

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

#include <ns_model.hpp>

Inheritance diagram for TrainVisitor< 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...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
using RATypeT = RAType< SortPolicy, 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 for BinarySpaceTrees. More...
 
 TrainVisitor (arma::mat &&referenceSet, const size_t leafSize, const double tau, const double rho)
 Construct the TrainVisitor object with the given reference set, leafSize for BinarySpaceTrees, and tau and rho for spill trees. More...
 
void operator() (NSTypeT< tree::BallTree > *ns) const
 Train on the given NSType specialized for BallTrees. More...
 
void operator() (NSTypeT< tree::KDTree > *ns) const
 Train on the given NSType specialized for KDTrees. More...
 
void operator() (NSTypeT< tree::Octree > *ns) const
 Train specialized for octrees. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (NSTypeT< TreeType > *ns) const
 Default Train on the given NSType instance. More...
 
void operator() (RATypeT< tree::KDTree > *ra) const
 Train on the given RAType specialized for KDTrees. More...
 
void operator() (RATypeT< tree::Octree > *ra) const
 Train on the given RAType specialized for Octrees. More...
 
template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void operator() (RATypeT< TreeType > *ra) const
 Default Train on the given RAType instance. More...
 
void operator() (SpillKNN *ns) const
 Train specialized for SPTrees. More...
 

Detailed Description

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

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

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

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.

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

Definition at line 127 of file ra_model.hpp.

Member Typedef Documentation

◆ NSTypeT

using NSTypeT = NSType<SortPolicy, TreeType>

Alias template necessary for visual c++ compiler.

Definition at line 165 of file ns_model.hpp.

◆ RATypeT

using RATypeT = RAType<SortPolicy, TreeType>

Alias template necessary for visual c++ compiler.

Definition at line 144 of file ra_model.hpp.

Constructor & Destructor Documentation

◆ TrainVisitor() [1/2]

TrainVisitor ( arma::mat &&  referenceSet,
const size_t  leafSize,
const double  tau,
const double  rho 
)

Construct the TrainVisitor object with the given reference set, leafSize for BinarySpaceTrees, and tau and rho for spill trees.

◆ TrainVisitor() [2/2]

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

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

Member Function Documentation

◆ operator()() [1/8]

void operator() ( NSTypeT< tree::BallTree > *  ns) const

Train on the given NSType specialized for BallTrees.

◆ operator()() [2/8]

void operator() ( NSTypeT< tree::KDTree > *  ns) const

Train on the given NSType specialized for KDTrees.

◆ operator()() [3/8]

void operator() ( NSTypeT< tree::Octree > *  ns) const

Train specialized for octrees.

◆ operator()() [4/8]

void operator() ( NSTypeT< TreeType > *  ns) const

Default Train on the given NSType instance.

◆ operator()() [5/8]

void operator() ( RATypeT< tree::KDTree > *  ra) const

Train on the given RAType specialized for KDTrees.

◆ operator()() [6/8]

void operator() ( RATypeT< tree::Octree > *  ra) const

Train on the given RAType specialized for Octrees.

◆ operator()() [7/8]

void operator() ( RATypeT< TreeType > *  ra) const

Default Train on the given RAType instance.

◆ operator()() [8/8]

void operator() ( SpillKNN ns) const

Train specialized for SPTrees.


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