17 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_NS_MODEL_HPP 18 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_NS_MODEL_HPP 29 template<
typename SortPolicy>
32 static const std::string
Name() {
return "neighbor_search_model"; }
38 static const std::string
Name() {
return "nearest_neighbor_search_model"; }
44 static const std::string
Name() {
return "furthest_neighbor_search_model"; }
47 template<
typename SortPolicy>
68 template<
template<
typename TreeMetricType,
69 typename TreeStatType,
70 typename TreeMatType>
class TreeType>
77 arma::mat>::template DualTreeTraverser>;
91 NSModel(
int treeType = TreeTypes::KD_TREE,
bool randomBasis =
false);
97 template<
typename Archive>
98 void Serialize(Archive& ar,
const unsigned int );
101 const arma::mat& Dataset()
const;
104 bool SingleMode()
const;
120 void BuildModel(arma::mat&& referenceSet,
121 const size_t leafSize,
123 const bool singleMode);
126 void Search(arma::mat&& querySet,
128 arma::Mat<size_t>& neighbors,
129 arma::mat& distances);
132 void Search(
const size_t k,
133 arma::Mat<size_t>& neighbors,
134 arma::mat& distances);
136 std::string TreeName()
const;
143 #include "ns_model_impl.hpp"
static const std::string Name()
Linear algebra utility functions, generally performed on matrices or vectors.
LMetric< 2, true > EuclideanDistance
The Euclidean (L2) distance.
Extra data for each node in the tree.
The NeighborSearch class is a template class for performing distance-based neighbor searches...
NSType< tree::RStarTree > * rStarTreeNS
static const std::string Name()
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSear...
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSear...
NSType< tree::KDTree > * kdTreeNS
NSType< tree::StandardCoverTree > * coverTreeNS
static const std::string Name()
NSType< tree::RTree > * rTreeNS
NSType< tree::BallTree > * ballTreeNS