Projections

Questions and problems about using polymake go here.
emerson
Posts: 6
Joined: 10 Feb 2011, 15:01

Projections

Postby emerson » 10 Feb 2011, 15:41

Hi everybody! I'm always in troubles when trying to use polymake. It is very nice to find this space here to ask. This must be an easy question, since I don't quite grasp how to read the documentation. I'm trying to use the command projection to eliminate the last coordinate from a 7-polytope. How should I specify the array of indices? For example, I tried the following...

Code: Select all

$R=projection($P,{0,1,2,3,4,5,6}); polymake: ERROR: projection: polyhedron full-dimensional, don't know where to project on
In this case $P is a full dimensional 7-polytope, but I am only interested in its projection. The first 0 index was supposed to mean the first 1 coordinate on the vertex description. What is the right way to do it?

I have similar problems with most of the things I try to use. Maybe it would be nice to have small examples of code that work for the different items on the documentation. Thanks for anything that could help... See you!

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

Re: Projections

Postby paffenholz » 13 Feb 2011, 17:28

The coordinates you want to project on should be handed to the function as an array of integers, so use "[" instead of "{". You also don't need to specify the homogenization coordinate, it will be preserved automatically. Your example should work if you use

Code: Select all

$R=projection($P,[1,2,3,4,5,6]);
The function "projection", also accepts some options, and one inverts the list of coordinates. You should obtain the same result if you use

Code: Select all

$R=projection($P,[7],revert=>1);
We try to gradually extend the documentation. If you look for conrete examples then maybe
the tutorials are a good place to look at.

herr
Developer
Posts: 40
Joined: 30 Dec 2010, 13:15

Re: Projections

Postby herr » 14 Feb 2011, 09:55

The documentation says

Code: Select all

Parameters Polytope P Array<Int> indices
So if the syntax you try does not work, it is always possible to specify the indices in an extra variable:

Code: Select all

$coords=new Array<Int>(1,2,3,4,5,6); $R=projection($P,$coords);
That way you can directly use the data type you find in the documentation.

emerson
Posts: 6
Joined: 10 Feb 2011, 15:01

Re: Projections

Postby emerson » 14 Feb 2011, 17:06

Thanks a lot! I'll probably be asking here again soon... Regards!

herr
Developer
Posts: 40
Joined: 30 Dec 2010, 13:15

Re: Projections

Postby herr » 14 Feb 2011, 17:16

Sure, questions like that are very welcome! :-)

User avatar
gawrilow
Main Author
Posts: 423
Joined: 25 Dec 2010, 17:40

Re: Projections

Postby gawrilow » 15 Feb 2011, 12:45

So if the syntax you try does not work, it is always possible to specify the indices in an extra variable ...
That way you can directly use the data type you find in the documentation.
It will surely be also helpful if we include a remark in the documentation of Array that it almost always can be encoded as a perl anonymous array, and give an example of the syntax.

emerson
Posts: 6
Joined: 10 Feb 2011, 15:01

Re: Projections

Postby emerson » 21 Mar 2011, 16:30

Hallo! The projections were working fine, but now I get some error message when I try to project a polytope I just loaded seconds ago. This is what I get:

Code: Select all

polytope > $P= load("ex1g40.poly"); polytope > $R=projection($P,[2,3,4,5,6,7]); /usr/site-local/share/bin/polymake: line 7: 11618 Segmentation fault /usr/site-local/polymake-suse-11.3/bin/polymake $*
The polytope is nevertheless uploaded successfully. I don't know what is going on...

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

Re: Projections

Postby joswig » 21 Mar 2011, 18:18

As it seems there is something terribly wrong with the installation at TU Berlin. Similar problems from there have been reported before. The current version 2.9.9 is extremely simple to install, even locally. You should try to get a correct installation.


Return to “Helpdesk”