source: git/Tst/Manual/AG_codes.tst @ 228e0b

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: 1.8 KB
Line 
1LIB "tst.lib"; tst_init();
2LIB "brnoeth.lib";
3ring s=2,(x,y),lp;            // characteristic 2
4poly f=x3y+y3+x;              // the Klein quartic
5list KLEIN=Adj_div(f);        // compute the conductor
6KLEIN=NSplaces(1..3,KLEIN);   // computes places up to degree 3
7KLEIN=extcurve(3,KLEIN);      // construct Klein quartic over F_8
8KLEIN[3];                     // display places (degree, number)
9// We define a divisor G of degree 14=6*1+4*2:
10intvec G=6,0,0,4,0,0,0,0,0,0,0;   // 6 * place #1 + 4 * place #4
11// We compute an evaluation code which evaluates at all rational places
12// outside the support of G (place #4 is not rational)
13intvec D=2..24;
14// in D, the number i refers to the i-th element of the list POINTS in
15// the ring KLEIN[1][5].
16def RR=KLEIN[1][5];
17setring RR; POINTS[1];        // the place in the support of G (not in supp(D))
18setring s;
19def RR=KLEIN[1][4];
20setring RR;
21matrix C=AGcode_L(G,D,KLEIN); // generator matrix for the evaluation AG code
22nrows(C);
23ncols(C);
24//
25// We can also compute a generator matrix for the residual AG code
26matrix CO=AGcode_Omega(G,D,KLEIN);
27//
28// Preparation for decoding:
29// We need a divisor of degree at least 6 whose support is disjoint with the
30// support of D:
31intvec F=6;                   // F = 6*point #1
32// in F, the i-th entry refers to the i-th element of the list POINTS in
33// the ring KLEIN[1][5]
34list K=prepSV(G,D,F,KLEIN);
35K[size(K)][1];                // error-correcting capacity
36//
37//  Encoding and Decoding:
38matrix word[1][11];           // a word of length 11 is encoded
39word = 1,1,1,1,1,1,1,1,1,1,1;
40def y=word*CO;                // the code word (length: 23)
41matrix disturb[1][23];
42disturb[1,1]=1;
43disturb[1,10]=a;
44disturb[1,12]=1+a;
45y=y+disturb;                  // disturb the code word (3 errors)
46def yy=decodeSV(y,K);         // error correction
47yy-y;                         // display the error
48tst_status(1);$
Note: See TracBrowser for help on using the repository browser.