Page 1 of 1

Vertex labels vs indices

Posted: 07 Mar 2013, 23:04
by ramanath
Dear all,

I am using topaz to read faces of a simplicial complex and print facets. I find that the vertex indices that are input using INPUT_FACES get re-ordered to start from 0 compactly, so when I print FACETS I get different labels and have to match it up. E.g if my input faces are

topaz > print $sc->INPUT_FACES;
{5 6 8}
{6 8}

and my FACETs are

topaz > print $sc->FACETS;
{0 1 2}

What I want to get is {5 6 8}, ie, preserve the labels, or map it back into what was input. My input faces need not be maximal.

Is there a simple way? I see VERTEX_LABELS and VERTEX_INDICES and can do the mapping offline with some work but I was wondering if polymake has a way to do this automatically. This must be a commonly encountered need, so how do people get around it?

Sorry if it is a naive question, I am a newbie here.

thanks!

-Ram

Re: Vertex labels vs indices

Posted: 07 Mar 2013, 23:34
by gawrilow

Code: Select all

print rows_labeled($sc->FACETS, undef, $sc->VERTEX_INDICES);
does almost exactly what you want. Each row is decorated with a sequential number, but this should not disturb you.

Re: Vertex labels vs indices

Posted: 07 Mar 2013, 23:35
by joswig
What about the following?

Code: Select all

topaz > $sc=new SimplicialComplex(INPUT_FACES=>[[5,6,8],[6,8]]); topaz > print rows_labeled($sc->FACETS,undef,$sc->VERTEX_INDICES); 0:5 6 8
The second parameter "undef" can be replaced by something meaningful if you also want to give names to the facets.

Re: Vertex labels vs indices

Posted: 07 Mar 2013, 23:52
by ramanath
Perfect! Just what I need!

Thanks very much for the quick responses.

-Ram