summaryrefslogtreecommitdiff
path: root/test/math/transforms
diff options
context:
space:
mode:
Diffstat (limited to 'test/math/transforms')
-rw-r--r--test/math/transforms/fft.cpp8
-rw-r--r--test/math/transforms/fftMul.cpp10
-rw-r--r--test/math/transforms/multiplyBitwise.cpp6
-rw-r--r--test/math/transforms/multiplyFFT.cpp6
-rw-r--r--test/math/transforms/multiplyNTT.cpp6
-rw-r--r--test/math/transforms/seriesOperations.cpp8
6 files changed, 22 insertions, 22 deletions
diff --git a/test/math/transforms/fft.cpp b/test/math/transforms/fft.cpp
index 858676b..66df1bf 100644
--- a/test/math/transforms/fft.cpp
+++ b/test/math/transforms/fft.cpp
@@ -2,14 +2,14 @@
#include <math/transforms/fft.cpp>
vector<cplx> to_cplx(const vector<ll>& in) {
- vector<cplx> res(sz(in));
- for (int i = 0; i < sz(in); i++) res[i] = in[i];
+ vector<cplx> res(ssize(in));
+ for (int i = 0; i < ssize(in); i++) res[i] = in[i];
return res;
}
vector<ll> from_cplx(const vector<cplx>& in) {
- vector<ll> res(sz(in));
- for (int i = 0; i < sz(in); i++) res[i] = llround(real(in[i]));
+ vector<ll> res(ssize(in));
+ for (int i = 0; i < ssize(in); i++) res[i] = llround(real(in[i]));
return res;
}
diff --git a/test/math/transforms/fftMul.cpp b/test/math/transforms/fftMul.cpp
index 5933864..7887a5e 100644
--- a/test/math/transforms/fftMul.cpp
+++ b/test/math/transforms/fftMul.cpp
@@ -5,21 +5,21 @@
#include <math/transforms/fftMul.cpp>
vector<ll> from_cplx(const vector<cplx>& in) {
- vector<ll> res(sz(in));
- for (int i = 0; i < sz(in); i++) res[i] = llround(real(in[i]));
+ vector<ll> res(ssize(in));
+ for (int i = 0; i < ssize(in); i++) res[i] = llround(real(in[i]));
return res;
}
vector<ll> naive(const vector<ll>& a, const vector<ll>& b) {
vector<ll> res;
for (ll i = 1;; i *= 2) {
- if (sz(a) + sz(b) <= i) {
+ if (ssize(a) + ssize(b) <= i) {
res.resize(i, 0);
break;
}
}
- for (int i = 0; i < sz(a); i++) {
- for (int j = 0; j < sz(b); j++) {
+ for (int i = 0; i < ssize(a); i++) {
+ for (int j = 0; j < ssize(b); j++) {
res[i+j] += a[i] * b[j];
}
}
diff --git a/test/math/transforms/multiplyBitwise.cpp b/test/math/transforms/multiplyBitwise.cpp
index bc73290..8b9eb2f 100644
--- a/test/math/transforms/multiplyBitwise.cpp
+++ b/test/math/transforms/multiplyBitwise.cpp
@@ -6,13 +6,13 @@
vector<ll> naive(const vector<ll>& a, const vector<ll>& b) {
vector<ll> res;
for (ll i = 1;; i *= 2) {
- if (sz(a) <= i && sz(b) <= i) {
+ if (ssize(a) <= i && ssize(b) <= i) {
res.resize(i, 0);
break;
}
}
- for (int i = 0; i < sz(a); i++) {
- for (int j = 0; j < sz(b); j++) {
+ for (int i = 0; i < ssize(a); i++) {
+ for (int j = 0; j < ssize(b); j++) {
res[i&j] += a[i] * b[j];
}
}
diff --git a/test/math/transforms/multiplyFFT.cpp b/test/math/transforms/multiplyFFT.cpp
index 782be1b..61040d0 100644
--- a/test/math/transforms/multiplyFFT.cpp
+++ b/test/math/transforms/multiplyFFT.cpp
@@ -6,13 +6,13 @@
vector<ll> naive(const vector<ll>& a, const vector<ll>& b) {
vector<ll> res;
for (ll i = 1;; i *= 2) {
- if (sz(a) + sz(b) <= i) {
+ if (ssize(a) + ssize(b) <= i) {
res.resize(i, 0);
break;
}
}
- for (int i = 0; i < sz(a); i++) {
- for (int j = 0; j < sz(b); j++) {
+ for (int i = 0; i < ssize(a); i++) {
+ for (int j = 0; j < ssize(b); j++) {
res[i+j] += a[i] * b[j];
}
}
diff --git a/test/math/transforms/multiplyNTT.cpp b/test/math/transforms/multiplyNTT.cpp
index 70fc137..6424c50 100644
--- a/test/math/transforms/multiplyNTT.cpp
+++ b/test/math/transforms/multiplyNTT.cpp
@@ -6,13 +6,13 @@
vector<ll> naive(const vector<ll>& a, const vector<ll>& b) {
vector<ll> res;
for (ll i = 1;; i *= 2) {
- if (sz(a) + sz(b) <= i) {
+ if (ssize(a) + ssize(b) <= i) {
res.resize(i, 0);
break;
}
}
- for (int i = 0; i < sz(a); i++) {
- for (int j = 0; j < sz(b); j++) {
+ for (int i = 0; i < ssize(a); i++) {
+ for (int j = 0; j < ssize(b); j++) {
res[i+j] += a[i] * b[j];
res[i+j] %= mod;
}
diff --git a/test/math/transforms/seriesOperations.cpp b/test/math/transforms/seriesOperations.cpp
index ee30e00..f78541d 100644
--- a/test/math/transforms/seriesOperations.cpp
+++ b/test/math/transforms/seriesOperations.cpp
@@ -24,7 +24,7 @@ namespace reference {//checked against yosupo
}
vector<ll> poly_deriv(vector<ll> a){
- for(int i = 0; i < sz(a)-1; i++)
+ for(int i = 0; i < ssize(a)-1; i++)
a[i] = a[i+1] * (i+1) % mod;
a.pop_back();
return a;
@@ -32,8 +32,8 @@ namespace reference {//checked against yosupo
vector<ll> poly_integr(vector<ll> a){
if(a.empty()) return {0};
- a.push_back(a.back() * powMod(sz(a), mod-2, mod) % mod);
- for(int i = sz(a)-2; i > 0; i--)
+ a.push_back(a.back() * powMod(ssize(a), mod-2, mod) % mod);
+ for(int i = ssize(a)-2; i > 0; i--)
a[i] = a[i-1] * powMod(i, mod-2, mod) % mod;
a[0] = 0;
return a;
@@ -51,7 +51,7 @@ namespace reference {//checked against yosupo
for(int len = 1; len < n; len *= 2){
vector<ll> p = poly_log(q, 2*len);
for(int i = 0; i < 2*len; i++)
- p[i] = (mod - p[i] + (i < sz(a) ? a[i] : 0)) % mod;
+ p[i] = (mod - p[i] + (i < ssize(a) ? a[i] : 0)) % mod;
vector<ll> q2 = q;
q2.resize(2*len);
ntt(p), ntt(q2);