Skip to content

Commit fd7fde8

Browse files
committed
Better wildcard matching
1 parent 603b474 commit fd7fde8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

verify/poly/wildcard.test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ string matches(string const& A, string const& B, char wild = '*') {
1515
static base c_to_int[2][26];
1616
static bool init = false;
1717
if(!init) {
18+
init = true;
1819
for(int i = 0; i < 26; i++) {
1920
c_to_int[0][i] = polar(1., (double)cp_algo::random::rng());
2021
c_to_int[1][i] = conj(c_to_int[0][i]);
@@ -33,7 +34,7 @@ string matches(string const& A, string const& B, char wild = '*') {
3334
string ans(size(ST[0]) - size(ST[1]) + 1, '0');
3435
for(size_t j = 0; j <= size(ans); j++) {
3536
ans[j] = '0' + (
36-
abs(dist0[j].imag()) < 1e-4 && abs(dist0[j].real() - round(dist0[j].real())) < 1e-4
37+
abs(dist0[j].imag()) < 1e-8 && abs(dist0[j].real() - round(dist0[j].real())) < 1e-8
3738
);
3839
}
3940
return ans;

0 commit comments

Comments
 (0)