NearestNeighborQueryEngine2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: NearestNeighborQueryEngine2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Abstract base class for 2-D nearest neigbor query engine.
6 > Created Time: 2017/10/14
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_NEAREST_NEIGHBOR_QUERY_ENGINE2_H
10 #define CUBBYFLOW_NEAREST_NEIGHBOR_QUERY_ENGINE2_H
11 
12 #include <Core/Vector/Vector2.h>
13 
14 namespace CubbyFlow
15 {
17  template <typename T>
19  {
20  const T* item = nullptr;
21  double distance = std::numeric_limits<double>::max();
22  };
23 
25  template <typename T>
26  using NearestNeighborDistanceFunc2 = std::function<double(const T&, const Vector2D&)>;
27 
29  template <typename T>
31  {
32  public:
35  const Vector2D& pt,
36  const NearestNeighborDistanceFunc2<T>& distanceFunc) const = 0;
37  };
38 }
39 
40 #endif
double distance
Definition: NearestNeighborQueryEngine2.h:21
Nearest neighbor query result.
Definition: NearestNeighborQueryEngine2.h:18
const T * item
Definition: NearestNeighborQueryEngine2.h:20
Definition: pybind11Utils.h:24
virtual NearestNeighborQueryResult2< T > GetNearestNeighbor(const Vector2D &pt, const NearestNeighborDistanceFunc2< T > &distanceFunc) const =0
Returns the nearest neighbor for given point and distance measure function.
2-D vector class.
Definition: Vector2.h:26
Abstract base class for 2-D nearest neighbor query engine.
Definition: NearestNeighborQueryEngine2.h:30
std::function< double(const T &, const Vector2D &)> NearestNeighborDistanceFunc2
Nearest neighbor distance measure function.
Definition: NearestNeighborQueryEngine2.h:26