Skip to content
Snippets Groups Projects
Commit 9c071927 authored by Lecocq Simon's avatar Lecocq Simon
Browse files

fin de la fonction mphf

parent 2e0c9575
Branches
No related tags found
No related merge requests found
......@@ -62,17 +62,17 @@ def construction_mphf(set_kmer, n, gamma=2, nb_niveaux=3):
max_rang = 0
for kmer in set_kmer:
h = hash(kmer)
h = abs(hash(kmer))
if h in grand_tableau:
index = grand_tableau.index(h)
rang = index - grand_tableau[:index + 1].count(-1)
mphf.append((h, rang))
mphf.append([h, rang])
max_rang = max(max_rang, rang)
for kmer in set_kmer_courant: #gestion des collisions: expliquer les 3 lignes du dessous
max_rang += 1
h = abs(hash(kmer))
mphf.append([h, max_rang])
max_rang += 1 # augmentation du rang maximal pour l'attribuer à l'une des dernières collisions
h = abs(hash(kmer)) # hachage de l'un des kmers restants dans les dernières collisions
mphf.append([h, max_rang]) # ajout de l'un des kmers restants dans la fonction de hachage avec son rang associé
return mphf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment