@@ -3759,16 +3759,16 @@ class LinearCode(AbstractLinearCode):
3759
3759
sage: C = LinearCode(G)
3760
3760
sage: C
3761
3761
Linear code of length 7, dimension 4 over Finite Field of size 5
3762
-
3762
+
3763
3763
Providing a code as the parameter in order to "forget" its structure (see
3764
3764
:trac:`20198`)::
3765
-
3765
+
3766
3766
sage: C = codes.GeneralizedReedSolomonCode(GF(23).list(), 12)
3767
3767
sage: LinearCode(C)
3768
3768
Linear code of length 23, dimension 12 over Finite Field of size 23
3769
-
3769
+
3770
3770
Another example::
3771
-
3771
+
3772
3772
sage: C = codes.HammingCode(GF(7), 3)
3773
3773
sage: C
3774
3774
[57, 54] Hamming Code over Finite Field of size 7
@@ -3831,19 +3831,19 @@ def __init__(self, generator, d=None):
3831
3831
...
3832
3832
ValueError: this linear code contains no non-zero vector
3833
3833
"""
3834
-
3834
+
3835
3835
base_ring = generator .base_ring ()
3836
3836
if not base_ring .is_field ():
3837
3837
raise ValueError ("'generator' must be defined on a field (not a ring)" )
3838
-
3838
+
3839
3839
try :
3840
3840
basis = generator .row_space ().basis () # generator matrix case
3841
-
3841
+
3842
3842
# if the matrix does not have full rank we replace it
3843
3843
if len (basis ) != generator .nrows ():
3844
3844
from sage .matrix .constructor import matrix
3845
3845
generator = matrix (base_ring , basis )
3846
-
3846
+
3847
3847
if generator .nrows () == 0 :
3848
3848
raise ValueError ("this linear code contains no non-zero vector" )
3849
3849
except AttributeError :
@@ -4853,8 +4853,7 @@ def decode_to_code(self, r):
4853
4853
4854
4854
INPUT:
4855
4855
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`.
4858
4857
4859
4858
OUTPUT:
4860
4859
@@ -4926,4 +4925,4 @@ def number_errors(self):
4926
4925
LinearCode ._registered_decoders ["NearestNeighbor" ] = LinearCodeNearestNeighborDecoder
4927
4926
LinearCodeNearestNeighborDecoder ._decoder_type = {"hard-decision" , "unique" , "always-succeed" , "complete" }
4928
4927
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