65.91 ExpurgatedCode

ExpurgatedCode( C, L )

ExpurgatedCode expurgates code C by throwing away codewords in list L. C must be a linear code. L must be a list of codeword input. The generator matrix of the new code no longer is a basis for the codewords specified by L. Since the returned code is still linear, it is very likely that, besides the words of L, more codewords of C are no longer in the new code.

    gap> C1 := HammingCode( 4 );; WeightDistribution( C1 );
    [ 1, 0, 0, 35, 105, 168, 280, 435, 435, 280, 168, 105, 35, 0, 0, 1 ]
    gap> L := Filtered( Elements(C1), i -> WeightCodeword(i) = 3 );;
    gap> C2 := ExpurgatedCode( C1, L );
    a linear [15,4,3..4]5..11 code, expurgated with 7 word(s)
    gap> WeightDistribution( C2 );
    [ 1, 0, 0, 0, 14, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ] 

This function does not work on non-linear codes. For removing words from a non-linear code, use RemovedElementsCode (see RemovedElementsCode). For expurgating a code of all words of odd weight, use EvenWeightSubcode (see EvenWeightSubcode).

Previous Up Top Next
Index

GAP 3.4.4
April 1997