06.09.2014 Views

guava - Gap

guava - Gap

guava - Gap

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

GUAVA 42<br />

4.7 Generating (Check) Matrices and Polynomials<br />

4.7.1 GeneratorMat<br />

♦ GeneratorMat(C)<br />

(function)<br />

GeneratorMat returns a generator matrix of C. The code consists of all linear combinations of<br />

the rows of this matrix.<br />

If until now no generator matrix of C was determined, it is computed from either the parity check<br />

matrix, the generator polynomial, the check polynomial or the elements (if possible), whichever is<br />

available.<br />

If C is a non-linear code, the function returns an error.<br />

Example<br />

gap> GeneratorMat( HammingCode( 3, GF(2) ) );<br />

[ [ an immutable GF2 vector of length 7],<br />

[ an immutable GF2 vector of length 7],<br />

[ an immutable GF2 vector of length 7],<br />

[ an immutable GF2 vector of length 7] ]<br />

gap> Display(last);<br />

1 1 1 . . . .<br />

1 . . 1 1 . .<br />

. 1 . 1 . 1 .<br />

1 1 . 1 . . 1<br />

gap> GeneratorMat( RepetitionCode( 5, GF(25) ) );<br />

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

gap> GeneratorMat( NullCode( 14, GF(4) ) );<br />

[ ]<br />

4.7.2 CheckMat<br />

♦ CheckMat(C)<br />

(function)<br />

CheckMat returns a parity check matrix of C. The code consists of all words orthogonal to each<br />

of the rows of this matrix. The transpose of the matrix is a right inverse of the generator matrix. The<br />

parity check matrix is computed from either the generator matrix, the generator polynomial, the check<br />

polynomial or the elements of C (if possible), whichever is available.<br />

If C is a non-linear code, the function returns an error.<br />

Example<br />

gap> CheckMat( HammingCode(3, GF(2) ) );<br />

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

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

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

gap> Display(last);<br />

. . . 1 1 1 1<br />

. 1 1 . . 1 1<br />

1 . 1 . 1 . 1<br />

gap> CheckMat( RepetitionCode( 5, GF(25) ) );<br />

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

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

[ 0*Z(5), 0*Z(5), Z(5)ˆ0, Z(5)ˆ2, 0*Z(5) ],

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

Saved successfully!

Ooh no, something went wrong!