Macaulay2 » Documentation
Packages » PALPInterface :: fromPalpMatrix
next | previous | forward | backward | up | index | toc

fromPalpMatrix -- read a matrix printed by PALP

Description

This is the inverse of toPalp on matrices, and does not change the orientation of what it reads.

i1 : M = matrix{{1,1,1,1},{0,1,2,3}}

o1 = | 1 1 1 1 |
     | 0 1 2 3 |

              2       4
o1 : Matrix ZZ  <-- ZZ
i2 : assert(M == fromPalpMatrix toPalp M)
i3 : print palpRun("poly", "-v", {3, 1, 1, 1})
2 3  Vertices of P
   -1    2   -1
   -1   -1    2
i4 : fromPalpMatrix palpRun("poly", "-v", {3, 1, 1, 1})

o4 = | -1 2  -1 |
     | -1 -1 2  |

              2       3
o4 : Matrix ZZ  <-- ZZ

Since PALP does not always print a point set the same way round, the functions that return point sets, such as palpMVertices, reorient what they read so that each point is a column. This function does not: it is the raw reader.

Caveat

An error is raised if PALP printed nothing, or if the rows do not have the length that PALP's header announced. The latter happens for the inequalities that poly.x -e prints for a polytope that is not reflexive, which carry an extra inhomogeneous entry.

See also

Ways to use fromPalpMatrix:

  • fromPalpMatrix(String)

For the programmer

The object fromPalpMatrix is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/PALPInterface.m2:1485:0.