Skip to content

Commit 07bdb2e

Browse files
committed
Fixes
1 parent e4da686 commit 07bdb2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cp-algo/math/poly.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ namespace cp_algo::math {
7171

7272
poly_t& reverse(size_t n) {return poly::impl::reverse(*this, n);}
7373
poly_t& reverse() {return reverse(size(a));}
74-
poly_t reversed(size_t n) {return poly_t(*this).reverse(n);}
75-
poly_t reversed() {return poly_t(*this).reverse();}
74+
poly_t reversed(size_t n) const {return poly_t(*this).reverse(n);}
75+
poly_t reversed() const {return poly_t(*this).reverse();}
7676

7777
std::array<poly_t, 2> divmod(poly_t const& b) const {
7878
return poly::impl::divmod(*this, b);

cp-algo/math/poly/impl/div.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace cp_algo::math::poly::impl {
3131
}
3232
poly D;
3333
if(d >= 0) {
34-
D = (p.reverse().mod_xk(d + 1) * qri.mod_xk(d + 1)).mod_xk(d + 1).reverse(d + 1);
34+
D = (p.reversed().mod_xk(d + 1) * qri.mod_xk(d + 1)).mod_xk(d + 1).reversed(d + 1);
3535
}
3636
return std::array{D, p - D * q};
3737
}
@@ -41,7 +41,7 @@ namespace cp_algo::math::poly::impl {
4141
if(std::min(d, q.deg()) < magic) {
4242
return divmod_slow(p, q);
4343
}
44-
return divmod_hint(p, q, q.reverse().inv(d + 1));
44+
return divmod_hint(p, q, q.reversed().inv(d + 1));
4545
}
4646

4747
template<typename poly>

0 commit comments

Comments
 (0)