06.09.2014 Views

guava - Gap

guava - Gap

guava - Gap

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GUAVA 22<br />

gap> c:=Random(C);<br />

[ 0 0 0 0 0 0 0 0 0 0 ]<br />

gap> c+C;<br />

[ add. coset of a [10,5,?] randomly generated code over GF(2) ]<br />

gap> c+C=C;<br />

true<br />

gap> IsLinearCode(c+C);<br />

false<br />

gap> v:=Codeword("100000000");<br />

[ 1 0 0 0 0 0 0 0 0 ]<br />

gap> v+C;<br />

[ add. coset of a [10,5,?] randomly generated code over GF(2) ]<br />

gap> C=v+C;<br />

false<br />

gap> C := GeneratorMatCode( [ [1, 0,0,0], [0, 1,0,0] ], GF(2) );<br />

a linear [4,2,1]1 code defined by generator matrix over GF(2)<br />

gap> Elements(C);<br />

[ [ 0 0 0 0 ], [ 0 1 0 0 ], [ 1 0 0 0 ], [ 1 1 0 0 ] ]<br />

gap> v:=Codeword("0011");<br />

[ 0 0 1 1 ]<br />

gap> C+v;<br />

[ add. coset of a linear [4,2,4]1 code defined by generator matrix over GF(2) ]<br />

gap> Elements(C+v);<br />

[ [ 0 0 1 1 ], [ 0 1 1 1 ], [ 1 0 1 1 ], [ 1 1 1 1 ] ]<br />

In general, the operations just described can also be performed on codewords expressed as vectors,<br />

strings or polynomials, although this is not recommended. The vector, string or polynomial is first<br />

converted to a codeword, after which the normal operation is performed. For this to go right, make<br />

sure that at least one of the operands is a codeword. Further more, it will not work when the right<br />

operand is a polynomial. In that case, the polynomial operations (FiniteFieldPolynomialOps) are<br />

called, instead of the codeword operations (CodewordOps).<br />

Some other code-oriented operations with codewords are described in 4.2.<br />

3.4 Functions that Convert Codewords to Vectors or Polynomials<br />

3.4.1 VectorCodeword<br />

♦ VectorCodeword(obj)<br />

(function)<br />

Here obj can be a code word or a list of code words. This function returns the corresponding<br />

vectors over a finite field.<br />

Example<br />

gap> a := Codeword("011011");;<br />

gap> VectorCodeword(a);<br />

[ 0*Z(2), Z(2)ˆ0, Z(2)ˆ0, 0*Z(2), Z(2)ˆ0, Z(2)ˆ0 ]<br />

3.4.2 PolyCodeword<br />

♦ PolyCodeword(obj)<br />

(function)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!