forked from lducas/CodeRed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
21 lines (15 loc) · 674 Bytes
/
example.py
File metadata and controls
21 lines (15 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from numpy import array, random
from middleware import CodeRedLib
B = random.randint(0,2, size=(5, 16), dtype="bool") # Create a random Basis for a [5,16]-code
red = CodeRedLib(B) # Load it into a fresh CodeRedLib object
def niceprint(B):
for v in B:
print("".join(["1" if x else "." for x in v]))
print()
niceprint(red.B) # Print current basis
niceprint(red.E) # Print current Epipodal matrix
print(red.l) # Print current Profile
red.LLL() # Apply LLL
niceprint(red.B) # Print current basis
niceprint(red.E) # Print current Epipodal matrix
print(red.l) # Print current Profile