![]() |
Chemical Data Processing Library C++ API - Version 1.3.0
|
Functor class for calculating the Hamming Distance [WHAM, CITB] between bitsets. More...
#include <SimilarityFunctors.hpp>
Public Member Functions | |
std::size_t | operator() (const Util::BitSet &bs1, const Util::BitSet &bs2) const |
Calculates the Hamming Distance [WHAM, CITB] between the bitsets bs1 and bs2. More... | |
|
inline |
Calculates the Hamming Distance [WHAM, CITB] between the bitsets bs1 and bs2.
The Hamming Distance is calculated by:
where is the number of bits that are set in the first bitset but not in the second bitset and is the number of bits that are set in the second bitset but not in the first one.
If the specified bitsets bs1 and bs2 are of different size, missing bits at the end of the smaller bitset are assumed to be zero.
bs1 | The first bitset. |
bs2 | The second bitset. |