A library for working with phylogenetic and population genetic data.
BitvectorXhash Struct Reference

#include <genesis/utils/math/bitvector.hpp>

Detailed Description

Helper structer that yields the x_hash of a given Bitvector.

It is meant to be used in containers such as unordered_set or unordered_map that can make use of custom hash functions for the key objects. Using this class instead of the standard std::hash specialization, the Bitvector::x_hash() function is used instead of the standard hash() function. It is hence faster to compute, but without avalanche effect.

In some use cases, this might be preferrable - we however recommend to test this, in order to make sure that colliding hashes do not slow down the performance in the end.

Note that the function needs to cast from Bitvector::IntType to std::size_t. On most modern systems, these are expecte to be the same, i.e., 64 bit unsigned integers. However, this might cause problem on systems where this is not the case.

Definition at line 376 of file bitvector.hpp.

Public Member Functions

std::size_t operator() (genesis::utils::Bitvector const &value) const

Member Function Documentation

◆ operator()()

std::size_t operator() ( genesis::utils::Bitvector const &  value) const

Definition at line 378 of file bitvector.hpp.

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