File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -250,8 +250,8 @@ namespace cp_algo::math::fft {
250
250
void mul (auto &&B, auto & res, size_t k) {
251
251
mul (B.A , B.B , res, k);
252
252
}
253
- std::deque <base> operator *= (auto &&B) {
254
- std::deque <base> res (2 * A.size ());
253
+ std::vector <base> operator *= (auto &&B) {
254
+ std::vector <base> res (2 * A.size ());
255
255
mul (B.A , B.B , res, size (res));
256
256
return res;
257
257
}
Original file line number Diff line number Diff line change 12
12
#include < optional>
13
13
#include < utility>
14
14
#include < vector>
15
- #include < deque>
16
15
#include < list>
17
16
namespace cp_algo ::math {
18
17
template <typename T>
19
18
struct poly_t {
20
19
using base = T;
21
- std::deque <T> a;
20
+ std::vector <T> a;
22
21
23
22
void normalize () {poly::impl::normalize (*this );}
24
23
25
24
poly_t (){}
26
25
poly_t (T a0): a{a0} {normalize ();}
27
- poly_t (std::vector<T> const & t): a(begin(t), end(t) ) {normalize ();}
28
- poly_t (std::deque <T> const & t): a(t ) {normalize ();}
26
+ poly_t (std::vector<T> const & t): a(t ) {normalize ();}
27
+ poly_t (std::vector <T>&& t): a(std::move(t) ) {normalize ();}
29
28
30
29
poly_t operator -() const {return poly::impl::neg (*this );}
31
30
poly_t & operator += (poly_t const & t) {return poly::impl::add (*this , t);}
@@ -576,7 +575,7 @@ namespace cp_algo::math {
576
575
}
577
576
578
577
poly_t x2 () { // P(x) -> P(x^2)
579
- std::deque <T> res (2 * a.size ());
578
+ std::vector <T> res (2 * a.size ());
580
579
for (size_t i = 0 ; i < a.size (); i++) {
581
580
res[2 * i] = a[i];
582
581
}
@@ -586,7 +585,7 @@ namespace cp_algo::math {
586
585
// Return {P0, P1}, where P(x) = P0(x) + xP1(x)
587
586
std::array<poly_t , 2 > bisect (size_t n) const {
588
587
n = std::min (n, size (a));
589
- std::deque <T> res[2 ];
588
+ std::vector <T> res[2 ];
590
589
for (size_t i = 0 ; i < n; i++) {
591
590
res[i % 2 ].push_back (a[i]);
592
591
}
You can’t perform that action at this time.
0 commit comments