projects
/
linpy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6a1d02b
)
Global context
author
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Wed, 18 Jun 2014 16:11:11 +0000
(18:11 +0200)
committer
Vivien Maisonneuve
<v.maisonneuve@gmail.com>
Wed, 18 Jun 2014 16:11:11 +0000
(18:11 +0200)
pypol/linear.py
patch
|
blob
|
history
diff --git
a/pypol/linear.py
b/pypol/linear.py
index
348294c
..
07c6293
100644
(file)
--- a/
pypol/linear.py
+++ b/
pypol/linear.py
@@
-42,6
+42,9
@@
def _polymorphic_operator(func):
return wrapper
return wrapper
+_main_ctx = Context()
+
+
class Expression:
"""
This class implements linear expressions.
class Expression:
"""
This class implements linear expressions.
@@
-498,8
+501,7
@@
class Polyhedron:
if symbols is None:
symbols = self.symbols()
num_coefficients = len(symbols)
if symbols is None:
symbols = self.symbols()
num_coefficients = len(symbols)
- ctx = Context()
- space = libisl.isl_space_set_alloc(ctx, 0, num_coefficients)
+ space = libisl.isl_space_set_alloc(_main_ctx, 0, num_coefficients)
bset = libisl.isl_basic_set_universe(libisl.isl_space_copy(space))
ls = libisl.isl_local_space_from_space(space)
ceq = libisl.isl_equality_alloc(libisl.isl_local_space_copy(ls))
bset = libisl.isl_basic_set_universe(libisl.isl_space_copy(space))
ls = libisl.isl_local_space_from_space(space)
ceq = libisl.isl_equality_alloc(libisl.isl_local_space_copy(ls))