Changeset 3754ca in git


Ignore:
Timestamp:
Apr 15, 2009, 1:28:08 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
a6606e6cba9689ecbcc4e27ac00fb8c1deabd128
Parents:
40c648539a84cb2dc36e46b6b6c84deeb21e393b
Message:
minor textual changes prior to 3-1-0


git-svn-id: file:///usr/local/Singular/svn/trunk@11714 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
51 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ainvar.lib

    r40c648 r3754ca  
    1 // $Id: ainvar.lib,v 1.9 2008-10-01 15:29:23 Singular Exp $
     1// $Id: ainvar.lib,v 1.10 2009-04-15 11:05:22 seelisch Exp $
    22/////////////////////////////////////////////////////////////////////////////
    3 version="$Id: ainvar.lib,v 1.9 2008-10-01 15:29:23 Singular Exp $";
     3version="$Id: ainvar.lib,v 1.10 2009-04-15 11:05:22 seelisch Exp $";
    44category="Invariant theory";
    55info="
     
    190190     {
    191191  // the ring L[2] = char(bsr),(x(1..nvars(bsr)),y(1..z)),(dp(n),dp(m)),
    192   // contains poly check s.t. LT(p) is of the form check(LT(f1),...,LT(fr))
     192  // contains polynomial check s.t. LT(p) is of the form check(LT(f1),...,LT(fr))
    193193       def s1 = L[2];
    194194       map psi = s1,maxideal(1),dom;
     
    230230
    231231  //---------  test wether @(0)-h(@(1),...,@(z)) is in ker ---------------
    232   // for some poly h and divide by maximal power of q=#[1]
     232  // for some polynomial h and divide by maximal power of q=#[1]
    233233     poly h;
    234234     z=size(kern);
  • Singular/LIB/aksaka.lib

    r40c648 r3754ca  
    11//CM, last modified 10.12.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: aksaka.lib,v 1.4 2009-04-06 12:39:02 seelisch Exp $";
     3version="$Id: aksaka.lib,v 1.5 2009-04-15 11:05:47 seelisch Exp $";
    44category="Teaching";
    55info="
     
    1818wurzel(r)                  square root of number r
    1919euler(r)                   phi-function of euler
    20 coeffmod(f,n)              poly f modulo number n (coefficients mod n)
    21 powerpolyX(q,n,a,r)        (poly a)^q modulo (poly r,number n)
     20coeffmod(f,n)              polynomial f modulo number n (coefficients mod n)
     21powerpolyX(q,n,a,r)        (polynomial a)^q modulo (poly r,number n)
    2222ask(n)                     ASK-Algorithm; deterministic Primality test
    2323";
     
    7171ASSUME: poly f depends on at most var(1) of the basering
    7272RETURN: poly f modulo number n
    73 NOTE:   at first the coefficients of the monomials of the poly f are
     73NOTE:   at first the coefficients of the monomials of the polynomial f are
    7474        determined, then their remainder modulo n is calculated,
    75         after that the poly 'is put together' again
     75        after that the polynomial 'is put together' again
    7676EXAMPLE:example coeffmod; shows an example
    7777"
     
    8787                   // umwandeln der Koeffizienten in numbers,
    8888                   // Berechnung der Reste dieser numbers modulo n,
    89                    // poly mit neuen Koeffizienten wieder zusammensetzen
     89                   // Polynom mit neuen Koeffizienten wieder zusammensetzen
    9090    i++;
    9191  }
  • Singular/LIB/alexpoly.lib

    r40c648 r3754ca  
    1 version="$Id: alexpoly.lib,v 1.17 2008-12-12 17:22:35 Singular Exp $";
     1version="$Id: alexpoly.lib,v 1.18 2009-04-15 11:06:40 seelisch Exp $";
    22category="Singularities";
    33info="
     
    198198  }
    199199  ///////////////////////////////////////////////////////////////////////////////////////////////////
    200   // If the input was a poly or a HN-Expansion, then calculate the contact matrix and char.exponents.
     200  // If the input was a polynomial or a HN-Expansion, then calculate the contact matrix and char.exponents.
    201201  ///////////////////////////////////////////////////////////////////////////////////////////////////
    202202  if (defined(I@N@V))
  • Singular/LIB/algebra.lib

    r40c648 r3754ca  
    33//new proc  nonZeroEntry(id), used to fix a bug in proc finitenessTest
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: algebra.lib,v 1.22 2009-04-14 12:00:13 Singular Exp $";
     5version="$Id: algebra.lib,v 1.23 2009-04-15 11:07:30 seelisch Exp $";
    66category="Commutative Algebra";
    77info="
     
    1414 algebra_containment(); query of algebra containment
    1515 module_containment();  query of module containment over a subalgebra
    16  inSubring(p,I);        test whether poly p is in subring generated by I
     16 inSubring(p,I);        test whether polynomial p is in subring generated by I
    1717 algDependent(I);       computes algebraic relations between generators of I
    1818 alg_kernel(phi);       computes the kernel of the ringmap phi
     
    5151           x = x(1),...,x(n) denote the variables of the basering
    5252@end format
    53 DISPLAY: if k=0 and printlevel >= voice+1 (default) display the poly check
     53DISPLAY: if k=0 and printlevel >= voice+1 (default) display the polynomial check
    5454NOTE:    The proc inSubring uses a different algorithm which is sometimes
    5555         faster.
     
    113113      dbprint(printlevel-voice+3,"
    114114// 'algebra_containment' created a ring as 2nd element of the list.
    115 // The ring contains the poly check which defines the algebraic relation.
     115// The ring contains the polynomial check which defines the algebraic relation.
    116116// To access to the ring and see check you must give the ring a name,
    117117// e.g.:
     
    211211      dbprint(printlevel-voice+3,"
    212212// 'module_containment' created a ring as 2nd element of the list. The
    213 // ring contains the poly check which defines the algebraic relation
     213// ring contains the polynomial check which defines the algebraic relation
    214214// for p. To access to the ring and see check you must give the ring
    215215// a name, e.g.:
     
    246246@format
    247247         a list l of size 2, l[1] integer, l[2] string
    248          l[1]=1 iff p is in the subring generated by i=i[1],...,i[k],
     248         l[1]=1 if and only if p is in the subring generated by i=i[1],...,i[k],
    249249                and then l[2] = y(0)-h(y(1),...,y(k)) if p = h(i[1],...,i[k])
    250          l[1]=0 iff p is in not the subring generated by i,
     250         l[1]=0 if and only if p is in not the subring generated by i,
    251251                and then l[2] = h(y(0),y(1),...,y(k)) where p satisfies the
    252252                nonlinear relation h(p,i[1],...,i[k])=0.
     
    254254NOTE:    the proc algebra_containment tests the same using a different
    255255         algorithm, which is often faster
    256          if l[1] == 0 then l[2] may contain more than one relation h(y(0),y(1),...,y(k)),
     256         if l[1] == 0 then l[2] may contain more than one relation h(y(0),y(1),...,y(k)), 
    257257         separated by comma
    258258EXAMPLE: example inSubring; shows an example
     
    620620"USAGE:   is_surjective(phi); phi map to basering, or ideal defining it
    621621RETURN:  an integer,  1 if phi is surjective, 0 if not
    622 NOTE:    The algorithm returns 1 iff all the variables of the basering are
     622NOTE:    The algorithm returns 1 if and only if all the variables of the basering are
    623623         contained in the polynomial subalgebra generated by the polynomials
    624624         defining phi. Hence, it tests surjectivity in the case of a global odering.
     
    995995RETURN:  1 if R ---> basering/J is finite and 0 else
    996996NOTE:    R may be a quotient ring (this will be ignored since a map R/I-->S/J
    997          is finite iff the induced map R-->S/J is finite).
     997         is finite if and only if the induced map R-->S/J is finite).
    998998SEE ALSO: finitenessTest
    999999EXAMPLE: example mapIsFinite; shows an example
  • Singular/LIB/bfun.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: bfun.lib,v 1.8 2009-04-14 12:00:13 Singular Exp $";
     2version="$Id: bfun.lib,v 1.9 2009-04-15 11:09:27 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    1010@*      one is interested in the global b-function (also known as Bernstein-Sato
    1111@*      polynomial) b(s) in K[s], defined to be the non-zero monic polynomial of minimal
    12 @*      degree, satisfying a functional identity L * F^{s+1} = b(s) F^s,
     12@*      degree, satisfying a functional identity L * F^{s+1} = b(s) F^s,   
    1313@*      for some operator L in D[s] (* stands for the action of differential operator)
    1414@*      By D one denotes the n-th Weyl algebra
     
    2121@*   There is a constructive definition of a b-function of a holonomic ideal I in D
    2222@*   (that is, an ideal I in a Weyl algebra D, such that D/I is holonomic module)
    23 @*   with respect to the given weight vector w: For a poly p in D, its initial
    24 @*   form w.r.t. (-w,w) is defined as the sum of all terms of p which have
     23@*   with respect to the given weight vector w: For a polynomial p in D, its initial
     24@*   form w.r.t. (-w,w) is defined as the sum of all terms of p which have 
    2525@*   maximal weighted total degree where the weight of x_i is -w_i and the weight
    26 @*   of d_i is w_i. Let J be the initial ideal of I w.r.t. (-w,w), i.e. the
     26@*   of d_i is w_i. Let J be the initial ideal of I w.r.t. (-w,w), i.e. the 
    2727@*   K-vector space generated by all initial forms w.r.t (-w,w) of elements of I.
    2828@*   Put s = w_1 x_1 d_1 + ... + w_n x_n d_n. Then the monic generator b_w(s) of
    29 @*   the intersection of J with the PID K[s] is called the b-function of I w.r.t.  w.
     29@*   the intersection of J with the PID K[s] is called the b-function of I w.r.t.  w. 
    3030@*   Unlike Bernstein-Sato polynomial, general b-function with respect to
    3131@*   arbitrary weights need not have rational roots at all. However, b-function
    3232@*  of a holonomic ideal is known to be non-zero as well.
    33 @*
    34 @*      References: [SST] Saito, Sturmfels, Takayama: Groebner Deformations of
     33@* 
     34@*      References: [SST] Saito, Sturmfels, Takayama: Groebner Deformations of 
    3535@*      Hypergeometric Differential Equations (2000),
    3636@*      Noro: An Efficient Modular Algorithm for Computing the Global b-function,
     
    4444bfctAnn(f[,s]);           compute the BS polynomial of f via Ann f^s + f
    4545bfctOneGB(f[,s,t]);     compute the BS polynomial of f by just one GB computation
    46 bfctIdeal(I,w[,s,t]);     compute the b-function of ideal wrt weight
    47 pIntersect(f,I[,s]);      intersection of ideal with subalgebra K[f] for a poly f
     46bfctIdeal(I,w[,s,t]);     compute the b-function of ideal w.r.t. weight
     47pIntersect(f,I[,s]);      intersection of ideal with subalgebra K[f] for a polynomial f
    4848pIntersectSyz(f,I[,p,s,t]); intersection of ideal with subalgebra K[f] with syz-solver
    49 linReduce(f,I[,s]);         reduce a poly by linear reductions wrt ideal
     49linReduce(f,I[,s]);         reduce a polynomial by linear reductions w.r.t. ideal
    5050linReduceIdeal(I,[s,t]);  interreduce generators of ideal by linear reductions
    5151linSyzSolve(I[,s]);         compute a linear dependency of elements of ideal I
     
    5353AUXILIARY PROCEDURES:
    5454
    55 allPositive(v);  checks whether all entries of an intvec are positive
     55allPositive(v);  checks whether all entries of an intvec are positive 
    5656scalarProd(v,w); computes the standard scalar product of two intvecs
    57 vec2poly(v[,i]); constructs an univariate poly with given coefficients
     57vec2poly(v[,i]); constructs an univariate polynomial with given coefficients
    5858
    5959SEE ALSO: dmod_lib, dmodapp_lib, gmssing_lib
     
    358358      for (i=1; i<=ncols(I); i++) { M[i] = gen(i);  }
    359359    }
    360   }
     360  } 
    361361  dbprint(ppl-1,"// initially sorted ideal:", I);
    362362  if (remembercoeffs <> 0) { dbprint(ppl-1,"// used permutations:", M); }
     
    468468"USAGE:  linReduce(f, I [,s,t,u]); f a poly, I an ideal, s,t,u optional ints
    469469RETURN:  poly or list, linear reductum (over field) of f by elements from I
    470 PURPOSE: reduce a poly only by linear reductions (no monomial multiplications)
    471 NOTE:    If s<>0, a list consisting of the reduced poly and the coefficient
     470PURPOSE: reduce a polynomial only by linear reductions (no monomial multiplications)
     471NOTE:    If s<>0, a list consisting of the reduced polynomial and the coefficient
    472472@*       vector of the used reductions is returned, otherwise (and by default)
    473 @*       only reduced poly is returned.
     473@*       only reduced polynomial is returned.
    474474@*       If t<>0 (and by default) all monomials are reduced (if possible),
    475475@*       otherwise, only leading monomials are reduced.
    476 @*       If u<>0 (and by default), the ideal is linearly pre-reduced, i.e.
     476@*       If u<>0 (and by default), the ideal is linearly pre-reduced, i.e. 
    477477@*       instead of the given ideal, the output of @code{linReduceIdeal} is used.
    478478@*       If u is set to 0 and the given ideal does not equal the output of
     
    918918NOTE:    If the intersection is zero, this procedure might not terminate.
    919919@*       If p>0 is given, this proc computes the generator of the intersection in
    920 @*       char p first and then only searches for a generator of the obtained
    921 @*       degree in the basering. Otherwise, it searches for all degrees by
     920@*       char p first and then only searches for a generator of the obtained 
     921@*       degree in the basering. Otherwise, it searches for all degrees by 
    922922@*       computing syzygies.
    923923@*       If s<>0, @code{std} is used for Groebner basis computations in char 0,
    924924@*       otherwise, and by default, @code{slimgb} is used.
    925 @*       If t<>0 and by default, @code{std} is used for Groebner basis
     925@*       If t<>0 and by default, @code{std} is used for Groebner basis 
    926926@*       computations in char >0, otherwise, @code{slimgb} is used.
    927927DISPLAY: If printlevel=1, progress debug messages will be printed,
     
    11311131  }
    11321132  dbprint(ppl,"// pIntersectSyz finished");
    1133   if (solveincharp) { short = shortSave; }
     1133  if (solveincharp) { short = shortSave; } 
    11341134  return(v);
    11351135}
     
    11501150proc vec2poly (list #)
    11511151"USAGE:  vec2poly(v [,i]);  v a vector or an intvec, i an optional int
    1152 RETURN:  poly, an univariate poly in i-th variable with coefficients given by v
    1153 PURPOSE: constructs an univariate poly in K[var(i)] with given coefficients,
     1152RETURN:  poly, an univariate polynomial in i-th variable with coefficients given by v
     1153PURPOSE: constructs an univariate polynomial in K[var(i)] with given coefficients,
    11541154@*       such that the coefficient at var(i)^{j-1} is v[j].
    11551155NOTE:    The optional argument i must be positive, by default i is 1.
     
    12351235  // the rest of this proc is nicked from bernsteinBM from dmod.lib
    12361236  list P = factorize(p);//with constants and multiplicities
    1237   ideal bs; intvec m;   //the BS poly is monic, so we are not interested in constants
     1237  ideal bs; intvec m;   //the BS polynomial is monic, so we are not interested in constants
    12381238  for (i=2; i<= size(P[1]); i++)  //we delete P[1][1] and P[2][1]
    12391239  {
     
    12721272  {
    12731273    return(list(ideal(0),intvec(0)));
    1274   }
     1274  } 
    12751275  if (inorann == 0) // bfct using initial ideal
    12761276  {
     
    13641364RETURN:  list of ideal and intvec
    13651365PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s)
    1366 @*       for the hypersurface defined by f.
     1366@*       for the hypersurface defined by f. 
    13671367ASSUME:  The basering is commutative and of characteristic 0.
    13681368BACKGROUND: In this proc, the initial Malgrange ideal is computed according to
    13691369@*       the algorithm by Masayuki Noro and then a system of linear equations is
    13701370@*       solved by linear reductions.
    1371 NOTE:    In the output list, the ideal contains all the roots
     1371NOTE:    In the output list, the ideal contains all the roots 
    13721372@*       and the intvec their multiplicities.
    13731373@*       If s<>0, @code{std} is used for GB computations,
    1374 @*       otherwise, and by default, @code{slimgb} is used.
     1374@*       otherwise, and by default, @code{slimgb} is used. 
    13751375@*       If t<>0, a matrix ordering is used for Groebner basis computations,
    13761376@*       otherwise, and by default, a block ordering is used.
     
    14351435@*       the algorithm by Masayuki Noro and then a system of linear equations is
    14361436@*       solved by computing syzygies.
    1437 NOTE:    In the output list, the ideal contains all the roots and the intvec
     1437NOTE:    In the output list, the ideal contains all the roots and the intvec 
    14381438@*       their multiplicities.
    14391439@*       If r<>0, @code{std} is used for GB computations in characteristic 0,
     
    15171517"USAGE:  bfctIdeal(I,w[,s,t]);  I an ideal, w an intvec, s,t optional ints
    15181518RETURN:  list of ideal and intvec
    1519 PURPOSE: computes the roots of the global b-function of I wrt the weight (-w,w).
     1519PURPOSE: computes the roots of the global b-function of I w.r.t. the weight (-w,w).
    15201520ASSUME:  The basering is the n-th Weyl algebra in characteristic 0 and for all
    15211521@*       1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the
    1522 @*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n),
     1522@*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 
    15231523@*       where D(i) is the differential operator belonging to x(i).
    15241524@*       Further we assume that I is holonomic.
     
    15331533@*  L[3] is 1 (for nonzero constant) or 0 (for zero b-function).
    15341534@*       If s<>0, @code{std} is used for GB computations in characteristic 0,
    1535 @*       otherwise, and by default, @code{slimgb} is used.
     1535@*       otherwise, and by default, @code{slimgb} is used. 
    15361536@*       If t<>0, a matrix ordering is used for GB computations, otherwise,
    15371537@*       and by default, a block ordering is used.
     
    16221622@*       their multiplicities.
    16231623@*       If s<>0, @code{std} is used for the GB computation, otherwise,
    1624 @*       and by default, @code{slimgb} is used.
     1624@*       and by default, @code{slimgb} is used. 
    16251625@*       If t<>0, a matrix ordering is used for GB computations,
    16261626@*       otherwise, and by default, a block ordering is used.
     
    16341634  def save = basering;
    16351635  int n = nvars(save);
    1636   if (char(save) <> 0)
     1636  if (char(save) <> 0) 
    16371637  {
    16381638    ERROR("characteristic of basering has to be 0");
     
    16711671  // create names for vars
    16721672  list Lvar;
    1673   Lvar[1]   = safeVarName("t");
     1673  Lvar[1]   = safeVarName("t"); 
    16741674  Lvar[2]   = safeVarName("s");
    16751675  Lvar[n+3] = safeVarName("D"+Lvar[1]);
     
    16841684  intvec @a = 1:N; @a[2] = 2;
    16851685  intvec @a2 = @a; @a2[2] = 0; @a2[2*n+4] = 0;
    1686   list Lord;
     1686  list Lord; 
    16871687  Lord[1] = list("a",@a); Lord[2] = list("a",@a2);
    16881688  if (methodord == 0) // default: block ordering
     
    17821782@*       their multiplicities.
    17831783@*       If r<>0, @code{std} is used for GB computations,
    1784 @*       otherwise, and by default, @code{slimgb} is used.
     1784@*       otherwise, and by default, @code{slimgb} is used. 
    17851785DISPLAY: If printlevel=1, progress debug messages will be printed,
    17861786@*       if printlevel>=2, all the debug messages will be printed.
  • Singular/LIB/brnoeth.lib

    r40c648 r3754ca  
    1 version="$Id: brnoeth.lib,v 1.21 2009-04-07 09:30:44 seelisch Exp $";
     1version="$Id: brnoeth.lib,v 1.22 2009-04-15 11:10:53 seelisch Exp $";
    22category="Coding theory";
    33info="
     
    456456{
    457457  // computes : the degree of a given point
    458   // remark(1) : if the input is (irreducible homogeneous) poly => the point
     458  // remark(1) : if the input is (irreducible homogeneous) polynomial => the point
    459459  //             is at infinity
    460460  // remark(2) : it the input is (std. resp. lp. prime) ideal => the point is
     
    483483    else
    484484    {
    485       ERROR("parameter must have a poly or ideal in the first component");
     485      ERROR("parameter must have a polynomial or ideal in the first component");
    486486    }
    487487  }
     
    11441144    else
    11451145    {
    1146       ERROR("a point must have a poly or ideal in the first component");
     1146      ERROR("a point must have a polynomial or ideal in the first component");
    11471147    }
    11481148  }
     
    32593259static proc local_eq (poly H,SS,int m)
    32603260{
    3261   // computes a local equation of poly H in the ring SS related to the place
     3261  // computes a local equation of polynomial H in the ring SS related to the place
    32623262  //     "m"
    32633263  // list POINT/POINTS is searched depending on wether m=0 or m>0 respectively
     
    34613461static proc polytoRF (F)
    34623462{
    3463   // converts a poly (or number) into a "rational function" of type "ideal"
    3464   // warning : it must be called inside "R" and poly should be affine
     3463  // converts a polynomial (or number) into a "rational function" of type "ideal"
     3464  // warning : it must be called inside "R" and the polynomial is expected to be affine
    34653465  ideal RF;
    34663466  RF[1]=homog(F,z);
     
    35353535{
    35363536  // computes l*F as rational function
    3537   // l should be either a number or a poly of degree zero
     3537  // l should be either a number or a polynomial of degree zero
    35383538  if (typeof(F)=="ideal")
    35393539  {
  • Singular/LIB/central.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: central.lib,v 1.9 2009-03-30 18:11:39 motsak Exp $"
     2version="$Id: central.lib,v 1.10 2009-04-15 11:11:04 seelisch Exp $"
    33category="Noncommutative"
    44info="
     
    14391439static proc SANF( poly p, list FOUND_LEADING_MONOMIALS )
    14401440  "
    1441     reduce p wrt found multiples without ANY polynomial multiplications!
     1441    reduce p w.r.t. found multiples without ANY polynomial multiplications!
    14421442"
    14431443{
     
    16661666"
    16671667USAGE:      sa_poly_reduce(p, V); p poly, V ideal
    1668 RETURN:     polynomial, a reduction of p wrt V
    1669 PURPOSE:    computes a reduction of the polynomial p wrt the subalgebra generated by elements of V
     1668RETURN:     polynomial, a reduction of p w.r.t. V
     1669PURPOSE:    computes a reduction of the polynomial p w.r.t. the subalgebra generated by elements of V
    16701670NOTE:       At the moment the usage of this procedure is limited to G-algebras
    16711671SEE ALSO:   sa_reduce
     
    17961796        {
    17971797          DBPrint( 1, "POLY: " + string (p) +
    1798                    " is NOT in the centralizer of poly {" + string(f) + "}" );
     1798                   " is NOT in the centralizer of polynomial {" + string(f) + "}" );
    17991799          return (0);
    18001800        }
     
    19461946RETURN:      integer, 1 if f is a Cartan element and 0 otherwise.
    19471947NOTE:        f is a Cartan element of the algebra A
    1948 @* iff for all g in A there exists C in K such that [f, g] = C * g
    1949 @* iff for all variables v_i there exist C in K such that [f, v_i] = C * v_i.
     1948@* if and only if for all g in A there exists C in K such that [f, g] = C * g
     1949@* if and only if for all variables v_i there exist C in K such that [f, v_i] = C * v_i.
    19501950"
    19511951{
  • Singular/LIB/classify.lib

    r40c648 r3754ca  
    11// KK,GMG last modified: 17.12.00
    22///////////////////////////////////////////////////////////////////////////////
    3 version  = "$Id: classify.lib,v 1.55 2009-01-14 16:07:03 Singular Exp $";
     3version  = "$Id: classify.lib,v 1.56 2009-04-15 11:11:11 seelisch Exp $";
    44category="Singularities";
    55info="
     
    1313PROCEDURES:
    1414 basicinvariants(f); computes Milnor number, determinacy-bound and corank of
    15  classify(f);        normal form of poly f determined with Arnold's method
     15 classify(f);        normal form of polynomial f determined with Arnold's method
    1616 corank(f);          computes the corank of f (i.e. of the Hessian of f)
    1717 Hcode(v);           coding of intvec v acoording to the number repetitions
    1818 init_debug([n]);    print trace and debugging information depending on int n
    1919 internalfunctions();display names of internal procedures of this library
    20  milnorcode(f[,e]);  Hilbert poly of [e-th] Milnor algebra coded with Hcode
     20 milnorcode(f[,e]);  Hilbert polynomial of [e-th] Milnor algebra coded with Hcode
    2121 morsesplit(f);      residual part of f after applying the splitting lemma
    2222 quickclass(f)       normal form of f determined by invariants (milnorcode)
     
    6262REMARK:   This version of classify is only beta. Please send bugs and
    6363          comments to: \"Kai Krueger\" <krueger@mathematik.uni-kl.de> @*
    64           Be sure to have at least Singular version 1.0.1. Updates can be
     64          Be sure to have at least @sc{Singular} version 1.0.1. Updates can be
    6565          found at: @*
    6666          URL=http://www.mathematik.uni-kl.de/~krueger/Singular/
  • Singular/LIB/crypto.lib

    r40c648 r3754ca  
    11//GP, last modified 28.6.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: crypto.lib,v 1.8 2009-04-14 12:00:14 Singular Exp $";
     3version="$Id: crypto.lib,v 1.9 2009-04-15 11:11:20 seelisch Exp $";
    44category="Teaching";
    55info="
     
    15751575"USAGE:  generateG(a,b,m);
    15761576RETURN: m-th division polynomial
    1577 NOTE: generate the so-called division polynomials, i.e., the recursively defined
     1577NOTE: generate the so-called division polynomials, i.e., the recursively defined 
    15781578polynomials p_m=generateG(a,b,m) in Z[x, y] such that, for a point (x:y:1) on the
    15791579elliptic curve defined by y^2=x^3+a*x+b  over Z/N the point@*
    15801580m*P=(x-(p_(m-1)*p_(m+1))/p_m^2 :(p_(m+2)*p_(m-1)^2-p_(m-2)*p_(m+1)^2)/4y*p_m^3 :1)
    1581 and m*P=0  iff p_m(P)=0
     1581and m*P=0 if and only if p_m(P)=0
    15821582EXAMPLE:example generateG; shows an example
    15831583"
  • Singular/LIB/curvepar.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////////////////
    2 version="$Id: curvepar.lib,v 1.3 2007-05-24 13:37:19 Singular Exp $";
     2version="$Id: curvepar.lib,v 1.4 2009-04-15 11:11:20 seelisch Exp $";
    33category="Singularities";
    44info="
     
    3737          Each chart C[i] is a list of size 5
    3838          C[i][1] is an integer j. It shows, which standard chart do we consider.
    39           C[i][2] is an irreducible poly g in k[a]. It is a minimal polynomial for the new parameter.
     39          C[i][2] is an irreducible polynomial g in k[a]. It is a minimal polynomial for the new parameter.
    4040          C[i][3] is an ideal H in k[a].
    4141                  c_i=F_i(a_new) for i=1..n,
     
    365365                        teta:k[x(1)..x(n),a]-->k[x(1)..x(n),a] from the
    366366                        new curve to the old one.
    367           Resolve[i][3] is an irreducible poly g in k[a]. It is a minimal polynomial for the new parameter a.
     367          Resolve[i][3] is an irreducible polynomial g in k[a]. It is a minimal polynomial for the new parameter a.
    368368          Resolve[i][4] sequence of multiplicities
    369369          Resolve[i][5] is a list of integers l. It shows, which standard charts we considered.
  • Singular/LIB/dmod.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: dmod.lib,v 1.41 2009-04-14 17:11:50 Singular Exp $";
     2version="$Id: dmod.lib,v 1.42 2009-04-15 11:11:34 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    77@*             Jorge Martin Morales,    jorge@unizar.es
    88
    9 THEORY: Let K be a field of characteristic 0. Given a polynomial ring
     9THEORY: Let K be a field of characteristic 0. Given a polynomial ring 
    1010@*      R = K[x_1,...,x_n] and a polynomial F in R,
    11 @*      one is interested in the R[1/F]-module of rank one, generated by
     11@*      one is interested in the R[1/F]-module of rank one, generated by 
    1212@*      the symbol F^s for a symbolic discrete variable s.
    1313@* In fact, the module R[1/F]*F^s has a structure of a D(R)[s]-module, where D(R)
     
    1919@* One is interested in the following data:
    2020@* - Ann F^s = I = I(F^s) in D(R)[s], denoted by LD in the output
    21 @* - global Bernstein polynomial in K[s], denoted by bs,
     21@* - global Bernstein polynomial in K[s], denoted by bs, 
    2222@* - its minimal integer root s0, the list of all roots of bs, which are known
    2323@*   to be rational, with their multiplicities, which is denoted by BS
    24 @* - Ann F^s0 = I(F^s0) in D(R), denoted by LD0 in the output
     24@* - Ann F^s0 = I(F^s0) in D(R), denoted by LD0 in the output 
    2525@*   (LD0 is a holonomic ideal in D(R))
    2626@* - Ann^(1) F^s in D(R)[s], denoted by LD1 (logarithmic derivations)
     
    2828@*     PS*F^(s+1) = bs*F^s holds in K[x_1,...,x_n,1/F]*F^s.
    2929
    30 REFERENCES:
     30REFERENCES: 
    3131@* We provide the following implementations of algorithms:
    32 @* (OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of
     32@* (OT) the classical Ann F^s algorithm from Oaku and Takayama (Journal of 
    3333@* Pure and Applied Math., 1999),
    3434@* (LOT) Levandovskyy's modification of the Oaku-Takayama algorithm (ISSAC 2007)
     
    3636@*        l'ideal de Bernstein associe a des polynomes, preprint, 2002)
    3737@* (LM08) V. Levandovskyy and J. Martin-Morales, ISSAC 2008
    38 @* (C) Countinho, A Primer of Algebraic D-Modules,
    39 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric
     38@* (C) Countinho, A Primer of Algebraic D-Modules, 
     39@* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 
    4040@*         Differential Equations', Springer, 2000
    4141
     
    5959MAIN PROCEDURES:
    6060
    61 annfs(F[,S,eng]);       compute Ann F^s0 in D and Bernstein poly for a poly F
    62 annfspecial(I, F, m, n);  compute Ann F^n from Ann F^s for a poly F and a number n
    63 Sannfs(F[,S,eng]);      compute Ann F^s in D[s] for a poly F
    64 Sannfslog(F[,eng]);     compute Ann^(1) F^s in D[s] for a poly F
    65 bernsteinBM(F[,eng]);   compute global Bernstein poly for a poly F (algorithm of Briancon-Maisonobe)
    66 operatorBM(F[,eng]);    compute Ann F^s, Ann F^s0, BS and PS for a poly F (algorithm of Briancon-Maisonobe)
    67 annfsParamBM(F[,eng]);  compute the generic Ann F^s (algorithm by Briancon and Maisonobe) and exceptional parametric constellations for a poly F with parametric coefficients
    68 annfsBMI(F[,eng]);      compute Ann F^s and Bernstein ideal for a poly F=f1*..*fP (multivariate algorithm of Briancon-Maisonobe)
     61annfs(F[,S,eng]);       compute Ann F^s0 in D and Bernstein polynomial for a poly F
     62annfspecial(I, F, m, n);  compute Ann F^n from Ann F^s for a polynomial F and a number n
     63Sannfs(F[,S,eng]);      compute Ann F^s in D[s] for a polynomial F
     64Sannfslog(F[,eng]);     compute Ann^(1) F^s in D[s] for a polynomial F
     65bernsteinBM(F[,eng]);   compute global Bernstein polynomial for a polynomial F (algorithm of Briancon-Maisonobe)
     66operatorBM(F[,eng]);    compute Ann F^s, Ann F^s0, BS and PS for a polynomial F (algorithm of Briancon-Maisonobe)
     67annfsParamBM(F[,eng]);  compute the generic Ann F^s (algorithm by Briancon and Maisonobe) and exceptional parametric constellations for a polynomial F with parametric coefficients
     68annfsBMI(F[,eng]);      compute Ann F^s and Bernstein ideal for a polynomial F=f1*..*fP (multivariate algorithm of Briancon-Maisonobe)
    6969checkRoot(F,a[,S,eng]); check if a given rational is a root of the global Bernstein polynomial of F and compute its multiplicity
    70 annfsBM(F[,eng]);          compute Ann F^s0 in D and Bernstein poly for a poly F (algorithm of Briancon-Maisonobe)
    71 annfsLOT(F[,eng]);         compute Ann F^s0 in D and Bernstein poly for a poly F (Levandovskyy modification of the Oaku-Takayama algorithm)
    72 annfsOT(F[,eng]);          compute Ann F^s0 in D and Bernstein poly for a poly F (algorithm of Oaku-Takayama)
    73 SannfsBM(F[,eng]);         compute Ann F^s in D[s] for a poly F (algorithm of Briancon-Maisonobe)
    74 SannfsBFCT(F[,eng]);      compute Ann F^s in D[s] for a poly F (algorithm of Briancon-Maisonobe, other output ordering)
    75 SannfsLOT(F[,eng]);        compute Ann F^s in D[s] for a poly F (Levandovskyy modification of the Oaku-Takayama algorithm)
    76 SannfsOT(F[,eng]);         compute Ann F^s in D[s] for a poly F (algorithm of Oaku-Takayama)
    77 annfs0(I,F [,eng]);          compute Ann F^s0 in D and Bernstein poly from the known Ann F^s in D[s]
    78 annfs2(I,F [,eng]);           compute Ann F^s0 in D and Bernstein poly from the known Ann F^s in D[s] by using a trick of Noro
    79 annfsRB(I,F [,eng]);          compute Ann F^s0 in D and Bernstein poly from the known Ann F^s in D[s] by reduceB strategy of Macaulay
     70annfsBM(F[,eng]);          compute Ann F^s0 in D and Bernstein polynomial for a polynomial F (algorithm of Briancon-Maisonobe)
     71annfsLOT(F[,eng]);         compute Ann F^s0 in D and Bernstein polynomial for a polynomial F (Levandovskyy modification of the Oaku-Takayama algorithm)
     72annfsOT(F[,eng]);          compute Ann F^s0 in D and Bernstein polynomial for a polynomial F (algorithm of Oaku-Takayama)
     73SannfsBM(F[,eng]);         compute Ann F^s in D[s] for a polynomial F (algorithm of Briancon-Maisonobe)
     74SannfsBFCT(F[,eng]);      compute Ann F^s in D[s] for a polynomial F (algorithm of Briancon-Maisonobe, other output ordering)
     75SannfsLOT(F[,eng]);        compute Ann F^s in D[s] for a polynomial F (Levandovskyy modification of the Oaku-Takayama algorithm)
     76SannfsOT(F[,eng]);         compute Ann F^s in D[s] for a polynomial F (algorithm of Oaku-Takayama)
     77annfs0(I,F [,eng]);          compute Ann F^s0 in D and Bernstein polynomial from the known Ann F^s in D[s]
     78annfs2(I,F [,eng]);           compute Ann F^s0 in D and Bernstein polynomial from the known Ann F^s in D[s] by using a trick of Noro
     79annfsRB(I,F [,eng]);          compute Ann F^s0 in D and Bernstein polynomial from the known Ann F^s in D[s] by reduceB strategy of Macaulay
    8080checkRoot1(I,F,a[,eng]);   check whether a rational is a root of the global Bernstein polynomial of F from the known Ann F^s in D[s]
    8181checkRoot2(I,F,a[,eng]);   check whether a rational is a root of the global Bernstein polynomial of F and compute its multiplicity from the known Ann F^s in D[s]
     
    105105LIB "poly.lib";
    106106
     107proc testdmodlib()
     108{
     109  /* tests all procs for consistency */
     110  /* adding the new proc, add it here */
     111
     112  "MAIN PROCEDURES:";
     113  example annfs;
     114  example Sannfs;
     115  example Sannfslog;
     116  example bernsteinBM;
     117  example operatorBM;
     118  example annfspecial;
     119  example annfsParamBM;
     120  example annfsBMI;
     121  example checkRoot;
     122  example annfs0;
     123  example annfs2;
     124  example annfsRB;
     125  example annfs2;
     126  "SECONDARY D-MOD PROCEDURES:";
     127  example annfsBM;
     128  example annfsLOT;
     129  example annfsOT;
     130  example SannfsBM;
     131  example SannfsLOT;
     132  example SannfsOT;
     133  example SannfsBFCT;
     134  example checkRoot1;
     135  example checkRoot2;
     136  example checkFactor;
     137}
     138
     139
     140
    107141// new top-level procedures
    108142proc annfs(poly F, list #)
    109143"USAGE:  annfs(f [,S,eng]);  f a poly, S a string, eng an optional int
    110144RETURN:  ring
    111 PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm
     145PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm 
    112146@*  given in S and with the Groebner basis engine given in ''eng''
    113147NOTE:  activate the output ring with the @code{setring} command.
     
    233267"USAGE:  Sannfs(f [,S,eng]);  f a poly, S a string, eng an optional int
    234268RETURN:  ring
    235 PURPOSE: compute the D-module structure of basering[f^s] with the algorithm
     269PURPOSE: compute the D-module structure of basering[f^s] with the algorithm 
    236270@*  given in S and with the Groebner basis engine given in eng
    237271NOTE:    activate the output ring with the @code{setring} command.
     
    354388PURPOSE: compute the D-module structure of basering[1/f]*f^s
    355389NOTE:    activate the output ring with the @code{setring} command.
    356 @*   In the output ring D[s], the ideal LD1 is generated by the elements
     390@*   In the output ring D[s], the ideal LD1 is generated by the elements 
    357391@*   in Ann F^s in D[s], coming from logarithmic derivations.
    358392@*       If eng <>0, @code{std} is used for Groebner basis computations,
     
    502536"USAGE:  ALTannfsBM(f [,eng]);  f a poly, eng an optional int
    503537RETURN:  ring
    504 PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl
     538PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl 
    505539@*   algebra, according to the algorithm by Briancon and Maisonobe
    506540NOTE:  activate the output ring with the @code{setring} command. In this ring,
     
    694728"USAGE:  bernsteinBM(f [,eng]);  f a poly, eng an optional int
    695729RETURN:  list (of roots of the Bernstein polynomial b and their multiplicies)
    696 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface,
     730PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, 
    697731@* defined by f, according to the algorithm by Briancon and Maisonobe
    698732NOTE:    If eng <>0, @code{std} is used for Groebner basis computations,
     
    12171251"USAGE:  annfs2(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    12181252RETURN:  ring
    1219 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra,
     1253PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 
    12201254@*       based on the output of Sannfs-like procedure
    12211255@*       annfs2 uses shorter expressions in the variable s (the idea of Noro).
     
    13781412"USAGE:  annfsRB(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    13791413RETURN:  ring
    1380 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra,
     1414PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 
    13811415@* based on the output of Sannfs like procedure
    13821416NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    14351469  attrib(JF,"isSB",1); // embedded comm ring is used
    14361470  ideal J = NF(I,JF);
    1437   dbprint(ppl,"// -1-2- finished computing the NF of I wrt Tjurina ideal");
     1471  dbprint(ppl,"// -1-2- finished computing the NF of I w.r.t. Tjurina ideal");
    14381472  dbprint(ppl-1, J2);
    14391473  // make leadcoeffs positive
     
    15671601"USAGE:  operatorBM(f [,eng]);  f a poly, eng an optional int
    15681602RETURN:  ring
    1569 PURPOSE: compute the B-operator and other relevant data for Ann F^s,
     1603PURPOSE: compute the B-operator and other relevant data for Ann F^s, 
    15701604@*  using e.g. algorithm by Briancon and Maisonobe for Ann F^s and BS.
    15711605NOTE:    activate the output ring with the @code{setring} command. In the output ring D[s]
     
    18901924"USAGE:  operatorModulo(f,I,b);  f a poly, I an ideal, b a poly
    18911925RETURN:  poly
    1892 PURPOSE: compute the B-operator from the poly f, ideal I = Ann f^s and Bernstein-Sato
     1926PURPOSE: compute the B-operator from the polynomial f, ideal I = Ann f^s and Bernstein-Sato
    18931927polynomial b using modulo i.e. kernel of module homomorphism
    18941928NOTE:  The computations take place in the ring, similar to the one returned by Sannfs procedure.
     
    22042238"USAGE:  annfsBMI(F [,eng]);  F an ideal, eng an optional int
    22052239RETURN:  ring
    2206 PURPOSE: compute the D-module structure of basering[1/f]*f^s where
     2240PURPOSE: compute the D-module structure of basering[1/f]*f^s where 
    22072241@* f = F[1]*..*F[P], according to the algorithm by Briancon and Maisonobe.
    22082242NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    25332567"USAGE:  annfsOT(f [,eng]);  f a poly, eng an optional int
    25342568RETURN:  ring
    2535 PURPOSE: compute the D-module structure of basering[1/f]*f^s,
     2569PURPOSE: compute the D-module structure of basering[1/f]*f^s, 
    25362570@* according to the algorithm by Oaku and Takayama
    25372571NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    29152949"USAGE:  SannfsOT(f [,eng]);  f a poly, eng an optional int
    29162950RETURN:  ring
    2917 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
     2951PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
    29182952@* 1st step of the algorithm by Oaku and Takayama in the ring D[s]
    29192953NOTE:    activate the output ring with the @code{setring} command.
    2920 @*  In the output ring D[s], the ideal LD (which is NOT a Groebner basis)
     2954@*  In the output ring D[s], the ideal LD (which is NOT a Groebner basis) 
    29212955@*  is the needed D-module structure.
    29222956@*  If eng <>0, @code{std} is used for Groebner basis computations,
     
    31993233"USAGE:  SannfsBM(f [,eng]);  f a poly, eng an optional int
    32003234RETURN:  ring
    3201 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
     3235PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
    32023236@* 1st step of the algorithm by Briancon and Maisonobe in the ring D[s].
    32033237NOTE:  activate the output ring with the @code{setring} command.
    3204 @*   In the output ring D[s], the ideal LD (which is NOT a Groebner basis) is
     3238@*   In the output ring D[s], the ideal LD (which is NOT a Groebner basis) is 
    32053239@*   the needed D-module structure.
    32063240@*   If eng <>0, @code{std} is used for Groebner basis computations,
     
    34083442PURPOSE: compute Ann f^s and Groebner basis of Ann f^s+f in D[s]
    34093443NOTE:    activate the output ring with the @code{setring} command.
    3410 @*  This procedure, unlike SannfsBM, returns a ring with the degrevlex
     3444@*  This procedure, unlike SannfsBM, returns a ring with the degrevlex 
    34113445@*  ordering in all variables.
    34123446@*  In the ring D[s], the ideal LD is the ideal needed (which is returned as a Groebner basis).
     
    36143648PURPOSE: compute Ann f^s and Groebner basis of Ann f^s+f in D[s]
    36153649NOTE:    activate the output ring with the @code{setring} command.
    3616 @*    This procedure, unlike SannfsBM, returns a ring with the degrevlex
     3650@*    This procedure, unlike SannfsBM, returns a ring with the degrevlex 
    36173651@*    ordering in all variables.
    36183652@*    In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal.
     
    36233657"
    36243658{
    3625   // DEBUG INFO: ordering on the output ring = dp,
     3659  // DEBUG INFO: ordering on the output ring = dp, 
    36263660  // use std(K,F); for reusing the std property of K
    36273661
     
    38353869"USAGE:  SannfsLOT(f [,eng]);  f a poly, eng an optional int
    38363870RETURN:  ring
    3837 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
     3871PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
    38383872@* Levandovskyy's modification of the algorithm by Oaku and Takayama in D[s]
    38393873NOTE:    activate the output ring with the @code{setring} command.
    3840 @*    In the ring D[s], the ideal LD (which is NOT a Groebner basis) is
     3874@*    In the ring D[s], the ideal LD (which is NOT a Groebner basis) is 
    38413875@*    the needed D-module structure.
    38423876@*    If eng <>0, @code{std} is used for Groebner basis computations,
     
    42924326"USAGE:  annfsLOT(F [,eng]);  F a poly, eng an optional int
    42934327RETURN:  ring
    4294 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to
     4328PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to 
    42954329@* the Levandovskyy's modification of the algorithm by Oaku and Takayama
    42964330NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    43374371"USAGE:  annfs0(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    43384372RETURN:  ring
    4339 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based
     4373PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based 
    43404374@* on the output of Sannfs-like procedure
    43414375NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    45154549//   // returns a ring with the ideal LD in it
    45164550//   def save = basering;
    4517 //   // compute the Bernstein poly from gmssing.lib
     4551//   // compute the Bernstein polynomial from gmssing.lib
    45184552//   list RL = ringlist(basering);
    45194553//   // in the descr. of the ordering, replace "p" by "s"
     
    48264860"USAGE:  annfspecial(I,F,mir,n);  I an ideal, F a poly, int mir, number n
    48274861RETURN:  ideal
    4828 PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra
     4862PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra 
    48294863@*           for the given rational number n
    48304864ASSUME:  The basering is D[s] and contains 's' explicitly as a variable,
     
    48324866@*   the integer 'mir' is the minimal integer root of the BS polynomial of F,
    48334867@*   and the number n is rational.
    4834 NOTE: We compute the real annihilator for any rational value of n (both
    4835 @*       generic and exceptional). The implementation goes along the lines of
    4836 @*       the Algorithm 5.3.15 from Saito-Sturmfels-Takayama.
     4868NOTE: We compute the real annihilator for any rational value of n (both 
     4869@*       generic and exceptional). The implementation goes along the lines of 
     4870@*       the Algorithm 5.3.15 from Saito-Sturmfels-Takayama. 
    48374871DISPLAY: If printlevel=1, progress debug messages will be printed,
    48384872@*       if printlevel>=2, all the debug messages will be printed.
     
    49925026  // together with a global ordering
    49935027  ring r2  = 0,x,dp;
    4994   poly f3   = 9*(x+2/3)*(x+1)*(x+4/3); //global b-poly of f1=x*y*(x+y)
     5028  poly f3   = 9*(x+2/3)*(x+1)*(x+4/3); //global b-polynomial of f1=x*y*(x+y)
    49955029  ideal I3 = factorize(f3,1);
    49965030  I3;
     
    51585192RETURN:  int
    51595193ASSUME: Basering is a commutative ring, alpha is a rational number.
    5160 PURPOSE: check whether a rational number alpha is a root of the global
     5194PURPOSE: check whether a rational number alpha is a root of the global 
    51615195@* Bernstein-Sato polynomial of f and compute its multiplicity,
    51625196@* with the algorithm given by S and with the Groebner basis engine given by eng.
    5163 NOTE:  The annihilator of f^s in D[s] is needed and hence it is computed with the
     5197NOTE:  The annihilator of f^s in D[s] is needed and hence it is computed with the 
    51645198@*       algorithm by Briancon and Maisonobe. The value of a string S can be
    51655199@*       'alg1' (default) - for the algorithm 1 of [LM08]
     
    54085442proc checkRoot2 (ideal I, poly F, number a, list #)
    54095443"USAGE:  checkRoot2(I,f,a [,eng]);  I an ideal, f a poly, alpha a number, eng an optional int
    5410 ASSUME:  I is the annihilator of f^s in D[s], basering is D[s],
     5444ASSUME:  I is the annihilator of f^s in D[s], basering is D[s], 
    54115445@* that is basering and I are the output os Sannfs-like procedure,
    54125446@* f is a polynomial in K[_x] and alpha is a rational number.
    5413 RETURN:  int, the multiplicity of -alpha as a root of the BS polynomial of f.
     5447RETURN:  int, the multiplicity of -alpha as a root of the BS polynomial of f. 
    54145448PURPOSE: check whether a rational number alpha is a root of the global Bernstein-
    54155449@* Sato polynomial of f and compute its multiplicity from the known Ann F^s in D[s]
     
    54235457{
    54245458
    5425 
     5459 
    54265460  // to check: alpha is rational (has char 0 check inside)
    54275461  if (!isRational(a))
     
    55585592ASSUME:  checkFactor is called from the basering, created by Sannfs-like proc,
    55595593@* that is, from the Weyl algebra in x1,..,xN,d1,..,dN tensored with K[s].
    5560 @* The ideal I is the annihilator of f^s in D[s], that is the ideal, computed
     5594@* The ideal I is the annihilator of f^s in D[s], that is the ideal, computed 
    55615595@* by Sannfs-like procedure (usually called LD there).
    55625596@* Moreover, f is a polynomial in K[x1,..,xN] and qs is a polynomial in K[s].
    55635597RETURN:  int, 1 if qs is a factor of the global Bernstein polynomial of f and 0 otherwise
    5564 PURPOSE: check whether a univariate polynomial qs is a factor of the
     5598PURPOSE: check whether a univariate polynomial qs is a factor of the 
    55655599@*  Bernstein-Sato polynomial of f without explicit knowledge of the latter.
    55665600NOTE:    If eng <>0, @code{std} is used for Groebner basis computations,
     
    56095643  dbprint(ppl,"// -1-3- _x,_Dx are eliminated");
    56105644  dbprint(ppl-1, K);
    5611   //q is a factor of bs iff K = < q >
     5645  //q is a factor of bs if and only if K = < q >
    56125646  //K = normalize(K);
    56135647  //q = normalize(q);
     
    56595693"USAGE:  indAR(L,n);  list L, int n
    56605694RETURN:  list
    5661 PURPOSE: computes arrangement inductively, using L and
     5695PURPOSE: computes arrangement inductively, using L and 
    56625696@* var(n) as the next variable
    56635697ASSUME: L has a structure of an arrangement
     
    57075741
    57085742proc isRational(number n)
    5709 "USAGE:  isRational(n); n number
     5743"USAGE:  isRational(n); n number 
    57105744RETURN:  int
    57115745PURPOSE: determine whether n is a rational number,
  • Singular/LIB/dmodapp.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: dmodapp.lib,v 1.28 2009-04-14 11:52:54 Singular Exp $";
     2version="$Id: dmodapp.lib,v 1.29 2009-04-15 11:11:34 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    77@*             Daniel Andres, daniel.andres@math.rwth-aachen.de
    88
    9 GUIDE: Let K be a field of characteristic 0, R = K[x1,..xN] and
     9GUIDE: Let K be a field of characteristic 0, R = K[x1,..xN] and 
    1010@* D be the Weyl algebra in variables x1,..xN,d1,..dN.
    1111@* In this library there are the following procedures for algebraic D-modules:
    1212@* - localization of a holonomic module D/I with respect to a mult. closed set
    13 @* of all powers of a given polynomial F from R. Our aim is to compute an
    14 @* ideal L in D, such that D/L is a presentation of a localized module. Such L
    15 @* always exists, since such localizations are known to be holonomic and thus
     13@* of all powers of a given polynomial F from R. Our aim is to compute an 
     14@* ideal L in D, such that D/L is a presentation of a localized module. Such L 
     15@* always exists, since such localizations are known to be holonomic and thus 
    1616@* cyclic modules. The procedures for the localization are DLoc,SDLoc and DLoc0.
    1717@*
    1818@* - annihilator in D of a given polynomial F from R as well as
    19 @* of a given rational function G/F from Quot(R). These can be computed via
     19@* of a given rational function G/F from Quot(R). These can be computed via 
    2020@* procedures annPoly resp. annRat.
    2121@*
    22 @* - initial form and initial ideals in Weyl algebras with respect to a given
     22@* - initial form and initial ideals in Weyl algebras with respect to a given 
    2323@* weight vector can be computed with  inForm, initialMalgrange, initialIdealW.
    2424@*
    25 @* - appelF1, appelF2 and appelF4 return ideals in parametric Weyl algebras,
     25@* - appelF1, appelF2 and appelF4 return ideals in parametric Weyl algebras, 
    2626@* which annihilate corresponding Appel hypergeometric functions.
    2727
    28 REFERENCES:
    29 @* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric
     28REFERENCES: 
     29@* (SST) Saito, Sturmfels, Takayama 'Groebner Deformations of Hypergeometric 
    3030@*         Differential Equations', Springer, 2000
    3131@* (ONW) Oaku, Takayama, Walther 'A Localization Algorithm for D-modules', 2000
     
    5151appelF4();      create an ideal annihilating Appel F4 function
    5252engine(I,i);     computes a Groebner basis with the algorithm given by i
    53 poly2list(f);   decompose a poly to a list of terms and exponents
     53poly2list(f);   decompose a polynomial into a list of terms and exponents
    5454fl2poly(L,s);  reconstruct a monic univariate polynomial from its factorization
    5555insertGenerator(id,p[,k]); insert an element into an ideal/module
     
    6868LIB "gkdim.lib";
    6969
     70// todo: complete and include into above list
     71// charVariety(I);       compute the characteristic variety of the ideal I
     72// charInfo(); ???
     73
     74
     75///////////////////////////////////////////////////////////////////////////////
     76// testing for consistency of the library:
     77proc testdmodapp()
     78{
     79  example initialIdealW;
     80  example initialMalgrange;
     81  example DLoc;
     82  example DLoc0;
     83  example SDLoc;
     84  example inForm;
     85  example isFsat;
     86  example annRat;
     87  example annPoly;
     88  example appelF1;
     89  example appelF2;
     90  example appelF4;
     91  example poly2list;
     92  example fl2poly;
     93  example insertGenerator;
     94  example deleteGenerator;
     95  example bFactor;
     96}
     97
    7098proc inForm (ideal I, intvec w)
    7199"USAGE:  inForm(I,w);  I ideal, w intvec
    72 RETURN:  the initial form of I wrt the weight vector w
    73 PURPOSE: computes the initial form of an ideal wrt a given weight vector
     100RETURN:  the initial form of I w.r.t. the weight vector w
     101PURPOSE: computes the initial form of an ideal w.r.t. a given weight vector
    74102NOTE:  the size of the weight vector must be equal to the number of variables
    75103@*     of the basering.
     
    251279"USAGE:  appelF1();
    252280RETURN:  ring  (and exports an ideal into it)
    253 PURPOSE: define the ideal in a parametric Weyl algebra,
     281PURPOSE: define the ideal in a parametric Weyl algebra, 
    254282@* which annihilates Appel F1 hypergeometric function
    255283NOTE: the ideal called  IAppel1 is exported to the output ring
     
    282310"USAGE:  appelF2();
    283311RETURN:  ring (and exports an ideal into it)
    284 PURPOSE: define the ideal in a parametric Weyl algebra,
     312PURPOSE: define the ideal in a parametric Weyl algebra, 
    285313@* which annihilates Appel F2 hypergeometric function
    286314NOTE: the ideal called  IAppel2 is exported to the output ring
     
    312340"USAGE:  appelF4();
    313341RETURN:  ring  (and exports an ideal into it)
    314 PURPOSE: define the ideal in a parametric Weyl algebra,
     342PURPOSE: define the ideal in a parametric Weyl algebra, 
    315343@* which annihilates Appel F4 hypergeometric function
    316344NOTE: the ideal called  IAppel4 is exported to the output ring
     
    416444NOTE:    In the basering, the following objects are exported:
    417445@* the ideal LD0 (in Groebner basis) is the presentation of the localization
    418 @* the list BS contains roots with multiplicities of Bernstein poly of (D/I)_f.
     446@* the list BS contains roots with multiplicities of Bernstein polynomial of (D/I)_f.
    419447DISPLAY: If printlevel=1, progress debug messages will be printed,
    420448@*       if printlevel>=2, all the debug messages will be printed.
     
    432460    ERROR("Basering is not a Weyl algebra");
    433461  }
    434   if (defined(LD0) || defined(BS))
     462  if (defined(LD0) || defined(BS)) 
    435463  {
    436464    ERROR("Reserved names LD0 and/or BS are used. Please rename the objects.");
     
    472500"USAGE:  DLoc0(I, F);  I an ideal, F a poly
    473501RETURN:  ring
    474 PURPOSE: compute the presentation of the localization of D/I w.r.t. f^s,
     502PURPOSE: compute the presentation of the localization of D/I w.r.t. f^s, 
    475503@*           where D is a Weyl Algebra, based on the output of procedure SDLoc
    476504ASSUME: the basering is similar to the output ring of SDLoc procedure
    477505NOTE:    activate this ring with the @code{setring} command. In this ring,
    478506@* the ideal LD0 (in Groebner basis) is the presentation of the localization
    479 @* the list BS contains roots and multiplicities of Bernstein poly of (D/I)_f.
     507@* the list BS contains roots and multiplicities of Bernstein polynomial of (D/I)_f.
    480508DISPLAY: If printlevel=1, progress debug messages will be printed,
    481509@*       if printlevel>=2, all the debug messages will be printed.
     
    706734  gkdim(I); // 3
    707735  def W = SDLoc(I,F);  setring W; // creates ideal LD in W = R[s]
    708   def U = DLoc0(LD, x2-y3);  setring U; // compute in R
     736  def U = DLoc0(LD, x2-y3);  setring U; // compute in R 
    709737  LD0; // Groebner basis of the presentation of localization
    710738  BS; // description of b-function for localization
     
    921949  setring R;
    922950  poly F = x2-y3;
    923   ideal I = Dx*F, Dy*F;
     951  ideal I = Dx*F, Dy*F; 
    924952  // note, that I is not holonomic, since it's dimension is not 2
    925953  gkdim(I); // 3, while dim R = 4
     
    12771305      if (inp1 == "ideal")
    12781306      {
    1279         ERROR("second argument has to be a poly if first argument is an ideal");
     1307        ERROR("second argument has to be a polynomial if first argument is an ideal");
    12801308      }
    12811309      else { vector f = #[2]; }
     
    13771405RETURN:  poly
    13781406PURPOSE: reconstruct a monic polynomial in one variable from its factorization
    1379 ASSUME:  s is a string with the name of some variable and
     1407ASSUME:  s is a string with the name of some variable and 
    13801408@*         L is supposed to consist of two entries:
    13811409@*         L[1] of the type ideal with the roots of a polynomial
     
    14361464proc initialIdealW (ideal I, intvec u, intvec v, list #)
    14371465"USAGE:  initialIdealW(I,u,v [,s,t]);  I ideal, u,v intvecs, s,t optional ints
    1438 RETURN:  ideal, GB of initial ideal of the input ideal wrt the weights u and v
     1466RETURN:  ideal, GB of initial ideal of the input ideal w.r.t. the weights u and v
    14391467ASSUME:  The basering is the n-th Weyl algebra in characteristic 0 and  for all
    14401468@*       1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the
    1441 @*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n),
     1469@*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 
    14421470@*       where D(i) is the differential operator belonging to x(i).
    14431471PURPOSE: computes the initial ideal with respect to given weights.
     
    14951523    }
    14961524  }
    1497 
     1525 
    14981526  // 1. create  homogenized Weyl algebra
    14991527  // 1.1 create ordering
     
    15651593"USAGE:  initialMalgrange(f,[,s,t,v]); f poly, s,t optional ints, v opt. intvec
    15661594RETURN:  ring, the Weyl algebra induced by basering, extended by two new vars
    1567 PURPOSE: computes the initial Malgrange ideal of a given poly wrt the weight
     1595PURPOSE: computes the initial Malgrange ideal of a given polynomial w.r.t. the weight
    15681596@*       vector (-1,0...,0,1,0,...,0) such that the weight of t is -1 and the
    15691597@*       weight of Dt is 1.
     
    18251853  {
    18261854    dbprint(ppl,"// found no roots");
    1827   }
     1855  } 
    18281856  L = list(II,mm);
    18291857  if (ir <> 1)
     
    18341862    L = L + list(string(ir));
    18351863  }
    1836   else
     1864  else 
    18371865  {
    18381866    dbprint(ppl,"// no irreducible factors found");
    1839   }
     1867  } 
    18401868  setring save;
    18411869  L = imap(@S,L);
     
    18471875  ring r = 0,(x,y),dp;
    18481876  bFactor((x^2-1)^2);
    1849   bFactor((x^2+1)^2);
     1877  bFactor((x^2+1)^2); 
    18501878  bFactor((y^2+1/2)*(y+9)*(y-7));
    18511879}
  • Singular/LIB/elim.lib

    r40c648 r3754ca  
    1 // $Id: elim.lib,v 1.30 2009-04-14 12:00:14 Singular Exp $
     1// $Id: elim.lib,v 1.31 2009-04-15 11:11:34 seelisch Exp $
    22// (GMG, modified 22.06.96)
    33// GMG, last modified 30.10.08: new procedure elimRing;
     
    1010// and can now choose as method slimgb or std.
    1111///////////////////////////////////////////////////////////////////////////////
    12 version="$Id: elim.lib,v 1.30 2009-04-14 12:00:14 Singular Exp $";
     12version="$Id: elim.lib,v 1.31 2009-04-15 11:11:34 seelisch Exp $";
    1313category="Commutative Algebra";
    1414info="
     
    223223  //------------------ set resp. compute ring weights ----------------------
    224224  int ii;
    225   intvec @w=1:nvarBR;     //to store weights of all variables
     225  intvec @w;              //to store weights of all variables
     226  @w[nvarBR] = 0;
     227  @w = @w + 1;            //initialize @w as 1..1
    226228  string str = "a";       //default for specifying elimination ordering
    227229  if (size(#) == 0)       //default values
     
    248250       @w = #[1];              //take the given weights
    249251       str = #[2];             //string for specifying elimination ordering
     252
    250253    }
    251254    if ( typeof(#[1]) == "string" and typeof(#[2]) == "intvec" )
     
    277280        {
    278281           int local = (var(ii) < 1);
    279         }
     282         }
    280283     }
    281284     else
     
    373376
    374377    //define now the first a-block of the form a(w1,0..0)
    375     intvec @v=0:nvarBR;
     378    intvec @v;
     379    @v[nvarBR] = 0;
    376380    @v = @v+w1;
    377381    B3[1] = list("a", @v);
     
    416420@*      If the variables in the basering have weights these weights are used
    417421        in elimRing. If a string \"withWeigts\" as (optional) argument is given
    418         Singular computes weights for the variables to make the input as
     422        @sc{Singular} computes weights for the variables to make the input as
    419423        homogeneous as possible.
    420424@*      The method is different from that used by eliminate and elim1;
  • Singular/LIB/equising.lib

    r40c648 r3754ca  
    1 version="$Id: equising.lib,v 1.19 2008-10-06 17:34:18 Singular Exp $";
     1version="$Id: equising.lib,v 1.20 2009-04-15 11:11:35 seelisch Exp $";
    22category="Singularities";
    33info="
     
    19211921  l[1]=ESSring is a ring extension of basering containing the ideal ES
    19221922        (describing the ES-stratum), the ideal ES_all_triv (describing the
    1923         part with trival equimultiple sections) and the poly p_F=F,
     1923        part with trival equimultiple sections) and the polynomial p_F=F,
    19241924  l[2]=1 if some error has occured,  l[2]=0 otherwise.
    19251925@end format
  • Singular/LIB/findifs.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: findifs.lib,v 1.6 2009-04-06 17:43:33 motsak Exp $";
     2version="$Id: findifs.lib,v 1.7 2009-04-15 11:11:35 seelisch Exp $";
    33category="Applications";
    44info="
     
    1212
    1313PROCEDURES:
    14 decoef(P,n);  decompose poly P into summands with respect to the number n
     14decoef(P,n);  decompose polynomial P into summands with respect to the number n
    1515difpoly2tex(S,P[,Q]); present the difference scheme in the nodal form
    1616
     
    333333"USAGE:  decoef(P,n);  P a poly, n a number
    334334RETURN:  ideal
    335 PURPOSE:  decompose poly P into summands with respect
     335PURPOSE:  decompose polynomial P into summands with respect
    336336to the  presence of a number n in the coefficients
    337337NOTE:    n is usually a parameter with no power
    338338EXAMPLE: example decoef; shows examples
    339339"{
    340   // decomposes poly into summands
    341   // wrt the presence of a number n in coeffs
     340  // decomposes polynomial into summands
     341  // w.r.t. the presence of a number n in coeffs
    342342  // returns ideal
    343343  def br = basering;
     
    718718 poly   p = S[4,1]; // by elimination of module components
    719719 list L; L[1]=A;L[2] = B;
    720  ideal I = decoef(p,dt); // make splitting wrt the appearance of dt
     720 ideal I = decoef(p,dt); // make splitting w.r.t. the appearance of dt
    721721 "* Create the nodal of the scheme in TeX format: ";
    722722 " ideal I = decoef(p,dt);";
  • Singular/LIB/freegb.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: freegb.lib,v 1.23 2009-04-14 12:08:36 Singular Exp $";
     2version="$Id: freegb.lib,v 1.24 2009-04-15 11:13:09 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    66AUTHOR: Viktor Levandovskyy,     levandov@math.rwth-aachen.de
    77
    8 THEORY: See chapter 'LETTERPLACE' in the Singular Manual.
     8THEORY: See chapter 'LETTERPLACE' in the @sc{Singular} Manual.
    99
    1010PROCEDURES:
     
    4242PURPOSE: sets attributes for a letterplace ring:
    4343@*      'isLetterplaceRing' = true, 'uptodeg' = d, 'lV' = b, where
    44 @*      'uptodeg' stands for the degree bound,
     44@*      'uptodeg' stands for the degree bound, 
    4545@*      'lV' for the number of variables in the block 0.
    4646NOTE: Activate the resulting ring by using @code{setring}
     
    5454    // Set letterplace-specific attributes for the output ring!
    5555  attrib(R, "uptodeg", uptodeg);
    56   attrib(R, "lV", lV);
    57   attrib(R, "isLetterplaceRing", 1);
    58   return (R);
     56  attrib(R, "lV", lV); 
     57  attrib(R, "isLetterplaceRing", 1); 
     58  return (R); 
    5959}
    6060example
     
    7373{
    7474  // FINALLY IMPLEMENTED AS A PART OT THE CODE
    75   // shifts a poly from the ring @R to s positions
     75  // shifts a polynomial from the ring R to s positions
    7676  // M lives in varing, the result in lpring
    7777  // to be run from varing
     
    347347"USAGE:  isVar(p);  poly p
    348348RETURN:  int
    349 PURPOSE: check, whether leading monomial of p is a power of a single variable
     349PURPOSE: check, whether leading monomial of p is a power of a single variable 
    350350@* from the basering. Returns the exponent or 0 if p is multivariate.
    351351EXAMPLE: example isVar; shows examples
     
    21302130  def R = makeLetterplaceRing(d);
    21312131  setring R;
    2132   int uptodeg = d;
    2133   int lV = 2;
     2132  int uptodeg = d; 
     2133  int lV = 2; 
    21342134  def R = setLetterplaceAttributes(r,uptodeg,2); // supply R with letterplace structure
    21352135  setring R;
     
    23262326static proc strList2poly(list L)
    23272327{
    2328   //  list L comes from sent2lplace (which takes a poly on the input)
     2328  //  list L comes from sent2lplace (which takes a polynomial as input)
    23292329  // each entry of L is a sublist with the coef on the last place
    23302330  int s = size(L); int t;
  • Singular/LIB/general.lib

    r40c648 r3754ca  
    33//eric, added absValue 11.04.2002
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: general.lib,v 1.60 2009-04-07 09:30:44 seelisch Exp $";
     5version="$Id: general.lib,v 1.61 2009-04-15 11:14:16 seelisch Exp $";
    66category="General purpose";
    77info="
     
    10381038           polynomials have to be put into eval(...) in order to be
    10391039           interpreted correctly
    1040          * a second Singular process is started by this procedure
     1040         * a second @sc{Singular} process is started by this procedure
    10411041EXAMPLE: example watchdog; shows an example
    10421042"
  • Singular/LIB/hnoether.lib

    r40c648 r3754ca  
    1 version="$Id: hnoether.lib,v 1.58 2008-09-24 07:54:59 Singular Exp $";
     1version="$Id: hnoether.lib,v 1.59 2009-04-15 11:14:36 seelisch Exp $";
    22// (GMG, last modified 08.06.08: comments to Newton non-degenerate added)
    33///////////////////////////////////////////////////////////////////////////////
     
    3838 puiseux2generators(m,n);   convert Puiseux pairs to generators of semigroup
    3939 separateHNE(hne1,hne2);    number of quadratic transf. needed for separation
    40  squarefree(f);             a squarefree divisor of the poly f
    41  allsquarefree(f,l);        the maximal squarefree divisor of the poly f
     40 squarefree(f);             a squarefree divisor of the polynomial f
     41 allsquarefree(f,l);        the maximal squarefree divisor of the polynomial f
    4242 further_hn_proc();         show further procedures useful for interactive use
    4343
     
    7373 T1_Transform(f,d,M); returns f(x,y+d*x^M)  (f: poly,d:number,M:int)
    7474 T2_Transform(f,d,M,N,ref);   a composition of T1 & T
    75  koeff(f,I,J);       gets coefficient of indicated monomial of poly f
     75 koeff(f,I,J);       gets coefficient of indicated monomial of polynomial f
    7676 redleit(f,S,E);     restriction of monomials of f to line (S-E)
    7777 leit(f,n,m);        special case of redleit (for irred. polynomials)
     
    8585
    8686//       static procedures not useful for interactive use:
    87 // polytest(f);        tests coefficients and exponents of poly f
     87// polytest(f);        tests coefficients and exponents of polynomial f
    8888// extractHNEs(H,t);   extracts output H of HN to output of hnexpansion
    8989// HN(f,grenze);       recursive subroutine for hnexpansion
     
    691691    kill zweitring;
    692692    nm = getnm(f);             // N,M haben sich evtl. veraendert
    693     N = nm[1]; M = nm[2];      // Berechne Schnittpunkte Newtonpoly mit Achsen
     693    N = nm[1]; M = nm[2];      // Berechne Schnittpunkte Newtonpolynom mit Achsen
    694694    if (defined(HNDebugOn)) {"I continue with the polynomial",f; }
    695695   }
     
    716716    f=test_sqr;
    717717    nm = getnm(f);              // N,M haben sich veraendert
    718     N = nm[1]; M = nm[2];       // Berechne Schnittpunkte Newtonpoly mit Achsen
     718    N = nm[1]; M = nm[2];       // Berechne Schnittpunkte Newtonpolynom mit Achsen
    719719    if (defined(HNDebugOn)) {"I continue with the polynomial",f; }
    720720   }
     
    733733  }
    734734  if (defined(HNDebugOn)) {
    735    if (getauscht) {"x<->y were exchanged; poly is now ",f;}
     735   if (getauscht) {"x<->y were exchanged; polynomial is now ",f;}
    736736   else           {"x , y were not exchanged";}
    737737   "M resp. N are now",M,N;
     
    12991299"
    13001300{
    1301  // INPUT = poly or ring
     1301 // INPUT = polynomial or ring
    13021302 if (typeof(#[1])=="poly") {
    13031303   list L=hnexpansion(#[1]);
     
    23902390NOTE:    The main purpose is that if the line defined by S and E is part of the
    23912391         Newton polygon, the result is the quasihomogeneous leading form of f
    2392          wrt. that line.
     2392         w.r.t. that line.
    23932393SEE ALSO: newtonpoly
    23942394EXAMPLE: example redleit;  shows an example
     
    27142714         If the computation of the HNE required a field extension, the first
    27152715         entry @code{L[1]} of the list is a ring, in which a list @code{hne}
    2716          of lists (the HN data, as above) and a poly @code{f} (image of
     2716         of lists (the HN data, as above) and a polynomial @code{f} (image of
    27172717         @code{f} over the new field) are stored.
    27182718         @*
     
    40264026 }
    40274027 else {
    4028   HNEs[1]=list(hqs)+azeilen+list(fneu); // fneu ist transform. Poly oder Null
     4028  HNEs[1]=list(hqs)+azeilen+list(fneu); // fneu ist transform. Polynom oder Null
    40294029  conj1[1]=conj_factor;
    40304030 }
  • Singular/LIB/inout.lib

    r40c648 r3754ca  
    11// (GMG/BM, last modified 22.06.96)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: inout.lib,v 1.33 2009-04-07 09:30:44 seelisch Exp $";
     3version="$Id: inout.lib,v 1.34 2009-04-15 11:14:36 seelisch Exp $";
    44category="General purpose";
    55info="
     
    1010 lprint(poly/...[,n]);  display poly/... fitting to pagewidth [size n]
    1111 pmat(matrix[,n]);      print form-matrix [first n chars of each colum]
    12  rMacaulay(string);     read Macaulay_1 output and return its Singular format
     12 rMacaulay(string);     read Macaulay_1 output and return its @sc{Singular} format
    1313 show(any);             display any object in a compact format
    1414 showrecursive(id,p);   display id recursively with respect to variables in p
     
    672672RETURN:  no return value
    673673NOTE:    The syntax of writelist is similar to the syntax of the
    674          write command of Singular which does not manage lists properly.
     674         write command of @sc{Singular} which does not manage lists properly.
    675675         If (file,name) = (\"listfile\",\"L1\"),  writelist creates (resp.
    676676         appends if listfile exists) a file with name listfile and stores
    677          there the list L under the name L1. The Singular command
    678          execute(read(\"listfile\")); assigns the content of L (stored in
     677         there the list L under the name L1. The @sc{Singular} command
     678         @code{execute(read(\"listfile\"))}; assigns the content of L (stored in
    679679         listfile) to a list L1.
    680680@*       On a UNIX system, write(\">file\",...) overwrites an existing file
  • Singular/LIB/involut.lib

    r40c648 r3754ca  
    1 version="$Id: involut.lib,v 1.17 2009-04-14 08:26:08 Singular Exp $";
     1version="$Id: involut.lib,v 1.18 2009-04-15 11:14:36 seelisch Exp $";
    22category="Noncommutative";
    33info="
     
    182182
    183183static proc In_Poly(poly mm, list l, int NVars)
    184 // applies the involution to the poly mm
     184// applies the involution to the polynomial mm
    185185// entries of a list l are images of variables under invo
    186186// more general than invo_poly; used in many rings setting
     
    210210
    211211static proc Hom_Poly(poly mm, list l, int NVars)
    212 // applies the endomorphism to the poly mm
     212// applies the endomorphism to the polynomial mm
    213213// entries of a list l are images of variables under endo
    214214// should not be replaced by map-based stuff! used in
  • Singular/LIB/kskernel.lib

    r40c648 r3754ca  
    11////////////////////////////////////////////////////////////////
    2 version="$Id: kskernel.lib,v 1.3 2007-06-20 15:30:11 Singular Exp $";
     2version="$Id: kskernel.lib,v 1.4 2009-04-15 11:14:36 seelisch Exp $";
    33category="General purpose";
    44info="
     
    7373// M is a sorted matrix of triples {i,j,k(i,j)}
    7474// returns a list of coefficients of p
    75 // wrt. the base {x^i y^j,(i,j) in (M[i,j,k])}=B_u
     75// w.r.t. the base {x^i y^j,(i,j) in (M[i,j,k])}=B_u
    7676proc MonoDec(poly p, matrix M)
    7777{
     
    295295RETURN:  nothing; but replaces elements of the matrix KSkernel
    296296         in the ring Ksring with their leading monomials
    297          wrt. the local ordering (ls)
     297         w.r.t. the local ordering (ls)
    298298EXAMPLE: example KSlinear; shows an example
    299299"
  • Singular/LIB/latex.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: latex.lib,v 1.34 2009-04-14 17:23:25 Singular Exp $";
     2version="$Id: latex.lib,v 1.35 2009-04-15 11:14:36 seelisch Exp $";
    33category="Visualization";
    44info="
     
    1111 tex(fnm)            calls LaTeX2e for LaTeX-file fnm
    1212 texdemo([n])        produces a file explaining the features of this lib
    13  texfactorize(fnm,f) creates string in LaTeX-format for factors of poly f
     13 texfactorize(fnm,f) creates string in LaTeX-format for factors of polynomial f
    1414 texmap(fnm,m,r1,r2) creates string in LaTeX-format for map m:r1->r2
    1515 texname(fnm,s)      creates string in LaTeX-format for identifier
     
    590590\"(\" + int + \",\" + s' + \")\" --> \"_@{\"+ int +\"@}\" + \"^@{\" + s'+\"@}\"
    591591@end example
    592          Furthermore, strings which begin with a left brace are modified
     592         Furthermore, strings which begin with a @code{\"@{\"} are modified
    593593         by deleting the first and the last character (which is then assumed to
    594          be a right brace).
     594         be a @code{\"@}\"}}.
    595595
    596596         if @code{fname!=\"\"}: append the transformed string s to the file
     
    13411341proc texpoly(string fname,def p,list #)
    13421342"USAGE:   texpoly(fname,p); fname string, p poly
    1343 RETURN:  if @code{fname=\"\"}: string, the poly p in LaTeX-typesetting;@*
     1343RETURN:  if @code{fname=\"\"}: string, the polynomial p in LaTeX-typesetting;@*
    13441344         otherwise: append this string to the file @code{<fname>}, and
    13451345         return nothing.
     
    13721372  { " -- Call  texmap  instead "; return();}
    13731373  if (typeof(p)  == "link" or typeof(p) == "list" or typeof(p) == "resolution")
    1374   { " -- Object can not translated into tex "; return();}
     1374  { " -- Object cannot translated into tex "; return();}
    13751375
    13761376  if (!(defined(TeXdisplay))){ lnbreak = "\\\\[2mm]" + newline;}
     
    18671867"\\\\" +  nl +
    18681868"{\\tt  texfactorize(fnm,f);} & creates string in \\LaTeX-format for
    1869 factors of poly f"+ "\\\\" +  nl +
     1869factors of polynomial f"+ "\\\\" +  nl +
    18701870"{\\tt  texmap(fnm,m,r1,r2);} & creates string in \\LaTeX-format for
    18711871map m:r1$\\rightarrow$r2"+ "\\\\" +  nl +
     
    19841984// write(fname,"\\Line");
    19851985
    1986 // -1b------ still in the same ring, a poly with rational coefs --------
     1986// -1b------ still in the same ring, a polynomial with rational coefs --------
    19871987write(fname,
    19881988" A polynomial with rational coefficients.
  • Singular/LIB/linalg.lib

    r40c648 r3754ca  
    11//GMG last modified: 04/25/2000
    22//////////////////////////////////////////////////////////////////////////////
    3 version="$Id: linalg.lib,v 1.40 2009-04-07 16:18:05 seelisch Exp $";
     3version="$Id: linalg.lib,v 1.41 2009-04-15 11:27:06 seelisch Exp $";
    44category="Linear Algebra";
    55info="
     
    565565  }
    566566
    567   //var can not be in A
     567  //var cannot be in A
    568568  s="Wp(";
    569569  for( i=1; i<=nvars(BR); i++ ){
  • Singular/LIB/modstd.lib

    r40c648 r3754ca  
    11//GP, last modified 23.10.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: modstd.lib,v 1.14 2007-07-20 10:02:38 Singular Exp $";
     3version="$Id: modstd.lib,v 1.15 2009-04-15 11:14:36 seelisch Exp $";
    44category="Commutative Algebra";
    55info="
     
    9595  }
    9696  //================= delete unlucky primes ====================
    97   // unlucky iff the leading ideal is wrong
     97  // unlucky if and only if the leading ideal is wrong
    9898  list LL=deleteUnluckyPrimes(T,L);
    9999  T=LL[1];
     
    240240  }
    241241  //================= delete unlucky primes ====================
    242   // unlucky iff the leading ideal is wrong
     242  // unlucky if and only if the leading ideal is wrong
    243243  list LL=deleteUnluckyPrimes(T,L);
    244244  T=LL[1];
  • Singular/LIB/ncalg.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ncalg.lib,v 1.33 2009-04-15 08:17:58 Singular Exp $";
     2version="$Id: ncalg.lib,v 1.34 2009-04-15 11:28:08 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    588588ASSUME: This procedure uses toric_lib and therefore inherits its input requirements:
    589589@*        possible values for input variable @code{alg} are: \"ect\",\"pt\",\"blr\", \"hs\", \"du\".
    590 @*        As for the term ordering, it should be a string @code{sord} in Singular format like \"lp\",\"dp\", etc.
     590@*        As for the term ordering, it should be a string @code{sord} in @sc{Singular} format like \"lp\",\"dp\", etc.
    591591@*        Please consult the toric_lib for allowed orderings and more details.
    592592SEE ALSO: toric_lib
  • Singular/LIB/nctools.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: nctools.lib,v 1.51 2009-04-14 13:31:39 Singular Exp $";
     2version="$Id: nctools.lib,v 1.52 2009-04-15 11:18:07 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    551551  // internal documentation, for tests etc
    552552  // 1st arg: v an optional integer (if v!=0, will be verbose)
    553   // if the second argument is given, produces ndc wrt powers x^N
     553  // if the second argument is given, produces ndc w.r.t. powers x^N
    554554  int N = 1;
    555555  int Verbose = 0;
     
    727727}
    728728
    729  
     729
    730730
    731731///////////////////////////////////////////////////////////////////////////////
     
    903903  {
    904904    print("Warning: Since the current ordering is not global there might be problems computing twostd(Q)!");
    905     "Q:";
     905    "Q:"; 
    906906    @Q;
    907907  }
  • Singular/LIB/normal.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: normal.lib,v 1.52 2009-04-10 13:34:00 Singular Exp $";
     2version="$Id: normal.lib,v 1.53 2009-04-15 11:15:56 seelisch Exp $";
    33category="Commutative Algebra";
    44info="
     
    1616 genus(I);           computes the geometric genus of a projective curve
    1717 primeClosure(L);    integral closure of R/p, p a prime ideal
    18  closureFrac(L);     write a poly in integral closure as element of Quot(R/p)
     18 closureFrac(L);     write a polynomial in integral closure as element of Quot(R/p)
    1919 iMult(L);           intersection multiplicity of the ideals of the list L
    2020
     
    13781378      ideal Ann = quotient(SM[2],SL[1]);
    13791379      ideal qAnn = simplify(reduce(Ann,SM[1]),2);
    1380       //NOTE: qAnn=0 iff first var (=SL[1]) not in SM is a nzd of R/SM
     1380      //NOTE: qAnn=0 if and only if first var (=SL[1]) not in SM is a nzd of R/SM
    13811381
    13821382   //------------- We found a non-zerodivisor of R/SM -----------------------
     
    29432943proc closureFrac(list L)
    29442944"USAGE:    closureFrac (L); L a list of size n+1 as in the result of
    2945           primeClosure, L[n] contains an additional poly f
     2945          primeClosure, L[n] contains an additional polynomial f
    29462946CREATE:   a list fraction of two elements of L[1], such that
    29472947          f=fraction[1]/fraction[2] via the injections phi L[i]-->L[i+1].
     
    41224122  J = fetch(R, J);
    41234123  J = interred(J);
    4124   poly D = getSmallest(J);    // Chooses the poly of smallest degree as
     4124  poly D = getSmallest(J);    // Chooses the polynomial of smallest degree as
    41254125                              // non-zerodivisor.
    41264126  if(dbg >= 1){
     
    46644664// and the others as parameters.
    46654665
    4666 // The degree is taken wrt the variables indicated in v.
     4666// The degree is taken w.r.t. the variables indicated in v.
    46674667  int i;      // Counter
    46684668  int d = 0;  // The degree
     
    58485848THEORY:  The procedure can be used to test whether the computation of the
    58495849         normalization was correct: basering/i --> nor[1][1]/norid is the
    5850          normalization of basering/i iff v=1,1,0.
     5850         normalization of basering/i if and only if v=1,1,0.
    58515851NOTE:    For big examples it can be hard to fully test correctness; the
    58525852         partial test norTest(i,nor,2) is usually fast
     
    58665866
    58675867    //### make a copy of nor to have a cpoy of nor[1][1]  (not a reference to)
    5868     // in order not to overwrite norid and normap.
     5868    // in order not to override norid and normap.
    58695869    // delete nor[2] (if it contains the module generators, which are not used)
    58705870    // s.t. newnor does not belong to a ring.
  • Singular/LIB/poly.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: poly.lib,v 1.52 2009-04-07 09:30:44 seelisch Exp $";
     2version="$Id: poly.lib,v 1.53 2009-04-15 11:19:50 seelisch Exp $";
    33category="General purpose";
    44info="
     
    1818 mindeg1(poly/...);     int = [weighted] minimal degree of input
    1919 normalize(poly/...);   normalize poly/... such that leading coefficient is 1
    20  rad_con(p,I);          check radical containment of poly p in ideal I
     20 rad_con(p,I);          check radical containment of polynomial p in ideal I
    2121 content(f);            content of polynomial/vector f
    2222 numerator(n);          numerator of number n
  • Singular/LIB/polymake.lib

    r40c648 r3754ca  
    1 version="$Id: polymake.lib,v 1.16 2009-04-15 08:08:58 Singular Exp $";
     1version="$Id: polymake.lib,v 1.17 2009-04-15 11:26:29 seelisch Exp $";
    22category="Tropical Geometry";
    33info="
    4 LIBRARY:   polymake.lib    Computations with polytopes and fans,
     4LIBRARY:   polymake.lib    Computations with polytopes and fans, 
    55                           interface to polymake and TOPCOM
    66AUTHOR:    Thomas Markwig,  email: keilen@mathematik.uni-kl.de
     
    88WARNING:
    99   Most procedures will not work unless polymake or topcom is installed and
    10    if so, they will only work with the operating system LINUX!
     10   if so, they will only work with the operating system LINUX! 
    1111   For more detailed information see the following note or consult the
    1212   help string of the procedures.
    1313
    1414NOTE:
    15    Even though this is a Singular library for computing polytopes and fans
    16    such as the Newton polytope or the Groebner fan of a polynomial, most of
    17    the hard computations are NOT done by Singular but by the program
     15   Even though this is a @sc{Singular} library for computing polytopes and fans
     16   such as the Newton polytope or the Groebner fan of a polynomial, most of 
     17   the hard computations are NOT done by @sc{Singular} but by the program
    1818@* - polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt
    19 @*   (see http://www.math.tu-berlin.de/polymake/),
     19@*   (see http://www.math.tu-berlin.de/polymake/), 
    2020@* respectively (only in the procedure triangularions) by the program
    2121@* - topcom by Joerg Rambau, Universitaet Bayreuth (see http://www.uni-bayreuth.de/
    2222     departments/wirtschaftsmathematik/rambau/TOPCOM);
    2323@*   This library should rather be seen as an interface which allows to use a
    24      (very limited) number of options which polymake respectively topcom offers
    25      to compute with polytopes and fans and to make the results available in
    26      Singular for further computations;
    27      moreover, the user familiar with Singular does not have to learn the syntax
    28      of polymake or topcom, if the options offered here are sufficient for his
     24     (very limited) number of options which polymake respectively topcom offers 
     25     to compute with polytopes and fans and to make the results available in 
     26     @sc{Singular} for further computations;
     27     moreover, the user familiar with @sc{Singular} does not have to learn the syntax
     28     of polymake or topcom, if the options offered here are sufficient for his 
    2929     purposes.
    30 @*   Note, though, that the procedures concerned with planar polygons are
     30@*   Note, though, that the procedures concerned with planar polygons are 
    3131     independent of both, polymake and topcom.
    3232
     
    9595proc polymakePolytope (intmat polytope,list #)
    9696"USAGE:  polymakePolytope(polytope[,#]);   polytope list, # string
    97 ASSUME:  each row of polytope gives the coordinates of a lattice point of a
    98          polytope with their affine coordinates as given by the output of
     97ASSUME:  each row of polytope gives the coordinates of a lattice point of a 
     98         polytope with their affine coordinates as given by the output of 
    9999         secondaryPolytope
    100 PURPOSE: the procedure calls polymake to compute the vertices of the polytope
     100PURPOSE: the procedure calls polymake to compute the vertices of the polytope 
    101101         as well as its dimension and information on its facets
    102102RETURN:  list L with four entries
    103103@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    104                      of the polytope
     104                     of the polytope 
    105105@*            L[2] : the dimension of the polytope
    106106@*            L[3] : a list whose i-th entry explains to which vertices the
    107                      ith vertex of the Newton polytope is connected
    108                      -- i.e. L[3][i] is an integer vector and an entry k in
    109                         there means that the vertex L[1][i] is connected to the
     107                     ith vertex of the Newton polytope is connected 
     108                     -- i.e. L[3][i] is an integer vector and an entry k in 
     109                        there means that the vertex L[1][i] is connected to the 
    110110                        vertex L[1][k]
    111 @*            L[4] : an integer matrix whose rows mulitplied by
    112                      (1,var(1),...,var(nvar)) give a linear system of equations
     111@*            L[4] : an integer matrix whose rows mulitplied by 
     112                     (1,var(1),...,var(nvar)) give a linear system of equations 
    113113                     describing the affine hull of the polytope,
    114114                     i.e. the smallest affine space containing the polytope
    115 NOTE: -  for its computations the procedure calls the program polymake by
    116          Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt;
    117          it therefore is necessary that this program is installed in order
     115NOTE: -  for its computations the procedure calls the program polymake by 
     116         Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt; 
     117         it therefore is necessary that this program is installed in order 
    118118         to use this procedure;
    119119         see http://www.math.tu-berlin.de/polymake/
    120 @*    -  note that in the vertex edge graph we have changed the polymake
    121          convention which starts indexing its vertices by zero while we start
     120@*    -  note that in the vertex edge graph we have changed the polymake 
     121         convention which starts indexing its vertices by zero while we start 
    122122         with one !
    123 @*    -  the procedure creates the file  /tmp/polytope.polymake which contains
    124          the polytope in polymake format; if you wish to use this for further
    125          computations with polymake, you have to use the procedure
     123@*    -  the procedure creates the file  /tmp/polytope.polymake which contains 
     124         the polytope in polymake format; if you wish to use this for further 
     125         computations with polymake, you have to use the procedure 
    126126         polymakeKeepTmpFiles in before
    127127@*    -  moreover, the procedure creates the file /tmp/polytope.output which
    128128         it deletes again before ending
    129129@*    -  it is possible to provide an optional second argument a string
    130          which then will be used instead of 'polytope' in the name of the
     130         which then will be used instead of 'polytope' in the name of the 
    131131         polymake output file
    132132EXAMPLE: example polymakePolytope;   shows an example"
     
    200200      }
    201201    }
    202   }
     202  } 
    203203  newveg=newveg[1,size(newveg)-1];
    204204  execute("list nveg="+newveg+";");
     
    235235   "EXAMPLE:";
    236236   echo=2;
    237    // the lattice points of the unit square in the plane
     237   // the lattice points of the unit square in the plane 
    238238   list points=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
    239239   // the secondary polytope of this lattice point configuration is computed
     
    261261                     of the Newton polytope of f
    262262@*            L[2] : the dimension of the Newton polytope of f
    263 @*            L[3] : a list whose ith entry explains to which vertices the
    264                      ith vertex of the Newton polytope is connected
    265                      -- i.e. L[3][i] is an integer vector and an entry k in
     263@*            L[3] : a list whose ith entry explains to which vertices the 
     264                     ith vertex of the Newton polytope is connected 
     265                     -- i.e. L[3][i] is an integer vector and an entry k in 
    266266                        there means that the vertex L[1][i] is
    267267                        connected to the vertex L[1][k]
    268 @*            L[4] : an integer matrix whose rows mulitplied by
    269                      (1,var(1),...,var(nvar)) give a linear system of equations
     268@*            L[4] : an integer matrix whose rows mulitplied by 
     269                     (1,var(1),...,var(nvar)) give a linear system of equations 
    270270                     describing the affine hull of the Newton polytope, i.e. the
    271271                     smallest affine space containing the Newton polytope
    272 NOTE: -  if we replace the first column of L[4] by zeros, i.e. if we move
    273          the affine hull to the origin, then we get the equations for the
    274          orthogonal comploment of the linearity space of the normal fan dual
     272NOTE: -  if we replace the first column of L[4] by zeros, i.e. if we move 
     273         the affine hull to the origin, then we get the equations for the 
     274         orthogonal comploment of the linearity space of the normal fan dual 
    275275         to the Newton polytope, i.e. we get the EQUATIONS that
    276276         we need as input for polymake when computing the normal fan
     
    278278         TU Berlin and Michael Joswig, so it only works if polymake is installed;
    279279         see http://www.math.tu-berlin.de/polymake/
    280 @*    -  the procedure creates the file  /tmp/newtonPolytope.polymake which
    281          contains the polytope in polymake format and which can be used for
     280@*    -  the procedure creates the file  /tmp/newtonPolytope.polymake which 
     281         contains the polytope in polymake format and which can be used for 
    282282         further computations with polymake
    283 @*    -  moreover, the procedure creates the file /tmp/newtonPolytope.output
     283@*    -  moreover, the procedure creates the file /tmp/newtonPolytope.output 
    284284         and deletes it again before ending
    285 @*    -  it is possible to give as an optional second argument a string
    286          which then will be used instead of 'newtonPolytope' in the name of
     285@*    -  it is possible to give as an optional second argument a string 
     286         which then will be used instead of 'newtonPolytope' in the name of 
    287287         the polymake output file
    288288EXAMPLE: example newtonPolytope;   shows an example"
    289289{
    290290  int i,j;
    291   // compute the list of exponent vectors of the polynomial,
     291  // compute the list of exponent vectors of the polynomial, 
    292292  // which are the lattice points
    293293  // whose convex hull is the Newton polytope of f
     
    320320   np[2];
    321321   // np[3] contains information how the vertices are connected to each other,
    322    // e.g. the first vertex (number 0) is connected to the second, third and
     322   // e.g. the first vertex (number 0) is connected to the second, third and 
    323323   //      fourth vertex
    324324   np[3][1];
     
    330330   np[1];
    331331   // its dimension is
    332    np[2];
    333    // the Newton polytope is contained in the affine space given
     332   np[2];   
     333   // the Newton polytope is contained in the affine space given 
    334334   //     by the equations
    335335   np[4]*M;
     
    340340proc newtonPolytopeLP (poly f)
    341341"USAGE:  newtonPolytopeLP(f);  f poly
    342 RETURN: list, the exponent vectors of the monomials occuring in f,
     342RETURN: list, the exponent vectors of the monomials occuring in f, 
    343343              i.e. the lattice points of the Newton polytope of f
    344344EXAMPLE: example normalFan;   shows an example"
     
    368368proc normalFan (intmat vertices,intmat affinehull,list graph,int er,list #)
    369369"USAGE:  normalFan (vert,aff,graph,rays,[,#]);   vert,aff intmat,  graph list, rays int, # string
    370 ASSUME:  - vert is an integer matrix whose rows are the coordinate of
    371            the vertices of a convex lattice polytope;
     370ASSUME:  - vert is an integer matrix whose rows are the coordinate of 
     371           the vertices of a convex lattice polytope; 
    372372@*       - aff describes the affine hull of this polytope, i.e.
    373            the smallest affine space containing it, in the following sense:
    374            denote by n the number of columns of vert, then multiply aff by
    375            (1,x(1),...,x(n)) and set the resulting terms to zero in order to
     373           the smallest affine space containing it, in the following sense: 
     374           denote by n the number of columns of vert, then multiply aff by 
     375           (1,x(1),...,x(n)) and set the resulting terms to zero in order to 
    376376           get the equations for the affine hull;
    377 @*       - the ith entry of graph is an integer vector describing to which
    378            vertices the ith vertex is connected, i.e. a k as entry means that
     377@*       - the ith entry of graph is an integer vector describing to which 
     378           vertices the ith vertex is connected, i.e. a k as entry means that 
    379379           the vertex vert[i] is connected to vert[k];
    380 @*       - the integer rays is either one (if the extreme rays should be
     380@*       - the integer rays is either one (if the extreme rays should be 
    381381           computed) or zero (otherwise)
    382 RETURN:  list, the ith entry of L[1] contains information about the cone in the
    383                normal fan dual to the ith vertex of the polytope
    384 @*             L[1][i][1] = integer matrix representing the inequalities which
     382RETURN:  list, the ith entry of L[1] contains information about the cone in the 
     383               normal fan dual to the ith vertex of the polytope 
     384@*             L[1][i][1] = integer matrix representing the inequalities which 
    385385                            describe the cone dual to the ith vertex
    386 @*             L[1][i][2] = a list which contains the inequalities represented
    387                             by L[i][1] as a list of strings, where we use the
     386@*             L[1][i][2] = a list which contains the inequalities represented 
     387                            by L[i][1] as a list of strings, where we use the 
    388388                            variables x(1),...,x(n)
    389389@*             L[1][i][3] = only present if 'er' is set to 1; in that case it is
    390                             an interger matrix whose rows are the extreme rays
     390                            an interger matrix whose rows are the extreme rays 
    391391                            of the cone
    392 @*             L[2] = is an integer matrix whose rows span the linearity space
    393                       of the fan, i.e. the linear space which is contained in
     392@*             L[2] = is an integer matrix whose rows span the linearity space 
     393                      of the fan, i.e. the linear space which is contained in 
    394394                      each cone
    395395NOTE:    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
    396            TU Berlin and Michael Joswig, so it only works if polymake is
     396           TU Berlin and Michael Joswig, so it only works if polymake is 
    397397           installed;
    398398           see http://www.math.tu-berlin.de/polymake/
    399 @*       - in the optional argument # it is possible to hand over other names
     399@*       - in the optional argument # it is possible to hand over other names 
    400400           for the variables to be used -- be careful, the format must be correct
    401401           which is not tested, e.g. if you want the variable names to be
     
    405405  list ineq; // stores the inequalities of the cones
    406406  int i,j,k;
    407   // we work over the following ring
     407  // we work over the following ring 
    408408  execute("ring ineqring=0,x(1.."+string(ncols(vertices))+"),lp;");
    409409  string greatersign=">";
     
    430430  for (i=1;i<=nrows(vertices);i++)
    431431  {
    432     // first we produce for each vertex in the polytope
     432    // first we produce for each vertex in the polytope 
    433433    // the inequalities describing the dual cone in the normal fan
    434     list pp;  // contain strings representing the inequalities
     434    list pp;  // contain strings representing the inequalities 
    435435              // describing the normal cone
    436     intmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities
     436    intmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities 
    437437                                                // as rows
    438     // consider all the vertices to which the ith vertex in the
     438    // consider all the vertices to which the ith vertex in the 
    439439    // polytope is connected by an edge
    440440    for (j=1;j<=size(graph[i]);j++)
    441441    {
    442442      // produce the vector ie_j pointing from the jth vertex to the ith vertex;
    443       // this will be the jth inequality for the cone in the normal fan dual to
     443      // this will be the jth inequality for the cone in the normal fan dual to 
    444444      // the ith vertex
    445445      ie[j,1..ncols(vertices)]=vertices[i,1..ncols(vertices)]-vertices[graph[i][j],1..ncols(vertices)];
     
    448448      p=(VAR*EXP)[1,1];
    449449      pl,pr=0,0;
    450       // separate the terms with positive coefficients in p from
     450      // separate the terms with positive coefficients in p from 
    451451      // those with negative coefficients
    452452      for (k=1;k<=size(p);k++)
     
    461461        }
    462462      }
    463       // build the string which represents the jth inequality
     463      // build the string which represents the jth inequality 
    464464      // for the cone dual to the ith vertex
    465       // as polynomial inequality of type string, and store this
     465      // as polynomial inequality of type string, and store this 
    466466      // in the list pp as jth entry
    467467      pp[j]=string(pl)+" "+greatersign+" "+string(pr);
     
    496496    // create the file ineq.output
    497497    write(":w /tmp/ineq.output","");
    498     int dimension; // keeps the dimension of the intersection the
     498    int dimension; // keeps the dimension of the intersection the 
    499499                   // bad cones with the u11tobeseencone
    500500    for (i=1;i<=size(ineq);i++)
    501501    {
    502       i,". Cone of ",nrows(vertices); // indicate how many
     502      i,". Cone of ",nrows(vertices); // indicate how many 
    503503                                      // vertices have been dealt with
    504504      ungleichungen=intmatToPolymake(ineq[i][1],"rays");
     
    525525  }
    526526  // get the linearity space
    527   return(list(ineq,linearity));
     527  return(list(ineq,linearity)); 
    528528}
    529529example
     
    554554proc groebnerFan (poly f,list #)
    555555"USAGE:  groebnerFan(f[,#]);  f poly, # string
    556 RETURN:  list, the ith entry of L[1] contains information about the ith cone
    557                in the Groebner fan dual to the ith vertex in the Newton
     556RETURN:  list, the ith entry of L[1] contains information about the ith cone 
     557               in the Groebner fan dual to the ith vertex in the Newton 
    558558               polytope of the f
    559 @*             L[1][i][1] = integer matrix representing the inequalities
    560                             which describe the cone
    561 @*             L[1][i][2] = a list which contains the inequalities represented
     559@*             L[1][i][1] = integer matrix representing the inequalities 
     560                            which describe the cone         
     561@*             L[1][i][2] = a list which contains the inequalities represented 
    562562                            by L[1][i][1] as a list of strings
    563 @*             L[1][i][3] = an interger matrix whose rows are the extreme rays
     563@*             L[1][i][3] = an interger matrix whose rows are the extreme rays 
    564564                            of the cone
    565 @*             L[2] = is an integer matrix whose rows span the linearity space
    566                       of the fan, i.e. the linear space which is contained
    567                       in each cone
    568 @*             L[3] = the Newton polytope of f in the format of the procedure
     565@*             L[2] = is an integer matrix whose rows span the linearity space 
     566                      of the fan, i.e. the linear space which is contained 
     567                      in each cone               
     568@*             L[3] = the Newton polytope of f in the format of the procedure 
    569569                      newtonPolytope
    570 @*             L[4] = integer matrix where each row represents the exponet
     570@*             L[4] = integer matrix where each row represents the exponet 
    571571                      vector of one monomial occuring in the input polynomial
    572572NOTE: - if you have already computed the Newton polytope of f then you might want
    573         to use the procedure normalFan instead in order to avoid doing costly
     573        to use the procedure normalFan instead in order to avoid doing costly 
    574574        computation twice
    575575@*    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
    576576        TU Berlin and Michael Joswig, so it only works if polymake is installed;
    577577        see http://www.math.tu-berlin.de/polymake/
    578 @*    - the procedure creates the file  /tmp/newtonPolytope.polymake which
    579         contains the Newton polytope of f in polymake format and which can
     578@*    - the procedure creates the file  /tmp/newtonPolytope.polymake which 
     579        contains the Newton polytope of f in polymake format and which can 
    580580        be used for further computations with polymake
    581 @*    - it is possible to give as an optional second argument as string which
    582         then will be used instead of 'newtonPolytope' in the name of the
     581@*    - it is possible to give as an optional second argument as string which 
     582        then will be used instead of 'newtonPolytope' in the name of the 
    583583        polymake output file
    584584EXAMPLE: example groebnerFan;   shows an example"
    585585{
    586586  int i,j;
    587   // compute the list of exponent vectors of the polynomial, which are
     587  // compute the list of exponent vectors of the polynomial, which are 
    588588  // the lattice points whose convex hull is the Newton polytope of f
    589589  intmat exponents[size(f)][nvars(basering)];
     
    649649proc intmatToPolymake (intmat M,string art)
    650650"USAGE:  intmatToPolymake(M,art);  M intmat, art string
    651 ASSUME:  - M is an integer matrix which should be transformed into polymake
     651ASSUME:  - M is an integer matrix which should be transformed into polymake 
    652652           format;
    653653@*       - art is one of the following strings:
    654654@*           + 'rays'   : indicating that a first column of 0's should be added
    655 @*           + 'points' : indicating that a first column of 1's should be added
    656 RETURN:  string, the matrix is transformed in a string and a first column has
     655@*           + 'points' : indicating that a first column of 1's should be added 
     656RETURN:  string, the matrix is transformed in a string and a first column has 
    657657                 been added
    658658EXAMPLE: example intmatToPolymake;   shows an example"
     
    662662    string anf="0 ";
    663663  }
    664   else
     664  else 
    665665  {
    666666    string anf="1 ";
     
    697697proc polymakeToIntmat (string pm,string art)
    698698"USAGE:  polymakeToIntmat(pm,art);  pm, art string
    699 ASSUME:  pm is the result of calling polymake with one 'argument' like
    700          VERTICES, AFFINE_HULL, etc., so that the first row of the string is
    701          the name of the corresponding 'argument' and the further rows contain
     699ASSUME:  pm is the result of calling polymake with one 'argument' like 
     700         VERTICES, AFFINE_HULL, etc., so that the first row of the string is 
     701         the name of the corresponding 'argument' and the further rows contain 
    702702         the result which consists of vectors either over the integers
    703703         or over the rationals
     
    705705                 from the second row, where each row has been multiplied with the
    706706                 lowest common multiple of the denominators of its entries as if
    707                  it is an integer matrix; moreover, if art=='affine', then
    708                  the first column is omitted since we only want affine
     707                 it is an integer matrix; moreover, if art=='affine', then 
     708                 the first column is omitted since we only want affine 
    709709                 coordinates
    710710EXAMPLE: example polymakeToIntmat;   shows an example"
     
    718718    pm=stringdelete(pm,1);
    719719  }
    720   pm=stringdelete(pm,1);
    721   // find out how many entries each vector has, namely one more
     720  pm=stringdelete(pm,1); 
     721  // find out how many entries each vector has, namely one more 
    722722  // than 'spaces' in a row
    723723  int i=1;
     
    734734  // if we want to have affine coordinates
    735735  if (art=="affine")
    736   {
     736  {   
    737737    s--; // then there is one column less
    738738    // and the entry of the first column (in the first row) has to be removed
     
    743743    pm=stringdelete(pm,1);
    744744  }
    745   // we add two line breaks at the end in order to have this as
     745  // we add two line breaks at the end in order to have this as 
    746746  // a stopping criterion
    747747  pm=pm+zeilenumbruch+zeilenumbruch;
     
    761761        z++;
    762762        pm[i]=",";
    763         // if we want to have affine coordinates,
     763        // if we want to have affine coordinates, 
    764764        // then we have to delete the first entry in each row
    765765        if (art=="affine")
     
    775775      if (pm[i]==" ")
    776776      {
    777         pm[i]=",";
     777        pm[i]=",";     
    778778      }
    779779    }
     
    784784    pm=stringdelete(pm,size(pm));
    785785  }
    786   // since the matrix could be over the rationals,
     786  // since the matrix could be over the rationals, 
    787787  // we need a ring with rational coefficients
    788   ring zwischering=0,x,lp;
     788  ring zwischering=0,x,lp;   
    789789  // create the matrix with the elements of pm as entries
    790790  execute("matrix mm["+string(z)+"]["+string(s)+"]="+pm+";");
     
    835835proc triangulations (list polygon)
    836836"USAGE:  triangulations(polygon); list polygon
    837 ASSUME:  polygon is a list of integer vectors of the same size representing
    838          the affine coordinates of the lattice points
     837ASSUME:  polygon is a list of integer vectors of the same size representing 
     838         the affine coordinates of the lattice points 
    839839PURPOSE: the procedure considers the marked polytope given as the convex hull of
    840840         the lattice points and with these lattice points as markings; it then
    841          computes all possible triangulations of this marked polytope
     841         computes all possible triangulations of this marked polytope 
    842842RETURN:  list, each entry corresponds to one triangulation and the ith entry is
    843843               itself a list of integer vectors of size three, where each integer
     
    846846NOTE:- the procedure calls for its computations the program points2triangs
    847847       from the program topcom by Joerg Rambau, Universitaet Bayreuth; it
    848        therefore is necessary that this program is installed in order to use
     848       therefore is necessary that this program is installed in order to use 
    849849       this  procedure; see
    850850@*     http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
    851 @*   - the procedure creates the files /tmp/triangulationsinput and
     851@*   - the procedure creates the files /tmp/triangulationsinput and 
    852852       /tmp/triangulationsoutput;
    853        the former is used as input for points2triangs and the latter is its
    854        output containing the triangulations of corresponding to points in the
    855        format of points2triangs; if you wish to use this for further
    856        computations with topcom, you have to use the procedure
     853       the former is used as input for points2triangs and the latter is its 
     854       output containing the triangulations of corresponding to points in the 
     855       format of points2triangs; if you wish to use this for further 
     856       computations with topcom, you have to use the procedure 
    857857       polymakeKeepTmpFiles in before
    858 @*   - note that an integer i in an integer vector representing a triangle
    859        refers to the ith lattice point, i.e. polygon[i]; this convention is
    860        different from TOPCOM's convention, where i would refer to the i-1st
     858@*   - note that an integer i in an integer vector representing a triangle 
     859       refers to the ith lattice point, i.e. polygon[i]; this convention is 
     860       different from TOPCOM's convention, where i would refer to the i-1st 
    861861       lattice point
    862862EXAMPLE: example triangulations;   shows an example"
    863863{
    864864  int i,j;
    865   // prepare the input for points2triangs by writing the input polygon in the
     865  // prepare the input for points2triangs by writing the input polygon in the 
    866866  // necessary format
    867867  string spi="[";
     
    885885    system("sh","cd /tmp; rm -f triangulationsinput; rm -f triangulationsoutput");
    886886  }
    887   // preprocessing of p2t if points2triangs is version >= 0.15
     887  // preprocessing of p2t if points2triangs is version >= 0.15 
    888888  // brings p2t to the format of version 0.14
    889889  string np2t; // takes the triangulations in Singular format
     
    907907      }
    908908      else
    909       {
     909      {       
    910910        np2t=np2t+p2t[i];
    911911      }
     
    919919  {
    920920    if (np2t[size(np2t)]!=";")
    921     {
     921    {     
    922922      np2t=np2t+p2t[size(p2t)-1]+p2t[size(p2t)];
    923923    }
     
    941941          np2t=np2t+"))";
    942942          i++;
    943         }
     943        }     
    944944        else
    945945        {
     
    979979   "EXAMPLE:";
    980980   echo=2;
    981    // the lattice points of the unit square in the plane
     981   // the lattice points of the unit square in the plane 
    982982   list polygon=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
    983983   // the triangulations of this lattice point configuration are computed
     
    10251025  int i,j,k,l;
    10261026  intmat N[2][2]; // is used to compute areas of triangles
    1027   intvec vertex;  // stores a point in the secondary polytope as
     1027  intvec vertex;  // stores a point in the secondary polytope as 
    10281028                  // intermediate result
    10291029  int eintrag;
    10301030  int halt;
    1031   intmat secpoly[size(triangs)][size(polygon)];   // stores all lattice points
     1031  intmat secpoly[size(triangs)][size(polygon)];   // stores all lattice points 
    10321032                                                  // of the secondary polytope
    1033   // consider each triangulation and compute the corresponding point
     1033  // consider each triangulation and compute the corresponding point 
    10341034  // in the secondary polytope
    10351035  for (i=1;i<=size(triangs);i++)
    10361036  {
    1037     // for each triangulation we have to compute the coordinates
     1037    // for each triangulation we have to compute the coordinates 
    10381038    // corresponding to each marked point
    10391039    for (j=1;j<=size(polygon);j++)
    10401040    {
    10411041      eintrag=0;
    1042       // for each marked point we have to consider all triangles in the
     1042      // for each marked point we have to consider all triangles in the 
    10431043      // triangulation which involve this particular point
    10441044      for (k=1;k<=size(triangs[i]);k++)
     
    10621062    secpoly[i,1..size(polygon)]=vertex;
    10631063  }
    1064   return(list(secpoly,triangs));
     1064  return(list(secpoly,triangs));         
    10651065}
    10661066example
     
    10841084proc secondaryFan (list polygon,list #)
    10851085"USAGE:  secondaryFan(polygon[,#]); list polygon, list #
    1086 ASSUME:  - polygon is a list of integer vectors of the same size representing
     1086ASSUME:  - polygon is a list of integer vectors of the same size representing 
    10871087           the affine coordinates of lattice points
    1088 @*       - if the triangulations of the corresponding polygon have already been
    1089            computed with the procedure triangulations then these can be given
    1090            as a second (optional) argument in order to avoid doing this
     1088@*       - if the triangulations of the corresponding polygon have already been 
     1089           computed with the procedure triangulations then these can be given 
     1090           as a second (optional) argument in order to avoid doing this 
    10911091           computation again
    10921092PURPOSE: the procedure considers the marked polytope given as the convex hull of
    10931093         the lattice points and with these lattice points as markings; it then
    1094          computes the lattice points of the secondary polytope given by this
     1094         computes the lattice points of the secondary polytope given by this 
    10951095         marked polytope which correspond to the triangulations computed by
    10961096         the procedure triangulations
    1097 RETURN:  list, the ith entry of L[1] contains information about the ith cone in
    1098                the secondary fan of the polygon, i.e. the cone dual to the
     1097RETURN:  list, the ith entry of L[1] contains information about the ith cone in 
     1098               the secondary fan of the polygon, i.e. the cone dual to the 
    10991099               ith vertex of the secondary polytope
    1100 @*             L[1][i][1] = integer matrix representing the inequalities which
     1100@*             L[1][i][1] = integer matrix representing the inequalities which 
    11011101                            describe the cone dual to the ith vertex
    1102 @*             L[1][i][2] = a list which contains the inequalities represented
     1102@*             L[1][i][2] = a list which contains the inequalities represented 
    11031103                            by L[1][i][1] as a list of strings, where we use the
    11041104                            variables x(1),...,x(n)
    11051105@*             L[1][i][3] = only present if 'er' is set to 1; in that case it is
    1106                             an interger matrix whose rows are the extreme rays
     1106                            an interger matrix whose rows are the extreme rays 
    11071107                            of the cone
    1108 @*             L[2] = is an integer matrix whose rows span the linearity space
    1109                       of the fan, i.e. the linear space which is contained in
     1108@*             L[2] = is an integer matrix whose rows span the linearity space 
     1109                      of the fan, i.e. the linear space which is contained in 
    11101110                      each cone
    1111 @*             L[3] = the secondary polytope in the format of the procedure
     1111@*             L[3] = the secondary polytope in the format of the procedure 
    11121112                      polymakePolytope
    1113 @*             L[4] = the list of triangulations corresponding to the vertices
     1113@*             L[4] = the list of triangulations corresponding to the vertices 
    11141114                      of the secondary polytope
    11151115NOTE:- the procedure calls for its computation polymake by Ewgenij Gawrilow,
    11161116       TU Berlin and Michael Joswig, so it only works if polymake is installed;
    11171117       see http://www.math.tu-berlin.de/polymake/
    1118 @*   - in the optional argument # it is possible to hand over other names for
     1118@*   - in the optional argument # it is possible to hand over other names for 
    11191119       the variables to be used -- be careful, the format must be correct
    11201120       which is not tested, e.g. if you want the variable names to be
    11211121       u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
    1122 @*   - if the triangluations are not handed over as optional argument the
    1123        procedure calls for its computation of these triangulations the program
    1124        points2triangs from the program topcom by Joerg Rambau, Universitaet
    1125        Bayreuth; it therefore is necessary that this program is installed in
     1122@*   - if the triangluations are not handed over as optional argument the 
     1123       procedure calls for its computation of these triangulations the program 
     1124       points2triangs from the program topcom by Joerg Rambau, Universitaet 
     1125       Bayreuth; it therefore is necessary that this program is installed in 
    11261126       order to use this procedure; see
    11271127@*     http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
     
    11721172proc cycleLength (list boundary,intvec interior)
    11731173"USAGE:  cycleLength(boundary,interior); list boundary, intvec interior
    1174 ASSUME:  boundary is a list of integer vectors describing a cycle in some
    1175          convex lattice polygon around the lattice point interior ordered
     1174ASSUME:  boundary is a list of integer vectors describing a cycle in some 
     1175         convex lattice polygon around the lattice point interior ordered 
    11761176         clock wise
    11771177RETURN:  string, the cycle length of the corresponding cycle in the dual
     
    11801180{
    11811181  int j;
    1182   // create a ring whose variables are indexed by the points in
     1182  // create a ring whose variables are indexed by the points in 
    11831183  // boundary resp. by interior
    11841184  string rst="ring cyclering=0,(u"+string(interior[1])+string(interior[2]);
     
    12181218   // interior is a lattice point in the interior of this lattice polygon
    12191219   intvec interior=1,1;
    1220    // compute the general cycle length of a cycle of the corresponding cycle
     1220   // compute the general cycle length of a cycle of the corresponding cycle 
    12211221   // in the dual tropical curve, note that (0,1) and (2,1) do not contribute
    12221222   cycleLength(boundary,interior);
     
    12271227proc splitPolygon (list markings)
    12281228"USAGE:  splitPolygon (markings);  markings list
    1229 ASSUME:  markings is a list of integer vectors representing lattice points in
    1230          the plane which we consider as the marked points of the convex lattice
     1229ASSUME:  markings is a list of integer vectors representing lattice points in 
     1230         the plane which we consider as the marked points of the convex lattice 
    12311231         polytope spanned by them
    1232 PURPOSE: split the marked points in the vertices, the points on the facets
     1232PURPOSE: split the marked points in the vertices, the points on the facets 
    12331233         which are not vertices, and the interior points
    12341234RETURN:  list, L consisting of three lists
     
    12361236@*                       L[1][i][1] = intvec, the coordinates of the ith vertex
    12371237@*                       L[1][i][2] = int, the position of L[1][i][1] in markings
    1238 @*             L[2][i] : represents the lattice points on the facet of the
    1239                          polygon with endpoints L[1][i] and L[1][i+1]
     1238@*             L[2][i] : represents the lattice points on the facet of the 
     1239                         polygon with endpoints L[1][i] and L[1][i+1] 
    12401240                         (i considered modulo size(L[1]))
    1241 @*                       L[2][i][j][1] = intvec, the coordinates of the jth
     1241@*                       L[2][i][j][1] = intvec, the coordinates of the jth 
    12421242                                                 lattice point on that facet
    1243 @*                       L[2][i][j][2] = int, the position of L[2][i][j][1]
     1243@*                       L[2][i][j][2] = int, the position of L[2][i][j][1] 
    12441244                                              in markings
    1245 @*             L[3]    : represents the interior lattice points of the polygon
     1245@*             L[3]    : represents the interior lattice points of the polygon 
    12461246@*                       L[3][i][1] = intvec, coordinates of ith interior point
    12471247@*                       L[3][i][2] = int, the position of L[3][i][1] in markings
     
    12541254  vert[1]=pb[2];
    12551255  int i,j,k;      // indices
    1256   list boundary;  // stores the points on the facets of the
     1256  list boundary;  // stores the points on the facets of the 
    12571257                  // polygon which are not vertices
    1258   // append to the boundary points as well as to the vertices
     1258  // append to the boundary points as well as to the vertices 
    12591259  // the first vertex a second time
    12601260  pb[1]=pb[1]+list(pb[1][1]);
     
    12811281  // store the information on the boundary in vert[2]
    12821282  vert[2]=boundary;
    1283   // find the remaining points in the input which are not on
     1283  // find the remaining points in the input which are not on 
    12841284  // the boundary by checking
    12851285  // for each point in markings if it is contained in pb[1]
     
    12981298  // store the interior points in vert[3]
    12991299  vert[3]=interior;
    1300   // add to each point in vert the index which it gets from
     1300  // add to each point in vert the index which it gets from 
    13011301  // its position in the input markings;
    13021302  // do so for ver[1]
     
    13321332    }
    13331333    vert[3][i]=list(vert[3][i],j);
    1334   }
     1334  } 
    13351335  return(vert);
    13361336}
     
    13391339   "EXAMPLE:";
    13401340   echo=2;
    1341    // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
     1341   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) 
    13421342   // with all integer points as markings
    13431343   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
     
    13591359proc eta (list triang,list polygon)
    13601360"USAGE:  eta(triang,polygon);  triang, polygon list
    1361 ASSUME:  polygon has the format of the output of splitPolygon, i.e. it is a
    1362          list with three entries describing a convex lattice polygon in the
     1361ASSUME:  polygon has the format of the output of splitPolygon, i.e. it is a 
     1362         list with three entries describing a convex lattice polygon in the 
    13631363         following way:
    1364 @*       polygon[1] : is a list of lists; for each i the entry polygon[1][i][1]
    1365                       is a lattice point which is a vertex of the lattice
     1364@*       polygon[1] : is a list of lists; for each i the entry polygon[1][i][1] 
     1365                      is a lattice point which is a vertex of the lattice 
    13661366                      polygon, and polygon[1][i][2] is an integer assigned to
    13671367                      this lattice point as identifying index
    1368 @*       polygon[2] : is a list of lists; for each vertex of the polygon,
    1369                       i.e. for each entry in polygon[1], it contains a list
    1370                       polygon[2][i], which contains the lattice points on the
    1371                       facet with endpoints polygon[1][i] and polygon[1][i+1]
     1368@*       polygon[2] : is a list of lists; for each vertex of the polygon, 
     1369                      i.e. for each entry in polygon[1], it contains a list 
     1370                      polygon[2][i], which contains the lattice points on the 
     1371                      facet with endpoints polygon[1][i] and polygon[1][i+1] 
    13721372                      - i considered mod size(polygon[1]);
    1373                       each such lattice point contributes an entry
     1373                      each such lattice point contributes an entry 
    13741374                      polygon[2][i][j][1] which is an integer
    1375                       vector giving the coordinate of the lattice point and an
     1375                      vector giving the coordinate of the lattice point and an 
    13761376                      entry polygon[2][i][j][2] which is the identifying index
    1377 @*       polygon[3] : is a list of lists, where each entry corresponds to a
    1378                       lattice point in the interior of the polygon, with
     1377@*       polygon[3] : is a list of lists, where each entry corresponds to a 
     1378                      lattice point in the interior of the polygon, with 
    13791379                      polygon[3][j][1] being the coordinates of the point
    13801380                      and polygon[3][j][2] being the identifying index;
    1381 @*       triang is a list of integer vectors all of size three describing a
    1382          triangulation of the polygon described by polygon; if an entry of
     1381@*       triang is a list of integer vectors all of size three describing a 
     1382         triangulation of the polygon described by polygon; if an entry of 
    13831383         triang is the vector (i,j,k) then the triangle is built from the vertices
    13841384         with indices i, j and k
    1385 RETURN:  intvec, the integer vector eta describing that vertex of the Newton
    1386                  polytope discriminant of the polygone whose dual cone in the
    1387                  Groebner fan contains the cone of the secondary fan of the
     1385RETURN:  intvec, the integer vector eta describing that vertex of the Newton 
     1386                 polytope discriminant of the polygone whose dual cone in the 
     1387                 Groebner fan contains the cone of the secondary fan of the 
    13881388                 polygon corresponding to the given triangulation
    1389 NOTE:  for a better description of eta see Gelfand, Kapranov,
     1389NOTE:  for a better description of eta see Gelfand, Kapranov, 
    13901390       Zelevinski: Discriminants, Resultants and multidimensional Determinants.
    13911391       Chapter 10.
     
    13931393{
    13941394  int i,j,k,l,m,n; // index variables
    1395   list ordpolygon;   // stores the lattice points in the order
     1395  list ordpolygon;   // stores the lattice points in the order 
    13961396                     // used in the triangulation
    13971397  list triangarea; // stores the areas of the triangulations
     
    14191419  for (i=1;i<=size(triang);i++)
    14201420  {
    1421     // Note that the ith lattice point in orderedpolygon has the
     1421    // Note that the ith lattice point in orderedpolygon has the 
    14221422    // number i-1 in the triangulation!
    14231423    N=ordpolygon[triang[i][1]]-ordpolygon[triang[i][2]],ordpolygon[triang[i][1]]-ordpolygon[triang[i][3]];
     
    14251425  }
    14261426  intvec ETA;        // stores the eta_ij
    1427   int etaij;         // stores the part of eta_ij during computations
     1427  int etaij;         // stores the part of eta_ij during computations 
    14281428                     // which comes from triangle areas
    1429   int seitenlaenge;  // stores the part of eta_ij during computations
     1429  int seitenlaenge;  // stores the part of eta_ij during computations 
    14301430                     // which comes from boundary facets
    14311431  list seiten;       // stores the lattice points on facets of the polygon
    14321432  intvec v;          // used to compute a facet length
    1433   // 3) store first in seiten[i] all lattice points on the facet
     1433  // 3) store first in seiten[i] all lattice points on the facet 
    14341434  //    connecting the ith vertex,
    1435   //    i.e. polygon[1][i], with the i+1st vertex, i.e. polygon[1][i+1],
     1435  //    i.e. polygon[1][i], with the i+1st vertex, i.e. polygon[1][i+1], 
    14361436  //    where we replace i+1
    14371437  //    1 if i=size(polygon[1]);
    1438   //    then append the last entry of seiten once more at the very
     1438  //    then append the last entry of seiten once more at the very 
    14391439  //    beginning of seiten, so
    14401440  //    that the index is shifted by one
     
    14621462      if ((polygon[1][j][2]==triang[k][1]) or (polygon[1][j][2]==triang[k][2]) or (polygon[1][j][2]==triang[k][3]))
    14631463      {
    1464         // ... if so, add the area of the triangle to etaij
     1464        // ... if so, add the area of the triangle to etaij 
    14651465        etaij=etaij+triangarea[k];
    1466         // then check if that triangle has a facet which is contained
    1467         // in one of the
     1466        // then check if that triangle has a facet which is contained 
     1467        // in one of the 
    14681468        // two facets of the polygon which are adjecent to the given vertex ...
    14691469        // these two facets are seiten[j] and seiten[j+1]
     
    14791479              if ((seiten[n][l][2]==triang[k][m]) and (seiten[n][l][2]!=polygon[1][j][2]))
    14801480              {
    1481                 // if so, then compute the vector pointing from this
     1481                // if so, then compute the vector pointing from this 
    14821482                // lattice point to the vertex
    14831483                v=polygon[1][j][1]-seiten[n][l][1];
    1484                 // and the lattice length of this vector has to be
     1484                // and the lattice length of this vector has to be 
    14851485                // subtracted from etaij
    14861486                etaij=etaij-abs(gcd(v[1],v[2]));
     
    14941494    ETA[polygon[1][j][2]]=etaij;
    14951495  }
    1496   // 5) compute the eta_ij for all lattice points on the facets
     1496  // 5) compute the eta_ij for all lattice points on the facets 
    14971497  //    of the polygon which are not vertices, these are the
    14981498  //    lattice points in polygon[2][1] to polygon[2][size(polygon[1])]
     
    15001500  {
    15011501    for (j=1;j<=size(polygon[2][i]);j++)
    1502     {
     1502    {     
    15031503      // initialise etaij
    15041504      etaij=0;
     
    15111511        if ((polygon[2][i][j][2]==triang[k][1]) or (polygon[2][i][j][2]==triang[k][2]) or (polygon[2][i][j][2]==triang[k][3]))
    15121512        {
    1513           // ... if so, add the area of the triangle to etaij
     1513          // ... if so, add the area of the triangle to etaij 
    15141514          etaij=etaij+triangarea[k];
    1515           // then check if that triangle has a facet which is contained in the
     1515          // then check if that triangle has a facet which is contained in the 
    15161516          // facet of the polygon which contains the lattice point in question,
    15171517          // this is the facet seiten[i+1];
     
    15211521            // ... and for each lattice point in the triangle ...
    15221522            for (m=1;m<=size(triang[k]);m++)
    1523             {
     1523            {           
    15241524              // ... if they coincide and are not the vertex itself ...
    15251525              if ((seiten[i+1][l][2]==triang[k][m]) and (seiten[i+1][l][2]!=polygon[2][i][j][2]))
    15261526              {
    1527                 // if so, then compute the vector pointing from
     1527                // if so, then compute the vector pointing from 
    15281528                // this lattice point to the vertex
    15291529                v=polygon[2][i][j][1]-seiten[i+1][l][1];
    1530                 // and the lattice length of this vector contributes
     1530                // and the lattice length of this vector contributes 
    15311531                // to seitenlaenge
    15321532                seitenlaenge=seitenlaenge+abs(gcd(v[1],v[2]));
     
    15361536        }
    15371537      }
    1538       // if the lattice point was a vertex of any triangle
     1538      // if the lattice point was a vertex of any triangle 
    15391539      // in the triangulation ...
    15401540      if (etaij!=0)
     
    15611561      if ((polygon[3][j][2]==triang[k][1]) or (polygon[3][j][2]==triang[k][2]) or (polygon[3][j][2]==triang[k][3]))
    15621562      {
    1563         // ... if so, add the area of the triangle to etaij
     1563        // ... if so, add the area of the triangle to etaij 
    15641564        etaij=etaij+triangarea[k];
    15651565      }
     
    15741574   "EXAMPLE:";
    15751575   echo=2;
    1576    // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
     1576   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) 
    15771577   // with all integer points as markings
    15781578   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
     
    15811581   // split the polygon in its vertices, its facets and its interior points
    15821582   list sp=splitPolygon(polygon);
    1583    // define a triangulation by connecting the only interior point
     1583   // define a triangulation by connecting the only interior point 
    15841584   //        with the vertices
    15851585   list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,5,10);
     
    15871587   eta(triang,sp);
    15881588}
    1589 
     1589 
    15901590/////////////////////////////////////////////////////////////////////////////
    15911591
     
    16141614  }
    16151615  // check is the polygon is only a line segment given by more than two points;
    1616   // for this first compute sum of the absolute values of the determinants
     1616  // for this first compute sum of the absolute values of the determinants 
    16171617  // of the matrices whose
    1618   // rows are the vectors pointing from the first to the second point
     1618  // rows are the vectors pointing from the first to the second point 
    16191619  // and from the
    1620   // the first point to the ith point for i=3,...,size(polygon);
     1620  // the first point to the ith point for i=3,...,size(polygon); 
    16211621  // if this sum is zero
    16221622  // then the polygon is a line segment and we have to find its end points
     
    16311631    intmat laenge[size(polygon)][size(polygon)];
    16321632    intvec mp;
    1633     //   for this collect first all vectors pointing from one lattice
     1633    //   for this collect first all vectors pointing from one lattice 
    16341634    //   point to the next,
    16351635    //   compute their pairwise angles and their lengths
    16361636    for (i=1;i<=size(polygon)-1;i++)
    1637     {
     1637    {     
    16381638      for (j=i+1;j<=size(polygon);j++)
    16391639      {
     
    16591659    polygon=sortlistbyintvec(polygon,abstand);
    16601660    return(list(polygon,endpoints));
    1661   }
     1661  } 
    16621662  ///////////////////////////////////////////////////////////////
    16631663  list orderedvertices;  // stores the vertices in an ordered way
    1664   list minimisedorderedvertices;  // stores the vertices in an ordered way;
     1664  list minimisedorderedvertices;  // stores the vertices in an ordered way; 
    16651665                                  // redundant ones removed
    1666   list comparevertices; // stores vertices which should be compared to
     1666  list comparevertices; // stores vertices which should be compared to 
    16671667                        // the testvertex
    16681668  orderedvertices[1]=polygon[1]; // set the starting vertex
    16691669  minimisedorderedvertices[1]=polygon[1]; // set the starting vertex
    16701670  intvec testvertex=polygon[1];  //vertex to which the others have to be compared
    1671   intvec startvertex=polygon[1]; // keep the starting vertex to test,
     1671  intvec startvertex=polygon[1]; // keep the starting vertex to test, 
    16721672                                 // when the end is reached
    16731673  int endtest;                   // is set to one, when the end is reached
    1674   int startvertexfound;// is 1, once for some testvertex a candidate
    1675                        // for the next vertex has been found
     1674  int startvertexfound;// is 1, once for some testvertex a candidate 
     1675                       // for the next vertex has been found 
    16761676  polygon=delete(polygon,1);    // delete the testvertex
    16771677  intvec v,w;
    16781678  int l=1;  // counts the vertices
    1679   // the basic idea is that a vertex can be
     1679  // the basic idea is that a vertex can be 
    16801680  // the next one on the boundary if all other vertices
    1681   // lie to the right of the vector v pointing
     1681  // lie to the right of the vector v pointing 
    16821682  // from the testvertex to this one; this can be tested
    1683   // by checking if the determinant of the 2x2-matrix
     1683  // by checking if the determinant of the 2x2-matrix 
    16841684  // with first column v and second column the vector w,
    1685   // pointing from the testvertex to the new vertex,
     1685  // pointing from the testvertex to the new vertex, 
    16861686  // is non-positive; if this is the case for all
    1687   // new vertices, then the one in consideration is
     1687  // new vertices, then the one in consideration is 
    16881688  // a possible choice for the next vertex on the boundary
    1689   // and it is stored in naechste; we can then order
     1689  // and it is stored in naechste; we can then order 
    16901690  // the candidates according to their distance from
    16911691  // the testvertex; then they occur on the boundary in that order!
     
    16991699      v=polygon[i]-testvertex; // points from the testvertex to the ith vertex
    17001700      comparevertices=delete(polygon,i); // we needn't compare v to itself
    1701       // we should compare v to the startvertex-testvertex;
     1701      // we should compare v to the startvertex-testvertex; 
    17021702      // in the first calling of the loop
    1703       // this is irrelevant since the difference will be zero;
     1703      // this is irrelevant since the difference will be zero; 
    17041704      // however, later on it will
    1705       // be vital, since we delete the vertices
     1705      // be vital, since we delete the vertices 
    17061706      // which we have already tested from the list
    1707       // of all vertices, and when all vertices
     1707      // of all vertices, and when all vertices 
    17081708      // on the boundary have been found we would
    1709       // therefore find a vertex in the interior
     1709      // therefore find a vertex in the interior 
    17101710      // as candidate; but always testing against
    1711       // the starting vertex, this can not happen
    1712       comparevertices[size(comparevertices)+1]=startvertex;
     1711      // the starting vertex, this cannot happen
     1712      comparevertices[size(comparevertices)+1]=startvertex; 
    17131713      for (j=1;(j<=size(comparevertices)) and (d<=0);j++)
    17141714      {
     
    17181718        d=det(D);
    17191719      }
    1720       if (d<=0) // if all determinants are non-positive,
     1720      if (d<=0) // if all determinants are non-positive, 
    17211721      { // then the ith vertex is a candidate
    17221722        naechste[k]=list(polygon[i],i,scalarproduct(v,v));// we store the vertex,
     
    17261726    }
    17271727    if (size(naechste)>0) // then a candidate for the next vertex has been found
    1728     {
     1728    {     
    17291729      startvertexfound=1; // at least once a candidate has been found
    1730       naechste=sortlist(naechste,3);  // we order the candidates according
     1730      naechste=sortlist(naechste,3);  // we order the candidates according 
    17311731                                      // to their distance from testvertex;
    1732       for (j=1;j<=size(naechste);j++) // then we store them in this
     1732      for (j=1;j<=size(naechste);j++) // then we store them in this 
    17331733      { // order in orderedvertices
    17341734        l++;
    17351735        orderedvertices[l]=naechste[j][1];
    17361736      }
    1737       testvertex=naechste[size(naechste)][1];  // we store the last one as
     1737      testvertex=naechste[size(naechste)][1];  // we store the last one as 
    17381738                                               // next testvertex;
    17391739      // store the next corner of NSD
    1740       minimisedorderedvertices[size(minimisedorderedvertices)+1]=testvertex;
    1741       naechste=sortlist(naechste,2); // then we reorder the vertices
     1740      minimisedorderedvertices[size(minimisedorderedvertices)+1]=testvertex; 
     1741      naechste=sortlist(naechste,2); // then we reorder the vertices 
    17421742                                     // according to their position
    17431743      for (j=size(naechste);j>=1;j--) // and we delete them from the vertices
     
    17461746      }
    17471747    }
    1748     else // that means either that the vertex was inside the polygon,
    1749     {    // or that we have reached the last vertex on the boundary
     1748    else // that means either that the vertex was inside the polygon, 
     1749    {    // or that we have reached the last vertex on the boundary 
    17501750         // of the polytope
    1751       if (startvertexfound==0) // the vertex was in the interior;
     1751      if (startvertexfound==0) // the vertex was in the interior; 
    17521752      { // we delete it and start all over again
    1753         orderedvertices[1]=polygon[1];
    1754         minimisedorderedvertices[1]=polygon[1];
     1753        orderedvertices[1]=polygon[1]; 
     1754        minimisedorderedvertices[1]=polygon[1]; 
    17551755        testvertex=polygon[1];
    17561756        startvertex=polygon[1];
    17571757        polygon=delete(polygon,1);
    17581758      }
    1759       else // we have reached the last vertex on the boundary of
     1759      else // we have reached the last vertex on the boundary of 
    17601760      { // the polytope and can stop
    17611761        endtest=1;
     
    17641764    kill naechste;
    17651765  }
    1766   // test if the first vertex in minimisedorderedvertices
     1766  // test if the first vertex in minimisedorderedvertices 
    17671767  // is on the same line with the second and
    1768   // the last, i.e. if we started our search in the
     1768  // the last, i.e. if we started our search in the 
    17691769  // middle of a face; if so, delete it
    17701770  v=minimisedorderedvertices[2]-minimisedorderedvertices[1];
     
    17751775    minimisedorderedvertices=delete(minimisedorderedvertices,1);
    17761776  }
    1777   // test if the first vertex in minimisedorderedvertices
     1777  // test if the first vertex in minimisedorderedvertices 
    17781778  // is on the same line with the two
    1779   // last ones, i.e. if we started our search at the end of a face;
     1779  // last ones, i.e. if we started our search at the end of a face; 
    17801780  // if so, delete it
    17811781  v=minimisedorderedvertices[size(minimisedorderedvertices)-1]-minimisedorderedvertices[1];
     
    18091809proc cyclePoints (list triang,list points,int pt)
    18101810"USAGE:      cyclePoints(triang,points,pt)  triang,points list, pt int
    1811 ASSUME:      - points is a list of integer vectors describing the lattice
     1811ASSUME:      - points is a list of integer vectors describing the lattice 
    18121812               points of a marked polygon;
    1813 @*           - triang is a list of integer vectors describing a triangulation
    1814                of the marked polygon in the sense that an integer vector of
    1815                the form (i,j,k) describes the triangle formed by polygon[i],
     1813@*           - triang is a list of integer vectors describing a triangulation 
     1814               of the marked polygon in the sense that an integer vector of 
     1815               the form (i,j,k) describes the triangle formed by polygon[i], 
    18161816               polygon[j] and polygon[k];
    1817 @*           - pt is an integer between 1 and size(points), singling out a
     1817@*           - pt is an integer between 1 and size(points), singling out a 
    18181818               lattice point among the marked points
    1819 PURPOSE:     consider the convex lattice polygon, say P, spanned by all lattice
    1820              points in points which in the triangulation triang are connected
    1821              to the point points[pt]; the procedure computes all marked points
     1819PURPOSE:     consider the convex lattice polygon, say P, spanned by all lattice 
     1820             points in points which in the triangulation triang are connected 
     1821             to the point points[pt]; the procedure computes all marked points 
    18221822             in points which lie on the boundary of that polygon, ordered
    18231823             clockwise
    1824 RETURN:      list, of integer vectors which are the coordinates of the lattice
    1825                    points on the boundary of the above mentioned polygon P, if
    1826                    this polygon is not the empty set (that would be the case if
    1827                    points[pt] is not a vertex of any triangle in the
     1824RETURN:      list, of integer vectors which are the coordinates of the lattice 
     1825                   points on the boundary of the above mentioned polygon P, if 
     1826                   this polygon is not the empty set (that would be the case if 
     1827                   points[pt] is not a vertex of any triangle in the 
    18281828                   triangulation); otherwise return the empty list
    18291829EXAMPLE:     example cyclePoints;   shows an example"
    18301830{
    18311831  int i,j; // indices
    1832   list v;  // saves the indices of lattice points connected to the
     1832  list v;  // saves the indices of lattice points connected to the 
    18331833           // interior point in the triangulation
    18341834  // save all points in triangulations containing pt in v
     
    18661866    pts[i]=points[v[i]];
    18671867  }
    1868   // consider the convex polytope spanned by the points in pts,
     1868  // consider the convex polytope spanned by the points in pts, 
    18691869  // find the points on the
    18701870  // boundary and order them clockwise
     
    18751875   "EXAMPLE:";
    18761876   echo=2;
    1877    // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
     1877   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3) 
    18781878   // with all integer points as markings
    18791879   list points=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
    18801880               intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
    18811881               intvec(0,2),intvec(0,3);
    1882    // define a triangulation
     1882   // define a triangulation 
    18831883   list triang=intvec(1,2,5),intvec(1,5,7),intvec(1,7,9),intvec(8,9,10),
    18841884               intvec(1,8,9),intvec(1,2,8);
     
    18921892"USAGE:  latticeArea(polygon);   polygon list
    18931893ASSUME:  polygon is a list of integer vectors in the plane
    1894 RETURN:  int, the lattice area of the convex hull of the lattice points in
     1894RETURN:  int, the lattice area of the convex hull of the lattice points in 
    18951895              polygon, i.e. twice the Euclidean area
    18961896EXAMPLE: example polygonlatticeArea;   shows an example"
     
    19211921proc picksFormula (list polygon)
    19221922"USAGE:  picksFormula(polygon);   polygon list
    1923 ASSUME:  polygon is a list of integer vectors in the plane and consider their
    1924          convex hull C
    1925 RETURN:  list, L of three integersthe
     1923ASSUME:  polygon is a list of integer vectors in the plane and consider their 
     1924         convex hull C 
     1925RETURN:  list, L of three integersthe 
    19261926@*             L[1] : the lattice area of C, i.e. twice the Euclidean area
    19271927@*             L[2] : the number of lattice points on the boundary of C
     
    19481948    bdpts=bdpts+abs(gcd(edge[1],edge[2]));
    19491949  }
    1950   // Pick's formula says that the lattice area A, the number g of interior
     1950  // Pick's formula says that the lattice area A, the number g of interior 
    19511951  // points and
    19521952  // the number b of boundary points are connected by the formula: A=b+2g-2
     
    19761976"USAGE:  ellipticNF(polygon);   polygon list
    19771977ASSUME:  polygon is a list of integer vectors in the plane such that their
    1978          convex hull C has precisely one interior lattice point, i.e. C is the
     1978         convex hull C has precisely one interior lattice point, i.e. C is the 
    19791979         Newton polygon of an elliptic curve
    1980 PURPOSE: compute the normal form of the polygon with respect to the unimodular
     1980PURPOSE: compute the normal form of the polygon with respect to the unimodular 
    19811981         affine transformations T=A*x+v; there are sixteen different normal forms
    1982          (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons
    1983                    and the number 12.  Amer. Math. Monthly  107  (2000),  no. 3,
     1982         (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons 
     1983                   and the number 12.  Amer. Math. Monthly  107  (2000),  no. 3, 
    19841984                   238--250.)
    19851985RETURN:  list, L such that
    1986 @*             L[1] : list whose entries are the vertices of the normal form of
     1986@*             L[1] : list whose entries are the vertices of the normal form of 
    19871987                      the polygon
    19881988@*             L[2] : the matrix A of the unimodular transformation
    19891989@*             L[3] : the translation vector v of the unimodular transformation
    1990 @*             L[4] : list such that the ith entry is the image of polygon[i]
     1990@*             L[4] : list such that the ith entry is the image of polygon[i] 
    19911991                      under the unimodular transformation T
    19921992EXAMPLE: example ellipticNF;   shows an example"
     
    20202020  intvec trans;    // stores the vector by which we have to translate the polygon
    20212021  intmat A[2][2];  // stores the matrix by which we have to transform the polygon
    2022   matrix M[3][3];  // stores the projective coordinates of the points
     2022  matrix M[3][3];  // stores the projective coordinates of the points 
    20232023                   // which are to be transformed
    2024   matrix N[3][3];  // stores the projective coordinates of the points to
     2024  matrix N[3][3];  // stores the projective coordinates of the points to 
    20252025                   // which M is to be transformed
    2026   intmat T[3][3];  // stores the unimodular affine transformation in
     2026  intmat T[3][3];  // stores the unimodular affine transformation in 
    20272027                   // projective form
    20282028  // add the second point of pg once again at the end
    20292029  pg=insert(pg,pg[2],size(pg));
    2030   // if there is only one edge which has the maximal number of lattice points,
     2030  // if there is only one edge which has the maximal number of lattice points, 
    20312031  // then M should be:
    20322032  M=pg[max],1,pg[max+1],1,pg[max+2],1;
     
    21182118    M=pg[max],1,pg[max+1],1,pg[max+2],1;
    21192119    // the orientation of the polygon matters
    2120     A=pg[max-1]-pg[max],pg[max+1]-pg[max];
     2120    A=pg[max-1]-pg[max],pg[max+1]-pg[max];   
    21212121    if (det(A)==4)
    21222122    {
     
    21672167    {
    21682168      max++;
    2169     }
     2169    }   
    21702170    M=pg[max],1,pg[max+1],1,pg[max+2],1;
    21712171    N=0,1,1,1,2,1,2,1,1;
     
    22302230   // the vertices of the normal form are
    22312231   nf[1];
    2232    // it has been transformed by the unimodular affine transformation A*x+v
     2232   // it has been transformed by the unimodular affine transformation A*x+v 
    22332233   // with matrix A
    22342234   nf[2];
     
    22472247"USAGE:  ellipticNFDB(n[,#]);   n int, # list
    22482248ASSUME:  n is an integer between 1 and 16
    2249 PURPOSE: this is a database storing the 16 normal forms of planar polygons with
     2249PURPOSE: this is a database storing the 16 normal forms of planar polygons with 
    22502250         precisely one interior point up to unimodular affine transformations
    2251 @*       (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons
     2251@*       (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons 
    22522252                   and the number 12.  Amer. Math. Monthly  107  (2000),  no. 3,
    22532253                   238--250.)
    22542254RETURN:  list, L such that
    2255 @*             L[1] : list whose entries are the vertices of the nth normal form
    2256 @*             L[2] : list whose entries are all the lattice points of the
    2257                       nth normal form
    2258 @*             L[3] : only present if the optional parameter # is present, and
    2259                       then it is a polynomial in the variables (x,y) whose
     2255@*             L[1] : list whose entries are the vertices of the nth normal form 
     2256@*             L[2] : list whose entries are all the lattice points of the 
     2257                      nth normal form 
     2258@*             L[3] : only present if the optional parameter # is present, and 
     2259                      then it is a polynomial in the variables (x,y) whose 
    22602260                      Newton polygon is the nth normal form
    2261 NOTE:    the optional parameter is only allowed if the basering has the
     2261NOTE:    the optional parameter is only allowed if the basering has the 
    22622262         variables x and y
    22632263EXAMPLE: example ellipticNFDB;   shows an example"
     
    23102310proc polymakeKeepTmpFiles (int i)
    23112311"USAGE:  polymakeKeepTmpFiles(int i);   i int
    2312 PURPOSE: some procedures create files in the directory /tmp which are used for
     2312PURPOSE: some procedures create files in the directory /tmp which are used for 
    23132313         computations with polymake respectively topcom; these will be removed
    2314          when the corresponding procedure is left; however, it might be
     2314         when the corresponding procedure is left; however, it might be 
    23152315         desireable to keep them for further computations with either polymake or
    23162316         topcom; this can be achieved by this procedure; call the procedure as:
     
    23552355static proc scalarproduct (intvec w,intvec v)
    23562356"USAGE:      scalarproduct(w,v); w,v intvec
    2357 ASSUME:      w and v are integer vectors of the same length
     2357ASSUME:      w and v are integer vectors of the same length 
    23582358RETURN:      int, the scalarproduct of v and w
    23592359NOTE:        the procedure is called by findOrientedBoundary"
     
    24022402  {
    24032403    int m=nrows(M);
    2404 
     2404   
    24052405  }
    24062406  else
     
    24602460  {
    24612461    return("");
    2462 
     2462   
    24632463  }
    24642464  if (i==1)
     
    25702570        k++;
    25712571      }
    2572       else
     2572      else 
    25732573      {
    25742574        stop=1;
     
    26132613        k++;
    26142614      }
    2615       else
     2615      else 
    26162616      {
    26172617        stop=1;
     
    26622662static proc polygonToCoordinates (list points)
    26632663"USAGE:      polygonToCoordinates(points);   points list
    2664 ASSUME:      points is a list of integer vectors each of size two describing the
    2665              marked points of a convex lattice polygon like the output of
     2664ASSUME:      points is a list of integer vectors each of size two describing the 
     2665             marked points of a convex lattice polygon like the output of 
    26662666             polygonDB
    2667 RETURN:      list, the first entry is a string representing the coordinates
     2667RETURN:      list, the first entry is a string representing the coordinates 
    26682668                   corresponding to the latticpoints seperated by commata
    2669                    the second entry is a list where the ith entry is a string
    2670                    representing the coordinate of corresponding to the ith
    2671                    lattice point the third entry is the latex format of the
     2669                   the second entry is a list where the ith entry is a string 
     2670                   representing the coordinate of corresponding to the ith 
     2671                   lattice point the third entry is the latex format of the 
    26722672                   first entry
    26732673NOTE:        the procedure is called by fan"
  • Singular/LIB/presolve.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: presolve.lib,v 1.30 2009-04-14 12:00:14 Singular Exp $";
     2version="$Id: presolve.lib,v 1.31 2009-04-15 11:18:27 seelisch Exp $";
    33category="Symbolic-numerical solving";
    44info="
     
    190190   if ( size(#)!=0 ) {  n=#[1]; }
    191191   ideal maxi,rest = maxideal(1),0;
    192    if ( n < nvars(BAS) )
    193    {
    194       rest = maxi[n+1..nvars(BAS)];
     192   if ( n < nvars(BAS) ) 
     193   { 
     194      rest = maxi[n+1..nvars(BAS)]; 
    195195   }
    196196   attrib(rest,"isSB",1);
     
    200200// which do not contain elements not to be eliminated
    201201
    202    //ideal id = interred(i);
    203    //## gmg, geŠndert 9/2008: interred sehr lange z.B. bei Leonard1 in normal,
     202   //ideal id = interred(i); 
     203   //## gmg, geŠndert 9/2008: interred sehr lange z.B. bei Leonard1 in normal, 
    204204   //daher interred ersetzt durch: std nur auf linearpart angewendet
    205205   //Ordnung muss global sein, sonst egal (da Lin affin linear)
     
    207207//--------------- replace ordering by dp if it is not global -----------------
    208208   if ( ord_test(BAS) <= 0 )
    209    {
    210       intvec V;
     209   { 
     210      intvec V; 
    211211      V[n]=0; V=V+1;                          //weights for dp ordering
    212212      gnirlist[3] = list("dp",V), g32;
     
    215215      ideal i = imap(BAS,i);
    216216   }
    217 
     217     
    218218   list  Lin = linearpart(i);
    219219   ideal lin = std(Lin[1]);          //SB of ideal generated by polys of i
     
    231231//------------- check for special case of unit ideal and return ---------------
    232232   int check;
    233    if( lin[1] == 1 )
    234    {
    235      check = 1;
    236    }
    237    else
     233   if( lin[1] == 1 ) 
     234   { 
     235     check = 1; 
     236   }
     237   else             
    238238   {
    239239     for (ii=1; ii<=size(id); ii++ )
    240240     {
    241241       if ( id[ii] == 1 )
    242        {
     242       { 
    243243         check = 1; break;
    244244        }
     
    349349   }
    350350//-------- direct substitution of variables if possible and if e!=0 -----------
    351 // first find terms lin1 in lin of pure degree 1 in each poly of lin
     351// first find terms lin1 in lin of pure degree 1 in each polynomial of lin
    352352// k1 = pure degree 1 part, i.e. nonzero elts of lin1, renumbered
    353353// k2 = lin2 (=matrix(lin) - matrix(lin2)), renumbered
     
    356356/*
    357357Alte Version mit interred:
    358 // Then go to ring newBAS with ordering c,dp(n) and create a matrix with
    359 // size(k1) colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2
    360 // is one of the polys of lin containing a pure degree 1 part and f1 is this
    361 // part interreduce this matrix (i.e. Gauss elimination on linear part, with
     358// Then go to ring newBAS with ordering c,dp(n) and create a matrix with 
     359// size(k1) colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2 
     360// is one of the polys of lin containing a pure degree 1 part and f1 is this 
     361// part interreduce this matrix (i.e. Gauss elimination on linear part, with 
    362362// rest transformed accordingly).
    363363//Ist jetzt durch direkte Substitution gemacht (schneller!)
     
    365365         //ideal k12 = k1,k2;
    366366         //matrix M = matrix(k12,2,kk);     //degree 1 part is now in row 1
    367          //M = interred(M);
    368          //### interred zu teuer, muss nicht sein. Wenn interred angewendet
     367         //M = interred(M);             
     368         //### interred zu teuer, muss nicht sein. Wenn interred angewendet 
    369369         //werden soll, vorher in Ring mit Ordnung (c,dp) wechseln!
    370370         //Abfrage:  if( ordstr(BAS) != "c,dp("+string(n)+")" )
     
    378378-z ergibt ich auch i[2]-z*i[3] mit option(redThrough)
    379379statt interred kann man hier auch NF(i,i[3])+i[3] verwenden
    380 hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))
     380hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i)) 
    381381aber 3 (x,y,z)
    382382Da interred oder NF aber die Laenge der polys vergroessern kann, nicht gemacht
     
    397397   //since lin1 != 0 there are candidates for substituting variables
    398398
    399    lin2 = lin - lin1;      //difference as matrix
     399   lin2 = lin - lin1;      //difference as matrix       
    400400   // rest of lin, part of pure degree 1 substracted from each generator of lin
    401401
     
    410410      }
    411411   }
    412    //Now each !=0 generator of lin2 contains only constant terms or terms of
     412   //Now each !=0 generator of lin2 contains only constant terms or terms of 
    413413   //degree >= 2, hence lin 2 can never be used for further substitutions
    414414   //We have: lin = ideal(matrix(k1)+matrix(k2)), lin2
    415415
    416    ideal kin = matrix(k1)+matrix(k2);
     416   ideal kin = matrix(k1)+matrix(k2); 
    417417   //kin = polys of lin which contained a pure degree 1 part.
    418418   kin = simplify(kin,2);
     
    421421   int count=1;
    422422   while ( count != 0 )
    423    {
     423   {   
    424424         count = 0;
    425425         for ( ii=1; ii<=n; ii++  )    //start direct substitution of var(ii)
     
    432432               {
    433433                  //we look for the shortest candidate to substitute var(ii)
    434                   if ( cand == 0 )
    435                   {
     434                  if ( cand == 0 ) 
     435                  { 
    436436                     cand = kin[kk];  //candidate for substituting var(ii)
    437                   }
     437                  } 
    438438                  else
    439439                  {
    440                      if ( size(kin[kk]) < size(cand) )
    441                      {
    442                         cand = kin[kk];
     440                     if ( size(kin[kk]) < size(cand) ) 
     441                     { 
     442                        cand = kin[kk]; 
    443443                     }
    444444                  }
    445445                }
    446             }
     446            }                     
    447447            if ( cand != 0 )
    448448            {
    449449                  p = cand/var(ii);
    450                   kip = cand/p;      //normalized poly of kin w.r.t var(ii)
     450                  kip = cand/p;      //normalized polynomial of kin w.r.t var(ii)
    451451                  eva = eva+var(ii); //var(ii) added to list of elimin. vars
    452452                  neva[ii] = 0;
    453                   sub = sub+kip;     //poly defining substituion
    454                   //## gmg: geŠndert 08/2008, map durch subst ersetzt
     453                  sub = sub+kip;     //polynomial defining substituion
     454                  //## gmg: geŠndert 08/2008, map durch subst ersetzt 
    455455                  //(viel schneller)
    456                   vip = var(ii) - kip;  //poly to be substituted
     456                  vip = var(ii) - kip;  //polynomial to be substituted
    457457                  lin = subst(lin, var(ii), vip);  //subst in rest
    458458                  lin = simplify(lin,2);
     
    465465         }
    466466   }
    467 
     467         
    468468   lin = kin+lin;
    469 
     469 
    470470   for( ii=1; ii<=size(lin); ii++ )
    471471   {
     
    473473   }
    474474
    475    for( ii=1; ii<=n; ii++ )
     475   for( ii=1; ii<=n; ii++ )     
    476476   {
    477477      for( kk=1; kk<=size(eva); kk++ )
  • Singular/LIB/primitiv.lib

    r40c648 r3754ca  
    33// This library is for Singular 1.2 or newer
    44
    5 version="$Id: primitiv.lib,v 1.22 2005-05-06 14:39:03 hannes Exp $";
     5version="$Id: primitiv.lib,v 1.23 2009-04-15 11:18:27 seelisch Exp $";
    66category="Commutative Algebra";
    77info="
     
    6767 option(redSB);
    6868
    69  //-------- Mache so lange Random-Koord.wechsel, bis letztes Poly -------------
     69 //-------- Mache so lange Random-Koord.wechsel, bis letztes Polynom -------------
    7070 //--------------- das Minpoly eines primitiven Elements ist : ----------------
    7171 for (Fehlversuche=0; Fehlversuche<maxtry; Fehlversuche++) {
  • Singular/LIB/qhmoduli.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: qhmoduli.lib,v 1.17 2009-04-14 12:08:36 Singular Exp $";
     2version="$Id: qhmoduli.lib,v 1.18 2009-04-15 11:17:11 seelisch Exp $";
    33category="Singularities";
    44info="
     
    472472PURPOSE: compute the equations of the isometry group of the ideal I,
    473473         each generator of I is fixed by the stabilizer.
    474 ASSUME:  I semiquasihomogeneous ideal wrt 'w' with an isolated singularity at 0
     474ASSUME:  I semiquasihomogeneous ideal w.r.t. 'w' with an isolated singularity at 0
    475475RETURN:  list of two rings 'S1', 'S2'
    476476         - 'S1' contians the equations of the stabilizer (ideal 'stabid') @*
  • Singular/LIB/random.lib

    r40c648 r3754ca  
    11//(GMG/BM, last modified 22.06.96)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: random.lib,v 1.19 2009-04-14 12:00:14 Singular Exp $";
     3version="$Id: random.lib,v 1.20 2009-04-15 11:18:27 seelisch Exp $";
    44category="General purpose";
    55info="
     
    154154proc sparseHomogIdeal (int k, int u, list #)
    155155"USAGE:   sparseid(k,u[,o,p,b]);  k,u,o,p,b integers
    156 RETURN:  ideal having k homogeneous generators, each of random degree in the
    157          interval [u,o], p percent of terms in degree d are 0, the remaining
    158          have random coefficients in the interval [1,b], (default: o=u, p=75,
     156RETURN:  ideal having k homogeneous generators, each of random degree in the 
     157         interval [u,o], p percent of terms in degree d are 0, the remaining 
     158         have random coefficients in the interval [1,b], (default: o=u, p=75, 
    159159         b=30000)
    160160EXAMPLE: example sparseid; shows an example
     
    172172   {
    173173       id = maxideal(random(u, o)); // monomial basis of some degree
    174        m = sparsemat(size(id),1,p,b); // random coefficients
     174       m = sparsemat(size(id),1,p,b); // random coefficients       
    175175       i[ii] = (matrix(id)*m)[1,1];
    176176   }
     
    278278proc sparsepoly (int u, list #)
    279279"USAGE:   sparsepoly(u[,o,p,b]);  u,o,p,b integers
    280 RETURN:  poly having only terms in degree d, u<=d<=o, p percent of the terms
     280RETURN:  poly having only terms in degree d, u<=d<=o, p percentage of the terms
    281281         in degree d are 0, the remaining have random coefficients in [1,b),
    282282         (defaults: o=u, p=75, b=30000)
  • Singular/LIB/ratgb.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ratgb.lib,v 1.15 2009-04-14 12:00:15 Singular Exp $";
     2version="$Id: ratgb.lib,v 1.16 2009-04-15 11:15:40 seelisch Exp $";
    33category="Noncommutative";
    44info="
     
    1515
    1616PROCEDURES:
    17 ratstd(ideal I, int n);   compute Groebner basis in Ore localization of the basering wrt first n variables
     17ratstd(ideal I, int n);   compute Groebner basis in Ore localization of the basering w.r.t. first n variables
    1818
    1919SUPPORT: SpezialForschungsBereich F1301 of the Austrian FWF
     
    174174      va = L3[w][2];
    175175      for(z=1;z<=nvars(save)-is;z++)
    176       {
    177         vb[z] = va[is+z];
     176      { 
     177        vb[z] = va[is+z]; 
    178178      }
    179179      tmp3[1] = "a";
     
    223223
    224224  dbprint(ppl,"// -3- running groebner");
    225   // 3. compute G = GB(I) wrt. the elim. ord. for D
     225  // 3. compute G = GB(I) w.r.t. the elim. ord. for D
    226226  setring save;
    227227  //  ideal CI = imap(@RAT,CI);
     
    372372  setring A;
    373373  IAppel1;
    374   def F1 = ratstd(IAppel1,2);
    375   lead(pGBid);
     374  def F1 = ratstd(IAppel1,2); 
     375  lead(pGBid); 
    376376  setring F1; rGBid;
    377377}
     
    385385  setring A;
    386386  IAppel2;
    387   def F1 = ratstd(IAppel2,2);
    388   lead(pGBid);
     387  def F1 = ratstd(IAppel2,2); 
     388  lead(pGBid); 
    389389  setring F1; rGBid;
    390390}
     
    398398  setring A;
    399399  IAppel4;
    400   def F1 = ratstd(IAppel4,2);
    401   lead(pGBid);
     400  def F1 = ratstd(IAppel4,2); 
     401  lead(pGBid); 
    402402  setring F1; rGBid;
    403403}
  • Singular/LIB/realrad.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: realrad.lib,v 1.7 2008-12-12 11:26:34 Singular Exp $";
     2version="$Id: realrad.lib,v 1.8 2009-04-15 11:15:06 seelisch Exp $";
    33category="real algebra";
    44info="
     
    180180 list prim,prepared,nonshape,realu;
    181181 int r;//counter
    182  int l;//number of first poly with degree >1 or even
     182 int l;//number of first polynomial with degree >1 or even
    183183 l=size(j);
    184184 for (r=1;r<=l;r++)
     
    436436//////////////////////////////////////////////////////////////////////////////
    437437proc realpoly(poly f)
    438 "USAGE:    realpoly(f); a univariate poly f;
     438"USAGE:    realpoly(f); a univariate polynomial f;
    439439RETURN:    poly f, where f is the real part of the input f
    440440EXAMPLE:   example realpoly; shows an example"
     
    542542   }
    543543   //search for a p in Q[x_n] such that f is pos. sem. definite
    544    //iff for every isolating setting S={a_1,...,a_r} holds that
     544   //if and only if for every isolating setting S={a_1,...,a_r} holds that
    545545   //every f(x_1,..,x_n-1, a_i) is positiv semidefinite
    546546   //recursion of variables
     
    795795        in the Bernstein basis pf lr=(l,r) an a number m in Q
    796796 RETURN:a list erg=erg1,erg2 s.th. erg1=erg1[1],erg[2] and erg1[1] are
    797         the bernstein coefficients of P wrt to erg1[2]=(l,m) and erg2[1]
     797        the bernstein coefficients of P w.r.t. to erg1[2]=(l,m) and erg2[1]
    798798        is one for erg2[2]=(m,r)
    799799 EXAMPLE: Bernsteincoefficients shows no example
     
    10461046static proc search_first(ideal j,int start, int i)
    10471047"USAGE:    searchfirst(j, start, i);
    1048            id a reduced groebner basis wrt lex
     1048           id a reduced groebner basis w.r.t. lex
    10491049RETURN:    if i=1 then turns the number of the first non univariate entry
    10501050           with order >1 in its leading term after start
  • Singular/LIB/redcgs.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: redcgs.lib,v 1.5 2009-04-07 09:30:44 seelisch Exp $";
     2version="$Id: redcgs.lib,v 1.6 2009-04-15 11:15:06 seelisch Exp $";
    33category="General purpose";
    44info="
     
    125125subset(F,G);         If all elements of F belong to the ideal G it returns 1,
    126126                     and 0 otherwise.
    127 pdivi(f,F);          Pseudodivision of a poly f by an ideal F in @R. Returns a
     127pdivi(f,F);          Pseudodivision of a polynomial f by an ideal F in @R. Returns a
    128128                     list (r,q,m) such that m*f=r+sum(q.G).
    129129facvar(ideal J)      Returns all the free-square factors of the elements
     
    134134redspec(N,W);        Given null and non-null conditions depending only on the
    135135                     parameters it returns a red-specification.
    136 pnormalform(f,N,W);  Reduces the poly f wrt to the null condition ideal N and the
     136pnormalform(f,N,W);  Reduces the polynomial f w.r.t. to the null condition ideal N and the
    137137                     non-null condition ideal W (both depending on the parameters).
    138138buildtree(F);        Returns a list T describing a first reduced CGS of the ideal
     
    428428
    429429
    430 // pdivi : pseudodivision of a poly f by an ideal F in @R
     430// pdivi : pseudodivision of a polynomial f by an ideal F in @R
    431431//         in the ring @R
    432432// input:
     
    442442          pseudodivision, q is the ideal of quotients, and m is the
    443443          factor by which f is to be multiplied.
    444 NOTE:     Pseudodivision of a poly f by an ideal F in @R. Returns a
     444NOTE:     Pseudodivision of a polynomial f by an ideal F in @R. Returns a
    445445          list (r,q,m) such that m*f=r+sum(q.G).
    446446KEYWORDS: division, reduce
     
    609609};
    610610
    611 // pnormalform: reduces a polynomial wrt a red-spec dividing by N and eliminating factors in W.
     611// pnormalform: reduces a polynomial w.r.t. a red-spec dividing by N and eliminating factors in W.
    612612//              called in the ring @R
    613613//              operates in the ring @RP
     
    617617//         ideal W  (depends only on the parameters)
    618618//                   (N,W) must be a red-spec (depends only on the parameters)
    619 // output: poly f2 reduced wrt to the red-spec (N,W)
     619// output: poly f2 reduced w.r.t. to the red-spec (N,W)
    620620// note:   for security a lot of work is done. If (N,W) is already a red-spec it should be simplified
    621621proc pnormalform(poly f, ideal N, ideal W)
     
    705705          N1 is uniquely determined and no prime component of N1 contains none of
    706706          the polynomials in W1. The polynomials in W1 are prime and reduced
    707           wrt N1, and are considered non-null on the segment.
     707          w.r.t. N1, and are considered non-null on the segment.
    708708          L1 contains the list of prime components of N1.
    709709NOTE:     can be called from ring @R but it works in ring @P.
     
    921921
    922922// redgb: given a minimal bases (gb reducing) it
    923 // reduces each polynomial wrt to the others
     923// reduces each polynomial w.r.t. to the others
    924924proc redgb(ideal F, ideal N, ideal W)
    925925{
     
    24852485  ideal N;   // the summarized N
    24862486  ideal W;   // the summarized W
    2487   ideal F;   // the summarized poly j (can contain a sheaf instead of
     2487  ideal F;   // the summarized polynomial j (can contain a sheaf instead of
    24882488             // a single poly)
    24892489  ideal FF;  // the same as F but it can be ideal(0)
     
    29892989
    29902990// reduceR
    2991 // reduces the polynomial f wrt N, in the ring @P
     2991// reduces the polynomial f w.r.t. N, in the ring @P
    29922992proc reduceR(poly f, ideal N)
    29932993{
     
    37483748
    37493749// redgb: given a minimal bases (gb reducing) it
    3750 // reduces each polynomial wrt to the others
     3750// reduces each polynomial w.r.t. to the others
    37513751proc postredgb(ideal F)
    37523752{
  • Singular/LIB/reesclos.lib

    r40c648 r3754ca  
    288288
    289289      // compute the preimage of [p mod ker(k)] under phi in R(k-1):
    290       // as p is an element of im(phi), there is a poly h such that
     290      // as p is an element of im(phi), there is a polynomial h such that
    291291      // h(vars(R(k-1)) is mapped to [p mod ker (k)], and h can be com-
    292292      // puted as the normal form of a w.r.t <ker(k),Z(n)-phi(k)(n)> in R(k)[Z]
  • Singular/LIB/reszeta.lib

    r40c648 r3754ca  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: reszeta.lib,v 1.13 2009-03-30 11:56:03 dreyer Exp $";
     2version="$Id: reszeta.lib,v 1.14 2009-04-15 11:15:06 seelisch Exp $";
    33category="Commutative Algebra";
    44info="
     
    23942394  }
    23952395
    2396 //---the poly is constant
     2396//---the polynomial is constant
    23972397  if(size(v)==1){return(re);}
    23982398
    2399 //---the poly depends only on one variable or is homogeneous
     2399//---the polynomial depends only on one variable or is homogeneous
    24002400//---in 2 variables
    24012401  if((size(v)==2)||((size(v)==3)&&(homog(p))))
     
    24212421  if(size(v)>2){ERROR("getMinpoly:input depends on more then 2 variables");}
    24222422
    2423 //---the general case, the poly is considered as poly in x an y now
     2423//---the general case, the polynomial is considered as polynomial in x an y now
    24242424  ring T=0,(x,y),lp;
    24252425  ideal M,N;
     
    24592459  }
    24602460  poly L=f*(diff(g,y)-diff(h,x))+h*diff(f,x)-g*diff(f,y);
    2461 //---according to the theory f is absolutely irreducible iff
     2461//---according to the theory f is absolutely irreducible if and only if
    24622462//---L(g,h)=0 has no non-trivial solution g,h
    24632463//---(g=diff(f,x),h=diff(f,y) is always a solution)
     
    45654565//---Auxilliary procedure for fetchInTree!
    45664566//---Assume E prime ideal, Z+E eqidimensional,
    4567 //---ht(E)+r=ht(Z+E). Compute  P=<p[1],...,p[r]> in Z+E, and poly f,
     4567//---ht(E)+r=ht(Z+E). Compute  P=<p[1],...,p[r]> in Z+E, and polynomial f,
    45684568//---such that radical(Z+E)=radical((E+P):f)
    45694569   int i,j,d,e;
  • Singular/LIB/ring.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ring.lib,v 1.33 2009-04-06 09:17:01 seelisch Exp $";
     2version="$Id: ring.lib,v 1.34 2009-04-15 11:18:27 seelisch Exp $";
    33category="General purpose";
    44info="
     
    419419         into the basering.
    420420         If no 2nd argument is present, the names are the same as in R. If,
    421          say, f is a poly in R and the 2nd argument is the string \"R\", then f
     421         say, f is a polynomial in R and the 2nd argument is the string \"R\", then f
    422422         is mapped to f_R etc.
    423423RETURN:  no return value
     
    465465         into the basering by applying imap to all objects of R.
    466466         If no 2nd argument is present, the names are the same as in R. If,
    467          say, f is a poly in R and the 3rd argument is the string \"R\", then f
     467         say, f is a polynomial in R and the 3rd argument is the string \"R\", then f
    468468         is mapped to f_R etc.
    469469RETURN:  no return value
     
    511511         matrix, map) into the basering by mapping the j-th variable of R to
    512512         the j-th generator of the ideal i. If no 3rd argument is present, the
    513          names are the same as in R. If, say, f is a poly in R and the 3rd
     513         names are the same as in R. If, say, f is a polynomial in R and the 3rd
    514514         argument is the string \"R\", then f is mapped to f_R etc.
    515515RETURN:  no return value.
  • Singular/LIB/rootsmr.lib

    r40c648 r3754ca  
    1 // $Id: rootsmr.lib,v 1.5 2009-04-06 12:39:02 seelisch Exp $
     1// $Id: rootsmr.lib,v 1.6 2009-04-15 11:15:06 seelisch Exp $
    22// E. Tobis  12.Nov.2004, April 2004
    33// last change 7. May 2005 (G.-M. Greuel)
     
    6060  //Note on complexity: Let n = no of complex roots of I (= vdim(std(I)).
    6161  //Then the algorithm needs:
    62   //1 std(I) and ~n NF computations (of randcharpoly wrt I)
     62  //1 std(I) and ~n NF computations (of randcharpoly w.r.t. I)
    6363
    6464  if (isparam(I)) {
     
    119119  //Note on complexity: Let n = no of complex roots of I (= vdim(std(I)).
    120120  //Then the algotithm needs:
    121   //1 std(I) and (1/2)n*(n+1)^2 ~ 1/2n^3 NF computations (of monomials wrt I)
     121  //1 std(I) and (1/2)n*(n+1)^2 ~ 1/2n^3 NF computations (of monomials w.r.t. I)
    122122
    123123  if (isparam(I)) {
     
    399399  int N = size(B);
    400400
    401   // We first compute the normal form of f wrt I
     401  // We first compute the normal form of f w.r.t. I
    402402  g = reduce(f,I);
    403403  int n = size(g);    //allways n <= N
     
    428428
    429429static proc isSquare(matrix m)
    430 // returns 1 iff m is a square matrix
     430// returns 1 if and only if m is a square matrix
    431431{
    432432  return (nrows(m)==ncols(m));
     
    497497proc verify(poly p,ideal B,ideal I)
    498498"USAGE:     verify(p,B,I); p poly, B,I,ideal
    499 RETURN:    integer: 1 iff the polynomial p splits the points of V(I).
     499RETURN:    integer: 1 if and only if the polynomial p splits the points of V(I).
    500500           It's used to check the result of randcharpoly
    501501ASSUME:    I is given by a Groebner basis and B is an ordered monomial basis of r/I,
  • Singular/LIB/rootsur.lib

    r40c648 r3754ca  
    1 // $Id: rootsur.lib,v 1.7 2009-04-06 12:39:02 seelisch Exp $
     1// $Id: rootsur.lib,v 1.8 2009-04-15 11:15:06 seelisch Exp $
    22// E. Tobis  12.Nov.2004, April 2004
    33// last change 5. May 2005 (G.-M. Greuel)
     
    2424  whichvariable(p) The only variable of a univariate monomial (or 0)
    2525  varsigns(p)      Number of sign changes in a list
    26   boundBuFou(p,a,b) Bound for number of real roots of poly p in interval (a,b)
    27   boundposDes(p)   Bound for the number of positive real roots of poly p
    28   boundDes(p)      Bound for the number of real roots of poly p
    29   allrealst(p)     Checks whether all the roots of a poly are real (via Sturm)
     26  boundBuFou(p,a,b) Bound for number of real roots of polynomial p in interval (a,b)
     27  boundposDes(p)   Bound for the number of positive real roots of polynomial p
     28  boundDes(p)      Bound for the number of real roots of polynomial p
     29  allrealst(p)     Checks whether all the roots of a polynomial are real (via Sturm)
    3030  maxabs(p)        A bound for the maximum absolute value of a root of a poly
    31   allreal(p)       Checks whether all the roots of a poly are real (via St-Ha)
    32   sturm(p,a,b)     Number of real roots of a poly on an interval (via Sturm)
     31  allreal(p)       Checks whether all the roots of a polynomial are real (via St-Ha)
     32  sturm(p,a,b)     Number of real roots of a polynomial on an interval (via Sturm)
    3333  sturmseq(p)      Sturm sequence of a polynomial
    34   sturmha(p,a,b)   Number of real roots of a poly in (a,b) (via Sturm-Habicht)
     34  sturmha(p,a,b)   Number of real roots of a polynomial in (a,b) (via Sturm-Habicht)
    3535  sturmhaseq(p)    A Sturm-Habicht Sequence of a polynomial
    3636  reverse(l)       Reverses a list
    3737  nrroots(p)       The number of real roots of p
    38   isparam(p)       Returns 0 iff the polynomial has non-parametric coefficients
     38  isparam(p)       Returns 0 if and only if the polynomial has non-parametric coefficients
    3939
    4040KEYWORDS:         real roots, univariate polynomial
     
    384384proc allrealst(poly p)
    385385"USAGE:     allrealst(p); poly p
    386 RETURN:    int: 1 iff all the roots of p are real, 0 otherwise.
     386RETURN:    int: 1 if and only if all the roots of p are real, 0 otherwise.
    387387           Checks by using Sturm's Theorem whether all the roots of p are real
    388388ASSUME:    p is a univariate polynomial with rational coefficients
     
    580580proc allreal(poly p)
    581581"USAGE:     allreal(p);
    582 RETURN:    int: 1 iff all the roots of p are real, 0 otherwise
     582RETURN:    int: 1 if and only if all the roots of p are real, 0 otherwise
    583583SEE ALSO:  allrealst
    584584EXAMPLE:   example allreal; shows an example"
  • Singular/LIB/sing.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: sing.lib,v 1.33 2009-02-23 15:12:44 Singular Exp $";
     2version="$Id: sing.lib,v 1.34 2009-04-15 11:15:56 seelisch Exp $";
    33category="Singularities";
    44info="
     
    1111 deform(i);             infinitesimal deformations of ideal i
    1212 dim_slocus(i);         dimension of singular locus of ideal i
    13  is_active(f,id);       is poly f an active element mod id? (id ideal/module)
     13 is_active(f,id);       is polynomial f an active element mod id? (id ideal/module)
    1414 is_ci(i);              is ideal i a complete intersection?
    1515 is_is(i);              is ideal i an isolated singularity?
    16  is_reg(f,id);          is poly f a regular element mod id? (id ideal/module)
     16 is_reg(f,id);          is polynomial f a regular element mod id? (id ideal/module)
    1717 is_regs(i[,id]);       are gen's of ideal i regular sequence modulo id?
    1818 locstd(i);             SB for local degree ordering without cancelling units
     
    977977RETURN:  a standard basis for a local degree ordering
    978978NOTE:    the procedure homogenizes id w.r.t. a new 1st variable @t@, computes
    979          a SB wrt (dp(1),dp) and substitutes @t@ by 1.
     979         a SB w.r.t. (dp(1),dp) and substitutes @t@ by 1.
    980980         Hence the result is a SB with respect to an ordering which sorts
    981981         first w.r.t. the order and then refines it with dp. This is a
  • Singular/LIB/solve.lib

    r40c648 r3754ca  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: solve.lib,v 1.38 2009-04-06 09:17:01 seelisch Exp $";
     2version="$Id: solve.lib,v 1.39 2009-04-15 11:24:12 seelisch Exp $";
    33category="Symbolic-numerical solving";
    44info="
     
    1212ures_solve(i,[..]);     find all roots of 0-dimensional ideal i with resultants
    1313mp_res_mat(i,[..]);     multipolynomial resultant matrix of ideal i
    14 interpolate(p,v,d);     interpolate poly from evaluation points i and results j
     14interpolate(p,v,d);     interpolate polynomial from evaluation points i and results j
    1515fglm_solve(i,[..]);     find roots of 0-dim. ideal using FGLM and lex_solve
    1616lex_solve(i,p,[..]);    find roots of reduced lexicographic standard basis
     
    274274    list l = laguerre_solve(f);
    275275    l;
    276     // check result, value of substituted poly should be near to zero
     276    // check result, value of substituted polynomial should be near to zero
    277277    // remember that l contains a list of strings
    278278    // in the case of a different ring
     
    479479}
    480480/*
    481 * returns a poly without zeroroots
     481* returns a polynomial without zeroroots
    482482*/
    483483static proc divzero(poly f,int iv)
     
    16021602                    dd++;
    16031603                    // hier Leading-Exponent pruefen???
    1604                     // oder ist das Poly immer als letztes in der Liste?!?
     1604                    // oder ist das Polynom immer als letztes in der Liste?!?
    16051605                    // leadexp(ps)
    16061606                }
  • Singular/LIB/standard.lib

    r40c648 r3754ca  
    55//### Todo: im lokalen Fall die Hilbert-Samuel Funktion verwenden
    66//////////////////////////////////////////////////////////////////////////////
    7 version="$Id: standard.lib,v 1.108 2009-04-14 09:54:52 seelisch Exp $";
     7version="$Id: standard.lib,v 1.109 2009-04-15 11:15:56 seelisch Exp $";
    88category="Miscellaneous";
    99info="
     
    1818 fprintf(link,fmt,..)   writes formatted string to link
    1919 printf(fmt,...)        displays formatted string
    20  weightKB(stc,dd,vl)    degree dd part of a kbase wrt. some weigths
     20 weightKB(stc,dd,vl)    degree dd part of a kbase w.r.t. some weigths
    2121 qslimgb(i)             computes a standard basis with slimgb in a qring
    2222 par2varRing([i])       create a ring making pars to vars, together with i
  • Singular/LIB/stratify.lib

    r40c648 r3754ca  
    11// (anne, last modified 23.5.00) last modified: 12.12.2000
    22/////////////////////////////////////////////////////////////////////////////
    3 version="$Id: stratify.lib,v 1.8 2006-07-18 15:22:16 Singular Exp $";
     3version="$Id: stratify.lib,v 1.9 2009-04-15 11:15:56 seelisch Exp $";
    44category="Invariant theory";
    55info="
     
    706706      retlist[i][3]=leer;
    707707      i=j-1;
    708 // retlist[..][3] is empty iff there was more than one entry to this intvec
     708// retlist[..][3] is empty if and only if there was more than one entry to this intvec
    709709    }
    710710    if(j>size(stratlist)) break;
  • Singular/LIB/surf.lib

    r40c648 r3754ca  
    11// last modified 21.07.2005, Oliver Wienand
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surf.lib,v 1.33 2009-04-06 12:39:02 seelisch Exp $";
     3version="$Id: surf.lib,v 1.34 2009-04-15 11:15:56 seelisch Exp $";
    44category="Visualization";
    55info="
     
    3232each contains the sums of all degrees in this variable of all monomials
    3333occuring in the ideal.
    34 An entry is zero iff the corresponding variable does not occur in the ideal.
     34An entry is zero if and only if the corresponding variable does not occur in the ideal.
    3535"
    3636{
  • Singular/LIB/teachstd.lib

    r40c648 r3754ca  
    22//GMG, last modified 28.9.01
    33///////////////////////////////////////////////////////////////////////////////
    4 version="$Id: teachstd.lib,v 1.12 2009-04-14 12:00:15 Singular Exp $";
     4version="$Id: teachstd.lib,v 1.13 2009-04-15 11:23:27 seelisch Exp $";
    55category="Teaching";
    66info="
     
    1919 tail(f);               tail of f
    2020 sameComponent(f,g);    test for same module component of lead(f) and lead(g)
    21  leadmonomial(f);       leading monomial as poly (also for vectors)
    22  monomialLcm(m,n);      lcm of monomials m and n as poly (also for vectors)
     21 leadmonomial(f);       leading monomial as polynomial (also for vectors)
     22 monomialLcm(m,n);      lcm of monomials m and n as polynomial (also for vectors)
    2323 spoly(f[,1]);          s-polynomial of f [symmetric form]
    2424 minEcart(T,h);         element g from T of minimal ecart s.t. LM(g)|LM(h)
  • Singular/LIB/tropical.lib

    r40c648 r3754ca  
    1 version="$Id: tropical.lib,v 1.15 2009-04-14 12:00:15 Singular Exp $";
     1version="$Id: tropical.lib,v 1.16 2009-04-15 11:22:37 seelisch Exp $";
    22category="Tropical Geometry";
    33info="
     
    88@*               Thomas Markwig,  email: keilen@mathematik.uni-kl.de
    99
    10 WARNING:
     10WARNING: 
    1111- tropicalLifting will only work with LINUX and if in addition gfan is installed.
    12 @*- drawTropicalCurve and drawTropicalNewtonSubdivision will only display the
    13 @*  tropical curve with LINUX and if in addition latex and kghostview
     12@*- drawTropicalCurve and drawTropicalNewtonSubdivision will only display the 
     13@*  tropical curve with LINUX and if in addition latex and kghostview 
    1414@*  are installed.
    15 @*- For tropicalLifting in the definition of the basering the parameter t
     15@*- For tropicalLifting in the definition of the basering the parameter t 
    1616@*  from the Puiseux series field C{{t}} must be defined as a variable,
    1717@*  while for all other procedures it must be defined as a parameter.
    1818
    1919THEORY:
    20   Fix some base field K and a bunch of lattice points v0,...,vm in the integer
    21   lattice Z^n, then this defines a toric variety as the closure of (K*)^n in
    22   the projective space P^m, where the torus is embedded via the map sending a
     20  Fix some base field K and a bunch of lattice points v0,...,vm in the integer 
     21  lattice Z^n, then this defines a toric variety as the closure of (K*)^n in 
     22  the projective space P^m, where the torus is embedded via the map sending a 
    2323  point x in (K*)^n to the point (x^v0,...,x^vm).
    24   The generic hyperplane sections are just the images of the hypersurfaces
     24  The generic hyperplane sections are just the images of the hypersurfaces 
    2525  in (K*)^n defined by the polynomials f=a0*x^v0+...+am*x^vm=0. Some properties
    26   of these hypersurfaces can be studied via tropicalisation.
    27 
    28   For this we suppose that K=C{{t}} is the field of Puiseux series over the
     26  of these hypersurfaces can be studied via tropicalisation. 
     27
     28  For this we suppose that K=C{{t}} is the field of Puiseux series over the 
    2929  field of complex numbers (or any other field with a valuation into the real
    30   numbers). One associates to the hypersurface given by f=a0*x^v0+...+am*x^vm
     30  numbers). One associates to the hypersurface given by f=a0*x^v0+...+am*x^vm 
    3131  the tropical hypersurface defined by the tropicalisation
    32   trop(f)=min{val(a0)+<v0,x>,...,val(am)+<vm,x>}.
     32  trop(f)=min{val(a0)+<v0,x>,...,val(am)+<vm,x>}. 
    3333  Here, <v,x> denotes the standard scalar product of the integer vector v in Z^n
    3434  with the vector x=(x1,...,xn) of variables, so that trop(f) is a piecewise
    35   linear function on R^n. The corner locus of this function (i.e. the points
    36   at which the minimum is attained a least twice) is the tropical hypersurface
    37   defined by trop(f).
    38   The theorem of Newton-Kapranov states that this tropical hypersurface is
    39   the same as if one computes pointwise the valuation of the hypersurface
    40   given by f. The analogue holds true if one replaces one equation f by an
    41   ideal I. A constructive proof of the theorem is given by an adapted
    42   version of the Newton-Puiseux algorithm. The hard part is to find a point
    43   in the variety over C{{t}} which corresponds to a given point in the
     35  linear function on R^n. The corner locus of this function (i.e. the points 
     36  at which the minimum is attained a least twice) is the tropical hypersurface 
     37  defined by trop(f). 
     38  The theorem of Newton-Kapranov states that this tropical hypersurface is 
     39  the same as if one computes pointwise the valuation of the hypersurface 
     40  given by f. The analogue holds true if one replaces one equation f by an 
     41  ideal I. A constructive proof of the theorem is given by an adapted 
     42  version of the Newton-Puiseux algorithm. The hard part is to find a point 
     43  in the variety over C{{t}} which corresponds to a given point in the 
    4444  tropical variety.
    4545
    46   It is the purpose of this library to provide basic means to deal with
    47   tropical varieties. Of course we cannot represent the field of Puiseux
    48   series over C in its full strength, however, in order to compute interesting
    49   examples it will be sufficient to replace the complex numbers C by the
    50   rational numbers Q and to replace Puiseux series in t by rational functions
    51   in t, i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t].
     46  It is the purpose of this library to provide basic means to deal with 
     47  tropical varieties. Of course we cannot represent the field of Puiseux 
     48  series over C in its full strength, however, in order to compute interesting 
     49  examples it will be sufficient to replace the complex numbers C by the 
     50  rational numbers Q and to replace Puiseux series in t by rational functions 
     51  in t, i.e. we replace C{{t}} by Q(t), or sometimes even by Q[t]. 
    5252  Note, that this in particular forbids rational exponents for the t's.
    5353
    54   Moreover, in Singular no negative exponents of monomials are allowed, so
    55   that the integer vectors vi will have to have non-negative entries.
    56   Shifting all exponents by a fixed integer vector does not change the
    57   tropicalisation nor does it change the toric variety. Thus this does not
     54  Moreover, in @sc{Singular} no negative exponents of monomials are allowed, so
     55  that the integer vectors vi will have to have non-negative entries. 
     56  Shifting all exponents by a fixed integer vector does not change the 
     57  tropicalisation nor does it change the toric variety. Thus this does not 
    5858  cause any restriction.
    59   If, however, for some reason you prefer to work with general vi, then you
    60   have to pass right away to the tropicalisation of the equations, whereever
     59  If, however, for some reason you prefer to work with general vi, then you 
     60  have to pass right away to the tropicalisation of the equations, whereever 
    6161  this is allowed -- these are linear polynomials where the constant coefficient
    62   corresponds to the valuation of the original coefficient and where
    63   the non-constant coefficient correspond to the exponents of the monomials,
    64   thus they may be rational numbers respectively negative numbers:
     62  corresponds to the valuation of the original coefficient and where 
     63  the non-constant coefficient correspond to the exponents of the monomials, 
     64  thus they may be rational numbers respectively negative numbers: 
    6565  e.g. if f=t^{1/2}*x^{-2}*y^3+2t*x*y+4  then  trop(f)=min{1/2-2x+3y,1+x+y,0}.
    6666
    6767  The main tools provided in this library are as follows:
    68 @*  - tropicalLifting    implements the constructive proof of the Theorem of
    69                          Newton-Kapranov and constructs a point in the variety
    70                          over C{{t}} corresponding to a given point in the
    71                          corresponding tropical variety associated to an
    72                          ideal I; the generators of I have to be in the
    73                          polynomial ring Q[t,x1,...,xn] considered as a
    74                          subring of C{{t}}[x1,...,xn]; a solution will be
    75                          constructed up to given order; note that several
     68@*  - tropicalLifting    implements the constructive proof of the Theorem of 
     69                         Newton-Kapranov and constructs a point in the variety 
     70                         over C{{t}} corresponding to a given point in the 
     71                         corresponding tropical variety associated to an 
     72                         ideal I; the generators of I have to be in the 
     73                         polynomial ring Q[t,x1,...,xn] considered as a 
     74                         subring of C{{t}}[x1,...,xn]; a solution will be 
     75                         constructed up to given order; note that several 
    7676                         field extensions of Q might be necessary throughout
    7777                         the intermediate computations; the procedures use
    7878                         the external program gfan
    79 @*  - drawTropicalCurve  visualises a tropical plane curve either given by a
    80                          polynomial in Q(t)[x,y] or by a list of linear
    81                          polynomials of the form ax+by+c with a,b in Z and c
     79@*  - drawTropicalCurve  visualises a tropical plane curve either given by a 
     80                         polynomial in Q(t)[x,y] or by a list of linear 
     81                         polynomials of the form ax+by+c with a,b in Z and c 
    8282                         in Q; latex must be installed on your computer
    83 @*  - tropicalJInvariant computes the tropical j-invaiant of a tropical
     83@*  - tropicalJInvariant computes the tropical j-invaiant of a tropical 
    8484                         elliptic curve
    8585@*  - jInvariant         computes the j-invariant of an elliptic curve
    86 @*  - weierstrassForm     computes the Weierstrass form of an elliptic curve
     86@*  - weierstrassForm     computes the Weierstrass form of an elliptic curve 
    8787
    8888PROCEDURES FOR TROPICAL LIFTING:
    89   tropicalLifting          computes a point in the tropical variety
    90   displayTropicalLifting   displays the output of tropicalLifting
     89  tropicalLifting()          computes a point in the tropical variety
     90  displayTropicalLifting()   displays the output of tropicalLifting
    9191
    9292PROCEDURES FOR DRAWING TROPICAL CURVES:
    93   tropicalCurve            computes a tropical curve and its Newton subdivision
    94   drawTropicalCurve        produces a post script image of a tropical curve
    95   drawNewtonSubdivision    produces a post script image of a Newton subdivision
     93  tropicalCurve()            computes a tropical curve and its Newton subdivision
     94  drawTropicalCurve()        produces a post script image of a tropical curve
     95  drawNewtonSubdivision()    produces a post script image of a Newton subdivision
    9696
    9797PROCEDURES FOR J-INVARIANTS:
    98   tropicalJInvariant       computes the tropical j-invariant of a tropical curve
    99   weierstrassForm          computes the Weierstrass form of a cubic polynomial
    100   jInvariant               computes the j-invariant of a cubic polynomial
     98  tropicalJInvariant()       computes the tropical j-invariant of a tropical curve
     99  weierstrassForm()          computes the Weierstrass form of a cubic polynomial
     100  jInvariant()               computes the j-invariant of a cubic polynomial
    101101
    102102GENERAL PROCEDURES:
    103   conicWithTangents  computes a conic through five points with tangents
    104   tropicalise        computes the tropicalisation of a polynomial
    105   tropicaliseSet     computes the tropicalisation several polynomials
    106   tInitialForm       computes the tInitial form of a poly in Q[t,x_1,...,x_n]
    107   tInitialIdeal      computes the tInitial ideal of an ideal in Q[t,x_1,...,x_n]
    108   initialForm        computes the initial form of poly in Q[x_1,...,x_n]
    109   initialIdeal       computes the initial ideal of an ideal in Q[x_1,...,x_n]
     103  conicWithTangents()  computes a conic through five points with tangents
     104  tropicalise()        computes the tropicalisation of a polynomial
     105  tropicaliseSet()     computes the tropicalisation several polynomials
     106  tInitialForm()       computes the tInitial form of a polynomial in Q[t,x_1,...,x_n]
     107  tInitialIdeal()      computes the tInitial ideal of an ideal in Q[t,x_1,...,x_n]
     108  initialForm()        computes the initial form of poly in Q[x_1,...,x_n]
     109  initialIdeal()       computes the initial ideal of an ideal in Q[x_1,...,x_n]
    110110
    111111PROCEDURES FOR LATEX CONVERSION:
    112   texNumber          outputs the texcommand for the leading coefficient of poly
    113   texPolynomial      outputs the texcommand for the polynomial poly
    114   texMatrix          outputs the texcommand for the matrix
    115   texDrawBasic       embeds output of texDrawTropical in a texdraw environment
    116   texDrawTropical    computes the texdraw commands for a tropical curve
    117   texDrawNewtonSubdivision   computes texdraw commands for a Newton subdivision
    118   texDrawTriangulation       computes texdraw commands for a triangulation
     112  texNumber()          outputs the texcommand for the leading coefficient of poly
     113  texPolynomial()      outputs the texcommand for the polynomial poly
     114  texMatrix()          outputs the texcommand for the matrix
     115  texDrawBasic()       embeds output of texDrawTropical in a texdraw environment
     116  texDrawTropical()    computes the texdraw commands for a tropical curve
     117  texDrawNewtonSubdivision()   computes texdraw commands for a Newton subdivision
     118  texDrawTriangulation()       computes texdraw commands for a triangulation
    119119
    120120AUXILARY PROCEDURES:
    121   radicalMemberShip     checks radical membership
    122   tInitialFormPar       computes the t-initial form of poly in Q(t)[x_1,...,x_n]
    123   tInitialFormParMax    same as tInitialFormPar, but uses maximum
    124   solveTInitialFormPar  displays approximated solution of a 0-dim ideal
    125   detropicalise         computes the detropicalisation of a linear form
    126   dualConic             computes the dual of an affine plane conic
    127   parameterSubstitute   substitutes in the poly the parameter t by t^N
    128   tropicalSubst         makes certain substitutions in a tropical polynomial
    129   randomPoly            computes a polynomial with random coefficients
    130   cleanTmp              clears /tmp from files created by other procedures
     121  radicalMemberShip()     checks radical membership
     122  tInitialFormPar()       computes the t-initial form of poly in Q(t)[x_1,...,x_n]
     123  tInitialFormParMax()    same as tInitialFormPar, but uses maximum
     124  solveTInitialFormPar()  displays approximated solution of a 0-dim ideal
     125  detropicalise()         computes the detropicalisation of a linear form
     126  dualConic()             computes the dual of an affine plane conic
     127  parameterSubstitute()   substitutes in the polynomial the parameter t by t^N
     128  tropicalSubst()         makes certain substitutions in a tropical polynomial
     129  randomPoly()            computes a polynomial with random coefficients
     130  cleanTmp()              clears /tmp from files created by other procedures
    131131
    132132KEYWORDS:        tropical curves; tropical polynomials
     
    155155/// - eliminatecomponents
    156156/// - findzerosAndBasictransform
    157 /// - ordermaximalideals
     157/// - ordermaximalideals 
    158158/// - verticesTropicalCurve
    159159/// - bunchOfLines
     
    204204
    205205///////////////////////////////////////////////////////////////////////////////
    206 /// Procedures concerned with tropical parametrisation
     206/// Procedures concerned with tropical parametrisation 
    207207///////////////////////////////////////////////////////////////////////////////
    208208
    209209proc tropicalLifting (ideal i,intvec w,int ordnung,list #)
    210210"USAGE:  tropicalLifting(i,w,ord[,opt]); i ideal, w intvec, ord int, opt string
    211 ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n)
    212            and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i,
    213            and ord is the order up to which a point in V(i) over Q{{t}}
    214            lying over (w_1/w_0,...,w_n/w_0) shall be computed;
     211ASSUME:  - i is an ideal in Q[t,x_1,...,x_n], w=(w_0,w_1,...,w_n) 
     212           and (w_1/w_0,...,w_n/w_0) is in the tropical variety of i, 
     213           and ord is the order up to which a point in V(i) over Q{{t}} 
     214           lying over (w_1/w_0,...,w_n/w_0) shall be computed; 
    215215           w_0 may NOT be ZERO
    216 @*       - the basering should not have any parameters on its own
    217            and it should have a global monomial ordering,
     216@*       - the basering should not have any parameters on its own 
     217           and it should have a global monomial ordering, 
    218218           e.g. ring r=0,(t,x(1..n)),dp;
    219 @*       - the first variable of the basering will be treated as the
     219@*       - the first variable of the basering will be treated as the 
    220220           parameter t in the Puiseux series field
    221 @*       - the optional parameter opt should be one or more strings among
     221@*       - the optional parameter opt should be one or more strings among 
    222222           the following:
    223223@*         'isZeroDimensional'  : the dimension i is zero (not to be checked);
    224 @*         'isPrime'            : the ideal is prime over Q(t)[x_1,...,x_n]
     224@*         'isPrime'            : the ideal is prime over Q(t)[x_1,...,x_n] 
    225225                                  (not to be checked);
    226 @*         'isInTrop'           : (w_1/w_0,...,w_n/w_0) is in the tropical
     226@*         'isInTrop'           : (w_1/w_0,...,w_n/w_0) is in the tropical 
    227227                                  variety (not to be checked);
    228 @*         'oldGfan'            : uses gfan version 0.2.1 or less
    229 @*         'findAll'            : find all solutions of a zero-dimensional
     228@*         'oldGfan'            : uses gfan version 0.2.1 or less 
     229@*         'findAll'            : find all solutions of a zero-dimensional 
    230230                                  ideal over (w_1/w_0,...,w_n/w_0)
    231231@*         'noAbs'              : do NOT use absolute primary decomposition
     
    233233RETURN:  IF THE OPTION 'findAll' WAS NOT SET THEN:
    234234@*       list, containing one lifting of the given point (w_1/w_0,...,w_n/w_0)
    235                in the tropical variety of i to a point in V(i) over Puiseux
     235               in the tropical variety of i to a point in V(i) over Puiseux 
    236236               series field up to the first ord terms; more precisely:
    237237@*             IF THE OPTION 'noAbs' WAS NOT SET, THEN:
     
    248248@*       IF THE OPITON 'findAll' WAS SET, THEN:
    249249@*       list, containing ALL liftings of the given point ((w_1/w_0,...,w_n/w_0)
    250                in the tropical variety of i to a point in V(i) over Puiseux
    251                series field up to the first ord terms, if the ideal is
     250               in the tropical variety of i to a point in V(i) over Puiseux 
     251               series field up to the first ord terms, if the ideal is 
    252252               zero-dimensional over Q{{t}};
    253                more precisely, each entry of the list is a list l as computed
     253               more precisely, each entry of the list is a list l as computed 
    254254               if  'findAll' was NOT set
    255255@*       WE NOW DESCRIBE THE LIST ENTRIES IF 'findAll' WAS NOT SET:
    256 @*       - the ring l[1] contains an ideal LIFT, which contains
     256@*       - the ring l[1] contains an ideal LIFT, which contains 
    257257           a point in V(i) lying over w up to the first ord terms;
    258 @*       - and if the integer l[2] is N then t has to be replaced by t^1/N
     258@*       - and if the integer l[2] is N then t has to be replaced by t^1/N 
    259259           in the lift, or alternatively replace t by t^N in the defining ideal
    260 @*       - if the k+1st entry of l[3] is  non-zero, then the kth component of
    261            LIFT has to be multiplied t^(-l[3][k]/l[3][1]) AFTER substituting t
     260@*       - if the k+1st entry of l[3] is  non-zero, then the kth component of 
     261           LIFT has to be multiplied t^(-l[3][k]/l[3][1]) AFTER substituting t 
    262262           by t^1/N
    263 @*       - unless the option 'noResubst' was set, the kth entry of list l[4]
     263@*       - unless the option 'noResubst' was set, the kth entry of list l[4] 
    264264           is a string which represents the kth generator of
    265            the ideal i where the coordinates have been replaced by the result
     265           the ideal i where the coordinates have been replaced by the result 
    266266           of the lift;
    267            the t-order of the kth entry should in principle be larger than the
     267           the t-order of the kth entry should in principle be larger than the 
    268268           t-degree of LIFT
    269 @*       - if the option 'noAbs' was set, then the string in l[5] defines
    270            a maximal ideal in the field Q[X(1),...,X(k)], where X(1),...,X(k)
     269@*       - if the option 'noAbs' was set, then the string in l[5] defines 
     270           a maximal ideal in the field Q[X(1),...,X(k)], where X(1),...,X(k) 
    271271           are the parameters of the ring in l[1];
    272            the basefield of the ring in l[1] should be considered modulo this
     272           the basefield of the ring in l[1] should be considered modulo this 
    273273           ideal
    274 REMARK:  - it is best to use the procedure displayTropicalLifting to
     274REMARK:  - it is best to use the procedure displayTropicalLifting to 
    275275           display the result
    276276@*       - the option 'findAll' cannot be used if 'noAbs' is set
    277277@*       - if the parameter 'findAll' is set AND the ideal i is zero-dimensional
    278            in Q{{t}}[x_1,...,x_n] then ALL points in V(i) lying over w are
     278           in Q{{t}}[x_1,...,x_n] then ALL points in V(i) lying over w are 
    279279           computed up to order ord; if the ideal is not-zero dimenisonal, then
    280280           only the points in the ideal after cutting down to dimension zero
    281281           will be computed
    282282@*       - the procedure requires that the program GFAN is installed on your
    283            computer; if you have GFAN version less than 0.3.0 then you must
     283           computer; if you have GFAN version less than 0.3.0 then you must 
    284284           use the optional parameter 'oldGfan'
    285 @*       - the procedure requires the Singular procedure absPrimdecGTZ to be
     285@*       - the procedure requires the @sc{Singular} procedure absPrimdecGTZ to be
    286286           present in the package primdec.lib, unless the option 'noAbs' is set;
    287            but even if absPrimdecGTZ is present it might be necessary to set
    288            the option 'noAbs' in order to avoid the costly absolute primary
    289            decomposition; the side effect is that the field extension which is
     287           but even if absPrimdecGTZ is present it might be necessary to set 
     288           the option 'noAbs' in order to avoid the costly absolute primary 
     289           decomposition; the side effect is that the field extension which is 
    290290           computed throughout the recursion might need more than one
    291291           parameter to be described
    292292@*       - since Q is infinite, the procedure finishes with probability one
    293 @*       - you can call the procedure with Z/pZ as base field instead of Q,
     293@*       - you can call the procedure with Z/pZ as base field instead of Q, 
    294294           but there are some problems you should be aware of:
    295 @*         + the Puiseux series field over the algebraic closure of Z/pZ is
    296              NOT algebraicall closed, and thus there may not exist a point in
    297              V(i) over the Puiseux series field with the desired valuation;
     295@*         + the Puiseux series field over the algebraic closure of Z/pZ is 
     296             NOT algebraicall closed, and thus there may not exist a point in 
     297             V(i) over the Puiseux series field with the desired valuation; 
    298298             so there is no chance that the procedure produced a sensible output
    299              - e.g. if i=tx^p-tx-1
    300 @*         + if the dimension of i over Z/pZ(t) is not zero the process of
    301              reduction to zero might not work if the characteristic is small
     299             - e.g. if i=tx^p-tx-1 
     300@*         + if the dimension of i over Z/pZ(t) is not zero the process of 
     301             reduction to zero might not work if the characteristic is small 
    302302             and you are unlucky
    303 @*         + the option 'noAbs' has to be used since absolute primary
    304              decomposition in Singular only works in characteristic zero
    305 @*       - the basefield should either be Q or Z/pZ for some prime p;
    306            field extensions will be computed if necessary; if you need
    307            parameters or field extensions from the beginning they should
    308            rather be simulated as variables possibly adding their relations to
     303@*         + the option 'noAbs' has to be used since absolute primary 
     304             decomposition in @sc{Singular} only works in characteristic zero
     305@*       - the basefield should either be Q or Z/pZ for some prime p; 
     306           field extensions will be computed if necessary; if you need 
     307           parameters or field extensions from the beginning they should 
     308           rather be simulated as variables possibly adding their relations to 
    309309           the ideal; the weights for the additional variables should be zero
    310310EXAMPLE: example tropicalLifting;   shows an example"
     
    357357      noabs=1;
    358358    }
    359     // this option is not documented -- it prevents the execution of gfan and
    360     // just asks for wneu to be inserted -- it can be used to check problems
    361     // with the precedure without calling gfan, if wneu is know from previous
     359    // this option is not documented -- it prevents the execution of gfan and 
     360    // just asks for wneu to be inserted -- it can be used to check problems 
     361    // with the precedure without calling gfan, if wneu is know from previous 
    362362    // computations
    363363    if (#[j]=="noGfan")
     
    370370    }
    371371  }
    372   // if the basering has characteristic not equal to zero,
     372  // if the basering has characteristic not equal to zero, 
    373373  // then absolute factorisation
    374374  // is not available, and thus we need the option noAbs
     
    384384  {
    385385    Error("The first coordinate of your input w must be NON-ZERO, since it is a DENOMINATOR!");
    386   }
     386  } 
    387387  // if w_0<0, then replace w by -w, so that the "denominator" w_0 is positive
    388388  if (w[1]<0)
     
    391391  }
    392392  intvec prew=w; // stores w for later reference
    393   // for our computations, w[1] represents the weight of t and this
     393  // for our computations, w[1] represents the weight of t and this 
    394394  // should be -w_0 !!!
    395395  w[1]=-w[1];
     
    401401    w[1]=-1;
    402402  }
    403   // if some entry of w is positive, we have to make a transformation,
     403  // if some entry of w is positive, we have to make a transformation, 
    404404  // which moves it to something non-positive
    405405  for (j=2;j<=nvars(basering);j++)
     
    427427  {
    428428    variablen=variablen+var(j);
    429   }
     429  }   
    430430  map GRUNDPHI=BASERING,t,variablen;
    431431  ideal i=GRUNDPHI(i);
    432   // compute the initial ideal of i and test if w is in the tropical
    433   // variety of i
     432  // compute the initial ideal of i and test if w is in the tropical 
     433  // variety of i 
    434434  // - the last entry 1 only means that t is the last variable in the ring
    435435  ideal ini=tInitialIdeal(i,w,1);
    436436  if (isintrop==0) // test if w is in trop(i) only if isInTrop has not been set
    437   {
     437  {   
    438438    poly product=1;
    439439    for (j=1;j<=nvars(basering)-1;j++)
     
    453453    int dd=dim(i);
    454454    setring GRUNDRING;
    455     // if the dimension is not zero, we cut the ideal down to dimension zero
     455    // if the dimension is not zero, we cut the ideal down to dimension zero 
    456456    // and compute the
    457457    // t-initial ideal of the new ideal at the same time
    458458    if(dd!=0)
    459459    {
    460       // the procedurce cutdown computes a new ring, in which there lives a
     460      // the procedurce cutdown computes a new ring, in which there lives a 
    461461      // zero-dimensional
    462       // ideal which has been computed by cutting down the input with
     462      // ideal which has been computed by cutting down the input with 
    463463      // generic linear forms
    464       // of the type x_i1-p_1,...,x_id-p_d for some polynomials
    465       // p_1,...,p_d not depending
    466       // on the variables x_i1,...,x_id; that way we have reduced
     464      // of the type x_i1-p_1,...,x_id-p_d for some polynomials 
     465      // p_1,...,p_d not depending 
     466      // on the variables x_i1,...,x_id; that way we have reduced 
    467467      // the number of variables by dd !!!
    468       // the new zero-dimensional ideal is called i, its t-initial
     468      // the new zero-dimensional ideal is called i, its t-initial 
    469469      // ideal (with respect to
    470       // the new w=CUTDOWN[2]) is ini, and finally there is a list
    471       // repl in the ring
     470      // the new w=CUTDOWN[2]) is ini, and finally there is a list 
     471      // repl in the ring 
    472472      // which contains at the polynomial p_j at position i_j and
    473473      //a zero otherwise;
     
    492492  list liftrings; // will contain the final result
    493493  // if the procedure is called without 'findAll' then it may happen, that no
    494   // proper solution is found when dd>0; in that case we have
     494  // proper solution is found when dd>0; in that case we have 
    495495  // to start all over again;
    496496  // this is controlled by the while-loop
     
    508508    // compute the liftrings by resubstitution
    509509    kk=1;  // counts the liftrings
    510     int isgood;  // test in the non-zerodimensional case
     510    int isgood;  // test in the non-zerodimensional case 
    511511                 // if the result has the correct valuation
    512512    for (jj=1;jj<=size(TP);jj++)
    513513    {
    514       // the list TP contains as a first entry the ring over which the
    515       // tropical parametrisation
     514      // the list TP contains as a first entry the ring over which the 
     515      // tropical parametrisation 
    516516      // of the (possibly cutdown ideal) i lives
    517517      def LIFTRING=TP[jj][1];
    518       // if the dimension of i originally was not zero,
     518      // if the dimension of i originally was not zero, 
    519519      // then we have to fill in the missing
    520520      // parts of the parametrisation
    521521      if (dd!=0)
    522522      {
    523         // we need a ring where the parameters X_1,...,X_k
     523        // we need a ring where the parameters X_1,...,X_k 
    524524        // from LIFTRING are present,
    525525        // and where also the variables of CUTDOWNRING live
    526526        execute("ring REPLACEMENTRING=("+charstr(LIFTRING)+"),("+varstr(CUTDOWNRING)+"),dp;");
    527         list repl=imap(CUTDOWNRING,repl); // get the replacement rules
     527        list repl=imap(CUTDOWNRING,repl); // get the replacement rules 
    528528                                          // from CUTDOWNRING
    529         ideal PARA=imap(LIFTRING,PARA);   // get the zero-dim. parametrisatio
     529        ideal PARA=imap(LIFTRING,PARA);   // get the zero-dim. parametrisatio 
    530530                                          // from LIFTRING
    531531        // compute the lift of the solution of the original ideal i
     
    533533        k=1;
    534534        // the lift has as many components as GRUNDRING has variables!=t
    535         for (j=1;j<=nvars(GRUNDRING)-1;j++)
     535        for (j=1;j<=nvars(GRUNDRING)-1;j++) 
    536536        {
    537537          // if repl[j]=0, then the corresponding variable was not eliminated
    538           if (repl[j]==0)
     538          if (repl[j]==0) 
    539539          {
    540             LIFT[j]=PARA[k]; // thus the lift has been
     540            LIFT[j]=PARA[k]; // thus the lift has been 
    541541                             // computed by tropicalparametrise
    542542            k++; // k checks how many entries of PARA have already been used
     
    544544          else  // if repl[j]!=0, repl[j] contains replacement rule for the lift
    545545          {
    546             LIFT[j]=repl[j]; // we still have to replace the vars
     546            LIFT[j]=repl[j]; // we still have to replace the vars 
    547547                             // in repl[j] by the corresp. entries of PARA
    548548            // replace all variables!=t (from CUTDOWNRING)
    549             for (l=1;l<=nvars(CUTDOWNRING)-1;l++)
     549            for (l=1;l<=nvars(CUTDOWNRING)-1;l++) 
    550550            {
    551551              // substitute the kth variable by PARA[k]
    552               LIFT[j]=subst(LIFT[j],var(l),PARA[l]);
     552              LIFT[j]=subst(LIFT[j],var(l),PARA[l]); 
    553553            }
    554554          }
    555555        }
    556556        setring LIFTRING;
    557         ideal LIFT=imap(REPLACEMENTRING,LIFT);
    558         // test now if the LIFT has the correct valuation !!!
    559         // note: it may happen, that when resubstituting PARA into
     557        ideal LIFT=imap(REPLACEMENTRING,LIFT);   
     558        // test now if the LIFT has the correct valuation !!!     
     559        // note: it may happen, that when resubstituting PARA into 
    560560        //       the replacement rules
    561         //       there occured some unexpected cancellation;
     561        //       there occured some unexpected cancellation;