File: codeman.gd

package info (click to toggle)
gap-guava 3.20%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,804 kB
  • sloc: ansic: 20,501; xml: 10,382; makefile: 254; sh: 55
file content (237 lines) | stat: -rw-r--r-- 8,842 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
#############################################################################
##
#A  codeman.gd              GUAVA library                       Reinald Baart
#A                                                        &Jasper Cramwinckel
#A                                                           &Erik Roijackers
##
##  This file contains functions for manipulating codes
##

#############################################################################
##
#F  DualCode( <C> ) . . . . . . . . . . . . . . . . . . . .  dual code of <C>
##
DeclareOperation("DualCode", [IsCode]);

#############################################################################
##
#F  AugmentedCode( <C> [, <L>] )  . . .  add words to generator matrix of <C>
##
DeclareOperation("AugmentedCode", [IsCode, IsObject]);

#############################################################################
##
#F  EvenWeightSubcode( <C> )  . . .  code of all even-weight codewords of <C>
##
DeclareOperation("EvenWeightSubcode", [IsCode]);

#############################################################################
##
#F  ConstantWeightSubcode( <C> [, <w>] )  .  all words of <C> with weight <w>
##
DeclareOperation("ConstantWeightSubcode", [IsCode, IsInt]);

#############################################################################
##
#F  ExtendedCode( <C> [, <i>] ) . . . . . code with added parity check symbol
##
DeclareOperation("ExtendedCode", [IsCode, IsInt]);

#############################################################################
##
#F  ShortenedCode( <C> [, <L>] )  . . . . . . . . . . . . . .  shortened code
##
DeclareOperation("ShortenedCode", [IsCode, IsList]);

#############################################################################
##
#F  PuncturedCode( <C> [, <list>] ) . . . . . . . . . . . . .  punctured code
##
##  PuncturedCode(C [, remlist]) punctures a code by leaving out the
##  coordinates given in list remlist. If remlist is omitted, then
##  the last coordinate will be removed.
##
DeclareOperation("PuncturedCode", [IsCode, IsList]);

#############################################################################
##
#F  ExpurgatedCode( <C>, <L> )  . . . . .  removes codewords in <L> from code
##
##  The usual way of expurgating a code is removing all words of odd weight.
##
DeclareOperation("ExpurgatedCode", [IsCode, IsList]);

#############################################################################
##
#F  AddedElementsCode( <C>, <L> ) . . . . . . . . . .  adds words in list <L>
##
DeclareOperation("AddedElementsCode", [IsCode, IsList]);

#############################################################################
##
#F  RemovedElementsCode( <C>, <L> ) . . . . . . . . removes words in list <L>
##
DeclareOperation("RemovedElementsCode", [IsCode, IsList]);

#############################################################################
##
#F  LengthenedCode( <C> [, <i>] ) . . . . . . . . . . . . . .  lengthens code
##
DeclareOperation("LengthenedCode", [IsCode, IsInt]);

#############################################################################
##
#F  ResidueCode( <C> [, <w>] )  . .  takes residue of <C> with respect to <w>
##
##  If w is omitted, a word from C of minimal weight is used
##
DeclareOperation("ResidueCode", [IsCode, IsCodeword]);

#############################################################################
##
#F  ConstructionBCode( <C> )  . . . . . . . . . . .  code from construction B
##
##  Construction B (See M&S, Ch. 18, P. 9) assumes that the check matrix has
##  a first row of weight d' (the dual distance of C). The new code has a
##  check matrix equal to this matrix, but with columns removed where the
##  first row is 1.
##
DeclareOperation("ConstructionBCode", [IsCode]);

#############################################################################
##
#F  ConstructionB2Code( <C> )  . . . . . . . . . .  code from construction B2
##
##  Construction B2 is mixtures of shortening and puncturing. Given an
##  [n,k,d] code which has dual code of minimum distance s, we obtain
##  an [n-s, k-s+2j+1, d-2j] code for each j with 2j+1 < s.
##
##  For more details, see A. Brouwer (1998), "Bounds on the size of linear
##  codes,", in Handbook of Coding Theory, V. S. Pless and W. C. Huffmann
##  ed., pp. 311
##
##  added by CJ, April 2006
##
DeclareOperation("ConstructionB2Code", [IsCode]);

