source: git/Tst/Manual/syndrome.tst @ 6fb723

spielwiese
Last change on this file since 6fb723 was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 453 bytes
Line 
1LIB "tst.lib"; tst_init();
2LIB "decodegb.lib";
3ring r=2,x,dp;
4matrix x[1][4]=1,0,1,0;
5matrix g[4][7]=1,0,0,0,0,1,1,
60,1,0,0,1,0,1,
70,0,1,0,1,1,1,
80,0,0,1,1,1,0;
9//encode x with the generator matrix g
10matrix c=encode(x,g);
11// disturb
12c[1,3]=0;
13//compute syndrome
14//corresponding check matrix
15matrix check[3][7]=1,0,0,1,1,0,1,0,1,0,1,0,1,1,0,0,1,0,1,1,1;
16print(syndrome(check,c));
17c[1,3]=1;
18//now c is a codeword
19print(syndrome(check,c));
20tst_status(1);$
Note: See TracBrowser for help on using the repository browser.