Go to the source code of this file.
◆ hash_combine()
static int hash_combine |
( |
int | c1, |
|
|
int | c2, |
|
|
int | l ) |
|
static |
Definition at line 21 of file fast_search.cpp.
21 {
22
23
24 int rot= (9 * l) & 31;
29 ((
u2 <<
rot) & 0xffffffff) ^ ((
u2 >> (32 -
rot)) & 0xffffffff);
30 return (
int) (
u1 ^
r2);
31}
The list class represents a linked list.
◆ fast_hash()
Definition at line 34 of file fast_search.cpp.
34 {
35 unsigned int h= 0;
36 for (
int i=
N (s) - 1; i >= 0; i--) {
37 h= ((h << 9) & 0xffffffff) ^ ((h >> 23) & 0xffffffff);
38 h= h ^ ((unsigned int) (unsigned char) s[i]);
39 }
40 return (int) h;
41}
int N(array< T > a)
Get the length of the array.
◆ get_longest_common()
void get_longest_common |
( |
string | s1, |
|
|
string | s2, |
|
|
int & | b1, |
|
|
int & | e1, |
|
|
int & | b2, |
|
|
int & | e2 ) |
Definition at line 125 of file fast_search.cpp.
125 {
126
131 for (
int i=
min (
N (
ss1->a),
N (
ss2->a)) - 1; i >= 0; i--) {
135 while (
it->busy ()) {
139 if (
N (
ps1) == 0 ||
N (
ps2) == 0)
continue;
149 }
153 }
161 }
162 }
163 }
164 }
165 }
166}
iterator< T > iterate(hashmap< T, U > h)
Generates an iterator for a container of type hashmap<T, U>.
SI min(SI i, SI j)
Returns the minimum of two signed integers.