bk-tree  0.1.4
Header-only Burkhard-Keller tree library
Public Member Functions | List of all members
bk_tree::metrics::LeeDistance Class Referencefinal

Lee distance metric. More...

#include <bktree.hpp>

Inheritance diagram for bk_tree::metrics::LeeDistance:
bk_tree::metrics::Distance< LeeDistance >

Public Member Functions

 LeeDistance (integer_type alphabet_size=BK_LEE_ALPHABET_SIZE)
 
integer_type compute_distance (std::string_view s, std::string_view t) const
 
- Public Member Functions inherited from bk_tree::metrics::Distance< LeeDistance >
integer_type operator() (std::string_view s, std::string_view t) const
 

Detailed Description

Lee distance metric.

\[d(x, y) = \sum_{i=0}^{n-1} \min\{|x_i - y_i|, m - |x_i - y_i|\},\]

where \(m\) is the alphabet size, and \(x\) and \(y\) are of the same length. When \(m = 2\) or \(m = 3\), LeeDistance is the same as HammingDistance.


The documentation for this class was generated from the following file: