mlpack 3.4.2
drusilla_select.hpp
Go to the documentation of this file.
1
30#ifndef MLPACK_METHODS_APPROX_KFN_DRUSILLA_SELECT_HPP
31#define MLPACK_METHODS_APPROX_KFN_DRUSILLA_SELECT_HPP
32
33#include <mlpack/prereqs.hpp>
34
35namespace mlpack {
36namespace neighbor {
37
38template<typename MatType = arma::mat>
40{
41 public:
51 DrusillaSelect(const MatType& referenceSet,
52 const size_t l,
53 const size_t m);
54
62 DrusillaSelect(const size_t l, const size_t m);
63
73 void Train(const MatType& referenceSet,
74 const size_t l = 0,
75 const size_t m = 0);
76
91 void Search(const MatType& querySet,
92 const size_t k,
93 arma::Mat<size_t>& neighbors,
94 arma::mat& distances);
95
99 template<typename Archive>
100 void serialize(Archive& ar, const unsigned int /* version */);
101
103 const MatType& CandidateSet() const { return candidateSet; }
105 MatType& CandidateSet() { return candidateSet; }
106
108 const arma::Col<size_t>& CandidateIndices() const { return candidateIndices; }
110 arma::Col<size_t>& CandidateIndices() { return candidateIndices; }
111
112 private:
114 MatType candidateSet;
116 arma::Col<size_t> candidateIndices;
117
119 size_t l;
121 size_t m;
122};
123
124} // namespace neighbor
125} // namespace mlpack
126
127// Include implementation.
128#include "drusilla_select_impl.hpp"
129
130#endif
void Train(const MatType &referenceSet, const size_t l=0, const size_t m=0)
Build the set of candidate points on the given reference set.
void Search(const MatType &querySet, const size_t k, arma::Mat< size_t > &neighbors, arma::mat &distances)
Search for the k furthest neighbors of the given query set.
MatType & CandidateSet()
Modify the candidate set. Be careful!
arma::Col< size_t > & CandidateIndices()
Modify the indices of points in the candidate set. Be careful!
const arma::Col< size_t > & CandidateIndices() const
Access the indices of points in the candidate set.
DrusillaSelect(const MatType &referenceSet, const size_t l, const size_t m)
Construct the DrusillaSelect object with the given reference set (this is the set that will be search...
DrusillaSelect(const size_t l, const size_t m)
Construct the DrusillaSelect object with no given reference set.
const MatType & CandidateSet() const
Access the candidate set.
void serialize(Archive &ar, const unsigned int)
Serialize the model.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.