Skip to content

Commit

Permalink
added more info display
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane Champailler committed May 2, 2021
1 parent 3602099 commit 387df1a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions p2_LZ77.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def peek(ndx):


def compute_compression_rate_for_LZ77(tuples, sliding_window_size, genome):

ds = [d for d,l,c in tuples]
dl = [l for d,l,c in tuples]
d_bits = math.ceil(math.log2(max(ds)))
l_bits = math.ceil(math.log2(max(dl)))
print(f"LZ77 : {min(ds)} <= d <= {max(ds)}, {d_bits} bits; {min(dl)} <= l <= {max(dl)}, {l_bits} bits")

dl_bits = math.ceil(math.log2(sliding_window_size))
char_bits = 8
tuple_bits = char_bits+2*dl_bits
Expand Down

0 comments on commit 387df1a

Please sign in to comment.