11#ifndef __RD_METRICFUNCS_H__
12#define __RD_METRICFUNCS_H__
19template <
typename T1,
typename T2>
22 for (
unsigned int i = 0; i < dim; i++) {
23 double diff =
static_cast<double>(v1[i]) -
static_cast<double>(v2[i]);
24 dist += (diff * diff);
33template <
typename T1,
typename T2>
45template <
typename T1,
typename T2>
Contains general bit-comparison and similarity operations.
double SimilarityWrapper(const T &bv1, const T &bv2, double(*metric)(const T &, const T &), bool returnDistance=false)
RDKIT_DATASTRUCTS_EXPORT double TanimotoSimilarity(const T1 &bv1, const T2 &bv2)
returns the Tanimoto similarity between two bit vects
#define RDUNUSED_PARAM(x)
double EuclideanDistanceMetric(const T1 &v1, const T2 &v2, unsigned int dim)
return the Euclidean distance between two vectors
double TanimotoSimilarityMetric(const T1 &bv1, const T2 &bv2, unsigned int dim)
return the Tanimoto similarity between two bit vectors
double TanimotoDistanceMetric(const T1 &bv1, const T2 &bv2, unsigned int dim)
return the Tanimoto distance (1-TanimotoSimilarity) between two bit vectors