File: codeword.gd

package info (click to toggle)
gap-guava 3.13%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,692 kB
  • ctags: 1,493
  • sloc: ansic: 20,869; xml: 10,231; makefile: 268; sh: 71
file content (111 lines) | stat: -rw-r--r-- 4,181 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
#############################################################################
##
#A  codeword.gd            GUAVA library                       Reinald Baart
#A                                                        &Jasper Cramwinckel
#A                                                           &Erik Roijackers
##
##  This file contains functions for working with codewords
##

#############################################################################
##
#F  IsCodeword( <v> ) . . . . . . . . . . . . . . . .  codeword category 
##
DeclareCategory("IsCodeword", IsRowVector); 
DeclareCategoryCollections("IsCodeword"); 

#############################################################################
##
#F  Codeword( <list> [, <F>] or . . . . . . . . . . . .  creates new codeword
#F  Codeword( <P> [, <n>] [, <F>] ) . . . . . . . . . . . . . . . . . . . . .
##  Codeword( <P>, Code)  . . . . . . . . . . . . . . . . . . . . . . . . . .
##
DeclareOperation("Codeword", [IsObject, IsInt, IsFFE]);

#############################################################################
##
#F  Support( <v> )  . . . . . . . set of coordinates in which <v> is not zero
##
DeclareAttribute("Support", IsCodeword); 

#############################################################################
##
#F  TreatAsPoly( <v> )  . . . . . . . . . . . .  treat codeword as polynomial
##
##  The codeword <v> will be treated as a polynomial
##
DeclareOperation("TreatAsPoly", [IsCodeword]);

#############################################################################
##
#F  TreatAsVector( <v> )  . . . . . . . . . . . .  treat codeword as a vector
##
##  The codeword <v> will be treated as a vector
##
DeclareOperation("TreatAsVector", [IsCodeword]);

#############################################################################
##
#F  PolyCodeword( <arg> ) . . . . . . . . . . converts input to polynomial(s)
##
## Input may be codeword, polynomial, vector or a list of those
##  
DeclareAttribute("PolyCodeword", IsCodeword); 

#############################################################################
##
#F  VectorCodeword( <arg> ) . . . . . . . . . . . .  converts input to vector
##
## Input may be codeword, polynomial, vector or a list of those
## 
DeclareAttribute("VectorCodeword", IsCodeword); 

#############################################################################
##
#F  Weight( <v> ) . . . . . . . . . . . calculates the weight of codeword <v>
##
DeclareAttribute("Weight", IsCodeword); 

#############################################################################
##
#F  WeightCodeword( <v> ) . . . . . . . calculates the weight of codeword <v>
##
DeclareSynonymAttr("WeightCodeword", Weight);

#############################################################################
##
#F  DistanceCodeword( <a>, <b> )  . the distance between codeword <a> and <b>
##
DeclareOperation("DistanceCodeword", [IsCodeword, IsCodeword]); 

#############################################################################
##
#F  NullWord( <C> ) or NullWord( <n>, <F> ) . . . . . . . . . . all zero word
##
DeclareOperation("NullWord", [IsInt, IsFFE]); 

#############################################################################
##
## Zero(<w>) .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  zero codeword
##

#############################################################################
##
#F  WordLength( <v> ) . . . . . . . . . stores the wordlength of codeword <v>
## 			Currently no method to calculate.  Assumed to be set at creation. 
DeclareAttribute("WordLength", IsCodeword); 

#############################################################################
##
#F  AdditiveInverseMutable( <v> ) . .  . determines the negative of a
##                              codewor <v>. (Used in subtraction of codewords.)
## 			
# DeclareOperation("AdditiveInverseMutable", [IsCodeword]);

#############################################################################
##
#F  Codeword( <list>, <n> [, <F>] or . . . . . . . . creates new codeword with
#F  Codeword( <list> , <Code> ) . . . . . . . . . . . support in <list>
##
DeclareOperation("ErrorVector", [IsSet, IsInt, IsFFE]);