Page 1 of 1

Projections

Posted: 10 Feb 2011, 15:41
by emerson
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!

Re: Projections

Posted: 13 Feb 2011, 17:28
by paffenholz
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.

Re: Projections

Posted: 14 Feb 2011, 09:55
by herr
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.

Re: Projections

Posted: 14 Feb 2011, 17:06
by emerson
Thanks a lot! I'll probably be asking here again soon... Regards!

Re: Projections

Posted: 14 Feb 2011, 17:16
by herr
Sure, questions like that are very welcome! :-)

Re: Projections

Posted: 15 Feb 2011, 12:45
by gawrilow
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.

Re: Projections

Posted: 21 Mar 2011, 16:30
by emerson
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...

Re: Projections

Posted: 21 Mar 2011, 18:18
by joswig
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.