Given a code C which is defined as a subset of the R-space R^((n)), and elements a_1, ..., a_n belonging to R, construct the codeword (a_1, ..., a_n) of C. It is checked that the vector (a_1, ..., a_n) is an element of C.
Given a code C which is defined as a subset of the R-space V = R^((n)), and an element u belonging to V, create the codeword of C corresponding to u. The function will fail if u does not belong to C.
The zero word of the code C.
Sum of the codewords u and v, where u and v belong to the same linear code C.
Additive inverse of the codeword u belonging to the linear code C.
Difference of the codewords u and v, where u and v belong to the same linear code C.
Given an element a belonging to the field R, and a codeword u belonging to the linear code C, return the codeword a * u.
The Hamming weight of the codeword v, i.e., the number of non-zero components of v.
The Hamming distance between the codewords u and v, where u and v belong to the same code C.
Given a word w belonging to the [n, k] code C, return its support as a subset of the integer set { 1 .. n }. The support of w consists of the coordinates at which w has non-zero entries.
Inner product of the vectors u and v with respect to the Euclidean norm, where u and v belong to the parent vector space of the code C.
Given an [n, k] linear code C and a codeword u of C return the coordinates of u with respect to C. The coordinates of u are returned as a sequence Q = [a_1, ..., a_k] of elements from the alphabet of C so that u = a_1 * C.1 + ... + a_k * C.k.
Given an element u of a code defined over the ring R, return the normalization of u, which is the unique vector v such that v = a⋅u for some scalar a in R such that the first non-zero entry of v is the canonical associate in R of the first non-zero entry of u (v is zero if u is zero).
Given a vector u, return the vector obtained from u by cyclically shifting its components to the right by k coordinate positions.
Given a vector u, destructively rotate u by k coordinate positions.
Given a word w belonging to the code C, return the ambient space V of C.
For an element x in Z_4, the Lee weight w_L(x) is defined by: w_L(0) = 0, w_L(1) = w_L(3) = 1, w_L(2) = 2. The Lee Weight w_L(v) of a vector v in (Z_4^n) is defined to be the sum (in Z) of the Lee weights of its components. See [Wan97, p. 16].
The Lee weight of the codeword u.
The Lee distance between the codewords u and v, where u and v belong to the same code C. This is defined to be the Lee weight of (u - v).
> Z4 := IntegerRing(4);
> C := LinearCode<Z4, 8 |
> [1,0,0,0,3,1,2,1],
> [0,1,0,0,1,2,3,1],
> [0,0,1,0,3,3,3,2],
> [0,0,0,1,2,3,1,1]>;
> {Distance(v, w): v, w in C};
{ 0, 4, 5, 7, 8 }
> {Weight(v): v in C};
{ 0, 4, 5, 7, 8 }
> {LeeWeight(v): v in C};
{ 0, 6, 8, 10, 16 }
> {LeeDistance(v, w): v, w in C};
{ 0, 6, 8, 10, 16 }
Given a codeword u belonging to the code C defined over the ring R, return the i-th component of u (as an element of R).
Given an element u belonging to a subcode C of the full R-space V = R^n, a positive integer i, 1 <= i <= n, and an element x of R, this function returns a vector in V which is u with its i-th component redefined to be x.[Next][Prev] [Right] [Left] [Up] [Index] [Root]