Index: Singular/LIB/decodegb.lib
===================================================================
--- Singular/LIB/decodegb.lib	(revision 1e8b8ea84b28157e5a3a88c6f332aed799c46a84)
+++ Singular/LIB/decodegb.lib	(revision c51e4a10429f5e0dc652e64d47621b06986328ad)
@@ -1,4 +1,4 @@
 ///////////////////////////////////////////////////////////////////////////////
-version="$Id: decodegb.lib,v 1.1 2008-08-13 15:44:20 bulygin Exp $";
+version="$Id: decodegb.lib,v 1.2 2008-08-21 14:06:56 bulygin Exp $";
 category="Coding theory";
 info="
@@ -7,9 +7,9 @@
 
 OVERVIEW:
- In this library we generate several systems used for decoding cyclic codes. And finding the minimum distance
+ In this library we generate several systems used for decoding cyclic codes and finding their minimum distance.
  Namely, we work with the Cooper's philosophy and generalized Newton identities.
  The original method of quadratic equations is worked out here as well. 
  We also (for comparison) enable to work with the system of Fitzgerald-Lax.
- We provide also some auxiliary functions for further manipulations and decoding.
+ We provide some auxiliary functions for further manipulations and decoding.
  For an overview of the methods mentioned above, cf. Stanislav Bulygin, Ruud Pellikaan: 'Decoding and finding the minimum distance with 
  Groebner bases: history and new insights', in 'Selected Topics in Information and Coding Theory', World Scientific (2008) (to appear) (*).
