Skip to content

Commit 3e6a57a

Browse files
committed
Fix precision failures with custom complex type
1 parent 094f2a7 commit 3e6a57a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cp-algo/math/fft.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace cp_algo::math::fft {
8787
pt cur;
8888
pt arg = to_pt<pt>(root<point>(n, step));
8989
for(size_t i = 0; i < m; i += step) {
90-
if(i % 64 == 0 || n < pre_roots) {
90+
if(i % 32 == 0 || n < pre_roots) {
9191
cur = root<pt>(n, i);
9292
} else {
9393
cur *= arg;
@@ -274,7 +274,7 @@ namespace cp_algo::math::fft {
274274
a.resize(k);
275275
for(int j = int(k - 1); j >= 0; j--) {
276276
a[j] *= b[0];
277-
for(size_t i = std::max<size_t>(j - n, 0) + 1; i < std::min<size_t>(j + 1, m); i++) {
277+
for(int i = std::max(j - (int)n, 0) + 1; i < std::min(j + 1, (int)m); i++) {
278278
a[j] += a[j - i] * b[i];
279279
}
280280
}

0 commit comments

Comments
 (0)