-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplitPointStrategy.hpp
More file actions
executable file
·36 lines (30 loc) · 1.09 KB
/
SplitPointStrategy.hpp
File metadata and controls
executable file
·36 lines (30 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef ROSSB83_SPLIT_POINT_STRATEGY_HPP
#define ROSSB83_SPLIT_POINT_STRATEGY_HPP
#include <iostream>
#include <vector>
#include <memory>
#include <fstream>
#include <sstream>
#include <queue>
#include <stack>
#include <unordered_map>
#include <tuple>
#include <regex>
#include <functional>
#include <algorithm>
#include <numeric>
#include <limits>
#include <math.h>
#include <complex>
namespace rossb83 {
// this abstract class is an interface to determine which point the kdtree will make the next node, it works by
// finding the median in an input vector of points and placing that median point in the center of the vector
template<typename T>
class SplitPointStrategy {
public:
// this pure virtual method is an interface to the point selection strategy, it will re-arrange the input
// point vector with the median placed at the center between begin and end
virtual Point<T> splitPoint(std::vector<Point<T>>& points, const std::size_t& dim, const std::size_t& begin, const std::size_t& end) = 0;
}; // class SplitPointStrategy
} // namespace rossb83
#endif // ROSSB83_SPLIT_POINT_STRATEGY