File: util2.gd

package info (click to toggle)
guava 3.6-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 11,788 kB
  • ctags: 2,359
  • sloc: ansic: 20,846; xml: 10,043; sh: 2,855; makefile: 388
file content (116 lines) | stat: -rw-r--r-- 3,360 bytes parent folder | download | duplicates (2)
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
#############################################################################
##
#A  util2.gd                GUAVA library                       Reinald Baart
#A                                                        &Jasper Cramwinckel
#A                                                           &Erik Roijackers
#A                                                         &David Joyner
## 
##  This file contains miscellaneous functions
##
#H  @(#)$Id: util2.gd,v 1.3 2003/02/12 03:49:21 gap Exp $
##
## several functions added 12-16-2005 
##  

Revision.("guava/lib/util2_gd") :=
    "@(#)$Id: util2.gd,v 1.3 2003/02/12 03:49:21 gap Exp $";

########################################################################
##
#F  AllOneVector( <n> [, <field> ] )
##
##  Return a vector with all ones.
##
DeclareOperation("AllOneVector", [IsInt, IsField]); 

########################################################################
##
#F  AllOneCodeword( <n>, <field> )
##
##  Return a codeword with <n> ones.
##
DeclareOperation("AllOneCodeword", [IsInt, IsField]); 

#############################################################################
##
#F  IntCeiling( <r> )
##
##  Return the smallest integer greater than or equal to r.
##  3/2 => 2,  -3/2 => -1.
##
DeclareOperation("IntCeiling", [IsRat]); 

########################################################################
##
#F  IntFloor( <r> ) 
##
##  Return the greatest integer smaller than or equal to r.
##  3/2 => 1, -3/2 => -2.
##
DeclareOperation("IntFloor", [IsRat]); 

########################################################################
##
#F  KroneckerDelta( <i>, <j> )
##
##  Return 1 if i = j,
##         0 otherwise
##
DeclareOperation("KroneckerDelta", [IsInt, IsInt]); 

########################################################################
##
#F  BinaryRepresentation( <elements>, <length> )
##
##  Return a binary representation of an element
##  of GF( 2^k ), where k <= length.
##  
##  If elements is a list, then return the binary
##  representation of every element of the list.
##
##  This function is used to make to Gabidulin codes.
##  It is not intended to be a global function, but including
##  it in all five Gabidulin codes is a bit over the top
##
##  Therefore, no error checking is done.
##

########################################################################
##
#F  SortedGaloisFieldElements( <size> )
##
##  Sort the field elements of size <size> according to
##  their log.
##
##  This function is used to make to Gabidulin codes.
##  It is not intended to be a global function, but including
##  it in all five Gabidulin codes is not a good idea.
## 

########################################################################
##
#F  VandermondeMat( <Pts> , <a> )
##  
## Input: Pts=[x1,..,xn], a >0 an integer
## Output: Vandermonde matrix (xi^j), 
##         for xi in Pts and 0 <= j <= a
##         (an nx(a+1) matrix)
##
DeclareOperation("VandermondeMat", [IsList, IsInt]); 

###########################################################
##
#F    MultiplicityInList(L,a)
##  
## Input: a list L
##        an element a of L
## Output: the multiplicity a occurs in L
##

###########################################################
##
#F    MostCommonInList(L,a)
##  
## Input: a list L
## Output: an a in L which occurs at least as much as any other in L
##