pplitepy 0.0.51__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,123 @@
1
+ Metadata-Version: 2.4
2
+ Name: pplitepy
3
+ Version: 0.0.51
4
+ Summary: Python pplite wrapper
5
+ Author-email: Acadia Larsen <acadia.larsen@gmail.com>
6
+ License: GPL v3
7
+ Project-URL: Homepage, https://github.com/ComboProblem/pplitepy
8
+ Project-URL: Download, https://github.com/ComboProblem/pplitepy
9
+ Keywords: polyhedron,polytope,convex,mathematics,ppl,pplite,milp,linear-programming
10
+ Platform: any
11
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
12
+ Classifier: Programming Language :: C++
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
23
+ Description-Content-Type: text/x-rst
24
+ Requires-Dist: cysignals
25
+ Requires-Dist: gmpy2>=2.1.0b1
26
+ Provides-Extra: doc
27
+ Requires-Dist: sphinx; extra == "doc"
28
+
29
+ PPlite Python Wrapper
30
+ =====================
31
+
32
+ This Python package provides a wrapper to the C++ package `pplite <https://github.com/ezaffanella/PPLite/>`__.
33
+
34
+ How it works
35
+ ------------
36
+
37
+ The names of objects and methods are a spelled out version of the objects and methods in the library:
38
+
39
+ .. code:: python
40
+
41
+ >>> import pplite
42
+ >>> x = pplite.Variable(0)
43
+ >>> y = pplite.Variable(1)
44
+ >>> z = pplite.Variable(2)
45
+ >>> cons = [x >= 0, y >= 0, z > 0, x + y + z == 1]
46
+ >>> poly = pplite.NNC_Polyhedron(spec_elem = "universe", dim_type = 3, topology = "nnc")
47
+ >>> poly.add_constraints(cons)
48
+ >>> poly
49
+ x0+x1+x2-1==0, x0>=0, x1>=0, -x0-x1+1>0
50
+ >>> poly.generators()
51
+ [p(x2), c(x0), c(x1)]
52
+
53
+ The available objects and functions from `pplite` Python module are:
54
+
55
+ - `Variable`, `Linear_Expression`, `Affine_Expression` (defined in `pplite.linear_algebra`)
56
+
57
+ - `Constraint` (defined in `pplite.constraint`)
58
+
59
+ - `Interval` (defined in `pplie.intervals`)
60
+
61
+ - `Bounding_Box_t`, `Bounding_Box_f` (defined in `pplite.bounding_box`)
62
+
63
+ - `PPliteGenerator`, `Point`, `Closure_point`, `Line`, `Ray` (defined in `pplite.generators`)
64
+
65
+ - `NNC_Polyhedron` (defined in `pplite.polyhedron`)
66
+
67
+ Installation
68
+ ------------
69
+
70
+ The project is available at `Python Package Index <https://pypi.org/project/pplitepy/>`_ and
71
+ can be installed with pip. It is reccomened to create a virtual enviorment
72
+ (suggested name `venv-pplite`) when installing the package.::
73
+
74
+ $ python3 -m venv venv-pplite
75
+ $ . ./venv-pplite/bin/activate
76
+ (venv-pplite) $ pip install pplitepy
77
+
78
+ The package should be accessed from the virtual enviroment::
79
+
80
+ (venv-pplite) $ python3
81
+ >>> import pplite
82
+
83
+ Using from Cython
84
+ -----------------
85
+
86
+ All Python classes from pplpy are extension types and can be used with Cython. Most
87
+ extension type carries an attribute `thisptr` that holds a pointer to
88
+ the corresponding C++ object from ppl.
89
+
90
+ Source
91
+ ------
92
+
93
+ You can find the latest version of the source code on github:
94
+ https://github.com/ComboProblem/pplitepy
95
+
96
+ Documentation
97
+ -------------
98
+
99
+ TBD.
100
+
101
+ License
102
+ -------
103
+
104
+ pplitepy is distributed under the terms of the GNU General Public License (GPL)
105
+ published by the Free Software Foundation; either version 3 of
106
+ the License, or (at your option) any later version. See http://www.gnu.org/licenses/.
107
+
108
+ Requirements
109
+ ------------
110
+
111
+ - `pplite <https://github.com/ezaffanella/PPLite>`__
112
+
113
+ - `Cython <http://cython.org>`_ (tested with 3.0)
114
+
115
+ - `cysignals <https://pypi.org/project/cysignals/>`_
116
+
117
+ - `gmpy2 <https://pypi.org/project/gmpy2/>`_
118
+
119
+ - `flint <https://flintlib.org/>`_
120
+
121
+ On Debian/Ubuntu systems the dependencies can be installed with::
122
+
123
+ $ sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libppl-dev cython3 python3-gmpy2 python3-cysignals-pari flint
@@ -0,0 +1,95 @@
1
+ PPlite Python Wrapper
2
+ =====================
3
+
4
+ This Python package provides a wrapper to the C++ package `pplite <https://github.com/ezaffanella/PPLite/>`__.
5
+
6
+ How it works
7
+ ------------
8
+
9
+ The names of objects and methods are a spelled out version of the objects and methods in the library:
10
+
11
+ .. code:: python
12
+
13
+ >>> import pplite
14
+ >>> x = pplite.Variable(0)
15
+ >>> y = pplite.Variable(1)
16
+ >>> z = pplite.Variable(2)
17
+ >>> cons = [x >= 0, y >= 0, z > 0, x + y + z == 1]
18
+ >>> poly = pplite.NNC_Polyhedron(spec_elem = "universe", dim_type = 3, topology = "nnc")
19
+ >>> poly.add_constraints(cons)
20
+ >>> poly
21
+ x0+x1+x2-1==0, x0>=0, x1>=0, -x0-x1+1>0
22
+ >>> poly.generators()
23
+ [p(x2), c(x0), c(x1)]
24
+
25
+ The available objects and functions from `pplite` Python module are:
26
+
27
+ - `Variable`, `Linear_Expression`, `Affine_Expression` (defined in `pplite.linear_algebra`)
28
+
29
+ - `Constraint` (defined in `pplite.constraint`)
30
+
31
+ - `Interval` (defined in `pplie.intervals`)
32
+
33
+ - `Bounding_Box_t`, `Bounding_Box_f` (defined in `pplite.bounding_box`)
34
+
35
+ - `PPliteGenerator`, `Point`, `Closure_point`, `Line`, `Ray` (defined in `pplite.generators`)
36
+
37
+ - `NNC_Polyhedron` (defined in `pplite.polyhedron`)
38
+
39
+ Installation
40
+ ------------
41
+
42
+ The project is available at `Python Package Index <https://pypi.org/project/pplitepy/>`_ and
43
+ can be installed with pip. It is reccomened to create a virtual enviorment
44
+ (suggested name `venv-pplite`) when installing the package.::
45
+
46
+ $ python3 -m venv venv-pplite
47
+ $ . ./venv-pplite/bin/activate
48
+ (venv-pplite) $ pip install pplitepy
49
+
50
+ The package should be accessed from the virtual enviroment::
51
+
52
+ (venv-pplite) $ python3
53
+ >>> import pplite
54
+
55
+ Using from Cython
56
+ -----------------
57
+
58
+ All Python classes from pplpy are extension types and can be used with Cython. Most
59
+ extension type carries an attribute `thisptr` that holds a pointer to
60
+ the corresponding C++ object from ppl.
61
+
62
+ Source
63
+ ------
64
+
65
+ You can find the latest version of the source code on github:
66
+ https://github.com/ComboProblem/pplitepy
67
+
68
+ Documentation
69
+ -------------
70
+
71
+ TBD.
72
+
73
+ License
74
+ -------
75
+
76
+ pplitepy is distributed under the terms of the GNU General Public License (GPL)
77
+ published by the Free Software Foundation; either version 3 of
78
+ the License, or (at your option) any later version. See http://www.gnu.org/licenses/.
79
+
80
+ Requirements
81
+ ------------
82
+
83
+ - `pplite <https://github.com/ezaffanella/PPLite>`__
84
+
85
+ - `Cython <http://cython.org>`_ (tested with 3.0)
86
+
87
+ - `cysignals <https://pypi.org/project/cysignals/>`_
88
+
89
+ - `gmpy2 <https://pypi.org/project/gmpy2/>`_
90
+
91
+ - `flint <https://flintlib.org/>`_
92
+
93
+ On Debian/Ubuntu systems the dependencies can be installed with::
94
+
95
+ $ sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libppl-dev cython3 python3-gmpy2 python3-cysignals-pari flint
@@ -0,0 +1,37 @@
1
+ r"""
2
+ Cython wrapper for the Parma Polyhedra Lite Library (PPLite).
3
+
4
+ The Parma Polyhedra Lite Library (PPLite) is a library for polyhedral computations over
5
+ the rationals. This interface tries to reproduce the C++ API as faithfully as possible
6
+ in Python.
7
+
8
+ AUTHORS:
9
+
10
+ - Acadia Larsen (2024): initial version.
11
+ """
12
+
13
+ __version__ = "0.0.51"
14
+
15
+ from .linear_algebra import (
16
+ Variable, Linear_Expression, Affine_Expression
17
+ )
18
+
19
+ from .constraint import (
20
+ Constraint
21
+ )
22
+
23
+ from .generators import (
24
+ PPliteGenerator, Point, Closure_point, Ray, Line
25
+ )
26
+
27
+ from .intervals import (
28
+ Interval
29
+ )
30
+
31
+ from .bounding_box import (
32
+ Bounding_Box_t, Bounding_Box_f
33
+ )
34
+
35
+ from .polyhedron import (
36
+ NNC_Polyhedron
37
+ )
@@ -0,0 +1,11 @@
1
+ # distutils: extra_compile_args = -std=c++11
2
+
3
+ from .pplite_decl cimport *
4
+
5
+ cdef class Bounding_Box_t:
6
+ cdef Box_t *thisptr
7
+
8
+ cdef class Bounding_Box_f:
9
+ cdef Box_f *thisptr
10
+
11
+ # cpdef Create_Bounding_Box(cppbool keep_volume_info, dim_type sd=*, Spec_Elem se=*)