summaryrefslogtreecommitdiff
path: root/test/math/linearRecurrence.cpp
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2024-09-11 10:39:00 +0200
committermzuenni <michi.zuendorf@gmail.com>2024-09-11 10:39:00 +0200
commita898bac55c6cd7c51fef5e6735aa3a316a18da7b (patch)
tree85d2bd63b303e3e6f140fbff52c0d0472d247623 /test/math/linearRecurrence.cpp
parentd0bf16e2f4a30b9a5260578fb5583950c149e425 (diff)
change tests
Diffstat (limited to 'test/math/linearRecurrence.cpp')
-rw-r--r--test/math/linearRecurrence.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/math/linearRecurrence.cpp b/test/math/linearRecurrence.cpp
index 50e98a0..f0ebe76 100644
--- a/test/math/linearRecurrence.cpp
+++ b/test/math/linearRecurrence.cpp
@@ -1,9 +1,12 @@
#include "../util.h"
-#include <math/modPowIterativ.cpp>
-#include <math/transforms/ntt.cpp>
-#include <math/transforms/multiplyNTT.cpp>
+vector<ll> mul(const vector<ll>& a, const vector<ll>& b);
#include <math/linearRecurrence.cpp>
+vector<ll> mul(const vector<ll>& a, const vector<ll>& b) {
+ return mulSlow(a, b);
+}
+
+
struct RandomRecurence {
vector<ll> f, c, cache;
RandomRecurence(int n) : f(Random::integers<ll>(n, 0, mod)), c(Random::integers<ll>(n, 0, mod)), cache(f) {}
@@ -23,7 +26,7 @@ struct RandomRecurence {
void stress_test() {
int queries = 0;
- for (int i = 0; i < 1'000; i++) {
+ for (int i = 0; i < 10'000; i++) {
int n = Random::integer<int>(1, 10);
RandomRecurence f(n);
for (int j = 0; j < 100; j++) {
@@ -39,14 +42,14 @@ void stress_test() {
cerr << "tested random queries: " << queries << endl;
}
-constexpr int N = 100'000;
+constexpr int N = 1'000;
void performance_test() {
timer t;
RandomRecurence f(N);
t.start();
hash_t hash = kthTerm(f.f, f.c, 1e18);
t.stop();
- if (t.time > 8000) cerr << "too slow: " << t.time << FAIL;
+ if (t.time > 500) cerr << "too slow: " << t.time << FAIL;
cerr << "tested performance: " << t.time << "ms (hash: " << hash << ")" << endl;
}