Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 924be79

Browse files
author
David Lucas
committed
Minor changes to the information set decoder
1 parent 59de997 commit 924be79

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/sage/coding/decoders_catalog.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from linear_code import (LinearCodeSyndromeDecoder,
3737
LinearCodeNearestNeighborDecoder,
3838
LinearCodeInformationSetDecoder)
39+
3940
from guruswami_sudan.gs_decoder import GRSGuruswamiSudanDecoder
4041
from grs import (GRSBerlekampWelchDecoder,
4142
GRSGaoDecoder,

src/sage/coding/linear_code.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -3759,16 +3759,16 @@ class LinearCode(AbstractLinearCode):
37593759
sage: C = LinearCode(G)
37603760
sage: C
37613761
Linear code of length 7, dimension 4 over Finite Field of size 5
3762-
3762+
37633763
Providing a code as the parameter in order to "forget" its structure (see
37643764
:trac:`20198`)::
3765-
3765+
37663766
sage: C = codes.GeneralizedReedSolomonCode(GF(23).list(), 12)
37673767
sage: LinearCode(C)
37683768
Linear code of length 23, dimension 12 over Finite Field of size 23
3769-
3769+
37703770
Another example::
3771-
3771+
37723772
sage: C = codes.HammingCode(GF(7), 3)
37733773
sage: C
37743774
[57, 54] Hamming Code over Finite Field of size 7
@@ -3831,19 +3831,19 @@ def __init__(self, generator, d=None):
38313831
...
38323832
ValueError: this linear code contains no non-zero vector
38333833
"""
3834-
3834+
38353835
base_ring = generator.base_ring()
38363836
if not base_ring.is_field():
38373837
raise ValueError("'generator' must be defined on a field (not a ring)")
3838-
3838+
38393839
try:
38403840
basis = generator.row_space().basis() # generator matrix case
3841-
3841+
38423842
# if the matrix does not have full rank we replace it
38433843
if len(basis) != generator.nrows():
38443844
from sage.matrix.constructor import matrix
38453845
generator = matrix(base_ring, basis)
3846-
3846+
38473847
if generator.nrows() == 0:
38483848
raise ValueError("this linear code contains no non-zero vector")
38493849
except AttributeError:
@@ -4853,8 +4853,7 @@ def decode_to_code(self, r):
48534853
48544854
INPUT:
48554855
4856-
- ``r`` -- a received word, i.e. a vector in the ambient space of
4857-
:meth:`decoder.Decoder.code`.
4856+
- ``r`` -- a vector in the ambient space of :meth:`decoder.Decoder.code`.
48584857
48594858
OUTPUT:
48604859
@@ -4926,4 +4925,4 @@ def number_errors(self):
49264925
LinearCode._registered_decoders["NearestNeighbor"] = LinearCodeNearestNeighborDecoder
49274926
LinearCodeNearestNeighborDecoder._decoder_type = {"hard-decision", "unique", "always-succeed", "complete"}
49284927
LinearCode._registered_decoders["InformationSet"] = LinearCodeInformationSetDecoder
4929-
LinearCodeNearestNeighborDecoder._decoder_type = {"hard-decision", "unique", "always-succeed", "complete"}
4928+
LinearCodeNearestNeighborDecoder._decoder_type = {"hard-decision", "unique", "might-fail", "might-error", "complete"}

0 commit comments

Comments
 (0)