10 if( !isNULLit(ptr->d_iterator) ){
11 vec.push_back(ptr->d_iterator);
20 #ifdef MAX_CMMTree_NODES
22 if( n_count == MAX_CMMTree_NODES)
23 throw std::runtime_error(
"node<X1>::add_new_node():\nThe number of nodes has reached an acceptable value of \"MAX_CMMTree_NODES = " + std::to_string(MAX_CMMTree_NODES) +
"\".");
25 throw std::runtime_error(
"node<X1>::add_new_node():\nYou have decided to use the constant \"MAX_CMMTree_NODES = " + std::to_string(MAX_CMMTree_NODES) +
"\".\nPlease uncomment the \"NODE_COUNTER\" directive and recompile the program.");
30 children =
new std::vector< node<X1>* >(1);
31 (*children)[0] =
new node<X1>(
this, pos);
34 children->emplace_back(
new node<X1>(
this, pos ) );
41 for(
size_t i = 0; i< children->size(); ++i)
42 delete (*children)[i];
52 size_t lev(0);
node<X1>* ptr(parent);
63 vec.resize(parent->children->size()) ;
64 for(
size_t i=0; i< vec.size(); ++i)
65 vec[i] =parent->children->operator[](i);
75 out <<
'<' <<
typeid(r).name() <<
'>';
The node class definition. This is a template of a class whose objects are used to build a tree of re...
size_t node_level() const
This function returns the level of the CMMTree where a given node is located.
node< X1 > *const & parent_node_address() const
This function returns the address of the parent node.
typename std::vector< X1 >::const_iterator data_addr
void data_on_path(std::vector< data_addr > &vec) const
This function allows you to find a set of elements on a path - starting from the current node to the ...
size_t children_number() const
The function returns the number of children of a given node.
void all_siblings_addresses(std::vector< const node< X1 > * > &vec) const
This function allows you to obtain the addresses of all children of a parent.
void add_new_node(data_addr const &pos)
This function is used to create another CMMTree node.
data_addr const & data_address() const
This function returns the const_iterator to a vector<X1> element (dataset element).
bool isNULLit(data_addr const &r) const
This function is used when there is a need to check whether it is possible to use the data to which r...
size_t siblings_number() const
The function returns the number of children of the parent of a given node.
node< X1 > const * this_node_address() const
The function returns the address of the node calling this function.
std::ostream & operator<<(std::ostream &out, node< X1 > const &r)