Skip to content

Commit 2348db3

Browse files
committed
Use flen instead of "4"
1 parent 296f145 commit 2348db3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cp-algo/math/fft.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace cp_algo::math::fft {
4646
resize(n);
4747
}
4848
void resize(size_t n) {
49-
n = std::bit_ceil(std::max<size_t>(n, 4));
49+
n = std::bit_ceil(std::max<size_t>(n, flen));
5050
if(size() != n) {
5151
x.resize(n / flen);
5252
y.resize(n / flen);

verify/poly/wildcard.test.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ using fft::ftype;
1414
using fft::point;
1515
using fft::cvector;
1616

17-
auto semicorr(auto &a, auto &b) {
17+
void semicorr(auto &a, auto &b) {
1818
b.resize(size(a));
1919
a.fft();
2020
b.fft();
2121
a.dot(b);
2222
a.ifft();
23-
return a;
2423
}
2524

2625
auto is_integer = [](point a) {
@@ -52,10 +51,10 @@ string matches(string const& A, string const& B, char wild = '*') {
5251
P[i].set(idx, val);
5352
}
5453
}
55-
auto corr = semicorr(P[0], P[1]);
54+
semicorr(P[0], P[1]);
5655
string ans(size(A) - size(B) + 1, '0');
5756
for(size_t j = 0; j < size(ans); j++) {
58-
ans[j] = '0' + is_integer(corr.get(size(B) - 1 + j));
57+
ans[j] = '0' + is_integer(P[0].get(size(B) - 1 + j));
5958
}
6059
return ans;
6160
}

0 commit comments

Comments
 (0)