18#include <parallel/algorithm>
20#define ISZERO(X) std::abs(X) <= 1e-5
36 static int overlap(
const std::vector<ui> &v1,
const std::vector<ui> &v2);
37 static double weightedOverlap(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
38 const std::vector<double> &
wordwt);
40 static int levDist(
const std::string &v1,
const std::string &v2);
50 static double jaccard(
const std::vector<ui> &v1,
const std::vector<ui> &v2);
51 static double jaccard(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
int ovlp);
52 static double weightedJaccard(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
53 const std::vector<double> &
wordwt,
54 double v1rw,
double v2rw);
58 static double cosine(
const std::vector<ui> &v1,
const std::vector<ui> &v2);
59 static double cosine(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
int ovlp);
60 static double weightedCosine(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
61 const std::vector<double> &
wordwt,
62 double v1rw,
double v2rw);
63 static double weightedCosine(
double v1rw,
double v2rw,
double ovlp);
66 static double dice(
const std::vector<ui> &v1,
const std::vector<ui> &v2);
67 static double dice(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
int ovlp);
68 static double weightedDice(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
69 const std::vector<double> &
wordwt,
70 double v1rw,
double v2rw);
71 static double weightedDice(
double v1rw,
double v2rw,
double ovlp);
74 static double overlapCoeff(
const std::vector<ui> &v1,
const std::vector<ui> &v2);
75 static double overlapCoeff(
const std::vector<ui> &v1,
const std::vector<ui> &v2,
int ovlp);
77 const std::vector<double> &
wordwt,
78 double v1rw,
double v2rw);
84 static double levSim(
const std::string &v1,
const std::string &v2);
85 static bool exactMatch(
const std::string &s1,
const std::string &s2);
86 static double absoluteNorm(
const std::string &s1,
const std::string &s2);
89 static double jaroWinkler(
const std::string &s1,
const std::string &s2);
90 static double mongeElkan(
const std::string &s1,
const std::string &s2);
111 static int overlap(
const std::vector<T> &v1,
const std::vector<T> &v2);
114 static double jaccard(
const std::vector<T> &v1,
const std::vector<T> &v2);
116 static double jaccard(
const std::vector<T> &v1,
const std::vector<T> &v2,
int ovlp);
119 static double cosine(
const std::vector<T> &v1,
const std::vector<T> &v2);
121 static double cosine(
const std::vector<T> &v1,
const std::vector<T> &v2,
int ovlp);
124 static double dice(
const std::vector<T> &v1,
const std::vector<T> &v2);
126 static double dice(
const std::vector<T> &v1,
const std::vector<T> &v2,
int ovlp);
129 static double overlapCoeff(
const std::vector<T> &v1,
const std::vector<T> &v2);
131 static double overlapCoeff(
const std::vector<T> &v1,
const std::vector<T> &v2,
int ovlp);
std::vector< std::vector< double > > wordwt
Definition blocker_config.cc:23
static double jaccard(const std::vector< T > &v1, const std::vector< T > &v2)
Definition simfunc.cc:431
static double cosine(const std::vector< T > &v1, const std::vector< T > &v2)
Definition simfunc.cc:452
~SimFuncsTemplate()=default
SimFuncsTemplate(SimFuncsTemplate &&other)=delete
static double overlapCoeff(const std::vector< T > &v1, const std::vector< T > &v2)
Definition simfunc.cc:494
SimFuncsTemplate()=default
static int overlap(const std::vector< T > &v1, const std::vector< T > &v2)
Definition simfunc.cc:421
static double dice(const std::vector< T > &v1, const std::vector< T > &v2)
Definition simfunc.cc:473
SimFuncsTemplate(const SimFuncsTemplate &other)=delete
static double weightedCosine(const std::vector< ui > &v1, const std::vector< ui > &v2, const std::vector< double > &wordwt, double v1rw, double v2rw)
Definition simfunc.cc:186
static double absoluteNorm(const std::string &s1, const std::string &s2)
Definition simfunc.cc:297
SimFuncs(SimFuncs &&other)=delete
static double jaccard(const std::vector< ui > &v1, const std::vector< ui > &v2)
Definition simfunc.cc:127
static double weightedOverlap(const std::vector< ui > &v1, const std::vector< ui > &v2, const std::vector< double > &wordwt)
Definition simfunc.cc:43
static double inverseSqrt(double number)
Definition simfunc.cc:75
static int levDist(const std::string &v1, const std::string &v2)
Definition simfunc.cc:88
static double mongeElkan(const std::string &s1, const std::string &s2)
Definition simfunc.cc:387
static bool exactMatch(const std::string &s1, const std::string &s2)
Definition simfunc.cc:292
static double weightedDice(const std::vector< ui > &v1, const std::vector< ui > &v2, const std::vector< double > &wordwt, double v1rw, double v2rw)
Definition simfunc.cc:227
static int tripletMin(int a, int b, int c)
Definition simfunc.cc:122
static double weightedJaccard(const std::vector< ui > &v1, const std::vector< ui > &v2, const std::vector< double > &wordwt, double v1rw, double v2rw)
Definition simfunc.cc:145
static double overlapCoeff(const std::vector< ui > &v1, const std::vector< ui > &v2)
Definition simfunc.cc:247
SimFuncs(const SimFuncs &other)=delete
static double levSim(const std::string &v1, const std::string &v2)
Definition simfunc.cc:285
static double jaroWinkler(const std::string &s1, const std::string &s2)
Definition simfunc.cc:318
static double cosine(const std::vector< ui > &v1, const std::vector< ui > &v2)
Definition simfunc.cc:165
static double dice(const std::vector< ui > &v1, const std::vector< ui > &v2)
Definition simfunc.cc:209
static double weightedOverlapCoeff(const std::vector< ui > &v1, const std::vector< ui > &v2, const std::vector< double > &wordwt, double v1rw, double v2rw)
Definition simfunc.cc:265
static int overlap(const std::vector< ui > &v1, const std::vector< ui > &v2)
Definition simfunc.cc:10