@@ -821,15 +821,15 @@ def __init__(self, base_field, length, default_encoder_name, default_decoder_nam
821
821
TESTS:
822
822
823
823
If the length field is neither a Python int nor a Sage Integer, it will
824
- raise an exception::
824
+ raise a exception::
825
825
826
826
sage: C = CodeExample(GF(17), 10.0, 5, generator_matrix)
827
827
Traceback (most recent call last):
828
828
...
829
829
ValueError: length must be a Python int or a Sage Integer
830
830
831
831
If the name of the default decoder is not known by the class, it will raise
832
- an exception::
832
+ a exception::
833
833
834
834
sage: class CodeExample(sage.coding.linear_code.AbstractLinearCode):
835
835
....: def __init__(self, field, length, dimension, generator_matrix):
@@ -844,7 +844,7 @@ def __init__(self, base_field, length, default_encoder_name, default_decoder_nam
844
844
sage: C = CodeExample(GF(17), 10, 5, generator_matrix)
845
845
Traceback (most recent call last):
846
846
...
847
- ValueError: You must set a valid decoder as default decoder for this code, by filling the dicitonary of registered decoders
847
+ ValueError: You must set a valid decoder as default decoder for this code, by filling in the dicitonary of registered decoders
848
848
849
849
If the name of the default encoder is not known by the class, it will raise
850
850
an exception::
@@ -862,7 +862,7 @@ def __init__(self, base_field, length, default_encoder_name, default_decoder_nam
862
862
sage: C = CodeExample(GF(17), 10, 5, generator_matrix)
863
863
Traceback (most recent call last):
864
864
...
865
- ValueError: You must set a valid encoder as default encoder for this code, by filling the dictionary of registered encoders
865
+ ValueError: You must set a valid encoder as default encoder for this code, by filling in the dictionary of registered encoders
866
866
867
867
A ring instead of a field::
868
868
@@ -875,11 +875,10 @@ def __init__(self, base_field, length, default_encoder_name, default_decoder_nam
875
875
raise ValueError ("length must be a Python int or a Sage Integer" )
876
876
if not base_field .is_field ():
877
877
raise ValueError ("'base_field' must be a field (and {} is not one)" .format (base_field ))
878
- self ._length = Integer (length )
879
878
if not default_encoder_name in self ._registered_encoders :
880
- raise ValueError ("You must set a valid encoder as default encoder for this code, by filling the dictionary of registered encoders" )
879
+ raise ValueError ("You must set a valid encoder as default encoder for this code, by filling in the dictionary of registered encoders" )
881
880
if not default_decoder_name in self ._registered_decoders :
882
- raise ValueError ("You must set a valid decoder as default decoder for this code, by filling the dicitonary of registered decoders" )
881
+ raise ValueError ("You must set a valid decoder as default decoder for this code, by filling in the dicitonary of registered decoders" )
883
882
self ._length = Integer (length )
884
883
self ._default_decoder_name = default_decoder_name
885
884
self ._default_encoder_name = default_encoder_name
@@ -1610,7 +1609,7 @@ def decode(self, right, algorithm="syndrome"):
1610
1609
1611
1610
INPUT:
1612
1611
1613
- - ``right`` -- a vector of the same length as ``self`` over test
1612
+ - ``right`` -- a vector of the same length as ``self`` over
1614
1613
the base field of ``self``
1615
1614
1616
1615
- ``algorithm`` -- (default: ``'syndrome'``) Name of the decoding algorithm which
@@ -1636,7 +1635,7 @@ def decode_to_code(self, word, decoder_name=None, **kwargs):
1636
1635
1637
1636
INPUT:
1638
1637
1639
- - ``word`` -- a vector of the same length as ``self`` over test
1638
+ - ``word`` -- a vector of the same length as ``self`` over
1640
1639
the base field of ``self``
1641
1640
1642
1641
- ``decoder_name`` -- (default: ``None``) Name of the decoder which will be used
@@ -3901,7 +3900,7 @@ def __hash__(self):
3901
3900
sage: hash(C) #random
3902
3901
9015017528451745710
3903
3902
3904
- If ``C1`` and ``C2`` are two codes which only differs by the coefficients of their
3903
+ If ``C1`` and ``C2`` are two codes which only differ by the coefficients of their
3905
3904
generator matrices, their hashes are different (we check that the bug found in trac #18813
3906
3905
is fixed)::
3907
3906
@@ -3914,7 +3913,7 @@ def __hash__(self):
3914
3913
"""
3915
3914
Str = str (self )
3916
3915
G = str (self .generator_matrix ()) #str because mutable matrices are unhashable
3917
- return hash ((Str , G )) ^ hash (Str ) ^ hash (Str )
3916
+ return hash ((Str , G )) ^ hash (Str ) ^ hash (G )
3918
3917
3919
3918
def generator_matrix (self , encoder_name = None , ** kwargs ):
3920
3919
r"""
@@ -4033,8 +4032,12 @@ def generator_matrix(self):
4033
4032
####################### decoders ###############################
4034
4033
class LinearCodeSyndromeDecoder (Decoder ):
4035
4034
r"""
4036
- Construct a decoder for Linear Codes. This decoder will use a syndrome
4037
- based decoding algorithm.
4035
+ Construct a decoder for Linear Codes.
4036
+
4037
+ .. WARNING::
4038
+
4039
+ As explained in trac #19623, despite its name this decoder actually uses a
4040
+ nearest neighbor decoding algorithm.
4038
4041
4039
4042
INPUT:
4040
4043
0 commit comments