We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2c5676 commit 58bf558Copy full SHA for 58bf558
cp-algo/math/poly.hpp
@@ -580,7 +580,14 @@ namespace cp_algo::math {
580
581
// [x^k] (a semicorr b) = sum_i a{i+k} * b{i}
582
static poly_t semicorr(poly_t const& a, poly_t const& b) {
583
- return corr(a, b).div_xk(b.deg());
+ Vector ra = a.a;
584
+ Vector rb = b.a;
585
+ size_t N = std::bit_ceil(size(ra));
586
+ std::ranges::reverse(rb);
587
+ ra.resize(N);
588
+ rb.resize(N);
589
+ fft::cyclic_mul(ra, rb, N);
590
+ return poly_t(ra).substr(b.deg(), a.deg() - b.deg() + 1);
591
}
592
593
poly_t invborel() const { // ak *= k!
0 commit comments