NSWrapperBase is a base wrapper class for holding all NeighborSearch types supported by NSModel. More...
Public Member Functions | |
NSWrapperBase () | |
Create the NSWrapperBase object. More... | |
virtual | ~NSWrapperBase () |
Destruct the NSWrapperBase (nothing to do). More... | |
virtual NSWrapperBase * | Clone () const =0 |
Create a new NSWrapperBase that is the same as this one. More... | |
virtual const arma::mat & | Dataset () const =0 |
Return a reference to the dataset. More... | |
virtual double | Epsilon () const =0 |
Get the approximation parameter epsilon. More... | |
virtual double & | Epsilon ()=0 |
Modify the approximation parameter epsilon. 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 leafSize, const double rho)=0 |
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)=0 |
Perform monochromatic neighbor search (i.e. More... | |
virtual NeighborSearchMode | SearchMode () const =0 |
Get the search mode. More... | |
virtual NeighborSearchMode & | SearchMode ()=0 |
Modify the search modem. More... | |
virtual void | Train (util::Timers &timers, arma::mat &&referenceSet, const size_t leafSize, const double tau, const double rho)=0 |
Train the NeighborSearch model with the given parameters. More... | |
NSWrapperBase is a base wrapper class for holding all NeighborSearch types supported by NSModel.
All NeighborSearch type wrappers inherit from this class, allowing a simple interface via inheritance for all the different types we want to support.
Definition at line 35 of file ns_model.hpp.
|
inline |
Create the NSWrapperBase object.
The base class does not hold anything, so this constructor does not do anything.
Definition at line 40 of file ns_model.hpp.
References NSWrapperBase::Clone().
|
inlinevirtual |
Destruct the NSWrapperBase (nothing to do).
Definition at line 47 of file ns_model.hpp.
References NSWrapperBase::Dataset(), NSWrapperBase::Epsilon(), NSWrapperBase::Search(), NSWrapperBase::SearchMode(), and NSWrapperBase::Train().
|
pure virtual |
Create a new NSWrapperBase that is the same as this one.
This function will properly handle polymorphism.
Implemented in SpillNSWrapper< SortPolicy >, LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by NSWrapperBase::NSWrapperBase().
|
pure virtual |
Return a reference to the dataset.
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by NSWrapperBase::~NSWrapperBase().
|
pure virtual |
Get the approximation parameter epsilon.
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by NSModel< SortPolicy >::Rho(), and NSWrapperBase::~NSWrapperBase().
|
pure virtual |
Modify the approximation parameter epsilon.
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
|
pure virtual |
Perform bichromatic neighbor search (i.e.
search with a separate query set).
Implemented in SpillNSWrapper< SortPolicy >, LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >::Clone(), SpillNSWrapper< SortPolicy >::Clone(), NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >::Epsilon(), NSModel< SortPolicy >::RandomBasis(), and NSWrapperBase::~NSWrapperBase().
|
pure virtual |
Perform monochromatic neighbor search (i.e.
use the reference set as the query set).
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
|
pure virtual |
Get the search mode.
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by NSWrapperBase::~NSWrapperBase().
|
pure virtual |
Modify the search modem.
Implemented in NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
|
pure virtual |
Train the NeighborSearch model with the given parameters.
Implemented in SpillNSWrapper< SortPolicy >, LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, NSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >, and NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >.
Referenced by LeafSizeNSWrapper< SortPolicy, TreeType, DualTreeTraversalType, SingleTreeTraversalType >::Clone(), SpillNSWrapper< SortPolicy >::Clone(), NSWrapper< SortPolicy, tree::SPTree, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistDualTreeTraverser, tree::SPTree< metric::EuclideanDistance, NeighborSearchStat< SortPolicy >, arma::mat >::template DefeatistSingleTreeTraverser >::Epsilon(), and NSWrapperBase::~NSWrapperBase().