Home Online Manual
Top
Back: closed_points
Forward: sys_code
FastBack: Visualization
FastForward: decodegb_lib
Up: brnoeth_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.10.1.11 dual_code

Procedure from library brnoeth.lib (see brnoeth_lib).

Usage:
dual_code(G); G a matrix of numbers

Return:
a generator matrix of the dual code generated by G

Note:
The input should be a matrix G of numbers.
The output is also a parity check matrix for the code defined by G

Example:
 
LIB "brnoeth.lib";
ring s=2,T,lp;
// here is the Hamming code of length 7 and dimension 3
matrix G[3][7]=1,0,1,0,1,0,1,0,1,1,0,0,1,1,0,0,0,1,1,1,1;
print(G);
==> 1,0,1,0,1,0,1,
==> 0,1,1,0,0,1,1,
==> 0,0,0,1,1,1,1 
matrix H=dual_code(G);
print(H);
==> 1,1,1,0,0,0,0,
==> 1,0,0,1,1,0,0,
==> 0,1,0,1,0,1,0,
==> 1,1,0,1,0,0,1