When polymake is called, its output is read as a string and then processed as follows:
the lines containing upper case letters are found. These are treated as lines containing the keywords. Each of those lines marks the beginning of a block of data.
The string is then cut into a list of blocks (also strings). Each block starts with a line containing the keyword some lines of data.
for each of the blocks, the appropriate function of ObjectConverters
is called. Here "appropriate" just means, that the keyword of the block coincides with the name of the function.
The output of the conversion function is then written added to the known properties of the PolymakeObject
for which Polymake
was called.
This is done by the following methods:
> ConvertPolymakeOutputToGapNotation ( string ) | ( method ) |
Returns: Record having polymake keywords as entry names and the respective converted polymake output as entries.
Given a the output of the polymake program as a string string, this method first calls SplitPolymakeOutputStringIntoBlocks
(4.1-2). For each of the returned blocks, the name (=first line) of the block is read and the record ObjectConverters
(4.1-3) is looked up for an entry with that name. If such an entry exists, it (being a function!) is called and passed the block. The returned value is then given the name of the block and added to the record returned by ConvertPolymakeOutputToGapNotation
.
> SplitPolymakeOutputStringIntoBlocks ( string ) | ( method ) |
Returns: List of strings -- "blocks"--
The string string is cut at the lines starting with an upper case letter. The parts are returned as a list of strings. The initial string string remains unchanged.
> ObjectConverters | ( global variable ) |
The entries of this record are labeled by polymake keywords. Each of the entries is a function which converts a string returned by polymake to GAP format. So far, only a few converters are implemented. To see which, try RecNames(ObjectConverters);
You can define new converters using the basic functions described in section 4.2.
The following functions are used for the functions in ObjectConverters
(4.1-3).
> ConvertPolymakeNumber ( string ) | ( method ) |
The string string is converted to a rational number. Unlike Rat
, it tests, if the number represented by string is a floating point number an converts it correctly. If this is the case, a waring is issued.
> ConvertPolymakeScalarToGAP ( list ) | ( method ) |
If list contains a single string, this string is converted into a number using ConvertPolymakeNumber
(4.2-1).
> ConvertPolymakeMatrixToGAP ( list ) | ( method ) |
> ConvertPolymakeMatrixToGAPKillOnes ( list ) | ( method ) |
The list list of strings is interpreted as a list of row vectors and converted into a matrix. The "KillOnes" version removes the leading ones.
> ConvertPolymakeVectorToGAP ( list ) | ( method ) |
> ConvertPolymakeVectorToGAPKillOne ( list ) | ( method ) |
As the corresponding "Matrix" version. Just for vectors.
> ConvertPolymakeBoolToGAP ( list ) | ( method ) |
If list contains a single string, which is either 0 or 1, this function returns false
or true
, respectively.
> ConvertPolymakeSetToGAP ( list ) | ( method ) |
Let list be a list containing single string, which is a list of numbers separated by whitespaces and enclosed by { and } . The returned value is then a set of rational numbers (in the GAP sense).
> ConvertPolymakeGraphToGAP ( list ) | ( method ) |
Let list be a list of strings representing sets (that is, a list of integers enclosed by { and }). Then a record is returned containing two sets named .vertices
and .edges
.
> ConvertPolymakeHasseDiagramToGAP ( list ) | ( method ) |
Returns: List of sets of triples (of sets). The returned list is completely immutable.
If list is a list of strings as output by polymake's HASSE_DIAGRAM
algorithm, then this function returns a list of sets.
The ith entry represents the faces of dimension i. There is one entry for each dimension between 0 and the dimension of the polyhedron. Note that the last entry consists of a list with exactly one entry representing the whole polyhedron.
Every face is a list with three entries [vertices,invboundary,boundary]
where vertices
is a list of integers representing the vertices of the face (and the number of such a vertex is that of the vertex as a vertex of the full polyhedron). The second entry is a list of integers representing the positions of the i+1 faces containing the current face (in the i+1st entry of the Hasse diagram). And the last entry is the list of i-1 faces containing the current face (numbered by position in the i-1st entry in the Hasse diagram). The faces with empty third entry are exactly the vertices while the face with empty second entry is the face corresponding to the whole poyhedron.
The way polymake returns Hasse diagrams and vertices makes sure that the numbering of vertices is the same for the output of HASSE_DIAGRAM
and VERTICES
(i.e. the ith vertex of the vertex list is at position i in the first entry of the Hasse diagram).
generated by GAPDoc2HTML