40#ifndef GEOGRAM_VORONOI_GENERIC_RVD_UTILS
41#define GEOGRAM_VORONOI_GENERIC_RVD_UTILS
93 const T&
top()
const {
94 return *rep_.rbegin();
101 return rep_.size() == 0;
147 return seed < rhs.seed;
256 insert(fs.seed, fs.f, conn_comp);
263 for(index_t i = 0; i <
nb_arrays(); ++i) {
266 for(index_t i = 0; i <
nb_arrays(); ++i) {
276 return index_t(keys_.size());
314 for(index_t i = 0; i < 32; i++) {
316 if((size & mask) != 0) {
322 result = result << 1;
334 index_t* K = keys_[array];
335 for(index_t i = 0; i <
array_size(array); ++i) {
356 return values_[array][i];
365 void insert(index_t array, index_t key, index_t value) {
372 index_t new_nb = index_t(2*i);
376 keys_[array] =
reinterpret_cast<index_t*
>(
377 realloc(keys_[array],
sizeof(index_t) * new_nb)
379 values_[array] =
reinterpret_cast<index_t*
>(
380 realloc(values_[array],
sizeof(index_t) * new_nb)
383 size_[array] = i + 1;
385 keys_[array][i] = key;
386 values_[array][i] = value;
390 std::vector<index_t*> keys_;
391 std::vector<index_t*> values_;
392 std::vector<index_t> size_;
Stores associations between (facet,seed) pairs and the index of a connected component.
void insert(index_t array, index_t key, index_t value)
Inserts a (key,value) pair into one of the arrays.
index_t array_size(index_t array) const
Gets the size of one of the arrays.
index_t get_connected_component(const FacetSeed &fs) const
Gets the index of the connected component associated with a given FacetSeed.
index_t find_index(index_t array, index_t key) const
Finds the index of one of the keys in one of the arrays.
bool is_marked(const FacetSeed &fs) const
Tests whether a fiven FacetSeed is marked.
FacetSeedMarking(index_t, index_t nb_seeds)
Creates a new FacetSeedMarking.
index_t find_value(index_t array, index_t key) const
Finds the value associated with a key in one of the arrays.
index_t array_capacity(index_t array) const
Gets the capacity of one of the arrays.
void mark(const FacetSeed &fs, index_t conn_comp)
Marks a FacetSeed and sets the associated connected component index.
index_t nb_arrays() const
Gets the number of arrays used internally.
~FacetSeedMarking()
FacetSeedMarking destructor.
bool is_marked(index_t facet, index_t seed) const
Tests whether a given facet,seed couple is marked.
void set_size(index_t nb_arrays)
Sets the number of arrays to be used.
A stack implemented in a GEO::vector.
const T & top() const
Gets the item on the top.
void pop()
Pops the top of the stack.
void push(const T &x)
Pushes a new item onto the stack.
bool empty() const
Tests whether the stack is empty.
Vector with aligned memory allocation.
Internal representation of polyhedra for GEO::GenericVoronoiDiagram.
Internal representation of polygons for GenericVoronoiDiagram.
std::stack< TetSeed > TetSeedStack
A stack of TetSeed.
std::stack< FacetSeed > FacetSeedStack
A stack of FacetSeed.
std::stack< index_t > SeedStack
A stack of seed indices (index_t).
Types and utilities for manipulating vertices in geometric and symbolic forms in restricted Voronoi d...
Common include file, providing basic definitions. Should be included before anything else by all head...
Types and functions for memory manipulation.
FacetSeed()
Creates a new uninitialized FacetSeed.
bool operator<(const FacetSeed &rhs) const
Compares two facet seeds using lexicographic order.
FacetSeed(index_t f_in, index_t seed_in)
Creates a new FacetSeed.