orbtree
orbtree::simple_setC Class Reference

Specialized set with compact storage. Simple version for weight functions that return one component (i.e. scalar functions). See orbtree for description of members. More...

#include <orbtree.h>

Detailed Description

Specialized set with compact storage. Simple version for weight functions that return one component (i.e. scalar functions). See orbtree for description of members.

This is a set, i.e. a collection of elements without duplicates. See orbtree for description of members. Nodes are stored in a flat array and the red-black bit is stored as part of node references. Indexing is done with integers instead of pointers, this can save space especially on 64-bit machines if 32-bit indices are sufficient. Space for each node is sizeof(Key) + 3*sizeof(IndexType) + padding (if necessary)

Template Parameters
KeyType of elements ("keys") stored in this set.
NVFuncfunction object calculating the weights associated with stored elements. Requires operator() with the key as the only parameter and returning NVFunc::result_type that should be a public typedef as well.
IndexTypeunsigned integral type to use for indexing. Maximum number of elements is half of the maximum value of this type - 1. Default is uin32_t, i.e. 32-bit integers, allowing 2^31-1 elements.
Comparecomparison functor for keys.

Note: internally, it uses realloc_vector::vector if Key is trivially copyable (as per std::is_trivially_copyable) and stacked_vector::vector otherwise. In the latter case, performnace can be improved by using the libdivide library – see the documentation of stacked_vector for more details.


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