@@ -19,7 +19,7 @@
  sysCRHTMindistBinary(n,defset,w); generates the ideal from Cooper's philosophy to find the minimum distance in the binary case
  sysNewton(n,defset,t,q,m,#); generates the ideal with the Generalized Newton identities
- sysBin(v,Q,n,#);  generates Bin system as in the work of Augot et.al, cf. [*] for a reference
- encode(x,g);  encodes given message with a given generator matrix
- syndrome(h, c);  computes a syndroem w.r.t. a given check matrix
+ sysBin(v,Q,n,#);  generates Bin system as in the work of Augot et.al, cf. [*] for the reference
+ encode(x,g);  encodes given message with the given generator matrix
+ syndrome(h, c);  computes a syndrome w.r.t. the given check matrix
  sysQE(check,y,t,fieldeq,formal); generates the system of quadratic equations as in the method of Pellikaan and Bulygin
  error(y,pos,val);  inserts errors in a word
@@ -27,11 +27,11 @@
  randomCheck(m,n,e);  generates a random check matrix
  genMDSMat(n,a);  generates an MDS (actually an RS) matrix
- mindist(check);   computes the minimum distance of the code via solving systems of quadratic equations
- decode(rec);  decoding of a word using the systems of quadratic equations 
+ mindist(check);   computes the minimum distance of the code via solving the system of quadratic equations
+ decode(rec);  decoding of a word using the system of quadratic equations 
  solveForRandom(redun,ncodes,ntrials,#);  a procedure for manipulation with random codes
- solveForCode(check,ntrials,#); a procedure for manipulation with a given codes
+ solveForCode(check,ntrials,#); a procedure for manipulation with the given codes
  vanishId(points); computes the vanishing ideal for the given set of points. The algorithm of Farr and Gao is implemented
  sysFL(check,y,t,e,s); generates the Fitzgerald-Lax system
- FLSolveForRandom(n,redun,p,e,t,ncodes,ntrials,minpol); a procedure for manipulation with random codes via Fitzgerald-Lax
+ solveForRandomFL(n,redun,p,e,t,ncodes,ntrials,minpol); a procedure for manipulation with random codes via Fitzgerald-Lax
  
 
@@ -105,5 +105,5 @@
           e the error-correcting capacity, m degree extension of the splitting field, if #>0 additional equations
           representing the fact that every two error positions are either different or at least one of them is zero
-RETURN:   a ring to work with the CRHT-ideal (with Sala's additions), the ideal itself is exported with the name 'crht'
+RETURN:   the ring to work with the CRHT-ideal (with Sala's additions), the ideal itself is exported with the name 'crht'
 EXAMPLE:  example sysCRHT; shows an example
 "
@@ -193,5 +193,5 @@
 "USAGE:  sysCRHTMindistBinary(n,defset,w);  n length of the cyclic code, defset is a list representing the defining set,
          w is a candidate for the minimum distance
-RETURN:  a ring to work with the Sala's ideal for mindist, the ideal itself is exported with the name 'crht_md'
+RETURN:  the ring to work with the Sala's ideal for the minimum distance, the ideal itself is exported with the name 'crht_md'
 EXAMPLE: example sysCRHTMindistBinary; shows an example
 "
@@ -262,5 +262,5 @@
           t is the number of errors, q is basefield size, m is degree extension of the splitting field
           if triangular>0 it indicates that Newton identities in triangular form should be constructed
-RETURN:   a ring to work with the generalized Newton identities (in triangular form if applicable), 
+RETURN:   the ring to work with the generalized Newton identities (in triangular form if applicable), 
           the ideal itself is exported with the name 'newton'
 EXAMPLE:  example sysNewton; shows an example
@@ -417,7 +417,7 @@
 
 proc sysBin (int v, list Q, int n, int#)
-"USAGE:    sysBin (v, Q, n, #);  v a number if errors, Q is a generating set of the code, n the length, # is additional parameter is 
+"USAGE:    sysBin (v, Q, n, #);  v a number if errors, Q is a generating set of the code, n the length, # is an additional parameter: if  
            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
-RETURN:    keeps a ring with the resulting system, which ideal is called 'bin'
+RETURN:    keeps the ring with the resulting system, which ideal is called 'bin'
 EXAMPLE:   example sysBin; shows an example
 "
@@ -576,5 +576,5 @@
 "USAGE:   sysQE(check, y, t, fieldeq, formal); check is the check matrix of the code   
           y is a received word, t the number of errors to be corrected, 
-          if fieldeq=1, then field equations are added; if formal=0, fields equations on (known) syndrome variables 
+          if fieldeq=1, then field equations are added; if formal=0, field equations on (known) syndrome variables 
           are not added, in order to add them (note that the exponent should be as a number of elements in the INITIAL alphabet) one
           needs to set formal>0 for the exponent
@@ -776,5 +776,5 @@
 proc errorRand(matrix y, int num, int e)
 "USAGE:    errorRand(y, num, e); y is a (code) word, num is the number of errors, e is an extension degree (if one wants values to
-           be from GF(p^e)
+           be from GF(p^e))
 RETURN:    corresponding received word
 EXAMPLE:   example errorRand; shows an example
@@ -836,5 +836,5 @@
 proc randomCheck(int m, int n, int e, int #)
 "USAGE:    randomCheck(m, n, e); m x n are dimensions of the matrix, e is an extension degree (if one wants values to
-           be from GF(p^e)
+           be from GF(p^e))
 RETURN:    random check matrix
 EXAMPLE:   example randomCheck; shows an example
@@ -871,5 +871,5 @@
 
 proc genMDSMat(int n, number a)
-"USAGE:   genMDSMat(n, a); n x n are dimensions of the matrix, a is a primitive element of the field
+"USAGE:   genMDSMat(n, a); n x n are dimensions of the matrix, a is a primitive element of the field.
           An MDS matrix is constructed in the following way. We take a to be a generator of the multiplicative group of the field.
           Then we construct the Vandermonde matrix with this a.
@@ -1046,7 +1046,7 @@
 proc solveForRandom(int n, int redun, int ncodes, int ntrials, int #)
 "USAGE:    solveForRandom(redun, q, ncodes, ntrials); redun is a redundabcy of a (random) code,
-           q = field size, ncodes = number of random codes to be processed
-           ntrials = number of received vectors per code to be corrected
-           if # is given it sets the correction capacity explicitly. It should be used in case one expexts some lower bound,
+           q = field size, ncodes = number of random codes to be processed,
+           ntrials = number of received vectors per code to be corrected.
+           If # is given it sets the correction capacity explicitly. It should be used in case one expexts some lower bound,
            otherwise the procedure tries to compute the real minimum distance to find out the error-correction capacity
 RETURN:    nothing; 
@@ -1101,9 +1101,9 @@
   
    tim=rtimer;
-   sys3=std(sys2);          
-   sys3;
+   sys3=std(sys2);   
    timdec=timdec+rtimer-tim;   
   } 
-  timdec2=timdec2+rtimer-tim2;  
+  timdec2=timdec2+rtimer-tim2;
+  kill A;
  } 
  printf("Time for mindist: %p", timdist);
@@ -1125,6 +1125,6 @@
 proc solveForCode(matrix check, int ntrials, int #)
 "USAGE:     solveForCode(check, ntrials); 
-            check is a check matrix for the code, ntrials = number of received vectors per code to be corrected
-            if # is given it sets the correction cpacity explicitly. It should be used in case one expexts some lower bound
+            check is a check matrix for the code, ntrials = number of received vectors per code to be corrected.
+            If # is given it sets the correction capacity explicitly. It should be used in case one expects some lower bound,
             otherwise the procedure tries to compute the real minimum distance to find out the error-correction capacity
 RETURN:     nothing;  
@@ -1179,6 +1179,5 @@
    
    tim=rtimer;
-   sys3=std(sys2);          
-   sys3;
+   sys3=std(sys2);   
    timdec=timdec+rtimer-tim;   
  } 
@@ -1280,5 +1279,5 @@
 
 proc vanishId (list points)
-"USAGE:  vanishId (points,e); points is a list of point that define, where polynomials from the vanishing ideal will vanish,
+"USAGE:  vanishId (points,e); points is a list of points, for which the vanishing ideal is to be constructed.
 RETURN:  Vanishing ideal corresponding to the given set of points
 EXAMPLE: example vanishId; shows an example 
@@ -1717,12 +1716,12 @@
 }
 
-proc FLSolveForRandom(int n, int redun, int p, int e, int t, int ncodes, int ntrials, string minpol)
-"USAGE:    FLSolveForRandom(redun,p,e,n,t,ncodes,ntrials,minpol); n = length of codes generated, redun = redundancy of codes generated, 
+proc solveForRandomFL(int n, int redun, int p, int e, int t, int ncodes, int ntrials, string minpol)
+"USAGE:    solveForRandomFL(redun,p,e,n,t,ncodes,ntrials,minpol); n = length of codes generated, redun = redundancy of codes generated, 
            p = characteristics, e is the extension degree, 
-           q = number of errors to correct, ncodes = number of random codes to be processed
+           t = number of errors to correct, ncodes = number of random codes to be processed
            ntrials = number of received vectors per code to be corrected
            due to some pecularities of SINGULAR one needs to provide minimal polynomial for the extension explicitly
 RETURN:    nothing
-EXAMPLE:   example FLSolveForRandom; shows an example
+EXAMPLE:   example solveForRandomFL; shows an example
 {
  list l=FLpreprocess(p,e,n,t,minpol); 
@@ -1772,6 +1771,6 @@
      "EXAMPLE:";  echo = 2;
      
-     // decoding for one random binary code of length 25, redundancy 14; 300 words are processed
-     FLSolveForRandom(25,14,2,1,1,1,300,"");
+     // correcting one error for one random binary code of length 25, redundancy 14; 300 words are processed
+     solveForRandomFL(25,14,2,1,1,1,300,"");
 }
 
