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

Commit 196e395

Browse files
author
David Lucas
committed
Removed trailing whitespaces and changed LinearCode docstring
1 parent 57a4944 commit 196e395

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/sage/coding/linear_code.py

+21-15
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,9 @@ def self_orthogonal_binary_codes(n, k, b=2, parent=None, BC=None, equal=False,
696696
class AbstractLinearCode(module.Module):
697697
"""
698698
Abstract class for linear codes.
699-
699+
700700
This class contains all methods that can be used on Linear Codes
701-
and on Linear Codes families.
701+
and on Linear Codes families.
702702
So, every Linear Code-related class should inherit from this abstract
703703
class.
704704
@@ -792,7 +792,7 @@ def __init__(self, base_field, length):
792792
raise an exception::
793793
794794
sage: C = CodeExample(GF(17), 10.0, 5, generator_matrix)
795-
Traceback (most recent call last):
795+
Traceback (most recent call last):
796796
...
797797
ValueError: length must be a Python int or a Sage Integer
798798
"""
@@ -1017,7 +1017,7 @@ def base_field(self):
10171017
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]])
10181018
sage: C = LinearCode(G)
10191019
sage: C.base_field()
1020-
Finite Field of size 2
1020+
Finite Field of size 2
10211021
"""
10221022
return self.base_ring()
10231023

@@ -1331,7 +1331,7 @@ def parity_check_matrix(self):
13311331
r"""
13321332
Returns the parity check matrix of ``self``.
13331333
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
13351335
generator matrix of the dual code of `C`.
13361336
13371337
EXAMPLES::
@@ -1803,7 +1803,7 @@ def __getitem__(self, i):
18031803
return codeword
18041804

18051805
def generator_matrix(self):
1806-
return NotImplementedError("This method must be set in subclasses")
1806+
return NotImplementedError("This method must be set in subclasses")
18071807

18081808
def generator_matrix_systematic(self):
18091809
"""
@@ -2972,7 +2972,7 @@ def syndrome(self, r):
29722972
Returns the syndrome of ``r``.
29732973
29742974
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``,
29762976
its syndrome equals to the zero vector.
29772977
29782978
INPUT:
@@ -2982,21 +2982,21 @@ def syndrome(self, r):
29822982
OUTPUT:
29832983
29842984
- a column vector
2985-
2985+
29862986
EXAMPLES::
29872987
29882988
sage: MS = MatrixSpace(GF(2),4,7)
29892989
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]])
29902990
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))
29922992
sage: r in C
29932993
True
29942994
sage: C.syndrome(r)
29952995
(0, 0, 0)
29962996
29972997
If ``r`` is not a codeword, its syndrome is not equal to zero::
29982998
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))
30003000
sage: r in C
30013001
False
30023002
sage: C.syndrome(r)
@@ -3214,13 +3214,19 @@ def LinearCodeFromVectorSpace(V, d=None):
32143214

32153215
class LinearCode(AbstractLinearCode):
32163216
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.
32183223
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.
32223228
3223-
See :wikipedia:`Linear_code` for more information.
3229+
See :wikipedia:`Linear_code` for more information on unstructured linear codes.
32243230
32253231
INPUT:
32263232

0 commit comments

Comments
 (0)