![]() |
Chemical Data Processing Library C++ API - Version 1.3.0
|
Functor class for calculating the Euclidean Distance [CITB] between bitsets and vectors. More...
#include <SimilarityFunctors.hpp>
Public Member Functions | |
double | operator() (const Util::BitSet &bs1, const Util::BitSet &bs2) const |
Calculates the Euclidean Distance [CITB] between the bitsets bs1 and bs2. More... | |
template<typename V > | |
double | operator() (const V &v1, const V &v2) const |
Calculates the Euclidean Distance [CITB] between the vectors v1 and v2. More... | |
Functor class for calculating the Euclidean Distance [CITB] between bitsets and vectors.
|
inline |
Calculates the Euclidean Distance [CITB] between the bitsets bs1 and bs2.
The Euclidean Distance D_{ab} is calculated by:
D_{ab} = \sqrt{N_a + N_b}
where N_a is the number of bits that are set in the first bitset but not in the second bitset and N_b 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. |
|
inline |
Calculates the Euclidean Distance [CITB] between the vectors v1 and v2.
The Euclidean Distance D_{12} is calculated by:
D_{12} = {\left \| \vec{v}_1 - \vec{v}_2 \right \|}
v1 | The first vector. |
v2 | The second vector. |