project a polytope

Questions and problems about using polymake go here.

Moderator: Moderators

chocoffee
Posts: 1
Joined: 28 May 2019, 22:12

project a polytope

Postby chocoffee » 28 May 2019, 22:21

Hi all,
I am trying to get the projection of a given polytope V with new m-dimensional variables y=Ex+f. Here x is the n-dimensional variable vector of the polytope V. E is a m*n matrix. I am wondering if I can get the projection by polymake. Thank you!

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

Re: project a polytope

Postby gawrilow » 01 Jun 2019, 18:51

I guess, all you need is to multiply the vertices of your input polytope with the transformation matrix, isn't it?

Taking care of the 0-th homogeneous coordinate:

Code: Select all

$tr=(1|$f)/(zero_vector<Rational>()|transpose($E)); $Vproj=new Polytope<Rational>(POINTS => $V->VERTICES * $tr);
Replace Rational with an appropriate coordinate type if necessary.

Collars
Posts: 1
Joined: 07 Jun 2019, 12:14

Re: project a polytope

Postby Collars » 08 Jun 2019, 15:14

Does replacing the Rational mess with anything else, Gawrilow?

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

Re: project a polytope

Postby gawrilow » 10 Jun 2019, 12:02

The choice of coordinate data type does not mess with anything, it should just reflect the nature of your input. Rational is the default choice in polymake, and this is appropriate in most standard cases. Float is also supported, but the outcome of many computations is not that reliable because of unavoidable rounding issues. You may try it out if your input is already in floating-point, but you can also switch to Rational, the numbers will be converted automatically.


Return to “Helpdesk”

cron