1 #ifndef KD_TREE_ELEMENT_H
2 #define KD_TREE_ELEMENT_H
11 namespace datastructure {
39 template <
typename K,
typename E>
60 const E& val = E(),
const string& lab =
string())
62 thickness(th), dimension(dim) {
76 const E& val = E(),
const string& lab =
string())
77 :
BSTElement<K, E>(k, nullptr, nullptr, val, lab),
78 dimension(dim), thickness(th) {
182 stringstream dim_str, thck_str;
183 dim_str << dimension;
184 thck_str << thickness;
This class can be used to create binary search tree elements, derived from BinTreeElement.
Definition: BSTElement.h:30
void setKey(const K &k)
Definition: BSTElement.h:80
void setLeft(BSTElement *l)
Definition: BSTElement.h:103
K getKey() const
Definition: BSTElement.h:72
virtual BSTElement * getRight() override
Definition: BSTElement.h:110
virtual const string getElementRepresentation() const override
Definition: BSTElement.h:133
void setRight(BSTElement *r)
Definition: BSTElement.h:126
virtual BSTElement * getLeft() override
Definition: BSTElement.h:87
This class can be used to create K-d Tree elements, derived from BSTElement. K-D trees can be thought...
Definition: KdTreeElement.h:40
int getDimension() const
Get Dimension of the partition.
Definition: KdTreeElement.h:88
void setLeft(KdTreeElement *l)
Sets left child to "l".
Definition: KdTreeElement.h:149
virtual KdTreeElement * getRight() override
Get right child.
Definition: KdTreeElement.h:156
void setPartitioner(const K &p)
Set partitioning dimension to "dim".
Definition: KdTreeElement.h:126
virtual const string getElementRepresentation() const override
get kd tree element representation as JSON string
Definition: KdTreeElement.h:179
KdTreeElement(const K &k, int dim, int th=0, const E &val=E(), const string &lab=string())
Definition: KdTreeElement.h:75
KdTreeElement(const K &k, int dim, int th, const KdTreeElement *l, const KdTreeElement *r, const E &val=E(), const string &lab=string())
Definition: KdTreeElement.h:58
virtual const KdTreeElement * getLeft() const override
Get left child - constant version.
Definition: KdTreeElement.h:141
K getPartitioner() const
Get partitioner value.
Definition: KdTreeElement.h:118
virtual const string getDStype() const override
Definition: KdTreeElement.h:81
virtual KdTreeElement * getLeft() override
Get left child.
Definition: KdTreeElement.h:133
void setDimension(const int &dim)
Set partitioning dimension to "dim".
Definition: KdTreeElement.h:96
void setThickness(const float &th)
Set partitioning dimension to "dim".
Definition: KdTreeElement.h:111
float getThickness() const
Get thickness of the partition.
Definition: KdTreeElement.h:103
virtual const KdTreeElement * getRight() const override
Get right child - Constant version.
Definition: KdTreeElement.h:164
void setRight(KdTreeElement *r)
Sets right child to "r".
Definition: KdTreeElement.h:172
std::string JSONencode(const T &d)
Definition: JSONutil.h:38
Support for drawing Bar charts.
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:52
const string COMMA
Definition: DataStructure.h:51
const string QUOTE
Definition: DataStructure.h:50