mlpack: a scalable c++ machine learning library
mlpack  2.0.2
range_search_stat.hpp
Go to the documentation of this file.
1 
15 #ifndef mlpack_METHODS_RANGE_SEARCH_RANGE_SEARCH_STAT_HPP
16 #define mlpack_METHODS_RANGE_SEARCH_RANGE_SEARCH_STAT_HPP
17 
18 #include <mlpack/core.hpp>
19 
20 namespace mlpack {
21 namespace range {
22 
29 {
30  public:
35 
40  template<typename TreeType>
41  RangeSearchStat(TreeType& /* node */) :
42  lastDistance(0.0) { }
43 
45  double LastDistance() const { return lastDistance; }
47  double& LastDistance() { return lastDistance; }
48 
50  template<typename Archive>
51  void Serialize(Archive& ar, const unsigned int /* version */)
52  {
53  ar & data::CreateNVP(lastDistance, "lastDistance");
54  }
55 
56  private:
58  double lastDistance;
59 };
60 
61 } // namespace neighbor
62 } // namespace mlpack
63 
64 #endif
double & LastDistance()
Modify the last distance evaluation.
Linear algebra utility functions, generally performed on matrices or vectors.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename boost::enable_if< HasSerialize< T >>::type *=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
The last distance evaluation.
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...
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
RangeSearchStat()
Initialize the statistic.