Blame isl-0.14/interface/isl.py

Packit fb9d21
from ctypes import *
Packit fb9d21
Packit fb9d21
isl = cdll.LoadLibrary("libisl.so")
Packit fb9d21
libc = cdll.LoadLibrary("libc.so.6")
Packit fb9d21
Packit fb9d21
class Error(Exception):
Packit fb9d21
    pass
Packit fb9d21
Packit fb9d21
class Context:
Packit fb9d21
    defaultInstance = None
Packit fb9d21
Packit fb9d21
    def __init__(self):
Packit fb9d21
        ptr = isl.isl_ctx_alloc()
Packit fb9d21
        self.ptr = ptr
Packit fb9d21
Packit fb9d21
    def __del__(self):
Packit fb9d21
        isl.isl_ctx_free(self)
Packit fb9d21
Packit fb9d21
    def from_param(self):
Packit fb9d21
        return self.ptr
Packit fb9d21
Packit fb9d21
    @staticmethod
Packit fb9d21
    def getDefaultInstance():
Packit fb9d21
        if Context.defaultInstance == None:
Packit fb9d21
            Context.defaultInstance = Context()
Packit fb9d21
        return Context.defaultInstance
Packit fb9d21
Packit fb9d21
isl.isl_ctx_alloc.restype = c_void_p
Packit fb9d21
isl.isl_ctx_free.argtypes = [Context]
Packit fb9d21
Packit fb9d21
class union_map:
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is basic_map:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is map:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_map_from_map(isl.isl_map_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_map_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_union_map_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_union_map_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.union_map("%s")' % str(self)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_affine_hull(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def polyhedral_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_polyhedral_hull(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def coalesce(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_coalesce(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_lexmin(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_lexmax(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def union(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_union(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_subtract(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_intersect(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_intersect_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_gist(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_gist_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_gist_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_gist_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_intersect_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_intersect_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_subtract_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_subtract_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_apply_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_apply_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def reverse(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_reverse(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_detect_equalities(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def deltas(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_deltas(isl.isl_union_map_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_single_valued(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_single_valued(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_injective(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_injective(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_bijective(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_bijective(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_strict_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_map_is_strict_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def foreach_map(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_map:
Packit fb9d21
                arg0 = union_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        exc_info = [None]
Packit fb9d21
        fn = CFUNCTYPE(c_int, c_void_p, c_void_p)
Packit fb9d21
        def cb_func(cb_arg0, cb_arg1):
Packit fb9d21
            cb_arg0 = map(ctx=arg0.ctx, ptr=cb_arg0)
Packit fb9d21
            try:
Packit fb9d21
                arg1(cb_arg0)
Packit fb9d21
            except:
Packit fb9d21
                import sys
Packit fb9d21
                exc_info[0] = sys.exc_info()
Packit fb9d21
                return -1
Packit fb9d21
            return 0
Packit fb9d21
        cb = fn(cb_func)
Packit fb9d21
        res = isl.isl_union_map_foreach_map(arg0.ptr, cb, None)
Packit fb9d21
        if exc_info[0] != None:
Packit fb9d21
            raise exc_info[0][0], exc_info[0][1], exc_info[0][2]
Packit fb9d21
        return res
Packit fb9d21
Packit fb9d21
isl.isl_union_map_from_basic_map.restype = c_void_p
Packit fb9d21
isl.isl_union_map_from_basic_map.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_map_from_map.restype = c_void_p
Packit fb9d21
isl.isl_union_map_from_map.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_map_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_union_map_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_union_map_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_union_map_polyhedral_hull.restype = c_void_p
Packit fb9d21
isl.isl_union_map_coalesce.restype = c_void_p
Packit fb9d21
isl.isl_union_map_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_union_map_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_union_map_union.restype = c_void_p
Packit fb9d21
isl.isl_union_map_subtract.restype = c_void_p
Packit fb9d21
isl.isl_union_map_intersect.restype = c_void_p
Packit fb9d21
isl.isl_union_map_intersect_params.restype = c_void_p
Packit fb9d21
isl.isl_union_map_gist.restype = c_void_p
Packit fb9d21
isl.isl_union_map_gist_params.restype = c_void_p
Packit fb9d21
isl.isl_union_map_gist_domain.restype = c_void_p
Packit fb9d21
isl.isl_union_map_gist_range.restype = c_void_p
Packit fb9d21
isl.isl_union_map_intersect_domain.restype = c_void_p
Packit fb9d21
isl.isl_union_map_intersect_range.restype = c_void_p
Packit fb9d21
isl.isl_union_map_subtract_domain.restype = c_void_p
Packit fb9d21
isl.isl_union_map_subtract_range.restype = c_void_p
Packit fb9d21
isl.isl_union_map_apply_domain.restype = c_void_p
Packit fb9d21
isl.isl_union_map_apply_range.restype = c_void_p
Packit fb9d21
isl.isl_union_map_reverse.restype = c_void_p
Packit fb9d21
isl.isl_union_map_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_union_map_deltas.restype = c_void_p
Packit fb9d21
isl.isl_union_map_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_map_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_map_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class map(union_map):
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is basic_map:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_map_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_map_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_map_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.map("%s")' % str(self)
Packit fb9d21
    def reverse(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_reverse(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def union(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).union(arg1)
Packit fb9d21
        res = isl.isl_map_union(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).intersect_domain(arg1)
Packit fb9d21
        res = isl.isl_map_intersect_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).intersect_range(arg1)
Packit fb9d21
        res = isl.isl_map_intersect_range(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).apply_domain(arg1)
Packit fb9d21
        res = isl.isl_map_apply_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).apply_range(arg1)
Packit fb9d21
        res = isl.isl_map_apply_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).intersect(arg1)
