Home

Awesome

Build Status

These are Python bindings to the Parma Polyhedra Library. They were extracted from the sagemath project, in order to be used in non-sage projects. This is GPL-licensed, as is Sagemath.

To build it you need to have both the ppl and gmp libraries installed in a place where distutils can find it. Then,

python setup.py build && python setup.py install

If you have trouble, try adding the desired paths to library_dirs in setup.py as a keyword argument to the Extension constructor.

To use it, simply import the module, create a matrix of Fractions or integers, and compute the double description !

from pyparma import Polyhedron
import numpy as np
from fractions import Fraction

fractionize = np.vectorize(lambda x: Fraction(str(x)))
A = fractionize(np.random.rand(50,3))
poly = Polyhedron(hrep=A)
print poly.hrep()

Both H-representation and V-representation follow the CDD format i.e.:

To run the tests, simply run:

nosetests

From the top-level directory. To run the tests, you need to have the CDD library installed. I assume that you installed the version that comes with the pycddlib bindings.