Changeset 35ee9b7 in git


Ignore:
Timestamp:
Aug 7, 2008, 6:04:01 PM (16 years ago)
Author:
Thomas Markwig <keilen@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dabe36544e87bab0e6bdb9b9936f225a7f67cdcd
Parents:
1747d96b7453246c6adbfeaa049fcdc86ce6baeb
Message:
help texts and examples reformatted


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/polymake.lib

    r1747d96 r35ee9b7  
    1 version="$Id: polymake.lib,v 1.6 2008-08-07 15:05:35 keilen Exp $";
     1version="$Id: polymake.lib,v 1.7 2008-08-07 16:04:01 keilen Exp $";
    22category="Tropical Geometry";
    33info="
    4 LIBRARY:         polymake.lib    Interface to polymake and TOPCOM
     4LIBRARY:        polymake.lib    Computations with polytopes and fans, interface to polymake and TOPCOM
    55AUTHOR:         Thomas Markwig,  email: keilen@mathematik.uni-kl.de
    66
     
    1515     as the Newton polytope or the Groebner fan of a polynomial, most of the hard
    1616     computations are NOT done by Singular but by the program
    17      -  polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt
    18         (see http://www.math.tu-berlin.de/polymake/), 
    19      respectively (only in the procedure triangularions) by the program
    20      -  topcom by Joerg Rambau, Universitaet Bayreuth
    21         (see http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM);
    22      this library should rather be seen as an interface which allows to use a (very limited)
     17@*   -  polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt
     18@*      (see http://www.math.tu-berlin.de/polymake/), 
     19@*   respectively (only in the procedure triangularions) by the program
     20@*   -  topcom by Joerg Rambau, Universitaet Bayreuth
     21@*      (see http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM);
     22@*   this library should rather be seen as an interface which allows to use a (very limited)
    2323     number of options which polymake respectively topcom offers to compute with polytopes
    2424     and fans and to make the results available in Singular for further computations;
    2525     moreover, the user familiar with Singular does not have to learn the syntax of polymake
    2626     or topcom, if the options offered here are sufficient for his purposes.
    27      Note, though, that the procedures concerned with planar polygons are independent of
     27@*   Note, though, that the procedures concerned with planar polygons are independent of
    2828     both, polymake and topcom.
    2929
     
    9191         as its dimension and information on its facets
    9292RETURN:  list, L with four entries
    93               L[1] : an integer matrix whose rows are the coordinates of vertices
     93@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    9494                     of the polytope
    95               L[2] : the dimension of the polytope
    96               L[3] : a list whose ith entry explains to which vertices the ith vertex
     95@*            L[2] : the dimension of the polytope
     96@*            L[3] : a list whose ith entry explains to which vertices the ith vertex
    9797                     of the Newton polytope is connected -- i.e. L[3][i] is an integer
    9898                     vector and an entry k in there means that the vertex L[1][i] is
    9999                     connected to the vertex L[1][k]
    100               L[4] : an integer matrix whose rows mulitplied by (1,var(1),...,var(nvar)) give
     100@*            L[4] : an integer matrix whose rows mulitplied by (1,var(1),...,var(nvar)) give
    101101                     a linear system of equations describing the affine hull of the polytope,
    102102                     i.e. the smallest affine space containing the polytope
     
    105105         this program is installed in order to use this procedure;
    106106         see http://www.math.tu-berlin.de/polymake/
    107       -  note that in the vertex edge graph we have changed the polymake convention which
     107@*    -  note that in the vertex edge graph we have changed the polymake convention which
    108108         starts indexing its vertices by zero while we start with one !
    109       -  the procedure creates the file  /tmp/polytope.polymake which contains the polytope
     109@*    -  the procedure creates the file  /tmp/polytope.polymake which contains the polytope
    110110         in polymake format and which can be used for further computations with polymake
    111       -  moreover, the procedure creates the file /tmp/polytope.output which it deletes
     111@*    -  moreover, the procedure creates the file /tmp/polytope.output which it deletes
    112112         again before ending
    113       -  it is possible to give as an optional second argument as string which then will be
     113@*    -  it is possible to give as an optional second argument as string which then will be
    114114         used instead of 'polytope' in the name of the polymake output file
    115115EXAMPLE: example polymakePolytope;   shows an example"
     
    233233"USAGE: newtonPolytope(f[,#]);  f poly, # string
    234234RETURN: list, L with four entries
    235               L[1] : an integer matrix whose rows are the coordinates of vertices
     235@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    236236                     of the Newton polytope of f
    237               L[2] : the dimension of the Newton polytope of f
    238               L[3] : a list whose ith entry explains to which vertices the ith vertex
     237@*            L[2] : the dimension of the Newton polytope of f
     238@*            L[3] : a list whose ith entry explains to which vertices the ith vertex
    239239                     of the Newton polytope is connected -- i.e. L[3][i] is an integer
    240240                     vector and an entry k in there means that the vertex L[1][i] is
    241241                     connected to the vertex L[1][k]
    242               L[4] : an integer matrix whose rows mulitplied by (1,var(1),...,var(nvar)) give
     242@*            L[4] : an integer matrix whose rows mulitplied by (1,var(1),...,var(nvar)) give
    243243                     a linear system of equations describing the affine hull of the Newton
    244244                     polytope, i.e. the smallest affine space containing the Newton polytope
     
    247247         space of the normal fan dual to the Newton polytope, i.e. we get the EQUATIONS that
    248248         we need as input for polymake when computing the normal fan
    249       -  the procedure calls for its computation polymake by Ewgenij Gawrilow,
     249@*    -  the procedure calls for its computation polymake by Ewgenij Gawrilow,
    250250         TU Berlin and Michael Joswig, so it only works if polymake is installed;
    251251         see http://www.math.tu-berlin.de/polymake/
    252       -  the procedure creates the file  /tmp/newtonPolytope.polymake which contains the polytope
     252@*    -  the procedure creates the file  /tmp/newtonPolytope.polymake which contains the polytope
    253253         in polymake format and which can be used for further computations with polymake
    254       -  moreover, the procedure creates the file /tmp/newtonPolytope.output which it deletes
     254@*    -  moreover, the procedure creates the file /tmp/newtonPolytope.output which it deletes
    255255         again before ending
    256       -  it is possible to give as an optional second argument as string which then will be
     256@*    -  it is possible to give as an optional second argument as string which then will be
    257257         used instead of 'newtonPolytope' in the name of the polymake output file
    258258EXAMPLE: example newtonPolytope;   shows an example"
     
    300300   // its dimension is
    301301   np[2];   
    302    // the Newton polytope is contained in the affine space given by the equations
     302   // the Newton polytope is contained in the affine space given
     303   //     by the equations
    303304   np[4]*M;
    304305}
     
    334335ASSUME:  - vert is an integer matrix whose rows are the coordinate of the vertices of
    335336           a convex lattice polygon;
    336          - aff describes the affine hull of this polytope, i.e.
     337@*       - aff describes the affine hull of this polytope, i.e.
    337338           the smallest affine space containing it, in the following sense:
    338339           denote by n the number of columns of vert, then multiply aff by (1,x(1),...,x(n))
    339340           and set the resulting terms to zero in order to get the equations for the affine hull;
    340          - the ith entry of graph is an integer vector describing to which vertices
     341@*       - the ith entry of graph is an integer vector describing to which vertices
    341342           the ith vertex is connected, i.e. a k as entry means that the vertex vert[i] is
    342343           connected to vert[k];
    343          - the integer rays is either one (if the extreme rays should be computed) or zero (otherwise)
     344@*       - the integer rays is either one (if the extreme rays should be computed) or zero (otherwise)
    344345RETURN:  list, the ith entry of L[1] contains information about the cone in the normal fan
    345346               dual to the ith vertex of the polytope
    346                L[1][i][1] = integer matrix representing the inequalities which describe the
     347@*             L[1][i][1] = integer matrix representing the inequalities which describe the
    347348                            cone dual to the ith vertex
    348                L[1][i][2] = a list which contains the inequalities represented by L[i][1]
     349@*             L[1][i][2] = a list which contains the inequalities represented by L[i][1]
    349350                            as a list of strings, where we use the variables x(1),...,x(n)
    350                L[1][i][3] = only present if 'er' is set to 1; in that case it is an interger matrix
     351@*             L[1][i][3] = only present if 'er' is set to 1; in that case it is an interger matrix
    351352                            whose rows are the extreme rays of the cone
    352                L[2] = is an integer matrix whose rows span the linearity space of the fan,
     353@*             L[2] = is an integer matrix whose rows span the linearity space of the fan,
    353354                      i.e. the linear space which is contained in each cone
    354355NOTE:    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
    355356           TU Berlin and Michael Joswig, so it only works if polymake is installed;
    356357           see http://www.math.tu-berlin.de/polymake/
    357          - in the optional argument # it is possible to hand over other names for the
     358@*       - in the optional argument # it is possible to hand over other names for the
    358359           variables to be used -- be carful, the format must be correct and that is
    359360           not tested, e.g. if you want the variable names to be u00,u10,u01,u11
     
    497498RETURN:  list, the ith entry of L[1] contains information about the ith cone in the Groebner fan
    498499               dual to the ith vertex in the Newton polytope of the f
    499                L[1][i][1] = integer matrix representing the inequalities which describe the cone         
    500                L[1][i][2] = a list which contains the inequalities represented by L[i][1]
     500@*             L[1][i][1] = integer matrix representing the inequalities which describe the cone         
     501@*             L[1][i][2] = a list which contains the inequalities represented by L[1][i][1]
    501502                            as a list of strings
    502                L[1][i][3] = an interger matrix whose rows are the extreme rays of the cone
    503                L[2] = is an integer matrix whose rows span the linearity space of the fan,
     503@*             L[1][i][3] = an interger matrix whose rows are the extreme rays of the cone
     504@*             L[2] = is an integer matrix whose rows span the linearity space of the fan,
    504505                      i.e. the linear space which is contained in each cone               
    505                L[3] = the Newton polytope of f in the format of the procedure newtonPolytope
     506@*             L[3] = the Newton polytope of f in the format of the procedure newtonPolytope
     507@*             L[4] = integer matrix where each row represents the exponet vector of one monomial
     508                      occuring in the input polynomial
    506509NOTE:    - if you have alread computed the Newton polytope of f then you might want
    507510           to use the procedure normalFan instead in order to avoid doing costly computation
    508511           twice
    509          - the procedure calls for its computation polymake by Ewgenij Gawrilow,
     512@*       - the procedure calls for its computation polymake by Ewgenij Gawrilow,
    510513           TU Berlin and Michael Joswig, so it only works if polymake is installed;
    511514           see http://www.math.tu-berlin.de/polymake/
    512          - the procedure creates the file  /tmp/newtonPolytope.polymake which contains the
     515@*       - the procedure creates the file  /tmp/newtonPolytope.polymake which contains the
    513516           Newton polytope of f in polymake format and which can be used for further
    514517           computations with polymake
    515          - it is possible to give as an optional second argument as string which then will be
     518@*       - it is possible to give as an optional second argument as string which then will be
    516519           used instead of 'newtonPolytope' in the name of the polymake output file
    517520EXAMPLE: example groebnerFan;   shows an example"
     
    544547  // append newtonp to gf
    545548  gf[3]=newtonp;
    546   // append newtonp the exponent vectors to gt
     549  // append the exponent vectors to gf
    547550  gf[4]=exponents;
    548551  return(gf);
     
    572575   gf[3][2];
    573576   // np[3] contains information how the vertices are connected to each other,
    574    // e.g. the first vertex is connected to the second, third and fourth vertex
     577   // e.g. the 1st vertex is connected to the 2nd, 3rd and 4th vertex
    575578   gf[3][3][1];
    576579}
     
    581584"USAGE:  intmatToPolymake(M,art);  M intmat, art string
    582585ASSUME:  - M is an integer matrix which should be transformed into polymake format;
    583          - art is one of the following strings
    584            - 'rays'   : indicating that a first column of 0's should be added
    585            - 'points' : indicating that a first column of 1's should be added
     586@*       - art is one of the following strings:
     587@*         + 'rays'   : indicating that a first column of 0's should be added
     588@*         + 'points' : indicating that a first column of 1's should be added
    586589RETURN:  string, the matrix is transformed in a string and a first column has been added
    587590EXAMPLE: example intmatToPolymake;   shows an example"
     
    768771         from the program topcom by Joerg Rambau, Universitaet Bayreuth; it
    769772         therefore is necessary that this program is installed in order to use this
    770          procedure;
    771          see http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
    772        - the procedure creates the files /tmp/triangulationsinput and /tmp/triangulationsoutput;
     773         procedure; see
     774@*      http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
     775@*     - the procedure creates the files /tmp/triangulationsinput and /tmp/triangulationsoutput;
    773776         the former is used as input for points2triangs and the latter is its output
    774777         containing the triangulations of corresponding to points in the format
     
    776779         you have to hand an optional parameter (e.g. the number 1) to the procedure,
    777780         since otherwise the files will be destroyed before leaving the procedure
    778        - note that an integer i in an integer vector representing a triangle refers to
     781@*     - note that an integer i in an integer vector representing a triangle refers to
    779782         the ith lattice point, i.e. polygon[i]; this convention is different from
    780783         TOPCOM's convention, where i would refer to the i-1st lattice point
     
    907910ASSUME:  - polygon is a list of integer vectors of the same size representing the affine
    908911           coordinates of lattice points
    909          - if the triangulations of the corresponding polygon have already been computed
     912@*       - if the triangulations of the corresponding polygon have already been computed
    910913           with the procedure triangulations then these can be given as a second (optional)
    911914           argument in order to avoid doing this computation again
     
    916919         the procedure triangulations
    917920RETURN:  list, say L, such that:
    918                L[1] = intmat, each row gives the affine coordinates of a lattice point
     921@*             L[1] = intmat, each row gives the affine coordinates of a lattice point
    919922                      in the secondary polytope given by the marked
    920923                      polytope corresponding to polygon
    921                L[2] = the list of corresponding triangulations
     924@*             L[2] = the list of corresponding triangulations
    922925NOTE:    if the triangluations are not handed over as optional argument the procedure calls
    923926         for its computation of these triangulations the program points2triangs
    924927         from the program topcom by Joerg Rambau, Universitaet Bayreuth; it
    925928         therefore is necessary that this program is installed in order to use this
    926          procedure;
    927          see http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
     929         procedure; see
     930@*      http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
    928931EXAMPLE: example secondaryPolytope;   shows an example"
    929932{
     
    10331036   // the integer vectors in boundary are lattice points on the boundary
    10341037   // of a convex lattice polygon in the plane
    1035    list boundary=intvec(0,0),intvec(0,1),intvec(0,2),intvec(2,2),intvec(2,1),intvec(2,0);
     1038   list boundary=intvec(0,0),intvec(0,1),intvec(0,2),intvec(2,2),
     1039                 intvec(2,1),intvec(2,0);
    10361040   // interior is a lattice point in the interior of this lattice polygon
    10371041   intvec interior=1,1;
    10381042   // compute the general cycle length of a cycle of the corresponding cycle
    1039    // in the dual tropical curve -- note that (0,1) and (2,1) do not contribute
     1043   // in the dual tropical curve, note that (0,1) and (2,1) do not contribute
    10401044   cycleLength(boundary,interior);
    10411045}
     
    10481052         and the interior points
    10491053RETURN:  list, L consisting of three lists
    1050                L[1]    : represents the vertices the polygon ordered clockwise
    1051                          L[1][i][1] = intvec, the coordinates of the ith vertex
    1052                          L[1][i][2] = int, the position of L[1][i][1] in markings
    1053                L[2][i] : represents the lattice points on the facet of the polygon with
     1054@*             L[1]    : represents the vertices the polygon ordered clockwise
     1055@*                       L[1][i][1] = intvec, the coordinates of the ith vertex
     1056@*                       L[1][i][2] = int, the position of L[1][i][1] in markings
     1057@*             L[2][i] : represents the lattice points on the facet of the polygon with
    10541058                         endpoints L[1][i] and L[1][i+1] (i considered modulo size(L[1]))
    1055                          L[2][i][j][1] = intvec, the coordinates of the jth lattice point on that facet
    1056                          L[2][i][j][2] = int, the position of L[2][i][j][1] in markings
    1057                L[3]    : represents the interior lattice points of the polygon
    1058                          L[3][i][1] = intvec, the coordinates of the ith interior point
    1059                          L[3][i][2] = int, the position of L[3][i][1] in markings
     1059@*                       L[2][i][j][1] = intvec, the coordinates of the jth lattice point on that facet
     1060@*                       L[2][i][j][2] = int, the position of L[2][i][j][1] in markings
     1061@*             L[3]    : represents the interior lattice points of the polygon
     1062@*                       L[3][i][1] = intvec, the coordinates of the ith interior point
     1063@*                       L[3][i][2] = int, the position of L[3][i][1] in markings
    10601064EXAMPLE: example splitPolygon;   shows an example"
    10611065{
     
    11491153   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
    11501154   // with all integer points as markings
    1151    list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3);
     1155   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
     1156                intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
     1157                intvec(0,2),intvec(0,3);
    11521158   // split the polygon in its vertices, its facets and its interior points
    11531159   list sp=splitPolygon(polygon);
     
    11651171ASSUME:  polygon has the format of the output of splitPolygon, i.e. it is a list with three
    11661172         entries describing a convex lattice polygon in the following way:
    1167          polygon[1] : is a list of lists; for each i the entry polygon[1][i][1] is a lattice point which is
     1173@*       polygon[1] : is a list of lists; for each i the entry polygon[1][i][1] is a lattice point which is
    11681174                      a vertex of the lattice polygon, and polygon[1][i][2] is an integer assigned to
    11691175                      this lattice point as identifying index
    1170          polygon[2] : is a list of lists; for each vertex of the polygon, i.e. for each entry in polygon[1],
     1176@*       polygon[2] : is a list of lists; for each vertex of the polygon, i.e. for each entry in polygon[1],
    11711177                      it contains a list polygon[2][i], which contains the lattice points on the facet
    11721178                      with endpoints polygon[1][i] and polygon[1][i+1] - i considered mod size(polygon[1]);
     
    11741180                      vector giving the coordinate of the lattice point and an entry polygon[2][i][j][2]
    11751181                      which is the identifying index
    1176          polygon[3] : is a list of lists, where each entry corresponds to a lattice point in the
     1182@*       polygon[3] : is a list of lists, where each entry corresponds to a lattice point in the
    11771183                      interior of the polygon, with polygon[3][j][1] being the coordinates of the point
    11781184                      and polygon[3][j][2] being the identifying index;
    1179          triang is a list of integer vectors all of size three describing a triangulation of the
     1185@*       triang is a list of integer vectors all of size three describing a triangulation of the
    11801186         polygon described by polygon; if an entry of triang is the vector (i,j,k) then the triangle
    11811187         is build by the vertices with indices i, j and k
     
    13571363   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
    13581364   // with all integer points as markings
    1359    list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3);
     1365   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
     1366                intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
     1367                intvec(0,2),intvec(0,3);
    13601368   // split the polygon in its vertices, its facets and its interior points
    13611369   list sp=splitPolygon(polygon);
    1362    // define a triangulation by connecting the only interior point with the vertices
     1370   // define a triangulation by connecting the only interior point
     1371   //        with the vertices
    13631372   list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,5,10);
    13641373   // compute the eta-vector of this triangulation
     
    13691378"USAGE:      findOrientedBoundary(polygon); polygon list
    13701379ASSUME:      polygon is a list of integer vectors defining integer lattice points in the plane
    1371 RETURN:      list, l[1] = list of integer vectors such that the polygonal path defined by
     1380RETURN:      list, l with the followin interpretation
     1381@*                 l[1] = list of integer vectors such that the polygonal path defined by
    13721382                          these is the boundary of the convex hull of the lattice points in polygon
    1373                    l[2] = list, the redundant points in l[1] have been removed
     1383@*                 l[2] = list, the redundant points in l[1] have been removed
    13741384EXAMPLE:     example findOrientedBoundary;   shows an example"
    13751385{
     
    15361546   echo=2;
    15371547// the following lattice points in the plane define a polygon
    1538    list polygon=intvec(0,0),intvec(3,1),intvec(1,0),intvec(2,0),intvec(1,1),intvec(3,2),intvec(1,2),intvec(2,3),intvec(2,4);
     1548   list polygon=intvec(0,0),intvec(3,1),intvec(1,0),intvec(2,0),
     1549                intvec(1,1),intvec(3,2),intvec(1,2),intvec(2,3),
     1550                intvec(2,4);
    15391551// we compute its boundary
    15401552   list boundarypolygon=findOrientedBoundary(polygon);
     
    15481560proc cyclePoints (list triang,list points,int pt)
    15491561"USAGE:      cyclePoints(triang,points,pt)  triang,points list, pt int
    1550 ASSUME:      points is a list of integer vectors describing the lattice points of a marked polygon;
    1551             triang is a list of integer vectors describing a triangulation of the marked polygon
    1552              in the sense that an integer vector of the form (i,j,k) describes the triangle formed
    1553              by polygon[i], polygon[j] and polygon[k];
    1554             pt is an integer between 1 and size(points), singling out a lattice point among
    1555              the marked points
     1562ASSUME:      - points is a list of integer vectors describing the lattice points of a marked polygon;
     1563@*           - triang is a list of integer vectors describing a triangulation of the marked polygon
     1564               in the sense that an integer vector of the form (i,j,k) describes the triangle formed
     1565               by polygon[i], polygon[j] and polygon[k];
     1566@*           - pt is an integer between 1 and size(points), singling out a lattice point among
     1567               the marked points
    15561568PURPOSE:     consider the convex lattice polygon, say P, spanned by all lattice points in points which
    15571569             in the triangulation triang are connected to the point points[pt]; the procedure
     
    16101622   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
    16111623   // with all integer points as markings
    1612    list points=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),intvec(0,2),intvec(0,3);
     1624   list points=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
     1625               intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
     1626               intvec(0,2),intvec(0,3);
    16131627   // define a triangulation
    1614    list triang=intvec(1,2,5),intvec(1,5,7),intvec(1,7,9),intvec(8,9,10),intvec(1,8,9),intvec(1,2,8);
     1628   list triang=intvec(1,2,5),intvec(1,5,7),intvec(1,7,9),intvec(8,9,10),
     1629               intvec(1,8,9),intvec(1,2,8);
    16151630   // compute the points connected to (1,1) in triang
    16161631   cyclePoints(triang,points,1);
     
    16401655   echo=2;
    16411656   // define a polygon with lattice area 5
    1642    list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),intvec(2,1),intvec(0,0);
     1657   list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),
     1658                intvec(2,1),intvec(0,0);
    16431659   latticeArea(polygon);
    16441660}
     
    16481664ASSUME:  polygon is a list of integer vectors in the plane and consider their convex hull C
    16491665RETURN:  list, L of three integersthe
    1650                L[1] : the lattice area of C, i.e. twice the Euclidean area
    1651                L[2] : the number of lattice points on the boundary of C
    1652                L[3] : the number of interior lattice points of C
     1666@*             L[1] : the lattice area of C, i.e. twice the Euclidean area
     1667@*             L[2] : the number of lattice points on the boundary of C
     1668@*             L[3] : the number of interior lattice points of C
    16531669NOTE:    the integers in L are related by Pick's formula, namely: L[1]=L[2]+2*L[3]-2
    16541670EXAMPLE: example picksFormula;   shows an example"
     
    16811697   echo=2;
    16821698   // define a polygon with lattice area 5
    1683    list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),intvec(2,1),intvec(0,0);
     1699   list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),
     1700                intvec(2,1),intvec(0,0);
    16841701   list pick=picksFormula(polygon);
    16851702   // the lattice area of the polygon is:
     
    17031720                   the number 12.  Amer. Math. Monthly  107  (2000),  no. 3, 238--250.)
    17041721RETURN:  list, L such that
    1705                L[1] : list whose entries are the vertices of the normal form of the polygon
    1706                L[2] : the matrix A of the unimodular transformation
    1707                L[3] : the translation vector v of the unimodular transformation
    1708                L[4] : list such that the ith entry is the image of polygon[i] under the
     1722@*             L[1] : list whose entries are the vertices of the normal form of the polygon
     1723@*             L[2] : the matrix A of the unimodular transformation
     1724@*             L[3] : the translation vector v of the unimodular transformation
     1725@*             L[4] : list such that the ith entry is the image of polygon[i] under the
    17091726                      unimodular transformation T
    17101727EXAMPLE: example ellipticNF;   shows an example"
     
    19341951   echo=2;
    19351952   ring r=0,(x,y),dp;
    1936    // the Newton polygon of the following polynomial has precisely one interior point
     1953   // the Newton polygon of the following polynomial
     1954   //     has precisely one interior point
    19371955   poly f=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3;
    19381956   list polygon=newtonPolytopeLP(f);
     
    19601978PURPOSE: this is a database storing the 16 normal forms of planar polygons with
    19611979         precisely one interior point up to unimodular affine transformations
    1962          (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons and
     1980@*       (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons and
    19631981                   the number 12.  Amer. Math. Monthly  107  (2000),  no. 3, 238--250.)
    19641982RETURN:  list, L such that
    1965                L[1] : list whose entries are the vertices of the nth normal form
    1966                L[2] : list whose entries are all the lattice points of the nth normal form
    1967                L[3] : only present if the optional parameter # is present, and then
     1983@*             L[1] : list whose entries are the vertices of the nth normal form
     1984@*             L[2] : list whose entries are all the lattice points of the nth normal form
     1985@*             L[3] : only present if the optional parameter # is present, and then
    19681986                      it is a polynomial in the variables (x,y) whose Newton polygon
    19691987                      is the nth normal form
Note: See TracChangeset for help on using the changeset viewer.