-
Notifications
You must be signed in to change notification settings - Fork 5
/
experiment_LLL_time.py
42 lines (30 loc) · 992 Bytes
/
experiment_LLL_time.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from numpy import zeros, array, random
from middleware import CodeRedLib
from time import time
def experiment(n, k, samples):
times = zeros(5)
G = random.randint(0,2, size=(k, n), dtype="bool")
red = CodeRedLib(G)
for s in range(samples):
T0 = time()
red.Randomize()
red.LLL()
T1 = time()
red.Randomize()
red.Systematize()
T2 = time()
red.LLL()
T3 = time()
red.Randomize()
red.Systematize()
red.EpiSort()
T4 = time()
red.LLL()
T5 = time()
times += array([T1 - T0, T3 - T1, T3 - T2, T5 - T3, T5 - T4])
return times/samples
print("n, tLLL_raw, tLLL_Sys, tLLL_afterSys, tLLL_Sort, tLLL_afterSort")
for n in [128, 192, 256, 384, 512, 768, 1024, 1280, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384]:
k = int(n/2)
v = experiment(n, k, 10)
print (n, ",\t %.4e,\t %.4e,\t %.4e,\t %.4e,\t %.4e"%tuple(v))