Problems with script ”gc_closure”

Questions and problems about using polymake go here.
maudi
Posts: 7
Joined: 07 Feb 2011, 18:29

Problems with script ”gc_closure”

Postby maudi » 30 Oct 2011, 09:58

Hello together,

I need your help again :-)
I use the new version 2.10 on openSUSE 11.4. and tried the script „gc_closure“.
Unfortunately it does not work accurately. Every polytope I use as input creates an empty polytope as output without showing an error.
The output polytope has no vertex although the input polytope has some integer vertices (see code example).


script("gc_closure");
$e=new Polytope<Rational>(POINTS=>[[1,0,0,0],[1,1/2,0,0],[1,1/2,0,1],[1,1,0,1/2],[1,1,1/2,1]]);
$q=gc_closure($e);

polymake: used package cddlib
  Implementation of the double description method of Motzkin et al.
  Copyright by Komei Fukuda.
  http://www.ifor.math.ethz.ch/~fukuda/cdd_home/cdd.html

polymake: used package normaliz2
  Normaliz is a tool for computations in affine monoids, vector configurations, lattice polytopes, and rational cones.
  Copyright by Winfried Bruns, Bogdan Ichim, Christof Soeger.
  http://www.math.uos.de/normaliz/


print$q->VERTICES;

It creates an empty polytope.

Normally the result after running “gc_closure” one time should be
1 0 0 0
1 1/2 0 1/2

and after running “gc_closure” a second time it should result the integer hull:
1 0 0 0

but it does not work. What could be wrong?
Maybe I forgot to install additional software to make it run? I already installed 4ti2 or normaliz2 in addition to polymake.

I hope you can help me with that :-)

User avatar
joswig
Main Author
Posts: 282
Joined: 24 Dec 2010, 11:10

Re: Problems with script ”gc_closure”

Postby joswig » 30 Oct 2011, 13:27

There is a sign error in the script. Please change line 28 of apps/polytope/scripts/gc_closure to

Code: Select all

my $obj=-(new Vector<Rational>(0 | $this_vector));
At some point we changed the orientation of the normal cones, but we forgot to modify this script accordingly. Sorry for the inconvenience. Will be fixed in the next release.

maudi
Posts: 7
Joined: 07 Feb 2011, 18:29

Re: Problems with script ”gc_closure”

Postby maudi » 30 Oct 2011, 14:19

Thank you for your fast reply!

I changed line 28 and saved it as „gc_closure11“.
Running „gc_closure11“ one time works well.

polytope > $q=gc_closure11($e);

polytope > print$q->VERTICES;
1 0 0 0
1 1/2 0 1/2

But the second run produces the following error:

polytope > $w=gc_closure11($q);
polymake: WARNING: could not compute 'HILBERT_BASIS' probably because of unsatisfied preconditions:
precondition : POINTED ( _4ti2.hilbert: HILBERT_BASIS : CONE_AMBIENT_DIM , FACETS | INEQUALITIES )
precondition : POINTED ( normaliz2.hilbert: HILBERT_BASIS : CONE_AMBIENT_DIM , FACETS | INEQUALITIES )
precondition : POINTED ( beneath_beyond.convex_hull.primal, default.triangulation:  FACETS, LINEAR_SPAN, RAYS_IN_FACETS, DUAL_GRAPH.ADJACENCY, TRIANGULATION.FACETS, ESSENTIALLY_GENERIC : RAYS )
precondition : POINTED ( normaliz2.hilbert: HILBERT_BASIS : CONE_AMBIENT_DIM , RAYS | INPUT_RAYS )

polymake: ERROR: Can't call method "rows" on an undefined value at /home/mandy/Desktop/scripte//gc_closure11 line 10.

What else could be wrong?
It should create
1 0 0 0
but it failed again.

paffenholz
Developer
Posts: 212
Joined: 24 Dec 2010, 13:47

Re: Problems with script ”gc_closure”

Postby paffenholz » 31 Oct 2011, 15:40

The script only works for full-dimensional polytopes, but, unfortunaltely, does not test this in the current version. A generating set of the semigroup of integer points in each normal cone is not unique for non-pointed cones (which is the case if the polytope is not full-dimensional), so computations in polymake are currently restricted to the pointed case.

You have basically two options here:
- modify the script. For each normal cone you could extract the pointed part and compute a Hilbert basis for this. A generating set for the lineality is not necessary in this case, as those inequalities will always have integral right hand side.
- apply a lattice transformation to make the polytope full-dimensional. polymake has the function "ambient_lattice_normalization" for this. Unfortunately it currently does not record the transformation matrix.


Return to “Helpdesk”