Template Class QuadtreePolarEuclid

Class Documentation

template<class T>
class QuadtreePolarEuclid

Public Functions

inline QuadtreePolarEuclid()
inline QuadtreePolarEuclid(double maxR, bool theoreticalSplit = false, double alpha = 1, count capacity = 1000, double balance = 0.5)
Parameters:
  • maxR – Radius of the managed area. Must be smaller than 1.

  • theoreticalSplit – If true, split cells to get the same area in each child cell. Default is false

  • alpha – dispersion Parameter of the point distribution. Only has an effect if theoretical split is true

  • capacity – How many points can inhabit a leaf cell before it is split up?

inline QuadtreePolarEuclid(const vector<double> &angles, const vector<double> &radii, const vector<T> &content, bool theoreticalSplit = false, count capacity = 1000, double balance = 0.5)
inline void addContent(T newcomer, double angle, double r)
Parameters:
  • newcomer – content to be added at point x

  • angle – angular coordinate of x

  • R – radial coordinate of x

inline bool removeContent(T toRemove, double angle, double r)
Parameters:
  • newcomer – content to be removed at point x

  • angle – angular coordinate of x

  • R – radial coordinate of x

inline vector<T> getElements() const

Get all elements, regardless of position

Returns:

vector<T> of elements

inline void extractCoordinates(vector<double> &anglesContainer, vector<double> &radiiContainer) const
inline void getElementsInEuclideanCircle(const Point2DWithIndex<double> circleCenter, const double radius, vector<T> &circleDenizens) const
inline count getElementsProbabilistically(Point2DWithIndex<double> euQuery, std::function<double(double)> prob, vector<T> &circleDenizens)
inline count getElementsProbabilistically(Point2DWithIndex<double> euQuery, std::function<double(double)> prob, bool suppressLeft, vector<T> &circleDenizens)
inline void recount()
inline count size() const
inline count height() const
inline count countLeaves() const
inline index indexSubtree(index nextID)
inline index getCellID(double phi, double r) const
inline double getMaxRadius() const
inline void reindex()
inline void trim()

trims the vectors used to hold the content in the leaf cells. Reduces memory usage, makes changes slower