Face Lattice

Questions and problems about using polymake go here.
satya123999
Posts: 25
Joined: 02 Apr 2013, 17:30

Face Lattice

Postby satya123999 » 02 Apr 2013, 17:55

Hello,

I made a newton polytope from the polynomial equation given below:

$d = $e*$x5+$e*$x12*$x4;
$nd = newton($d);

then when I print the faces lattice structure it turns out to be:
print $HD->FACES;
{}
{0}
{1}
{0 1}
but when I try to access the last 1 dimensional face i.e.

for (my $k=$HD->DIMS->[1]; $k<$HD->DIMS->[2]; ++$k) { print $HD->FACES->[$k] }

The following error is encountered:
polymake: ERROR: index out of range at input line 1.

Please help me to resolve the error.

Thanks & Regards,

Satya

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

Re: Face Lattice

Postby paffenholz » 02 Apr 2013, 19:08

Indices in polymake start with 0, and the array DIMS has only two entries, so you probably meant to access 0 and 1 instead of 1 and 2.

There is, however, a more subtle problem in your code. The array DIMS contains the indices of the faces where the dimension changes, but polymake is allowed to store a face lattice either from bottom or from top (depending on some heuristics), so DIMS either marks a jump up or a jump down in the dimension. A more general form of your code would be:

Code: Select all

for my $e (@{$HD->nodes_of_dim(1)}) { print $HD->FACES->[$e], "\n"; }

satya123999
Posts: 25
Joined: 02 Apr 2013, 17:30

Re: Face Lattice

Postby satya123999 » 02 Apr 2013, 19:20

Thank you very much !


Return to “Helpdesk”