--- ppl/constraint.pxd.orig 2017-04-28 13:38:54.000000000 -0600
+++ ppl/constraint.pxd 2019-10-30 15:58:27.789332547 -0600
@@ -2,7 +2,7 @@ from .linear_algebra cimport *
cdef _wrap_Constraint(PPL_Constraint constraint)
-cdef _wrap_Constraint_System(PPL_Constraint_System constraint_system)
+cdef _wrap_Constraint_System(PPL_Constraint_System *constraint_system)
cdef _make_Constraint_from_richcmp(lhs_, rhs_, op)
--- ppl/constraint.pyx.orig 2019-02-14 02:51:09.000000000 -0700
+++ ppl/constraint.pyx 2019-10-31 14:27:41.273005195 -0600
@@ -1266,12 +1266,12 @@ cdef _wrap_Constraint(PPL_Constraint con
c.thisptr = new PPL_Constraint(constraint)
return c
-cdef _wrap_Constraint_System(PPL_Constraint_System constraint_system):
+cdef _wrap_Constraint_System(PPL_Constraint_System *constraint_system):
"""
Wrap a C++ ``PPL_Constraint_System`` into a Cython ``Constraint_System``.
"""
cdef Constraint_System cs = Constraint_System.__new__(Constraint_System)
- cs.thisptr = new PPL_Constraint_System(constraint_system)
+ cs.thisptr = new PPL_Constraint_System(deref(constraint_system))
return cs
cdef _wrap_Poly_Con_Relation(PPL_Poly_Con_Relation relation):
--- ppl/generator.pxd.orig 2017-04-28 13:38:54.000000000 -0600
+++ ppl/generator.pxd 2019-10-31 14:34:33.582052118 -0600
@@ -3,7 +3,7 @@ from .linear_algebra cimport *
cdef _wrap_Generator(PPL_Generator generator)
-cdef _wrap_Generator_System(PPL_Generator_System generator_system)
+cdef _wrap_Generator_System(PPL_Generator_System *generator_system)
cdef PPL_GeneratorType_str(PPL_GeneratorType t)
--- ppl/generator.pyx.orig 2018-08-29 21:44:39.000000000 -0600
+++ ppl/generator.pyx 2019-10-31 14:34:20.607271403 -0600
@@ -1086,13 +1086,13 @@ cdef _wrap_Generator(PPL_Generator gener
return g
-cdef _wrap_Generator_System(PPL_Generator_System generator_system):
+cdef _wrap_Generator_System(PPL_Generator_System *generator_system):
"""
Wrap a C++ ``PPL_Generator_System`` into a Cython ``Generator_System``.
"""
cdef Generator_System gs = Generator_System()
del gs.thisptr
- gs.thisptr = new PPL_Generator_System(generator_system)
+ gs.thisptr = new PPL_Generator_System(deref(generator_system))
return gs
cdef class Poly_Gen_Relation(object):
--- ppl/polyhedron.pyx.orig 2019-02-20 02:54:21.000000000 -0700
+++ ppl/polyhedron.pyx 2019-10-31 15:21:15.489145305 -0600
@@ -247,7 +247,7 @@ cdef class Polyhedron(object):
Constraint_System {x1>=0, x0>=0}
"""
sig_on()
- cdef PPL_Constraint_System cs = self.thisptr.constraints()
+ cdef PPL_Constraint_System *cs = &self.thisptr.constraints()
sig_off()
return _wrap_Constraint_System(cs)
@@ -275,7 +275,7 @@ cdef class Polyhedron(object):
Constraint_System {x1>=0, x0>=0}
"""
sig_on()
- cdef PPL_Constraint_System cs = self.thisptr.minimized_constraints()
+ cdef PPL_Constraint_System *cs = &self.thisptr.minimized_constraints()
sig_off()
return _wrap_Constraint_System(cs)
@@ -304,7 +304,7 @@ cdef class Polyhedron(object):
Generator_System {point(-1/1, -1/1, 0/1), point(1/1, 1/1, 0/1)}
"""
sig_on()
- cdef PPL_Generator_System gs = self.thisptr.generators()
+ cdef PPL_Generator_System *gs = &self.thisptr.generators()
sig_off()
return _wrap_Generator_System(gs)
@@ -333,7 +333,7 @@ cdef class Polyhedron(object):
Generator_System {point(-1/1, -1/1, 0/1), point(1/1, 1/1, 0/1)}
"""
sig_on()
- cdef PPL_Generator_System gs = self.thisptr.minimized_generators()
+ cdef PPL_Generator_System *gs = &self.thisptr.minimized_generators()
sig_off()
return _wrap_Generator_System(gs)
@@ -345,7 +345,7 @@ cdef class Polyhedron(object):
try:
sig_on()
try:
- rel.thisptr = new_relation_with(self.thisptr[0], g.thisptr[0])
+ rel.thisptr = new_relation_with((<const PPL_Polyhedron *>self.thisptr)[0], (<const PPL_Generator *>g.thisptr)[0])
finally:
sig_off()
except BaseException:
@@ -362,7 +362,7 @@ cdef class Polyhedron(object):
try:
sig_on()
try:
- rel.thisptr = new_relation_with(self.thisptr[0], c.thisptr[0])
+ rel.thisptr = new_relation_with((<const PPL_Polyhedron *>self.thisptr)[0], (<const PPL_Constraint *>c.thisptr)[0])
finally:
sig_off()
except BaseException:
@@ -2226,7 +2226,8 @@ cdef class Polyhedron(object):
>>> p0 == p1
True
"""
- self.thisptr.affine_image(v.thisptr[0], le.thisptr[0])
+ self.thisptr.affine_image(<const PPL_Variable>v.thisptr[0],
+ <const PPL_Linear_Expression>le.thisptr[0])
def affine_preimage(self, Variable v, Linear_Expression le):
r"""
@@ -2262,7 +2263,8 @@ cdef class Polyhedron(object):
>>> p0 == p1
True
"""
- self.thisptr.affine_preimage(v.thisptr[0], le.thisptr[0])
+ self.thisptr.affine_preimage(<const PPL_Variable>v.thisptr[0],
+ <const PPL_Linear_Expression>le.thisptr[0])
def ascii_dump(self):
r"""
@@ -2519,7 +2521,7 @@ cdef class C_Polyhedron(Polyhedron):
"""
if isinstance(arg, C_Polyhedron):
ph = <C_Polyhedron>arg
- self.thisptr = new PPL_C_Polyhedron(<PPL_C_Polyhedron&>ph.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_C_Polyhedron(<PPL_C_Polyhedron&>ph.thisptr[0])
return
if isinstance(arg, Generator):
arg = Generator_System(arg)
@@ -2527,11 +2529,11 @@ cdef class C_Polyhedron(Polyhedron):
arg = Constraint_System(arg)
if isinstance(arg, Generator_System):
gs = <Generator_System>arg
- self.thisptr = new PPL_C_Polyhedron(gs.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_C_Polyhedron(gs.thisptr[0])
return
if isinstance(arg, Constraint_System):
cs = <Constraint_System>arg
- self.thisptr = new PPL_C_Polyhedron(cs.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_C_Polyhedron(cs.thisptr[0])
return
try:
dim = int(arg)
@@ -2540,10 +2542,10 @@ cdef class C_Polyhedron(Polyhedron):
raise ValueError('Cannot initialize C_Polyhedron with '+str(arg)+'.')
degenerate_element = degenerate_element.lower()
if degenerate_element=='universe':
- self.thisptr = new PPL_C_Polyhedron(<PPL_dimension_type>dim, UNIVERSE)
+ self.thisptr = <PPL_Polyhedron *>new PPL_C_Polyhedron(<PPL_dimension_type>dim, UNIVERSE)
return
elif degenerate_element=='empty':
- self.thisptr = new PPL_C_Polyhedron(<PPL_dimension_type>dim, EMPTY)
+ self.thisptr = <PPL_Polyhedron *>new PPL_C_Polyhedron(<PPL_dimension_type>dim, EMPTY)
return
else:
raise ValueError('Unknown value: degenerate_element='+str(degenerate_element)+'.')
@@ -2690,11 +2692,11 @@ cdef class NNC_Polyhedron(Polyhedron):
"""
if isinstance(arg, NNC_Polyhedron):
p_nnc = <NNC_Polyhedron>arg
- self.thisptr = new PPL_NNC_Polyhedron(<PPL_NNC_Polyhedron&>p_nnc.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(<PPL_NNC_Polyhedron&>p_nnc.thisptr[0])
return
if isinstance(arg, C_Polyhedron):
p_c = <C_Polyhedron>arg
- self.thisptr = new PPL_NNC_Polyhedron(<PPL_C_Polyhedron&>p_c.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(<PPL_C_Polyhedron&>p_c.thisptr[0])
return
if isinstance(arg, Generator):
arg = Generator_System(arg)
@@ -2702,11 +2704,11 @@ cdef class NNC_Polyhedron(Polyhedron):
arg = Constraint_System(arg)
if isinstance(arg, Generator_System):
gs = <Generator_System>arg
- self.thisptr = new PPL_NNC_Polyhedron(gs.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(gs.thisptr[0])
return
if isinstance(arg, Constraint_System):
cs = <Constraint_System>arg
- self.thisptr = new PPL_NNC_Polyhedron(cs.thisptr[0])
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(cs.thisptr[0])
return
try:
dim = int(arg)
@@ -2715,10 +2717,10 @@ cdef class NNC_Polyhedron(Polyhedron):
raise ValueError('Cannot initialize NNC_Polyhedron with '+str(arg)+'.')
degenerate_element = degenerate_element.lower()
if degenerate_element=='universe':
- self.thisptr = new PPL_NNC_Polyhedron(<PPL_dimension_type>dim, UNIVERSE)
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(<PPL_dimension_type>dim, UNIVERSE)
return
elif degenerate_element=='empty':
- self.thisptr = new PPL_NNC_Polyhedron(<PPL_dimension_type>dim, EMPTY)
+ self.thisptr = <PPL_Polyhedron *>new PPL_NNC_Polyhedron(<PPL_dimension_type>dim, EMPTY)
return
else:
raise ValueError('Unknown value: degenerate_element='+str(degenerate_element)+'.')
--- setup.py.orig 2019-02-14 03:12:15.000000000 -0700
+++ setup.py 2019-10-30 14:20:44.986152713 -0600
@@ -25,7 +25,8 @@ class build_ext(_build_ext):
sys.exit(1)
self.distribution.ext_modules[:] = cythonize(
- self.distribution.ext_modules, include_path=sys.path)
+ self.distribution.ext_modules, include_path=['ppl'] + sys.path,
+ compiler_directives={'language_level': 3})
_build_ext.finalize_options(self)
class TestCommand(Command):