Problems with fan::raysToFacetNormals

Questions and problems about using polymake go here.
User avatar
hampe
Developer
Posts: 48
Joined: 29 Apr 2011, 10:42

Problems with fan::raysToFacetNormals

Postby hampe » 08 Sep 2011, 15:10

Hi!
I think I've found a problem in the FACET_NORMALS computation of PolyhedralFan. When I create the following fan:

Code: Select all

$f = new fan::PolyhedralFan(RAYS=>[[1,0,0],[0,1,0],[0,0,1]],MAXIMAL_CONES=>[[0],[1],[2]],LINEALITY_SPACE=>[[1,1,1]]);
and ask for the FACET_NORMALS, I get a "polymake: ERROR: Integer/Rational NaN at input line 1" or a std::bad_alloc and sometimes a segfault. I think I also found the reason for this:
In raysToFacetNormals (rays_facets_conversion.cc), the fan dimension is computed as rank(rays) + lineality_dim (which would be 4 here), while it probably should be rank(rays / lineality_space). While adding the linear span of the first cone, "ambientDim - fanDim" will then be -1, so the function will try to access linearSpan.row(-1), which of course doesn't work :-)

blorenz
Developer
Posts: 139
Joined: 10 Jan 2011, 17:21

Re: Problems with fan::raysToFacetNormals

Postby blorenz » 08 Sep 2011, 17:24

Hi,
thanks for the report!
You are correct, it should compute the total rank, as we cannot assume the rays to be orthogonal to the lineality space:

Code: Select all

int fanDim = rank(rays/linealitySpace);
After changing that line and recompiling it, the client should produce a correct facet description of the fan.

Ben


Return to “Helpdesk”