Changeset c34952 in git


Ignore:
Timestamp:
Aug 11, 2008, 10:31:56 AM (16 years ago)
Author:
Stanislav Bulygin <bulygin@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
1e5b760d17d4a47feae5716b7f581fd22e98960b
Parents:
8e5a056876d28989ee075ac8260ef617777a486b
Message:
hard examples at the end are added


git-svn-id: file:///usr/local/Singular/svn/trunk@10984 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/decodedistGB.lib

    r8e5a056 rc34952  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: decodedistGB.lib,v 1.1 2008-07-15 09:39:28 Singular Exp $";
     2version="$Id: decodedistGB.lib,v 1.2 2008-08-11 08:31:56 bulygin Exp $";
    33category="Coding theory";
    44info="
    55LIBRARY:   decodedistGB.lib     Generating and solving systems of polynomial equations for decoding and finding the minimum distance of linear codes
    66AUTHORS:   Stanislav Bulygin,   bulygin@mathematik.uni-kl.de,
    7            Ruud Pellikaan,      g.r.pellikaan@tue.nl
     7           Ruud Pellikaan,      g.r.pellikaan@tue.nl           
    88
    99OVERVIEW:
    1010 In this library we generate several systems used for decoding cyclic codes. And finding the minimum distance
    1111 Namely, we work with the Cooper's philosophy and generalized Newton identities.
    12  The original method of quadratic equations is worked out here as well.
     12 The original method of quadratic equations is worked out here as well. 
    1313 We also (for comparison) enable to work with the system of Fitzgerald-Lax.
    1414 We provide also some auxiliary functions for further manipulations and decoding.
    15  For an overview of the methods mentioned above, cf. Stanislav Bulygin, Ruud Pellikaan: 'Decoding and finding the minimum distance with
     15 For an overview of the methods mentioned above, cf. Stanislav Bulygin, Ruud Pellikaan: 'Decoding and finding the minimum distance with 
    1616 Groebner bases: history and new insights', in 'Selected Topics in Information and Coding Theory', World Scientific (2008) (to appear).
    1717
    18 MAIN PROCEDURES:
     18MAIN PROCEDURES: 
    1919 CRHT(n,defset,e,q,m,#); generates the CRHT-ideal that follows Cooper's philosophy, Sala's extentions are available
    2020 CRHT_mindist_binary(n,defset,w); generates the ideal from Cooper's philosophy to find the minimum distance in the binary case
     
    2929 MDSmat(n,a);  generates an MDS (actually an RS) matrix
    3030 mindist(check);   computes the minimum distance of the code via solving systems of quadratic equations
    31  decode(rec);  decoding of a word using the systems of quadratic equations
     31 decode(rec);  decoding of a word using the systems of quadratic equations 
    3232 solve_for_random(redun,ncodes,ntrials,#);  a procedure for manipulation with random codes
    3333 solve_for_code(check,ntrials,#); a procedure for manipulation with a given codes
    34  vanish_id(points); computes the vanishing ideal for the given set of points
     34 vanish_id(points); computes the vanishing ideal for the given set of points. The algorithm of Farr and Gao is implemented
    3535 FLsystem(check,y,t,e,s); generates the Fitzgerald-Lax system
    3636 FL_solve_for_random(n,redun,p,e,t,ncodes,ntrials,minpol); a procedure for manipulation with random codes via Fitzgerald-Lax
    37 
    38 
    39 KEYWORDS:  Cyclic code; Linear code; Decoding;
     37 
     38
     39KEYWORDS:  Cyclic code; Linear code; Decoding; 
    4040           Minimum distance; Groebner bases
    4141";
     
    8989  }
    9090 }
    91  return(result);
     91 return(result);   
    9292}
    9393
     
    110110"
    111111{
    112   int r=size(defset);
     112  int r=size(defset); 
    113113  ring @crht=(q,a),(Y(e..1),Z(1..e),X(r..1)),lp;
    114114  ideal crht;
    115115  int i,j;
    116116  poly sum;
    117 
     117 
    118118  // check equations
    119119  for (i=1; i<=r; i++)
     
    126126    crht[i]=sum-X(i);
    127127  }
    128 
     128 
    129129  // restrictions on syndromes
    130130  for (i=1; i<=r; i++)
     
    132132    crht=crht,X(i)^(q^m)-X(i);
    133133  }
    134 
     134 
    135135  // n-th roots of unity
    136136  for (i=1; i<=e; i++)
     
    138138    crht=crht,Z(i)^(n+1)-Z(i);
    139139  }
    140 
     140 
    141141  for (i=1; i<=e; i++)
    142142  {
    143143    crht=crht,Y(i)^(q-1)-1;
    144   }
    145 
     144  } 
     145 
    146146  if (#)
    147147  {
     
    153153      }
    154154    }
    155   }
    156   export crht;
    157   return(@crht);
    158 }
    159 example
     155  } 
     156  export crht; 
     157  return(@crht);   
     158} example
    160159{
    161160  "EXAMPLE:"; echo=2;
    162161  // binary cyclic [15,7,5] code with defining set (1,3)
    163 
     162 
    164163  list defset=1,3; // defining set
    165 
     164 
    166165  int n=15; // length
    167166  int e=2; // error-correcting capacity
     
    169168  int m=4; // degree extension of the splitting field
    170169  int sala=1; // indicator to add additional equations
    171 
    172   def A=CRHT(n,defset,e,q,m);
     170   
     171  def A=CRHT(n,defset,e,q,m); 
    173172  setring A;
    174173  A; // shows the ring we are working in
    175   print(crht); // the CRHT-ideal
     174  print(crht); // the CRHT-ideal 
    176175  option(redSB);
    177176  ideal red_crht=std(crht);
    178177  // reduced Groebner basis
    179178  print(red_crht);
    180 
     179 
    181180  //============================
    182   A=CRHT(n,defset,e,q,m,sala);
    183   setring A;
     181  A=CRHT(n,defset,e,q,m,sala); 
     182  setring A; 
    184183  print(crht); // the CRHT-ideal with additional equations from Sala
    185184  option(redSB);
     
    199198"
    200199{
    201   int r=size(defset);
     200  int r=size(defset); 
    202201  ring @crht_md=2,Z(1..w),lp;
    203202  ideal crht_md;
    204203  int i,j;
    205204  poly sum;
    206 
     205 
    207206  // check equations
    208207  for (i=1; i<=r; i++)
     
    214213    }
    215214    crht_md[i]=sum;
    216   }
    217 
    218 
     215  } 
     216 
     217 
    219218  // n-th roots of unity
    220219  for (i=1; i<=w; i++)
    221220  {
    222221    crht_md=crht_md,Z(i)^n-1;
    223   }
    224 
    225 
     222  } 
     223 
     224 
    226225  for (i=1; i<=w; i++)
    227226  {
     
    231230    }
    232231  }
    233 
    234   export crht_md;
    235   return(@crht_md);
    236 }
    237 example
     232   
     233  export crht_md; 
     234  return(@crht_md);   
     235} example
    238236{
    239237  "EXAMPLE:"; echo=2;
    240238  // binary cyclic [15,7,5] code with defining set (1,3)
    241 
     239 
    242240  list defset=1,3; // defining set
    243 
     241 
    244242  int n=15; // length
    245   int d=5; // candidate for the minimum distance
    246 
    247   def A=CRHT_mindist_binary(n,defset,d);
     243  int d=5; // candidate for the minimum distance 
     244     
     245  def A=CRHT_mindist_binary(n,defset,d); 
    248246  setring A;
    249247  A; // shows the ring we are working in
     
    252250  ideal red_crht_md=std(crht_md);
    253251  // reduced Groebner basis
    254   print(red_crht_md);
     252  print(red_crht_md); 
    255253}
    256254
     
    265263          t is the number of errors, q is basefield size, m is degree extension of the splitting field
    266264          if triangular>0 it indicates that Newton identities in triangular form should be constructed
    267 RETURN:   a ring to work with the generalized Newton identities (in triangular form if applicable),
     265RETURN:   a ring to work with the generalized Newton identities (in triangular form if applicable), 
    268266          the ideal itself is exported with the name 'newton'
    269267EXAMPLE:  example Newton; shows an example
    270268"
    271 {
     269{ 
    272270 string s="ring @newton=("+string(q)+",a),(";
    273271 int i,j;
     
    281279    {
    282280      flag=0;
    283       break;
     281      break;     
    284282    }
    285283  }
     
    294292  s=s+"S("+string(defset[i])+"),";
    295293 }
    296  s=s+"S("+string(defset[1])+")),lp;";
    297 
     294 s=s+"S("+string(defset[1])+")),lp;"; 
     295 
    298296 execute(s);
    299 
    300  ideal newton;
     297 
     298 ideal newton; 
    301299 poly sum;
    302 
    303 
     300 
     301 
    304302 // generate generalized Newton identities
    305303 if (#)
     
    315313  }
    316314 } else
    317  {
     315 { 
    318316  for (i=1; i<=t; i++)
    319317  {
     
    334332  }
    335333  newton=newton,S(t+i)+sum;
    336  }
    337 
     334 } 
     335 
    338336 // field equations on sigma's
    339337 for (i=1; i<=t; i++)
     
    341339  newton=newton,sigma(i)^(q^m)-sigma(i);
    342340 }
    343 
     341 
    344342 // conjugacy relations
    345343 for (i=1; i<=n; i++)
     
    349347 newton=simplify(newton,2);
    350348 export newton;
    351  return(@newton);
    352 }
    353 example
     349 return(@newton);
     350} example
    354351{
    355352     "EXAMPLE:";  echo = 2;
    356353     // Newton identities for a binary 3-error-correcting cyclic code of length 31 with defining set (1,5,7)
    357 
     354     
    358355     int n=31; // length
    359356     list defset=1,5,7; //defining set
     
    361358     int q=2; // basefield size
    362359     int m=5; // degree extension of the splitting field
    363      int triangular=1; // indicator of triangular form of Newton identities
    364 
     360     int triangular=1; // indicator of triangular form of Newton identities       
     361     
    365362     def A=Newton(n,defset,t,q,m);
    366363     setring A;
    367364     A; // shows the ring we are working in
    368365     print(newton); // generalized Newton identities
    369 
     366     
    370367     //===============================
    371368     A=Newton(n,defset,t,q,m,triangular);
    372      setring A;
     369     setring A;     
    373370     print(newton); // generalized Newton identities in triangular form
    374371}
     
    395392   count++;
    396393  }
    397   if (flag)
     394  if (flag) 
    398395  {
    399396   for (j=2; j<=m; j++)
     
    401398    interm[i][j]=interm[i][j] div j;
    402399   }
    403    result[size(result)+1]=interm[i];
     400   result[size(result)+1]=interm[i]; 
    404401  }
    405402 }
     
    421418
    422419static proc Bin (int v, list Q, int n, int#)
    423 "USAGE:    Bin (v, Q, n, #);  v a number if errors, Q is a generating set of the code, n the length, # is additional parameter is
     420"USAGE:    Bin (v, Q, n, #);  v a number if errors, Q is a generating set of the code, n the length, # is additional parameter is 
    424421           set to 1, then the generating set is enlarged by odd elements, which are 2^(some power)*(some elment in the gen.set) mod n
    425422RETURN:    keeps a ring with the resulting system, which ideal is called 'bin'
     
    462459  Q_update=Q;
    463460 }
    464 
     461   
    465462 for (i=1; i<=size(Q_update); i++)
    466463 {
     
    475472   }
    476473   count1=0;
    477    for (j=2; j<=upper-1; j++)
     474   for (j=2; j<=upper-1; j++) 
    478475   {
    479476    count1=count1+exp_count(j,2);
     
    498495   sum_=sum_+coef_*mon;
    499496  }
    500   result=result,S(Q_update[i])-sum_;
     497  result=result,S(Q_update[i])-sum_; 
    501498 }
    502499 ideal bin=simplify(result,2);
    503500 export bin;
    504501 return(r);
    505 }
    506 example
     502} example
    507503{
    508504     "EXAMPLE:";  echo = 2;
     
    524520 if (ncols(x)!=nrows(g)) {print("ERRORenc2!");}
    525521 return(x*g);
    526 }
    527 example
     522} example
    528523{
    529524     "EXAMPLE:";  echo = 2;
     
    535530                    0,0,0,1,1,1,0;
    536531     //encode x with the generator matrix g
    537      print(enc(x,g));
     532     print(enc(x,g)); 
    538533}
    539534
     
    546541 if (nrows(c)>1) {print("ERRORsyndrome1!");}
    547542 if (ncols(c)!=ncols(h)) {print("ERRORsyndrome2!");}
    548  return(h*transpose(c));
    549 }
    550 example
     543 return(h*transpose(c)); 
     544} example
    551545{
    552546     "EXAMPLE:";  echo = 2;
     
    566560     print(syndrome(check,c));
    567561     c[1,3]=1;
    568      //now c is a codeword
     562     //now c is a codeword 
    569563     print(syndrome(check,c));
    570564}
     
    581575
    582576proc QE(matrix check, matrix y, int t, int fieldeq, int formal)
    583 "USAGE:   QE(check, y, t, fieldeq, formal); check is the check matrix of the code
    584           y is a received word, t the number of errors to be corrected,
    585           if fieldeq=1, then field equations are added; if formal=0, fields equations on (known) syndrome variables
     577"USAGE:   QE(check, y, t, fieldeq, formal); check is the check matrix of the code   
     578          y is a received word, t the number of errors to be corrected, 
     579          if fieldeq=1, then field equations are added; if formal=0, fields equations on (known) syndrome variables 
    586580          are not added, in order to add them (note that the exponent should be as a number of elements in the INITIAL alphabet) one
    587581          needs to set formal>0 for the exponent
     
    590584"
    591585{
    592  def br=basering;
     586 def br=basering; 
    593587 list rl=ringlist(br);
    594 
     588 
    595589 int red=nrows(check);
    596590 int n=ncols(check);
    597591 int q=rl[1][1];
    598 
     592 
    599593 if (formal==0)
    600  {
     594 { 
    601595  ring work=(q,a),(V(1..t),U(1..n)),dp;
    602596 } else
     
    604598  ring work=(q,a),(V(1..t),U(1..n),s(1..red)),(dp(t),lp(n),dp(red));
    605599 }
    606 
     600 
    607601 matrix check=imap(br,check);
    608602 matrix y=imap(br,y);
    609 
     603 
    610604 matrix h_full=MDSmat(n,a);
    611605 matrix h=submat(h_full,1..red,1..n);
    612606 if (nrows(y)!=1) {print("ERROR1Pell");}
    613607 if (ncols(y)!=n) {print("ERROR2Pell");}
    614 
     608 
    615609 ideal result;
    616 
     610 
    617611 list c;
    618612 list a;
     
    625619  c[i]=tmp;
    626620 }
    627 
     621 
    628622 int tim=rtimer;
    629623 matrix transf=inverse(transpose(h_full));
    630 
     624 
    631625 tim=rtimer;
    632626 for (i=1; i<=red ; i++)
     
    635629  a[i]=transf*a[i];
    636630 }
    637 
     631 
    638632 tim=rtimer;
    639  matrix te[n][1];
     633 matrix te[n][1]; 
    640634 for (i=1; i<=n; i++)
    641635 {
     
    643637  {
    644638   if ((j<i)&&(i<=t+1)) {c[i][j]=c[j][i];}
    645    else
     639   else 
    646640   {
    647     if (i+j<=n+1)
     641    if (i+j<=n+1) 
    648642    {
    649643     c[i][j]=te;
    650      c[i][j][i+j-1,1]=1;
     644     c[i][j][i+j-1,1]=1; 
    651645    }
    652646    else
     
    654648     c[i][j]=star(h_full,i,j);
    655649     c[i][j]=transf*c[i][j];
    656     }
     650    }   
    657651   }
    658652  }
    659653 }
    660 
    661 
    662  tim=rtimer;
     654 
     655 
     656 tim=rtimer; 
    663657 if (formal==0)
    664658 {
     
    699693     result=result,V(j)^q-V(j);
    700694  }
    701  }
     695 } 
    702696 for (i=1; i<=n; i++)
    703697 {
     
    718712  }
    719713  result=result,sum1-sum3;
    720  }
    721 
     714 } 
     715 
    722716 result=simplify(result,2);
    723 
     717 
    724718 ideal qe=result;
    725719 export qe;
    726720 return(work);
    727  //exportto(Top,h_full);
    728 }
    729 example
     721 //exportto(Top,h_full);   
     722} example
    730723{
    731724     "EXAMPLE:";  echo = 2;
     
    747740     option(redSB);
    748741     ideal sys_qe=std(qe);
    749      print(sys_qe);
     742     print(sys_qe);     
    750743}
    751744
     
    763756 }
    764757 return(result);
    765 }
    766 example
     758} example
    767759{
    768760     "EXAMPLE:";  echo = 2;
     
    776768     matrix y[1][7]=enc(x,g);
    777769     print(y);
    778 
     770     
    779771     //disturb with 2 errors
    780772     matrix rec[1][7]=error(y,list(2,4),list(1,a));
     
    806798   }
    807799   if (flag) {pos[i]=temp;break;}
    808   }
    809  }
    810 
     800  } 
     801 }
     802 
    811803 for (i=1; i<=num; i++)
    812804 {
    813805  flag=1;
    814806  while(flag)
    815   {
    816    tempnum=randomvector(1,e);
    817    if (tempnum!=0) {flag=0;}
    818   }
    819   val[i]=tempnum;
    820  }
    821 
     807  {   
     808   tempnum=randomvector(1,e);   
     809   if (tempnum!=0) {flag=0;}   
     810  }
     811  val[i]=tempnum; 
     812 }
     813 
    822814 for (i=1; i<=size(pos); i++)
    823815 {
     
    825817 }
    826818 return(result);
    827 }
    828 example
     819} example
    829820{
    830821  "EXAMPLE:";  echo = 2;
     
    837828     matrix x[1][3]=0,0,1,0;
    838829     matrix y[1][7]=enc(x,g);
    839 
     830     
    840831     //disturb with 2 random errors
    841832     matrix rec[1][7]=error_rand(y,2,3);
    842833     print(rec);
    843      print(rec-y);
     834     print(rec-y);     
    844835}
    845836
     
    857848 for (i=1; i<=m; i++)
    858849 {
    859   temp=randomvector(n-m,e,#);
     850  temp=randomvector(n-m,e,#); 
    860851  for (j=1; j<=n-m; j++)
    861852  {
    862853   rand[i,j]=temp[j,1];
    863   }
     854  } 
    864855 }
    865856 result=concat(rand,unitmat(m));
    866857 return(result);
    867 }
    868 example
    869 {
    870   "EXAMPLE:";  echo = 2;
     858} example
     859{
     860  "EXAMPLE:";  echo = 2;     
    871861     int redun=5; int n=15;
    872862     ring r=2,x,dp;
    873 
     863     
    874864     //generate random check matrix for a [15,5] binary code
    875865     matrix h=random_check(redun,n,1);
    876866     print(h);
    877 
     867     
    878868     //corresponding generator matrix
    879869     matrix g=dual_code(h);
    880      print(g);
     870     print(g);     
    881871}
    882872
     
    885875          An MDS matrix is constructed in the following way. We take a to be a generator of the multiplicative group of the field.
    886876          Then we construct the Vandermonde matrix with this a.
    887 ASSUME:   extension field should already be defined
     877ASSUME:   extension field should already be defined 
    888878RETURN:   a matrix with the MDS property
    889 EXAMPLE:  example random_check; shows an example
     879EXAMPLE:  example random_check; shows an example 
    890880"
    891881{
     
    897887  {
    898888   result[j+1,i+1]=(a^i)^j;
    899   }
     889  } 
    900890 }
    901891 return(result);
    902 }
    903 example
     892} example
    904893{
    905894     "EXAMPLE:";  echo = 2;
    906895     int q=16; int n=15;
    907896     ring r=(q,a),x,dp;
    908 
     897     
    909898     //generate an MDS (Vandermonde) matrix
    910899     matrix h_full=MDSmat(n,a);
    911      print(h_full);
     900     print(h_full);     
    912901}
    913902
     
    916905"USAGE:  mindist (check, q); check is a check matrix, q = field size
    917906RETURN:  minimum distance of the code together with the time needed for its calculation
    918 EXAMPLE: example mindist; shows an example
     907EXAMPLE: example mindist; shows an example 
    919908"
    920909{
    921910 int n=ncols(check); int redun=nrows(check); int t=redun+1;
    922 
    923  def br=basering;
    924  list rl=ringlist(br);
     911 
     912 def br=basering; 
     913 list rl=ringlist(br); 
    925914 int q=rl[1][1];
    926 
    927  ring work=(q,a),(V(1..t),U(1..n)),dp;
    928  matrix check=imap(br,check);
    929 
     915 
     916 ring work=(q,a),(V(1..t),U(1..n)),dp; 
     917 matrix check=imap(br,check); 
     918 
    930919 ideal temp;
    931920 int count=1;
     
    933922 int flag2;
    934923 int i, tim, timsolve;
    935  matrix z[1][n];
     924 matrix z[1][n]; 
    936925 option(redSB);
    937926 def A=QE(check,z,count,0,0);
     
    943932    tim=rtimer;
    944933    temp=std(temp);
    945     timsolve=timsolve+rtimer-tim;
     934    timsolve=timsolve+rtimer-tim; 
    946935    flag2=1;
    947936    setring work;
    948     temp=imap(A,temp);
     937    temp=imap(A,temp);   
    949938    for (i=1; i<=n; i++)
    950939    {
    951       if
    952         (temp[i]!=U(n-i+1))
     940      if 
     941        (temp[i]!=U(n-i+1)) 
    953942        {
    954943          flag2=0;
    955944        }
    956945    }
    957     if (!flag2)
     946    if (!flag2) 
    958947    {
    959948      flag=0;
    960949    }
    961     else
     950    else 
    962951    {
    963952      count++;
    964953    }
    965954 }
    966  list result=list(count,timsolve);
    967  return(result);
    968 }
    969 example
     955 list result=list(count,timsolve);
     956 return(result);
     957} example
    970958{
    971959     "EXAMPLE:";  echo = 2;
    972      //determine a minimum distance for a [7,3] binary code
    973      int q=8; int n=7; int redun=4; int t=redun+1;
    974      ring r=(q,a),x,dp;
    975 
     960     //determine a minimum distance for a [7,3] binary code 
     961     int q=8; int n=7; int redun=4; int t=redun+1; 
     962     ring r=(q,a),x,dp;     
     963               
    976964     //generate random check matrix
    977965     matrix h=random_check(redun,n,1);
    978966     print(h);
    979      list l=mindist(h);
    980      print(l[1]);
    981      //time for the comutation in secs
    982      print(l[2]);
     967     list l=mindist(h);     
     968     print(l[1]); 
     969     //time for the comutation in secs   
     970     print(l[2]);     
    983971}
    984972
     
    988976ASSUME:    Errors in rec should be correctable, otherwise the output is unpredictable
    989977RETURN:    a codeword that is closest to rec
    990 EXAMPLE:   example decode; shows an example
     978EXAMPLE:   example decode; shows an example 
    991979"
    992 {
     980{ 
    993981 def br=basering;
    994  int n=ncols(check);
    995 
    996  int count=1;
     982 int n=ncols(check); 
     983 
     984 int count=1; 
    997985 def A=QE(check,rec,count,0,0);
    998986 while(1)
    999987 {
    1000988  A=QE(check,rec,count,0,0);
    1001   setring A;
     989  setring A;     
    1002990  matrix h_full=MDSmat(n,a);
    1003991  matrix rec=imap(br,rec);
    1004992  option(redSB);
    1005   ideal qe_red=std(qe);
     993  ideal qe_red=std(qe);   
    1006994  if (qe_red[1]!=1)
    1007995  {
    1008996    break;
    1009997  }
    1010   else
     998  else 
    1011999  {
    10121000    count++;
     
    10141002  setring br;
    10151003 }
    1016 
    1017  setring A;
    1018 
     1004 
     1005 setring A; 
     1006     
    10191007 //obtain a codeword
    10201008 //this works only if our code is indeed can correct these errors
     
    10231011 {
    10241012  syn[i,1]=-qe_red[n-i+1]+lead(qe_red[n-i+1]);
    1025  }
    1026 
    1027  matrix real_syn=inverse(h_full)*syn;
     1013 }   
     1014 
     1015 matrix real_syn=inverse(h_full)*syn; 
    10281016 setring br;
    10291017 matrix real_syn=imap(A,real_syn);
    1030  return(rec-transpose(real_syn));
    1031 }
    1032 example
    1033 {
    1034      "EXAMPLE:";  echo = 2;
    1035      //correct 1 error in [15,7] binary code
     1018 return(rec-transpose(real_syn));     
     1019} example
     1020{
     1021     "EXAMPLE:";  echo = 2;     
     1022     //correct 1 error in [15,7] binary code
    10361023     int t=1; int q=16; int n=15; int redun=10;
    1037      ring r=(q,a),x,dp;
    1038 
     1024     ring r=(q,a),x,dp;     
     1025             
    10391026     //generate random check matrix
    1040      matrix h=random_check(redun,n,1);
     1027     matrix h=random_check(redun,n,1);     
    10411028     matrix g=dual_code(h);
    10421029     matrix x[1][n-redun]=0,0,1,0,1,0,1;
    10431030     matrix y[1][n]=enc(x,g);
    10441031     print(y);
    1045 
     1032     
    10461033     // find out the minimum distance of the code
    10471034     list l=mindist(h);
    1048 
     1035     
    10491036     //disturb with errors
    10501037     "Correct ",(l[1]-1) div 2," errors";
    10511038     matrix rec[1][n]=error_rand(y,(l[1]-1) div 2,1);
    1052      print(rec);
    1053 
     1039     print(rec);     
     1040     
    10541041     //let us decode
    10551042     matrix dec_word=decode(h,rec);
    1056      print(dec_word);
     1043     print(dec_word);     
    10571044}
    10581045
     
    10641051           if # is given it sets the correction capacity explicitly. It should be used in case one expexts some lower bound,
    10651052           otherwise the procedure tries to compute the real minimum distance to find out the error-correction capacity
    1066 RETURN:    nothing;
    1067 EXAMPLE:   example solve_for_random; shows an example
     1053RETURN:    nothing; 
     1054EXAMPLE:   example solve_for_random; shows an example 
    10681055"
    10691056{
     
    10761063 option(redSB);
    10771064 def br=basering;
    1078  matrix h_full=MDSmat(n,a);
     1065 matrix h_full=MDSmat(n,a); 
    10791066 matrix z[1][ncols(h_full)];
    10801067 int n=ncols(h_full);
     
    10941081     dist=tmp[1];
    10951082     printf("d= %p",dist);
    1096      t=(dist-1) div 2;
    1097   }
    1098   tim2=rtimer;
     1083     t=(dist-1) div 2; 
     1084  }     
     1085  tim2=rtimer; 
    10991086  tim3=rtimer;
    11001087  def A=QE(h,z,t,0,0);
     
    11031090  ideal sys2,sys3;
    11041091  matrix h=imap(br,h);
    1105   matrix g=dual_code(h);
     1092  matrix g=dual_code(h); 
    11061093  ideal sys=qe;
    11071094  print("The system is generated");
    1108   timdec3=timdec3+rtimer-tim3;
     1095  timdec3=timdec3+rtimer-tim3; 
    11091096  for (j=1; j<=ntrials; j++)
    11101097  {
    1111    word=randomvector(n-redun,1);
     1098   word=randomvector(n-redun,1);   
    11121099   y=enc(transpose(word),g);
    1113    rec=error_rand(y,t,1);
    1114    sys2=add_synd(rec,h,redun,sys);
    1115 
     1100   rec=error_rand(y,t,1);   
     1101   sys2=add_synd(rec,h,redun,sys); 
     1102 
    11161103   tim=rtimer;
    1117    sys3=std(sys2);
     1104   sys3=std(sys2);         
    11181105   sys3;
    1119    timdec=timdec+rtimer-tim;
    1120   }
    1121   timdec2=timdec2+rtimer-tim2;
    1122  }
     1106   timdec=timdec+rtimer-tim;   
     1107  } 
     1108  timdec2=timdec2+rtimer-tim2; 
     1109 } 
    11231110 printf("Time for mindist: %p", timdist);
    11241111 printf("Time for GB in mindist: %p", timdist);
    11251112 printf("Time for decoding: %p", timdec2);
    11261113 printf("Time for GB in decoding: %p", timdec);
    1127  printf("Time for QE in decoding: %p", timdec3);
    1128 }
    1129 example
     1114 printf("Time for QE in decoding: %p", timdec3);
     1115} example
    11301116{
    11311117     "EXAMPLE:";  echo = 2;
    11321118     int q=32; int n=25; int redun=n-11; int t=redun+1;
    11331119     ring r=(q,a),x,dp;
    1134 
     1120     
    11351121     // correct 2 errors in 5 random binary codes, 50 trials each
    1136      solve_for_random(n,redun,5,50,2);
     1122     solve_for_random(n,redun,5,50,2); 
    11371123}
    11381124
    11391125
    11401126proc solve_for_code(matrix check, int ntrials, int #)
    1141 "USAGE:     solve_for_code(check, ntrials);
     1127"USAGE:     solve_for_code(check, ntrials); 
    11421128            check is a check matrix for the code, ntrials = number of received vectors per code to be corrected
    11431129            if # is given it sets the correction cpacity explicitly. It should be used in case one expexts some lower bound
    11441130            otherwise the procedure tries to compute the real minimum distance to find out the error-correction capacity
    1145 RETURN:     nothing;
    1146 EXAMPLE:    example solve_for_code; shows an example
     1131RETURN:     nothing; 
     1132EXAMPLE:    example solve_for_code; shows an example 
    11471133"
    11481134{
     
    11571143 option(redSB);
    11581144 def br=basering;
    1159  matrix h_full=MDSmat(n,a);
     1145 matrix h_full=MDSmat(n,a); 
    11601146 matrix z[1][ncols(h_full)];
    11611147 int n=ncols(h_full);
     
    11731159   dist=tmp[1];
    11741160   printf("d= %p",dist);
    1175    t=(dist-1) div 2;
    1176  }
    1177  tim2=rtimer;
     1161   t=(dist-1) div 2; 
     1162 }     
     1163 tim2=rtimer; 
    11781164 tim3=rtimer;
    11791165 def A=QE(h,z,t,0,0);
     
    11821168 ideal sys2,sys3;
    11831169 matrix h=imap(br,h);
    1184  matrix g=dual_code(h);
     1170 matrix g=dual_code(h); 
    11851171 ideal sys=qe;
    11861172 print("The system is generated");
    1187  timdec3=timdec3+rtimer-tim3;
     1173 timdec3=timdec3+rtimer-tim3; 
    11881174 for (j=1; j<=ntrials; j++)
    11891175 {
    1190    word=randomvector(n-redun,1);
     1176   word=randomvector(n-redun,1);   
    11911177   y=enc(transpose(word),g);
    1192    rec=error_rand(y,t,1);
    1193    sys2=add_synd(rec,h,redun,sys);
    1194 
     1178   rec=error_rand(y,t,1);   
     1179   sys2=add_synd(rec,h,redun,sys); 
     1180   
    11951181   tim=rtimer;
    1196    sys3=std(sys2);
     1182   sys3=std(sys2);         
    11971183   sys3;
    1198    timdec=timdec+rtimer-tim;
    1199  }
    1200  timdec2=timdec2+rtimer-tim2;
    1201 
     1184   timdec=timdec+rtimer-tim;   
     1185 } 
     1186 timdec2=timdec2+rtimer-tim2; 
     1187 
    12021188 printf("Time for mindist: %p", timdist);
    12031189 printf("Time for GB in mindist: %p", timdist);
    12041190 printf("Time for decoding: %p", timdec2);
    12051191 printf("Time for GB in decoding: %p", timdec);
    1206  printf("Time for QE in decoding: %p", timdec3);
    1207 }
    1208 example
     1192 printf("Time for QE in decoding: %p", timdec3);
     1193} example
    12091194{
    12101195     "EXAMPLE:";  echo = 2;
     
    12121197     ring r=(q,a),x,dp;
    12131198     matrix check=random_check(redun,n,1);
    1214 
    1215      // correct 2 errors in using the code above, 50 trials
    1216      solve_for_code(check,50,2);
     1199     
     1200     // correct 2 errors in using the code above, 50 trials 
     1201     solve_for_code(check,50,2); 
    12171202}
    12181203
     
    12271212 return(result);
    12281213}
    1229 
     1214   
    12301215
    12311216static proc add_synd (matrix rec, matrix check, int redun, ideal sys)
     
    12341219     matrix s[redun][1]=syndrome(check,rec);
    12351220     for (int i=1; i<=redun; i++)
    1236 
    1237      {
    1238           result[i]=result[i]-s[i,1];
     1221     
     1222     {
     1223          result[i]=result[i]-s[i,1];         
    12391224     }
    12401225     return(result);
     
    12901275     for (int i=1; i<=size(G); i++)
    12911276     {
    1292           if (m/leadmonom(G[i])!=0) {return(1);}
     1277          if (m/leadmonom(G[i])!=0) {return(1);}         
    12931278     }
    12941279     return(0);
     
    12981283"USAGE:  vanish_id (points,e); points is a list of point that define, where polynomials from the vanishing ideal will vanish,
    12991284RETURN:  Vanishing ideal corresponding to the given set of points
    1300 EXAMPLE: example vanish_id; shows an example
     1285EXAMPLE: example vanish_id; shows an example 
    13011286"
    13021287{
    13031288     int m=size(points[1]);
    13041289     int n=size(points);
    1305 
     1290     
    13061291     ideal G=1;
    13071292     int i,k,j;
     
    13091294     poly h,cur;
    13101295     for (k=1; k<=n; k++)
    1311      {
     1296     {         
    13121297          i=find_index(G,points[k]);
    1313           cur=G[i];
     1298          cur=G[i];         
    13141299          for(j=i+1; j<=size(G); j++)
    13151300          {
     
    13191304          temp=ideal2list(G);
    13201305          temp=delete(temp,i);
    1321           G=list2ideal(temp);
     1306          G=list2ideal(temp);         
    13221307          for (j=1; j<=m; j++)
    13231308          {
     
    13251310               {
    13261311                    attrib(G,"isSB",1);
    1327                     h=NF((x(j)-points[k][j,1])*cur,G);
     1312                    h=NF((x(j)-points[k][j,1])*cur,G);                   
    13281313                    temp=ideal2list(G);
    13291314                    temp=insert(temp,h);
    13301315                    G=list2ideal(temp);
    1331                     G=sort(G)[1];
     1316                    G=sort(G)[1];     
    13321317               }
    13331318          }
     
    13351320     attrib(G,"isSB",1);
    13361321     return(G);
    1337 }
    1338 example
     1322} example
    13391323{
    13401324     "EXAMPLE:";  echo = 2;
    13411325      ring r=3,(x(1..3)),dp;
    1342 
     1326     
    13431327     //generate all 3-vectors over GF(3)
    13441328     list points=points_gen(3,1);
    1345 
     1329     
    13461330     list points2=conv_points(points);
    1347 
     1331     
    13481332     //grasps the first 11 points
    13491333     list p=grasp_list(points2,1,11);
    13501334     print(p);
    1351 
     1335     
    13521336     //construct the vanishing ideal
    13531337     ideal id=vanish_id(p);
     
    13751359          count++;
    13761360          for (j=1; j<=charac^(e)-1; j++)
    1377           {
     1361          {               
    13781362               result[count][m]=a^j;
    13791363               count++;
     
    13811365          return(result);
    13821366     }
    1383      list prev=points_gen(m-1,e);
     1367     list prev=points_gen(m-1,e);     
    13841368     for (i=1; i<=size(prev); i++)
    13851369     {
     
    13961380     return(result);
    13971381     }
    1398 
     1382     
    13991383     if (e==1)
    14001384     {
     
    14031387     int i,j;
    14041388     list l=ringlist(basering);
    1405      int charac=l[1][1];
     1389     int charac=l[1][1];     
    14061390     list tmp;
    14071391     for (i=1; i<=charac^m; i++)
     
    14121396     {
    14131397          for (j=0; j<=charac-1; j++)
    1414           {
     1398          {               
    14151399               result[count][m]=number(j);
    14161400               count++;
     
    14181402          return(result);
    14191403     }
    1420      list prev=points_gen(m-1,e);
     1404     list prev=points_gen(m-1,e);     
    14211405     for (i=1; i<=size(prev); i++)
    14221406     {
     
    14301414     return(result);
    14311415     }
    1432 
     1416     
    14331417}
    14341418
     
    14671451{
    14681452     poly prod=1;
    1469      list rl=ringlist(basering);
     1453     list rl=ringlist(basering);     
    14701454     int charac=rl[1][1];
    14711455     int l;
     
    15091493"
    15101494{
    1511      list rl=ringlist(basering);
    1512      int charac=rl[1][1];
     1495     list rl=ringlist(basering);       
     1496     int charac=rl[1][1];     
    15131497     int n=ncols(check);
    1514      int m=nrows(check);
     1498     int m=nrows(check);         
    15151499     list points=points_gen(s,e);
    15161500     list points2=conv_points(points);
    1517      list p=grasp_list(points2,1,n);
    1518      ideal id=vanish_id(p,e);
    1519      ideal funcs=gener_funcs(check,p,e,id,s);
    1520 
     1501     list p=grasp_list(points2,1,n);     
     1502     ideal id=vanish_id(p,e);     
     1503     ideal funcs=gener_funcs(check,p,e,id,s);         
     1504     
    15211505     ideal result;
    15221506     poly temp;
    15231507     int i,j,k;
    1524 
    1525      //vanishing realtions
     1508     
     1509     //vanishing realtions     
    15261510     for (i=1; i<=t; i++)
    1527      {
     1511     {         
    15281512          for (j=1; j<=size(id); j++)
    15291513          {
    1530                temp=id[j];
     1514               temp=id[j];               
    15311515               for (k=1; k<=s; k++)
    15321516               {
    15331517                    temp=subst(temp,x(k),x_var(i,k,s));
    1534                }
     1518               }               
    15351519               result=result,temp;
    15361520          }
    1537      }
    1538 
     1521     }         
     1522     
    15391523     //field equations
    15401524     for (i=1; i<=t; i++)
     
    15491533          result=result,e(i)^(charac^e-1)-1;
    15501534     }
    1551 
     1535     
    15521536     result=simplify(result,8);
    1553 
     1537     
    15541538     //check realtions
    15551539     poly sum;
    1556      matrix syn[m][1]=syndrome(check,y);
     1540     matrix syn[m][1]=syndrome(check,y);         
    15571541     for (i=1; i<=size(funcs); i++)
    1558      {
     1542     {         
    15591543          sum=0;
    15601544          for (j=1; j<=t; j++)
     
    15651549                    temp=subst(temp,x(k),x_var(j,k,s));
    15661550               }
    1567                sum=sum+temp*e(j);
     1551               sum=sum+temp*e(j);         
    15681552          }
    15691553          result=result,sum-syn[i,1];
    15701554     }
    1571 
     1555     
    15721556     result=simplify(result,2);
    1573 
     1557     
    15741558     points=points2;
    1575      export points;
     1559     export points;     
    15761560     return(result);
    1577 }
    1578 example
     1561} example
    15791562{
    15801563     "EXAMPLE:";  echo = 2;
    1581 
     1564     
    15821565     list l=FLpreprocess(3,1,11,2,"");
    15831566     def r=l[1];
    15841567     setring r;
    1585      int s_work=l[2];
    1586 
     1568     int s_work=l[2];     
     1569     
    15871570     //the check matrix of [11,6,5] ternary code
    15881571     matrix h[5][11]=1,0,0,0,0,1,1,1,-1,-1,0,
     
    15971580     matrix rec[1][11]=error(y,list(2,4),list(1,-1));
    15981581
    1599      //the Fitzgerald-Lax system
     1582     //the Fitzgerald-Lax system     
    16001583     ideal sys=FLsystem(h,rec,2,1,s_work);
    16011584     print(sys);
     
    16051588     // the points are (0,0,1) and (0,1,0) with error values 1 and -1 resp.
    16061589     // use list points to find error positions;
    1607      points;
     1590     points;     
    16081591}
    16091592
     
    16151598     {
    16161599          s++;
    1617      }
     1600     }     
    16181601     list var_ord;
    16191602     int i,j;
     
    16331616               count++;
    16341617          }
    1635      }
    1636 
     1618     }     
     1619     
    16371620     list rl;
    16381621     list tmp;
    1639 
     1622     
    16401623     if (e>1)
    16411624     {
     
    16531636          rl[1]=p;
    16541637     }
    1655 
     1638     
    16561639     rl[2]=var_ord;
    1657 
     1640     
    16581641     rl[3]=tmp;
    1659      rl[3][1]=tmp;
     1642     rl[3][1]=tmp;     
    16601643     //rl[3][1][1]=string("dp("+string((t-1)*(s+1)+s)+"),lp("+string(s+1)+")");
    16611644     rl[3][1][1]=string("lp");
     
    16651648          v=v,1;
    16661649     }
    1667      rl[3][1][2]=v;
     1650     rl[3][1][2]=v; 
    16681651     rl[3][2]=tmp;
    1669      rl[3][2][1]=string("C");
     1652     rl[3][2][1]=string("C");   
    16701653     rl[3][2][2]=intvec(0);
    1671 
    1672      rl[4]=ideal(0);
    1673 
     1654     
     1655     rl[4]=ideal(0);     
     1656     
    16741657     def r2=ring(rl);
    16751658     setring r2;
    1676      list l=ringlist(r2);
     1659     list l=ringlist(r2);     
    16771660     if (e>1)
    16781661     {
    1679           execute(string("poly f="+minp));
    1680           ideal id=f;
     1662          execute(string("poly f="+minp));     
     1663          ideal id=f;     
    16811664          l[1][4]=id;
    16821665     }
    1683 
     1666     
    16841667     def r=ring(l);
    1685      setring r;
    1686 
     1668     setring r;     
     1669     
    16871670     return(list(r,s));
    16881671}
    16891672
    16901673static proc x_var (int i, int j, int s)
    1691 {
     1674{     
    16921675     return(x1(s*(i-1)+j));
    16931676}
    16941677
    16951678static proc randomvector(int n, int e, int #)
    1696 {
     1679{     
    16971680    int i;
    16981681    matrix result[n][1];
     
    17011684        result[i,1]=asElement(random_prime_vector(e,#));
    17021685    }
    1703     return(result);
     1686    return(result);       
    17041687}
    17051688
     
    17091692  int i;
    17101693  number w=1;
    1711   if (size(l)>1) {w=par(1);}
     1694  if (size(l)>1) {w=par(1);} 
    17121695  for (i=0; i<=size(l)-1; i++)
    17131696  {
     
    17211704  if (#==1)
    17221705  {
    1723      list rl=ringlist(basering);
     1706     list rl=ringlist(basering);     
    17241707     int charac=rl[1][1];
    17251708  } else {
     
    17361719
    17371720proc FL_solve_for_random(int n, int redun, int p, int e, int t, int ncodes, int ntrials, string minpol)
    1738 "USAGE:    FL_solve_for_random(redun,p,e,n,t,ncodes,ntrials,minpol); n = length of codes generated, redun = redundancy of codes generated,
    1739            p = characteristics, e is the extension degree,
     1721"USAGE:    FL_solve_for_random(redun,p,e,n,t,ncodes,ntrials,minpol); n = length of codes generated, redun = redundancy of codes generated, 
     1722           p = characteristics, e is the extension degree, 
    17401723           q = number of errors to correct, ncodes = number of random codes to be processed
    17411724           ntrials = number of received vectors per code to be corrected
     
    17441727EXAMPLE:   example FLsystem; shows an example
    17451728{
    1746  list l=FLpreprocess(p,e,n,t,minpol);
    1747 
     1729 list l=FLpreprocess(p,e,n,t,minpol); 
     1730 
    17481731 def r=l[1];
    1749  int s_work=l[2];
     1732 int s_work=l[2]; 
    17501733 export(s_work);
    17511734 setring r;
    1752 
     1735 
    17531736 int i,j;
    17541737 matrix h, g, word, y, rec;
     
    17561739 int dist, tim, tim2, tim3, timdist, timdec, timdist2, timdec2, timdec3;
    17571740 ideal sys, sys2, sys3;
    1758  list tmp;
    1759 
    1760  option(redSB);
    1761  matrix z[1][n];
    1762 
     1741 list tmp; 
     1742
     1743 option(redSB); 
     1744 matrix z[1][n]; 
     1745 
    17631746 for (i=1; i<=ncodes; i++)
    17641747 {
    1765      h=random_check(redun,n,e,1);
     1748     h=random_check(redun,n,e,1);           
    17661749     g=dual_code(h);
    1767      tim2=rtimer;
    1768      tim3=rtimer;
    1769      sys=FLsystem(h,z,t,e,s_work);
     1750     tim2=rtimer;       
     1751     tim3=rtimer;               
     1752     sys=FLsystem(h,z,t,e,s_work);     
    17701753     timdec3=timdec3+rtimer-tim3;
    1771 
     1754   
    17721755     for (j=1; j<=ntrials; j++)
    17731756     {
     
    17751758          y=enc(transpose(word),g);
    17761759          rec=error_rand(y,t,e);
    1777           sys2=LF_add_synd(rec,h,sys);
     1760          sys2=LF_add_synd(rec,h,sys);   
    17781761          tim=rtimer;
    17791762          sys3=std(sys2);
    17801763          timdec=timdec+rtimer-tim;
    1781      }
     1764     }           
    17821765     timdec2=timdec2+rtimer-tim2;
    1783  }
    1784 
     1766 } 
     1767 
    17851768 printf("Time for decoding: %p", timdec2);
    17861769 printf("Time for GB in decoding: %p", timdec);
    1787  printf("Time for generating Fitzgerald-Lax system during decoding: %p", timdec3);
    1788 }
    1789 example
     1770 printf("Time for generating Fitzgerald-Lax system during decoding: %p", timdec3);
     1771} example
    17901772{
    17911773     "EXAMPLE:";  echo = 2;
    1792 
     1774     
    17931775     // decoding for one random binary code of length 25, redundancy 14; 300 words are processed
    17941776     FL_solve_for_random(25,14,2,1,1,1,300,"");
     
    18061788     return(result);
    18071789}
     1790
     1791
     1792/*
     1793//////////////     SOME HARD EXAMPLES    //////////////////////
     1794//////      THAT MAYBE WILL BE DOABLE LATER     ///////////////
     1795
     17961.) These random instances are not doable in <=1000 sec.
     1797
     1798"EXAMPLE:";  echo = 2;
     1799int q=128; int n=120; int redun=n-40;
     1800ring r=(q,a),x,dp;
     1801solve_for_random(n,redun,1,1,6);
     1802
     1803redun=n-30;
     1804solve_for_random(n,redun,1,1,8);
     1805
     1806redun=n-20;
     1807solve_for_random(n,redun,1,1,12);
     1808
     1809redun=n-10;
     1810solve_for_random(n,redun,1,1,24);
     1811
     1812int q=256; int n=150; int redun=n-10;
     1813ring r=(q,a),x,dp;
     1814solve_for_random(n,redun,1,1,26);
     1815
     1816
     18172.) Generic decoding is hard!
     1818
     1819int q=32; int n=31; int redun=n-16; int t=3;
     1820ring r=(q,a),(V(1..n),U(n..1),s(redun..1)),(dp(n),lp(n),dp(redun));
     1821matrix check[redun][n]= 1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,
     18220,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,1,
     18230,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
     18240,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,
     18250,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,
     18260,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
     18270,0,0,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,
     18280,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,
     18290,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,
     18300,0,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,
     18310,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
     18321,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,
     18330,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,0,0,
     18341,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
     18351,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,
     18360,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,1,0,1,
     18370,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     18380,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,
     18390,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,1,
     18400,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
     18410,0,0,1,1,0,1,1,0,0,0,1,0,1,0,0,1,0,0,1,0,
     18420,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,
     18430,1,0,1,0,0,1,0,0,1;
     1844matrix rec[1][n];
     1845
     1846def A=QE(check,rec,t,1,2);
     1847setring A;
     1848print(qe);
     1849ideal red_qe=stdfglm(qe);
     1850
     1851*/
Note: See TracChangeset for help on using the changeset viewer.