NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType > Class Template Reference

NSWrapper is a wrapper class for most NeighborSearch types. More...

Inheritance diagram for NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >:

Public Member Functions

 NSWrapper (const NeighborSearchMode searchMode, const double epsilon)
 Construct the NSWrapper object, initializing the internally-held NeighborSearch object. More...

 
virtual ~NSWrapper ()
 Delete the NSWrapper object. More...

 
virtual NSWrapperClone () const
 Create a copy of this NSWrapper object. More...

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

 
double Epsilon () const
 Get epsilon, the approximation parameter. More...

 
double & Epsilon ()
 Modify epsilon, the approximation parameter. More...

 
virtual void Search (util::Timers &timers, arma::mat &&querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances, const size_t, const double)
 Perform bichromatic neighbor search (i.e. More...

 
virtual void Search (util::Timers &timers, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
 Perform monochromatic neighbor search (i.e. More...

 
NeighborSearchMode SearchMode () const
 Get the search mode. More...

 
NeighborSearchModeSearchMode ()
 Modify the search mode. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const uint32_t)
 Serialize the NeighborSearch model. More...

 
virtual void Train (util::Timers &timers, arma::mat &&referenceSet, const size_t, const double, const double)
 Train the model with the given options. More...

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

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

 

Protected Types

typedef NeighborSearch< SortPolicy, metric::EuclideanDistance, arma::mat, TreeType, DualTreeTraversalType, SingleTreeTraversalType > NSType
 

Protected Attributes

NSType ns
 The instantiated NeighborSearch object that we are wrapping. More...

 

Detailed Description


template<typename SortPolicy, template< typename TreeMetricType, typename TreeStatType, typename TreeMatType > class TreeType, template< typename RuleType > class DualTreeTraversalType = TreeType<metric::EuclideanDistance, NeighborSearchStat<SortPolicy>, arma::mat>::template DualTreeTraverser, template< typename RuleType > class SingleTreeTraversalType = TreeType<metric::EuclideanDistance, NeighborSearchStat<SortPolicy>, arma::mat>::template SingleTreeTraverser>
class mlpack::neighbor::NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >

NSWrapper is a wrapper class for most NeighborSearch types.

Definition at line 102 of file ns_model.hpp.

Member Typedef Documentation

◆ NSType

typedef NeighborSearch<SortPolicy, metric::EuclideanDistance, arma::mat, TreeType, DualTreeTraversalType, SingleTreeTraversalType> NSType
protected

Definition at line 173 of file ns_model.hpp.

Constructor & Destructor Documentation

◆ NSWrapper()

NSWrapper ( const NeighborSearchMode  searchMode,
const double  epsilon 
)
inline

Construct the NSWrapper object, initializing the internally-held NeighborSearch object.

Definition at line 107 of file ns_model.hpp.

◆ ~NSWrapper()

virtual ~NSWrapper ( )
inlinevirtual

Delete the NSWrapper object.

Definition at line 115 of file ns_model.hpp.

Member Function Documentation

◆ Clone()

virtual NSWrapper* Clone ( ) const
inlinevirtual

Create a copy of this NSWrapper object.

This correctly handles polymorphism.

Implements NSWrapperBase.

Reimplemented in SpillNSWrapper< SortPolicy >, and LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.

Definition at line 119 of file ns_model.hpp.

◆ Dataset()

const arma::mat& Dataset ( ) const
inlinevirtual

Get a reference to the reference set.

Implements NSWrapperBase.

Definition at line 122 of file ns_model.hpp.

◆ Epsilon() [1/2]

double Epsilon ( ) const
inlinevirtual

Get epsilon, the approximation parameter.

Implements NSWrapperBase.

Definition at line 130 of file ns_model.hpp.

◆ Epsilon() [2/2]

double& Epsilon ( )
inlinevirtual

Modify epsilon, the approximation parameter.

Implements NSWrapperBase.

Definition at line 132 of file ns_model.hpp.

◆ Search() [1/2]

virtual void Search ( util::Timers timers,
arma::mat &&  querySet,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances,
const size_t  ,
const double   
)
virtual

Perform bichromatic neighbor search (i.e.

search with a separate query set). For NSWrapper, we ignore the extra parameters.

Implements NSWrapperBase.

Reimplemented in SpillNSWrapper< SortPolicy >, and LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.

◆ Search() [2/2]

virtual void Search ( util::Timers timers,
const size_t  k,
arma::Mat< size_t > &  neighbors,
arma::mat &  distances 
)
virtual

Perform monochromatic neighbor search (i.e.

use the reference set as the query set).

Implements NSWrapperBase.

◆ SearchMode() [1/2]

NeighborSearchMode SearchMode ( ) const
inlinevirtual

Get the search mode.

Implements NSWrapperBase.

Definition at line 125 of file ns_model.hpp.

◆ SearchMode() [2/2]

NeighborSearchMode& SearchMode ( )
inlinevirtual

Modify the search mode.

Implements NSWrapperBase.

Definition at line 127 of file ns_model.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const uint32_t   
)
inline

Serialize the NeighborSearch model.

Definition at line 161 of file ns_model.hpp.

◆ Train()

virtual void Train ( util::Timers timers,
arma::mat &&  referenceSet,
const size_t  ,
const double  ,
const double   
)
virtual

Train the model with the given options.

For NSWrapper, we ignore the extra parameters.

Implements NSWrapperBase.

Reimplemented in SpillNSWrapper< SortPolicy >, and LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.

Member Data Documentation

◆ ns

NSType ns
protected

The instantiated NeighborSearch object that we are wrapping.

Definition at line 176 of file ns_model.hpp.


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