Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4
Python wrapper to the PPL library. Source repository forhttps://pypi.org/project/pplpy/
License
sagemath/pplpy
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This Python package provides a wrapper to the C++Parma Polyhedra Library(PPL).
The whole package started as a fork of a tiny part of theSage software.
The names of objects and methods are the same as in the library:
>>>importppl>>>x=ppl.Variable(0)>>>y=ppl.Variable(1)>>>z=ppl.Variable(2)>>>cs=ppl.Constraint_System()>>>cs.insert(x>=0)>>>cs.insert(y>=0)>>>cs.insert(z>=0)>>>cs.insert(x+y+z==1)>>>poly=ppl.C_Polyhedron(cs)>>>poly.minimized_generators()Generator_System {point(1/1,0/1,0/1),point(0/1,1/1,0/1),point(0/1,0/1,1/1)}
The available objects and functions from the ppl Python module are:
- Variable, Variables_Set, Linear_Expression (defined in ppl.linear_algebra)
- MIP_Problem (defined in ppl.mip_problem)
- C_Polyhedron, NNC_Polyhedron (defined in ppl.polyhedron)
- Generator, Generator_System, Poly_Gen_Relation, point,closure_point, ray, line (defined in ppl.generator)
- Constraint, Constraint_System, Poly_Con_Relation,inequality, equation, strict_inequality (defined in ppl.constraint)
The project is available atPython Package Index andcan be installed with pip:
$ pip install pplpy
Note that if you have gmp and ppl installed in a non standard directory (e.g. you use brewon MacOSX) then you need to set appropriately the variables CFLAGS before calling pip. Forexample:
$ export CFLAGS="-I/path/to/gmp/include/ -L/path/to/gmp/lib/ -I/path/to/ppl/include/ -L/path/to/ppl/lib $CFLAGS"$ pip install pplpy
All Python classes from pplpy are extension types and can be used with Cython. Eachextension type carries an attribute thisptr that holds a pointer tothe corresponding C++ object from ppl.
A complete example is provided with the files tests/testpplpy.pyx and tests/setup.py.
You can find the latest version of the source code on github:https://github.com/sagemath/pplpy
An online version of the documentation is available athttps://www.sagemath.org/pplpy/
Compiling the html documentation requires make andsphinx.Before building the documentation, you need to install the pplpy package (sphinx uses Python introspection).The documentation source code is contained in the repository docs where there is a standardMakefile with a target html. Running make html in the docs repository builds the documentationinside docs/build/html. For more configuration options, run make help.
pplpy is distributed under the terms of the GNU General Public License (GPL)published by the Free Software Foundation; either version 3 ofthe License, or (at your option) any later version. Seehttp://www.gnu.org/licenses/.
On Debian/Ubuntu systems the dependencies can be installed with:
$ sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libppl-dev cython3 python3-gmpy2 python3-cysignals-pari
About
Python wrapper to the PPL library. Source repository forhttps://pypi.org/project/pplpy/
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors6
Uh oh!
There was an error while loading.Please reload this page.