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

Commit f49c204

Browse files
committed
trac #19251: A real matrix as LinearCode.basis()
1 parent aeeddeb commit f49c204

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/sage/coding/linear_code.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@
9292
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]])
9393
sage: C = LinearCode(G)
9494
sage: C.basis()
95-
[(1, 1, 1, 0, 0, 0, 0),
96-
(1, 0, 0, 1, 1, 0, 0),
97-
(0, 1, 0, 1, 0, 1, 0),
98-
(1, 1, 0, 1, 0, 0, 1)]
95+
[1 1 1 0 0 0 0]
96+
[1 0 0 1 1 0 0]
97+
[0 1 0 1 0 1 0]
98+
[1 1 0 1 0 0 1]
9999
sage: c = C.basis()[1]
100100
sage: c in C
101101
True
@@ -1036,9 +1036,12 @@ def basis(self):
10361036
10371037
sage: C = codes.HammingCode(3, GF(2))
10381038
sage: C.basis()
1039-
[(1, 0, 0, 0, 0, 1, 1), (0, 1, 0, 0, 1, 0, 1), (0, 0, 1, 0, 1, 1, 0), (0, 0, 0, 1, 1, 1, 1)]
1039+
[1 0 0 0 0 1 1]
1040+
[0 1 0 0 1 0 1]
1041+
[0 0 1 0 1 1 0]
1042+
[0 0 0 1 1 1 1]
10401043
"""
1041-
return self.gens()
1044+
return self.generator_matrix()
10421045

10431046
# S. Pancratz, 19 Jan 2010: In the doctests below, I removed the example
10441047
# ``C.binomial_moment(3)``, which was also marked as ``#long``. This way,
@@ -3317,9 +3320,9 @@ def __init__(self, generator_matrix, d=None):
33173320
....: [a, a + 1, 1, a + 1, 1, 0, 0]])
33183321
sage: C = LinearCode(G)
33193322
sage: C.basis()
3320-
[(1, 0, 0, a + 1, 0, 1, 0),
3321-
(0, 1, 0, 0, a + 1, 0, 1),
3322-
(0, 0, 1, a, a + 1, a, a + 1)]
3323+
[ 1 0 0 a + 1 0 1 0]
3324+
[ 0 1 0 0 a + 1 0 1]
3325+
[ 0 0 1 a a + 1 a a + 1]
33233326
sage: C.minimum_distance()
33243327
3
33253328

0 commit comments

Comments
 (0)