RAWrapper< TreeType > Class Template Reference

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

Inheritance diagram for RAWrapper< TreeType >:

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. More...

 
double Alpha () const
 Get the value of alpha. More...

 
double & Alpha ()
 Modify the value of alpha. More...

 
virtual RAWrapperClone () const
 Create a copy of this RAWrapper object. More...

 
const arma::mat & Dataset () const
 Get a reference to the reference set. More...

 
bool FirstLeafExact () const
 Get whether to do exact search at the first leaf. More...

 
bool & FirstLeafExact ()
 Modify whether to do exact search at the first leaf. More...

 
bool Naive () const
 Get whether naive search is being used. More...

 
bool & Naive ()
 Modify whether naive search is being used. More...

 
bool SampleAtLeaves () const
 Get whether to do sampling at leaves. More...

 
bool & SampleAtLeaves ()
 Modify whether to do sampling at leaves. More...

 
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. More...

 
bool SingleMode () const
 Get whether single-tree search is being used. More...

 
bool & SingleMode ()
 Modify whether single-tree search is being used. More...

 
size_t SingleSampleLimit () const
 Get the single sample limit. More...

 
size_t & SingleSampleLimit ()
 Modify the single sample limit. More...

 
double Tau () const
 Get the value of tau. More...

 
double & Tau ()
 Modify the value of tau. More...

 
virtual void Train (arma::mat &&referenceSet, const size_t)
 Train the model. For RAWrapper, we ignore the leaf size. More...

 
- Public Member Functions inherited from RAWrapperBase
 RAWrapperBase ()
 Create the RAWrapperBase object. More...

 
virtual ~RAWrapperBase ()
 Destruct the RAWrapperBase (nothing to do). More...

 

Protected Types

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

Protected Attributes

RAType ra
 The instantiated RASearch object that we are wrapping. More...

 

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.

Definition at line 109 of file ra_model.hpp.

Member Typedef Documentation

◆ RAType

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

Definition at line 194 of file ra_model.hpp.

Constructor & Destructor Documentation

◆ RAWrapper()

RAWrapper ( const bool  singleMode,
const bool  naive 
)
inline

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

Definition at line 114 of file ra_model.hpp.

◆ ~RAWrapper()

virtual ~RAWrapper ( )
inlinevirtual

Delete the RAWrapper object.

Definition at line 121 of file ra_model.hpp.

Member Function Documentation

◆ Alpha() [1/2]

double Alpha ( ) const
inlinevirtual

Get the value of alpha.

Implements RAWrapperBase.

Definition at line 146 of file ra_model.hpp.

◆ Alpha() [2/2]

double& Alpha ( )
inlinevirtual

Modify the value of alpha.

Implements RAWrapperBase.

Definition at line 148 of file ra_model.hpp.

◆ Clone()

virtual RAWrapper* Clone ( ) const
inlinevirtual

Create a copy of this RAWrapper object.

This correctly handles polymorphism.

Implements RAWrapperBase.

Reimplemented in LeafSizeRAWrapper< TreeType >.

Definition at line 125 of file ra_model.hpp.

◆ Dataset()

const arma::mat& Dataset ( ) const
inlinevirtual

Get a reference to the reference set.

Implements RAWrapperBase.

Definition at line 128 of file ra_model.hpp.

◆ FirstLeafExact() [1/2]

bool FirstLeafExact ( ) const
inlinevirtual

Get whether to do exact search at the first leaf.

Implements RAWrapperBase.

Definition at line 136 of file ra_model.hpp.

◆ FirstLeafExact() [2/2]

bool& FirstLeafExact ( )
inlinevirtual

Modify whether to do exact search at the first leaf.

Implements RAWrapperBase.

Definition at line 138 of file ra_model.hpp.

◆ Naive() [1/2]

bool Naive ( ) const
inlinevirtual

Get whether naive search is being used.

Implements RAWrapperBase.

Definition at line 161 of file ra_model.hpp.

◆ Naive() [2/2]

bool& Naive ( )
inlinevirtual

Modify whether naive search is being used.

Implements RAWrapperBase.

Definition at line 163 of file ra_model.hpp.

References RAWrapperBase::Search(), and RAWrapperBase::Train().

◆ SampleAtLeaves() [1/2]

bool SampleAtLeaves ( ) const
inlinevirtual

Get whether to do sampling at leaves.

Implements RAWrapperBase.

Definition at line 141 of file ra_model.hpp.

◆ SampleAtLeaves() [2/2]

bool& SampleAtLeaves ( )
inlinevirtual

Modify whether to do sampling at leaves.

Implements RAWrapperBase.

Definition at line 143 of file ra_model.hpp.

◆ Search() [1/2]

virtual void 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 RAWrapperBase.

Reimplemented in LeafSizeRAWrapper< TreeType >.

◆ Search() [2/2]

virtual void 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 RAWrapperBase.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)
inline

Serialize the RASearch model.

Definition at line 185 of file ra_model.hpp.

◆ SingleMode() [1/2]

bool SingleMode ( ) const
inlinevirtual

Get whether single-tree search is being used.

Implements RAWrapperBase.

Definition at line 156 of file ra_model.hpp.

◆ SingleMode() [2/2]

bool& SingleMode ( )
inlinevirtual

Modify whether single-tree search is being used.

Implements RAWrapperBase.

Definition at line 158 of file ra_model.hpp.

◆ SingleSampleLimit() [1/2]

size_t SingleSampleLimit ( ) const
inlinevirtual

Get the single sample limit.

Implements RAWrapperBase.

Definition at line 131 of file ra_model.hpp.

◆ SingleSampleLimit() [2/2]

size_t& SingleSampleLimit ( )
inlinevirtual

Modify the single sample limit.

Implements RAWrapperBase.

Definition at line 133 of file ra_model.hpp.

◆ Tau() [1/2]

double Tau ( ) const
inlinevirtual

Get the value of tau.

Implements RAWrapperBase.

Definition at line 151 of file ra_model.hpp.

◆ Tau() [2/2]

double& Tau ( )
inlinevirtual

Modify the value of tau.

Implements RAWrapperBase.

Definition at line 153 of file ra_model.hpp.

◆ Train()

virtual void Train ( arma::mat &&  referenceSet,
const size_t   
)
virtual

Train the model. For RAWrapper, we ignore the leaf size.

Implements RAWrapperBase.

Reimplemented in LeafSizeRAWrapper< TreeType >.

Member Data Documentation

◆ ra

RAType ra
protected

The instantiated RASearch object that we are wrapping.

Definition at line 197 of file ra_model.hpp.


The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-git/src/mlpack/methods/rann/ra_model.hpp