Add reserve() in generic code and change comment to avoid warning

This commit is contained in:
Andreas Fabri 2022-04-13 12:59:21 +01:00
parent 104aca6295
commit 2a5fcdcfb1
2 changed files with 14 additions and 10 deletions

View File

@ -65,16 +65,18 @@ class ID_support_handler<SNC_indexed_items, Decorator> {
hash.reserve(n);
}
// The method get_hash implements a
// two-pass union find algorithm
// __ __ _______
// / \ / \ / _____\
// _|__|__|__|_ _/__/__/__|_
// | | v | v | | | | | v |
// | O O O O | => | O O O O |
// |____|__^____| |____________|
// | | root
// \_/
/*
The method get_hash implements a
two-pass union find algorithm
__ __ _______
/ \ / \ / _____\
_|__|__|__|_ _/__/__/__|_
| | v | v | | | | | v |
| O O O O | => | O O O O |
|____|__^____| |____________|
| | root
\_/
*/
int get_hash(int i) {
int root(i);
while(hash[root] != root)

View File

@ -38,6 +38,8 @@ class ID_support_handler {
public:
ID_support_handler() {}
void reserve(std::size_t n) {}
int get_hash(int) { return 0; }
template<typename Handle> void initialize_hash(Handle /*h*/) {}
void initialize_hash(int /*i*/) {}