Ask Your Question

Modifying PALP settings

asked 2011-07-10 00:11:24 -0500

Cody gravatar image

updated 2011-07-10 09:51:45 -0500

I encounter an error from PALP when I try to create a dual cone. I create a cone Cstar as an intersection of several other cones, then try to create its dual:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 10, in <module>
    exec compile(u'open("","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("Q3N0YXIuZHVhbCgp"),globals())+"\\n"); execfile(os.path.abspath(""))
  File "", line 1, in <module>

  File "/tmp/tmpFOwj4h/", line 2, in <module>
    exec compile(u'Cstar.dual()
  File "", line 1, in <module>

  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 1608, in dual
    rays = list(self.facet_normals())
  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 2123, in facet_normals
    for i in range(P.nfacets()):
  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 2196, in nfacets
    if self.is_reflexive():
  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 1930, in is_reflexive
  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 2712, in poly_x
    return self._palp("poly.x -f" + keys, reduce_dimension)
  File "/opt/sage47/local/lib/python2.6/site-packages/sage/geometry/", line 1026, in _palp
    self, self.vertices(), result)
ValueError: Error executing "poly.x -fe" for the given polytope!
Polytope: A lattice polytope: 10-dimensional, 47 vertices.
...[a large matrix]
increase POLY_Dmax!

How do I increase POLY_Dmax?

edit retag flag offensive close merge delete


Can you post the Sage code you used to produce the error?

benjaminfjones gravatar imagebenjaminfjones ( 2011-07-10 06:45:55 -0500 )edit

Edited to include the code.

Cody gravatar imageCody ( 2011-07-10 09:53:50 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2011-07-11 02:58:09 -0500

Volker Braun gravatar image

The latest Sage development version does not use PALP for cones any more, partly because it suffers from compile-time limits. Now it uses PPL and has no limits (besides ram and cpu time) for all practical purposes. And is faster, too :-) You need Sage-4.7.1-alpha1 or higher.

For the record, though, if you really want to use PALP for higher-dimensional problems then you must edit its Global.h header. PALP has no bounds checking, so make sure to increase the maximal number of points to suit your problem, too. Just increasing POLY_Dmax is likely to end up in segfaults.

edit flag offensive delete link more

answered 2011-07-10 10:10:49 -0500

benjaminfjones gravatar image

Looking through the source code of sage/geometry/ I found the method which is calling PALP, it is poly_x. In the documentation for poly_x there is an example which suggests that PALP has certain limits which are determined at compile time:

IMPORTANT: PALP requires some parameters to be determined during
   compilation time, i.e., the maximum dimension of polytopes, the
   maximum number of points, etc. These limitations may lead to errors
   during calls to different functions of these module.

Thus, it looks like you can't change POLY_Dmax unless you rebuild PALP manually. It might be a good idea to post your question to the sage-support list and mention the authors of the Sage interface to PALP: Andrey Novoseltsev and William Stein.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-07-10 00:11:24 -0500

Seen: 197 times

Last updated: Jul 11 '11