projects
/
linpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Code cleanup
[linpy.git]
/
pypol
/
isl.py
diff --git
a/pypol/isl.py
b/pypol/isl.py
index
74cc5d3
..
bbc8d13
100644
(file)
--- 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 ctypes, ctypes.util
+import functools
import math
import numbers
import operator
import re
import math
import numbers
import operator
import re
-import functools
from decimal import Decimal
from fractions import Fraction
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
libisl.isl_printer_get_str.restype = ctypes.c_char_p
+
def _polymorphic_method(func):
@functools.wraps(func)
def wrapper(self, other):
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
raise TypeError('operand should be a Value or a Rational')
return wrapper
+
class Context:
__slots__ = ('_ic')
class Context:
__slots__ = ('_ic')
@@
-37,8
+43,9
@@
class Context:
def _as_parameter_(self):
return self._ic
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):
def __eq__(self, other):
if not isinstance(other, Context):