65.166 PiecewiseConstantCode

PiecewiseConstantCode( part, weights [, field ] )

PiecewiseConstantCode returns a code with length n = sum n_i, where <part>=[ n_1, ..., n_k ]. weights is a list of constraints, each of length k. The default field is GF(2).

A constraint is a list of integers, and a word c = ( c_1, ..., c_k ) (according to part) is in the resulting code if and only if |c_i| = w_i^{(l)} for all 1 leq i leq k for some constraint w^{(l)} in <constraints>.

An example might be more clear:

    gap> PiecewiseConstantCode( [ 2, 3 ],
    > [ [ 0, 0 ], [ 0, 3 ], [ 1, 0 ], [ 2, 2 ] ],
    > GF(2) );
    a (5,7,1..5)1..5 piecewise constant code over GF(2)
    gap> Elements(last);
    [ [ 0 0 0 0 0 ], [ 0 0 1 1 1 ], [ 0 1 0 0 0 ], [ 1 0 0 0 0 ],
      [ 1 1 0 1 1 ], [ 1 1 1 0 1 ], [ 1 1 1 1 0 ] ] 

The first constraint is satisfied by codeword 1, the second by codeword 2, the third by codewords 3 and 4, and the fourth by codewords 5, 6 and 7.

Previous Up Top Next
Index

GAP 3.4.4
April 1997