ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
EditDistance.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*-------------------------- File EditDistance.h ---------------------------*/
3
/*--------------------------------------------------------------------------*/
155
/*--------------------------------------------------------------------------*/
156
/*----------------------------- DEFINITIONS --------------------------------*/
157
/*--------------------------------------------------------------------------*/
158
159
#ifndef __ADS_EditDistance
160
#define __ADS_EditDistance
161
/* self-identification: #endif constant */
162
163
/*--------------------------------------------------------------------------*/
164
/*------------------------------ INCLUDES ----------------------------------*/
165
/*--------------------------------------------------------------------------*/
166
167
#include "
ADS/Contract.h
"
168
169
#include <cstddef>
170
#include <cstdint>
171
#include <string_view>
172
#include <utility>
173
#include <vector>
174
175
/*--------------------------------------------------------------------------*/
176
/*--------------------------- NAMESPACE ------------------------------------*/
177
/*--------------------------------------------------------------------------*/
178
179
namespace
ADS
180
{
181
219
[[nodiscard]]
inline
std::size_t
levenshtein
( std::string_view a ,
220
std::string_view b );
221
245
[[nodiscard]]
inline
std::size_t
246
levenshtein
( std::string_view a , std::string_view b , std::size_t k );
247
267
[[nodiscard]]
inline
std::size_t
lcsLength
( std::string_view a ,
268
std::string_view b );
269
300
[[nodiscard]]
inline
std::vector< std::pair< std::size_t , std::size_t > >
301
approximateMatches
( std::string_view T , std::string_view P , std::size_t k );
302
303
/*--------------------------------------------------------------------------*/
304
305
}
// end( namespace ADS )
306
307
/*--------------------------------------------------------------------------*/
308
/*-------------------------- IMPLEMENTATION --------------------------------*/
309
/*--------------------------------------------------------------------------*/
310
311
#include "ADS/string/impl/EditDistance.tpp"
312
313
/*--------------------------------------------------------------------------*/
314
315
#endif
/* EditDistance.h included */
316
317
/*--------------------------------------------------------------------------*/
318
/*------------------------ End File EditDistance.h -------------------------*/
319
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::levenshtein
std::size_t levenshtein(std::string_view a, std::string_view b)
the edit distance of Levenshtein of and
ADS::approximateMatches
std::vector< std::pair< std::size_t, std::size_t > > approximateMatches(std::string_view T, std::string_view P, std::size_t k)
the ends , from 1 to , of the substrings of at edit distance at most from , in increasing order,...
ADS::lcsLength
std::size_t lcsLength(std::string_view a, std::string_view b)
the length of a longest common subsequence of and
ADS
Definition
ADT.h:96
ADS
string
EditDistance.h
Generated by
1.17.0