05133582357d429c2b644fba8cee492cd0b721f1
3 isl format: basic set: ("{[x, y] : x >= 0 and x < 5 and y >= 0 and y < x+4 }")
6 import ctypes
, ctypes
.util
14 libisl
= ctypes
.CDLL(ctypes
.util
.find_library('isl'))
16 libisl
.isl_printer_get_str
.restype
= ctypes
.c_char_p
23 def __init__(self
, ptr
):
27 def _as_parameter_(self
):
31 class Context(IslObject
):
34 self
._ptr
= libisl
.isl_ctx_alloc()
36 #comment out so does not delete itself after being created
38 # libisl.isl_ctx_free(self)
40 def __eq__(self
, other
):
41 if not isinstance(other
, Context
):
43 return self
._ptr
== other
._ptr
46 class BasicSet(IslObject
):
49 ls
= libisl
.isl_basic_set_get_local_space(self
)
50 ctx
= libisl
.isl_local_space_get_ctx(ls
)
51 p
= libisl
.isl_printer_to_str(ctx
)
52 p
= libisl
.isl_printer_print_basic_set(p
, self
)
53 string
= libisl
.isl_printer_get_str(p
)
54 string
= str(string
.decode())