# Singular

#### D.13.2.1 polymakePolytope

Procedure from library `polymake.lib` (see polymake_lib).

Usage:
polymakePolytope(points); polytope intmat

Assume:
each row of points gives the coordinates of a lattice point of a polytope with their affine coordinates as given by the output of secondaryPolytope

Purpose:
the procedure calls polymake to compute the vertices of the polytope as well as its dimension and information on its facets

Return:
list, L with four entries
L[1] : an integer matrix whose rows are the coordinates of vertices of the polytope
L[2] : the dimension of the polytope
L[3] : a list whose ith entry explains to which vertices the ith vertex of the Newton polytope is connected
-- i.e. L[3][i] is an integer vector and an entry k in there means that the vertex L[1][i] is connected to the vertex L[1][k]
L[4] : an matrix of type bigintmat whose rows mulitplied by (1,var(1),...,var(nvar)) give a linear system of equations describing the affine hull of the polytope,
i.e. the smallest affine space containing the polytope

Note:
- for its computations the procedure calls the program polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt; it therefore is necessary that this program is installed in order to use this procedure;
see http://www.polymake.org/
- note that in the vertex edge graph we have changed the polymake convention which starts indexing its vertices by zero while we start with one !

Example:
 ```LIB "polymake.lib"; ==> Welcome to polymake version ==> Copyright (c) 1997-2015 ==> Ewgenij Gawrilow, Michael Joswig (TU Darmstadt) ==> http://www.polymake.org // the lattice points of the unit square in the plane list points=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1); // the secondary polytope of this lattice point configuration is computed intmat secpoly=secondaryPolytope(points)[1]; ==> Evaluating Commandline Options ... ==> ... done. ==> 0 ==> 0 list np=polymakePolytope(secpoly); ==> polymake: used package ppl ==> The Parma Polyhedra Library (PPL): A C++ library for convex polyhedra ==> and other numerical abstractions. ==> http://www.cs.unipr.it/ppl/ ==> // the vertices of the secondary polytope are: np[1]; ==> 2,1,1,2, ==> 1,2,2,1 // its dimension is np[2]; ==> 1 // np[3] contains information how the vertices are connected to each other, // e.g. the first vertex (number 0) is connected to the second one np[3][1]; ==> 2 // the affine hull has the equation ring r=0,x(1..4),dp; matrix M[5][1]=1,x(1),x(2),x(3),x(4); intmat(np[4])*M; ==> _[1,1]=-x(3)-x(4)+3 ==> _[2,1]=x(1)-x(4) ==> _[3,1]=x(2)-x(3) ```