Changeset 3f4e52 in git


Ignore:
Timestamp:
Jul 28, 2009, 12:34:56 PM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
663baa085095bc4743611bd73380eb8c5d952985
Parents:
ae9fd9360b24aab77a82322cff14a56f1ba835fa
Message:
*hannes: format


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/algebra.lib

    rae9fd9 r3f4e52  
    33//new proc  nonZeroEntry(id), used to fix a bug in proc finitenessTest
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: algebra.lib,v 1.23 2009-04-15 11:07:30 seelisch Exp $";
     5version="$Id: algebra.lib,v 1.24 2009-07-28 10:34:54 Singular Exp $";
    66category="Commutative Algebra";
    77info="
     
    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
  • Singular/LIB/bfun.lib

    rae9fd9 r3f4e52  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: bfun.lib,v 1.11 2009-07-28 10:19:59 Singular Exp $";
     2version="$Id: bfun.lib,v 1.12 2009-07-28 10:34:54 Singular 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
     
    2222@*   (that is, an ideal I in a Weyl algebra D, such that D/I is holonomic module)
    2323@*   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 
     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
     
    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,
     
    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
    5757vec2poly(v[,i]); constructs an univariate polynomial with given coefficients
     
    361361      for (i=1; i<=ncols(I); i++) { M[i] = gen(i);  }
    362362    }
    363   } 
     363  }
    364364  dbprint(ppl-1,"// initially sorted ideal:", I);
    365365  if (remembercoeffs <> 0) { dbprint(ppl-1,"// used permutations:", M); }
     
    477477@*       If t<>0 (and by default) all monomials are reduced (if possible),
    478478@*       otherwise, only leading monomials are reduced.
    479 @*       If u<>0 (and by default), the ideal is linearly pre-reduced, i.e. 
     479@*       If u<>0 (and by default), the ideal is linearly pre-reduced, i.e.
    480480@*       instead of the given ideal, the output of @code{linReduceIdeal} is used.
    481481@*       If u is set to 0 and the given ideal does not equal the output of
     
    921921NOTE:    If the intersection is zero, this procedure might not terminate.
    922922@*       If p>0 is given, this proc computes the generator of the intersection in
    923 @*       char p first and then only searches for a generator of the obtained 
    924 @*       degree in the basering. Otherwise, it searches for all degrees by 
     923@*       char p first and then only searches for a generator of the obtained
     924@*       degree in the basering. Otherwise, it searches for all degrees by
    925925@*       computing syzygies.
    926926@*       If s<>0, @code{std} is used for Groebner basis computations in char 0,
    927927@*       otherwise, and by default, @code{slimgb} is used.
    928 @*       If t<>0 and by default, @code{std} is used for Groebner basis 
     928@*       If t<>0 and by default, @code{std} is used for Groebner basis
    929929@*       computations in char >0, otherwise, @code{slimgb} is used.
    930930DISPLAY: If printlevel=1, progress debug messages will be printed,
     
    11341134  }
    11351135  dbprint(ppl,"// pIntersectSyz finished");
    1136   if (solveincharp) { short = shortSave; } 
     1136  if (solveincharp) { short = shortSave; }
    11371137  return(v);
    11381138}
     
    12891289  if (size(L) == 3) // irreducible factor
    12901290  {
    1291     if (L[3] <> "0" && L[3] <> "1") 
     1291    if (L[3] <> "0" && L[3] <> "1")
    12921292    {
    12931293      LL = LL + list(L[3]);
     
    14271427RETURN:  list of ideal and intvec
    14281428PURPOSE: computes the roots of the Bernstein-Sato polynomial b(s)
    1429 @*       for the hypersurface defined by f. 
     1429@*       for the hypersurface defined by f.
    14301430ASSUME:  The basering is commutative and of characteristic 0.
    14311431BACKGROUND: In this proc, the initial Malgrange ideal is computed according to
    14321432@*       the algorithm by Masayuki Noro and then a system of linear equations is
    14331433@*       solved by linear reductions.
    1434 NOTE:    In the output list, the ideal contains all the roots 
     1434NOTE:    In the output list, the ideal contains all the roots
    14351435@*       and the intvec their multiplicities.
    14361436@*       If s<>0, @code{std} is used for GB computations,
    1437 @*       otherwise, and by default, @code{slimgb} is used. 
     1437@*       otherwise, and by default, @code{slimgb} is used.
    14381438@*       If t<>0, a matrix ordering is used for Groebner basis computations,
    14391439@*       otherwise, and by default, a block ordering is used.
     
    14981498@*       the algorithm by Masayuki Noro and then a system of linear equations is
    14991499@*       solved by computing syzygies.
    1500 NOTE:    In the output list, the ideal contains all the roots and the intvec 
     1500NOTE:    In the output list, the ideal contains all the roots and the intvec
    15011501@*       their multiplicities.
    15021502@*       If r<>0, @code{std} is used for GB computations in characteristic 0,
     
    15831583ASSUME:  The basering is the n-th Weyl algebra in characteristic 0 and for all
    15841584@*       1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the
    1585 @*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 
     1585@*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n),
    15861586@*       where D(i) is the differential operator belonging to x(i).
    15871587@*       Further we assume that I is holonomic.
     
    15961596@*  L[3] is 1 (for nonzero constant) or 0 (for zero b-function).
    15971597@*       If s<>0, @code{std} is used for GB computations in characteristic 0,
    1598 @*       otherwise, and by default, @code{slimgb} is used. 
     1598@*       otherwise, and by default, @code{slimgb} is used.
    15991599@*       If t<>0, a matrix ordering is used for GB computations, otherwise,
    16001600@*       and by default, a block ordering is used.
     
    16851685@*       their multiplicities.
    16861686@*       If s<>0, @code{std} is used for the GB computation, otherwise,
    1687 @*       and by default, @code{slimgb} is used. 
     1687@*       and by default, @code{slimgb} is used.
    16881688@*       If t<>0, a matrix ordering is used for GB computations,
    16891689@*       otherwise, and by default, a block ordering is used.
     
    16971697  def save = basering;
    16981698  int n = nvars(save);
    1699   if (char(save) <> 0) 
     1699  if (char(save) <> 0)
    17001700  {
    17011701    ERROR("characteristic of basering has to be 0");
     
    17341734  // create names for vars
    17351735  list Lvar;
    1736   Lvar[1]   = safeVarName("t"); 
     1736  Lvar[1]   = safeVarName("t");
    17371737  Lvar[2]   = safeVarName("s");
    17381738  Lvar[n+3] = safeVarName("D"+Lvar[1]);
     
    17471747  intvec @a = 1:N; @a[2] = 2;
    17481748  intvec @a2 = @a; @a2[2] = 0; @a2[2*n+4] = 0;
    1749   list Lord; 
     1749  list Lord;
    17501750  Lord[1] = list("a",@a); Lord[2] = list("a",@a2);
    17511751  if (methodord == 0) // default: block ordering
     
    18481848@*  If a<>0, only f is appended to Ann(f^s), otherwise, and by default,
    18491849@*  f and all its partial derivatives are appended.
    1850 @*  If b<>0, @code{std} is used for GB computations, otherwise, and by 
     1850@*  If b<>0, @code{std} is used for GB computations, otherwise, and by
    18511851@*  default, @code{slimgb} is used.
    18521852@*  If c<>0, @code{std} is used for Groebner basis computations of ideals
  • Singular/LIB/crypto.lib

    rae9fd9 r3f4e52  
    11//GP, last modified 28.6.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: crypto.lib,v 1.9 2009-04-15 11:11:20 seelisch Exp $";
     3version="$Id: crypto.lib,v 1.10 2009-07-28 10:34:54 Singular 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@*
  • Singular/LIB/dmod.lib

    rae9fd9 r3f4e52  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: dmod.lib,v 1.46 2009-07-27 07:49:53 Singular Exp $";
     2version="$Id: dmod.lib,v 1.47 2009-07-28 10:34:54 Singular 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
     
    146146"USAGE:  annfs(f [,S,eng]);  f a poly, S a string, eng an optional int
    147147RETURN:  ring
    148 PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm 
     148PURPOSE: compute the D-module structure of basering[1/f]*f^s with the algorithm
    149149@*  given in S and with the Groebner basis engine given in ''eng''
    150150NOTE:  activate the output ring with the @code{setring} command.
     
    270270"USAGE:  Sannfs(f [,S,eng]);  f a poly, S a string, eng an optional int
    271271RETURN:  ring
    272 PURPOSE: compute the D-module structure of basering[f^s] with the algorithm 
     272PURPOSE: compute the D-module structure of basering[f^s] with the algorithm
    273273@*  given in S and with the Groebner basis engine given in eng
    274274NOTE:    activate the output ring with the @code{setring} command.
     
    391391PURPOSE: compute the D-module structure of basering[1/f]*f^s
    392392NOTE:    activate the output ring with the @code{setring} command.
    393 @*   In the output ring D[s], the ideal LD1 is generated by the elements 
     393@*   In the output ring D[s], the ideal LD1 is generated by the elements
    394394@*   in Ann F^s in D[s], coming from logarithmic derivations.
    395395@*       If eng <>0, @code{std} is used for Groebner basis computations,
     
    539539"USAGE:  ALTannfsBM(f [,eng]);  f a poly, eng an optional int
    540540RETURN:  ring
    541 PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl 
     541PURPOSE: compute the annihilator ideal of f^s in D[s], where D is the Weyl
    542542@*   algebra, according to the algorithm by Briancon and Maisonobe
    543543NOTE:  activate the output ring with the @code{setring} command. In this ring,
     
    731731"USAGE:  bernsteinBM(f [,eng]);  f a poly, eng an optional int
    732732RETURN:  list (of roots of the Bernstein polynomial b and their multiplicies)
    733 PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface, 
     733PURPOSE: compute the global Bernstein-Sato polynomial for a hypersurface,
    734734@* defined by f, according to the algorithm by Briancon and Maisonobe
    735735NOTE:    If eng <>0, @code{std} is used for Groebner basis computations,
     
    12541254"USAGE:  annfs2(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    12551255RETURN:  ring
    1256 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 
     1256PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra,
    12571257@*       based on the output of Sannfs-like procedure
    12581258@*       annfs2 uses shorter expressions in the variable s (the idea of Noro).
     
    14151415"USAGE:  annfsRB(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    14161416RETURN:  ring
    1417 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, 
     1417PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra,
    14181418@* based on the output of Sannfs like procedure
    14191419NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    16041604"USAGE:  operatorBM(f [,eng]);  f a poly, eng an optional int
    16051605RETURN:  ring
    1606 PURPOSE: compute the B-operator and other relevant data for Ann F^s, 
     1606PURPOSE: compute the B-operator and other relevant data for Ann F^s,
    16071607@*  using e.g. algorithm by Briancon and Maisonobe for Ann F^s and BS.
    16081608NOTE:    activate the output ring with the @code{setring} command. In the output ring D[s]
     
    19211921"USAGE:  operatorModulo(f,I,b);  f a poly, I an ideal, b a poly
    19221922RETURN:  poly
    1923 PURPOSE: compute the B-operator from the polynomial f, 
    1924 @*           ideal I = Ann f^s and Bernstein-Sato polynomial b 
     1923PURPOSE: compute the B-operator from the polynomial f,
     1924@*           ideal I = Ann f^s and Bernstein-Sato polynomial b
    19251925@*           using modulo i.e. kernel of module homomorphism
    1926 NOTE:  The computations take place in the ring, similar to the one 
     1926NOTE:  The computations take place in the ring, similar to the one
    19271927@*       returned by Sannfs procedure.
    1928 @*     Note, that operator is not completely reduced wrt Ann f^{s+1}. 
     1928@*     Note, that operator is not completely reduced wrt Ann f^{s+1}.
    19291929@*     If printlevel=1, progress debug messages will be printed,
    19301930@*     if printlevel>=2, all the debug messages will be printed.
     
    19531953//     module GMT = transpose(G);
    19541954//     GMT = GMT[2],GMT[3]; // modulo matrix
    1955 //     module K = GMT[2]; 
     1955//     module K = GMT[2];
    19561956//     GMT = transpose(GMT);
    19571957//     K = transpose(K);
     
    19861986      return(t);
    19871987    }
    1988     dbprint(ppl,"no explicit constant. Start one more GB computation");   
     1988    dbprint(ppl,"no explicit constant. Start one more GB computation");
    19891989    // else: compute GB and do the same
    19901990    L = L[2..ncols(L)];
     
    20492049  LD = groebner(LD);
    20502050  PS = NF(PS,subst(LD,s,s+1));; // reduction modulo Ann s^{s+1}
    2051   size(PS); 
     2051  size(PS);
    20522052  lead(PS);
    20532053  reduce(PS*F-bs,LD); // check the defining property of PS
     
    23002300"USAGE:  annfsBMI(F [,eng]);  F an ideal, eng an optional int
    23012301RETURN:  ring
    2302 PURPOSE: compute the D-module structure of basering[1/f]*f^s where 
     2302PURPOSE: compute the D-module structure of basering[1/f]*f^s where
    23032303@* f = F[1]*..*F[P], according to the algorithm by Briancon and Maisonobe.
    23042304NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    26292629"USAGE:  annfsOT(f [,eng]);  f a poly, eng an optional int
    26302630RETURN:  ring
    2631 PURPOSE: compute the D-module structure of basering[1/f]*f^s, 
     2631PURPOSE: compute the D-module structure of basering[1/f]*f^s,
    26322632@* according to the algorithm by Oaku and Takayama
    26332633NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    30113011"USAGE:  SannfsOT(f [,eng]);  f a poly, eng an optional int
    30123012RETURN:  ring
    3013 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
     3013PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
    30143014@* 1st step of the algorithm by Oaku and Takayama in the ring D[s]
    30153015NOTE:    activate the output ring with the @code{setring} command.
    3016 @*  In the output ring D[s], the ideal LD (which is NOT a Groebner basis) 
     3016@*  In the output ring D[s], the ideal LD (which is NOT a Groebner basis)
    30173017@*  is the needed D-module structure.
    30183018@*  If eng <>0, @code{std} is used for Groebner basis computations,
     
    32953295"USAGE:  SannfsBM(f [,eng]);  f a poly, eng an optional int
    32963296RETURN:  ring
    3297 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
     3297PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
    32983298@* 1st step of the algorithm by Briancon and Maisonobe in the ring D[s].
    32993299NOTE:  activate the output ring with the @code{setring} command.
    3300 @*   In the output ring D[s], the ideal LD (which is NOT a Groebner basis) is 
     3300@*   In the output ring D[s], the ideal LD (which is NOT a Groebner basis) is
    33013301@*   the needed D-module structure.
    33023302@*   If eng <>0, @code{std} is used for Groebner basis computations,
     
    36653665  // ----- keep char, minpoly
    36663666  L[1] = RL[1];
    3667   L[4] = RL[4]; 
     3667  L[4] = RL[4];
    36683668  // ----- create vars
    36693669  string newVar@t = safeVarName("t");
     
    37203720  {
    37213721    I = J,I;
    3722     I = engine(I,eng); 
     3722    I = engine(I,eng);
    37233723  }
    37243724  kill J;
     
    37733773  {
    37743774    LD = LD,J;
    3775     LD = engine(LD,eng); 
     3775    LD = engine(LD,eng);
    37763776  }
    37773777  if (addPD) { dbprint(ppl,"// -4-4- Finished GB computations for Ann f^s + <f, f_i>"); }
     
    38113811PURPOSE: compute Ann f^s and Groebner basis of Ann f^s+f in D[s]
    38123812NOTE:    activate the output ring with the @code{setring} command.
    3813 @*    This procedure, unlike SannfsBM, returns a ring with the degrevlex 
     3813@*    This procedure, unlike SannfsBM, returns a ring with the degrevlex
    38143814@*    ordering in all variables.
    38153815@*    In the ring D[s], the ideal LD (which IS a Groebner basis) is the needed ideal.
     
    38203820"
    38213821{
    3822   // DEBUG INFO: ordering on the output ring = dp, 
     3822  // DEBUG INFO: ordering on the output ring = dp,
    38233823  // use std(K,F); for reusing the std property of K
    38243824
     
    40324032"USAGE:  SannfsLOT(f [,eng]);  f a poly, eng an optional int
    40334033RETURN:  ring
    4034 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the 
     4034PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to the
    40354035@* Levandovskyy's modification of the algorithm by Oaku and Takayama in D[s]
    40364036NOTE:    activate the output ring with the @code{setring} command.
    4037 @*    In the ring D[s], the ideal LD (which is NOT a Groebner basis) is 
     4037@*    In the ring D[s], the ideal LD (which is NOT a Groebner basis) is
    40384038@*    the needed D-module structure.
    40394039@*    If eng <>0, @code{std} is used for Groebner basis computations,
     
    44894489"USAGE:  annfsLOT(F [,eng]);  F a poly, eng an optional int
    44904490RETURN:  ring
    4491 PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to 
     4491PURPOSE: compute the D-module structure of basering[1/f]*f^s, according to
    44924492@* the Levandovskyy's modification of the algorithm by Oaku and Takayama
    44934493NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    45344534"USAGE:  annfs0(I, F [,eng]);  I an ideal, F a poly, eng an optional int
    45354535RETURN:  ring
    4536 PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based 
     4536PURPOSE: compute the annihilator ideal of f^s in the Weyl Algebra, based
    45374537@* on the output of Sannfs-like procedure
    45384538NOTE:    activate the output ring with the @code{setring} command. In this ring,
     
    50235023"USAGE:  annfspecial(I,F,mir,n);  I an ideal, F a poly, int mir, number n
    50245024RETURN:  ideal
    5025 PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra 
     5025PURPOSE: compute the annihilator ideal of F^n in the Weyl Algebra
    50265026@*           for the given rational number n
    50275027ASSUME:  The basering is D[s] and contains 's' explicitly as a variable,
     
    50295029@*   the integer 'mir' is the minimal integer root of the BS polynomial of F,
    50305030@*   and the number n is rational.
    5031 NOTE: We compute the real annihilator for any rational value of n (both 
    5032 @*       generic and exceptional). The implementation goes along the lines of 
    5033 @*       the Algorithm 5.3.15 from Saito-Sturmfels-Takayama. 
     5031NOTE: We compute the real annihilator for any rational value of n (both
     5032@*       generic and exceptional). The implementation goes along the lines of
     5033@*       the Algorithm 5.3.15 from Saito-Sturmfels-Takayama.
    50345034DISPLAY: If printlevel=1, progress debug messages will be printed,
    50355035@*       if printlevel>=2, all the debug messages will be printed.
     
    53555355RETURN:  int
    53565356ASSUME: Basering is a commutative ring, alpha is a rational number.
    5357 PURPOSE: check whether a rational number alpha is a root of the global 
     5357PURPOSE: check whether a rational number alpha is a root of the global
    53585358@* Bernstein-Sato polynomial of f and compute its multiplicity,
    53595359@* with the algorithm given by S and with the Groebner basis engine given by eng.
    5360 NOTE:  The annihilator of f^s in D[s] is needed and hence it is computed with the 
     5360NOTE:  The annihilator of f^s in D[s] is needed and hence it is computed with the
    53615361@*       algorithm by Briancon and Maisonobe. The value of a string S can be
    53625362@*       'alg1' (default) - for the algorithm 1 of [LM08]
     
    56055605proc checkRoot2 (ideal I, poly F, number a, list #)
    56065606"USAGE:  checkRoot2(I,f,a [,eng]);  I an ideal, f a poly, alpha a number, eng an optional int
    5607 ASSUME:  I is the annihilator of f^s in D[s], basering is D[s], 
     5607ASSUME:  I is the annihilator of f^s in D[s], basering is D[s],
    56085608@* that is basering and I are the output os Sannfs-like procedure,
    56095609@* f is a polynomial in K[_x] and alpha is a rational number.
    5610 RETURN:  int, the multiplicity of -alpha as a root of the BS polynomial of f. 
     5610RETURN:  int, the multiplicity of -alpha as a root of the BS polynomial of f.
    56115611PURPOSE: check whether a rational number alpha is a root of the global Bernstein-
    56125612@* Sato polynomial of f and compute its multiplicity from the known Ann F^s in D[s]
     
    56205620{
    56215621
    5622  
     5622
    56235623  // to check: alpha is rational (has char 0 check inside)
    56245624  if (!isRational(a))
     
    57555755ASSUME:  checkFactor is called from the basering, created by Sannfs-like proc,
    57565756@* that is, from the Weyl algebra in x1,..,xN,d1,..,dN tensored with K[s].
    5757 @* The ideal I is the annihilator of f^s in D[s], that is the ideal, computed 
     5757@* The ideal I is the annihilator of f^s in D[s], that is the ideal, computed
    57585758@* by Sannfs-like procedure (usually called LD there).
    57595759@* Moreover, f is a polynomial in K[x1,..,xN] and qs is a polynomial in K[s].
    57605760RETURN:  int, 1 if qs is a factor of the global Bernstein polynomial of f and 0 otherwise
    5761 PURPOSE: check whether a univariate polynomial qs is a factor of the 
     5761PURPOSE: check whether a univariate polynomial qs is a factor of the
    57625762@*  Bernstein-Sato polynomial of f without explicit knowledge of the latter.
    57635763NOTE:    If eng <>0, @code{std} is used for Groebner basis computations,
     
    58565856"USAGE:  indAR(L,n);  list L, int n
    58575857RETURN:  list
    5858 PURPOSE: computes arrangement inductively, using L and 
     5858PURPOSE: computes arrangement inductively, using L and
    58595859@* var(n) as the next variable
    58605860ASSUME: L has a structure of an arrangement
     
    59045904
    59055905proc isRational(number n)
    5906 "USAGE:  isRational(n); n number 
     5906"USAGE:  isRational(n); n number
    59075907RETURN:  int
    59085908PURPOSE: determine whether n is a rational number,
  • Singular/LIB/dmodapp.lib

    rae9fd9 r3f4e52  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: dmodapp.lib,v 1.32 2009-07-28 10:13:06 Singular Exp $";
     2version="$Id: dmodapp.lib,v 1.33 2009-07-28 10:34:55 Singular 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
     
    279279"USAGE:  appelF1();
    280280RETURN:  ring  (and exports an ideal into it)
    281 PURPOSE: define the ideal in a parametric Weyl algebra, 
     281PURPOSE: define the ideal in a parametric Weyl algebra,
    282282@* which annihilates Appel F1 hypergeometric function
    283283NOTE: the ideal called  IAppel1 is exported to the output ring
     
    307307}
    308308
    309 proc appelF2() 
     309proc appelF2()
    310310"USAGE:  appelF2();
    311311RETURN:  ring (and exports an ideal into it)
    312 PURPOSE: define the ideal in a parametric Weyl algebra, 
     312PURPOSE: define the ideal in a parametric Weyl algebra,
    313313@* which annihilates Appel F2 hypergeometric function
    314314NOTE: the ideal called  IAppel2 is exported to the output ring
     
    340340"USAGE:  appelF4();
    341341RETURN:  ring  (and exports an ideal into it)
    342 PURPOSE: define the ideal in a parametric Weyl algebra, 
     342PURPOSE: define the ideal in a parametric Weyl algebra,
    343343@* which annihilates Appel F4 hypergeometric function
    344344NOTE: the ideal called  IAppel4 is exported to the output ring
     
    460460    ERROR("Basering is not a Weyl algebra");
    461461  }
    462   if (defined(LD0) || defined(BS)) 
     462  if (defined(LD0) || defined(BS))
    463463  {
    464464    ERROR("Reserved names LD0 and/or BS are used. Please rename the objects.");
     
    500500"USAGE:  DLoc0(I, F);  I an ideal, F a poly
    501501RETURN:  ring
    502 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,
    503503@*           where D is a Weyl Algebra, based on the output of procedure SDLoc
    504504ASSUME: the basering is similar to the output ring of SDLoc procedure
     
    734734  gkdim(I); // 3
    735735  def W = SDLoc(I,F);  setring W; // creates ideal LD in W = R[s]
    736   def U = DLoc0(LD, x2-y3);  setring U; // compute in R 
     736  def U = DLoc0(LD, x2-y3);  setring U; // compute in R
    737737  LD0; // Groebner basis of the presentation of localization
    738738  BS; // description of b-function for localization
     
    949949  setring R;
    950950  poly F = x2-y3;
    951   ideal I = Dx*F, Dy*F; 
     951  ideal I = Dx*F, Dy*F;
    952952  // note, that I is not holonomic, since it's dimension is not 2
    953953  gkdim(I); // 3, while dim R = 4
     
    14051405RETURN:  poly
    14061406PURPOSE: reconstruct a monic polynomial in one variable from its factorization
    1407 ASSUME:  s is a string with the name of some variable and 
     1407ASSUME:  s is a string with the name of some variable and
    14081408@*         L is supposed to consist of two entries:
    14091409@*         L[1] of the type ideal with the roots of a polynomial
     
    14681468ASSUME:  The basering is the n-th Weyl algebra in characteristic 0 and  for all
    14691469@*       1<=i<=n the identity var(i+n)*var(i)=var(i)*var(i+1)+1 holds, i.e. the
    1470 @*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n), 
     1470@*       sequence of variables is given by x(1),...,x(n),D(1),...,D(n),
    14711471@*       where D(i) is the differential operator belonging to x(i).
    14721472PURPOSE: computes the initial ideal with respect to given weights.
     
    15361536      ERROR(string(var(i+n)) + " is not a differential operator for " + string(var(i)));
    15371537    }
    1538   } 
     1538  }
    15391539  // 1. create  homogenized Weyl algebra
    15401540  // 1.1 create ordering
     
    15711571  for (i=1; i<=n; i++) { @relD[i,n+i] = var(N)^(homogweights[i]+homogweights[n+i]); }
    15721572  def Dh = nc_algebra(1,@relD);
    1573   setring Dh; kill @Dh;    
     1573  setring Dh; kill @Dh;
    15741574  dbprint(ppl-1,"// computing in ring",Dh);
    15751575  // 2. Compute the initial ideal
     
    18161816  {
    18171817    dbprint(ppl,"// found no roots");
    1818   } 
     1818  }
    18191819  L = list(II,mm);
    18201820  if (ir <> 1)
     
    18251825    L = L + list(string(ir));
    18261826  }
    1827   else 
     1827  else
    18281828  {
    18291829    dbprint(ppl,"// no irreducible factors found");
    1830   } 
     1830  }
    18311831  setring save;
    18321832  L = imap(@S,L);
     
    18381838  ring r = 0,(x,y),dp;
    18391839  bFactor((x^2-1)^2);
    1840   bFactor((x^2+1)^2); 
     1840  bFactor((x^2+1)^2);
    18411841  bFactor((y^2+1/2)*(y+9)*(y-7));
    18421842}
  • Singular/LIB/elim.lib

    rae9fd9 r3f4e52  
    1 // $Id: elim.lib,v 1.34 2009-05-05 09:25:56 bulygin Exp $
     1// $Id: elim.lib,v 1.35 2009-07-28 10:34:55 Singular 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.34 2009-05-05 09:25:56 bulygin Exp $";
     12version="$Id: elim.lib,v 1.35 2009-07-28 10:34:55 Singular Exp $";
    1313category="Commutative Algebra";
    1414info="
     
    478478       if ( #[2] == "std" ) { method = "std"; }
    479479       if ( #[2] == "slimgb" ) { method = "slimgb"; }
    480        
     480
    481481    }
    482482    else
     
    484484      ERROR("expected `elim(ideal,intvec[,string])`");
    485485    }
    486    
     486
    487487    if (size(#) == 3)
    488488    {
     
    500500    if ( method == "" )
    501501    {
    502       ERROR("expected \"std\" or \"slimgb\" or \"withWeights\" as the optional string parameters");       
    503     }
    504    
     502      ERROR("expected \"std\" or \"slimgb\" or \"withWeights\" as the optional string parameters");
     503    }
    505504  }
    506505
  • Singular/LIB/freegb.lib

    rae9fd9 r3f4e52  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: freegb.lib,v 1.24 2009-04-15 11:13:09 seelisch Exp $";
     2version="$Id: freegb.lib,v 1.25 2009-07-28 10:34:55 Singular Exp $";
    33category="Noncommutative";
    44info="
     
    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
     
    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;
  • Singular/LIB/general.lib

    rae9fd9 r3f4e52  
    33//eric, added absValue 11.04.2002
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: general.lib,v 1.64 2009-07-15 14:43:52 motsak Exp $";
     5version="$Id: general.lib,v 1.65 2009-07-28 10:34:55 Singular Exp $";
    66category="General purpose";
    77info="
     
    846846   // Note that in general: lead(sort(M)) != sort(lead(M)), e.g:
    847847   module M = [0, 1, 1, 0], [1, 0, 0, 1]; M;
    848    sort(lead(M), "c, dp")[1]; 
    849    lead(sort(M, "c, dp")[1]); 
     848   sort(lead(M), "c, dp")[1];
     849   lead(sort(M, "c, dp")[1]);
    850850
    851851   // In order to sort M wrt a NEW ordering by considering OLD leading
    852852   // terms use one of the following equivalent commands:
    853    module( M[ sort(lead(M), "c,dp")[2] ] ); 
    854    sort( M, sort(lead(M), "c,dp")[2] )[1]; 
     853   module( M[ sort(lead(M), "c,dp")[2] ] );
     854   sort( M, sort(lead(M), "c,dp")[2] )[1];
    855855}
    856856///////////////////////////////////////////////////////////////////////////////
  • Singular/LIB/gmssing.lib

    rae9fd9 r3f4e52  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: gmssing.lib,v 1.14 2009-07-28 08:13:38 Singular Exp $";
     2version="$Id: gmssing.lib,v 1.15 2009-07-28 10:34:55 Singular Exp $";
    33category="Singularities";
    44
     
    3838KEYWORDS: singularities; Gauss-Manin system; Brieskorn lattice;
    3939          mixed Hodge structure; V-filtration; weight filtration
    40           Bernstein-Sato polynomial; monodromy; spectrum; spectral pairs; 
     40          Bernstein-Sato polynomial; monodromy; spectrum; spectral pairs;
    4141          good basis
    4242";
     
    590590    int bs[2][i];  multiplicity of i-th root of b(s)
    591591@end format
    592 KEYWORDS: singularities; Gauss-Manin system; Brieskorn lattice; 
     592KEYWORDS: singularities; Gauss-Manin system; Brieskorn lattice;
    593593          Bernstein-Sato polynomial
    594594EXAMPLE:  example bernstein; shows examples
     
    633633@format
    634634list l;  Jordan data jordan(M) of monodromy matrix exp(-2*pi*i*M)
    635   ideal l[1]; 
     635  ideal l[1];
    636636    number l[1][i];  eigenvalue of i-th Jordan block of M
    637   intvec l[2]; 
     637  intvec l[2];
    638638    int l[2][i];  size of i-th Jordan block of M
    639   intvec l[3]; 
     639  intvec l[3];
    640640    int l[3][i];  multiplicity of i-th Jordan block of M
    641641@end format
  • Singular/LIB/ncdecomp.lib

    rae9fd9 r3f4e52  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ncdecomp.lib,v 1.15 2009-07-07 16:29:58 levandov Exp $";
     2version="$Id: ncdecomp.lib,v 1.16 2009-07-28 10:34:55 Singular Exp $";
    33category="Noncommutative";
    44info="
     
    77
    88OVERVIEW:
    9 @* This library presents algorithms for the central character decomposition of a module, 
    10 @* i.e. a decomposition into generalized weight modules with respect to the center. 
    11 @* Based on ideas of O. Khomenko and V. Levandovskyy (see the article [L2] in the 
     9@* This library presents algorithms for the central character decomposition of a module,
     10@* i.e. a decomposition into generalized weight modules with respect to the center.
     11@* Based on ideas of O. Khomenko and V. Levandovskyy (see the article [L2] in the
    1212@* References for details).
    1313
     
    119119RETURN:  module
    120120PURPOSE: compute the central quotient M:G
    121 THEORY:  for an ideal G of the center of an algebra and a submodule M of A^n, 
     121THEORY:  for an ideal G of the center of an algebra and a submodule M of A^n,
    122122@* the central quotient of M by G is defined to be
    123123@* M:G  :=  { v in A^n | z*v in M, for all z in G }.
  • Singular/LIB/polymake.lib

    rae9fd9 r3f4e52  
    1 version="$Id: polymake.lib,v 1.17 2009-04-15 11:26:29 seelisch Exp $";
     1version="$Id: polymake.lib,v 1.18 2009-07-28 10:34:55 Singular 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.
     
    1414NOTE:
    1515   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 
     16   such as the Newton polytope or the Groebner fan of a polynomial, most of
    1717   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 
     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
    2626     @sc{Singular} for further computations;
    2727     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 
     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
    17111711      // the starting vertex, this cannot happen
    1712       comparevertices[size(comparevertices)+1]=startvertex; 
     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/primdec.lib

    rae9fd9 r3f4e52  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: primdec.lib,v 1.147 2009-04-15 08:10:22 Singular Exp $";
     2version="$Id: primdec.lib,v 1.148 2009-07-28 10:34:55 Singular Exp $";
    33category="Commutative Algebra";
    44info="
     
    2222    They work in any characteristic.@*
    2323    Baserings must have a global ordering and no quotient ideal.
    24    
     24
    2525
    2626PROCEDURES:
  • Singular/LIB/random.lib

    rae9fd9 r3f4e52  
    11//(GMG/BM, last modified 22.06.96)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: random.lib,v 1.20 2009-04-15 11:18:27 seelisch Exp $";
     3version="$Id: random.lib,v 1.21 2009-07-28 10:34:56 Singular 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   }
  • Singular/LIB/ratgb.lib

    rae9fd9 r3f4e52  
    11//////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ratgb.lib,v 1.16 2009-04-15 11:15:40 seelisch Exp $";
     2version="$Id: ratgb.lib,v 1.17 2009-07-28 10:34:56 Singular Exp $";
    33category="Noncommutative";
    44info="
     
    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";
     
    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}
Note: See TracChangeset for help on using the changeset viewer.