Stores associations between (facet,seed) pairs and the index of a connected component.
More...
#include <geogram/voronoi/generic_RVD_utils.h>
|
index_t | nb_arrays () const |
| Gets the number of arrays used internally.
|
|
void | set_size (index_t nb_arrays) |
| Sets the number of arrays to be used. More...
|
|
index_t | array_size (index_t array) const |
| Gets the size of one of the arrays. More...
|
|
index_t | array_capacity (index_t array) const |
| Gets the capacity of one of the arrays. More...
|
|
signed_index_t | find_index (index_t array, index_t key) const |
| Finds the index of one of the keys in one of the arrays. More...
|
|
signed_index_t | find_value (index_t array, index_t key) const |
| Finds the value associated with a key in one of the arrays. More...
|
|
void | insert (index_t array, index_t key, index_t value) |
| Inserts a (key,value) pair into one of the arrays. More...
|
|
Stores associations between (facet,seed) pairs and the index of a connected component.
Used by GEOGen::RestrictedVoronoiDiagram. The implementation uses an array of (key,value) vectors, with dynamic reallocation and linear search. Experimentally, this significantly reduces the memory footprint and execution time as compared to std::table<FacetSeed,index_t>.
Definition at line 217 of file generic_RVD_utils.h.
◆ FacetSeedMarking()
GEOGen::FacetSeedMarking::FacetSeedMarking |
( |
index_t |
, |
|
|
index_t |
nb_seeds |
|
) |
| |
|
inline |
◆ array_capacity()
index_t GEOGen::FacetSeedMarking::array_capacity |
( |
index_t |
array | ) |
const |
|
inlineprotected |
Gets the capacity of one of the arrays.
It corresponds with the power of two immediately greater than size. Unlike in std::vector, capacity is implicitly retrieved from size (this saves one integer per seed).
- Parameters
-
[in] | array | index of the array |
- Precondition
- array < nb_arrays()
Definition at line 305 of file generic_RVD_utils.h.
◆ array_size()
index_t GEOGen::FacetSeedMarking::array_size |
( |
index_t |
array | ) |
const |
|
inlineprotected |
◆ find_index()
signed_index_t GEOGen::FacetSeedMarking::find_index |
( |
index_t |
array, |
|
|
index_t |
key |
|
) |
| const |
|
inlineprotected |
Finds the index of one of the keys in one of the arrays.
- Parameters
-
[in] | array | index of the array |
[in] | key | the query key |
- Returns
- the index of
key
in array
or -1 if not found
Definition at line 331 of file generic_RVD_utils.h.
◆ find_value()
signed_index_t GEOGen::FacetSeedMarking::find_value |
( |
index_t |
array, |
|
|
index_t |
key |
|
) |
| const |
|
inlineprotected |
Finds the value associated with a key in one of the arrays.
- Parameters
-
[in] | array | index of the array |
[in] | key | the query key |
- Returns
- the value associated with
key
in array
or -1 if not found.
Definition at line 349 of file generic_RVD_utils.h.
◆ insert()
void GEOGen::FacetSeedMarking::insert |
( |
index_t |
array, |
|
|
index_t |
key, |
|
|
index_t |
value |
|
) |
| |
|
inlineprotected |
Inserts a (key,value) pair into one of the arrays.
- Parameters
-
[in] | array | index of the array |
[in] | key | the key |
[in] | value | the value to be associated with key |
Definition at line 363 of file generic_RVD_utils.h.
◆ set_size()
void GEOGen::FacetSeedMarking::set_size |
( |
index_t |
nb_arrays | ) |
|
|
inlineprotected |
Sets the number of arrays to be used.
- Parameters
-
[in] | nb_arrays | number of arrays |
Definition at line 281 of file generic_RVD_utils.h.
The documentation for this class was generated from the following file: