ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
ApproximateMatching.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*----------------------- File ApproximateMatching.h -----------------------*/
3
/*--------------------------------------------------------------------------*/
52
/*--------------------------------------------------------------------------*/
53
/*----------------------------- DEFINITIONS --------------------------------*/
54
/*--------------------------------------------------------------------------*/
55
56
#ifndef __ADS_ApproximateMatching
57
#define __ADS_ApproximateMatching
58
/* self-identification: #endif constant */
59
60
/*--------------------------------------------------------------------------*/
61
/*------------------------------ INCLUDES ----------------------------------*/
62
/*--------------------------------------------------------------------------*/
63
64
#include <algorithm>
65
#include "
ADS/Contract.h
"
66
67
#include <cstddef>
68
#include <string>
69
#include <utility>
70
#include <vector>
71
72
/*--------------------------------------------------------------------------*/
73
/*--------------------------- NAMESPACE ------------------------------------*/
74
/*--------------------------------------------------------------------------*/
75
76
namespace
ADS
77
{
78
80
using
Table
= std::vector< std::vector< int > >;
81
103
template
<
class
S >
104
Table
matchingTable
(
const
S & P ,
const
S & T ,
bool
edit =
false
);
105
125
template
<
class
S >
126
std::pair< long , int >
stringMatching
(
const
S & P ,
const
S & T );
127
153
template
<
class
S >
154
std::size_t
occurrence
(
const
Table
& DP ,
const
S & P ,
const
S & T ,
155
std::size_t j );
156
176
template
<
class
S >
177
int
stringMatchingSingleRow
(
const
S & P ,
const
S & T );
178
199
template
<
class
S >
200
int
editDistance
(
const
S & P ,
const
S & T );
201
202
/*--------------------------------------------------------------------------*/
203
204
}
// end( namespace ADS )
205
206
/*--------------------------------------------------------------------------*/
207
/*-------------------------- IMPLEMENTATION --------------------------------*/
208
/*--------------------------------------------------------------------------*/
209
210
#include "ADS/string/impl/ApproximateMatching.tpp"
211
212
/*--------------------------------------------------------------------------*/
213
214
#endif
/* ApproximateMatching.h included */
215
216
/*--------------------------------------------------------------------------*/
217
/*--------------------- End File ApproximateMatching.h ---------------------*/
218
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::occurrence
std::size_t occurrence(const Table &DP, const S &P, const S &T, std::size_t j)
the place where the occurrence of starts in that ends at with errors, walking back on the table
ADS::Table
std::vector< std::vector< int > > Table
the table of the costs
Definition
ApproximateMatching.h:80
ADS::stringMatchingSingleRow
int stringMatchingSingleRow(const S &P, const S &T)
the least number of errors of an occurrence of in , with two rows of the table only
ADS::stringMatching
std::pair< long, int > stringMatching(const S &P, const S &T)
the end of an occurrence of in with the fewest errors, the first one, and their number; if is emp...
ADS::matchingTable
Table matchingTable(const S &P, const S &T, bool edit=false)
the table of and , of rows and columns; with edit the first row is , that of the edit distance
ADS::editDistance
int editDistance(const S &P, const S &T)
the edit distance of and , in space
ADS
Definition
ADT.h:96
ADS
string
ApproximateMatching.h
Generated by
1.17.0