spielwiese
Last change
on this file since 228e0b 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:
573 bytes
|
Rev | Line | |
---|
[894057] | 1 | LIB "tst.lib"; tst_init(); |
---|
| 2 | LIB "decodegb.lib"; |
---|
| 3 | //correct 1 error in [15,7] binary code |
---|
| 4 | int t=1; int q=16; int n=15; int redun=10; |
---|
| 5 | ring r=(q,a),x,dp; |
---|
| 6 | //generate random check matrix |
---|
| 7 | matrix h=randomCheck(redun,n,1); |
---|
| 8 | matrix g=dual_code(h); |
---|
| 9 | matrix x[1][n-redun]=0,0,1,0,1,0,1; |
---|
| 10 | matrix y[1][n]=encode(x,g); |
---|
| 11 | print(y); |
---|
| 12 | // find out the minimum distance of the code |
---|
| 13 | list l=mindist(h); |
---|
| 14 | //disturb with errors |
---|
| 15 | "Correct ",(l[1]-1) div 2," errors"; |
---|
| 16 | matrix rec[1][n]=errorRand(y,(l[1]-1) div 2,1); |
---|
| 17 | print(rec); |
---|
| 18 | //let us decode |
---|
| 19 | matrix dec_word=decode(h,rec); |
---|
| 20 | print(dec_word); |
---|
| 21 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.