Spatial C++ Library
Generic Multi-Dimensional Containers and Spatial Operations
spatial::perfect_balancing Struct Reference

A policy that balances a node if the difference in weight between left and right is higher than 2 (two). More...

#include <spatial_relaxed_kdtree.hpp>

Public Member Functions

template<typename Rank >
bool operator() (const Rank &, weight_type left, weight_type right) const
 Rebalancing predicate. More...
 

Detailed Description

A policy that balances a node if the difference in weight between left and right is higher than 2 (two).

The value of 2 (two) is chosen because it offers optimal balancing in a k-d tree, this is useful when spatial::point_multiset, spatial::point_multimap, spatial::box_multiset or spatial::box_multimap is used as a source of a spatial::idle_point_multiset, spatial::idle_point_multimap spatial::idle_box_multiset or spatial::idle_box_multimap, respectively.

Definition at line 119 of file spatial_relaxed_kdtree.hpp.

Member Function Documentation

template<typename Rank >
bool spatial::perfect_balancing::operator() ( const Rank &  ,
weight_type  left,
weight_type  right 
) const

Rebalancing predicate.

Parameters
leftThe weight at the left
rightThe weight at the right
Returns
true Indicate that reblancing must occurs, otherwise false.

Definition at line 129 of file spatial_relaxed_kdtree.hpp.


The documentation for this struct was generated from the following file: