26 #ifndef __TERRALIB_SAM_KDTREE_INTERNAL_NODE_H 27 #define __TERRALIB_SAM_KDTREE_INTERNAL_NODE_H 61 template<
class NodeKey,
class NodeData,
class NodeDataItem,
class NodeDataTag = kd_node_m_datasingle_tag>
class Node 148 return !(hasLeft() || hasRight());
154 std::size_t totalLeft = 0;
155 std::size_t totalRight = 0;
158 totalLeft = 1 + getLeft()->descendants();
161 totalRight = 1 + getRight()->descendants();
163 return totalLeft + totalRight;
222 m_discriminator(
'x'),
261 return m_discriminator;
303 return !(hasLeft() || hasRight());
309 std::size_t totalLeft = 0;
310 std::size_t totalRight = 0;
313 totalLeft = 1 + getLeft()->descendants();
316 totalRight = 1 + getRight()->descendants();
318 return totalLeft + totalRight;
352 #endif // __TERRALIB_SAM_KDTREE_INTERNAL_NODE_H double m_key
The key used to access this record.
char m_discriminator
The discriminator used in partition.
NodeDataItem kdDataItem
Export data item type.
void setKey(const double &k)
It sets the key to the node.
AdaptativeNode * m_right
Pointer to the right sub-tree.
NodeKey m_key
The key used to access this record.
const NodeKey & getKey() const
It returns a reference to node key.
bool isLeaf() const
It returns true if this node is a leaf node.
Node * m_left
Pointer to the left sub-tree.
AdaptativeNode * m_left
Pointer to the left sub-tree.
const double & getKey() const
It returns a reference to node key.
std::size_t descendants() const
It counts the number of nodes below this.
void setRight(Node *node)
It sets the right child pointer.
bool hasRight() const
It checks if this node has a right child.
const char & getDiscriminator() const
It returns a reference to discriminator.
void setLeft(AdaptativeNode *node)
It sets the left child pointer.
AdaptativeNode(const double &k)
Constructor.
void setKey(const NodeKey &k)
It sets the key to the node.
std::size_t descendants() const
It counts the number of nodes below this.
bool hasLeft() const
It checks if this node has a left child.
NodeData m_data
The data stored in this record.
NodeData kdData
Export data type.
void setLeft(Node *node)
It sets the left child pointer.
bool hasLeft() const
It checks if this node has a left child.
Kd-Tree node type for nodes with multuple elements (used by template instantiation).
void setData(const NodeData &data)
It sets the data in the node.
NodeData kdData
Export data type.
Kd-tree node type for nodes with single elements (used by template instantiation).
A class that represents an Kd-tree node.
NodeKey kdKey
Export key type.
Node * getRight() const
It gets the right child.
Node * getLeft() const
It gets the left child.
Node(const NodeKey &k)
Constructor.
bool hasRight() const
It checks if this node has a right child.
void setDiscriminator(const char &d)
It sets the data in the node.
bool isLeaf() const
It returns true if this node is a leaf node.
Node * m_right
Pointer to the right sub-tree.
NodeData m_data
The data stored in this record.
AdaptativeNode * getRight() const
It gets the right child.
void setRight(AdaptativeNode *node)
It sets the right child pointer.
NodeDataItem kdDataItem
Export data item type.
A class that represents an Kd-tree node.
NodeData & getData()
It returns a reference to data node.
NodeKey kdKey
Export key type.
void setData(const NodeData &data)
It sets the data in the node.
NodeData & getData()
It returns a reference to data node.
AdaptativeNode * getLeft() const
It gets the left child.
NodeDataTag kdDataTag
Export data type.