#############################################################################
##
#F  SubCode( <C>, [ <s> ] ) . . . . . . . . . . . . . . . . . . subcode of C
##
##  Given C, an [n,k,d] code, return a subcode of C with dimension k-s.
##  If s is not given, it is assumed 1.
##
##  added by CJ, April 2006
DeclareOperation("SubCode", [IsCode, IsInt]);

#############################################################################
##
#F  PermutedCode( <C>, <P> )  . . . . . . . permutes coordinates of codewords
##
DeclareOperation("PermutedCode", [IsCode, IsPerm]);

#############################################################################
##
#F  StandardFormCode( <C> ) . . . . . . . . . . . . standard form of code <C>
##
DeclareOperation("StandardFormCode", [IsCode]);

#############################################################################
##
#F  ConversionFieldCode( <C> )  . . . . . converts code from GF(q^m) to GF(q)
##
DeclareOperation("ConversionFieldCode", [IsCode]);

#############################################################################
##
#F  CosetCode( <C>, <f> ) . . . . . . . . . . . . . . . . . . .  coset of <C>
##
DeclareOperation("CosetCode", [IsCode, IsCodeword]);

#############################################################################
##
#F  DirectSumCode( <C1>, <C2> ) . . . . . . . . . . . . . . . . .  direct sum
##
##  DirectSumCode(C1, C2) creates a (n1 + n2 , M1 M2 , min{d1 , d2} ) code
##  by adding each codeword of the second code to all the codewords of the
##  first code.
##
DeclareOperation("DirectSumCode", [IsCode, IsCode]);

#############################################################################
##
#F  ConcatenationCode( <C1>, <C2> ) . . . . .  concatenation of <C1> and <C2>
##
DeclareOperation("ConcatenationCode", [IsCode, IsCode]);

#############################################################################
##
#F  DirectProductCode( <C1>, <C2> ) . . . . . . . . . . . . .  direct product
##
##  DirectProductCode constructs a new code from the direct product of two
##  codes by taking the Kronecker product of the two generator matrices
##
DeclareOperation("DirectProductCode", [IsCode, IsCode]);

#############################################################################
##
#F  UUVCode( <C1>, <C2> ) . . . . . . . . . . . . . . .  u | u+v construction
##
##  Uuvcode(C1, C2) # creates a ( 2n , M1 M2 , d = min{2 d1 , d2} ) code
##  with codewords  (u | u + v) for all u in C1 and v in C2
##
DeclareOperation("UUVCode", [IsCode, IsCode]);

#############################################################################
##
#F  UnionCode( <C1>, <C2> ) . . . . . . . . . . . . .  union of <C1> and <C2>
##
DeclareOperation("UnionCode", [IsCode, IsCode]);

#############################################################################
##
#F  IntersectionCode( <C1>, <C2> )  . . . . . . intersection of <C1> and <C2>
##
DeclareOperation("IntersectionCode", [IsCode, IsCode]);

#############################################################################
##
#F  ConstructionXCode( <C>, <A> ) ... code from Construction X
##
##
DeclareOperation("ConstructionXCode", [IsList, IsList]);

#############################################################################
##
#F  ConstructionXXCode( <C1>, <C2>, <C3>, <A1>, <A2>  ) ... code from Construction XX
##
##
DeclareOperation("ConstructionXXCode", [IsCode, IsCode, IsCode, IsCode, IsCode]);

#########################################################################
##
#F BZCode( <O>, <I> ) . . . . . . . . . . Blokh Zyablov concatenated code
##
## Given a set of outer codes O_i=[N, K_i, D_i] over GF(q^e_i), where
## i=1,2,...,t and a set of inner codes I_i=[n, k_i, d_i] over GF(q),
## BZCode returns a multilevel concatenated code with parameter
## [ n*N, e_1*K_1 + e_2*K_2 + ... + e_t*K_t, min(d_i * D_i)] over GF(q).
##
## Note that the set inner codes must satisfy chain condition, i.e.
## I_1=[n,k_1,d_1] < I_2=[n,k_2,d_2] < ... < I_t=[n,k_t,d_t] where
## 0=k_0 < k_1 < k_2 < ... < k_t.
##
## The dimensions of the inner code must satisfy the condition
## e_i = k_i - k_{i-1}, where GF(q^e_i) is the field of the ith
## outer code.
##
DeclareOperation("BZCode", [IsList, IsList]);

DeclareOperation("BZCodeNC", [IsList, IsList]);

#############################################################################
##
#F  HullCode( <C> ) . . . . . . . . . . . . . . . . . . . .  hull of <C>
##
DeclareOperation("HullCode", [IsCode]);