 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef __RD_METRICFUNCS_H__
12 #define __RD_METRICFUNCS_H__
19 template <
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);
33 template <
typename T1,
typename T2>
45 template <
typename T1,
typename T2>
double SimilarityWrapper(const T &bv1, const T &bv2, double(*metric)(const T &, const T &), bool returnDistance=false)
Contains general bit-comparison and similarity operations.
#define RDUNUSED_PARAM(x)
RDKIT_DATASTRUCTS_EXPORT double TanimotoSimilarity(const T1 &bv1, const T2 &bv2)
returns the Tanimoto similarity between two bit vects
double TanimotoDistanceMetric(const T1 &bv1, const T2 &bv2, unsigned int dim)
return the Tanimoto distance (1-TanimotoSimilarity) between two bit vectors
double TanimotoSimilarityMetric(const T1 &bv1, const T2 &bv2, unsigned int dim)
return the Tanimoto similarity between two bit vectors
double EuclideanDistanceMetric(const T1 &v1, const T2 &v2, unsigned int dim)
return the Euclidean distance between two vectors