Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reed_solomon
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
darius.briquet
reed_solomon
Commits
c681bbb7
Commit
c681bbb7
authored
3 years ago
by
jonas.stirnema
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' into '11-create-function-get_possibilities'
# Conflicts: # reed_solomon.py
parents
de97792f
4c45e872
Branches
Branches containing commit
No related tags found
1 merge request
!11
Resolve "Create function get_possibilities"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
polynome.py
+5
-8
5 additions, 8 deletions
polynome.py
reed_solomon.py
+7
-1
7 additions, 1 deletion
reed_solomon.py
with
14 additions
and
10 deletions
.gitignore
+
2
−
1
View file @
c681bbb7
**/__pycache__
\ No newline at end of file
**/__pycache__
**/test.py
This diff is collapsed.
Click to expand it.
polynome.py
+
5
−
8
View file @
c681bbb7
...
...
@@ -9,19 +9,16 @@ class polynome():
self
.
prime_mod
=
229
def
show
(
self
):
# TODO: OPTIMIZE IFs
for
i
in
range
(
len
(
self
.
coefs
)
-
1
,
-
1
,
-
1
):
power
=
""
if
self
.
coefs
[
i
]
!=
0
:
coef
=
str
(
self
.
coefs
[
i
])
if
i
!=
0
:
# its not 0's degree
power
=
f
"
x^
{
i
}
+
"
else
:
coef
=
""
if
i
!=
0
:
power
=
f
"
x^
{
i
}
+
"
else
:
power
=
""
print
(
f
"
{
coef
}{
power
}
"
,
end
=
""
)
print
()
print
(
f
"
{
coef
}{
power
}
"
,
end
=
""
)
print
()
# new line
def
add
(
self
,
poly_2
):
coeff_poly_1
=
self
.
coefs
...
...
This diff is collapsed.
Click to expand it.
reed_solomon.py
+
7
−
1
View file @
c681bbb7
...
...
@@ -25,4 +25,10 @@ def lagrange_compute(l: list) -> polynome:
pass
def
check_nb_error
(
l
:
list
,
p
:
polynome
)
->
int
:
pass
\ No newline at end of file
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
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