From: Vivien Maisonneuve Date: Wed, 18 Jun 2014 16:11:11 +0000 (+0200) Subject: Global context X-Git-Tag: 1.0~249 X-Git-Url: https://scm.cri.mines-paristech.fr/git/linpy.git/commitdiff_plain/76c0aa89c5a4008aaf0de557dd659917518aa41a?ds=sidebyside;hp=6a1d02bd5c59e77c8333ccb4b54d6d2025c493ca Global context --- diff --git a/pypol/linear.py b/pypol/linear.py index 348294c..07c6293 100644 --- a/pypol/linear.py +++ b/pypol/linear.py @@ -42,6 +42,9 @@ def _polymorphic_operator(func): return wrapper +_main_ctx = Context() + + class Expression: """ This class implements linear expressions. @@ -498,8 +501,7 @@ class Polyhedron: 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))