Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp2 sdd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pacome Riobe
tp2 sdd
Commits
1cece38e
Commit
1cece38e
authored
2 months ago
by
Clara Moreno
Browse files
Options
Downloads
Patches
Plain Diff
legere modif du construction_mphf et ajout commentaire explicatif
parent
7b513398
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tp_2_miso_mphf.py
+9
-4
9 additions, 4 deletions
tp_2_miso_mphf.py
with
9 additions
and
4 deletions
tp_2_miso_mphf.py
+
9
−
4
View file @
1cece38e
...
...
@@ -68,10 +68,13 @@ def construction_mphf(set_kmer, n, gamma=2, nb_niveaux=3):
h_tab
=
grand_tableau
[
pos
]
if
h_tab
!=
-
1
:
count
+=
1
list_h_pos
.
append
((
h_tab
,
count
))
list_h_pos
.
append
((
h_tab
,
count
))
#tester et approuver par les autorité competente, fait une liste sous forme :
# [(2052854839243325982, 1), (4957333478667127183, 2), (937960722055874324, 3), (5781457990790611126, 4), (639567318783299370, 5), (8946549155908438712, 6), (2965694465669227395, 7), (2528361345495398196, 8), (4425804304571150798, 9), (8833577342042152210, 10)]
col
=
[]
h
=
abs
(
hash
(
kmer
))
col
_h
=
[]
col_kmer
=
[]
for
k
in
kmer
:
h
=
abs
(
hash
(
k
))
ok
=
0
...
...
@@ -79,7 +82,9 @@ def construction_mphf(set_kmer, n, gamma=2, nb_niveaux=3):
if
list_h_pos
[
e
][
0
]
==
h
:
ok
+=
1
if
ok
==
0
:
col
.
append
(
h
)
col_h
.
append
(
h
)
#si besoin d'une liste de h qui sont pas dans tableau et qu'il faut rajouter apres
col_kmer
.
append
(
k
)
#pareil mais avec les kmer, jsp ce qu'on aura besoin ensuite
# compléter
# hacher le kmer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment