File tree 1 file changed +13
-10
lines changed
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ namespace cp_algo::math::fft {
28
28
auto splt = [&](size_t i, auto mul) {
29
29
auto ai = i < size (a) ? (a[i] * mul).rem_direct () : 0 ;
30
30
auto rem = ai % split;
31
- auto quo = (ai - rem) / split;
31
+ auto quo = ai / split;
32
32
return std::pair{(ftype)rem, (ftype)quo};
33
33
};
34
34
auto [rai, qai] = splt (i, cur);
@@ -44,15 +44,8 @@ namespace cp_algo::math::fft {
44
44
}
45
45
}
46
46
47
- void mul (auto &&C, auto const & D, auto &res, size_t k) {
48
- assert (A.size () == C.size ());
49
- size_t n = A.size ();
50
- if (!n) {
51
- res = {};
52
- return ;
53
- }
54
-
55
- cvector::exec_on_evals<1 >(n / flen, [&](size_t k, point rt) {
47
+ void dot (auto &&C, auto const & D) {
48
+ cvector::exec_on_evals<1 >(A.size () / flen, [&](size_t k, point rt) {
56
49
k *= flen;
57
50
auto [Ax, Ay] = A.at (k);
58
51
auto [Bx, By] = B.at (k);
@@ -79,6 +72,16 @@ namespace cp_algo::math::fft {
79
72
B.at (k) = BD;
80
73
});
81
74
checkpoint (" dot" );
75
+ }
76
+
77
+ void mul (auto &&C, auto const & D, auto &res, size_t k) {
78
+ assert (A.size () == C.size ());
79
+ size_t n = A.size ();
80
+ if (!n) {
81
+ res = {};
82
+ return ;
83
+ }
84
+ dot (C, D);
82
85
A.ifft ();
83
86
B.ifft ();
84
87
C.ifft ();
You can’t perform that action at this time.
0 commit comments