::iterator_category,
- typename std::iterator_traits::value_type,
- typename std::iterator_traits
::difference_type,
- typename std::iterator_traits
::pointer,
- typename std::iterator_traits
::reference> {
+class Parma_Polyhedra_Library::Implementation::Ptr_Iterator {
public:
+ typedef typename std::iterator_traits
::iterator_category iterator_category;
+ typedef typename std::iterator_traits
::value_type value_type;
typedef typename std::iterator_traits
::difference_type difference_type;
- typedef typename std::iterator_traits
::reference reference;
typedef typename std::iterator_traits
::pointer pointer;
+ typedef typename std::iterator_traits
::reference reference;
//! Default constructor: no guarantees.
Ptr_Iterator();
diff -ru ppl-1.2/src/ppl.hh.dist b/src/ppl.hh.dist
--- ppl-1.2/src/ppl.hh.dist 2016-02-11 20:40:41.000000000 +0800
+++ b/src/ppl.hh.dist 2026-02-09 16:08:43.702480365 +0800
@@ -23959,7 +23959,7 @@
from.~data_type();
*/
- std::memcpy(&to, &from, sizeof(data_type));
+ std::memcpy(static_cast(&to), static_cast(&from), sizeof(data_type));
}
@@ -43799,13 +43799,13 @@
// NOTE: This is not an inner class of Constraint_System, so Constraint can
// declare that this class is his friend without including this file
// (the .types.hh file suffices).
-class Parma_Polyhedra_Library::Constraint_System_const_iterator
- : public std::iterator {
+class Parma_Polyhedra_Library::Constraint_System_const_iterator {
public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef Constraint value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const Constraint* pointer;
+ typedef const Constraint& reference;
//! Default constructor.
Constraint_System_const_iterator();
@@ -44516,13 +44516,13 @@
cout << *i << endl;
\endcode
*/
- class const_iterator
- : public std::iterator {
+ class const_iterator {
public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef Congruence value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const Congruence* pointer;
+ typedef const Congruence& reference;
//! Default constructor.
const_iterator();
@@ -46623,13 +46623,13 @@
copy(gs.begin(), gs.end(), ostream_iterator(cout, "\n"));
\endcode
*/
-class Parma_Polyhedra_Library::Generator_System_const_iterator
- : public std::iterator {
+class Parma_Polyhedra_Library::Generator_System_const_iterator {
public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef Generator value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const Generator* pointer;
+ typedef const Generator& reference;
//! Default constructor.
Generator_System_const_iterator();
@@ -56055,13 +56055,13 @@
copy(ggs.begin(), ggs.end(), ostream_iterator(cout, "\n"));
\endcode
*/
- class const_iterator
- : public std::iterator {
+ class const_iterator {
public:
+ typedef std::forward_iterator_tag iterator_category;
+ typedef Grid_Generator value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const Grid_Generator* pointer;
+ typedef const Grid_Generator& reference;
//! Default constructor.
const_iterator();
@@ -60312,16 +60312,13 @@
//! A class to define STL const and non-const iterators from pointer types.
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
template
-class Parma_Polyhedra_Library::Implementation::Ptr_Iterator
- : public std::iterator::iterator_category,
- typename std::iterator_traits::value_type,
- typename std::iterator_traits
::difference_type,
- typename std::iterator_traits
::pointer,
- typename std::iterator_traits
::reference> {
+class Parma_Polyhedra_Library::Implementation::Ptr_Iterator {
public:
+ typedef typename std::iterator_traits
::iterator_category iterator_category;
+ typedef typename std::iterator_traits
::value_type value_type;
typedef typename std::iterator_traits
::difference_type difference_type;
- typedef typename std::iterator_traits
::reference reference;
typedef typename std::iterator_traits
::pointer pointer;
+ typedef typename std::iterator_traits
::reference reference;
//! Default constructor: no guarantees.
Ptr_Iterator();
@@ -100392,7 +100389,7 @@
having signature void foo(PSET& x, const PSET& y) that
applies an operator to \c x and \c y and assigns the result to \c x.
For instance, such a function object is obtained by
- std::mem_fun_ref(&C_Polyhedron::intersection_assign).
+ std::mem_fn(&C_Polyhedron::intersection_assign).
*/
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
template
@@ -101623,6 +101620,7 @@
/* Automatically generated from PPL source file ../src/Powerset_inlines.hh line 28. */
#include
+#include
namespace Parma_Polyhedra_Library {
@@ -101794,7 +101792,7 @@
template
inline void
Powerset::meet_assign(const Powerset& y) {
- pairwise_apply_assign(y, std::mem_fun_ref(&D::meet_assign));
+ pairwise_apply_assign(y, std::mem_fn(&D::meet_assign));
}
template
@@ -103752,7 +103750,7 @@
Pointset_Powerset::intersection_assign(const Pointset_Powerset& y) {
Pointset_Powerset& x = *this;
x.pairwise_apply_assign(y,
- Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::intersection_assign)));
+ Det_PSET::lift_op_assign(std::mem_fn(&PSET::intersection_assign)));
}
template
@@ -103760,7 +103758,7 @@
Pointset_Powerset::time_elapse_assign(const Pointset_Powerset& y) {
Pointset_Powerset& x = *this;
x.pairwise_apply_assign(y,
- Det_PSET::lift_op_assign(std::mem_fun_ref(&PSET::time_elapse_assign)));
+ Det_PSET::lift_op_assign(std::mem_fn(&PSET::time_elapse_assign)));
}
template
pplpy-0.9.0/subprojects/ppl-1.2.wrap 0000664 0000000 0000000 00000000513 15160322050 0017204 0 ustar 00root root 0000000 0000000 [wrap-file]
directory = ppl-1.2
source_url = https://github.com/sagemath/sage/releases/download/10.8/ppl-1.2.tar.bz2
source_filename = ppl-1.2.tar.bz2
source_hash = 2d470b0c262904f190a19eac57fb5c2387b1bfc3510de25a08f3c958df62fdf1
patch_directory = ppl-1.2
diff_files = ppl-1.2/ppl-1.2-compiler-fixes.patch
[provide]
ppl = ppl_dep
pplpy-0.9.0/tests/ 0000775 0000000 0000000 00000000000 15160322050 0014020 5 ustar 00root root 0000000 0000000 pplpy-0.9.0/tests/meson.build 0000664 0000000 0000000 00000003177 15160322050 0016172 0 ustar 00root root 0000000 0000000 # ---------- Test environment ----------
# Built ppl extensions live in builddir/ppl/; make them importable
test_env = environment()
test_env.prepend('PYTHONPATH', meson.project_build_root())
# ---------- Pure-Python tests ----------
test(
'doctests',
py,
args: [files('runtests.py')],
env: test_env,
workdir: meson.current_source_dir(),
timeout: 120,
)
test(
'test_variable',
py,
args: ['-m', 'unittest', 'test_variable'],
env: test_env,
workdir: meson.current_source_dir(),
)
test(
'test_constraint',
py,
args: ['-m', 'unittest', 'test_constraint'],
env: test_env,
workdir: meson.current_source_dir(),
)
# ---------- Cython integration tests ----------
# Include dirs: ../ppl covers both source (for ppl_shim.hh) and build (for
# generated Cython headers).
ppl_src_inc = include_directories('../ppl')
foreach test_name : ['testpplpy', 'testpplpy2']
ext = py.extension_module(
test_name,
test_name + '.pyx',
dependencies: common_deps,
include_directories: ppl_src_inc,
override_options: ['cython_language=cpp'] + ppl_cpp_std_override,
cython_args: [
'--directive',
'language_level=3',
'-I',
meson.project_source_root(),
],
install: false,
)
test(
'cython_' + test_name,
py,
args: [
'-c',
'import sys; sys.path.insert(0, "' + meson.current_build_dir() + '"); ' + 'import ' + test_name + '; ' + test_name + '.test(); ' + test_name + '.example()',
],
env: test_env,
depends: [ext],
)
endforeach
pplpy-0.9.0/tests/runtests.py 0000664 0000000 0000000 00000001372 15160322050 0016264 0 ustar 00root root 0000000 0000000 import ppl
import sys
import os
path = os.path.dirname(__file__)
if path:
os.chdir(path)
ans = 0 # set to nonzero if an error is found
print("Running pplpy doctests")
print('-'*80)
import doctest
for mod in [ppl, ppl.linear_algebra, ppl.mip_problem, ppl.polyhedron, ppl.generator, ppl.constraint, ppl.congruence, ppl.bit_arrays]:
res = doctest.testmod(mod, optionflags=doctest.ELLIPSIS | doctest.REPORT_NDIFF | doctest.NORMALIZE_WHITESPACE)
print(mod)
print(res)
print('-'*80)
ans = ans | res[0]
print("Running unittests")
print('-'*80)
import unittest
for mod in ['test_variable', 'test_constraint']:
res = unittest.main(module=mod, exit=False, failfast=False, verbosity=2)
ans = ans | bool(res.result.errors)
sys.exit(ans)
pplpy-0.9.0/tests/test_constraint.py 0000664 0000000 0000000 00000001765 15160322050 0017626 0 ustar 00root root 0000000 0000000 import unittest
from ppl import Variable, Constraint, Constraint_System
class TestConstraint(unittest.TestCase):
def test_creation_empty(self):
c = Constraint()
self.assertTrue(c.is_tautological())
def test_creation_other(self):
x = Variable(0)
y = Variable(1)
c = x + 3 * y == 1
cc = Constraint(c)
self.assertTrue(c.is_equivalent_to(cc))
def test_creation_invalid(self):
self.assertRaises(TypeError, Constraint, "hello")
class TestConstraint_System(unittest.TestCase):
def test_creation_empty(self):
cs = Constraint_System()
self.assertTrue(cs.empty())
def test_creation_other(self):
x = Variable(0)
y = Variable(1)
cs = Constraint_System(5*x - 2*y > 0)
cs.insert(6 * x < 3 * y)
ccs = Constraint_System(cs)
self.assertTrue(cs[0].is_equivalent_to(ccs[0]))
def test_creation_invalid(self):
self.assertRaises(TypeError, Constraint_System, "hello")
pplpy-0.9.0/tests/test_variable.py 0000664 0000000 0000000 00000000442 15160322050 0017216 0 ustar 00root root 0000000 0000000 import unittest
from ppl import Variable
class TestVariable(unittest.TestCase):
def test_creation_valid(self):
Variable(0)
def test_creation_invalid(self):
self.assertRaises(OverflowError, Variable, -1)
self.assertRaises(TypeError, Variable, "hello")
pplpy-0.9.0/tests/testpplpy.pyx 0000664 0000000 0000000 00000002353 15160322050 0016631 0 ustar 00root root 0000000 0000000 """
The goal of this file is to test cython can use pplpy package properly
In order to do this we do some test with objects from each packages and extension :
ppl
ppl.linear_algebra
ppl.constraint
ppl.mip_problem
"""
from ppl.linear_algebra cimport Variable
from ppl.constraint cimport Constraint_System
from ppl.mip_problem cimport MIP_Problem
from ppl.polyhedron cimport C_Polyhedron
def test():
x = Variable(0)
y = Variable(1)
cs = Constraint_System()
cs.insert( x >= 0)
cs.insert( y >= 0 )
cs.insert( 3 * x + 5 * y <= 10 )
m = MIP_Problem(2, cs, x + y)
m.objective_function()
from ppl import C_Polyhedron
C_Polyhedron( 5*x-2*y >= x+y-1 )
print("-"*80)
print("Cython test 1 OK")
print("-"*80)
def example():
"Cython version of the example from the README"
cdef Variable x = Variable(0)
cdef Variable y = Variable(1)
cdef Variable z = 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())
print('dim = %lu' % poly.thisptr.space_dimension())
print("-"*80)
print("Cython example 1 OK")
print("-"*80)
pplpy-0.9.0/tests/testpplpy2.pyx 0000664 0000000 0000000 00000002376 15160322050 0016720 0 ustar 00root root 0000000 0000000 """
The goal of this file is to test cython can use pplpy package properly
In order to do this we do some test with objects from each packages and extension :
ppl
ppl.linear_algebra
ppl.linear_algebra
ppl.constraint
ppl.mip_problem
"""
from ppl.linear_algebra cimport Variable
from ppl.constraint cimport Constraint_System
from ppl.mip_problem cimport MIP_Problem
from ppl.polyhedron cimport C_Polyhedron
def test():
x = Variable(0)
y = Variable(1)
cs = Constraint_System()
cs.insert( x >= 0)
cs.insert( y >= 0 )
cs.insert( 3 * x + 5 * y <= 10 )
m = MIP_Problem(2, cs, x + y)
m.objective_function()
from ppl import C_Polyhedron
C_Polyhedron( 5*x-2*y >= x+y-1 )
print("-"*80)
print("Cython test 2 OK")
print("-"*80)
def example():
"Cython version of the example from the README"
cdef Variable x = Variable(0)
cdef Variable y = Variable(1)
cdef Variable z = 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())
print('dim = %lu' % poly.thisptr.space_dimension())
print("-"*80)
print("Cython example 2 OK")
print("-"*80)