MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / test

Function test

code/mathematics/fht.test.cpp:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13void test() {
14 rep(it,0,1000) {
15 int k = rng() % 10;
16 int n = 1<<k;
17 vi a(n), b(n);
18 rep(i,0,n) {
19 a[i] = uniform_int_distribution(-100, 100)(rng);
20 b[i] = uniform_int_distribution(-100, 100)(rng);
21 }
22 vi ans = slow(a,b);
23
24 fht(a);
25 fht(b);
26
27 rep(i,0,n) {
28 a[i] *= b[i];
29 }
30
31 fht(a,true);
32 assert(a == ans);
33 }
34}

Callers

nothing calls this directly

Calls 2

fhtFunction · 0.85
slowFunction · 0.70

Tested by

no test coverage detected