mlpack
|
NSWrapper is a wrapper class for most NeighborSearch types. More...
#include <ns_model.hpp>
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. | |
virtual NSWrapper * | Clone () const |
Create a copy of this NSWrapper object. More... | |
const arma::mat & | Dataset () const |
Get a reference to the reference set. | |
NeighborSearchMode | SearchMode () const |
Get the search mode. | |
NeighborSearchMode & | SearchMode () |
Modify the search mode. | |
double | Epsilon () const |
Get epsilon, the approximation parameter. | |
double & | Epsilon () |
Modify epsilon, the approximation parameter. | |
virtual void | Train (arma::mat &&referenceSet, const size_t, const double, const double) |
Train the model with the given options. More... | |
virtual void | Search (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 (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 NeighborSearch model. | |
![]() | |
NSWrapperBase () | |
Create the NSWrapperBase object. More... | |
virtual | ~NSWrapperBase () |
Destruct the NSWrapperBase (nothing to do). | |
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. | |
NSWrapper is a wrapper class for most NeighborSearch types.
|
inline |
Construct the NSWrapper object, initializing the internally-held NeighborSearch object.
|
inlinevirtual |
Create a copy of this NSWrapper object.
This correctly handles polymorphism.
Implements mlpack::neighbor::NSWrapperBase.
Reimplemented in mlpack::neighbor::SpillNSWrapper< SortPolicy >, and mlpack::neighbor::LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.
|
virtual |
Perform bichromatic neighbor search (i.e.
search with a separate query set). For NSWrapper, we ignore the extra parameters.
Implements mlpack::neighbor::NSWrapperBase.
Reimplemented in mlpack::neighbor::SpillNSWrapper< SortPolicy >, and mlpack::neighbor::LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.
|
virtual |
Perform monochromatic neighbor search (i.e.
use the reference set as the query set).
Implements mlpack::neighbor::NSWrapperBase.
|
virtual |
Train the model with the given options.
For NSWrapper, we ignore the extra parameters.
Implements mlpack::neighbor::NSWrapperBase.
Reimplemented in mlpack::neighbor::SpillNSWrapper< SortPolicy >, and mlpack::neighbor::LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >.