Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 15-create-plot-function
  • 17-test-jonas
  • main
3 results

Target

Select target project
  • darius.briquet/reed_solomon
1 result
Select Git revision
  • 15-create-plot-function
  • 17-test-jonas
  • main
3 results
Show changes
Commits on Source (9)
**/__pycache__
\ No newline at end of file
**/__pycache__
**/test.py
......@@ -45,5 +45,5 @@ class polynome():
# Using horner method
res = 0
for i in range(len(self.coefs) - 1, -1, -1):
res = (res * x + self.coefs[i]) % self.prime_mod
res = (res * x + self.coefs[i])
return res
# Created on 09/12/2021
from polynome import *
from itertools import combinations
def get_possibilities(l: list):
pass
# Transforme the list in list of tupples with their indexes
for x, _ in enumerate(l):
l[x] = (x, l[x])
# ! la valeur 20 est hardcodée. Paramètre de fonction ??
l_fixe = l[20:] # Liste contenant aucune erreur
l_posi = l[:20] # Liste contenant des erreurs,
p = list(combinations(l_posi, 2))
for x, y in enumerate(p):
p[x] = list(y)
p[x].extend(l_fixe)
return p
def lagrange_compute(l: list) -> polynome:
pass
def check_nb_error(l: list, p: polynome) -> int:
pass
nbr_error = 0
for _, item in enumerate(l):
if (item % p.prime_mod) != (p.evaluate(_) % p.prime_mod):
print(f"{item} != p.evaluate({_}) = {p.evaluate(_)}")
nbr_error += 1
return nbr_error
\ No newline at end of file