diff --git a/TP2_hachage/tp_2_miso_mphf.py b/TP2_hachage/tp_2_miso_mphf.py index 6bbf6a880fd480a255271be44116641431866b0b..6d3886768105034e26179369a4415d8c51c46b6c 100644 --- a/TP2_hachage/tp_2_miso_mphf.py +++ b/TP2_hachage/tp_2_miso_mphf.py @@ -48,13 +48,13 @@ def construction_mphf(set_kmer, n, gamma=2, nb_niveaux=3): tableaux.append(tableau_principal) # expliquer set_kmer_courant = collision.copy() # expliquer - collision = set() # expliquer je pense que c'est pour éliminer les collisoin de même valeurs + collision = set() # expliquer # Construction de la MPHF mphf = [] grand_tableau = [] for tableau in tableaux: - grand_tableau.extend(tableau) # expliquer elle va ajouté toute les valeurs du tableau + grand_tableau.extend(tableau) # expliquer rangs = [] max_rang = 0 @@ -67,7 +67,7 @@ def construction_mphf(set_kmer, n, gamma=2, nb_niveaux=3): mphf.append([hacher, rangs[-1]]) max_rang = max(rangs) - for kmer in set_kmer_courant: # gestion des collisions: expliquer les 3 lignes du dessous + for kmer in set_kmer_courant: # expliquer les 3 lignes du dessous max_rang += 1 h = abs(hash(kmer)) mphf.append([h, max_rang])