65.95 ShortenedCode

ShortenedCode( C )

ShortenedCode returns code C shortened by taking a cross section. If C is a linear code, this is done by removing all codewords that start with a non-zero entry, after which the first column is cut off. If C was a [n,k,d] code, the shortened code generally is a [n-1,k-1,d] code. It is possible that the dimension remains the same; it is also possible that the minimum distance increases.

    gap> C1 := HammingCode( 4 );
    a linear [15,11,3]1 Hamming (4,2) code over GF(2)
    gap> C2 := ShortenedCode( C1 );
    a linear [14,10,3]2 shortened code 

If C is a non-linear code, ShortenedCode first checks which finite field element occurs most often in the first column of the codewords. The codewords not starting with this element are removed from the code, after which the first column is cut off. The resulting shortened code has at least the same minimum distance as C.

    gap> C1 := ElementsCode( ["1000", "1101", "0011" ], GF(2) );
    a (4,3,1..4)2 user defined unrestricted code over GF(2)
    gap> MinimumDistance( C1 );
    2
    gap> C2 := ShortenedCode( C1 );
    a (3,2,2..3)1..2 shortened code
    gap> Elements( C2 );
    [ [ 0 0 0 ], [ 1 0 1 ] ] 

ShortenedCode( C, L )

When called in this format, ShortenedCode repeats the shortening process on each of the columns specified by L. L therefore is a list of integers. The column numbers in L are the numbers as they are before the shortening process. If L has l entries, the returned code has a word length of l positions shorter than C.

    gap> C1 := HammingCode( 5, GF(2) );
    a linear [31,26,3]1 Hamming (5,2) code over GF(2)
    gap> C2 := ShortenedCode( C1, [ 1, 2, 3 ] );
    a linear [28,23,3]2 shortened code
    gap> OptimalityLinearCode( C2 );
    0 

The function LengthenedCode lengthens the code again (only for linear codes), see LengthenedCode. In general, this is not exactly the inverse function.

Previous Up Top Next
Index

GAP 3.4.4
April 1997