@@ -18,7 +18,7 @@ namespace cp_algo::math::fft {
18
18
static constexpr size_t flen = vftype::size();
19
19
20
20
struct cvector {
21
- static constexpr size_t pre_roots = 1 << 19 ;
21
+ static constexpr size_t pre_roots = 1 << 18 ;
22
22
std::vector<vftype> x, y;
23
23
cvector (size_t n) {
24
24
n = std::max (flen, std::bit_ceil (n));
@@ -57,12 +57,12 @@ namespace cp_algo::math::fft {
57
57
}
58
58
}
59
59
static const cvector roots;
60
- template <class pt = point, bool precalc = false >
61
- static pt root (size_t n, size_t k, auto &&arg) {
60
+ template < bool precalc = false , class ft = point >
61
+ static auto root (size_t n, size_t k, ft &&arg) {
62
62
if (n < pre_roots && !precalc) {
63
- return roots.get <pt >(n + k);
63
+ return roots.get <complex<ft> >(n + k);
64
64
} else {
65
- return polar< typename pt::value_type> (1 ., arg);
65
+ return complex<ft>:: polar (1 ., arg);
66
66
}
67
67
}
68
68
template <class pt = point, bool precalc = false >
@@ -78,7 +78,7 @@ namespace cp_algo::math::fft {
78
78
}
79
79
}();
80
80
for (size_t i = 0 ; i < m; i += step, k += (ftype)step) {
81
- callback (i, root<pt, precalc>(n, i, arg * k));
81
+ callback (i, root<precalc>(n, i, arg * k));
82
82
}
83
83
}
84
84
@@ -93,7 +93,7 @@ namespace cp_algo::math::fft {
93
93
set (k, get<pt>(k) + t);
94
94
};
95
95
if (i < flen) {
96
- exec_on_roots (i, i, butterfly);
96
+ exec_on_roots<point> (i, i, butterfly);
97
97
} else {
98
98
exec_on_roots<vpoint>(i, i, butterfly);
99
99
}
@@ -115,7 +115,7 @@ namespace cp_algo::math::fft {
115
115
set (k + i, B * rt);
116
116
};
117
117
if (i < flen) {
118
- exec_on_roots (i, i, butterfly);
118
+ exec_on_roots<point> (i, i, butterfly);
119
119
} else {
120
120
exec_on_roots<vpoint>(i, i, butterfly);
121
121
}
0 commit comments