Packit fb9d21
        res = isl.isl_map_intersect(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).intersect_params(arg1)
Packit fb9d21
        res = isl.isl_map_intersect_params(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).subtract(arg1)
Packit fb9d21
        res = isl.isl_map_subtract(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def complement(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_complement(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def deltas(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_deltas(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_detect_equalities(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_affine_hull(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def polyhedral_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_polyhedral_hull(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_flatten(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten_domain(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_flatten_domain(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten_range(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_flatten_range(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_lexmin(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_lexmax(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def sample(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_sample(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).is_subset(arg1)
Packit fb9d21
        res = isl.isl_map_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_strict_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).is_strict_subset(arg1)
Packit fb9d21
        res = isl.isl_map_is_strict_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).is_equal(arg1)
Packit fb9d21
        res = isl.isl_map_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_disjoint(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).is_disjoint(arg1)
Packit fb9d21
        res = isl.isl_map_is_disjoint(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_single_valued(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_is_single_valued(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_injective(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_is_injective(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_bijective(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_is_bijective(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).gist(arg1)
Packit fb9d21
        res = isl.isl_map_gist(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_map(arg0).gist_domain(arg1)
Packit fb9d21
        res = isl.isl_map_gist_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def coalesce(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_map_coalesce(isl.isl_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def foreach_basic_map(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is map:
Packit fb9d21
                arg0 = map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        exc_info = [None]
Packit fb9d21
        fn = CFUNCTYPE(c_int, c_void_p, c_void_p)
Packit fb9d21
        def cb_func(cb_arg0, cb_arg1):
Packit fb9d21
            cb_arg0 = basic_map(ctx=arg0.ctx, ptr=cb_arg0)
Packit fb9d21
            try:
Packit fb9d21
                arg1(cb_arg0)
Packit fb9d21
            except:
Packit fb9d21
                import sys
Packit fb9d21
                exc_info[0] = sys.exc_info()
Packit fb9d21
                return -1
Packit fb9d21
            return 0
Packit fb9d21
        cb = fn(cb_func)
Packit fb9d21
        res = isl.isl_map_foreach_basic_map(arg0.ptr, cb, None)
Packit fb9d21
        if exc_info[0] != None:
Packit fb9d21
            raise exc_info[0][0], exc_info[0][1], exc_info[0][2]
Packit fb9d21
        return res
Packit fb9d21
Packit fb9d21
isl.isl_map_from_basic_map.restype = c_void_p
Packit fb9d21
isl.isl_map_from_basic_map.argtypes = [c_void_p]
Packit fb9d21
isl.isl_map_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_map_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_map_reverse.restype = c_void_p
Packit fb9d21
isl.isl_map_union.restype = c_void_p
Packit fb9d21
isl.isl_map_intersect_domain.restype = c_void_p
Packit fb9d21
isl.isl_map_intersect_range.restype = c_void_p
Packit fb9d21
isl.isl_map_apply_domain.restype = c_void_p
Packit fb9d21
isl.isl_map_apply_range.restype = c_void_p
Packit fb9d21
isl.isl_map_intersect.restype = c_void_p
Packit fb9d21
isl.isl_map_intersect_params.restype = c_void_p
Packit fb9d21
isl.isl_map_subtract.restype = c_void_p
Packit fb9d21
isl.isl_map_complement.restype = c_void_p
Packit fb9d21
isl.isl_map_deltas.restype = c_void_p
Packit fb9d21
isl.isl_map_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_map_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_map_polyhedral_hull.restype = c_void_p
Packit fb9d21
isl.isl_map_flatten.restype = c_void_p
Packit fb9d21
isl.isl_map_flatten_domain.restype = c_void_p
Packit fb9d21
isl.isl_map_flatten_range.restype = c_void_p
Packit fb9d21
isl.isl_map_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_map_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_map_sample.restype = c_void_p
Packit fb9d21
isl.isl_map_gist.restype = c_void_p
Packit fb9d21
isl.isl_map_gist_domain.restype = c_void_p
Packit fb9d21
isl.isl_map_coalesce.restype = c_void_p
Packit fb9d21
isl.isl_map_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_map_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_map_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class basic_map(map):
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_basic_map_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_basic_map_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_basic_map_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.basic_map("%s")' % str(self)
Packit fb9d21
    def intersect_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).intersect_range(arg1)
Packit fb9d21
        res = isl.isl_basic_map_intersect_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).intersect(arg1)
Packit fb9d21
        res = isl.isl_basic_map_intersect(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def union(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).union(arg1)
Packit fb9d21
        res = isl.isl_basic_map_union(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).apply_domain(arg1)
Packit fb9d21
        res = isl.isl_basic_map_apply_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply_range(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).apply_range(arg1)
Packit fb9d21
        res = isl.isl_basic_map_apply_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_affine_hull(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def reverse(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_reverse(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def sample(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_sample(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_detect_equalities(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def deltas(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_deltas(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_flatten(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten_domain(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_flatten_domain(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def flatten_range(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_flatten_range(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_domain(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).intersect_domain(arg1)
Packit fb9d21
        res = isl.isl_basic_map_intersect_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).is_equal(arg1)
Packit fb9d21
        res = isl.isl_basic_map_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_lexmin(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_lexmax(isl.isl_basic_map_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_map_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).is_subset(arg1)
Packit fb9d21
        res = isl.isl_basic_map_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_map:
Packit fb9d21
                arg0 = basic_map(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return map(arg0).gist(arg1)
Packit fb9d21
        res = isl.isl_basic_map_gist(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return basic_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
Packit fb9d21
isl.isl_basic_map_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_basic_map_intersect_range.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_intersect.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_union.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_apply_domain.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_apply_range.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_reverse.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_sample.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_deltas.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_flatten.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_flatten_domain.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_flatten_range.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_intersect_domain.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_gist.restype = c_void_p
Packit fb9d21
isl.isl_basic_map_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_basic_map_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_basic_map_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class union_set:
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is basic_set:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is set:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_set_from_set(isl.isl_set_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_union_set_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_union_set_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_union_set_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.union_set("%s")' % str(self)
Packit fb9d21
    def identity(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_identity(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_detect_equalities(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_affine_hull(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def polyhedral_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_polyhedral_hull(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def coalesce(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_coalesce(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_lexmin(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_lexmax(isl.isl_union_set_copy(arg0.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_subtract(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_intersect(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_intersect_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_gist(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def gist_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_gist_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_map:
Packit fb9d21
                arg1 = union_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_apply(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr))
Packit fb9d21
        return union_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_strict_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is union_set:
Packit fb9d21
                arg1 = union_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_union_set_is_strict_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def foreach_set(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is union_set:
Packit fb9d21
                arg0 = union_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        exc_info = [None]
Packit fb9d21
        fn = CFUNCTYPE(c_int, c_void_p, c_void_p)
Packit fb9d21
        def cb_func(cb_arg0, cb_arg1):
Packit fb9d21
            cb_arg0 = set(ctx=arg0.ctx, ptr=cb_arg0)
Packit fb9d21
            try:
Packit fb9d21
                arg1(cb_arg0)
Packit fb9d21
            except:
Packit fb9d21
                import sys
Packit fb9d21
                exc_info[0] = sys.exc_info()
Packit fb9d21
                return -1
Packit fb9d21
            return 0
Packit fb9d21
        cb = fn(cb_func)
Packit fb9d21
        res = isl.isl_union_set_foreach_set(arg0.ptr, cb, None)
Packit fb9d21
        if exc_info[0] != None:
Packit fb9d21
            raise exc_info[0][0], exc_info[0][1], exc_info[0][2]
Packit fb9d21
        return res
Packit fb9d21
Packit fb9d21
isl.isl_union_set_from_basic_set.restype = c_void_p
Packit fb9d21
isl.isl_union_set_from_basic_set.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_set_from_set.restype = c_void_p
Packit fb9d21
isl.isl_union_set_from_set.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_set_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_union_set_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_union_set_identity.restype = c_void_p
Packit fb9d21
isl.isl_union_set_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_union_set_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_union_set_polyhedral_hull.restype = c_void_p
Packit fb9d21
isl.isl_union_set_coalesce.restype = c_void_p
Packit fb9d21
isl.isl_union_set_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_union_set_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_union_set_subtract.restype = c_void_p
Packit fb9d21
isl.isl_union_set_intersect.restype = c_void_p
Packit fb9d21
isl.isl_union_set_intersect_params.restype = c_void_p
Packit fb9d21
isl.isl_union_set_gist.restype = c_void_p
Packit fb9d21
isl.isl_union_set_gist_params.restype = c_void_p
Packit fb9d21
isl.isl_union_set_apply.restype = c_void_p
Packit fb9d21
isl.isl_union_set_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_set_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_set_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class set(union_set):
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_set_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and args[0].__class__ is basic_set:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr))
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_set_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_set_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.set("%s")' % str(self)
Packit fb9d21
    def identity(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_identity(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return map(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_wrapping(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_is_wrapping(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def flatten(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_flatten(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_lexmin(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_lexmax(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def sample(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_sample(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_detect_equalities(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_affine_hull(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def polyhedral_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_polyhedral_hull(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def union(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).union(arg1)
Packit fb9d21
        res = isl.isl_set_union(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).intersect(arg1)
Packit fb9d21
        res = isl.isl_set_intersect(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).intersect_params(arg1)
Packit fb9d21
        res = isl.isl_set_intersect_params(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def subtract(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).subtract(arg1)
Packit fb9d21
        res = isl.isl_set_subtract(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def complement(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_complement(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is map:
Packit fb9d21
                arg1 = map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).apply(arg1)
Packit fb9d21
        res = isl.isl_set_apply(isl.isl_set_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).is_subset(arg1)
Packit fb9d21
        res = isl.isl_set_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_strict_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).is_strict_subset(arg1)
Packit fb9d21
        res = isl.isl_set_is_strict_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).is_equal(arg1)
Packit fb9d21
        res = isl.isl_set_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_disjoint(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).is_disjoint(arg1)
Packit fb9d21
        res = isl.isl_set_is_disjoint(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is set:
Packit fb9d21
                arg1 = set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return union_set(arg0).gist(arg1)
Packit fb9d21
        res = isl.isl_set_gist(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def coalesce(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_set_coalesce(isl.isl_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def foreach_basic_set(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is set:
Packit fb9d21
                arg0 = set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        exc_info = [None]
Packit fb9d21
        fn = CFUNCTYPE(c_int, c_void_p, c_void_p)
Packit fb9d21
        def cb_func(cb_arg0, cb_arg1):
Packit fb9d21
            cb_arg0 = basic_set(ctx=arg0.ctx, ptr=cb_arg0)
Packit fb9d21
            try:
Packit fb9d21
                arg1(cb_arg0)
Packit fb9d21
            except:
Packit fb9d21
                import sys
Packit fb9d21
                exc_info[0] = sys.exc_info()
Packit fb9d21
                return -1
Packit fb9d21
            return 0
Packit fb9d21
        cb = fn(cb_func)
Packit fb9d21
        res = isl.isl_set_foreach_basic_set(arg0.ptr, cb, None)
Packit fb9d21
        if exc_info[0] != None:
Packit fb9d21
            raise exc_info[0][0], exc_info[0][1], exc_info[0][2]
Packit fb9d21
        return res
Packit fb9d21
Packit fb9d21
isl.isl_set_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_set_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_set_from_basic_set.restype = c_void_p
Packit fb9d21
isl.isl_set_from_basic_set.argtypes = [c_void_p]
Packit fb9d21
isl.isl_set_identity.restype = c_void_p
Packit fb9d21
isl.isl_set_flatten.restype = c_void_p
Packit fb9d21
isl.isl_set_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_set_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_set_sample.restype = c_void_p
Packit fb9d21
isl.isl_set_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_set_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_set_polyhedral_hull.restype = c_void_p
Packit fb9d21
isl.isl_set_union.restype = c_void_p
Packit fb9d21
isl.isl_set_intersect.restype = c_void_p
Packit fb9d21
isl.isl_set_intersect_params.restype = c_void_p
Packit fb9d21
isl.isl_set_subtract.restype = c_void_p
Packit fb9d21
isl.isl_set_complement.restype = c_void_p
Packit fb9d21
isl.isl_set_apply.restype = c_void_p
Packit fb9d21
isl.isl_set_gist.restype = c_void_p
Packit fb9d21
isl.isl_set_coalesce.restype = c_void_p
Packit fb9d21
isl.isl_set_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_set_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_set_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class basic_set(set):
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        if len(args) == 1 and type(args[0]) == str:
Packit fb9d21
            self.ctx = Context.getDefaultInstance()
Packit fb9d21
            self.ptr = isl.isl_basic_set_read_from_str(self.ctx, args[0])
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_basic_set_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_basic_set_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.basic_set("%s")' % str(self)
Packit fb9d21
    def is_wrapping(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_is_wrapping(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def flatten(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_flatten(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).intersect(arg1)
Packit fb9d21
        res = isl.isl_basic_set_intersect(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def intersect_params(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).intersect_params(arg1)
Packit fb9d21
        res = isl.isl_basic_set_intersect_params(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def apply(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_map:
Packit fb9d21
                arg1 = basic_map(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).apply(arg1)
Packit fb9d21
        res = isl.isl_basic_set_apply(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def affine_hull(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_affine_hull(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def sample(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_sample(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def detect_equalities(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_detect_equalities(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_equal(arg0, arg1):
Packit fb9d21
        res = isl.isl_basic_set_is_equal(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def lexmin(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_lexmin(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def lexmax(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_lexmax(isl.isl_basic_set_copy(arg0.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def union(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).union(arg1)
Packit fb9d21
        res = isl.isl_basic_set_union(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
    def is_empty(arg0):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        res = isl.isl_basic_set_is_empty(arg0.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def is_subset(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).is_subset(arg1)
Packit fb9d21
        res = isl.isl_basic_set_is_subset(arg0.ptr, arg1.ptr)
Packit fb9d21
        return res
Packit fb9d21
    def gist(arg0, arg1):
Packit fb9d21
        try:
Packit fb9d21
            if not arg0.__class__ is basic_set:
Packit fb9d21
                arg0 = basic_set(arg0)
Packit fb9d21
        except:
Packit fb9d21
            raise
Packit fb9d21
        try:
Packit fb9d21
            if not arg1.__class__ is basic_set:
Packit fb9d21
                arg1 = basic_set(arg1)
Packit fb9d21
        except:
Packit fb9d21
            return set(arg0).gist(arg1)
Packit fb9d21
        res = isl.isl_basic_set_gist(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr))
Packit fb9d21
        return basic_set(ctx=arg0.ctx, ptr=res)
Packit fb9d21
Packit fb9d21
isl.isl_basic_set_read_from_str.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_read_from_str.argtypes = [Context, c_char_p]
Packit fb9d21
isl.isl_basic_set_flatten.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_intersect.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_intersect_params.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_apply.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_affine_hull.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_sample.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_detect_equalities.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_lexmin.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_lexmax.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_union.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_gist.restype = c_void_p
Packit fb9d21
isl.isl_basic_set_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_basic_set_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_basic_set_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class pw_qpolynomial:
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_pw_qpolynomial_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_pw_qpolynomial_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.pw_qpolynomial("%s")' % str(self)
Packit fb9d21
Packit fb9d21
isl.isl_pw_qpolynomial_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_pw_qpolynomial_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_pw_qpolynomial_to_str.restype = POINTER(c_char)
Packit fb9d21
Packit fb9d21
class union_pw_qpolynomial:
Packit fb9d21
    def __init__(self, *args, **keywords):
Packit fb9d21
        if "ptr" in keywords:
Packit fb9d21
            self.ctx = keywords["ctx"]
Packit fb9d21
            self.ptr = keywords["ptr"]
Packit fb9d21
            return
Packit fb9d21
        raise Error
Packit fb9d21
    def __del__(self):
Packit fb9d21
        if hasattr(self, 'ptr'):
Packit fb9d21
            isl.isl_union_pw_qpolynomial_free(self.ptr)
Packit fb9d21
    def __str__(self):
Packit fb9d21
        ptr = isl.isl_union_pw_qpolynomial_to_str(self.ptr)
Packit fb9d21
        res = str(cast(ptr, c_char_p).value)
Packit fb9d21
        libc.free(ptr)
Packit fb9d21
        return res
Packit fb9d21
    def __repr__(self):
Packit fb9d21
        return 'isl.union_pw_qpolynomial("%s")' % str(self)
Packit fb9d21
Packit fb9d21
isl.isl_union_pw_qpolynomial_free.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_pw_qpolynomial_to_str.argtypes = [c_void_p]
Packit fb9d21
isl.isl_union_pw_qpolynomial_to_str.restype = POINTER(c_char)