mlpack  master
range_search_stat.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_STAT_HPP
14 #define MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_STAT_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace range {
20 
27 {
28  public:
33 
38  template<typename TreeType>
39  RangeSearchStat(TreeType& /* node */) :
40  lastDistance(0.0) { }
41 
43  double LastDistance() const { return lastDistance; }
45  double& LastDistance() { return lastDistance; }
46 
48  template<typename Archive>
49  void Serialize(Archive& ar, const unsigned int /* version */)
50  {
51  ar & data::CreateNVP(lastDistance, "lastDistance");
52  }
53 
54  private:
56  double lastDistance;
57 };
58 
59 } // namespace neighbor
60 } // namespace mlpack
61 
62 #endif
double & LastDistance()
Modify the last distance evaluation.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
double lastDistance
The last distance evaluation.
The core includes that mlpack expects; standard C++ includes and Armadillo.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function.
double LastDistance() const
Get the last distance evaluation.
void Serialize(Archive &ar, const unsigned int)
Serialize the statistic.
RangeSearchStat(TreeType &)
Initialize the statistic given a tree node that this statistic belongs to.
Statistic class for RangeSearch, to be set to the StatisticType of the tree type that range search is...
RangeSearchStat()
Initialize the statistic.