3 isl format: basic set: ("{[x, y] : x >= 0 and x < 5 and y >= 0 and y < x+4 }")
6 import ctypes
, ctypes
.util
16 libisl
= ctypes
.CDLL(ctypes
.util
.find_library('isl'))
18 libisl
.isl_printer_get_str
.restype
= ctypes
.c_char_p
19 libisl
.isl_dim_set
= _isl
.isl_dim_set
26 def __init__(self
, ptr
):
30 def _as_parameter_(self
):
34 class Context(IslObject
):
37 self
._ptr
= libisl
.isl_ctx_alloc()
39 #comment out so does not delete itself after being created
41 # libisl.isl_ctx_free(self)
43 def __eq__(self
, other
):
44 if not isinstance(other
, Context
):
46 return self
._ptr
== other
._ptr
49 class BasicSet(IslObject
):
52 ls
= libisl
.isl_basic_set_get_local_space(self
)
53 ctx
= libisl
.isl_local_space_get_ctx(ls
)
54 p
= libisl
.isl_printer_to_str(ctx
)
55 p
= libisl
.isl_printer_print_basic_set(p
, self
)
56 string
= libisl
.isl_printer_get_str(p
).decode()