X-Git-Url: https://scm.cri.ensmp.fr/git/linpy.git/blobdiff_plain/ddd4ffae2055577597ec46bf195bd401aaa9c625..3ff02ec4a397d81d1019080a78198c454861c1e2:/pypol/isl.py diff --git a/pypol/isl.py b/pypol/isl.py index 74cc5d3..bbc8d13 100644 --- a/pypol/isl.py +++ b/pypol/isl.py @@ -1,10 +1,14 @@ +""" +note: for islpy +isl format: basic set: ("{[x, y] : x >= 0 and x < 5 and y >= 0 and y < x+4 }") +""" import ctypes, ctypes.util +import functools import math import numbers import operator import re -import functools from decimal import Decimal from fractions import Fraction @@ -15,6 +19,7 @@ libisl = ctypes.CDLL(ctypes.util.find_library('isl')) libisl.isl_printer_get_str.restype = ctypes.c_char_p + def _polymorphic_method(func): @functools.wraps(func) def wrapper(self, other): @@ -26,6 +31,7 @@ def _polymorphic_method(func): raise TypeError('operand should be a Value or a Rational') return wrapper + class Context: __slots__ = ('_ic') @@ -37,8 +43,9 @@ class Context: def _as_parameter_(self): return self._ic - def __del__(self): - libisl.isl_ctx_free(self) + #comment out so does not delete itself after being created + #def __del__(self): + # libisl.isl_ctx_free(self) def __eq__(self, other): if not isinstance(other, Context):