68 : r_gen(123), mesh_(mesh), leaf_size_limit(soft_leaf_size_limit)
70 ASSERT(mesh !=
nullptr,
" ");
177 double left_bound=node_box.
min(axis);
178 double right_bound=node_box.
max(axis);
182 left_bound = std::max( left_bound,
elements_[ *
left ].max(axis) );
189 right_bound = std::min( right_bound,
elements_[ *
right ].min(axis) );
200 unsigned int right_end = node.
leaf_end();
201 unsigned int depth = node.
depth()+1;
205 nodes_.back().set_leaf(left_begin, left_end, left_bound, depth);
207 nodes_.back().set_leaf(left_end, right_end, right_bound, depth);
222 #ifdef DEBUG_MESSAGES
239 #ifdef DEBUG_MESSAGES
260 #ifdef DEBUG_MESSAGES
330 unsigned int median_idx;
331 unsigned int n_elements = node.
leaf_size();
335 std::uniform_int_distribution<unsigned int> distribution(node.
leaf_begin(), node.
leaf_end()-1);
337 for (
unsigned int i=0; i<
coors_.size(); i++) {
338 median_idx = distribution(this->
r_gen);
346 coors_.resize(n_elements);
347 for (
unsigned int i=0; i<
coors_.size(); i++) {
354 unsigned int median_position = (
unsigned int)(
coors_.size() / 2);
358 return coors_[median_position];
461 std::stack<unsigned int, std::vector<unsigned int> > node_stack;
465 while (! node_stack.empty()) {
491 node_stack.push( node.
child(0) );
496 node_stack.push( node.
child(1) );
505 sort(result_list.begin(), result_list.end());
506 it = unique(result_list.begin(), result_list.end());
507 ASSERT_EQUAL(searsearchedElements.size() , it - result_list.begin());