### Install pplpy with pip Source: https://www.sagemath.org/pplpy/_sources/index.rst.txt Installs pplpy from the Python Package Index (PyPI). ```bash $ pip install pplpy ``` -------------------------------- ### setup.py for Cython extension with pplpy Source: https://www.sagemath.org/pplpy/_sources/index.rst.txt Minimal setup.py for a Cython extension using pplpy. It links with the ppl library and includes the pplpy installation path. ```python from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize import ppl extensions = [ Extension("test", ["test.pyx"], libraries=['ppl'], include_dirs=ppl.__path__, language='c++') ] setup(ext_modules=cythonize(extensions)) ``` -------------------------------- ### Access C++ object with thisptr Source: https://www.sagemath.org/pplpy/_sources/index.rst.txt Continues the previous Cython example, accessing the underlying C++ object via the thisptr attribute to print the space dimension. ```cython print('dim = %lu' % poly.thisptr.space_dimension()) ``` -------------------------------- ### Cython sample using pplpy Source: https://www.sagemath.org/pplpy/_sources/index.rst.txt Short sample of Cython code using pplpy. It creates variables, a constraint system, and a C_Polyhedron, then prints the minimized generators. ```cython from ppl.linear_algebra cimport Variable from ppl.constraint cimport Constraint_System from ppl.polyhedron cimport C_Polyhedron cdef Variable x = ppl.Variable(0) cdef Variable y = ppl.Variable(1) cdef Variable z = ppl.Variable(2) cdef Constraint_System cs = Constraint_System() cs.insert(x >= 0) cs.insert(y >= 0) cs.insert(x + y + z == 1) cdef C_Polyhedron poly = C_Polyhedron(cs) print(poly.minimized_generators()) ``` -------------------------------- ### Clone pplpy source from GitHub Source: https://www.sagemath.org/pplpy/_sources/index.rst.txt Clones the pplpy source code repository from GitHub. ```bash $ git clone https://github.com/sagemath/pplpy.git ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.