1 import ctypes
, ctypes
.util
12 libisl
= ctypes
.CDLL(ctypes
.util
.find_library('isl'))
14 libisl
.isl_printer_get_str
.restype
= ctypes
.c_char_p
15 libisl
.isl_dim_set
= _isl
.dim_set
24 def __init__(self
, ptr
):
28 def _as_parameter_(self
):
32 class Context(IslObject
):
35 ptr
= libisl
.isl_ctx_alloc()
38 #comment out so does not delete itself after being created
40 # libisl.isl_ctx_free(self)
42 def __eq__(self
, other
):
43 if not isinstance(other
, Context
):
45 return self
._ptr
== other
._ptr
48 class BasicSet(IslObject
):
51 ls
= libisl
.isl_basic_set_get_local_space(self
)
52 ctx
= libisl
.isl_local_space_get_ctx(ls
)
53 p
= libisl
.isl_printer_to_str(ctx
)
54 p
= libisl
.isl_printer_print_basic_set(p
, self
)
55 string
= libisl
.isl_printer_get_str(p
).decode()
59 libisl
.isl_basic_set_free(self
)
61 def constraints(self
):
62 return _isl
.basic_set_constraints(self
._ptr
)