@@ -696,9 +696,9 @@ def self_orthogonal_binary_codes(n, k, b=2, parent=None, BC=None, equal=False,
696
696
class AbstractLinearCode (module .Module ):
697
697
"""
698
698
Abstract class for linear codes.
699
-
699
+
700
700
This class contains all methods that can be used on Linear Codes
701
- and on Linear Codes families.
701
+ and on Linear Codes families.
702
702
So, every Linear Code-related class should inherit from this abstract
703
703
class.
704
704
@@ -792,7 +792,7 @@ def __init__(self, base_field, length):
792
792
raise an exception::
793
793
794
794
sage: C = CodeExample(GF(17), 10.0, 5, generator_matrix)
795
- Traceback (most recent call last):
795
+ Traceback (most recent call last):
796
796
...
797
797
ValueError: length must be a Python int or a Sage Integer
798
798
"""
@@ -1017,7 +1017,7 @@ def base_field(self):
1017
1017
sage: G = Matrix(GF(2), [[1,1,1,0,0,0,0], [1,0,0,1,1,0,0], [0,1,0,1,0,1,0], [1,1,0,1,0,0,1]])
1018
1018
sage: C = LinearCode(G)
1019
1019
sage: C.base_field()
1020
- Finite Field of size 2
1020
+ Finite Field of size 2
1021
1021
"""
1022
1022
return self .base_ring ()
1023
1023
@@ -1331,7 +1331,7 @@ def parity_check_matrix(self):
1331
1331
r"""
1332
1332
Returns the parity check matrix of ``self``.
1333
1333
1334
- The parity check matrix of a linear code `C` corresponds to the
1334
+ The parity check matrix of a linear code `C` corresponds to the
1335
1335
generator matrix of the dual code of `C`.
1336
1336
1337
1337
EXAMPLES::
@@ -1803,7 +1803,7 @@ def __getitem__(self, i):
1803
1803
return codeword
1804
1804
1805
1805
def generator_matrix (self ):
1806
- return NotImplementedError ("This method must be set in subclasses" )
1806
+ return NotImplementedError ("This method must be set in subclasses" )
1807
1807
1808
1808
def generator_matrix_systematic (self ):
1809
1809
"""
@@ -2972,7 +2972,7 @@ def syndrome(self, r):
2972
2972
Returns the syndrome of ``r``.
2973
2973
2974
2974
The syndrome of ``r`` is the result of `H \times r` where `H` is
2975
- the parity check matrix of ``self``. If ``r`` belongs to ``self``,
2975
+ the parity check matrix of ``self``. If ``r`` belongs to ``self``,
2976
2976
its syndrome equals to the zero vector.
2977
2977
2978
2978
INPUT:
@@ -2982,21 +2982,21 @@ def syndrome(self, r):
2982
2982
OUTPUT:
2983
2983
2984
2984
- a column vector
2985
-
2985
+
2986
2986
EXAMPLES::
2987
2987
2988
2988
sage: MS = MatrixSpace(GF(2),4,7)
2989
2989
sage: G = MS([[1,1,1,0,0,0,0], [1,0,0,1,1,0,0], [0,1,0,1,0,1,0], [1,1,0,1,0,0,1]])
2990
2990
sage: C = LinearCode(G)
2991
- sage: r = vector(GF(2), (1,0,1,0,1,0,1))
2991
+ sage: r = vector(GF(2), (1,0,1,0,1,0,1))
2992
2992
sage: r in C
2993
2993
True
2994
2994
sage: C.syndrome(r)
2995
2995
(0, 0, 0)
2996
2996
2997
2997
If ``r`` is not a codeword, its syndrome is not equal to zero::
2998
2998
2999
- sage: r = vector(GF(2), (1,0,1,0,1,1,1))
2999
+ sage: r = vector(GF(2), (1,0,1,0,1,1,1))
3000
3000
sage: r in C
3001
3001
False
3002
3002
sage: C.syndrome(r)
@@ -3214,13 +3214,19 @@ def LinearCodeFromVectorSpace(V, d=None):
3214
3214
3215
3215
class LinearCode (AbstractLinearCode ):
3216
3216
r"""
3217
- Linear codes over a finite field or finite ring.
3217
+ Linear codes over a finite field or finite ring, represented using a
3218
+ generator matrix.
3219
+
3220
+ This class should be used for arbitrary and unstructured linear codes. This
3221
+ means that basic operations on the code, such as the computation of the
3222
+ minimum distance, will use generic, slow algorithms.
3218
3223
3219
- A *linear code* is a subspace of a vector space over a finite field. It can
3220
- be defined by one of its basis or equivalently a generator matrix (a `k
3221
- \times n` matrix of full rank `k`).
3224
+ If you are looking for constructing a code from a more specific family, see
3225
+ if the family has been implemented by investigating codes.<tab>. These
3226
+ more specific classes use properties particular for that family to allow
3227
+ faster algorithms, and could also have family-specific methods.
3222
3228
3223
- See :wikipedia:`Linear_code` for more information.
3229
+ See :wikipedia:`Linear_code` for more information on unstructured linear codes .
3224
3230
3225
3231
INPUT:
3226
3232
0 commit comments