mlpack  3.4.2
ra_query_stat.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_RANN_RA_QUERY_STAT_HPP
14 #define MLPACK_METHODS_RANN_RA_QUERY_STAT_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
19 
22 
23 namespace mlpack {
24 namespace neighbor {
25 
34 template<typename SortPolicy>
36 {
37  public:
42  RAQueryStat() : bound(SortPolicy::WorstDistance()), numSamplesMade(0) { }
43 
47  template<typename TreeType>
48  RAQueryStat(const TreeType& /* node */) :
49  bound(SortPolicy::WorstDistance()),
50  numSamplesMade(0)
51  { }
52 
54  double Bound() const { return bound; }
56  double& Bound() { return bound; }
57 
59  size_t NumSamplesMade() const { return numSamplesMade; }
61  size_t& NumSamplesMade() { return numSamplesMade; }
62 
64  template<typename Archive>
65  void serialize(Archive& ar, const unsigned int /* version */)
66  {
67  ar & BOOST_SERIALIZATION_NVP(bound);
68  ar & BOOST_SERIALIZATION_NVP(numSamplesMade);
69  }
70 
71  private:
73  double bound;
75  size_t numSamplesMade;
76 };
77 
78 } // namespace neighbor
79 } // namespace mlpack
80 
81 #endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::neighbor::RAQueryStat
Extra data for each node in the tree.
Definition: ra_query_stat.hpp:36
nearest_neighbor_sort.hpp
lmetric.hpp
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::neighbor::RAQueryStat::Bound
double & Bound()
Modify the bound.
Definition: ra_query_stat.hpp:56
mlpack::neighbor::RAQueryStat::serialize
void serialize(Archive &ar, const unsigned int)
Serialize the statistic.
Definition: ra_query_stat.hpp:65
mlpack::neighbor::RAQueryStat::NumSamplesMade
size_t NumSamplesMade() const
Get the number of samples made.
Definition: ra_query_stat.hpp:59
mlpack::neighbor::RAQueryStat::Bound
double Bound() const
Get the bound.
Definition: ra_query_stat.hpp:54
mlpack::neighbor::RAQueryStat::RAQueryStat
RAQueryStat(const TreeType &)
Initialization for a node.
Definition: ra_query_stat.hpp:48
mlpack::neighbor::RAQueryStat::RAQueryStat
RAQueryStat()
Initialize the statistic with the worst possible distance according to our sorting policy.
Definition: ra_query_stat.hpp:42
mlpack::neighbor::RAQueryStat::NumSamplesMade
size_t & NumSamplesMade()
Modify the number of samples made.
Definition: ra_query_stat.hpp:61
binary_space_tree.hpp