mlpack
Public Member Functions | Protected Types | Protected Attributes | List of all members
mlpack::neighbor::RAWrapper< TreeType > Class Template Reference

RAWrapper is a wrapper class for most RASearch types. More...

#include <ra_model.hpp>

Inheritance diagram for mlpack::neighbor::RAWrapper< TreeType >:
Inheritance graph
[legend]
Collaboration diagram for mlpack::neighbor::RAWrapper< TreeType >:
Collaboration graph
[legend]

Public Member Functions

 RAWrapper (const bool singleMode, const bool naive)
 Construct the RAWrapper object, initializing the internally-held RASearch object. More...
 
virtual ~RAWrapper ()
 Delete the RAWrapper object.
 
virtual RAWrapperClone () const
 Create a copy of this RAWrapper object. More...
 
const arma::mat & Dataset () const
 Get a reference to the reference set.
 
size_t SingleSampleLimit () const
 Get the single sample limit.
 
size_t & SingleSampleLimit ()
 Modify the single sample limit.
 
bool FirstLeafExact () const
 Get whether to do exact search at the first leaf.
 
bool & FirstLeafExact ()
 Modify whether to do exact search at the first leaf.
 
bool SampleAtLeaves () const
 Get whether to do sampling at leaves.
 
bool & SampleAtLeaves ()
 Modify whether to do sampling at leaves.
 
double Alpha () const
 Get the value of alpha.
 
double & Alpha ()
 Modify the value of alpha.
 
double Tau () const
 Get the value of tau.
 
double & Tau ()
 Modify the value of tau.
 
bool SingleMode () const
 Get whether single-tree search is being used.
 
bool & SingleMode ()
 Modify whether single-tree search is being used.
 
bool Naive () const
 Get whether naive search is being used.
 
bool & Naive ()
 Modify whether naive search is being used.
 
virtual void Train (arma::mat &&referenceSet, const size_t)
 Train the model. For RAWrapper, we ignore the leaf size.
 
virtual void Search (arma::mat &&querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances, const size_t)
 Perform bichromatic neighbor search (i.e. More...
 
virtual void Search (const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Perform monochromatic neighbor search (i.e. More...
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the RASearch model.
 
- Public Member Functions inherited from mlpack::neighbor::RAWrapperBase
 RAWrapperBase ()
 Create the RAWrapperBase object. More...
 
virtual ~RAWrapperBase ()
 Destruct the RAWrapperBase (nothing to do).
 

Protected Types

typedef RASearch< NearestNeighborSort, metric::EuclideanDistance, arma::mat, TreeType > RAType
 

Protected Attributes

RAType ra
 The instantiated RASearch object that we are wrapping.
 

Detailed Description

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
class mlpack::neighbor::RAWrapper< TreeType >

RAWrapper is a wrapper class for most RASearch types.

Constructor & Destructor Documentation

◆ RAWrapper()

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
mlpack::neighbor::RAWrapper< TreeType >::RAWrapper ( const bool  singleMode,
const bool  naive 
)
inline

Construct the RAWrapper object, initializing the internally-held RASearch object.

Member Function Documentation

◆ Clone()

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
virtual RAWrapper* mlpack::neighbor::RAWrapper< TreeType >::Clone ( ) const
inlinevirtual

Create a copy of this RAWrapper object.

This correctly handles polymorphism.

Implements mlpack::neighbor::RAWrapperBase.

Reimplemented in mlpack::neighbor::LeafSizeRAWrapper< TreeType >.

◆ Search() [1/2]

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void mlpack::neighbor::RAWrapper< TreeType >::Search ( arma::mat &&  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances,
const size_t   
)
virtual

Perform bichromatic neighbor search (i.e.

search with a separate query set). For RAWrapper, we ignore the leaf size.

Implements mlpack::neighbor::RAWrapperBase.

Reimplemented in mlpack::neighbor::LeafSizeRAWrapper< TreeType >.

◆ Search() [2/2]

template<template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType>
void mlpack::neighbor::RAWrapper< TreeType >::Search ( const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)
virtual

Perform monochromatic neighbor search (i.e.

search where the reference set is used as the query set).

Implements mlpack::neighbor::RAWrapperBase.


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