6#ifndef CHEBYSHEV_DISTANCE_H
7#define CHEBYSHEV_DISTANCE_H
20 template<
typename Type = real_t>
29 template<
typename Vector>
32 if (
v1.size() !=
v2.size() || !
v1.size())
36 for (
size_t i = 1;
i <
v1.size();
i++) {
40 return std::sqrt(
sum);
46 inline unsigned int hamming(
const std::string& a,
const std::string& b) {
49 for (
size_t i = 0;
i < std::min(a.size(), b.size());
i++)
53 if (a.size() != b.size())
54 sum += std::abs(
int(a.size()) -
int(b.size()));
long double prec_t
Floating-point type of higher precision, used in computations, such as error estimation.
Definition common.h:42
unsigned int hamming(const std::string &a, const std::string &b)
Hamming distance between two strings, defined as the number of positions at which the corresponding c...
Definition distance.h:46
prec_t euclidean(const Vector &v1, const Vector &v2)
Euclidean distance between vectors (any type with a size() method and [] operator).
Definition distance.h:30
prec_t absolute(Type a, Type b)
Absolute distance between two values which have an ordering with respect to zero.
Definition distance.h:21
General namespace of the framework.
Definition benchmark.h:22
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition common.h:65