Skip to main content

Bindings to the parma polyhedra library, allowing to use double description from Python

Project description

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 build && python install

If you have trouble, try adding the desired paths to library_dirs in 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.:

  • H_rep = [b | A] where the polyhedron is defined by b + A x >= 0
  • V_rep = [t | V] where V are the stacked vertices (Horizontal vectors) and t is the type: 1 for points, 0 for rays/lines.

To run the tests, simply run:


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.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyparma, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size pyparma-0.5.0.tar.gz (189.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page