10 #ifndef __RD_METRICFUNCS_H__ 11 #define __RD_METRICFUNCS_H__ 17 template <
typename T1,
typename T2>
20 for (
unsigned int i = 0; i < dim; i++) {
21 double diff =
static_cast<double>(v1[i]) - static_cast<double>(v2[i]);
31 template <
typename T1,
typename T2>
39 template <
typename T1,
typename T2>
double EuclideanDistanceMetric(const T1 &v1, const T2 &v2, unsigned int dim)
return the Euclidean distance between two vectors
double TanimotoSimilarity(const T1 &bv1, const T2 &bv2)
returns the Tanimoto similarity between two bit vects
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
Contains general bit-comparison and similarity operations.
double SimilarityWrapper(const T &bv1, const T &bv2, double(*metric)(const T &, const T &), bool returnDistance=false)