|
Geogram Version 1.9.9
A programming library of geometric algorithms
|
Stores associations between (facet,seed) pairs and the index of a connected component. More...
#include <geogram/voronoi/generic_RVD_utils.h>
Public Member Functions | |
| FacetSeedMarking (index_t, index_t nb_seeds) | |
| Creates a new FacetSeedMarking. | |
| bool | is_marked (index_t facet, index_t seed) const |
| Tests whether a given facet,seed couple is marked. | |
| bool | is_marked (const FacetSeed &fs) const |
| Tests whether a fiven FacetSeed is marked. | |
| index_t | get_connected_component (const FacetSeed &fs) const |
| Gets the index of the connected component associated with a given FacetSeed. | |
| void | mark (const FacetSeed &fs, index_t conn_comp) |
| Marks a FacetSeed and sets the associated connected component index. | |
| ~FacetSeedMarking () | |
| FacetSeedMarking destructor. | |
Protected Member Functions | |
| 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. | |
| index_t | array_size (index_t array) const |
| Gets the size of one of the arrays. | |
| index_t | array_capacity (index_t array) const |
| Gets the capacity of one of the arrays. | |
| index_t | find_index (index_t array, index_t key) const |
| Finds the index of one of the keys in one of the arrays. | |
| index_t | find_value (index_t array, index_t key) const |
| Finds the value associated with a key in one of the arrays. | |
| void | insert (index_t array, index_t key, index_t value) |
| Inserts a (key,value) pair into one of the arrays. | |
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 219 of file generic_RVD_utils.h.
|
inline |
Creates a new FacetSeedMarking.
| [in] | nb_seeds | total number of seeds |
Definition at line 225 of file generic_RVD_utils.h.
|
inline |
FacetSeedMarking destructor.
Definition at line 262 of file generic_RVD_utils.h.
|
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).
| [in] | array | index of the array |
Definition at line 307 of file generic_RVD_utils.h.
|
inlineprotected |
Gets the size of one of the arrays.
| [in] | array | index of the array |
Definition at line 294 of file generic_RVD_utils.h.
|
inlineprotected |
Finds the index of one of the keys in one of the arrays.
| [in] | array | index of the array |
| [in] | key | the query key |
key in array or NO_INDEX if not found Definition at line 333 of file generic_RVD_utils.h.
|
inlineprotected |
Finds the value associated with a key in one of the arrays.
| [in] | array | index of the array |
| [in] | key | the query key |
key in array or NO_INDEX if not found. Definition at line 351 of file generic_RVD_utils.h.
|
inline |
Gets the index of the connected component associated with a given FacetSeed.
Definition at line 247 of file generic_RVD_utils.h.
|
inlineprotected |
Inserts a (key,value) pair into one of the arrays.
| [in] | array | index of the array |
| [in] | key | the key |
| [in] | value | the value to be associated with key |
Definition at line 365 of file generic_RVD_utils.h.
Tests whether a fiven FacetSeed is marked.
Definition at line 239 of file generic_RVD_utils.h.
|
inline |
Tests whether a given facet,seed couple is marked.
Definition at line 232 of file generic_RVD_utils.h.
|
inline |
Marks a FacetSeed and sets the associated connected component index.
Definition at line 255 of file generic_RVD_utils.h.
|
inlineprotected |
Gets the number of arrays used internally.
Definition at line 275 of file generic_RVD_utils.h.
|
inlineprotected |
Sets the number of arrays to be used.
| [in] | nb_arrays | number of arrays |
Definition at line 283 of file generic_RVD_utils.h.