File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ namespace cp_algo::math {
44
44
return *this ;
45
45
}
46
46
poly_t & div_xk_inplace (size_t k) {
47
- a.erase (begin (a), min (k, size (a)));
47
+ a.erase (begin (a), begin (a) + std:: min (k, size (a)));
48
48
normalize ();
49
49
return *this ;
50
50
}
@@ -195,9 +195,8 @@ namespace cp_algo::math {
195
195
// calculate log p(x) mod x^n
196
196
poly_t & log_inplace (size_t n) {
197
197
assert (a[0 ] == T (1 ));
198
- auto t = mod_xk_inplace (n).inv (n);
199
- deriv_inplace ();
200
- return (*this *= t).mod_xk_inplace (n - 1 ).integr_inplace ();
198
+ mod_xk_inplace (n);
199
+ return (inv_inplace (n) *= mod_xk_inplace (n).deriv ()).mod_xk_inplace (n - 1 ).integr_inplace ();
201
200
}
202
201
poly_t log (size_t n) const {
203
202
return poly_t (*this ).log_inplace (n);
You can’t perform that action at this time.
0 commit comments