Python PPL wrapper
Project description
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 the Sage software.
How it works
The names of objects and methods are the same as in the library:
>>> import ppl
>>> 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)
Installation
The project is available at Python Package Index and can 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 brew on MacOSX) then you need to set appropriately the variables CFLAGS before calling pip. For example:
$ 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
Using from Cython
All Python classes from pplpy are extension types and can be used with Cython. Each extension type carries an attribute thisptr that holds a pointer to the corresponding C++ object from ppl.
A complete example is provided with the files tests/testpplpy.pyx and tests/setup.py.
Source
You can find the latest version of the source code on github: https://github.com/sagemath/pplpy
Documentation
An online version of the documentation is available at https://www.sagemath.org/pplpy/
Compiling the html documentation requires make and sphinx. 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 standard Makefile with a target html. Running make html in the docs repository builds the documentation inside docs/build/html. For more configuration options, run make help.
License
pplpy is distributed under the terms of the GNU General Public License (GPL) published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. See http://www.gnu.org/licenses/.
Requirements
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pplpy-0.8.10.tar.gz
.
File metadata
- Download URL: pplpy-0.8.10.tar.gz
- Upload date:
- Size: 64.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d42a216c82914dcf4d7c000debc98bb336b8f83e026ba5d952cccd9f8074effd |
|
MD5 | ab1d684e650d26bb5446c5066de8d036 |
|
BLAKE2b-256 | 92d0664f5ee65a8d9d071c2cdbfc8e42e0476b5b8c5ceefaa5fc9c2e1cd6fa5e |
File details
Details for the file pplpy-0.8.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 13.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f9230641b6920f5cb07d04a9da72d3e68108f6a8d4259be1fc4cbc71560261b |
|
MD5 | 8384922019660579e70fa0f8bc275b4b |
|
BLAKE2b-256 | 29c18907fc08864167cc90b2a14b4c340251b29631cb62c9d2b7893431123881 |
File details
Details for the file pplpy-0.8.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 12.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb027f45e543b2e8a97f7a81ce7aab6b318b922e996692018b8a6eb0641ca4eb |
|
MD5 | 04226e7be017acebdb423c793ab71391 |
|
BLAKE2b-256 | 98a76faf2a0d75b88f20fee305919c43b2d827a46dd4d8b3028009d22ea23eaa |
File details
Details for the file pplpy-0.8.10-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b7cb32f8e184dfffdf33f685bcded7323c132162ff05cd8292e802b8068c8dc |
|
MD5 | 33a256696c54a77b850420339cc52de5 |
|
BLAKE2b-256 | 56b26c3da00cc53efd5f7c4b34ccbece05c52e38ea490d229188a6b26d2fbb4c |
File details
Details for the file pplpy-0.8.10-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7cbea42765889c9c217552696923e8b98148669c9c2917f70b07b96d0270266 |
|
MD5 | 132231364d11c00cb445f45b093c50c3 |
|
BLAKE2b-256 | a38193c59b6275826a5fcec97b9079d12d39f91e915d6f582ea414431e01ea8d |
File details
Details for the file pplpy-0.8.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 13.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb7c63cef99e8437aadbcdf23581d6f50dbdcd582ab9e3ad90ab5a83720b23f |
|
MD5 | a0cf0ea9edfedafced6ce6921d4c0cbe |
|
BLAKE2b-256 | 1ca3d57468107c7b5676d2f9a6ef5b982693bccd79427ad3b47f55fb1994e52c |
File details
Details for the file pplpy-0.8.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 12.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43ccd3e742467909ac8fcff84260a324b4a076d2fda61acc4efc9afc58f022f5 |
|
MD5 | b4da8ccb813f700f7a00f7de9ae56c56 |
|
BLAKE2b-256 | 66c2d874a03435efc39c88bed380e848d4d4438dbf7ee8d9ad2999d4fcd4cb82 |
File details
Details for the file pplpy-0.8.10-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fffdfe52f3ee92cfbabf120f19cd734d2ebafbd347303e9783f85592cc79672 |
|
MD5 | a0f75855d4d3c72d067f132e4ee045d9 |
|
BLAKE2b-256 | fc7c062cb63f4529bd8a144e1875288e4b0789b95df1f88243fd91efd9f4c094 |
File details
Details for the file pplpy-0.8.10-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f886097628b958a03970a8383bd9186474c59fd73142e66540670d2294401bc |
|
MD5 | c1f8e3226659922a6f0bf08bea29c690 |
|
BLAKE2b-256 | 83a5f94aee420f757c09e292d44d7ba55d62836e985d608302e95810a0d3c600 |
File details
Details for the file pplpy-0.8.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cac93b538a6a348f4606e4e5f706ffad9e6f4c19776201a1710a6bf72db7e54 |
|
MD5 | 3ec1de029277f797d6d53846ca958800 |
|
BLAKE2b-256 | 2c10dae61a9005211481374cbf208d8cca7db94c4f027545f2cb611d2f3c5183 |
File details
Details for the file pplpy-0.8.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 12.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c354ec02fe140ace79585b72fc5555cc7286b8d6a95c1cde4ccc17154644e13 |
|
MD5 | 8998d24b9216f5c1866d7f57a2cb9574 |
|
BLAKE2b-256 | ebc397d5ad1a81b48053a0bd4e7ce2981634e7f3ba2df66600b34a3ace641c1d |
File details
Details for the file pplpy-0.8.10-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b41b0cb023a5beb16ca5b603515953f4262ed46fa85216a6ad08f9a16f45870 |
|
MD5 | 5502765d08688f5e6d895dadb54d0d41 |
|
BLAKE2b-256 | fb0ce70c4810de2874f7d39a757eb7cfc2539faf7d99a11769ee489fb62920c4 |
File details
Details for the file pplpy-0.8.10-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82212ede8b817382b88f0b6735c892249c2b4c8547b65a0968c1d18eec6b4707 |
|
MD5 | f40b1115a8e9e11ad0dc4ef6bc331fb6 |
|
BLAKE2b-256 | 52b88105f79fa31a641427af6d1f6cf9e42c2723c65514effd491202bf16bca9 |
File details
Details for the file pplpy-0.8.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df37f8b8bb43285f029efadb65155bf3d9f71aa17b42b7ee25e19afe0f15f4dc |
|
MD5 | a596485d3def80b7f8953065c5529b59 |
|
BLAKE2b-256 | 0264ea807a96e30837a284899d61a1509638b2e66677eb0dd689344c1bbc5926 |
File details
Details for the file pplpy-0.8.10-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 12.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaa2c9ea7b4be207309fb64965f5e6a0eea3c4227cec46db35d9a4cea2e6ef57 |
|
MD5 | b052363a4927e4be6175c3e87c358ca9 |
|
BLAKE2b-256 | 7c3ed4e3f19d0d2c62a73f82dbb7f7c5ace0e477018dd31a2b00e24c2fefc8be |
File details
Details for the file pplpy-0.8.10-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3731b52295d6cbb1eb4f8438c232bef5136e4bec2e78fd437ebd0bd42416eeaf |
|
MD5 | 817978de7dd83f63136b3dd1c91fd4a8 |
|
BLAKE2b-256 | 4f0aad534471e721e099e89c44ece7fb2ab0e99b9122247b56ba34e18466f7e8 |
File details
Details for the file pplpy-0.8.10-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pplpy-0.8.10-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d580c86db3be53a1874de4a7e387e21ea08b36512028e3f35eeddd54d4b7d956 |
|
MD5 | 4dd49add08319f82362a22fb0f34515d |
|
BLAKE2b-256 | e28d659f3c7fc98da6c54f31ceacc8bd2d64c402b63f9920ce30f915c9760f99 |