Go to the documentation of this file.
1 /*
3  *
4  * Created on: 21.05.2014
5  * Author: Moritz v. Looz (moritz.looz-corswarem@kit.edu)
6  */
7
10
11 #include <vector>
12 #include <memory>
13 #include <cmath>
14 #include <omp.h>
15 #include <functional>
17
18 namespace NetworKit {
19
20 template <class T>
23 public:
27  }
28
36  QuadtreePolarEuclid(double maxR,bool theoreticalSplit=false, double alpha=1, count capacity=1000, double balance = 0.5) {
37  root = QuadNodePolarEuclid<T>(0, 0, 2*M_PI, maxR, capacity, 0,theoreticalSplit,alpha,balance);
39  }
40
41  QuadtreePolarEuclid(const vector<double> &angles, const vector<double> &radii, const vector<T> &content, bool theoreticalSplit=false, count capacity=1000, double balance = 0.5) {
42  const count n = angles.size();
48  }
51  for (index i = 0; i < n; i++) {
52  assert(content[i] < n);
54  }
55  }
56
62  void addContent(T newcomer, double angle, double r) {
64  }
65
71  bool removeContent(T toRemove, double angle, double r) {
72  return root.removeContent(toRemove, angle, r);
73  }
74
80  vector<T> getElements() const {
81  return root.getElements();
82  }
83
84  void extractCoordinates(vector<double> &anglesContainer, vector<double> &radiiContainer) const {
86  }
87
88  void getElementsInEuclideanCircle(const Point2D<double> circleCenter, const double radius, vector<T> &circleDenizens) const {
90  }
91
92  count getElementsProbabilistically(Point2D<double> euQuery, std::function<double(double)> prob, vector<T> &circleDenizens) {
93  return root.getElementsProbabilistically(euQuery, prob, false, circleDenizens);
94  }
95
96  count getElementsProbabilistically(Point2D<double> euQuery, std::function<double(double)> prob, bool suppressLeft, vector<T> &circleDenizens) {
97  return root.getElementsProbabilistically(euQuery, prob, suppressLeft, circleDenizens);
98  }
99
100  void recount() {
101  root.recount();
102  }
103
104  count size() const {
105  return root.size();
106  }
107
108  count height() const {
109  return root.height();
110  }
111
112  count countLeaves() const {
113  return root.countLeaves();
114  }
115
117  return root.indexSubtree(nextID);
118  }
119
120  index getCellID(double phi, double r) const {
121  return root.getCellID(phi, r);
122  }
123
126  }
127
128  void reindex() {
129  #pragma omp parallel
130  {
131  #pragma omp single nowait
132  {
133  root.reindex(0);
134  }
135  }
136  }
137
141  void trim() {
142  root.trim();
143  }
144
145 private:
148 };
149 }
150
void reindex()
QuadtreePolarEuclid(const vector< double > &angles, const vector< double > &radii, const vector< T > &content, bool theoreticalSplit=false, count capacity=1000, double balance=0.5)
count countLeaves() const
count getElementsProbabilistically(Point2D< double > euQuery, std::function< double(double)> prob, bool suppressLeft, vector< T > &circleDenizens)
QuadtreePolarEuclid(double maxR, bool theoreticalSplit=false, double alpha=1, count capacity=1000, double balance=0.5)
index indexSubtree(index nextID)
count size() const
uint64_t index
Typedefs.
Definition: Globals.h:20
bool removeContent(T toRemove, double angle, double r)
void recount()
vector< T > getElements() const
Get all elements, regardless of position.
void addContent(T newcomer, double angle, double r)
void trim()
trims the vectors used to hold the content in the leaf cells.
index getCellID(double phi, double r) const
void extractCoordinates(vector< double > &anglesContainer, vector< double > &radiiContainer) const
count getElementsProbabilistically(Point2D< double > euQuery, std::function< double(double)> prob, vector< T > &circleDenizens)
count height() const
uint64_t count
Definition: Globals.h:21
void getElementsInEuclideanCircle(const Point2D< double > circleCenter, const double radius, vector< T > &circleDenizens) const