1isl_dlname='libisl.so.23' 2import os 3from ctypes import * 4from ctypes.util import find_library 5 6isl_dyld_library_path = os.environ.get('ISL_DYLD_LIBRARY_PATH') 7if isl_dyld_library_path != None: 8 os.environ['DYLD_LIBRARY_PATH'] = isl_dyld_library_path 9try: 10 isl = cdll.LoadLibrary(isl_dlname) 11except: 12 isl = cdll.LoadLibrary(find_library("isl")) 13libc = cdll.LoadLibrary(find_library("c")) 14 15class Error(Exception): 16 pass 17 18class Context: 19 defaultInstance = None 20 21 def __init__(self): 22 ptr = isl.isl_ctx_alloc() 23 self.ptr = ptr 24 25 def __del__(self): 26 isl.isl_ctx_free(self) 27 28 def from_param(self): 29 return c_void_p(self.ptr) 30 31 @staticmethod 32 def getDefaultInstance(): 33 if Context.defaultInstance == None: 34 Context.defaultInstance = Context() 35 return Context.defaultInstance 36 37isl.isl_ctx_alloc.restype = c_void_p 38isl.isl_ctx_free.argtypes = [Context] 39 40class union_pw_multi_aff(object): 41 def __init__(self, *args, **keywords): 42 if "ptr" in keywords: 43 self.ctx = keywords["ctx"] 44 self.ptr = keywords["ptr"] 45 return 46 if len(args) == 1 and args[0].__class__ is multi_aff: 47 self.ctx = Context.getDefaultInstance() 48 self.ptr = isl.isl_union_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 49 return 50 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 51 self.ctx = Context.getDefaultInstance() 52 self.ptr = isl.isl_union_pw_multi_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 53 return 54 if len(args) == 1 and args[0].__class__ is union_pw_aff: 55 self.ctx = Context.getDefaultInstance() 56 self.ptr = isl.isl_union_pw_multi_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 57 return 58 if len(args) == 1 and type(args[0]) == str: 59 self.ctx = Context.getDefaultInstance() 60 self.ptr = isl.isl_union_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 61 return 62 raise Error 63 def __del__(self): 64 if hasattr(self, 'ptr'): 65 isl.isl_union_pw_multi_aff_free(self.ptr) 66 def __str__(arg0): 67 try: 68 if not arg0.__class__ is union_pw_multi_aff: 69 arg0 = union_pw_multi_aff(arg0) 70 except: 71 raise 72 ptr = isl.isl_union_pw_multi_aff_to_str(arg0.ptr) 73 res = cast(ptr, c_char_p).value.decode('ascii') 74 libc.free(ptr) 75 return res 76 def __repr__(self): 77 s = str(self) 78 if '"' in s: 79 return 'isl.union_pw_multi_aff("""%s""")' % s 80 else: 81 return 'isl.union_pw_multi_aff("%s")' % s 82 def add(arg0, arg1): 83 try: 84 if not arg0.__class__ is union_pw_multi_aff: 85 arg0 = union_pw_multi_aff(arg0) 86 except: 87 raise 88 try: 89 if not arg1.__class__ is union_pw_multi_aff: 90 arg1 = union_pw_multi_aff(arg1) 91 except: 92 raise 93 ctx = arg0.ctx 94 res = isl.isl_union_pw_multi_aff_add(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 95 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 96 return obj 97 def apply(*args): 98 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 99 ctx = args[0].ctx 100 res = isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 101 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 102 return obj 103 raise Error 104 def as_pw_multi_aff(arg0): 105 try: 106 if not arg0.__class__ is union_pw_multi_aff: 107 arg0 = union_pw_multi_aff(arg0) 108 except: 109 raise 110 ctx = arg0.ctx 111 res = isl.isl_union_pw_multi_aff_as_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 112 obj = pw_multi_aff(ctx=ctx, ptr=res) 113 return obj 114 def coalesce(arg0): 115 try: 116 if not arg0.__class__ is union_pw_multi_aff: 117 arg0 = union_pw_multi_aff(arg0) 118 except: 119 raise 120 ctx = arg0.ctx 121 res = isl.isl_union_pw_multi_aff_coalesce(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 122 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 123 return obj 124 def domain(arg0): 125 try: 126 if not arg0.__class__ is union_pw_multi_aff: 127 arg0 = union_pw_multi_aff(arg0) 128 except: 129 raise 130 ctx = arg0.ctx 131 res = isl.isl_union_pw_multi_aff_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 132 obj = union_set(ctx=ctx, ptr=res) 133 return obj 134 @staticmethod 135 def empty(*args): 136 if len(args) == 0: 137 ctx = Context.getDefaultInstance() 138 res = isl.isl_union_pw_multi_aff_empty_ctx(ctx) 139 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 140 return obj 141 raise Error 142 def extract_pw_multi_aff(arg0, arg1): 143 try: 144 if not arg0.__class__ is union_pw_multi_aff: 145 arg0 = union_pw_multi_aff(arg0) 146 except: 147 raise 148 try: 149 if not arg1.__class__ is space: 150 arg1 = space(arg1) 151 except: 152 raise 153 ctx = arg0.ctx 154 res = isl.isl_union_pw_multi_aff_extract_pw_multi_aff(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 155 obj = pw_multi_aff(ctx=ctx, ptr=res) 156 return obj 157 def flat_range_product(arg0, arg1): 158 try: 159 if not arg0.__class__ is union_pw_multi_aff: 160 arg0 = union_pw_multi_aff(arg0) 161 except: 162 raise 163 try: 164 if not arg1.__class__ is union_pw_multi_aff: 165 arg1 = union_pw_multi_aff(arg1) 166 except: 167 raise 168 ctx = arg0.ctx 169 res = isl.isl_union_pw_multi_aff_flat_range_product(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 170 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 171 return obj 172 def space(arg0): 173 try: 174 if not arg0.__class__ is union_pw_multi_aff: 175 arg0 = union_pw_multi_aff(arg0) 176 except: 177 raise 178 ctx = arg0.ctx 179 res = isl.isl_union_pw_multi_aff_get_space(arg0.ptr) 180 obj = space(ctx=ctx, ptr=res) 181 return obj 182 def get_space(arg0): 183 return arg0.space() 184 def gist(arg0, arg1): 185 try: 186 if not arg0.__class__ is union_pw_multi_aff: 187 arg0 = union_pw_multi_aff(arg0) 188 except: 189 raise 190 try: 191 if not arg1.__class__ is union_set: 192 arg1 = union_set(arg1) 193 except: 194 raise 195 ctx = arg0.ctx 196 res = isl.isl_union_pw_multi_aff_gist(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 197 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 198 return obj 199 def intersect_domain(*args): 200 if len(args) == 2 and args[1].__class__ is space: 201 ctx = args[0].ctx 202 res = isl.isl_union_pw_multi_aff_intersect_domain_space(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 203 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 204 return obj 205 if len(args) == 2 and args[1].__class__ is union_set: 206 ctx = args[0].ctx 207 res = isl.isl_union_pw_multi_aff_intersect_domain_union_set(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 208 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 209 return obj 210 raise Error 211 def intersect_domain_wrapped_domain(arg0, arg1): 212 try: 213 if not arg0.__class__ is union_pw_multi_aff: 214 arg0 = union_pw_multi_aff(arg0) 215 except: 216 raise 217 try: 218 if not arg1.__class__ is union_set: 219 arg1 = union_set(arg1) 220 except: 221 raise 222 ctx = arg0.ctx 223 res = isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 224 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 225 return obj 226 def intersect_domain_wrapped_range(arg0, arg1): 227 try: 228 if not arg0.__class__ is union_pw_multi_aff: 229 arg0 = union_pw_multi_aff(arg0) 230 except: 231 raise 232 try: 233 if not arg1.__class__ is union_set: 234 arg1 = union_set(arg1) 235 except: 236 raise 237 ctx = arg0.ctx 238 res = isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 239 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 240 return obj 241 def intersect_params(arg0, arg1): 242 try: 243 if not arg0.__class__ is union_pw_multi_aff: 244 arg0 = union_pw_multi_aff(arg0) 245 except: 246 raise 247 try: 248 if not arg1.__class__ is set: 249 arg1 = set(arg1) 250 except: 251 raise 252 ctx = arg0.ctx 253 res = isl.isl_union_pw_multi_aff_intersect_params(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 254 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 255 return obj 256 def involves_locals(arg0): 257 try: 258 if not arg0.__class__ is union_pw_multi_aff: 259 arg0 = union_pw_multi_aff(arg0) 260 except: 261 raise 262 ctx = arg0.ctx 263 res = isl.isl_union_pw_multi_aff_involves_locals(arg0.ptr) 264 if res < 0: 265 raise 266 return bool(res) 267 def isa_pw_multi_aff(arg0): 268 try: 269 if not arg0.__class__ is union_pw_multi_aff: 270 arg0 = union_pw_multi_aff(arg0) 271 except: 272 raise 273 ctx = arg0.ctx 274 res = isl.isl_union_pw_multi_aff_isa_pw_multi_aff(arg0.ptr) 275 if res < 0: 276 raise 277 return bool(res) 278 def plain_is_empty(arg0): 279 try: 280 if not arg0.__class__ is union_pw_multi_aff: 281 arg0 = union_pw_multi_aff(arg0) 282 except: 283 raise 284 ctx = arg0.ctx 285 res = isl.isl_union_pw_multi_aff_plain_is_empty(arg0.ptr) 286 if res < 0: 287 raise 288 return bool(res) 289 def preimage_domain_wrapped_domain(*args): 290 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 291 ctx = args[0].ctx 292 res = isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 293 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 294 return obj 295 raise Error 296 def pullback(*args): 297 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 298 ctx = args[0].ctx 299 res = isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 300 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 301 return obj 302 raise Error 303 def range_factor_domain(arg0): 304 try: 305 if not arg0.__class__ is union_pw_multi_aff: 306 arg0 = union_pw_multi_aff(arg0) 307 except: 308 raise 309 ctx = arg0.ctx 310 res = isl.isl_union_pw_multi_aff_range_factor_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 311 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 312 return obj 313 def range_factor_range(arg0): 314 try: 315 if not arg0.__class__ is union_pw_multi_aff: 316 arg0 = union_pw_multi_aff(arg0) 317 except: 318 raise 319 ctx = arg0.ctx 320 res = isl.isl_union_pw_multi_aff_range_factor_range(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 321 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 322 return obj 323 def range_product(arg0, arg1): 324 try: 325 if not arg0.__class__ is union_pw_multi_aff: 326 arg0 = union_pw_multi_aff(arg0) 327 except: 328 raise 329 try: 330 if not arg1.__class__ is union_pw_multi_aff: 331 arg1 = union_pw_multi_aff(arg1) 332 except: 333 raise 334 ctx = arg0.ctx 335 res = isl.isl_union_pw_multi_aff_range_product(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 336 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 337 return obj 338 def sub(arg0, arg1): 339 try: 340 if not arg0.__class__ is union_pw_multi_aff: 341 arg0 = union_pw_multi_aff(arg0) 342 except: 343 raise 344 try: 345 if not arg1.__class__ is union_pw_multi_aff: 346 arg1 = union_pw_multi_aff(arg1) 347 except: 348 raise 349 ctx = arg0.ctx 350 res = isl.isl_union_pw_multi_aff_sub(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 351 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 352 return obj 353 def subtract_domain(*args): 354 if len(args) == 2 and args[1].__class__ is space: 355 ctx = args[0].ctx 356 res = isl.isl_union_pw_multi_aff_subtract_domain_space(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 357 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 358 return obj 359 if len(args) == 2 and args[1].__class__ is union_set: 360 ctx = args[0].ctx 361 res = isl.isl_union_pw_multi_aff_subtract_domain_union_set(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 362 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 363 return obj 364 raise Error 365 def union_add(arg0, arg1): 366 try: 367 if not arg0.__class__ is union_pw_multi_aff: 368 arg0 = union_pw_multi_aff(arg0) 369 except: 370 raise 371 try: 372 if not arg1.__class__ is union_pw_multi_aff: 373 arg1 = union_pw_multi_aff(arg1) 374 except: 375 raise 376 ctx = arg0.ctx 377 res = isl.isl_union_pw_multi_aff_union_add(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 378 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 379 return obj 380 381isl.isl_union_pw_multi_aff_from_multi_aff.restype = c_void_p 382isl.isl_union_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 383isl.isl_union_pw_multi_aff_from_pw_multi_aff.restype = c_void_p 384isl.isl_union_pw_multi_aff_from_pw_multi_aff.argtypes = [c_void_p] 385isl.isl_union_pw_multi_aff_from_union_pw_aff.restype = c_void_p 386isl.isl_union_pw_multi_aff_from_union_pw_aff.argtypes = [c_void_p] 387isl.isl_union_pw_multi_aff_read_from_str.restype = c_void_p 388isl.isl_union_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 389isl.isl_union_pw_multi_aff_add.restype = c_void_p 390isl.isl_union_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 391isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.restype = c_void_p 392isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 393isl.isl_union_pw_multi_aff_as_pw_multi_aff.restype = c_void_p 394isl.isl_union_pw_multi_aff_as_pw_multi_aff.argtypes = [c_void_p] 395isl.isl_union_pw_multi_aff_coalesce.restype = c_void_p 396isl.isl_union_pw_multi_aff_coalesce.argtypes = [c_void_p] 397isl.isl_union_pw_multi_aff_domain.restype = c_void_p 398isl.isl_union_pw_multi_aff_domain.argtypes = [c_void_p] 399isl.isl_union_pw_multi_aff_empty_ctx.restype = c_void_p 400isl.isl_union_pw_multi_aff_empty_ctx.argtypes = [Context] 401isl.isl_union_pw_multi_aff_extract_pw_multi_aff.restype = c_void_p 402isl.isl_union_pw_multi_aff_extract_pw_multi_aff.argtypes = [c_void_p, c_void_p] 403isl.isl_union_pw_multi_aff_flat_range_product.restype = c_void_p 404isl.isl_union_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 405isl.isl_union_pw_multi_aff_get_space.restype = c_void_p 406isl.isl_union_pw_multi_aff_get_space.argtypes = [c_void_p] 407isl.isl_union_pw_multi_aff_gist.restype = c_void_p 408isl.isl_union_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 409isl.isl_union_pw_multi_aff_intersect_domain_space.restype = c_void_p 410isl.isl_union_pw_multi_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 411isl.isl_union_pw_multi_aff_intersect_domain_union_set.restype = c_void_p 412isl.isl_union_pw_multi_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 413isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.restype = c_void_p 414isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 415isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.restype = c_void_p 416isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 417isl.isl_union_pw_multi_aff_intersect_params.restype = c_void_p 418isl.isl_union_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 419isl.isl_union_pw_multi_aff_involves_locals.argtypes = [c_void_p] 420isl.isl_union_pw_multi_aff_isa_pw_multi_aff.argtypes = [c_void_p] 421isl.isl_union_pw_multi_aff_plain_is_empty.argtypes = [c_void_p] 422isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.restype = c_void_p 423isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 424isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.restype = c_void_p 425isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 426isl.isl_union_pw_multi_aff_range_factor_domain.restype = c_void_p 427isl.isl_union_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 428isl.isl_union_pw_multi_aff_range_factor_range.restype = c_void_p 429isl.isl_union_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 430isl.isl_union_pw_multi_aff_range_product.restype = c_void_p 431isl.isl_union_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 432isl.isl_union_pw_multi_aff_sub.restype = c_void_p 433isl.isl_union_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 434isl.isl_union_pw_multi_aff_subtract_domain_space.restype = c_void_p 435isl.isl_union_pw_multi_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 436isl.isl_union_pw_multi_aff_subtract_domain_union_set.restype = c_void_p 437isl.isl_union_pw_multi_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 438isl.isl_union_pw_multi_aff_union_add.restype = c_void_p 439isl.isl_union_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 440isl.isl_union_pw_multi_aff_copy.restype = c_void_p 441isl.isl_union_pw_multi_aff_copy.argtypes = [c_void_p] 442isl.isl_union_pw_multi_aff_free.restype = c_void_p 443isl.isl_union_pw_multi_aff_free.argtypes = [c_void_p] 444isl.isl_union_pw_multi_aff_to_str.restype = POINTER(c_char) 445isl.isl_union_pw_multi_aff_to_str.argtypes = [c_void_p] 446 447class multi_union_pw_aff(object): 448 def __init__(self, *args, **keywords): 449 if "ptr" in keywords: 450 self.ctx = keywords["ctx"] 451 self.ptr = keywords["ptr"] 452 return 453 if len(args) == 1 and args[0].__class__ is multi_pw_aff: 454 self.ctx = Context.getDefaultInstance() 455 self.ptr = isl.isl_multi_union_pw_aff_from_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 456 return 457 if len(args) == 1 and args[0].__class__ is union_pw_aff: 458 self.ctx = Context.getDefaultInstance() 459 self.ptr = isl.isl_multi_union_pw_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 460 return 461 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is union_pw_aff_list: 462 self.ctx = Context.getDefaultInstance() 463 self.ptr = isl.isl_multi_union_pw_aff_from_union_pw_aff_list(isl.isl_space_copy(args[0].ptr), isl.isl_union_pw_aff_list_copy(args[1].ptr)) 464 return 465 if len(args) == 1 and type(args[0]) == str: 466 self.ctx = Context.getDefaultInstance() 467 self.ptr = isl.isl_multi_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 468 return 469 raise Error 470 def __del__(self): 471 if hasattr(self, 'ptr'): 472 isl.isl_multi_union_pw_aff_free(self.ptr) 473 def __str__(arg0): 474 try: 475 if not arg0.__class__ is multi_union_pw_aff: 476 arg0 = multi_union_pw_aff(arg0) 477 except: 478 raise 479 ptr = isl.isl_multi_union_pw_aff_to_str(arg0.ptr) 480 res = cast(ptr, c_char_p).value.decode('ascii') 481 libc.free(ptr) 482 return res 483 def __repr__(self): 484 s = str(self) 485 if '"' in s: 486 return 'isl.multi_union_pw_aff("""%s""")' % s 487 else: 488 return 'isl.multi_union_pw_aff("%s")' % s 489 def add(arg0, arg1): 490 try: 491 if not arg0.__class__ is multi_union_pw_aff: 492 arg0 = multi_union_pw_aff(arg0) 493 except: 494 raise 495 try: 496 if not arg1.__class__ is multi_union_pw_aff: 497 arg1 = multi_union_pw_aff(arg1) 498 except: 499 raise 500 ctx = arg0.ctx 501 res = isl.isl_multi_union_pw_aff_add(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 502 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 503 return obj 504 def bind(arg0, arg1): 505 try: 506 if not arg0.__class__ is multi_union_pw_aff: 507 arg0 = multi_union_pw_aff(arg0) 508 except: 509 raise 510 try: 511 if not arg1.__class__ is multi_id: 512 arg1 = multi_id(arg1) 513 except: 514 raise 515 ctx = arg0.ctx 516 res = isl.isl_multi_union_pw_aff_bind(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 517 obj = union_set(ctx=ctx, ptr=res) 518 return obj 519 def coalesce(arg0): 520 try: 521 if not arg0.__class__ is multi_union_pw_aff: 522 arg0 = multi_union_pw_aff(arg0) 523 except: 524 raise 525 ctx = arg0.ctx 526 res = isl.isl_multi_union_pw_aff_coalesce(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 527 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 528 return obj 529 def domain(arg0): 530 try: 531 if not arg0.__class__ is multi_union_pw_aff: 532 arg0 = multi_union_pw_aff(arg0) 533 except: 534 raise 535 ctx = arg0.ctx 536 res = isl.isl_multi_union_pw_aff_domain(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 537 obj = union_set(ctx=ctx, ptr=res) 538 return obj 539 def flat_range_product(arg0, arg1): 540 try: 541 if not arg0.__class__ is multi_union_pw_aff: 542 arg0 = multi_union_pw_aff(arg0) 543 except: 544 raise 545 try: 546 if not arg1.__class__ is multi_union_pw_aff: 547 arg1 = multi_union_pw_aff(arg1) 548 except: 549 raise 550 ctx = arg0.ctx 551 res = isl.isl_multi_union_pw_aff_flat_range_product(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 552 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 553 return obj 554 def at(arg0, arg1): 555 try: 556 if not arg0.__class__ is multi_union_pw_aff: 557 arg0 = multi_union_pw_aff(arg0) 558 except: 559 raise 560 ctx = arg0.ctx 561 res = isl.isl_multi_union_pw_aff_get_at(arg0.ptr, arg1) 562 obj = union_pw_aff(ctx=ctx, ptr=res) 563 return obj 564 def get_at(arg0, arg1): 565 return arg0.at(arg1) 566 def list(arg0): 567 try: 568 if not arg0.__class__ is multi_union_pw_aff: 569 arg0 = multi_union_pw_aff(arg0) 570 except: 571 raise 572 ctx = arg0.ctx 573 res = isl.isl_multi_union_pw_aff_get_list(arg0.ptr) 574 obj = union_pw_aff_list(ctx=ctx, ptr=res) 575 return obj 576 def get_list(arg0): 577 return arg0.list() 578 def space(arg0): 579 try: 580 if not arg0.__class__ is multi_union_pw_aff: 581 arg0 = multi_union_pw_aff(arg0) 582 except: 583 raise 584 ctx = arg0.ctx 585 res = isl.isl_multi_union_pw_aff_get_space(arg0.ptr) 586 obj = space(ctx=ctx, ptr=res) 587 return obj 588 def get_space(arg0): 589 return arg0.space() 590 def gist(arg0, arg1): 591 try: 592 if not arg0.__class__ is multi_union_pw_aff: 593 arg0 = multi_union_pw_aff(arg0) 594 except: 595 raise 596 try: 597 if not arg1.__class__ is union_set: 598 arg1 = union_set(arg1) 599 except: 600 raise 601 ctx = arg0.ctx 602 res = isl.isl_multi_union_pw_aff_gist(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 603 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 604 return obj 605 def intersect_domain(arg0, arg1): 606 try: 607 if not arg0.__class__ is multi_union_pw_aff: 608 arg0 = multi_union_pw_aff(arg0) 609 except: 610 raise 611 try: 612 if not arg1.__class__ is union_set: 613 arg1 = union_set(arg1) 614 except: 615 raise 616 ctx = arg0.ctx 617 res = isl.isl_multi_union_pw_aff_intersect_domain(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 618 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 619 return obj 620 def intersect_params(arg0, arg1): 621 try: 622 if not arg0.__class__ is multi_union_pw_aff: 623 arg0 = multi_union_pw_aff(arg0) 624 except: 625 raise 626 try: 627 if not arg1.__class__ is set: 628 arg1 = set(arg1) 629 except: 630 raise 631 ctx = arg0.ctx 632 res = isl.isl_multi_union_pw_aff_intersect_params(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 633 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 634 return obj 635 def involves_nan(arg0): 636 try: 637 if not arg0.__class__ is multi_union_pw_aff: 638 arg0 = multi_union_pw_aff(arg0) 639 except: 640 raise 641 ctx = arg0.ctx 642 res = isl.isl_multi_union_pw_aff_involves_nan(arg0.ptr) 643 if res < 0: 644 raise 645 return bool(res) 646 def neg(arg0): 647 try: 648 if not arg0.__class__ is multi_union_pw_aff: 649 arg0 = multi_union_pw_aff(arg0) 650 except: 651 raise 652 ctx = arg0.ctx 653 res = isl.isl_multi_union_pw_aff_neg(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 654 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 655 return obj 656 def plain_is_equal(arg0, arg1): 657 try: 658 if not arg0.__class__ is multi_union_pw_aff: 659 arg0 = multi_union_pw_aff(arg0) 660 except: 661 raise 662 try: 663 if not arg1.__class__ is multi_union_pw_aff: 664 arg1 = multi_union_pw_aff(arg1) 665 except: 666 raise 667 ctx = arg0.ctx 668 res = isl.isl_multi_union_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 669 if res < 0: 670 raise 671 return bool(res) 672 def pullback(*args): 673 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 674 ctx = args[0].ctx 675 res = isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 676 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 677 return obj 678 raise Error 679 def range_product(arg0, arg1): 680 try: 681 if not arg0.__class__ is multi_union_pw_aff: 682 arg0 = multi_union_pw_aff(arg0) 683 except: 684 raise 685 try: 686 if not arg1.__class__ is multi_union_pw_aff: 687 arg1 = multi_union_pw_aff(arg1) 688 except: 689 raise 690 ctx = arg0.ctx 691 res = isl.isl_multi_union_pw_aff_range_product(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 692 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 693 return obj 694 def scale(*args): 695 if len(args) == 2 and args[1].__class__ is multi_val: 696 ctx = args[0].ctx 697 res = isl.isl_multi_union_pw_aff_scale_multi_val(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 698 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 699 return obj 700 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 701 args = list(args) 702 try: 703 if not args[1].__class__ is val: 704 args[1] = val(args[1]) 705 except: 706 raise 707 ctx = args[0].ctx 708 res = isl.isl_multi_union_pw_aff_scale_val(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 709 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 710 return obj 711 raise Error 712 def scale_down(*args): 713 if len(args) == 2 and args[1].__class__ is multi_val: 714 ctx = args[0].ctx 715 res = isl.isl_multi_union_pw_aff_scale_down_multi_val(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 716 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 717 return obj 718 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 719 args = list(args) 720 try: 721 if not args[1].__class__ is val: 722 args[1] = val(args[1]) 723 except: 724 raise 725 ctx = args[0].ctx 726 res = isl.isl_multi_union_pw_aff_scale_down_val(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 727 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 728 return obj 729 raise Error 730 def set_at(arg0, arg1, arg2): 731 try: 732 if not arg0.__class__ is multi_union_pw_aff: 733 arg0 = multi_union_pw_aff(arg0) 734 except: 735 raise 736 try: 737 if not arg2.__class__ is union_pw_aff: 738 arg2 = union_pw_aff(arg2) 739 except: 740 raise 741 ctx = arg0.ctx 742 res = isl.isl_multi_union_pw_aff_set_at(isl.isl_multi_union_pw_aff_copy(arg0.ptr), arg1, isl.isl_union_pw_aff_copy(arg2.ptr)) 743 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 744 return obj 745 def size(arg0): 746 try: 747 if not arg0.__class__ is multi_union_pw_aff: 748 arg0 = multi_union_pw_aff(arg0) 749 except: 750 raise 751 ctx = arg0.ctx 752 res = isl.isl_multi_union_pw_aff_size(arg0.ptr) 753 if res < 0: 754 raise 755 return int(res) 756 def sub(arg0, arg1): 757 try: 758 if not arg0.__class__ is multi_union_pw_aff: 759 arg0 = multi_union_pw_aff(arg0) 760 except: 761 raise 762 try: 763 if not arg1.__class__ is multi_union_pw_aff: 764 arg1 = multi_union_pw_aff(arg1) 765 except: 766 raise 767 ctx = arg0.ctx 768 res = isl.isl_multi_union_pw_aff_sub(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 769 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 770 return obj 771 def union_add(arg0, arg1): 772 try: 773 if not arg0.__class__ is multi_union_pw_aff: 774 arg0 = multi_union_pw_aff(arg0) 775 except: 776 raise 777 try: 778 if not arg1.__class__ is multi_union_pw_aff: 779 arg1 = multi_union_pw_aff(arg1) 780 except: 781 raise 782 ctx = arg0.ctx 783 res = isl.isl_multi_union_pw_aff_union_add(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 784 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 785 return obj 786 @staticmethod 787 def zero(arg0): 788 try: 789 if not arg0.__class__ is space: 790 arg0 = space(arg0) 791 except: 792 raise 793 ctx = arg0.ctx 794 res = isl.isl_multi_union_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 795 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 796 return obj 797 798isl.isl_multi_union_pw_aff_from_multi_pw_aff.restype = c_void_p 799isl.isl_multi_union_pw_aff_from_multi_pw_aff.argtypes = [c_void_p] 800isl.isl_multi_union_pw_aff_from_union_pw_aff.restype = c_void_p 801isl.isl_multi_union_pw_aff_from_union_pw_aff.argtypes = [c_void_p] 802isl.isl_multi_union_pw_aff_from_union_pw_aff_list.restype = c_void_p 803isl.isl_multi_union_pw_aff_from_union_pw_aff_list.argtypes = [c_void_p, c_void_p] 804isl.isl_multi_union_pw_aff_read_from_str.restype = c_void_p 805isl.isl_multi_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 806isl.isl_multi_union_pw_aff_add.restype = c_void_p 807isl.isl_multi_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 808isl.isl_multi_union_pw_aff_bind.restype = c_void_p 809isl.isl_multi_union_pw_aff_bind.argtypes = [c_void_p, c_void_p] 810isl.isl_multi_union_pw_aff_coalesce.restype = c_void_p 811isl.isl_multi_union_pw_aff_coalesce.argtypes = [c_void_p] 812isl.isl_multi_union_pw_aff_domain.restype = c_void_p 813isl.isl_multi_union_pw_aff_domain.argtypes = [c_void_p] 814isl.isl_multi_union_pw_aff_flat_range_product.restype = c_void_p 815isl.isl_multi_union_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 816isl.isl_multi_union_pw_aff_get_at.restype = c_void_p 817isl.isl_multi_union_pw_aff_get_at.argtypes = [c_void_p, c_int] 818isl.isl_multi_union_pw_aff_get_list.restype = c_void_p 819isl.isl_multi_union_pw_aff_get_list.argtypes = [c_void_p] 820isl.isl_multi_union_pw_aff_get_space.restype = c_void_p 821isl.isl_multi_union_pw_aff_get_space.argtypes = [c_void_p] 822isl.isl_multi_union_pw_aff_gist.restype = c_void_p 823isl.isl_multi_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 824isl.isl_multi_union_pw_aff_intersect_domain.restype = c_void_p 825isl.isl_multi_union_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 826isl.isl_multi_union_pw_aff_intersect_params.restype = c_void_p 827isl.isl_multi_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 828isl.isl_multi_union_pw_aff_involves_nan.argtypes = [c_void_p] 829isl.isl_multi_union_pw_aff_neg.restype = c_void_p 830isl.isl_multi_union_pw_aff_neg.argtypes = [c_void_p] 831isl.isl_multi_union_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 832isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 833isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 834isl.isl_multi_union_pw_aff_range_product.restype = c_void_p 835isl.isl_multi_union_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 836isl.isl_multi_union_pw_aff_scale_multi_val.restype = c_void_p 837isl.isl_multi_union_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 838isl.isl_multi_union_pw_aff_scale_val.restype = c_void_p 839isl.isl_multi_union_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 840isl.isl_multi_union_pw_aff_scale_down_multi_val.restype = c_void_p 841isl.isl_multi_union_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 842isl.isl_multi_union_pw_aff_scale_down_val.restype = c_void_p 843isl.isl_multi_union_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 844isl.isl_multi_union_pw_aff_set_at.restype = c_void_p 845isl.isl_multi_union_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 846isl.isl_multi_union_pw_aff_size.argtypes = [c_void_p] 847isl.isl_multi_union_pw_aff_sub.restype = c_void_p 848isl.isl_multi_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 849isl.isl_multi_union_pw_aff_union_add.restype = c_void_p 850isl.isl_multi_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 851isl.isl_multi_union_pw_aff_zero.restype = c_void_p 852isl.isl_multi_union_pw_aff_zero.argtypes = [c_void_p] 853isl.isl_multi_union_pw_aff_copy.restype = c_void_p 854isl.isl_multi_union_pw_aff_copy.argtypes = [c_void_p] 855isl.isl_multi_union_pw_aff_free.restype = c_void_p 856isl.isl_multi_union_pw_aff_free.argtypes = [c_void_p] 857isl.isl_multi_union_pw_aff_to_str.restype = POINTER(c_char) 858isl.isl_multi_union_pw_aff_to_str.argtypes = [c_void_p] 859 860class union_pw_aff(union_pw_multi_aff, multi_union_pw_aff): 861 def __init__(self, *args, **keywords): 862 if "ptr" in keywords: 863 self.ctx = keywords["ctx"] 864 self.ptr = keywords["ptr"] 865 return 866 if len(args) == 1 and args[0].__class__ is aff: 867 self.ctx = Context.getDefaultInstance() 868 self.ptr = isl.isl_union_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 869 return 870 if len(args) == 1 and args[0].__class__ is pw_aff: 871 self.ctx = Context.getDefaultInstance() 872 self.ptr = isl.isl_union_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 873 return 874 if len(args) == 1 and type(args[0]) == str: 875 self.ctx = Context.getDefaultInstance() 876 self.ptr = isl.isl_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 877 return 878 raise Error 879 def __del__(self): 880 if hasattr(self, 'ptr'): 881 isl.isl_union_pw_aff_free(self.ptr) 882 def __str__(arg0): 883 try: 884 if not arg0.__class__ is union_pw_aff: 885 arg0 = union_pw_aff(arg0) 886 except: 887 raise 888 ptr = isl.isl_union_pw_aff_to_str(arg0.ptr) 889 res = cast(ptr, c_char_p).value.decode('ascii') 890 libc.free(ptr) 891 return res 892 def __repr__(self): 893 s = str(self) 894 if '"' in s: 895 return 'isl.union_pw_aff("""%s""")' % s 896 else: 897 return 'isl.union_pw_aff("%s")' % s 898 def add(arg0, arg1): 899 try: 900 if not arg0.__class__ is union_pw_aff: 901 arg0 = union_pw_aff(arg0) 902 except: 903 raise 904 try: 905 if not arg1.__class__ is union_pw_aff: 906 arg1 = union_pw_aff(arg1) 907 except: 908 return union_pw_multi_aff(arg0).add(arg1) 909 ctx = arg0.ctx 910 res = isl.isl_union_pw_aff_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 911 obj = union_pw_aff(ctx=ctx, ptr=res) 912 return obj 913 def bind(*args): 914 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 915 args = list(args) 916 try: 917 if not args[1].__class__ is id: 918 args[1] = id(args[1]) 919 except: 920 raise 921 ctx = args[0].ctx 922 res = isl.isl_union_pw_aff_bind_id(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 923 obj = union_set(ctx=ctx, ptr=res) 924 return obj 925 raise Error 926 def coalesce(arg0): 927 try: 928 if not arg0.__class__ is union_pw_aff: 929 arg0 = union_pw_aff(arg0) 930 except: 931 raise 932 ctx = arg0.ctx 933 res = isl.isl_union_pw_aff_coalesce(isl.isl_union_pw_aff_copy(arg0.ptr)) 934 obj = union_pw_aff(ctx=ctx, ptr=res) 935 return obj 936 def domain(arg0): 937 try: 938 if not arg0.__class__ is union_pw_aff: 939 arg0 = union_pw_aff(arg0) 940 except: 941 raise 942 ctx = arg0.ctx 943 res = isl.isl_union_pw_aff_domain(isl.isl_union_pw_aff_copy(arg0.ptr)) 944 obj = union_set(ctx=ctx, ptr=res) 945 return obj 946 def space(arg0): 947 try: 948 if not arg0.__class__ is union_pw_aff: 949 arg0 = union_pw_aff(arg0) 950 except: 951 raise 952 ctx = arg0.ctx 953 res = isl.isl_union_pw_aff_get_space(arg0.ptr) 954 obj = space(ctx=ctx, ptr=res) 955 return obj 956 def get_space(arg0): 957 return arg0.space() 958 def gist(arg0, arg1): 959 try: 960 if not arg0.__class__ is union_pw_aff: 961 arg0 = union_pw_aff(arg0) 962 except: 963 raise 964 try: 965 if not arg1.__class__ is union_set: 966 arg1 = union_set(arg1) 967 except: 968 return union_pw_multi_aff(arg0).gist(arg1) 969 ctx = arg0.ctx 970 res = isl.isl_union_pw_aff_gist(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 971 obj = union_pw_aff(ctx=ctx, ptr=res) 972 return obj 973 def intersect_domain(*args): 974 if len(args) == 2 and args[1].__class__ is space: 975 ctx = args[0].ctx 976 res = isl.isl_union_pw_aff_intersect_domain_space(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 977 obj = union_pw_aff(ctx=ctx, ptr=res) 978 return obj 979 if len(args) == 2 and args[1].__class__ is union_set: 980 ctx = args[0].ctx 981 res = isl.isl_union_pw_aff_intersect_domain_union_set(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 982 obj = union_pw_aff(ctx=ctx, ptr=res) 983 return obj 984 raise Error 985 def intersect_domain_wrapped_domain(arg0, arg1): 986 try: 987 if not arg0.__class__ is union_pw_aff: 988 arg0 = union_pw_aff(arg0) 989 except: 990 raise 991 try: 992 if not arg1.__class__ is union_set: 993 arg1 = union_set(arg1) 994 except: 995 return union_pw_multi_aff(arg0).intersect_domain_wrapped_domain(arg1) 996 ctx = arg0.ctx 997 res = isl.isl_union_pw_aff_intersect_domain_wrapped_domain(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 998 obj = union_pw_aff(ctx=ctx, ptr=res) 999 return obj 1000 def intersect_domain_wrapped_range(arg0, arg1): 1001 try: 1002 if not arg0.__class__ is union_pw_aff: 1003 arg0 = union_pw_aff(arg0) 1004 except: 1005 raise 1006 try: 1007 if not arg1.__class__ is union_set: 1008 arg1 = union_set(arg1) 1009 except: 1010 return union_pw_multi_aff(arg0).intersect_domain_wrapped_range(arg1) 1011 ctx = arg0.ctx 1012 res = isl.isl_union_pw_aff_intersect_domain_wrapped_range(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 1013 obj = union_pw_aff(ctx=ctx, ptr=res) 1014 return obj 1015 def intersect_params(arg0, arg1): 1016 try: 1017 if not arg0.__class__ is union_pw_aff: 1018 arg0 = union_pw_aff(arg0) 1019 except: 1020 raise 1021 try: 1022 if not arg1.__class__ is set: 1023 arg1 = set(arg1) 1024 except: 1025 return union_pw_multi_aff(arg0).intersect_params(arg1) 1026 ctx = arg0.ctx 1027 res = isl.isl_union_pw_aff_intersect_params(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1028 obj = union_pw_aff(ctx=ctx, ptr=res) 1029 return obj 1030 def pullback(*args): 1031 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 1032 ctx = args[0].ctx 1033 res = isl.isl_union_pw_aff_pullback_union_pw_multi_aff(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 1034 obj = union_pw_aff(ctx=ctx, ptr=res) 1035 return obj 1036 raise Error 1037 def sub(arg0, arg1): 1038 try: 1039 if not arg0.__class__ is union_pw_aff: 1040 arg0 = union_pw_aff(arg0) 1041 except: 1042 raise 1043 try: 1044 if not arg1.__class__ is union_pw_aff: 1045 arg1 = union_pw_aff(arg1) 1046 except: 1047 return union_pw_multi_aff(arg0).sub(arg1) 1048 ctx = arg0.ctx 1049 res = isl.isl_union_pw_aff_sub(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1050 obj = union_pw_aff(ctx=ctx, ptr=res) 1051 return obj 1052 def subtract_domain(*args): 1053 if len(args) == 2 and args[1].__class__ is space: 1054 ctx = args[0].ctx 1055 res = isl.isl_union_pw_aff_subtract_domain_space(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 1056 obj = union_pw_aff(ctx=ctx, ptr=res) 1057 return obj 1058 if len(args) == 2 and args[1].__class__ is union_set: 1059 ctx = args[0].ctx 1060 res = isl.isl_union_pw_aff_subtract_domain_union_set(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 1061 obj = union_pw_aff(ctx=ctx, ptr=res) 1062 return obj 1063 raise Error 1064 def union_add(arg0, arg1): 1065 try: 1066 if not arg0.__class__ is union_pw_aff: 1067 arg0 = union_pw_aff(arg0) 1068 except: 1069 raise 1070 try: 1071 if not arg1.__class__ is union_pw_aff: 1072 arg1 = union_pw_aff(arg1) 1073 except: 1074 return union_pw_multi_aff(arg0).union_add(arg1) 1075 ctx = arg0.ctx 1076 res = isl.isl_union_pw_aff_union_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1077 obj = union_pw_aff(ctx=ctx, ptr=res) 1078 return obj 1079 1080isl.isl_union_pw_aff_from_aff.restype = c_void_p 1081isl.isl_union_pw_aff_from_aff.argtypes = [c_void_p] 1082isl.isl_union_pw_aff_from_pw_aff.restype = c_void_p 1083isl.isl_union_pw_aff_from_pw_aff.argtypes = [c_void_p] 1084isl.isl_union_pw_aff_read_from_str.restype = c_void_p 1085isl.isl_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1086isl.isl_union_pw_aff_add.restype = c_void_p 1087isl.isl_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 1088isl.isl_union_pw_aff_bind_id.restype = c_void_p 1089isl.isl_union_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 1090isl.isl_union_pw_aff_coalesce.restype = c_void_p 1091isl.isl_union_pw_aff_coalesce.argtypes = [c_void_p] 1092isl.isl_union_pw_aff_domain.restype = c_void_p 1093isl.isl_union_pw_aff_domain.argtypes = [c_void_p] 1094isl.isl_union_pw_aff_get_space.restype = c_void_p 1095isl.isl_union_pw_aff_get_space.argtypes = [c_void_p] 1096isl.isl_union_pw_aff_gist.restype = c_void_p 1097isl.isl_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1098isl.isl_union_pw_aff_intersect_domain_space.restype = c_void_p 1099isl.isl_union_pw_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 1100isl.isl_union_pw_aff_intersect_domain_union_set.restype = c_void_p 1101isl.isl_union_pw_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 1102isl.isl_union_pw_aff_intersect_domain_wrapped_domain.restype = c_void_p 1103isl.isl_union_pw_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 1104isl.isl_union_pw_aff_intersect_domain_wrapped_range.restype = c_void_p 1105isl.isl_union_pw_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 1106isl.isl_union_pw_aff_intersect_params.restype = c_void_p 1107isl.isl_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1108isl.isl_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 1109isl.isl_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1110isl.isl_union_pw_aff_sub.restype = c_void_p 1111isl.isl_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1112isl.isl_union_pw_aff_subtract_domain_space.restype = c_void_p 1113isl.isl_union_pw_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 1114isl.isl_union_pw_aff_subtract_domain_union_set.restype = c_void_p 1115isl.isl_union_pw_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 1116isl.isl_union_pw_aff_union_add.restype = c_void_p 1117isl.isl_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1118isl.isl_union_pw_aff_copy.restype = c_void_p 1119isl.isl_union_pw_aff_copy.argtypes = [c_void_p] 1120isl.isl_union_pw_aff_free.restype = c_void_p 1121isl.isl_union_pw_aff_free.argtypes = [c_void_p] 1122isl.isl_union_pw_aff_to_str.restype = POINTER(c_char) 1123isl.isl_union_pw_aff_to_str.argtypes = [c_void_p] 1124 1125class multi_pw_aff(multi_union_pw_aff): 1126 def __init__(self, *args, **keywords): 1127 if "ptr" in keywords: 1128 self.ctx = keywords["ctx"] 1129 self.ptr = keywords["ptr"] 1130 return 1131 if len(args) == 1 and args[0].__class__ is aff: 1132 self.ctx = Context.getDefaultInstance() 1133 self.ptr = isl.isl_multi_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 1134 return 1135 if len(args) == 1 and args[0].__class__ is multi_aff: 1136 self.ctx = Context.getDefaultInstance() 1137 self.ptr = isl.isl_multi_pw_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 1138 return 1139 if len(args) == 1 and args[0].__class__ is pw_aff: 1140 self.ctx = Context.getDefaultInstance() 1141 self.ptr = isl.isl_multi_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1142 return 1143 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is pw_aff_list: 1144 self.ctx = Context.getDefaultInstance() 1145 self.ptr = isl.isl_multi_pw_aff_from_pw_aff_list(isl.isl_space_copy(args[0].ptr), isl.isl_pw_aff_list_copy(args[1].ptr)) 1146 return 1147 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 1148 self.ctx = Context.getDefaultInstance() 1149 self.ptr = isl.isl_multi_pw_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 1150 return 1151 if len(args) == 1 and type(args[0]) == str: 1152 self.ctx = Context.getDefaultInstance() 1153 self.ptr = isl.isl_multi_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1154 return 1155 raise Error 1156 def __del__(self): 1157 if hasattr(self, 'ptr'): 1158 isl.isl_multi_pw_aff_free(self.ptr) 1159 def __str__(arg0): 1160 try: 1161 if not arg0.__class__ is multi_pw_aff: 1162 arg0 = multi_pw_aff(arg0) 1163 except: 1164 raise 1165 ptr = isl.isl_multi_pw_aff_to_str(arg0.ptr) 1166 res = cast(ptr, c_char_p).value.decode('ascii') 1167 libc.free(ptr) 1168 return res 1169 def __repr__(self): 1170 s = str(self) 1171 if '"' in s: 1172 return 'isl.multi_pw_aff("""%s""")' % s 1173 else: 1174 return 'isl.multi_pw_aff("%s")' % s 1175 def add(arg0, arg1): 1176 try: 1177 if not arg0.__class__ is multi_pw_aff: 1178 arg0 = multi_pw_aff(arg0) 1179 except: 1180 raise 1181 try: 1182 if not arg1.__class__ is multi_pw_aff: 1183 arg1 = multi_pw_aff(arg1) 1184 except: 1185 return multi_union_pw_aff(arg0).add(arg1) 1186 ctx = arg0.ctx 1187 res = isl.isl_multi_pw_aff_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1188 obj = multi_pw_aff(ctx=ctx, ptr=res) 1189 return obj 1190 def add_constant(*args): 1191 if len(args) == 2 and args[1].__class__ is multi_val: 1192 ctx = args[0].ctx 1193 res = isl.isl_multi_pw_aff_add_constant_multi_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 1194 obj = multi_pw_aff(ctx=ctx, ptr=res) 1195 return obj 1196 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1197 args = list(args) 1198 try: 1199 if not args[1].__class__ is val: 1200 args[1] = val(args[1]) 1201 except: 1202 raise 1203 ctx = args[0].ctx 1204 res = isl.isl_multi_pw_aff_add_constant_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 1205 obj = multi_pw_aff(ctx=ctx, ptr=res) 1206 return obj 1207 raise Error 1208 def bind(arg0, arg1): 1209 try: 1210 if not arg0.__class__ is multi_pw_aff: 1211 arg0 = multi_pw_aff(arg0) 1212 except: 1213 raise 1214 try: 1215 if not arg1.__class__ is multi_id: 1216 arg1 = multi_id(arg1) 1217 except: 1218 return multi_union_pw_aff(arg0).bind(arg1) 1219 ctx = arg0.ctx 1220 res = isl.isl_multi_pw_aff_bind(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1221 obj = set(ctx=ctx, ptr=res) 1222 return obj 1223 def bind_domain(arg0, arg1): 1224 try: 1225 if not arg0.__class__ is multi_pw_aff: 1226 arg0 = multi_pw_aff(arg0) 1227 except: 1228 raise 1229 try: 1230 if not arg1.__class__ is multi_id: 1231 arg1 = multi_id(arg1) 1232 except: 1233 return multi_union_pw_aff(arg0).bind_domain(arg1) 1234 ctx = arg0.ctx 1235 res = isl.isl_multi_pw_aff_bind_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1236 obj = multi_pw_aff(ctx=ctx, ptr=res) 1237 return obj 1238 def bind_domain_wrapped_domain(arg0, arg1): 1239 try: 1240 if not arg0.__class__ is multi_pw_aff: 1241 arg0 = multi_pw_aff(arg0) 1242 except: 1243 raise 1244 try: 1245 if not arg1.__class__ is multi_id: 1246 arg1 = multi_id(arg1) 1247 except: 1248 return multi_union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 1249 ctx = arg0.ctx 1250 res = isl.isl_multi_pw_aff_bind_domain_wrapped_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1251 obj = multi_pw_aff(ctx=ctx, ptr=res) 1252 return obj 1253 def coalesce(arg0): 1254 try: 1255 if not arg0.__class__ is multi_pw_aff: 1256 arg0 = multi_pw_aff(arg0) 1257 except: 1258 raise 1259 ctx = arg0.ctx 1260 res = isl.isl_multi_pw_aff_coalesce(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1261 obj = multi_pw_aff(ctx=ctx, ptr=res) 1262 return obj 1263 def domain(arg0): 1264 try: 1265 if not arg0.__class__ is multi_pw_aff: 1266 arg0 = multi_pw_aff(arg0) 1267 except: 1268 raise 1269 ctx = arg0.ctx 1270 res = isl.isl_multi_pw_aff_domain(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1271 obj = set(ctx=ctx, ptr=res) 1272 return obj 1273 def flat_range_product(arg0, arg1): 1274 try: 1275 if not arg0.__class__ is multi_pw_aff: 1276 arg0 = multi_pw_aff(arg0) 1277 except: 1278 raise 1279 try: 1280 if not arg1.__class__ is multi_pw_aff: 1281 arg1 = multi_pw_aff(arg1) 1282 except: 1283 return multi_union_pw_aff(arg0).flat_range_product(arg1) 1284 ctx = arg0.ctx 1285 res = isl.isl_multi_pw_aff_flat_range_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1286 obj = multi_pw_aff(ctx=ctx, ptr=res) 1287 return obj 1288 def at(arg0, arg1): 1289 try: 1290 if not arg0.__class__ is multi_pw_aff: 1291 arg0 = multi_pw_aff(arg0) 1292 except: 1293 raise 1294 ctx = arg0.ctx 1295 res = isl.isl_multi_pw_aff_get_at(arg0.ptr, arg1) 1296 obj = pw_aff(ctx=ctx, ptr=res) 1297 return obj 1298 def get_at(arg0, arg1): 1299 return arg0.at(arg1) 1300 def list(arg0): 1301 try: 1302 if not arg0.__class__ is multi_pw_aff: 1303 arg0 = multi_pw_aff(arg0) 1304 except: 1305 raise 1306 ctx = arg0.ctx 1307 res = isl.isl_multi_pw_aff_get_list(arg0.ptr) 1308 obj = pw_aff_list(ctx=ctx, ptr=res) 1309 return obj 1310 def get_list(arg0): 1311 return arg0.list() 1312 def space(arg0): 1313 try: 1314 if not arg0.__class__ is multi_pw_aff: 1315 arg0 = multi_pw_aff(arg0) 1316 except: 1317 raise 1318 ctx = arg0.ctx 1319 res = isl.isl_multi_pw_aff_get_space(arg0.ptr) 1320 obj = space(ctx=ctx, ptr=res) 1321 return obj 1322 def get_space(arg0): 1323 return arg0.space() 1324 def gist(arg0, arg1): 1325 try: 1326 if not arg0.__class__ is multi_pw_aff: 1327 arg0 = multi_pw_aff(arg0) 1328 except: 1329 raise 1330 try: 1331 if not arg1.__class__ is set: 1332 arg1 = set(arg1) 1333 except: 1334 return multi_union_pw_aff(arg0).gist(arg1) 1335 ctx = arg0.ctx 1336 res = isl.isl_multi_pw_aff_gist(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1337 obj = multi_pw_aff(ctx=ctx, ptr=res) 1338 return obj 1339 def identity(*args): 1340 if len(args) == 1: 1341 ctx = args[0].ctx 1342 res = isl.isl_multi_pw_aff_identity_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 1343 obj = multi_pw_aff(ctx=ctx, ptr=res) 1344 return obj 1345 raise Error 1346 @staticmethod 1347 def identity_on_domain(*args): 1348 if len(args) == 1 and args[0].__class__ is space: 1349 ctx = args[0].ctx 1350 res = isl.isl_multi_pw_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 1351 obj = multi_pw_aff(ctx=ctx, ptr=res) 1352 return obj 1353 raise Error 1354 def insert_domain(arg0, arg1): 1355 try: 1356 if not arg0.__class__ is multi_pw_aff: 1357 arg0 = multi_pw_aff(arg0) 1358 except: 1359 raise 1360 try: 1361 if not arg1.__class__ is space: 1362 arg1 = space(arg1) 1363 except: 1364 return multi_union_pw_aff(arg0).insert_domain(arg1) 1365 ctx = arg0.ctx 1366 res = isl.isl_multi_pw_aff_insert_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 1367 obj = multi_pw_aff(ctx=ctx, ptr=res) 1368 return obj 1369 def intersect_domain(arg0, arg1): 1370 try: 1371 if not arg0.__class__ is multi_pw_aff: 1372 arg0 = multi_pw_aff(arg0) 1373 except: 1374 raise 1375 try: 1376 if not arg1.__class__ is set: 1377 arg1 = set(arg1) 1378 except: 1379 return multi_union_pw_aff(arg0).intersect_domain(arg1) 1380 ctx = arg0.ctx 1381 res = isl.isl_multi_pw_aff_intersect_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1382 obj = multi_pw_aff(ctx=ctx, ptr=res) 1383 return obj 1384 def intersect_params(arg0, arg1): 1385 try: 1386 if not arg0.__class__ is multi_pw_aff: 1387 arg0 = multi_pw_aff(arg0) 1388 except: 1389 raise 1390 try: 1391 if not arg1.__class__ is set: 1392 arg1 = set(arg1) 1393 except: 1394 return multi_union_pw_aff(arg0).intersect_params(arg1) 1395 ctx = arg0.ctx 1396 res = isl.isl_multi_pw_aff_intersect_params(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1397 obj = multi_pw_aff(ctx=ctx, ptr=res) 1398 return obj 1399 def involves_nan(arg0): 1400 try: 1401 if not arg0.__class__ is multi_pw_aff: 1402 arg0 = multi_pw_aff(arg0) 1403 except: 1404 raise 1405 ctx = arg0.ctx 1406 res = isl.isl_multi_pw_aff_involves_nan(arg0.ptr) 1407 if res < 0: 1408 raise 1409 return bool(res) 1410 def involves_param(*args): 1411 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 1412 args = list(args) 1413 try: 1414 if not args[1].__class__ is id: 1415 args[1] = id(args[1]) 1416 except: 1417 raise 1418 ctx = args[0].ctx 1419 res = isl.isl_multi_pw_aff_involves_param_id(args[0].ptr, args[1].ptr) 1420 if res < 0: 1421 raise 1422 return bool(res) 1423 if len(args) == 2 and args[1].__class__ is id_list: 1424 ctx = args[0].ctx 1425 res = isl.isl_multi_pw_aff_involves_param_id_list(args[0].ptr, args[1].ptr) 1426 if res < 0: 1427 raise 1428 return bool(res) 1429 raise Error 1430 def max(arg0, arg1): 1431 try: 1432 if not arg0.__class__ is multi_pw_aff: 1433 arg0 = multi_pw_aff(arg0) 1434 except: 1435 raise 1436 try: 1437 if not arg1.__class__ is multi_pw_aff: 1438 arg1 = multi_pw_aff(arg1) 1439 except: 1440 return multi_union_pw_aff(arg0).max(arg1) 1441 ctx = arg0.ctx 1442 res = isl.isl_multi_pw_aff_max(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1443 obj = multi_pw_aff(ctx=ctx, ptr=res) 1444 return obj 1445 def max_multi_val(arg0): 1446 try: 1447 if not arg0.__class__ is multi_pw_aff: 1448 arg0 = multi_pw_aff(arg0) 1449 except: 1450 raise 1451 ctx = arg0.ctx 1452 res = isl.isl_multi_pw_aff_max_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1453 obj = multi_val(ctx=ctx, ptr=res) 1454 return obj 1455 def min(arg0, arg1): 1456 try: 1457 if not arg0.__class__ is multi_pw_aff: 1458 arg0 = multi_pw_aff(arg0) 1459 except: 1460 raise 1461 try: 1462 if not arg1.__class__ is multi_pw_aff: 1463 arg1 = multi_pw_aff(arg1) 1464 except: 1465 return multi_union_pw_aff(arg0).min(arg1) 1466 ctx = arg0.ctx 1467 res = isl.isl_multi_pw_aff_min(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1468 obj = multi_pw_aff(ctx=ctx, ptr=res) 1469 return obj 1470 def min_multi_val(arg0): 1471 try: 1472 if not arg0.__class__ is multi_pw_aff: 1473 arg0 = multi_pw_aff(arg0) 1474 except: 1475 raise 1476 ctx = arg0.ctx 1477 res = isl.isl_multi_pw_aff_min_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1478 obj = multi_val(ctx=ctx, ptr=res) 1479 return obj 1480 def neg(arg0): 1481 try: 1482 if not arg0.__class__ is multi_pw_aff: 1483 arg0 = multi_pw_aff(arg0) 1484 except: 1485 raise 1486 ctx = arg0.ctx 1487 res = isl.isl_multi_pw_aff_neg(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1488 obj = multi_pw_aff(ctx=ctx, ptr=res) 1489 return obj 1490 def plain_is_equal(arg0, arg1): 1491 try: 1492 if not arg0.__class__ is multi_pw_aff: 1493 arg0 = multi_pw_aff(arg0) 1494 except: 1495 raise 1496 try: 1497 if not arg1.__class__ is multi_pw_aff: 1498 arg1 = multi_pw_aff(arg1) 1499 except: 1500 return multi_union_pw_aff(arg0).plain_is_equal(arg1) 1501 ctx = arg0.ctx 1502 res = isl.isl_multi_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 1503 if res < 0: 1504 raise 1505 return bool(res) 1506 def product(arg0, arg1): 1507 try: 1508 if not arg0.__class__ is multi_pw_aff: 1509 arg0 = multi_pw_aff(arg0) 1510 except: 1511 raise 1512 try: 1513 if not arg1.__class__ is multi_pw_aff: 1514 arg1 = multi_pw_aff(arg1) 1515 except: 1516 return multi_union_pw_aff(arg0).product(arg1) 1517 ctx = arg0.ctx 1518 res = isl.isl_multi_pw_aff_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1519 obj = multi_pw_aff(ctx=ctx, ptr=res) 1520 return obj 1521 def pullback(*args): 1522 if len(args) == 2 and args[1].__class__ is multi_aff: 1523 ctx = args[0].ctx 1524 res = isl.isl_multi_pw_aff_pullback_multi_aff(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 1525 obj = multi_pw_aff(ctx=ctx, ptr=res) 1526 return obj 1527 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 1528 ctx = args[0].ctx 1529 res = isl.isl_multi_pw_aff_pullback_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 1530 obj = multi_pw_aff(ctx=ctx, ptr=res) 1531 return obj 1532 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 1533 ctx = args[0].ctx 1534 res = isl.isl_multi_pw_aff_pullback_pw_multi_aff(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 1535 obj = multi_pw_aff(ctx=ctx, ptr=res) 1536 return obj 1537 raise Error 1538 def range_product(arg0, arg1): 1539 try: 1540 if not arg0.__class__ is multi_pw_aff: 1541 arg0 = multi_pw_aff(arg0) 1542 except: 1543 raise 1544 try: 1545 if not arg1.__class__ is multi_pw_aff: 1546 arg1 = multi_pw_aff(arg1) 1547 except: 1548 return multi_union_pw_aff(arg0).range_product(arg1) 1549 ctx = arg0.ctx 1550 res = isl.isl_multi_pw_aff_range_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1551 obj = multi_pw_aff(ctx=ctx, ptr=res) 1552 return obj 1553 def scale(*args): 1554 if len(args) == 2 and args[1].__class__ is multi_val: 1555 ctx = args[0].ctx 1556 res = isl.isl_multi_pw_aff_scale_multi_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 1557 obj = multi_pw_aff(ctx=ctx, ptr=res) 1558 return obj 1559 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1560 args = list(args) 1561 try: 1562 if not args[1].__class__ is val: 1563 args[1] = val(args[1]) 1564 except: 1565 raise 1566 ctx = args[0].ctx 1567 res = isl.isl_multi_pw_aff_scale_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 1568 obj = multi_pw_aff(ctx=ctx, ptr=res) 1569 return obj 1570 raise Error 1571 def scale_down(*args): 1572 if len(args) == 2 and args[1].__class__ is multi_val: 1573 ctx = args[0].ctx 1574 res = isl.isl_multi_pw_aff_scale_down_multi_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 1575 obj = multi_pw_aff(ctx=ctx, ptr=res) 1576 return obj 1577 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1578 args = list(args) 1579 try: 1580 if not args[1].__class__ is val: 1581 args[1] = val(args[1]) 1582 except: 1583 raise 1584 ctx = args[0].ctx 1585 res = isl.isl_multi_pw_aff_scale_down_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 1586 obj = multi_pw_aff(ctx=ctx, ptr=res) 1587 return obj 1588 raise Error 1589 def set_at(arg0, arg1, arg2): 1590 try: 1591 if not arg0.__class__ is multi_pw_aff: 1592 arg0 = multi_pw_aff(arg0) 1593 except: 1594 raise 1595 try: 1596 if not arg2.__class__ is pw_aff: 1597 arg2 = pw_aff(arg2) 1598 except: 1599 return multi_union_pw_aff(arg0).set_at(arg1, arg2) 1600 ctx = arg0.ctx 1601 res = isl.isl_multi_pw_aff_set_at(isl.isl_multi_pw_aff_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 1602 obj = multi_pw_aff(ctx=ctx, ptr=res) 1603 return obj 1604 def size(arg0): 1605 try: 1606 if not arg0.__class__ is multi_pw_aff: 1607 arg0 = multi_pw_aff(arg0) 1608 except: 1609 raise 1610 ctx = arg0.ctx 1611 res = isl.isl_multi_pw_aff_size(arg0.ptr) 1612 if res < 0: 1613 raise 1614 return int(res) 1615 def sub(arg0, arg1): 1616 try: 1617 if not arg0.__class__ is multi_pw_aff: 1618 arg0 = multi_pw_aff(arg0) 1619 except: 1620 raise 1621 try: 1622 if not arg1.__class__ is multi_pw_aff: 1623 arg1 = multi_pw_aff(arg1) 1624 except: 1625 return multi_union_pw_aff(arg0).sub(arg1) 1626 ctx = arg0.ctx 1627 res = isl.isl_multi_pw_aff_sub(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1628 obj = multi_pw_aff(ctx=ctx, ptr=res) 1629 return obj 1630 def unbind_params_insert_domain(arg0, arg1): 1631 try: 1632 if not arg0.__class__ is multi_pw_aff: 1633 arg0 = multi_pw_aff(arg0) 1634 except: 1635 raise 1636 try: 1637 if not arg1.__class__ is multi_id: 1638 arg1 = multi_id(arg1) 1639 except: 1640 return multi_union_pw_aff(arg0).unbind_params_insert_domain(arg1) 1641 ctx = arg0.ctx 1642 res = isl.isl_multi_pw_aff_unbind_params_insert_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1643 obj = multi_pw_aff(ctx=ctx, ptr=res) 1644 return obj 1645 def union_add(arg0, arg1): 1646 try: 1647 if not arg0.__class__ is multi_pw_aff: 1648 arg0 = multi_pw_aff(arg0) 1649 except: 1650 raise 1651 try: 1652 if not arg1.__class__ is multi_pw_aff: 1653 arg1 = multi_pw_aff(arg1) 1654 except: 1655 return multi_union_pw_aff(arg0).union_add(arg1) 1656 ctx = arg0.ctx 1657 res = isl.isl_multi_pw_aff_union_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1658 obj = multi_pw_aff(ctx=ctx, ptr=res) 1659 return obj 1660 @staticmethod 1661 def zero(arg0): 1662 try: 1663 if not arg0.__class__ is space: 1664 arg0 = space(arg0) 1665 except: 1666 raise 1667 ctx = arg0.ctx 1668 res = isl.isl_multi_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 1669 obj = multi_pw_aff(ctx=ctx, ptr=res) 1670 return obj 1671 1672isl.isl_multi_pw_aff_from_aff.restype = c_void_p 1673isl.isl_multi_pw_aff_from_aff.argtypes = [c_void_p] 1674isl.isl_multi_pw_aff_from_multi_aff.restype = c_void_p 1675isl.isl_multi_pw_aff_from_multi_aff.argtypes = [c_void_p] 1676isl.isl_multi_pw_aff_from_pw_aff.restype = c_void_p 1677isl.isl_multi_pw_aff_from_pw_aff.argtypes = [c_void_p] 1678isl.isl_multi_pw_aff_from_pw_aff_list.restype = c_void_p 1679isl.isl_multi_pw_aff_from_pw_aff_list.argtypes = [c_void_p, c_void_p] 1680isl.isl_multi_pw_aff_from_pw_multi_aff.restype = c_void_p 1681isl.isl_multi_pw_aff_from_pw_multi_aff.argtypes = [c_void_p] 1682isl.isl_multi_pw_aff_read_from_str.restype = c_void_p 1683isl.isl_multi_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1684isl.isl_multi_pw_aff_add.restype = c_void_p 1685isl.isl_multi_pw_aff_add.argtypes = [c_void_p, c_void_p] 1686isl.isl_multi_pw_aff_add_constant_multi_val.restype = c_void_p 1687isl.isl_multi_pw_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 1688isl.isl_multi_pw_aff_add_constant_val.restype = c_void_p 1689isl.isl_multi_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 1690isl.isl_multi_pw_aff_bind.restype = c_void_p 1691isl.isl_multi_pw_aff_bind.argtypes = [c_void_p, c_void_p] 1692isl.isl_multi_pw_aff_bind_domain.restype = c_void_p 1693isl.isl_multi_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 1694isl.isl_multi_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 1695isl.isl_multi_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 1696isl.isl_multi_pw_aff_coalesce.restype = c_void_p 1697isl.isl_multi_pw_aff_coalesce.argtypes = [c_void_p] 1698isl.isl_multi_pw_aff_domain.restype = c_void_p 1699isl.isl_multi_pw_aff_domain.argtypes = [c_void_p] 1700isl.isl_multi_pw_aff_flat_range_product.restype = c_void_p 1701isl.isl_multi_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 1702isl.isl_multi_pw_aff_get_at.restype = c_void_p 1703isl.isl_multi_pw_aff_get_at.argtypes = [c_void_p, c_int] 1704isl.isl_multi_pw_aff_get_list.restype = c_void_p 1705isl.isl_multi_pw_aff_get_list.argtypes = [c_void_p] 1706isl.isl_multi_pw_aff_get_space.restype = c_void_p 1707isl.isl_multi_pw_aff_get_space.argtypes = [c_void_p] 1708isl.isl_multi_pw_aff_gist.restype = c_void_p 1709isl.isl_multi_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1710isl.isl_multi_pw_aff_identity_multi_pw_aff.restype = c_void_p 1711isl.isl_multi_pw_aff_identity_multi_pw_aff.argtypes = [c_void_p] 1712isl.isl_multi_pw_aff_identity_on_domain_space.restype = c_void_p 1713isl.isl_multi_pw_aff_identity_on_domain_space.argtypes = [c_void_p] 1714isl.isl_multi_pw_aff_insert_domain.restype = c_void_p 1715isl.isl_multi_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 1716isl.isl_multi_pw_aff_intersect_domain.restype = c_void_p 1717isl.isl_multi_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 1718isl.isl_multi_pw_aff_intersect_params.restype = c_void_p 1719isl.isl_multi_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1720isl.isl_multi_pw_aff_involves_nan.argtypes = [c_void_p] 1721isl.isl_multi_pw_aff_involves_param_id.argtypes = [c_void_p, c_void_p] 1722isl.isl_multi_pw_aff_involves_param_id_list.argtypes = [c_void_p, c_void_p] 1723isl.isl_multi_pw_aff_max.restype = c_void_p 1724isl.isl_multi_pw_aff_max.argtypes = [c_void_p, c_void_p] 1725isl.isl_multi_pw_aff_max_multi_val.restype = c_void_p 1726isl.isl_multi_pw_aff_max_multi_val.argtypes = [c_void_p] 1727isl.isl_multi_pw_aff_min.restype = c_void_p 1728isl.isl_multi_pw_aff_min.argtypes = [c_void_p, c_void_p] 1729isl.isl_multi_pw_aff_min_multi_val.restype = c_void_p 1730isl.isl_multi_pw_aff_min_multi_val.argtypes = [c_void_p] 1731isl.isl_multi_pw_aff_neg.restype = c_void_p 1732isl.isl_multi_pw_aff_neg.argtypes = [c_void_p] 1733isl.isl_multi_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 1734isl.isl_multi_pw_aff_product.restype = c_void_p 1735isl.isl_multi_pw_aff_product.argtypes = [c_void_p, c_void_p] 1736isl.isl_multi_pw_aff_pullback_multi_aff.restype = c_void_p 1737isl.isl_multi_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 1738isl.isl_multi_pw_aff_pullback_multi_pw_aff.restype = c_void_p 1739isl.isl_multi_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 1740isl.isl_multi_pw_aff_pullback_pw_multi_aff.restype = c_void_p 1741isl.isl_multi_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1742isl.isl_multi_pw_aff_range_product.restype = c_void_p 1743isl.isl_multi_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 1744isl.isl_multi_pw_aff_scale_multi_val.restype = c_void_p 1745isl.isl_multi_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 1746isl.isl_multi_pw_aff_scale_val.restype = c_void_p 1747isl.isl_multi_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 1748isl.isl_multi_pw_aff_scale_down_multi_val.restype = c_void_p 1749isl.isl_multi_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 1750isl.isl_multi_pw_aff_scale_down_val.restype = c_void_p 1751isl.isl_multi_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 1752isl.isl_multi_pw_aff_set_at.restype = c_void_p 1753isl.isl_multi_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 1754isl.isl_multi_pw_aff_size.argtypes = [c_void_p] 1755isl.isl_multi_pw_aff_sub.restype = c_void_p 1756isl.isl_multi_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1757isl.isl_multi_pw_aff_unbind_params_insert_domain.restype = c_void_p 1758isl.isl_multi_pw_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 1759isl.isl_multi_pw_aff_union_add.restype = c_void_p 1760isl.isl_multi_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1761isl.isl_multi_pw_aff_zero.restype = c_void_p 1762isl.isl_multi_pw_aff_zero.argtypes = [c_void_p] 1763isl.isl_multi_pw_aff_copy.restype = c_void_p 1764isl.isl_multi_pw_aff_copy.argtypes = [c_void_p] 1765isl.isl_multi_pw_aff_free.restype = c_void_p 1766isl.isl_multi_pw_aff_free.argtypes = [c_void_p] 1767isl.isl_multi_pw_aff_to_str.restype = POINTER(c_char) 1768isl.isl_multi_pw_aff_to_str.argtypes = [c_void_p] 1769 1770class pw_multi_aff(union_pw_multi_aff, multi_pw_aff): 1771 def __init__(self, *args, **keywords): 1772 if "ptr" in keywords: 1773 self.ctx = keywords["ctx"] 1774 self.ptr = keywords["ptr"] 1775 return 1776 if len(args) == 1 and args[0].__class__ is multi_aff: 1777 self.ctx = Context.getDefaultInstance() 1778 self.ptr = isl.isl_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 1779 return 1780 if len(args) == 1 and args[0].__class__ is pw_aff: 1781 self.ctx = Context.getDefaultInstance() 1782 self.ptr = isl.isl_pw_multi_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1783 return 1784 if len(args) == 1 and type(args[0]) == str: 1785 self.ctx = Context.getDefaultInstance() 1786 self.ptr = isl.isl_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1787 return 1788 raise Error 1789 def __del__(self): 1790 if hasattr(self, 'ptr'): 1791 isl.isl_pw_multi_aff_free(self.ptr) 1792 def __str__(arg0): 1793 try: 1794 if not arg0.__class__ is pw_multi_aff: 1795 arg0 = pw_multi_aff(arg0) 1796 except: 1797 raise 1798 ptr = isl.isl_pw_multi_aff_to_str(arg0.ptr) 1799 res = cast(ptr, c_char_p).value.decode('ascii') 1800 libc.free(ptr) 1801 return res 1802 def __repr__(self): 1803 s = str(self) 1804 if '"' in s: 1805 return 'isl.pw_multi_aff("""%s""")' % s 1806 else: 1807 return 'isl.pw_multi_aff("%s")' % s 1808 def add(arg0, arg1): 1809 try: 1810 if not arg0.__class__ is pw_multi_aff: 1811 arg0 = pw_multi_aff(arg0) 1812 except: 1813 raise 1814 try: 1815 if not arg1.__class__ is pw_multi_aff: 1816 arg1 = pw_multi_aff(arg1) 1817 except: 1818 return union_pw_multi_aff(arg0).add(arg1) 1819 ctx = arg0.ctx 1820 res = isl.isl_pw_multi_aff_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 1821 obj = pw_multi_aff(ctx=ctx, ptr=res) 1822 return obj 1823 def add_constant(*args): 1824 if len(args) == 2 and args[1].__class__ is multi_val: 1825 ctx = args[0].ctx 1826 res = isl.isl_pw_multi_aff_add_constant_multi_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 1827 obj = pw_multi_aff(ctx=ctx, ptr=res) 1828 return obj 1829 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1830 args = list(args) 1831 try: 1832 if not args[1].__class__ is val: 1833 args[1] = val(args[1]) 1834 except: 1835 raise 1836 ctx = args[0].ctx 1837 res = isl.isl_pw_multi_aff_add_constant_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 1838 obj = pw_multi_aff(ctx=ctx, ptr=res) 1839 return obj 1840 raise Error 1841 def as_multi_aff(arg0): 1842 try: 1843 if not arg0.__class__ is pw_multi_aff: 1844 arg0 = pw_multi_aff(arg0) 1845 except: 1846 raise 1847 ctx = arg0.ctx 1848 res = isl.isl_pw_multi_aff_as_multi_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 1849 obj = multi_aff(ctx=ctx, ptr=res) 1850 return obj 1851 def bind_domain(arg0, arg1): 1852 try: 1853 if not arg0.__class__ is pw_multi_aff: 1854 arg0 = pw_multi_aff(arg0) 1855 except: 1856 raise 1857 try: 1858 if not arg1.__class__ is multi_id: 1859 arg1 = multi_id(arg1) 1860 except: 1861 return union_pw_multi_aff(arg0).bind_domain(arg1) 1862 ctx = arg0.ctx 1863 res = isl.isl_pw_multi_aff_bind_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1864 obj = pw_multi_aff(ctx=ctx, ptr=res) 1865 return obj 1866 def bind_domain_wrapped_domain(arg0, arg1): 1867 try: 1868 if not arg0.__class__ is pw_multi_aff: 1869 arg0 = pw_multi_aff(arg0) 1870 except: 1871 raise 1872 try: 1873 if not arg1.__class__ is multi_id: 1874 arg1 = multi_id(arg1) 1875 except: 1876 return union_pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 1877 ctx = arg0.ctx 1878 res = isl.isl_pw_multi_aff_bind_domain_wrapped_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1879 obj = pw_multi_aff(ctx=ctx, ptr=res) 1880 return obj 1881 def coalesce(arg0): 1882 try: 1883 if not arg0.__class__ is pw_multi_aff: 1884 arg0 = pw_multi_aff(arg0) 1885 except: 1886 raise 1887 ctx = arg0.ctx 1888 res = isl.isl_pw_multi_aff_coalesce(isl.isl_pw_multi_aff_copy(arg0.ptr)) 1889 obj = pw_multi_aff(ctx=ctx, ptr=res) 1890 return obj 1891 def domain(arg0): 1892 try: 1893 if not arg0.__class__ is pw_multi_aff: 1894 arg0 = pw_multi_aff(arg0) 1895 except: 1896 raise 1897 ctx = arg0.ctx 1898 res = isl.isl_pw_multi_aff_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 1899 obj = set(ctx=ctx, ptr=res) 1900 return obj 1901 @staticmethod 1902 def domain_map(arg0): 1903 try: 1904 if not arg0.__class__ is space: 1905 arg0 = space(arg0) 1906 except: 1907 raise 1908 ctx = arg0.ctx 1909 res = isl.isl_pw_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 1910 obj = pw_multi_aff(ctx=ctx, ptr=res) 1911 return obj 1912 def flat_range_product(arg0, arg1): 1913 try: 1914 if not arg0.__class__ is pw_multi_aff: 1915 arg0 = pw_multi_aff(arg0) 1916 except: 1917 raise 1918 try: 1919 if not arg1.__class__ is pw_multi_aff: 1920 arg1 = pw_multi_aff(arg1) 1921 except: 1922 return union_pw_multi_aff(arg0).flat_range_product(arg1) 1923 ctx = arg0.ctx 1924 res = isl.isl_pw_multi_aff_flat_range_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 1925 obj = pw_multi_aff(ctx=ctx, ptr=res) 1926 return obj 1927 def foreach_piece(arg0, arg1): 1928 try: 1929 if not arg0.__class__ is pw_multi_aff: 1930 arg0 = pw_multi_aff(arg0) 1931 except: 1932 raise 1933 exc_info = [None] 1934 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 1935 def cb_func(cb_arg0, cb_arg1, cb_arg2): 1936 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 1937 cb_arg1 = multi_aff(ctx=arg0.ctx, ptr=(cb_arg1)) 1938 try: 1939 arg1(cb_arg0, cb_arg1) 1940 except: 1941 import sys 1942 exc_info[0] = sys.exc_info() 1943 return -1 1944 return 0 1945 cb = fn(cb_func) 1946 ctx = arg0.ctx 1947 res = isl.isl_pw_multi_aff_foreach_piece(arg0.ptr, cb, None) 1948 if exc_info[0] != None: 1949 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 1950 if res < 0: 1951 raise 1952 def space(arg0): 1953 try: 1954 if not arg0.__class__ is pw_multi_aff: 1955 arg0 = pw_multi_aff(arg0) 1956 except: 1957 raise 1958 ctx = arg0.ctx 1959 res = isl.isl_pw_multi_aff_get_space(arg0.ptr) 1960 obj = space(ctx=ctx, ptr=res) 1961 return obj 1962 def get_space(arg0): 1963 return arg0.space() 1964 def gist(arg0, arg1): 1965 try: 1966 if not arg0.__class__ is pw_multi_aff: 1967 arg0 = pw_multi_aff(arg0) 1968 except: 1969 raise 1970 try: 1971 if not arg1.__class__ is set: 1972 arg1 = set(arg1) 1973 except: 1974 return union_pw_multi_aff(arg0).gist(arg1) 1975 ctx = arg0.ctx 1976 res = isl.isl_pw_multi_aff_gist(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1977 obj = pw_multi_aff(ctx=ctx, ptr=res) 1978 return obj 1979 @staticmethod 1980 def identity_on_domain(*args): 1981 if len(args) == 1 and args[0].__class__ is space: 1982 ctx = args[0].ctx 1983 res = isl.isl_pw_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 1984 obj = pw_multi_aff(ctx=ctx, ptr=res) 1985 return obj 1986 raise Error 1987 def insert_domain(arg0, arg1): 1988 try: 1989 if not arg0.__class__ is pw_multi_aff: 1990 arg0 = pw_multi_aff(arg0) 1991 except: 1992 raise 1993 try: 1994 if not arg1.__class__ is space: 1995 arg1 = space(arg1) 1996 except: 1997 return union_pw_multi_aff(arg0).insert_domain(arg1) 1998 ctx = arg0.ctx 1999 res = isl.isl_pw_multi_aff_insert_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 2000 obj = pw_multi_aff(ctx=ctx, ptr=res) 2001 return obj 2002 def intersect_domain(arg0, arg1): 2003 try: 2004 if not arg0.__class__ is pw_multi_aff: 2005 arg0 = pw_multi_aff(arg0) 2006 except: 2007 raise 2008 try: 2009 if not arg1.__class__ is set: 2010 arg1 = set(arg1) 2011 except: 2012 return union_pw_multi_aff(arg0).intersect_domain(arg1) 2013 ctx = arg0.ctx 2014 res = isl.isl_pw_multi_aff_intersect_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2015 obj = pw_multi_aff(ctx=ctx, ptr=res) 2016 return obj 2017 def intersect_params(arg0, arg1): 2018 try: 2019 if not arg0.__class__ is pw_multi_aff: 2020 arg0 = pw_multi_aff(arg0) 2021 except: 2022 raise 2023 try: 2024 if not arg1.__class__ is set: 2025 arg1 = set(arg1) 2026 except: 2027 return union_pw_multi_aff(arg0).intersect_params(arg1) 2028 ctx = arg0.ctx 2029 res = isl.isl_pw_multi_aff_intersect_params(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2030 obj = pw_multi_aff(ctx=ctx, ptr=res) 2031 return obj 2032 def involves_locals(arg0): 2033 try: 2034 if not arg0.__class__ is pw_multi_aff: 2035 arg0 = pw_multi_aff(arg0) 2036 except: 2037 raise 2038 ctx = arg0.ctx 2039 res = isl.isl_pw_multi_aff_involves_locals(arg0.ptr) 2040 if res < 0: 2041 raise 2042 return bool(res) 2043 def isa_multi_aff(arg0): 2044 try: 2045 if not arg0.__class__ is pw_multi_aff: 2046 arg0 = pw_multi_aff(arg0) 2047 except: 2048 raise 2049 ctx = arg0.ctx 2050 res = isl.isl_pw_multi_aff_isa_multi_aff(arg0.ptr) 2051 if res < 0: 2052 raise 2053 return bool(res) 2054 def max_multi_val(arg0): 2055 try: 2056 if not arg0.__class__ is pw_multi_aff: 2057 arg0 = pw_multi_aff(arg0) 2058 except: 2059 raise 2060 ctx = arg0.ctx 2061 res = isl.isl_pw_multi_aff_max_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2062 obj = multi_val(ctx=ctx, ptr=res) 2063 return obj 2064 def min_multi_val(arg0): 2065 try: 2066 if not arg0.__class__ is pw_multi_aff: 2067 arg0 = pw_multi_aff(arg0) 2068 except: 2069 raise 2070 ctx = arg0.ctx 2071 res = isl.isl_pw_multi_aff_min_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2072 obj = multi_val(ctx=ctx, ptr=res) 2073 return obj 2074 def n_piece(arg0): 2075 try: 2076 if not arg0.__class__ is pw_multi_aff: 2077 arg0 = pw_multi_aff(arg0) 2078 except: 2079 raise 2080 ctx = arg0.ctx 2081 res = isl.isl_pw_multi_aff_n_piece(arg0.ptr) 2082 if res < 0: 2083 raise 2084 return int(res) 2085 def preimage_domain_wrapped_domain(*args): 2086 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2087 ctx = args[0].ctx 2088 res = isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 2089 obj = pw_multi_aff(ctx=ctx, ptr=res) 2090 return obj 2091 raise Error 2092 def product(arg0, arg1): 2093 try: 2094 if not arg0.__class__ is pw_multi_aff: 2095 arg0 = pw_multi_aff(arg0) 2096 except: 2097 raise 2098 try: 2099 if not arg1.__class__ is pw_multi_aff: 2100 arg1 = pw_multi_aff(arg1) 2101 except: 2102 return union_pw_multi_aff(arg0).product(arg1) 2103 ctx = arg0.ctx 2104 res = isl.isl_pw_multi_aff_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2105 obj = pw_multi_aff(ctx=ctx, ptr=res) 2106 return obj 2107 def pullback(*args): 2108 if len(args) == 2 and args[1].__class__ is multi_aff: 2109 ctx = args[0].ctx 2110 res = isl.isl_pw_multi_aff_pullback_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 2111 obj = pw_multi_aff(ctx=ctx, ptr=res) 2112 return obj 2113 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2114 ctx = args[0].ctx 2115 res = isl.isl_pw_multi_aff_pullback_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 2116 obj = pw_multi_aff(ctx=ctx, ptr=res) 2117 return obj 2118 raise Error 2119 def range_factor_domain(arg0): 2120 try: 2121 if not arg0.__class__ is pw_multi_aff: 2122 arg0 = pw_multi_aff(arg0) 2123 except: 2124 raise 2125 ctx = arg0.ctx 2126 res = isl.isl_pw_multi_aff_range_factor_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2127 obj = pw_multi_aff(ctx=ctx, ptr=res) 2128 return obj 2129 def range_factor_range(arg0): 2130 try: 2131 if not arg0.__class__ is pw_multi_aff: 2132 arg0 = pw_multi_aff(arg0) 2133 except: 2134 raise 2135 ctx = arg0.ctx 2136 res = isl.isl_pw_multi_aff_range_factor_range(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2137 obj = pw_multi_aff(ctx=ctx, ptr=res) 2138 return obj 2139 @staticmethod 2140 def range_map(arg0): 2141 try: 2142 if not arg0.__class__ is space: 2143 arg0 = space(arg0) 2144 except: 2145 raise 2146 ctx = arg0.ctx 2147 res = isl.isl_pw_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 2148 obj = pw_multi_aff(ctx=ctx, ptr=res) 2149 return obj 2150 def range_product(arg0, arg1): 2151 try: 2152 if not arg0.__class__ is pw_multi_aff: 2153 arg0 = pw_multi_aff(arg0) 2154 except: 2155 raise 2156 try: 2157 if not arg1.__class__ is pw_multi_aff: 2158 arg1 = pw_multi_aff(arg1) 2159 except: 2160 return union_pw_multi_aff(arg0).range_product(arg1) 2161 ctx = arg0.ctx 2162 res = isl.isl_pw_multi_aff_range_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2163 obj = pw_multi_aff(ctx=ctx, ptr=res) 2164 return obj 2165 def scale(*args): 2166 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2167 args = list(args) 2168 try: 2169 if not args[1].__class__ is val: 2170 args[1] = val(args[1]) 2171 except: 2172 raise 2173 ctx = args[0].ctx 2174 res = isl.isl_pw_multi_aff_scale_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2175 obj = pw_multi_aff(ctx=ctx, ptr=res) 2176 return obj 2177 raise Error 2178 def scale_down(*args): 2179 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2180 args = list(args) 2181 try: 2182 if not args[1].__class__ is val: 2183 args[1] = val(args[1]) 2184 except: 2185 raise 2186 ctx = args[0].ctx 2187 res = isl.isl_pw_multi_aff_scale_down_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2188 obj = pw_multi_aff(ctx=ctx, ptr=res) 2189 return obj 2190 raise Error 2191 def sub(arg0, arg1): 2192 try: 2193 if not arg0.__class__ is pw_multi_aff: 2194 arg0 = pw_multi_aff(arg0) 2195 except: 2196 raise 2197 try: 2198 if not arg1.__class__ is pw_multi_aff: 2199 arg1 = pw_multi_aff(arg1) 2200 except: 2201 return union_pw_multi_aff(arg0).sub(arg1) 2202 ctx = arg0.ctx 2203 res = isl.isl_pw_multi_aff_sub(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2204 obj = pw_multi_aff(ctx=ctx, ptr=res) 2205 return obj 2206 def subtract_domain(arg0, arg1): 2207 try: 2208 if not arg0.__class__ is pw_multi_aff: 2209 arg0 = pw_multi_aff(arg0) 2210 except: 2211 raise 2212 try: 2213 if not arg1.__class__ is set: 2214 arg1 = set(arg1) 2215 except: 2216 return union_pw_multi_aff(arg0).subtract_domain(arg1) 2217 ctx = arg0.ctx 2218 res = isl.isl_pw_multi_aff_subtract_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2219 obj = pw_multi_aff(ctx=ctx, ptr=res) 2220 return obj 2221 def union_add(arg0, arg1): 2222 try: 2223 if not arg0.__class__ is pw_multi_aff: 2224 arg0 = pw_multi_aff(arg0) 2225 except: 2226 raise 2227 try: 2228 if not arg1.__class__ is pw_multi_aff: 2229 arg1 = pw_multi_aff(arg1) 2230 except: 2231 return union_pw_multi_aff(arg0).union_add(arg1) 2232 ctx = arg0.ctx 2233 res = isl.isl_pw_multi_aff_union_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2234 obj = pw_multi_aff(ctx=ctx, ptr=res) 2235 return obj 2236 @staticmethod 2237 def zero(arg0): 2238 try: 2239 if not arg0.__class__ is space: 2240 arg0 = space(arg0) 2241 except: 2242 raise 2243 ctx = arg0.ctx 2244 res = isl.isl_pw_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 2245 obj = pw_multi_aff(ctx=ctx, ptr=res) 2246 return obj 2247 2248isl.isl_pw_multi_aff_from_multi_aff.restype = c_void_p 2249isl.isl_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 2250isl.isl_pw_multi_aff_from_pw_aff.restype = c_void_p 2251isl.isl_pw_multi_aff_from_pw_aff.argtypes = [c_void_p] 2252isl.isl_pw_multi_aff_read_from_str.restype = c_void_p 2253isl.isl_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 2254isl.isl_pw_multi_aff_add.restype = c_void_p 2255isl.isl_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 2256isl.isl_pw_multi_aff_add_constant_multi_val.restype = c_void_p 2257isl.isl_pw_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 2258isl.isl_pw_multi_aff_add_constant_val.restype = c_void_p 2259isl.isl_pw_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 2260isl.isl_pw_multi_aff_as_multi_aff.restype = c_void_p 2261isl.isl_pw_multi_aff_as_multi_aff.argtypes = [c_void_p] 2262isl.isl_pw_multi_aff_bind_domain.restype = c_void_p 2263isl.isl_pw_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 2264isl.isl_pw_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 2265isl.isl_pw_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 2266isl.isl_pw_multi_aff_coalesce.restype = c_void_p 2267isl.isl_pw_multi_aff_coalesce.argtypes = [c_void_p] 2268isl.isl_pw_multi_aff_domain.restype = c_void_p 2269isl.isl_pw_multi_aff_domain.argtypes = [c_void_p] 2270isl.isl_pw_multi_aff_domain_map.restype = c_void_p 2271isl.isl_pw_multi_aff_domain_map.argtypes = [c_void_p] 2272isl.isl_pw_multi_aff_flat_range_product.restype = c_void_p 2273isl.isl_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 2274isl.isl_pw_multi_aff_foreach_piece.argtypes = [c_void_p, c_void_p, c_void_p] 2275isl.isl_pw_multi_aff_get_space.restype = c_void_p 2276isl.isl_pw_multi_aff_get_space.argtypes = [c_void_p] 2277isl.isl_pw_multi_aff_gist.restype = c_void_p 2278isl.isl_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 2279isl.isl_pw_multi_aff_identity_on_domain_space.restype = c_void_p 2280isl.isl_pw_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 2281isl.isl_pw_multi_aff_insert_domain.restype = c_void_p 2282isl.isl_pw_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 2283isl.isl_pw_multi_aff_intersect_domain.restype = c_void_p 2284isl.isl_pw_multi_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 2285isl.isl_pw_multi_aff_intersect_params.restype = c_void_p 2286isl.isl_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 2287isl.isl_pw_multi_aff_involves_locals.argtypes = [c_void_p] 2288isl.isl_pw_multi_aff_isa_multi_aff.argtypes = [c_void_p] 2289isl.isl_pw_multi_aff_max_multi_val.restype = c_void_p 2290isl.isl_pw_multi_aff_max_multi_val.argtypes = [c_void_p] 2291isl.isl_pw_multi_aff_min_multi_val.restype = c_void_p 2292isl.isl_pw_multi_aff_min_multi_val.argtypes = [c_void_p] 2293isl.isl_pw_multi_aff_n_piece.argtypes = [c_void_p] 2294isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.restype = c_void_p 2295isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2296isl.isl_pw_multi_aff_product.restype = c_void_p 2297isl.isl_pw_multi_aff_product.argtypes = [c_void_p, c_void_p] 2298isl.isl_pw_multi_aff_pullback_multi_aff.restype = c_void_p 2299isl.isl_pw_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 2300isl.isl_pw_multi_aff_pullback_pw_multi_aff.restype = c_void_p 2301isl.isl_pw_multi_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2302isl.isl_pw_multi_aff_range_factor_domain.restype = c_void_p 2303isl.isl_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 2304isl.isl_pw_multi_aff_range_factor_range.restype = c_void_p 2305isl.isl_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 2306isl.isl_pw_multi_aff_range_map.restype = c_void_p 2307isl.isl_pw_multi_aff_range_map.argtypes = [c_void_p] 2308isl.isl_pw_multi_aff_range_product.restype = c_void_p 2309isl.isl_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 2310isl.isl_pw_multi_aff_scale_val.restype = c_void_p 2311isl.isl_pw_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 2312isl.isl_pw_multi_aff_scale_down_val.restype = c_void_p 2313isl.isl_pw_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 2314isl.isl_pw_multi_aff_sub.restype = c_void_p 2315isl.isl_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 2316isl.isl_pw_multi_aff_subtract_domain.restype = c_void_p 2317isl.isl_pw_multi_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 2318isl.isl_pw_multi_aff_union_add.restype = c_void_p 2319isl.isl_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 2320isl.isl_pw_multi_aff_zero.restype = c_void_p 2321isl.isl_pw_multi_aff_zero.argtypes = [c_void_p] 2322isl.isl_pw_multi_aff_copy.restype = c_void_p 2323isl.isl_pw_multi_aff_copy.argtypes = [c_void_p] 2324isl.isl_pw_multi_aff_free.restype = c_void_p 2325isl.isl_pw_multi_aff_free.argtypes = [c_void_p] 2326isl.isl_pw_multi_aff_to_str.restype = POINTER(c_char) 2327isl.isl_pw_multi_aff_to_str.argtypes = [c_void_p] 2328 2329class pw_aff(union_pw_aff, pw_multi_aff, multi_pw_aff): 2330 def __init__(self, *args, **keywords): 2331 if "ptr" in keywords: 2332 self.ctx = keywords["ctx"] 2333 self.ptr = keywords["ptr"] 2334 return 2335 if len(args) == 1 and args[0].__class__ is aff: 2336 self.ctx = Context.getDefaultInstance() 2337 self.ptr = isl.isl_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 2338 return 2339 if len(args) == 1 and type(args[0]) == str: 2340 self.ctx = Context.getDefaultInstance() 2341 self.ptr = isl.isl_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 2342 return 2343 raise Error 2344 def __del__(self): 2345 if hasattr(self, 'ptr'): 2346 isl.isl_pw_aff_free(self.ptr) 2347 def __str__(arg0): 2348 try: 2349 if not arg0.__class__ is pw_aff: 2350 arg0 = pw_aff(arg0) 2351 except: 2352 raise 2353 ptr = isl.isl_pw_aff_to_str(arg0.ptr) 2354 res = cast(ptr, c_char_p).value.decode('ascii') 2355 libc.free(ptr) 2356 return res 2357 def __repr__(self): 2358 s = str(self) 2359 if '"' in s: 2360 return 'isl.pw_aff("""%s""")' % s 2361 else: 2362 return 'isl.pw_aff("%s")' % s 2363 def add(arg0, arg1): 2364 try: 2365 if not arg0.__class__ is pw_aff: 2366 arg0 = pw_aff(arg0) 2367 except: 2368 raise 2369 try: 2370 if not arg1.__class__ is pw_aff: 2371 arg1 = pw_aff(arg1) 2372 except: 2373 return union_pw_aff(arg0).add(arg1) 2374 ctx = arg0.ctx 2375 res = isl.isl_pw_aff_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2376 obj = pw_aff(ctx=ctx, ptr=res) 2377 return obj 2378 def add_constant(*args): 2379 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2380 args = list(args) 2381 try: 2382 if not args[1].__class__ is val: 2383 args[1] = val(args[1]) 2384 except: 2385 raise 2386 ctx = args[0].ctx 2387 res = isl.isl_pw_aff_add_constant_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2388 obj = pw_aff(ctx=ctx, ptr=res) 2389 return obj 2390 raise Error 2391 def as_aff(arg0): 2392 try: 2393 if not arg0.__class__ is pw_aff: 2394 arg0 = pw_aff(arg0) 2395 except: 2396 raise 2397 ctx = arg0.ctx 2398 res = isl.isl_pw_aff_as_aff(isl.isl_pw_aff_copy(arg0.ptr)) 2399 obj = aff(ctx=ctx, ptr=res) 2400 return obj 2401 def bind(*args): 2402 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 2403 args = list(args) 2404 try: 2405 if not args[1].__class__ is id: 2406 args[1] = id(args[1]) 2407 except: 2408 raise 2409 ctx = args[0].ctx 2410 res = isl.isl_pw_aff_bind_id(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 2411 obj = set(ctx=ctx, ptr=res) 2412 return obj 2413 raise Error 2414 def bind_domain(arg0, arg1): 2415 try: 2416 if not arg0.__class__ is pw_aff: 2417 arg0 = pw_aff(arg0) 2418 except: 2419 raise 2420 try: 2421 if not arg1.__class__ is multi_id: 2422 arg1 = multi_id(arg1) 2423 except: 2424 return union_pw_aff(arg0).bind_domain(arg1) 2425 ctx = arg0.ctx 2426 res = isl.isl_pw_aff_bind_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2427 obj = pw_aff(ctx=ctx, ptr=res) 2428 return obj 2429 def bind_domain_wrapped_domain(arg0, arg1): 2430 try: 2431 if not arg0.__class__ is pw_aff: 2432 arg0 = pw_aff(arg0) 2433 except: 2434 raise 2435 try: 2436 if not arg1.__class__ is multi_id: 2437 arg1 = multi_id(arg1) 2438 except: 2439 return union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 2440 ctx = arg0.ctx 2441 res = isl.isl_pw_aff_bind_domain_wrapped_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2442 obj = pw_aff(ctx=ctx, ptr=res) 2443 return obj 2444 def ceil(arg0): 2445 try: 2446 if not arg0.__class__ is pw_aff: 2447 arg0 = pw_aff(arg0) 2448 except: 2449 raise 2450 ctx = arg0.ctx 2451 res = isl.isl_pw_aff_ceil(isl.isl_pw_aff_copy(arg0.ptr)) 2452 obj = pw_aff(ctx=ctx, ptr=res) 2453 return obj 2454 def coalesce(arg0): 2455 try: 2456 if not arg0.__class__ is pw_aff: 2457 arg0 = pw_aff(arg0) 2458 except: 2459 raise 2460 ctx = arg0.ctx 2461 res = isl.isl_pw_aff_coalesce(isl.isl_pw_aff_copy(arg0.ptr)) 2462 obj = pw_aff(ctx=ctx, ptr=res) 2463 return obj 2464 def cond(arg0, arg1, arg2): 2465 try: 2466 if not arg0.__class__ is pw_aff: 2467 arg0 = pw_aff(arg0) 2468 except: 2469 raise 2470 try: 2471 if not arg1.__class__ is pw_aff: 2472 arg1 = pw_aff(arg1) 2473 except: 2474 return union_pw_aff(arg0).cond(arg1, arg2) 2475 try: 2476 if not arg2.__class__ is pw_aff: 2477 arg2 = pw_aff(arg2) 2478 except: 2479 return union_pw_aff(arg0).cond(arg1, arg2) 2480 ctx = arg0.ctx 2481 res = isl.isl_pw_aff_cond(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr), isl.isl_pw_aff_copy(arg2.ptr)) 2482 obj = pw_aff(ctx=ctx, ptr=res) 2483 return obj 2484 def div(arg0, arg1): 2485 try: 2486 if not arg0.__class__ is pw_aff: 2487 arg0 = pw_aff(arg0) 2488 except: 2489 raise 2490 try: 2491 if not arg1.__class__ is pw_aff: 2492 arg1 = pw_aff(arg1) 2493 except: 2494 return union_pw_aff(arg0).div(arg1) 2495 ctx = arg0.ctx 2496 res = isl.isl_pw_aff_div(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2497 obj = pw_aff(ctx=ctx, ptr=res) 2498 return obj 2499 def domain(arg0): 2500 try: 2501 if not arg0.__class__ is pw_aff: 2502 arg0 = pw_aff(arg0) 2503 except: 2504 raise 2505 ctx = arg0.ctx 2506 res = isl.isl_pw_aff_domain(isl.isl_pw_aff_copy(arg0.ptr)) 2507 obj = set(ctx=ctx, ptr=res) 2508 return obj 2509 def eq_set(arg0, arg1): 2510 try: 2511 if not arg0.__class__ is pw_aff: 2512 arg0 = pw_aff(arg0) 2513 except: 2514 raise 2515 try: 2516 if not arg1.__class__ is pw_aff: 2517 arg1 = pw_aff(arg1) 2518 except: 2519 return union_pw_aff(arg0).eq_set(arg1) 2520 ctx = arg0.ctx 2521 res = isl.isl_pw_aff_eq_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2522 obj = set(ctx=ctx, ptr=res) 2523 return obj 2524 def eval(arg0, arg1): 2525 try: 2526 if not arg0.__class__ is pw_aff: 2527 arg0 = pw_aff(arg0) 2528 except: 2529 raise 2530 try: 2531 if not arg1.__class__ is point: 2532 arg1 = point(arg1) 2533 except: 2534 return union_pw_aff(arg0).eval(arg1) 2535 ctx = arg0.ctx 2536 res = isl.isl_pw_aff_eval(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 2537 obj = val(ctx=ctx, ptr=res) 2538 return obj 2539 def floor(arg0): 2540 try: 2541 if not arg0.__class__ is pw_aff: 2542 arg0 = pw_aff(arg0) 2543 except: 2544 raise 2545 ctx = arg0.ctx 2546 res = isl.isl_pw_aff_floor(isl.isl_pw_aff_copy(arg0.ptr)) 2547 obj = pw_aff(ctx=ctx, ptr=res) 2548 return obj 2549 def ge_set(arg0, arg1): 2550 try: 2551 if not arg0.__class__ is pw_aff: 2552 arg0 = pw_aff(arg0) 2553 except: 2554 raise 2555 try: 2556 if not arg1.__class__ is pw_aff: 2557 arg1 = pw_aff(arg1) 2558 except: 2559 return union_pw_aff(arg0).ge_set(arg1) 2560 ctx = arg0.ctx 2561 res = isl.isl_pw_aff_ge_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2562 obj = set(ctx=ctx, ptr=res) 2563 return obj 2564 def gist(arg0, arg1): 2565 try: 2566 if not arg0.__class__ is pw_aff: 2567 arg0 = pw_aff(arg0) 2568 except: 2569 raise 2570 try: 2571 if not arg1.__class__ is set: 2572 arg1 = set(arg1) 2573 except: 2574 return union_pw_aff(arg0).gist(arg1) 2575 ctx = arg0.ctx 2576 res = isl.isl_pw_aff_gist(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2577 obj = pw_aff(ctx=ctx, ptr=res) 2578 return obj 2579 def gt_set(arg0, arg1): 2580 try: 2581 if not arg0.__class__ is pw_aff: 2582 arg0 = pw_aff(arg0) 2583 except: 2584 raise 2585 try: 2586 if not arg1.__class__ is pw_aff: 2587 arg1 = pw_aff(arg1) 2588 except: 2589 return union_pw_aff(arg0).gt_set(arg1) 2590 ctx = arg0.ctx 2591 res = isl.isl_pw_aff_gt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2592 obj = set(ctx=ctx, ptr=res) 2593 return obj 2594 def insert_domain(arg0, arg1): 2595 try: 2596 if not arg0.__class__ is pw_aff: 2597 arg0 = pw_aff(arg0) 2598 except: 2599 raise 2600 try: 2601 if not arg1.__class__ is space: 2602 arg1 = space(arg1) 2603 except: 2604 return union_pw_aff(arg0).insert_domain(arg1) 2605 ctx = arg0.ctx 2606 res = isl.isl_pw_aff_insert_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 2607 obj = pw_aff(ctx=ctx, ptr=res) 2608 return obj 2609 def intersect_domain(arg0, arg1): 2610 try: 2611 if not arg0.__class__ is pw_aff: 2612 arg0 = pw_aff(arg0) 2613 except: 2614 raise 2615 try: 2616 if not arg1.__class__ is set: 2617 arg1 = set(arg1) 2618 except: 2619 return union_pw_aff(arg0).intersect_domain(arg1) 2620 ctx = arg0.ctx 2621 res = isl.isl_pw_aff_intersect_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2622 obj = pw_aff(ctx=ctx, ptr=res) 2623 return obj 2624 def intersect_params(arg0, arg1): 2625 try: 2626 if not arg0.__class__ is pw_aff: 2627 arg0 = pw_aff(arg0) 2628 except: 2629 raise 2630 try: 2631 if not arg1.__class__ is set: 2632 arg1 = set(arg1) 2633 except: 2634 return union_pw_aff(arg0).intersect_params(arg1) 2635 ctx = arg0.ctx 2636 res = isl.isl_pw_aff_intersect_params(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2637 obj = pw_aff(ctx=ctx, ptr=res) 2638 return obj 2639 def isa_aff(arg0): 2640 try: 2641 if not arg0.__class__ is pw_aff: 2642 arg0 = pw_aff(arg0) 2643 except: 2644 raise 2645 ctx = arg0.ctx 2646 res = isl.isl_pw_aff_isa_aff(arg0.ptr) 2647 if res < 0: 2648 raise 2649 return bool(res) 2650 def le_set(arg0, arg1): 2651 try: 2652 if not arg0.__class__ is pw_aff: 2653 arg0 = pw_aff(arg0) 2654 except: 2655 raise 2656 try: 2657 if not arg1.__class__ is pw_aff: 2658 arg1 = pw_aff(arg1) 2659 except: 2660 return union_pw_aff(arg0).le_set(arg1) 2661 ctx = arg0.ctx 2662 res = isl.isl_pw_aff_le_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2663 obj = set(ctx=ctx, ptr=res) 2664 return obj 2665 def lt_set(arg0, arg1): 2666 try: 2667 if not arg0.__class__ is pw_aff: 2668 arg0 = pw_aff(arg0) 2669 except: 2670 raise 2671 try: 2672 if not arg1.__class__ is pw_aff: 2673 arg1 = pw_aff(arg1) 2674 except: 2675 return union_pw_aff(arg0).lt_set(arg1) 2676 ctx = arg0.ctx 2677 res = isl.isl_pw_aff_lt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2678 obj = set(ctx=ctx, ptr=res) 2679 return obj 2680 def max(arg0, arg1): 2681 try: 2682 if not arg0.__class__ is pw_aff: 2683 arg0 = pw_aff(arg0) 2684 except: 2685 raise 2686 try: 2687 if not arg1.__class__ is pw_aff: 2688 arg1 = pw_aff(arg1) 2689 except: 2690 return union_pw_aff(arg0).max(arg1) 2691 ctx = arg0.ctx 2692 res = isl.isl_pw_aff_max(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2693 obj = pw_aff(ctx=ctx, ptr=res) 2694 return obj 2695 def min(arg0, arg1): 2696 try: 2697 if not arg0.__class__ is pw_aff: 2698 arg0 = pw_aff(arg0) 2699 except: 2700 raise 2701 try: 2702 if not arg1.__class__ is pw_aff: 2703 arg1 = pw_aff(arg1) 2704 except: 2705 return union_pw_aff(arg0).min(arg1) 2706 ctx = arg0.ctx 2707 res = isl.isl_pw_aff_min(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2708 obj = pw_aff(ctx=ctx, ptr=res) 2709 return obj 2710 def mod(*args): 2711 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2712 args = list(args) 2713 try: 2714 if not args[1].__class__ is val: 2715 args[1] = val(args[1]) 2716 except: 2717 raise 2718 ctx = args[0].ctx 2719 res = isl.isl_pw_aff_mod_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2720 obj = pw_aff(ctx=ctx, ptr=res) 2721 return obj 2722 raise Error 2723 def mul(arg0, arg1): 2724 try: 2725 if not arg0.__class__ is pw_aff: 2726 arg0 = pw_aff(arg0) 2727 except: 2728 raise 2729 try: 2730 if not arg1.__class__ is pw_aff: 2731 arg1 = pw_aff(arg1) 2732 except: 2733 return union_pw_aff(arg0).mul(arg1) 2734 ctx = arg0.ctx 2735 res = isl.isl_pw_aff_mul(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2736 obj = pw_aff(ctx=ctx, ptr=res) 2737 return obj 2738 def ne_set(arg0, arg1): 2739 try: 2740 if not arg0.__class__ is pw_aff: 2741 arg0 = pw_aff(arg0) 2742 except: 2743 raise 2744 try: 2745 if not arg1.__class__ is pw_aff: 2746 arg1 = pw_aff(arg1) 2747 except: 2748 return union_pw_aff(arg0).ne_set(arg1) 2749 ctx = arg0.ctx 2750 res = isl.isl_pw_aff_ne_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2751 obj = set(ctx=ctx, ptr=res) 2752 return obj 2753 def neg(arg0): 2754 try: 2755 if not arg0.__class__ is pw_aff: 2756 arg0 = pw_aff(arg0) 2757 except: 2758 raise 2759 ctx = arg0.ctx 2760 res = isl.isl_pw_aff_neg(isl.isl_pw_aff_copy(arg0.ptr)) 2761 obj = pw_aff(ctx=ctx, ptr=res) 2762 return obj 2763 @staticmethod 2764 def param_on_domain(*args): 2765 if len(args) == 2 and args[0].__class__ is set and (args[1].__class__ is id or type(args[1]) == str): 2766 args = list(args) 2767 try: 2768 if not args[1].__class__ is id: 2769 args[1] = id(args[1]) 2770 except: 2771 raise 2772 ctx = args[0].ctx 2773 res = isl.isl_pw_aff_param_on_domain_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 2774 obj = pw_aff(ctx=ctx, ptr=res) 2775 return obj 2776 raise Error 2777 def pullback(*args): 2778 if len(args) == 2 and args[1].__class__ is multi_aff: 2779 ctx = args[0].ctx 2780 res = isl.isl_pw_aff_pullback_multi_aff(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 2781 obj = pw_aff(ctx=ctx, ptr=res) 2782 return obj 2783 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 2784 ctx = args[0].ctx 2785 res = isl.isl_pw_aff_pullback_multi_pw_aff(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 2786 obj = pw_aff(ctx=ctx, ptr=res) 2787 return obj 2788 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2789 ctx = args[0].ctx 2790 res = isl.isl_pw_aff_pullback_pw_multi_aff(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 2791 obj = pw_aff(ctx=ctx, ptr=res) 2792 return obj 2793 raise Error 2794 def scale(*args): 2795 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2796 args = list(args) 2797 try: 2798 if not args[1].__class__ is val: 2799 args[1] = val(args[1]) 2800 except: 2801 raise 2802 ctx = args[0].ctx 2803 res = isl.isl_pw_aff_scale_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2804 obj = pw_aff(ctx=ctx, ptr=res) 2805 return obj 2806 raise Error 2807 def scale_down(*args): 2808 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2809 args = list(args) 2810 try: 2811 if not args[1].__class__ is val: 2812 args[1] = val(args[1]) 2813 except: 2814 raise 2815 ctx = args[0].ctx 2816 res = isl.isl_pw_aff_scale_down_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2817 obj = pw_aff(ctx=ctx, ptr=res) 2818 return obj 2819 raise Error 2820 def sub(arg0, arg1): 2821 try: 2822 if not arg0.__class__ is pw_aff: 2823 arg0 = pw_aff(arg0) 2824 except: 2825 raise 2826 try: 2827 if not arg1.__class__ is pw_aff: 2828 arg1 = pw_aff(arg1) 2829 except: 2830 return union_pw_aff(arg0).sub(arg1) 2831 ctx = arg0.ctx 2832 res = isl.isl_pw_aff_sub(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2833 obj = pw_aff(ctx=ctx, ptr=res) 2834 return obj 2835 def subtract_domain(arg0, arg1): 2836 try: 2837 if not arg0.__class__ is pw_aff: 2838 arg0 = pw_aff(arg0) 2839 except: 2840 raise 2841 try: 2842 if not arg1.__class__ is set: 2843 arg1 = set(arg1) 2844 except: 2845 return union_pw_aff(arg0).subtract_domain(arg1) 2846 ctx = arg0.ctx 2847 res = isl.isl_pw_aff_subtract_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2848 obj = pw_aff(ctx=ctx, ptr=res) 2849 return obj 2850 def tdiv_q(arg0, arg1): 2851 try: 2852 if not arg0.__class__ is pw_aff: 2853 arg0 = pw_aff(arg0) 2854 except: 2855 raise 2856 try: 2857 if not arg1.__class__ is pw_aff: 2858 arg1 = pw_aff(arg1) 2859 except: 2860 return union_pw_aff(arg0).tdiv_q(arg1) 2861 ctx = arg0.ctx 2862 res = isl.isl_pw_aff_tdiv_q(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2863 obj = pw_aff(ctx=ctx, ptr=res) 2864 return obj 2865 def tdiv_r(arg0, arg1): 2866 try: 2867 if not arg0.__class__ is pw_aff: 2868 arg0 = pw_aff(arg0) 2869 except: 2870 raise 2871 try: 2872 if not arg1.__class__ is pw_aff: 2873 arg1 = pw_aff(arg1) 2874 except: 2875 return union_pw_aff(arg0).tdiv_r(arg1) 2876 ctx = arg0.ctx 2877 res = isl.isl_pw_aff_tdiv_r(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2878 obj = pw_aff(ctx=ctx, ptr=res) 2879 return obj 2880 def union_add(arg0, arg1): 2881 try: 2882 if not arg0.__class__ is pw_aff: 2883 arg0 = pw_aff(arg0) 2884 except: 2885 raise 2886 try: 2887 if not arg1.__class__ is pw_aff: 2888 arg1 = pw_aff(arg1) 2889 except: 2890 return union_pw_aff(arg0).union_add(arg1) 2891 ctx = arg0.ctx 2892 res = isl.isl_pw_aff_union_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2893 obj = pw_aff(ctx=ctx, ptr=res) 2894 return obj 2895 2896isl.isl_pw_aff_from_aff.restype = c_void_p 2897isl.isl_pw_aff_from_aff.argtypes = [c_void_p] 2898isl.isl_pw_aff_read_from_str.restype = c_void_p 2899isl.isl_pw_aff_read_from_str.argtypes = [Context, c_char_p] 2900isl.isl_pw_aff_add.restype = c_void_p 2901isl.isl_pw_aff_add.argtypes = [c_void_p, c_void_p] 2902isl.isl_pw_aff_add_constant_val.restype = c_void_p 2903isl.isl_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 2904isl.isl_pw_aff_as_aff.restype = c_void_p 2905isl.isl_pw_aff_as_aff.argtypes = [c_void_p] 2906isl.isl_pw_aff_bind_id.restype = c_void_p 2907isl.isl_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 2908isl.isl_pw_aff_bind_domain.restype = c_void_p 2909isl.isl_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 2910isl.isl_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 2911isl.isl_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 2912isl.isl_pw_aff_ceil.restype = c_void_p 2913isl.isl_pw_aff_ceil.argtypes = [c_void_p] 2914isl.isl_pw_aff_coalesce.restype = c_void_p 2915isl.isl_pw_aff_coalesce.argtypes = [c_void_p] 2916isl.isl_pw_aff_cond.restype = c_void_p 2917isl.isl_pw_aff_cond.argtypes = [c_void_p, c_void_p, c_void_p] 2918isl.isl_pw_aff_div.restype = c_void_p 2919isl.isl_pw_aff_div.argtypes = [c_void_p, c_void_p] 2920isl.isl_pw_aff_domain.restype = c_void_p 2921isl.isl_pw_aff_domain.argtypes = [c_void_p] 2922isl.isl_pw_aff_eq_set.restype = c_void_p 2923isl.isl_pw_aff_eq_set.argtypes = [c_void_p, c_void_p] 2924isl.isl_pw_aff_eval.restype = c_void_p 2925isl.isl_pw_aff_eval.argtypes = [c_void_p, c_void_p] 2926isl.isl_pw_aff_floor.restype = c_void_p 2927isl.isl_pw_aff_floor.argtypes = [c_void_p] 2928isl.isl_pw_aff_ge_set.restype = c_void_p 2929isl.isl_pw_aff_ge_set.argtypes = [c_void_p, c_void_p] 2930isl.isl_pw_aff_gist.restype = c_void_p 2931isl.isl_pw_aff_gist.argtypes = [c_void_p, c_void_p] 2932isl.isl_pw_aff_gt_set.restype = c_void_p 2933isl.isl_pw_aff_gt_set.argtypes = [c_void_p, c_void_p] 2934isl.isl_pw_aff_insert_domain.restype = c_void_p 2935isl.isl_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 2936isl.isl_pw_aff_intersect_domain.restype = c_void_p 2937isl.isl_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 2938isl.isl_pw_aff_intersect_params.restype = c_void_p 2939isl.isl_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 2940isl.isl_pw_aff_isa_aff.argtypes = [c_void_p] 2941isl.isl_pw_aff_le_set.restype = c_void_p 2942isl.isl_pw_aff_le_set.argtypes = [c_void_p, c_void_p] 2943isl.isl_pw_aff_lt_set.restype = c_void_p 2944isl.isl_pw_aff_lt_set.argtypes = [c_void_p, c_void_p] 2945isl.isl_pw_aff_max.restype = c_void_p 2946isl.isl_pw_aff_max.argtypes = [c_void_p, c_void_p] 2947isl.isl_pw_aff_min.restype = c_void_p 2948isl.isl_pw_aff_min.argtypes = [c_void_p, c_void_p] 2949isl.isl_pw_aff_mod_val.restype = c_void_p 2950isl.isl_pw_aff_mod_val.argtypes = [c_void_p, c_void_p] 2951isl.isl_pw_aff_mul.restype = c_void_p 2952isl.isl_pw_aff_mul.argtypes = [c_void_p, c_void_p] 2953isl.isl_pw_aff_ne_set.restype = c_void_p 2954isl.isl_pw_aff_ne_set.argtypes = [c_void_p, c_void_p] 2955isl.isl_pw_aff_neg.restype = c_void_p 2956isl.isl_pw_aff_neg.argtypes = [c_void_p] 2957isl.isl_pw_aff_param_on_domain_id.restype = c_void_p 2958isl.isl_pw_aff_param_on_domain_id.argtypes = [c_void_p, c_void_p] 2959isl.isl_pw_aff_pullback_multi_aff.restype = c_void_p 2960isl.isl_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 2961isl.isl_pw_aff_pullback_multi_pw_aff.restype = c_void_p 2962isl.isl_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 2963isl.isl_pw_aff_pullback_pw_multi_aff.restype = c_void_p 2964isl.isl_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2965isl.isl_pw_aff_scale_val.restype = c_void_p 2966isl.isl_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 2967isl.isl_pw_aff_scale_down_val.restype = c_void_p 2968isl.isl_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 2969isl.isl_pw_aff_sub.restype = c_void_p 2970isl.isl_pw_aff_sub.argtypes = [c_void_p, c_void_p] 2971isl.isl_pw_aff_subtract_domain.restype = c_void_p 2972isl.isl_pw_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 2973isl.isl_pw_aff_tdiv_q.restype = c_void_p 2974isl.isl_pw_aff_tdiv_q.argtypes = [c_void_p, c_void_p] 2975isl.isl_pw_aff_tdiv_r.restype = c_void_p 2976isl.isl_pw_aff_tdiv_r.argtypes = [c_void_p, c_void_p] 2977isl.isl_pw_aff_union_add.restype = c_void_p 2978isl.isl_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 2979isl.isl_pw_aff_copy.restype = c_void_p 2980isl.isl_pw_aff_copy.argtypes = [c_void_p] 2981isl.isl_pw_aff_free.restype = c_void_p 2982isl.isl_pw_aff_free.argtypes = [c_void_p] 2983isl.isl_pw_aff_to_str.restype = POINTER(c_char) 2984isl.isl_pw_aff_to_str.argtypes = [c_void_p] 2985 2986class multi_aff(pw_multi_aff, multi_pw_aff): 2987 def __init__(self, *args, **keywords): 2988 if "ptr" in keywords: 2989 self.ctx = keywords["ctx"] 2990 self.ptr = keywords["ptr"] 2991 return 2992 if len(args) == 1 and args[0].__class__ is aff: 2993 self.ctx = Context.getDefaultInstance() 2994 self.ptr = isl.isl_multi_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 2995 return 2996 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is aff_list: 2997 self.ctx = Context.getDefaultInstance() 2998 self.ptr = isl.isl_multi_aff_from_aff_list(isl.isl_space_copy(args[0].ptr), isl.isl_aff_list_copy(args[1].ptr)) 2999 return 3000 if len(args) == 1 and type(args[0]) == str: 3001 self.ctx = Context.getDefaultInstance() 3002 self.ptr = isl.isl_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 3003 return 3004 raise Error 3005 def __del__(self): 3006 if hasattr(self, 'ptr'): 3007 isl.isl_multi_aff_free(self.ptr) 3008 def __str__(arg0): 3009 try: 3010 if not arg0.__class__ is multi_aff: 3011 arg0 = multi_aff(arg0) 3012 except: 3013 raise 3014 ptr = isl.isl_multi_aff_to_str(arg0.ptr) 3015 res = cast(ptr, c_char_p).value.decode('ascii') 3016 libc.free(ptr) 3017 return res 3018 def __repr__(self): 3019 s = str(self) 3020 if '"' in s: 3021 return 'isl.multi_aff("""%s""")' % s 3022 else: 3023 return 'isl.multi_aff("%s")' % s 3024 def add(arg0, arg1): 3025 try: 3026 if not arg0.__class__ is multi_aff: 3027 arg0 = multi_aff(arg0) 3028 except: 3029 raise 3030 try: 3031 if not arg1.__class__ is multi_aff: 3032 arg1 = multi_aff(arg1) 3033 except: 3034 return pw_multi_aff(arg0).add(arg1) 3035 ctx = arg0.ctx 3036 res = isl.isl_multi_aff_add(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3037 obj = multi_aff(ctx=ctx, ptr=res) 3038 return obj 3039 def add_constant(*args): 3040 if len(args) == 2 and args[1].__class__ is multi_val: 3041 ctx = args[0].ctx 3042 res = isl.isl_multi_aff_add_constant_multi_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 3043 obj = multi_aff(ctx=ctx, ptr=res) 3044 return obj 3045 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3046 args = list(args) 3047 try: 3048 if not args[1].__class__ is val: 3049 args[1] = val(args[1]) 3050 except: 3051 raise 3052 ctx = args[0].ctx 3053 res = isl.isl_multi_aff_add_constant_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3054 obj = multi_aff(ctx=ctx, ptr=res) 3055 return obj 3056 raise Error 3057 def bind(arg0, arg1): 3058 try: 3059 if not arg0.__class__ is multi_aff: 3060 arg0 = multi_aff(arg0) 3061 except: 3062 raise 3063 try: 3064 if not arg1.__class__ is multi_id: 3065 arg1 = multi_id(arg1) 3066 except: 3067 return pw_multi_aff(arg0).bind(arg1) 3068 ctx = arg0.ctx 3069 res = isl.isl_multi_aff_bind(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3070 obj = basic_set(ctx=ctx, ptr=res) 3071 return obj 3072 def bind_domain(arg0, arg1): 3073 try: 3074 if not arg0.__class__ is multi_aff: 3075 arg0 = multi_aff(arg0) 3076 except: 3077 raise 3078 try: 3079 if not arg1.__class__ is multi_id: 3080 arg1 = multi_id(arg1) 3081 except: 3082 return pw_multi_aff(arg0).bind_domain(arg1) 3083 ctx = arg0.ctx 3084 res = isl.isl_multi_aff_bind_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3085 obj = multi_aff(ctx=ctx, ptr=res) 3086 return obj 3087 def bind_domain_wrapped_domain(arg0, arg1): 3088 try: 3089 if not arg0.__class__ is multi_aff: 3090 arg0 = multi_aff(arg0) 3091 except: 3092 raise 3093 try: 3094 if not arg1.__class__ is multi_id: 3095 arg1 = multi_id(arg1) 3096 except: 3097 return pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 3098 ctx = arg0.ctx 3099 res = isl.isl_multi_aff_bind_domain_wrapped_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3100 obj = multi_aff(ctx=ctx, ptr=res) 3101 return obj 3102 @staticmethod 3103 def domain_map(arg0): 3104 try: 3105 if not arg0.__class__ is space: 3106 arg0 = space(arg0) 3107 except: 3108 raise 3109 ctx = arg0.ctx 3110 res = isl.isl_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 3111 obj = multi_aff(ctx=ctx, ptr=res) 3112 return obj 3113 def flat_range_product(arg0, arg1): 3114 try: 3115 if not arg0.__class__ is multi_aff: 3116 arg0 = multi_aff(arg0) 3117 except: 3118 raise 3119 try: 3120 if not arg1.__class__ is multi_aff: 3121 arg1 = multi_aff(arg1) 3122 except: 3123 return pw_multi_aff(arg0).flat_range_product(arg1) 3124 ctx = arg0.ctx 3125 res = isl.isl_multi_aff_flat_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3126 obj = multi_aff(ctx=ctx, ptr=res) 3127 return obj 3128 def floor(arg0): 3129 try: 3130 if not arg0.__class__ is multi_aff: 3131 arg0 = multi_aff(arg0) 3132 except: 3133 raise 3134 ctx = arg0.ctx 3135 res = isl.isl_multi_aff_floor(isl.isl_multi_aff_copy(arg0.ptr)) 3136 obj = multi_aff(ctx=ctx, ptr=res) 3137 return obj 3138 def at(arg0, arg1): 3139 try: 3140 if not arg0.__class__ is multi_aff: 3141 arg0 = multi_aff(arg0) 3142 except: 3143 raise 3144 ctx = arg0.ctx 3145 res = isl.isl_multi_aff_get_at(arg0.ptr, arg1) 3146 obj = aff(ctx=ctx, ptr=res) 3147 return obj 3148 def get_at(arg0, arg1): 3149 return arg0.at(arg1) 3150 def constant_multi_val(arg0): 3151 try: 3152 if not arg0.__class__ is multi_aff: 3153 arg0 = multi_aff(arg0) 3154 except: 3155 raise 3156 ctx = arg0.ctx 3157 res = isl.isl_multi_aff_get_constant_multi_val(arg0.ptr) 3158 obj = multi_val(ctx=ctx, ptr=res) 3159 return obj 3160 def get_constant_multi_val(arg0): 3161 return arg0.constant_multi_val() 3162 def list(arg0): 3163 try: 3164 if not arg0.__class__ is multi_aff: 3165 arg0 = multi_aff(arg0) 3166 except: 3167 raise 3168 ctx = arg0.ctx 3169 res = isl.isl_multi_aff_get_list(arg0.ptr) 3170 obj = aff_list(ctx=ctx, ptr=res) 3171 return obj 3172 def get_list(arg0): 3173 return arg0.list() 3174 def space(arg0): 3175 try: 3176 if not arg0.__class__ is multi_aff: 3177 arg0 = multi_aff(arg0) 3178 except: 3179 raise 3180 ctx = arg0.ctx 3181 res = isl.isl_multi_aff_get_space(arg0.ptr) 3182 obj = space(ctx=ctx, ptr=res) 3183 return obj 3184 def get_space(arg0): 3185 return arg0.space() 3186 def gist(arg0, arg1): 3187 try: 3188 if not arg0.__class__ is multi_aff: 3189 arg0 = multi_aff(arg0) 3190 except: 3191 raise 3192 try: 3193 if not arg1.__class__ is set: 3194 arg1 = set(arg1) 3195 except: 3196 return pw_multi_aff(arg0).gist(arg1) 3197 ctx = arg0.ctx 3198 res = isl.isl_multi_aff_gist(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3199 obj = multi_aff(ctx=ctx, ptr=res) 3200 return obj 3201 def identity(*args): 3202 if len(args) == 1: 3203 ctx = args[0].ctx 3204 res = isl.isl_multi_aff_identity_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 3205 obj = multi_aff(ctx=ctx, ptr=res) 3206 return obj 3207 raise Error 3208 @staticmethod 3209 def identity_on_domain(*args): 3210 if len(args) == 1 and args[0].__class__ is space: 3211 ctx = args[0].ctx 3212 res = isl.isl_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 3213 obj = multi_aff(ctx=ctx, ptr=res) 3214 return obj 3215 raise Error 3216 def insert_domain(arg0, arg1): 3217 try: 3218 if not arg0.__class__ is multi_aff: 3219 arg0 = multi_aff(arg0) 3220 except: 3221 raise 3222 try: 3223 if not arg1.__class__ is space: 3224 arg1 = space(arg1) 3225 except: 3226 return pw_multi_aff(arg0).insert_domain(arg1) 3227 ctx = arg0.ctx 3228 res = isl.isl_multi_aff_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 3229 obj = multi_aff(ctx=ctx, ptr=res) 3230 return obj 3231 def involves_locals(arg0): 3232 try: 3233 if not arg0.__class__ is multi_aff: 3234 arg0 = multi_aff(arg0) 3235 except: 3236 raise 3237 ctx = arg0.ctx 3238 res = isl.isl_multi_aff_involves_locals(arg0.ptr) 3239 if res < 0: 3240 raise 3241 return bool(res) 3242 def involves_nan(arg0): 3243 try: 3244 if not arg0.__class__ is multi_aff: 3245 arg0 = multi_aff(arg0) 3246 except: 3247 raise 3248 ctx = arg0.ctx 3249 res = isl.isl_multi_aff_involves_nan(arg0.ptr) 3250 if res < 0: 3251 raise 3252 return bool(res) 3253 def neg(arg0): 3254 try: 3255 if not arg0.__class__ is multi_aff: 3256 arg0 = multi_aff(arg0) 3257 except: 3258 raise 3259 ctx = arg0.ctx 3260 res = isl.isl_multi_aff_neg(isl.isl_multi_aff_copy(arg0.ptr)) 3261 obj = multi_aff(ctx=ctx, ptr=res) 3262 return obj 3263 def plain_is_equal(arg0, arg1): 3264 try: 3265 if not arg0.__class__ is multi_aff: 3266 arg0 = multi_aff(arg0) 3267 except: 3268 raise 3269 try: 3270 if not arg1.__class__ is multi_aff: 3271 arg1 = multi_aff(arg1) 3272 except: 3273 return pw_multi_aff(arg0).plain_is_equal(arg1) 3274 ctx = arg0.ctx 3275 res = isl.isl_multi_aff_plain_is_equal(arg0.ptr, arg1.ptr) 3276 if res < 0: 3277 raise 3278 return bool(res) 3279 def product(arg0, arg1): 3280 try: 3281 if not arg0.__class__ is multi_aff: 3282 arg0 = multi_aff(arg0) 3283 except: 3284 raise 3285 try: 3286 if not arg1.__class__ is multi_aff: 3287 arg1 = multi_aff(arg1) 3288 except: 3289 return pw_multi_aff(arg0).product(arg1) 3290 ctx = arg0.ctx 3291 res = isl.isl_multi_aff_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3292 obj = multi_aff(ctx=ctx, ptr=res) 3293 return obj 3294 def pullback(*args): 3295 if len(args) == 2 and args[1].__class__ is multi_aff: 3296 ctx = args[0].ctx 3297 res = isl.isl_multi_aff_pullback_multi_aff(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 3298 obj = multi_aff(ctx=ctx, ptr=res) 3299 return obj 3300 raise Error 3301 @staticmethod 3302 def range_map(arg0): 3303 try: 3304 if not arg0.__class__ is space: 3305 arg0 = space(arg0) 3306 except: 3307 raise 3308 ctx = arg0.ctx 3309 res = isl.isl_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 3310 obj = multi_aff(ctx=ctx, ptr=res) 3311 return obj 3312 def range_product(arg0, arg1): 3313 try: 3314 if not arg0.__class__ is multi_aff: 3315 arg0 = multi_aff(arg0) 3316 except: 3317 raise 3318 try: 3319 if not arg1.__class__ is multi_aff: 3320 arg1 = multi_aff(arg1) 3321 except: 3322 return pw_multi_aff(arg0).range_product(arg1) 3323 ctx = arg0.ctx 3324 res = isl.isl_multi_aff_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3325 obj = multi_aff(ctx=ctx, ptr=res) 3326 return obj 3327 def scale(*args): 3328 if len(args) == 2 and args[1].__class__ is multi_val: 3329 ctx = args[0].ctx 3330 res = isl.isl_multi_aff_scale_multi_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 3331 obj = multi_aff(ctx=ctx, ptr=res) 3332 return obj 3333 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3334 args = list(args) 3335 try: 3336 if not args[1].__class__ is val: 3337 args[1] = val(args[1]) 3338 except: 3339 raise 3340 ctx = args[0].ctx 3341 res = isl.isl_multi_aff_scale_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3342 obj = multi_aff(ctx=ctx, ptr=res) 3343 return obj 3344 raise Error 3345 def scale_down(*args): 3346 if len(args) == 2 and args[1].__class__ is multi_val: 3347 ctx = args[0].ctx 3348 res = isl.isl_multi_aff_scale_down_multi_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 3349 obj = multi_aff(ctx=ctx, ptr=res) 3350 return obj 3351 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3352 args = list(args) 3353 try: 3354 if not args[1].__class__ is val: 3355 args[1] = val(args[1]) 3356 except: 3357 raise 3358 ctx = args[0].ctx 3359 res = isl.isl_multi_aff_scale_down_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3360 obj = multi_aff(ctx=ctx, ptr=res) 3361 return obj 3362 raise Error 3363 def set_at(arg0, arg1, arg2): 3364 try: 3365 if not arg0.__class__ is multi_aff: 3366 arg0 = multi_aff(arg0) 3367 except: 3368 raise 3369 try: 3370 if not arg2.__class__ is aff: 3371 arg2 = aff(arg2) 3372 except: 3373 return pw_multi_aff(arg0).set_at(arg1, arg2) 3374 ctx = arg0.ctx 3375 res = isl.isl_multi_aff_set_at(isl.isl_multi_aff_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 3376 obj = multi_aff(ctx=ctx, ptr=res) 3377 return obj 3378 def size(arg0): 3379 try: 3380 if not arg0.__class__ is multi_aff: 3381 arg0 = multi_aff(arg0) 3382 except: 3383 raise 3384 ctx = arg0.ctx 3385 res = isl.isl_multi_aff_size(arg0.ptr) 3386 if res < 0: 3387 raise 3388 return int(res) 3389 def sub(arg0, arg1): 3390 try: 3391 if not arg0.__class__ is multi_aff: 3392 arg0 = multi_aff(arg0) 3393 except: 3394 raise 3395 try: 3396 if not arg1.__class__ is multi_aff: 3397 arg1 = multi_aff(arg1) 3398 except: 3399 return pw_multi_aff(arg0).sub(arg1) 3400 ctx = arg0.ctx 3401 res = isl.isl_multi_aff_sub(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3402 obj = multi_aff(ctx=ctx, ptr=res) 3403 return obj 3404 def unbind_params_insert_domain(arg0, arg1): 3405 try: 3406 if not arg0.__class__ is multi_aff: 3407 arg0 = multi_aff(arg0) 3408 except: 3409 raise 3410 try: 3411 if not arg1.__class__ is multi_id: 3412 arg1 = multi_id(arg1) 3413 except: 3414 return pw_multi_aff(arg0).unbind_params_insert_domain(arg1) 3415 ctx = arg0.ctx 3416 res = isl.isl_multi_aff_unbind_params_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3417 obj = multi_aff(ctx=ctx, ptr=res) 3418 return obj 3419 @staticmethod 3420 def zero(arg0): 3421 try: 3422 if not arg0.__class__ is space: 3423 arg0 = space(arg0) 3424 except: 3425 raise 3426 ctx = arg0.ctx 3427 res = isl.isl_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 3428 obj = multi_aff(ctx=ctx, ptr=res) 3429 return obj 3430 3431isl.isl_multi_aff_from_aff.restype = c_void_p 3432isl.isl_multi_aff_from_aff.argtypes = [c_void_p] 3433isl.isl_multi_aff_from_aff_list.restype = c_void_p 3434isl.isl_multi_aff_from_aff_list.argtypes = [c_void_p, c_void_p] 3435isl.isl_multi_aff_read_from_str.restype = c_void_p 3436isl.isl_multi_aff_read_from_str.argtypes = [Context, c_char_p] 3437isl.isl_multi_aff_add.restype = c_void_p 3438isl.isl_multi_aff_add.argtypes = [c_void_p, c_void_p] 3439isl.isl_multi_aff_add_constant_multi_val.restype = c_void_p 3440isl.isl_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 3441isl.isl_multi_aff_add_constant_val.restype = c_void_p 3442isl.isl_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 3443isl.isl_multi_aff_bind.restype = c_void_p 3444isl.isl_multi_aff_bind.argtypes = [c_void_p, c_void_p] 3445isl.isl_multi_aff_bind_domain.restype = c_void_p 3446isl.isl_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 3447isl.isl_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 3448isl.isl_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 3449isl.isl_multi_aff_domain_map.restype = c_void_p 3450isl.isl_multi_aff_domain_map.argtypes = [c_void_p] 3451isl.isl_multi_aff_flat_range_product.restype = c_void_p 3452isl.isl_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 3453isl.isl_multi_aff_floor.restype = c_void_p 3454isl.isl_multi_aff_floor.argtypes = [c_void_p] 3455isl.isl_multi_aff_get_at.restype = c_void_p 3456isl.isl_multi_aff_get_at.argtypes = [c_void_p, c_int] 3457isl.isl_multi_aff_get_constant_multi_val.restype = c_void_p 3458isl.isl_multi_aff_get_constant_multi_val.argtypes = [c_void_p] 3459isl.isl_multi_aff_get_list.restype = c_void_p 3460isl.isl_multi_aff_get_list.argtypes = [c_void_p] 3461isl.isl_multi_aff_get_space.restype = c_void_p 3462isl.isl_multi_aff_get_space.argtypes = [c_void_p] 3463isl.isl_multi_aff_gist.restype = c_void_p 3464isl.isl_multi_aff_gist.argtypes = [c_void_p, c_void_p] 3465isl.isl_multi_aff_identity_multi_aff.restype = c_void_p 3466isl.isl_multi_aff_identity_multi_aff.argtypes = [c_void_p] 3467isl.isl_multi_aff_identity_on_domain_space.restype = c_void_p 3468isl.isl_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 3469isl.isl_multi_aff_insert_domain.restype = c_void_p 3470isl.isl_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 3471isl.isl_multi_aff_involves_locals.argtypes = [c_void_p] 3472isl.isl_multi_aff_involves_nan.argtypes = [c_void_p] 3473isl.isl_multi_aff_neg.restype = c_void_p 3474isl.isl_multi_aff_neg.argtypes = [c_void_p] 3475isl.isl_multi_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 3476isl.isl_multi_aff_product.restype = c_void_p 3477isl.isl_multi_aff_product.argtypes = [c_void_p, c_void_p] 3478isl.isl_multi_aff_pullback_multi_aff.restype = c_void_p 3479isl.isl_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3480isl.isl_multi_aff_range_map.restype = c_void_p 3481isl.isl_multi_aff_range_map.argtypes = [c_void_p] 3482isl.isl_multi_aff_range_product.restype = c_void_p 3483isl.isl_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 3484isl.isl_multi_aff_scale_multi_val.restype = c_void_p 3485isl.isl_multi_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 3486isl.isl_multi_aff_scale_val.restype = c_void_p 3487isl.isl_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 3488isl.isl_multi_aff_scale_down_multi_val.restype = c_void_p 3489isl.isl_multi_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 3490isl.isl_multi_aff_scale_down_val.restype = c_void_p 3491isl.isl_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3492isl.isl_multi_aff_set_at.restype = c_void_p 3493isl.isl_multi_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 3494isl.isl_multi_aff_size.argtypes = [c_void_p] 3495isl.isl_multi_aff_sub.restype = c_void_p 3496isl.isl_multi_aff_sub.argtypes = [c_void_p, c_void_p] 3497isl.isl_multi_aff_unbind_params_insert_domain.restype = c_void_p 3498isl.isl_multi_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 3499isl.isl_multi_aff_zero.restype = c_void_p 3500isl.isl_multi_aff_zero.argtypes = [c_void_p] 3501isl.isl_multi_aff_copy.restype = c_void_p 3502isl.isl_multi_aff_copy.argtypes = [c_void_p] 3503isl.isl_multi_aff_free.restype = c_void_p 3504isl.isl_multi_aff_free.argtypes = [c_void_p] 3505isl.isl_multi_aff_to_str.restype = POINTER(c_char) 3506isl.isl_multi_aff_to_str.argtypes = [c_void_p] 3507 3508class aff(pw_aff, multi_aff): 3509 def __init__(self, *args, **keywords): 3510 if "ptr" in keywords: 3511 self.ctx = keywords["ctx"] 3512 self.ptr = keywords["ptr"] 3513 return 3514 if len(args) == 1 and type(args[0]) == str: 3515 self.ctx = Context.getDefaultInstance() 3516 self.ptr = isl.isl_aff_read_from_str(self.ctx, args[0].encode('ascii')) 3517 return 3518 raise Error 3519 def __del__(self): 3520 if hasattr(self, 'ptr'): 3521 isl.isl_aff_free(self.ptr) 3522 def __str__(arg0): 3523 try: 3524 if not arg0.__class__ is aff: 3525 arg0 = aff(arg0) 3526 except: 3527 raise 3528 ptr = isl.isl_aff_to_str(arg0.ptr) 3529 res = cast(ptr, c_char_p).value.decode('ascii') 3530 libc.free(ptr) 3531 return res 3532 def __repr__(self): 3533 s = str(self) 3534 if '"' in s: 3535 return 'isl.aff("""%s""")' % s 3536 else: 3537 return 'isl.aff("%s")' % s 3538 def add(arg0, arg1): 3539 try: 3540 if not arg0.__class__ is aff: 3541 arg0 = aff(arg0) 3542 except: 3543 raise 3544 try: 3545 if not arg1.__class__ is aff: 3546 arg1 = aff(arg1) 3547 except: 3548 return pw_aff(arg0).add(arg1) 3549 ctx = arg0.ctx 3550 res = isl.isl_aff_add(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3551 obj = aff(ctx=ctx, ptr=res) 3552 return obj 3553 def add_constant(*args): 3554 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3555 args = list(args) 3556 try: 3557 if not args[1].__class__ is val: 3558 args[1] = val(args[1]) 3559 except: 3560 raise 3561 ctx = args[0].ctx 3562 res = isl.isl_aff_add_constant_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3563 obj = aff(ctx=ctx, ptr=res) 3564 return obj 3565 raise Error 3566 def bind(*args): 3567 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 3568 args = list(args) 3569 try: 3570 if not args[1].__class__ is id: 3571 args[1] = id(args[1]) 3572 except: 3573 raise 3574 ctx = args[0].ctx 3575 res = isl.isl_aff_bind_id(isl.isl_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 3576 obj = basic_set(ctx=ctx, ptr=res) 3577 return obj 3578 raise Error 3579 def ceil(arg0): 3580 try: 3581 if not arg0.__class__ is aff: 3582 arg0 = aff(arg0) 3583 except: 3584 raise 3585 ctx = arg0.ctx 3586 res = isl.isl_aff_ceil(isl.isl_aff_copy(arg0.ptr)) 3587 obj = aff(ctx=ctx, ptr=res) 3588 return obj 3589 def div(arg0, arg1): 3590 try: 3591 if not arg0.__class__ is aff: 3592 arg0 = aff(arg0) 3593 except: 3594 raise 3595 try: 3596 if not arg1.__class__ is aff: 3597 arg1 = aff(arg1) 3598 except: 3599 return pw_aff(arg0).div(arg1) 3600 ctx = arg0.ctx 3601 res = isl.isl_aff_div(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3602 obj = aff(ctx=ctx, ptr=res) 3603 return obj 3604 def eq_set(arg0, arg1): 3605 try: 3606 if not arg0.__class__ is aff: 3607 arg0 = aff(arg0) 3608 except: 3609 raise 3610 try: 3611 if not arg1.__class__ is aff: 3612 arg1 = aff(arg1) 3613 except: 3614 return pw_aff(arg0).eq_set(arg1) 3615 ctx = arg0.ctx 3616 res = isl.isl_aff_eq_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3617 obj = set(ctx=ctx, ptr=res) 3618 return obj 3619 def eval(arg0, arg1): 3620 try: 3621 if not arg0.__class__ is aff: 3622 arg0 = aff(arg0) 3623 except: 3624 raise 3625 try: 3626 if not arg1.__class__ is point: 3627 arg1 = point(arg1) 3628 except: 3629 return pw_aff(arg0).eval(arg1) 3630 ctx = arg0.ctx 3631 res = isl.isl_aff_eval(isl.isl_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 3632 obj = val(ctx=ctx, ptr=res) 3633 return obj 3634 def floor(arg0): 3635 try: 3636 if not arg0.__class__ is aff: 3637 arg0 = aff(arg0) 3638 except: 3639 raise 3640 ctx = arg0.ctx 3641 res = isl.isl_aff_floor(isl.isl_aff_copy(arg0.ptr)) 3642 obj = aff(ctx=ctx, ptr=res) 3643 return obj 3644 def ge_set(arg0, arg1): 3645 try: 3646 if not arg0.__class__ is aff: 3647 arg0 = aff(arg0) 3648 except: 3649 raise 3650 try: 3651 if not arg1.__class__ is aff: 3652 arg1 = aff(arg1) 3653 except: 3654 return pw_aff(arg0).ge_set(arg1) 3655 ctx = arg0.ctx 3656 res = isl.isl_aff_ge_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3657 obj = set(ctx=ctx, ptr=res) 3658 return obj 3659 def constant_val(arg0): 3660 try: 3661 if not arg0.__class__ is aff: 3662 arg0 = aff(arg0) 3663 except: 3664 raise 3665 ctx = arg0.ctx 3666 res = isl.isl_aff_get_constant_val(arg0.ptr) 3667 obj = val(ctx=ctx, ptr=res) 3668 return obj 3669 def get_constant_val(arg0): 3670 return arg0.constant_val() 3671 def gist(arg0, arg1): 3672 try: 3673 if not arg0.__class__ is aff: 3674 arg0 = aff(arg0) 3675 except: 3676 raise 3677 try: 3678 if not arg1.__class__ is set: 3679 arg1 = set(arg1) 3680 except: 3681 return pw_aff(arg0).gist(arg1) 3682 ctx = arg0.ctx 3683 res = isl.isl_aff_gist(isl.isl_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3684 obj = aff(ctx=ctx, ptr=res) 3685 return obj 3686 def gt_set(arg0, arg1): 3687 try: 3688 if not arg0.__class__ is aff: 3689 arg0 = aff(arg0) 3690 except: 3691 raise 3692 try: 3693 if not arg1.__class__ is aff: 3694 arg1 = aff(arg1) 3695 except: 3696 return pw_aff(arg0).gt_set(arg1) 3697 ctx = arg0.ctx 3698 res = isl.isl_aff_gt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3699 obj = set(ctx=ctx, ptr=res) 3700 return obj 3701 def is_cst(arg0): 3702 try: 3703 if not arg0.__class__ is aff: 3704 arg0 = aff(arg0) 3705 except: 3706 raise 3707 ctx = arg0.ctx 3708 res = isl.isl_aff_is_cst(arg0.ptr) 3709 if res < 0: 3710 raise 3711 return bool(res) 3712 def le_set(arg0, arg1): 3713 try: 3714 if not arg0.__class__ is aff: 3715 arg0 = aff(arg0) 3716 except: 3717 raise 3718 try: 3719 if not arg1.__class__ is aff: 3720 arg1 = aff(arg1) 3721 except: 3722 return pw_aff(arg0).le_set(arg1) 3723 ctx = arg0.ctx 3724 res = isl.isl_aff_le_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3725 obj = set(ctx=ctx, ptr=res) 3726 return obj 3727 def lt_set(arg0, arg1): 3728 try: 3729 if not arg0.__class__ is aff: 3730 arg0 = aff(arg0) 3731 except: 3732 raise 3733 try: 3734 if not arg1.__class__ is aff: 3735 arg1 = aff(arg1) 3736 except: 3737 return pw_aff(arg0).lt_set(arg1) 3738 ctx = arg0.ctx 3739 res = isl.isl_aff_lt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3740 obj = set(ctx=ctx, ptr=res) 3741 return obj 3742 def mod(*args): 3743 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3744 args = list(args) 3745 try: 3746 if not args[1].__class__ is val: 3747 args[1] = val(args[1]) 3748 except: 3749 raise 3750 ctx = args[0].ctx 3751 res = isl.isl_aff_mod_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3752 obj = aff(ctx=ctx, ptr=res) 3753 return obj 3754 raise Error 3755 def mul(arg0, arg1): 3756 try: 3757 if not arg0.__class__ is aff: 3758 arg0 = aff(arg0) 3759 except: 3760 raise 3761 try: 3762 if not arg1.__class__ is aff: 3763 arg1 = aff(arg1) 3764 except: 3765 return pw_aff(arg0).mul(arg1) 3766 ctx = arg0.ctx 3767 res = isl.isl_aff_mul(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3768 obj = aff(ctx=ctx, ptr=res) 3769 return obj 3770 def ne_set(arg0, arg1): 3771 try: 3772 if not arg0.__class__ is aff: 3773 arg0 = aff(arg0) 3774 except: 3775 raise 3776 try: 3777 if not arg1.__class__ is aff: 3778 arg1 = aff(arg1) 3779 except: 3780 return pw_aff(arg0).ne_set(arg1) 3781 ctx = arg0.ctx 3782 res = isl.isl_aff_ne_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3783 obj = set(ctx=ctx, ptr=res) 3784 return obj 3785 def neg(arg0): 3786 try: 3787 if not arg0.__class__ is aff: 3788 arg0 = aff(arg0) 3789 except: 3790 raise 3791 ctx = arg0.ctx 3792 res = isl.isl_aff_neg(isl.isl_aff_copy(arg0.ptr)) 3793 obj = aff(ctx=ctx, ptr=res) 3794 return obj 3795 def pullback(*args): 3796 if len(args) == 2 and args[1].__class__ is multi_aff: 3797 ctx = args[0].ctx 3798 res = isl.isl_aff_pullback_multi_aff(isl.isl_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 3799 obj = aff(ctx=ctx, ptr=res) 3800 return obj 3801 raise Error 3802 def scale(*args): 3803 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3804 args = list(args) 3805 try: 3806 if not args[1].__class__ is val: 3807 args[1] = val(args[1]) 3808 except: 3809 raise 3810 ctx = args[0].ctx 3811 res = isl.isl_aff_scale_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3812 obj = aff(ctx=ctx, ptr=res) 3813 return obj 3814 raise Error 3815 def scale_down(*args): 3816 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3817 args = list(args) 3818 try: 3819 if not args[1].__class__ is val: 3820 args[1] = val(args[1]) 3821 except: 3822 raise 3823 ctx = args[0].ctx 3824 res = isl.isl_aff_scale_down_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3825 obj = aff(ctx=ctx, ptr=res) 3826 return obj 3827 raise Error 3828 def sub(arg0, arg1): 3829 try: 3830 if not arg0.__class__ is aff: 3831 arg0 = aff(arg0) 3832 except: 3833 raise 3834 try: 3835 if not arg1.__class__ is aff: 3836 arg1 = aff(arg1) 3837 except: 3838 return pw_aff(arg0).sub(arg1) 3839 ctx = arg0.ctx 3840 res = isl.isl_aff_sub(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3841 obj = aff(ctx=ctx, ptr=res) 3842 return obj 3843 def unbind_params_insert_domain(arg0, arg1): 3844 try: 3845 if not arg0.__class__ is aff: 3846 arg0 = aff(arg0) 3847 except: 3848 raise 3849 try: 3850 if not arg1.__class__ is multi_id: 3851 arg1 = multi_id(arg1) 3852 except: 3853 return pw_aff(arg0).unbind_params_insert_domain(arg1) 3854 ctx = arg0.ctx 3855 res = isl.isl_aff_unbind_params_insert_domain(isl.isl_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3856 obj = aff(ctx=ctx, ptr=res) 3857 return obj 3858 @staticmethod 3859 def zero_on_domain(*args): 3860 if len(args) == 1 and args[0].__class__ is space: 3861 ctx = args[0].ctx 3862 res = isl.isl_aff_zero_on_domain_space(isl.isl_space_copy(args[0].ptr)) 3863 obj = aff(ctx=ctx, ptr=res) 3864 return obj 3865 raise Error 3866 3867isl.isl_aff_read_from_str.restype = c_void_p 3868isl.isl_aff_read_from_str.argtypes = [Context, c_char_p] 3869isl.isl_aff_add.restype = c_void_p 3870isl.isl_aff_add.argtypes = [c_void_p, c_void_p] 3871isl.isl_aff_add_constant_val.restype = c_void_p 3872isl.isl_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 3873isl.isl_aff_bind_id.restype = c_void_p 3874isl.isl_aff_bind_id.argtypes = [c_void_p, c_void_p] 3875isl.isl_aff_ceil.restype = c_void_p 3876isl.isl_aff_ceil.argtypes = [c_void_p] 3877isl.isl_aff_div.restype = c_void_p 3878isl.isl_aff_div.argtypes = [c_void_p, c_void_p] 3879isl.isl_aff_eq_set.restype = c_void_p 3880isl.isl_aff_eq_set.argtypes = [c_void_p, c_void_p] 3881isl.isl_aff_eval.restype = c_void_p 3882isl.isl_aff_eval.argtypes = [c_void_p, c_void_p] 3883isl.isl_aff_floor.restype = c_void_p 3884isl.isl_aff_floor.argtypes = [c_void_p] 3885isl.isl_aff_ge_set.restype = c_void_p 3886isl.isl_aff_ge_set.argtypes = [c_void_p, c_void_p] 3887isl.isl_aff_get_constant_val.restype = c_void_p 3888isl.isl_aff_get_constant_val.argtypes = [c_void_p] 3889isl.isl_aff_gist.restype = c_void_p 3890isl.isl_aff_gist.argtypes = [c_void_p, c_void_p] 3891isl.isl_aff_gt_set.restype = c_void_p 3892isl.isl_aff_gt_set.argtypes = [c_void_p, c_void_p] 3893isl.isl_aff_is_cst.argtypes = [c_void_p] 3894isl.isl_aff_le_set.restype = c_void_p 3895isl.isl_aff_le_set.argtypes = [c_void_p, c_void_p] 3896isl.isl_aff_lt_set.restype = c_void_p 3897isl.isl_aff_lt_set.argtypes = [c_void_p, c_void_p] 3898isl.isl_aff_mod_val.restype = c_void_p 3899isl.isl_aff_mod_val.argtypes = [c_void_p, c_void_p] 3900isl.isl_aff_mul.restype = c_void_p 3901isl.isl_aff_mul.argtypes = [c_void_p, c_void_p] 3902isl.isl_aff_ne_set.restype = c_void_p 3903isl.isl_aff_ne_set.argtypes = [c_void_p, c_void_p] 3904isl.isl_aff_neg.restype = c_void_p 3905isl.isl_aff_neg.argtypes = [c_void_p] 3906isl.isl_aff_pullback_multi_aff.restype = c_void_p 3907isl.isl_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3908isl.isl_aff_scale_val.restype = c_void_p 3909isl.isl_aff_scale_val.argtypes = [c_void_p, c_void_p] 3910isl.isl_aff_scale_down_val.restype = c_void_p 3911isl.isl_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3912isl.isl_aff_sub.restype = c_void_p 3913isl.isl_aff_sub.argtypes = [c_void_p, c_void_p] 3914isl.isl_aff_unbind_params_insert_domain.restype = c_void_p 3915isl.isl_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 3916isl.isl_aff_zero_on_domain_space.restype = c_void_p 3917isl.isl_aff_zero_on_domain_space.argtypes = [c_void_p] 3918isl.isl_aff_copy.restype = c_void_p 3919isl.isl_aff_copy.argtypes = [c_void_p] 3920isl.isl_aff_free.restype = c_void_p 3921isl.isl_aff_free.argtypes = [c_void_p] 3922isl.isl_aff_to_str.restype = POINTER(c_char) 3923isl.isl_aff_to_str.argtypes = [c_void_p] 3924 3925class aff_list(object): 3926 def __init__(self, *args, **keywords): 3927 if "ptr" in keywords: 3928 self.ctx = keywords["ctx"] 3929 self.ptr = keywords["ptr"] 3930 return 3931 if len(args) == 1 and type(args[0]) == int: 3932 self.ctx = Context.getDefaultInstance() 3933 self.ptr = isl.isl_aff_list_alloc(self.ctx, args[0]) 3934 return 3935 if len(args) == 1 and args[0].__class__ is aff: 3936 self.ctx = Context.getDefaultInstance() 3937 self.ptr = isl.isl_aff_list_from_aff(isl.isl_aff_copy(args[0].ptr)) 3938 return 3939 raise Error 3940 def __del__(self): 3941 if hasattr(self, 'ptr'): 3942 isl.isl_aff_list_free(self.ptr) 3943 def __str__(arg0): 3944 try: 3945 if not arg0.__class__ is aff_list: 3946 arg0 = aff_list(arg0) 3947 except: 3948 raise 3949 ptr = isl.isl_aff_list_to_str(arg0.ptr) 3950 res = cast(ptr, c_char_p).value.decode('ascii') 3951 libc.free(ptr) 3952 return res 3953 def __repr__(self): 3954 s = str(self) 3955 if '"' in s: 3956 return 'isl.aff_list("""%s""")' % s 3957 else: 3958 return 'isl.aff_list("%s")' % s 3959 def add(arg0, arg1): 3960 try: 3961 if not arg0.__class__ is aff_list: 3962 arg0 = aff_list(arg0) 3963 except: 3964 raise 3965 try: 3966 if not arg1.__class__ is aff: 3967 arg1 = aff(arg1) 3968 except: 3969 raise 3970 ctx = arg0.ctx 3971 res = isl.isl_aff_list_add(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 3972 obj = aff_list(ctx=ctx, ptr=res) 3973 return obj 3974 def clear(arg0): 3975 try: 3976 if not arg0.__class__ is aff_list: 3977 arg0 = aff_list(arg0) 3978 except: 3979 raise 3980 ctx = arg0.ctx 3981 res = isl.isl_aff_list_clear(isl.isl_aff_list_copy(arg0.ptr)) 3982 obj = aff_list(ctx=ctx, ptr=res) 3983 return obj 3984 def concat(arg0, arg1): 3985 try: 3986 if not arg0.__class__ is aff_list: 3987 arg0 = aff_list(arg0) 3988 except: 3989 raise 3990 try: 3991 if not arg1.__class__ is aff_list: 3992 arg1 = aff_list(arg1) 3993 except: 3994 raise 3995 ctx = arg0.ctx 3996 res = isl.isl_aff_list_concat(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_list_copy(arg1.ptr)) 3997 obj = aff_list(ctx=ctx, ptr=res) 3998 return obj 3999 def drop(arg0, arg1, arg2): 4000 try: 4001 if not arg0.__class__ is aff_list: 4002 arg0 = aff_list(arg0) 4003 except: 4004 raise 4005 ctx = arg0.ctx 4006 res = isl.isl_aff_list_drop(isl.isl_aff_list_copy(arg0.ptr), arg1, arg2) 4007 obj = aff_list(ctx=ctx, ptr=res) 4008 return obj 4009 def foreach(arg0, arg1): 4010 try: 4011 if not arg0.__class__ is aff_list: 4012 arg0 = aff_list(arg0) 4013 except: 4014 raise 4015 exc_info = [None] 4016 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 4017 def cb_func(cb_arg0, cb_arg1): 4018 cb_arg0 = aff(ctx=arg0.ctx, ptr=(cb_arg0)) 4019 try: 4020 arg1(cb_arg0) 4021 except: 4022 import sys 4023 exc_info[0] = sys.exc_info() 4024 return -1 4025 return 0 4026 cb = fn(cb_func) 4027 ctx = arg0.ctx 4028 res = isl.isl_aff_list_foreach(arg0.ptr, cb, None) 4029 if exc_info[0] != None: 4030 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 4031 if res < 0: 4032 raise 4033 def at(arg0, arg1): 4034 try: 4035 if not arg0.__class__ is aff_list: 4036 arg0 = aff_list(arg0) 4037 except: 4038 raise 4039 ctx = arg0.ctx 4040 res = isl.isl_aff_list_get_at(arg0.ptr, arg1) 4041 obj = aff(ctx=ctx, ptr=res) 4042 return obj 4043 def get_at(arg0, arg1): 4044 return arg0.at(arg1) 4045 def insert(arg0, arg1, arg2): 4046 try: 4047 if not arg0.__class__ is aff_list: 4048 arg0 = aff_list(arg0) 4049 except: 4050 raise 4051 try: 4052 if not arg2.__class__ is aff: 4053 arg2 = aff(arg2) 4054 except: 4055 raise 4056 ctx = arg0.ctx 4057 res = isl.isl_aff_list_insert(isl.isl_aff_list_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 4058 obj = aff_list(ctx=ctx, ptr=res) 4059 return obj 4060 def size(arg0): 4061 try: 4062 if not arg0.__class__ is aff_list: 4063 arg0 = aff_list(arg0) 4064 except: 4065 raise 4066 ctx = arg0.ctx 4067 res = isl.isl_aff_list_size(arg0.ptr) 4068 if res < 0: 4069 raise 4070 return int(res) 4071 4072isl.isl_aff_list_alloc.restype = c_void_p 4073isl.isl_aff_list_alloc.argtypes = [Context, c_int] 4074isl.isl_aff_list_from_aff.restype = c_void_p 4075isl.isl_aff_list_from_aff.argtypes = [c_void_p] 4076isl.isl_aff_list_add.restype = c_void_p 4077isl.isl_aff_list_add.argtypes = [c_void_p, c_void_p] 4078isl.isl_aff_list_clear.restype = c_void_p 4079isl.isl_aff_list_clear.argtypes = [c_void_p] 4080isl.isl_aff_list_concat.restype = c_void_p 4081isl.isl_aff_list_concat.argtypes = [c_void_p, c_void_p] 4082isl.isl_aff_list_drop.restype = c_void_p 4083isl.isl_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 4084isl.isl_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 4085isl.isl_aff_list_get_at.restype = c_void_p 4086isl.isl_aff_list_get_at.argtypes = [c_void_p, c_int] 4087isl.isl_aff_list_insert.restype = c_void_p 4088isl.isl_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 4089isl.isl_aff_list_size.argtypes = [c_void_p] 4090isl.isl_aff_list_copy.restype = c_void_p 4091isl.isl_aff_list_copy.argtypes = [c_void_p] 4092isl.isl_aff_list_free.restype = c_void_p 4093isl.isl_aff_list_free.argtypes = [c_void_p] 4094isl.isl_aff_list_to_str.restype = POINTER(c_char) 4095isl.isl_aff_list_to_str.argtypes = [c_void_p] 4096 4097class ast_build(object): 4098 def __init__(self, *args, **keywords): 4099 if "ptr" in keywords: 4100 self.ctx = keywords["ctx"] 4101 self.ptr = keywords["ptr"] 4102 return 4103 if len(args) == 0: 4104 self.ctx = Context.getDefaultInstance() 4105 self.ptr = isl.isl_ast_build_alloc(self.ctx) 4106 return 4107 raise Error 4108 def __del__(self): 4109 if hasattr(self, 'ptr'): 4110 isl.isl_ast_build_free(self.ptr) 4111 def copy_callbacks(self, obj): 4112 if hasattr(obj, 'at_each_domain'): 4113 self.at_each_domain = obj.at_each_domain 4114 def set_at_each_domain(arg0, arg1): 4115 try: 4116 if not arg0.__class__ is ast_build: 4117 arg0 = ast_build(arg0) 4118 except: 4119 raise 4120 exc_info = [None] 4121 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_void_p) 4122 def cb_func(cb_arg0, cb_arg1, cb_arg2): 4123 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 4124 cb_arg1 = ast_build(ctx=arg0.ctx, ptr=isl.isl_ast_build_copy(cb_arg1)) 4125 try: 4126 res = arg1(cb_arg0, cb_arg1) 4127 except: 4128 import sys 4129 exc_info[0] = sys.exc_info() 4130 return None 4131 return isl.isl_ast_node_copy(res.ptr) 4132 cb = fn(cb_func) 4133 ctx = arg0.ctx 4134 res = isl.isl_ast_build_set_at_each_domain(isl.isl_ast_build_copy(arg0.ptr), cb, None) 4135 if exc_info[0] != None: 4136 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 4137 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4138 exc_info = arg0.at_each_domain['exc_info'][0] 4139 arg0.at_each_domain['exc_info'][0] = None 4140 if exc_info != None: 4141 raise (exc_info[0], exc_info[1], exc_info[2]) 4142 obj = ast_build(ctx=ctx, ptr=res) 4143 obj.copy_callbacks(arg0) 4144 obj.at_each_domain = { 'func': cb, 'exc_info': exc_info } 4145 return obj 4146 def access_from(*args): 4147 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 4148 ctx = args[0].ctx 4149 res = isl.isl_ast_build_access_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 4150 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4151 exc_info = args[0].at_each_domain['exc_info'][0] 4152 args[0].at_each_domain['exc_info'][0] = None 4153 if exc_info != None: 4154 raise (exc_info[0], exc_info[1], exc_info[2]) 4155 obj = ast_expr(ctx=ctx, ptr=res) 4156 return obj 4157 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 4158 ctx = args[0].ctx 4159 res = isl.isl_ast_build_access_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 4160 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4161 exc_info = args[0].at_each_domain['exc_info'][0] 4162 args[0].at_each_domain['exc_info'][0] = None 4163 if exc_info != None: 4164 raise (exc_info[0], exc_info[1], exc_info[2]) 4165 obj = ast_expr(ctx=ctx, ptr=res) 4166 return obj 4167 raise Error 4168 def call_from(*args): 4169 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 4170 ctx = args[0].ctx 4171 res = isl.isl_ast_build_call_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 4172 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4173 exc_info = args[0].at_each_domain['exc_info'][0] 4174 args[0].at_each_domain['exc_info'][0] = None 4175 if exc_info != None: 4176 raise (exc_info[0], exc_info[1], exc_info[2]) 4177 obj = ast_expr(ctx=ctx, ptr=res) 4178 return obj 4179 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 4180 ctx = args[0].ctx 4181 res = isl.isl_ast_build_call_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 4182 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4183 exc_info = args[0].at_each_domain['exc_info'][0] 4184 args[0].at_each_domain['exc_info'][0] = None 4185 if exc_info != None: 4186 raise (exc_info[0], exc_info[1], exc_info[2]) 4187 obj = ast_expr(ctx=ctx, ptr=res) 4188 return obj 4189 raise Error 4190 def expr_from(*args): 4191 if len(args) == 2 and args[1].__class__ is pw_aff: 4192 ctx = args[0].ctx 4193 res = isl.isl_ast_build_expr_from_pw_aff(args[0].ptr, isl.isl_pw_aff_copy(args[1].ptr)) 4194 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4195 exc_info = args[0].at_each_domain['exc_info'][0] 4196 args[0].at_each_domain['exc_info'][0] = None 4197 if exc_info != None: 4198 raise (exc_info[0], exc_info[1], exc_info[2]) 4199 obj = ast_expr(ctx=ctx, ptr=res) 4200 return obj 4201 if len(args) == 2 and args[1].__class__ is set: 4202 ctx = args[0].ctx 4203 res = isl.isl_ast_build_expr_from_set(args[0].ptr, isl.isl_set_copy(args[1].ptr)) 4204 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4205 exc_info = args[0].at_each_domain['exc_info'][0] 4206 args[0].at_each_domain['exc_info'][0] = None 4207 if exc_info != None: 4208 raise (exc_info[0], exc_info[1], exc_info[2]) 4209 obj = ast_expr(ctx=ctx, ptr=res) 4210 return obj 4211 raise Error 4212 @staticmethod 4213 def from_context(arg0): 4214 try: 4215 if not arg0.__class__ is set: 4216 arg0 = set(arg0) 4217 except: 4218 raise 4219 ctx = arg0.ctx 4220 res = isl.isl_ast_build_from_context(isl.isl_set_copy(arg0.ptr)) 4221 obj = ast_build(ctx=ctx, ptr=res) 4222 return obj 4223 def schedule(arg0): 4224 try: 4225 if not arg0.__class__ is ast_build: 4226 arg0 = ast_build(arg0) 4227 except: 4228 raise 4229 ctx = arg0.ctx 4230 res = isl.isl_ast_build_get_schedule(arg0.ptr) 4231 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4232 exc_info = arg0.at_each_domain['exc_info'][0] 4233 arg0.at_each_domain['exc_info'][0] = None 4234 if exc_info != None: 4235 raise (exc_info[0], exc_info[1], exc_info[2]) 4236 obj = union_map(ctx=ctx, ptr=res) 4237 return obj 4238 def get_schedule(arg0): 4239 return arg0.schedule() 4240 def node_from(*args): 4241 if len(args) == 2 and args[1].__class__ is schedule: 4242 ctx = args[0].ctx 4243 res = isl.isl_ast_build_node_from_schedule(args[0].ptr, isl.isl_schedule_copy(args[1].ptr)) 4244 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4245 exc_info = args[0].at_each_domain['exc_info'][0] 4246 args[0].at_each_domain['exc_info'][0] = None 4247 if exc_info != None: 4248 raise (exc_info[0], exc_info[1], exc_info[2]) 4249 obj = ast_node(ctx=ctx, ptr=res) 4250 return obj 4251 raise Error 4252 def node_from_schedule_map(arg0, arg1): 4253 try: 4254 if not arg0.__class__ is ast_build: 4255 arg0 = ast_build(arg0) 4256 except: 4257 raise 4258 try: 4259 if not arg1.__class__ is union_map: 4260 arg1 = union_map(arg1) 4261 except: 4262 raise 4263 ctx = arg0.ctx 4264 res = isl.isl_ast_build_node_from_schedule_map(arg0.ptr, isl.isl_union_map_copy(arg1.ptr)) 4265 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4266 exc_info = arg0.at_each_domain['exc_info'][0] 4267 arg0.at_each_domain['exc_info'][0] = None 4268 if exc_info != None: 4269 raise (exc_info[0], exc_info[1], exc_info[2]) 4270 obj = ast_node(ctx=ctx, ptr=res) 4271 return obj 4272 4273isl.isl_ast_build_alloc.restype = c_void_p 4274isl.isl_ast_build_alloc.argtypes = [Context] 4275isl.isl_ast_build_set_at_each_domain.restype = c_void_p 4276isl.isl_ast_build_set_at_each_domain.argtypes = [c_void_p, c_void_p, c_void_p] 4277isl.isl_ast_build_access_from_multi_pw_aff.restype = c_void_p 4278isl.isl_ast_build_access_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 4279isl.isl_ast_build_access_from_pw_multi_aff.restype = c_void_p 4280isl.isl_ast_build_access_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 4281isl.isl_ast_build_call_from_multi_pw_aff.restype = c_void_p 4282isl.isl_ast_build_call_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 4283isl.isl_ast_build_call_from_pw_multi_aff.restype = c_void_p 4284isl.isl_ast_build_call_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 4285isl.isl_ast_build_expr_from_pw_aff.restype = c_void_p 4286isl.isl_ast_build_expr_from_pw_aff.argtypes = [c_void_p, c_void_p] 4287isl.isl_ast_build_expr_from_set.restype = c_void_p 4288isl.isl_ast_build_expr_from_set.argtypes = [c_void_p, c_void_p] 4289isl.isl_ast_build_from_context.restype = c_void_p 4290isl.isl_ast_build_from_context.argtypes = [c_void_p] 4291isl.isl_ast_build_get_schedule.restype = c_void_p 4292isl.isl_ast_build_get_schedule.argtypes = [c_void_p] 4293isl.isl_ast_build_node_from_schedule.restype = c_void_p 4294isl.isl_ast_build_node_from_schedule.argtypes = [c_void_p, c_void_p] 4295isl.isl_ast_build_node_from_schedule_map.restype = c_void_p 4296isl.isl_ast_build_node_from_schedule_map.argtypes = [c_void_p, c_void_p] 4297isl.isl_ast_build_copy.restype = c_void_p 4298isl.isl_ast_build_copy.argtypes = [c_void_p] 4299isl.isl_ast_build_free.restype = c_void_p 4300isl.isl_ast_build_free.argtypes = [c_void_p] 4301 4302class ast_expr(object): 4303 def __init__(self, *args, **keywords): 4304 if "ptr" in keywords: 4305 self.ctx = keywords["ctx"] 4306 self.ptr = keywords["ptr"] 4307 return 4308 if len(args) == 1 and isinstance(args[0], ast_expr_op): 4309 self.ctx = args[0].ctx 4310 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4311 return 4312 if len(args) == 1 and isinstance(args[0], ast_expr_id): 4313 self.ctx = args[0].ctx 4314 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4315 return 4316 if len(args) == 1 and isinstance(args[0], ast_expr_int): 4317 self.ctx = args[0].ctx 4318 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4319 return 4320 raise Error 4321 def __del__(self): 4322 if hasattr(self, 'ptr'): 4323 isl.isl_ast_expr_free(self.ptr) 4324 def __new__(cls, *args, **keywords): 4325 if "ptr" in keywords: 4326 type = isl.isl_ast_expr_get_type(keywords["ptr"]) 4327 if type == 0: 4328 return ast_expr_op(**keywords) 4329 if type == 1: 4330 return ast_expr_id(**keywords) 4331 if type == 2: 4332 return ast_expr_int(**keywords) 4333 raise 4334 return super(ast_expr, cls).__new__(cls) 4335 def __str__(arg0): 4336 try: 4337 if not arg0.__class__ is ast_expr: 4338 arg0 = ast_expr(arg0) 4339 except: 4340 raise 4341 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4342 res = cast(ptr, c_char_p).value.decode('ascii') 4343 libc.free(ptr) 4344 return res 4345 def __repr__(self): 4346 s = str(self) 4347 if '"' in s: 4348 return 'isl.ast_expr("""%s""")' % s 4349 else: 4350 return 'isl.ast_expr("%s")' % s 4351 def to_C_str(arg0): 4352 try: 4353 if not arg0.__class__ is ast_expr: 4354 arg0 = ast_expr(arg0) 4355 except: 4356 raise 4357 ctx = arg0.ctx 4358 res = isl.isl_ast_expr_to_C_str(arg0.ptr) 4359 if res == 0: 4360 raise 4361 string = cast(res, c_char_p).value.decode('ascii') 4362 libc.free(res) 4363 return string 4364 4365isl.isl_ast_expr_to_C_str.restype = POINTER(c_char) 4366isl.isl_ast_expr_to_C_str.argtypes = [c_void_p] 4367isl.isl_ast_expr_copy.restype = c_void_p 4368isl.isl_ast_expr_copy.argtypes = [c_void_p] 4369isl.isl_ast_expr_free.restype = c_void_p 4370isl.isl_ast_expr_free.argtypes = [c_void_p] 4371isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4372isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4373isl.isl_ast_expr_get_type.argtypes = [c_void_p] 4374 4375class ast_expr_id(ast_expr): 4376 def __init__(self, *args, **keywords): 4377 if "ptr" in keywords: 4378 self.ctx = keywords["ctx"] 4379 self.ptr = keywords["ptr"] 4380 return 4381 raise Error 4382 def __del__(self): 4383 if hasattr(self, 'ptr'): 4384 isl.isl_ast_expr_free(self.ptr) 4385 def __new__(cls, *args, **keywords): 4386 return super(ast_expr_id, cls).__new__(cls) 4387 def __str__(arg0): 4388 try: 4389 if not arg0.__class__ is ast_expr_id: 4390 arg0 = ast_expr_id(arg0) 4391 except: 4392 raise 4393 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4394 res = cast(ptr, c_char_p).value.decode('ascii') 4395 libc.free(ptr) 4396 return res 4397 def __repr__(self): 4398 s = str(self) 4399 if '"' in s: 4400 return 'isl.ast_expr_id("""%s""")' % s 4401 else: 4402 return 'isl.ast_expr_id("%s")' % s 4403 def id(arg0): 4404 try: 4405 if not arg0.__class__ is ast_expr: 4406 arg0 = ast_expr(arg0) 4407 except: 4408 raise 4409 ctx = arg0.ctx 4410 res = isl.isl_ast_expr_id_get_id(arg0.ptr) 4411 obj = id(ctx=ctx, ptr=res) 4412 return obj 4413 def get_id(arg0): 4414 return arg0.id() 4415 4416isl.isl_ast_expr_id_get_id.restype = c_void_p 4417isl.isl_ast_expr_id_get_id.argtypes = [c_void_p] 4418isl.isl_ast_expr_copy.restype = c_void_p 4419isl.isl_ast_expr_copy.argtypes = [c_void_p] 4420isl.isl_ast_expr_free.restype = c_void_p 4421isl.isl_ast_expr_free.argtypes = [c_void_p] 4422isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4423isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4424 4425class ast_expr_int(ast_expr): 4426 def __init__(self, *args, **keywords): 4427 if "ptr" in keywords: 4428 self.ctx = keywords["ctx"] 4429 self.ptr = keywords["ptr"] 4430 return 4431 raise Error 4432 def __del__(self): 4433 if hasattr(self, 'ptr'): 4434 isl.isl_ast_expr_free(self.ptr) 4435 def __new__(cls, *args, **keywords): 4436 return super(ast_expr_int, cls).__new__(cls) 4437 def __str__(arg0): 4438 try: 4439 if not arg0.__class__ is ast_expr_int: 4440 arg0 = ast_expr_int(arg0) 4441 except: 4442 raise 4443 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4444 res = cast(ptr, c_char_p).value.decode('ascii') 4445 libc.free(ptr) 4446 return res 4447 def __repr__(self): 4448 s = str(self) 4449 if '"' in s: 4450 return 'isl.ast_expr_int("""%s""")' % s 4451 else: 4452 return 'isl.ast_expr_int("%s")' % s 4453 def val(arg0): 4454 try: 4455 if not arg0.__class__ is ast_expr: 4456 arg0 = ast_expr(arg0) 4457 except: 4458 raise 4459 ctx = arg0.ctx 4460 res = isl.isl_ast_expr_int_get_val(arg0.ptr) 4461 obj = val(ctx=ctx, ptr=res) 4462 return obj 4463 def get_val(arg0): 4464 return arg0.val() 4465 4466isl.isl_ast_expr_int_get_val.restype = c_void_p 4467isl.isl_ast_expr_int_get_val.argtypes = [c_void_p] 4468isl.isl_ast_expr_copy.restype = c_void_p 4469isl.isl_ast_expr_copy.argtypes = [c_void_p] 4470isl.isl_ast_expr_free.restype = c_void_p 4471isl.isl_ast_expr_free.argtypes = [c_void_p] 4472isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4473isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4474 4475class ast_expr_op(ast_expr): 4476 def __init__(self, *args, **keywords): 4477 if "ptr" in keywords: 4478 self.ctx = keywords["ctx"] 4479 self.ptr = keywords["ptr"] 4480 return 4481 if len(args) == 1 and isinstance(args[0], ast_expr_op_and): 4482 self.ctx = args[0].ctx 4483 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4484 return 4485 if len(args) == 1 and isinstance(args[0], ast_expr_op_and_then): 4486 self.ctx = args[0].ctx 4487 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4488 return 4489 if len(args) == 1 and isinstance(args[0], ast_expr_op_or): 4490 self.ctx = args[0].ctx 4491 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4492 return 4493 if len(args) == 1 and isinstance(args[0], ast_expr_op_or_else): 4494 self.ctx = args[0].ctx 4495 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4496 return 4497 if len(args) == 1 and isinstance(args[0], ast_expr_op_max): 4498 self.ctx = args[0].ctx 4499 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4500 return 4501 if len(args) == 1 and isinstance(args[0], ast_expr_op_min): 4502 self.ctx = args[0].ctx 4503 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4504 return 4505 if len(args) == 1 and isinstance(args[0], ast_expr_op_minus): 4506 self.ctx = args[0].ctx 4507 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4508 return 4509 if len(args) == 1 and isinstance(args[0], ast_expr_op_add): 4510 self.ctx = args[0].ctx 4511 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4512 return 4513 if len(args) == 1 and isinstance(args[0], ast_expr_op_sub): 4514 self.ctx = args[0].ctx 4515 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4516 return 4517 if len(args) == 1 and isinstance(args[0], ast_expr_op_mul): 4518 self.ctx = args[0].ctx 4519 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4520 return 4521 if len(args) == 1 and isinstance(args[0], ast_expr_op_div): 4522 self.ctx = args[0].ctx 4523 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4524 return 4525 if len(args) == 1 and isinstance(args[0], ast_expr_op_fdiv_q): 4526 self.ctx = args[0].ctx 4527 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4528 return 4529 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_q): 4530 self.ctx = args[0].ctx 4531 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4532 return 4533 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_r): 4534 self.ctx = args[0].ctx 4535 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4536 return 4537 if len(args) == 1 and isinstance(args[0], ast_expr_op_zdiv_r): 4538 self.ctx = args[0].ctx 4539 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4540 return 4541 if len(args) == 1 and isinstance(args[0], ast_expr_op_cond): 4542 self.ctx = args[0].ctx 4543 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4544 return 4545 if len(args) == 1 and isinstance(args[0], ast_expr_op_select): 4546 self.ctx = args[0].ctx 4547 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4548 return 4549 if len(args) == 1 and isinstance(args[0], ast_expr_op_eq): 4550 self.ctx = args[0].ctx 4551 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4552 return 4553 if len(args) == 1 and isinstance(args[0], ast_expr_op_le): 4554 self.ctx = args[0].ctx 4555 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4556 return 4557 if len(args) == 1 and isinstance(args[0], ast_expr_op_lt): 4558 self.ctx = args[0].ctx 4559 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4560 return 4561 if len(args) == 1 and isinstance(args[0], ast_expr_op_ge): 4562 self.ctx = args[0].ctx 4563 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4564 return 4565 if len(args) == 1 and isinstance(args[0], ast_expr_op_gt): 4566 self.ctx = args[0].ctx 4567 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4568 return 4569 if len(args) == 1 and isinstance(args[0], ast_expr_op_call): 4570 self.ctx = args[0].ctx 4571 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4572 return 4573 if len(args) == 1 and isinstance(args[0], ast_expr_op_access): 4574 self.ctx = args[0].ctx 4575 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4576 return 4577 if len(args) == 1 and isinstance(args[0], ast_expr_op_member): 4578 self.ctx = args[0].ctx 4579 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4580 return 4581 if len(args) == 1 and isinstance(args[0], ast_expr_op_address_of): 4582 self.ctx = args[0].ctx 4583 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4584 return 4585 raise Error 4586 def __del__(self): 4587 if hasattr(self, 'ptr'): 4588 isl.isl_ast_expr_free(self.ptr) 4589 def __new__(cls, *args, **keywords): 4590 if "ptr" in keywords: 4591 type = isl.isl_ast_expr_op_get_type(keywords["ptr"]) 4592 if type == 0: 4593 return ast_expr_op_and(**keywords) 4594 if type == 1: 4595 return ast_expr_op_and_then(**keywords) 4596 if type == 2: 4597 return ast_expr_op_or(**keywords) 4598 if type == 3: 4599 return ast_expr_op_or_else(**keywords) 4600 if type == 4: 4601 return ast_expr_op_max(**keywords) 4602 if type == 5: 4603 return ast_expr_op_min(**keywords) 4604 if type == 6: 4605 return ast_expr_op_minus(**keywords) 4606 if type == 7: 4607 return ast_expr_op_add(**keywords) 4608 if type == 8: 4609 return ast_expr_op_sub(**keywords) 4610 if type == 9: 4611 return ast_expr_op_mul(**keywords) 4612 if type == 10: 4613 return ast_expr_op_div(**keywords) 4614 if type == 11: 4615 return ast_expr_op_fdiv_q(**keywords) 4616 if type == 12: 4617 return ast_expr_op_pdiv_q(**keywords) 4618 if type == 13: 4619 return ast_expr_op_pdiv_r(**keywords) 4620 if type == 14: 4621 return ast_expr_op_zdiv_r(**keywords) 4622 if type == 15: 4623 return ast_expr_op_cond(**keywords) 4624 if type == 16: 4625 return ast_expr_op_select(**keywords) 4626 if type == 17: 4627 return ast_expr_op_eq(**keywords) 4628 if type == 18: 4629 return ast_expr_op_le(**keywords) 4630 if type == 19: 4631 return ast_expr_op_lt(**keywords) 4632 if type == 20: 4633 return ast_expr_op_ge(**keywords) 4634 if type == 21: 4635 return ast_expr_op_gt(**keywords) 4636 if type == 22: 4637 return ast_expr_op_call(**keywords) 4638 if type == 23: 4639 return ast_expr_op_access(**keywords) 4640 if type == 24: 4641 return ast_expr_op_member(**keywords) 4642 if type == 25: 4643 return ast_expr_op_address_of(**keywords) 4644 raise 4645 return super(ast_expr_op, cls).__new__(cls) 4646 def __str__(arg0): 4647 try: 4648 if not arg0.__class__ is ast_expr_op: 4649 arg0 = ast_expr_op(arg0) 4650 except: 4651 raise 4652 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4653 res = cast(ptr, c_char_p).value.decode('ascii') 4654 libc.free(ptr) 4655 return res 4656 def __repr__(self): 4657 s = str(self) 4658 if '"' in s: 4659 return 'isl.ast_expr_op("""%s""")' % s 4660 else: 4661 return 'isl.ast_expr_op("%s")' % s 4662 def arg(arg0, arg1): 4663 try: 4664 if not arg0.__class__ is ast_expr: 4665 arg0 = ast_expr(arg0) 4666 except: 4667 raise 4668 ctx = arg0.ctx 4669 res = isl.isl_ast_expr_op_get_arg(arg0.ptr, arg1) 4670 obj = ast_expr(ctx=ctx, ptr=res) 4671 return obj 4672 def get_arg(arg0, arg1): 4673 return arg0.arg(arg1) 4674 def n_arg(arg0): 4675 try: 4676 if not arg0.__class__ is ast_expr: 4677 arg0 = ast_expr(arg0) 4678 except: 4679 raise 4680 ctx = arg0.ctx 4681 res = isl.isl_ast_expr_op_get_n_arg(arg0.ptr) 4682 if res < 0: 4683 raise 4684 return int(res) 4685 def get_n_arg(arg0): 4686 return arg0.n_arg() 4687 4688isl.isl_ast_expr_op_get_arg.restype = c_void_p 4689isl.isl_ast_expr_op_get_arg.argtypes = [c_void_p, c_int] 4690isl.isl_ast_expr_op_get_n_arg.argtypes = [c_void_p] 4691isl.isl_ast_expr_copy.restype = c_void_p 4692isl.isl_ast_expr_copy.argtypes = [c_void_p] 4693isl.isl_ast_expr_free.restype = c_void_p 4694isl.isl_ast_expr_free.argtypes = [c_void_p] 4695isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4696isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4697isl.isl_ast_expr_op_get_type.argtypes = [c_void_p] 4698 4699class ast_expr_op_access(ast_expr_op): 4700 def __init__(self, *args, **keywords): 4701 if "ptr" in keywords: 4702 self.ctx = keywords["ctx"] 4703 self.ptr = keywords["ptr"] 4704 return 4705 raise Error 4706 def __del__(self): 4707 if hasattr(self, 'ptr'): 4708 isl.isl_ast_expr_free(self.ptr) 4709 def __new__(cls, *args, **keywords): 4710 return super(ast_expr_op_access, cls).__new__(cls) 4711 def __str__(arg0): 4712 try: 4713 if not arg0.__class__ is ast_expr_op_access: 4714 arg0 = ast_expr_op_access(arg0) 4715 except: 4716 raise 4717 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4718 res = cast(ptr, c_char_p).value.decode('ascii') 4719 libc.free(ptr) 4720 return res 4721 def __repr__(self): 4722 s = str(self) 4723 if '"' in s: 4724 return 'isl.ast_expr_op_access("""%s""")' % s 4725 else: 4726 return 'isl.ast_expr_op_access("%s")' % s 4727 4728isl.isl_ast_expr_copy.restype = c_void_p 4729isl.isl_ast_expr_copy.argtypes = [c_void_p] 4730isl.isl_ast_expr_free.restype = c_void_p 4731isl.isl_ast_expr_free.argtypes = [c_void_p] 4732isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4733isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4734 4735class ast_expr_op_add(ast_expr_op): 4736 def __init__(self, *args, **keywords): 4737 if "ptr" in keywords: 4738 self.ctx = keywords["ctx"] 4739 self.ptr = keywords["ptr"] 4740 return 4741 raise Error 4742 def __del__(self): 4743 if hasattr(self, 'ptr'): 4744 isl.isl_ast_expr_free(self.ptr) 4745 def __new__(cls, *args, **keywords): 4746 return super(ast_expr_op_add, cls).__new__(cls) 4747 def __str__(arg0): 4748 try: 4749 if not arg0.__class__ is ast_expr_op_add: 4750 arg0 = ast_expr_op_add(arg0) 4751 except: 4752 raise 4753 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4754 res = cast(ptr, c_char_p).value.decode('ascii') 4755 libc.free(ptr) 4756 return res 4757 def __repr__(self): 4758 s = str(self) 4759 if '"' in s: 4760 return 'isl.ast_expr_op_add("""%s""")' % s 4761 else: 4762 return 'isl.ast_expr_op_add("%s")' % s 4763 4764isl.isl_ast_expr_copy.restype = c_void_p 4765isl.isl_ast_expr_copy.argtypes = [c_void_p] 4766isl.isl_ast_expr_free.restype = c_void_p 4767isl.isl_ast_expr_free.argtypes = [c_void_p] 4768isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4769isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4770 4771class ast_expr_op_address_of(ast_expr_op): 4772 def __init__(self, *args, **keywords): 4773 if "ptr" in keywords: 4774 self.ctx = keywords["ctx"] 4775 self.ptr = keywords["ptr"] 4776 return 4777 raise Error 4778 def __del__(self): 4779 if hasattr(self, 'ptr'): 4780 isl.isl_ast_expr_free(self.ptr) 4781 def __new__(cls, *args, **keywords): 4782 return super(ast_expr_op_address_of, cls).__new__(cls) 4783 def __str__(arg0): 4784 try: 4785 if not arg0.__class__ is ast_expr_op_address_of: 4786 arg0 = ast_expr_op_address_of(arg0) 4787 except: 4788 raise 4789 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4790 res = cast(ptr, c_char_p).value.decode('ascii') 4791 libc.free(ptr) 4792 return res 4793 def __repr__(self): 4794 s = str(self) 4795 if '"' in s: 4796 return 'isl.ast_expr_op_address_of("""%s""")' % s 4797 else: 4798 return 'isl.ast_expr_op_address_of("%s")' % s 4799 4800isl.isl_ast_expr_copy.restype = c_void_p 4801isl.isl_ast_expr_copy.argtypes = [c_void_p] 4802isl.isl_ast_expr_free.restype = c_void_p 4803isl.isl_ast_expr_free.argtypes = [c_void_p] 4804isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4805isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4806 4807class ast_expr_op_and(ast_expr_op): 4808 def __init__(self, *args, **keywords): 4809 if "ptr" in keywords: 4810 self.ctx = keywords["ctx"] 4811 self.ptr = keywords["ptr"] 4812 return 4813 raise Error 4814 def __del__(self): 4815 if hasattr(self, 'ptr'): 4816 isl.isl_ast_expr_free(self.ptr) 4817 def __new__(cls, *args, **keywords): 4818 return super(ast_expr_op_and, cls).__new__(cls) 4819 def __str__(arg0): 4820 try: 4821 if not arg0.__class__ is ast_expr_op_and: 4822 arg0 = ast_expr_op_and(arg0) 4823 except: 4824 raise 4825 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4826 res = cast(ptr, c_char_p).value.decode('ascii') 4827 libc.free(ptr) 4828 return res 4829 def __repr__(self): 4830 s = str(self) 4831 if '"' in s: 4832 return 'isl.ast_expr_op_and("""%s""")' % s 4833 else: 4834 return 'isl.ast_expr_op_and("%s")' % s 4835 4836isl.isl_ast_expr_copy.restype = c_void_p 4837isl.isl_ast_expr_copy.argtypes = [c_void_p] 4838isl.isl_ast_expr_free.restype = c_void_p 4839isl.isl_ast_expr_free.argtypes = [c_void_p] 4840isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4841isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4842 4843class ast_expr_op_and_then(ast_expr_op): 4844 def __init__(self, *args, **keywords): 4845 if "ptr" in keywords: 4846 self.ctx = keywords["ctx"] 4847 self.ptr = keywords["ptr"] 4848 return 4849 raise Error 4850 def __del__(self): 4851 if hasattr(self, 'ptr'): 4852 isl.isl_ast_expr_free(self.ptr) 4853 def __new__(cls, *args, **keywords): 4854 return super(ast_expr_op_and_then, cls).__new__(cls) 4855 def __str__(arg0): 4856 try: 4857 if not arg0.__class__ is ast_expr_op_and_then: 4858 arg0 = ast_expr_op_and_then(arg0) 4859 except: 4860 raise 4861 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4862 res = cast(ptr, c_char_p).value.decode('ascii') 4863 libc.free(ptr) 4864 return res 4865 def __repr__(self): 4866 s = str(self) 4867 if '"' in s: 4868 return 'isl.ast_expr_op_and_then("""%s""")' % s 4869 else: 4870 return 'isl.ast_expr_op_and_then("%s")' % s 4871 4872isl.isl_ast_expr_copy.restype = c_void_p 4873isl.isl_ast_expr_copy.argtypes = [c_void_p] 4874isl.isl_ast_expr_free.restype = c_void_p 4875isl.isl_ast_expr_free.argtypes = [c_void_p] 4876isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4877isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4878 4879class ast_expr_op_call(ast_expr_op): 4880 def __init__(self, *args, **keywords): 4881 if "ptr" in keywords: 4882 self.ctx = keywords["ctx"] 4883 self.ptr = keywords["ptr"] 4884 return 4885 raise Error 4886 def __del__(self): 4887 if hasattr(self, 'ptr'): 4888 isl.isl_ast_expr_free(self.ptr) 4889 def __new__(cls, *args, **keywords): 4890 return super(ast_expr_op_call, cls).__new__(cls) 4891 def __str__(arg0): 4892 try: 4893 if not arg0.__class__ is ast_expr_op_call: 4894 arg0 = ast_expr_op_call(arg0) 4895 except: 4896 raise 4897 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4898 res = cast(ptr, c_char_p).value.decode('ascii') 4899 libc.free(ptr) 4900 return res 4901 def __repr__(self): 4902 s = str(self) 4903 if '"' in s: 4904 return 'isl.ast_expr_op_call("""%s""")' % s 4905 else: 4906 return 'isl.ast_expr_op_call("%s")' % s 4907 4908isl.isl_ast_expr_copy.restype = c_void_p 4909isl.isl_ast_expr_copy.argtypes = [c_void_p] 4910isl.isl_ast_expr_free.restype = c_void_p 4911isl.isl_ast_expr_free.argtypes = [c_void_p] 4912isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4913isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4914 4915class ast_expr_op_cond(ast_expr_op): 4916 def __init__(self, *args, **keywords): 4917 if "ptr" in keywords: 4918 self.ctx = keywords["ctx"] 4919 self.ptr = keywords["ptr"] 4920 return 4921 raise Error 4922 def __del__(self): 4923 if hasattr(self, 'ptr'): 4924 isl.isl_ast_expr_free(self.ptr) 4925 def __new__(cls, *args, **keywords): 4926 return super(ast_expr_op_cond, cls).__new__(cls) 4927 def __str__(arg0): 4928 try: 4929 if not arg0.__class__ is ast_expr_op_cond: 4930 arg0 = ast_expr_op_cond(arg0) 4931 except: 4932 raise 4933 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4934 res = cast(ptr, c_char_p).value.decode('ascii') 4935 libc.free(ptr) 4936 return res 4937 def __repr__(self): 4938 s = str(self) 4939 if '"' in s: 4940 return 'isl.ast_expr_op_cond("""%s""")' % s 4941 else: 4942 return 'isl.ast_expr_op_cond("%s")' % s 4943 4944isl.isl_ast_expr_copy.restype = c_void_p 4945isl.isl_ast_expr_copy.argtypes = [c_void_p] 4946isl.isl_ast_expr_free.restype = c_void_p 4947isl.isl_ast_expr_free.argtypes = [c_void_p] 4948isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4949isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4950 4951class ast_expr_op_div(ast_expr_op): 4952 def __init__(self, *args, **keywords): 4953 if "ptr" in keywords: 4954 self.ctx = keywords["ctx"] 4955 self.ptr = keywords["ptr"] 4956 return 4957 raise Error 4958 def __del__(self): 4959 if hasattr(self, 'ptr'): 4960 isl.isl_ast_expr_free(self.ptr) 4961 def __new__(cls, *args, **keywords): 4962 return super(ast_expr_op_div, cls).__new__(cls) 4963 def __str__(arg0): 4964 try: 4965 if not arg0.__class__ is ast_expr_op_div: 4966 arg0 = ast_expr_op_div(arg0) 4967 except: 4968 raise 4969 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4970 res = cast(ptr, c_char_p).value.decode('ascii') 4971 libc.free(ptr) 4972 return res 4973 def __repr__(self): 4974 s = str(self) 4975 if '"' in s: 4976 return 'isl.ast_expr_op_div("""%s""")' % s 4977 else: 4978 return 'isl.ast_expr_op_div("%s")' % s 4979 4980isl.isl_ast_expr_copy.restype = c_void_p 4981isl.isl_ast_expr_copy.argtypes = [c_void_p] 4982isl.isl_ast_expr_free.restype = c_void_p 4983isl.isl_ast_expr_free.argtypes = [c_void_p] 4984isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4985isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4986 4987class ast_expr_op_eq(ast_expr_op): 4988 def __init__(self, *args, **keywords): 4989 if "ptr" in keywords: 4990 self.ctx = keywords["ctx"] 4991 self.ptr = keywords["ptr"] 4992 return 4993 raise Error 4994 def __del__(self): 4995 if hasattr(self, 'ptr'): 4996 isl.isl_ast_expr_free(self.ptr) 4997 def __new__(cls, *args, **keywords): 4998 return super(ast_expr_op_eq, cls).__new__(cls) 4999 def __str__(arg0): 5000 try: 5001 if not arg0.__class__ is ast_expr_op_eq: 5002 arg0 = ast_expr_op_eq(arg0) 5003 except: 5004 raise 5005 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5006 res = cast(ptr, c_char_p).value.decode('ascii') 5007 libc.free(ptr) 5008 return res 5009 def __repr__(self): 5010 s = str(self) 5011 if '"' in s: 5012 return 'isl.ast_expr_op_eq("""%s""")' % s 5013 else: 5014 return 'isl.ast_expr_op_eq("%s")' % s 5015 5016isl.isl_ast_expr_copy.restype = c_void_p 5017isl.isl_ast_expr_copy.argtypes = [c_void_p] 5018isl.isl_ast_expr_free.restype = c_void_p 5019isl.isl_ast_expr_free.argtypes = [c_void_p] 5020isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5021isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5022 5023class ast_expr_op_fdiv_q(ast_expr_op): 5024 def __init__(self, *args, **keywords): 5025 if "ptr" in keywords: 5026 self.ctx = keywords["ctx"] 5027 self.ptr = keywords["ptr"] 5028 return 5029 raise Error 5030 def __del__(self): 5031 if hasattr(self, 'ptr'): 5032 isl.isl_ast_expr_free(self.ptr) 5033 def __new__(cls, *args, **keywords): 5034 return super(ast_expr_op_fdiv_q, cls).__new__(cls) 5035 def __str__(arg0): 5036 try: 5037 if not arg0.__class__ is ast_expr_op_fdiv_q: 5038 arg0 = ast_expr_op_fdiv_q(arg0) 5039 except: 5040 raise 5041 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5042 res = cast(ptr, c_char_p).value.decode('ascii') 5043 libc.free(ptr) 5044 return res 5045 def __repr__(self): 5046 s = str(self) 5047 if '"' in s: 5048 return 'isl.ast_expr_op_fdiv_q("""%s""")' % s 5049 else: 5050 return 'isl.ast_expr_op_fdiv_q("%s")' % s 5051 5052isl.isl_ast_expr_copy.restype = c_void_p 5053isl.isl_ast_expr_copy.argtypes = [c_void_p] 5054isl.isl_ast_expr_free.restype = c_void_p 5055isl.isl_ast_expr_free.argtypes = [c_void_p] 5056isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5057isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5058 5059class ast_expr_op_ge(ast_expr_op): 5060 def __init__(self, *args, **keywords): 5061 if "ptr" in keywords: 5062 self.ctx = keywords["ctx"] 5063 self.ptr = keywords["ptr"] 5064 return 5065 raise Error 5066 def __del__(self): 5067 if hasattr(self, 'ptr'): 5068 isl.isl_ast_expr_free(self.ptr) 5069 def __new__(cls, *args, **keywords): 5070 return super(ast_expr_op_ge, cls).__new__(cls) 5071 def __str__(arg0): 5072 try: 5073 if not arg0.__class__ is ast_expr_op_ge: 5074 arg0 = ast_expr_op_ge(arg0) 5075 except: 5076 raise 5077 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5078 res = cast(ptr, c_char_p).value.decode('ascii') 5079 libc.free(ptr) 5080 return res 5081 def __repr__(self): 5082 s = str(self) 5083 if '"' in s: 5084 return 'isl.ast_expr_op_ge("""%s""")' % s 5085 else: 5086 return 'isl.ast_expr_op_ge("%s")' % s 5087 5088isl.isl_ast_expr_copy.restype = c_void_p 5089isl.isl_ast_expr_copy.argtypes = [c_void_p] 5090isl.isl_ast_expr_free.restype = c_void_p 5091isl.isl_ast_expr_free.argtypes = [c_void_p] 5092isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5093isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5094 5095class ast_expr_op_gt(ast_expr_op): 5096 def __init__(self, *args, **keywords): 5097 if "ptr" in keywords: 5098 self.ctx = keywords["ctx"] 5099 self.ptr = keywords["ptr"] 5100 return 5101 raise Error 5102 def __del__(self): 5103 if hasattr(self, 'ptr'): 5104 isl.isl_ast_expr_free(self.ptr) 5105 def __new__(cls, *args, **keywords): 5106 return super(ast_expr_op_gt, cls).__new__(cls) 5107 def __str__(arg0): 5108 try: 5109 if not arg0.__class__ is ast_expr_op_gt: 5110 arg0 = ast_expr_op_gt(arg0) 5111 except: 5112 raise 5113 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5114 res = cast(ptr, c_char_p).value.decode('ascii') 5115 libc.free(ptr) 5116 return res 5117 def __repr__(self): 5118 s = str(self) 5119 if '"' in s: 5120 return 'isl.ast_expr_op_gt("""%s""")' % s 5121 else: 5122 return 'isl.ast_expr_op_gt("%s")' % s 5123 5124isl.isl_ast_expr_copy.restype = c_void_p 5125isl.isl_ast_expr_copy.argtypes = [c_void_p] 5126isl.isl_ast_expr_free.restype = c_void_p 5127isl.isl_ast_expr_free.argtypes = [c_void_p] 5128isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5129isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5130 5131class ast_expr_op_le(ast_expr_op): 5132 def __init__(self, *args, **keywords): 5133 if "ptr" in keywords: 5134 self.ctx = keywords["ctx"] 5135 self.ptr = keywords["ptr"] 5136 return 5137 raise Error 5138 def __del__(self): 5139 if hasattr(self, 'ptr'): 5140 isl.isl_ast_expr_free(self.ptr) 5141 def __new__(cls, *args, **keywords): 5142 return super(ast_expr_op_le, cls).__new__(cls) 5143 def __str__(arg0): 5144 try: 5145 if not arg0.__class__ is ast_expr_op_le: 5146 arg0 = ast_expr_op_le(arg0) 5147 except: 5148 raise 5149 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5150 res = cast(ptr, c_char_p).value.decode('ascii') 5151 libc.free(ptr) 5152 return res 5153 def __repr__(self): 5154 s = str(self) 5155 if '"' in s: 5156 return 'isl.ast_expr_op_le("""%s""")' % s 5157 else: 5158 return 'isl.ast_expr_op_le("%s")' % s 5159 5160isl.isl_ast_expr_copy.restype = c_void_p 5161isl.isl_ast_expr_copy.argtypes = [c_void_p] 5162isl.isl_ast_expr_free.restype = c_void_p 5163isl.isl_ast_expr_free.argtypes = [c_void_p] 5164isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5165isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5166 5167class ast_expr_op_lt(ast_expr_op): 5168 def __init__(self, *args, **keywords): 5169 if "ptr" in keywords: 5170 self.ctx = keywords["ctx"] 5171 self.ptr = keywords["ptr"] 5172 return 5173 raise Error 5174 def __del__(self): 5175 if hasattr(self, 'ptr'): 5176 isl.isl_ast_expr_free(self.ptr) 5177 def __new__(cls, *args, **keywords): 5178 return super(ast_expr_op_lt, cls).__new__(cls) 5179 def __str__(arg0): 5180 try: 5181 if not arg0.__class__ is ast_expr_op_lt: 5182 arg0 = ast_expr_op_lt(arg0) 5183 except: 5184 raise 5185 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5186 res = cast(ptr, c_char_p).value.decode('ascii') 5187 libc.free(ptr) 5188 return res 5189 def __repr__(self): 5190 s = str(self) 5191 if '"' in s: 5192 return 'isl.ast_expr_op_lt("""%s""")' % s 5193 else: 5194 return 'isl.ast_expr_op_lt("%s")' % s 5195 5196isl.isl_ast_expr_copy.restype = c_void_p 5197isl.isl_ast_expr_copy.argtypes = [c_void_p] 5198isl.isl_ast_expr_free.restype = c_void_p 5199isl.isl_ast_expr_free.argtypes = [c_void_p] 5200isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5201isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5202 5203class ast_expr_op_max(ast_expr_op): 5204 def __init__(self, *args, **keywords): 5205 if "ptr" in keywords: 5206 self.ctx = keywords["ctx"] 5207 self.ptr = keywords["ptr"] 5208 return 5209 raise Error 5210 def __del__(self): 5211 if hasattr(self, 'ptr'): 5212 isl.isl_ast_expr_free(self.ptr) 5213 def __new__(cls, *args, **keywords): 5214 return super(ast_expr_op_max, cls).__new__(cls) 5215 def __str__(arg0): 5216 try: 5217 if not arg0.__class__ is ast_expr_op_max: 5218 arg0 = ast_expr_op_max(arg0) 5219 except: 5220 raise 5221 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5222 res = cast(ptr, c_char_p).value.decode('ascii') 5223 libc.free(ptr) 5224 return res 5225 def __repr__(self): 5226 s = str(self) 5227 if '"' in s: 5228 return 'isl.ast_expr_op_max("""%s""")' % s 5229 else: 5230 return 'isl.ast_expr_op_max("%s")' % s 5231 5232isl.isl_ast_expr_copy.restype = c_void_p 5233isl.isl_ast_expr_copy.argtypes = [c_void_p] 5234isl.isl_ast_expr_free.restype = c_void_p 5235isl.isl_ast_expr_free.argtypes = [c_void_p] 5236isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5237isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5238 5239class ast_expr_op_member(ast_expr_op): 5240 def __init__(self, *args, **keywords): 5241 if "ptr" in keywords: 5242 self.ctx = keywords["ctx"] 5243 self.ptr = keywords["ptr"] 5244 return 5245 raise Error 5246 def __del__(self): 5247 if hasattr(self, 'ptr'): 5248 isl.isl_ast_expr_free(self.ptr) 5249 def __new__(cls, *args, **keywords): 5250 return super(ast_expr_op_member, cls).__new__(cls) 5251 def __str__(arg0): 5252 try: 5253 if not arg0.__class__ is ast_expr_op_member: 5254 arg0 = ast_expr_op_member(arg0) 5255 except: 5256 raise 5257 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5258 res = cast(ptr, c_char_p).value.decode('ascii') 5259 libc.free(ptr) 5260 return res 5261 def __repr__(self): 5262 s = str(self) 5263 if '"' in s: 5264 return 'isl.ast_expr_op_member("""%s""")' % s 5265 else: 5266 return 'isl.ast_expr_op_member("%s")' % s 5267 5268isl.isl_ast_expr_copy.restype = c_void_p 5269isl.isl_ast_expr_copy.argtypes = [c_void_p] 5270isl.isl_ast_expr_free.restype = c_void_p 5271isl.isl_ast_expr_free.argtypes = [c_void_p] 5272isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5273isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5274 5275class ast_expr_op_min(ast_expr_op): 5276 def __init__(self, *args, **keywords): 5277 if "ptr" in keywords: 5278 self.ctx = keywords["ctx"] 5279 self.ptr = keywords["ptr"] 5280 return 5281 raise Error 5282 def __del__(self): 5283 if hasattr(self, 'ptr'): 5284 isl.isl_ast_expr_free(self.ptr) 5285 def __new__(cls, *args, **keywords): 5286 return super(ast_expr_op_min, cls).__new__(cls) 5287 def __str__(arg0): 5288 try: 5289 if not arg0.__class__ is ast_expr_op_min: 5290 arg0 = ast_expr_op_min(arg0) 5291 except: 5292 raise 5293 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5294 res = cast(ptr, c_char_p).value.decode('ascii') 5295 libc.free(ptr) 5296 return res 5297 def __repr__(self): 5298 s = str(self) 5299 if '"' in s: 5300 return 'isl.ast_expr_op_min("""%s""")' % s 5301 else: 5302 return 'isl.ast_expr_op_min("%s")' % s 5303 5304isl.isl_ast_expr_copy.restype = c_void_p 5305isl.isl_ast_expr_copy.argtypes = [c_void_p] 5306isl.isl_ast_expr_free.restype = c_void_p 5307isl.isl_ast_expr_free.argtypes = [c_void_p] 5308isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5309isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5310 5311class ast_expr_op_minus(ast_expr_op): 5312 def __init__(self, *args, **keywords): 5313 if "ptr" in keywords: 5314 self.ctx = keywords["ctx"] 5315 self.ptr = keywords["ptr"] 5316 return 5317 raise Error 5318 def __del__(self): 5319 if hasattr(self, 'ptr'): 5320 isl.isl_ast_expr_free(self.ptr) 5321 def __new__(cls, *args, **keywords): 5322 return super(ast_expr_op_minus, cls).__new__(cls) 5323 def __str__(arg0): 5324 try: 5325 if not arg0.__class__ is ast_expr_op_minus: 5326 arg0 = ast_expr_op_minus(arg0) 5327 except: 5328 raise 5329 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5330 res = cast(ptr, c_char_p).value.decode('ascii') 5331 libc.free(ptr) 5332 return res 5333 def __repr__(self): 5334 s = str(self) 5335 if '"' in s: 5336 return 'isl.ast_expr_op_minus("""%s""")' % s 5337 else: 5338 return 'isl.ast_expr_op_minus("%s")' % s 5339 5340isl.isl_ast_expr_copy.restype = c_void_p 5341isl.isl_ast_expr_copy.argtypes = [c_void_p] 5342isl.isl_ast_expr_free.restype = c_void_p 5343isl.isl_ast_expr_free.argtypes = [c_void_p] 5344isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5345isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5346 5347class ast_expr_op_mul(ast_expr_op): 5348 def __init__(self, *args, **keywords): 5349 if "ptr" in keywords: 5350 self.ctx = keywords["ctx"] 5351 self.ptr = keywords["ptr"] 5352 return 5353 raise Error 5354 def __del__(self): 5355 if hasattr(self, 'ptr'): 5356 isl.isl_ast_expr_free(self.ptr) 5357 def __new__(cls, *args, **keywords): 5358 return super(ast_expr_op_mul, cls).__new__(cls) 5359 def __str__(arg0): 5360 try: 5361 if not arg0.__class__ is ast_expr_op_mul: 5362 arg0 = ast_expr_op_mul(arg0) 5363 except: 5364 raise 5365 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5366 res = cast(ptr, c_char_p).value.decode('ascii') 5367 libc.free(ptr) 5368 return res 5369 def __repr__(self): 5370 s = str(self) 5371 if '"' in s: 5372 return 'isl.ast_expr_op_mul("""%s""")' % s 5373 else: 5374 return 'isl.ast_expr_op_mul("%s")' % s 5375 5376isl.isl_ast_expr_copy.restype = c_void_p 5377isl.isl_ast_expr_copy.argtypes = [c_void_p] 5378isl.isl_ast_expr_free.restype = c_void_p 5379isl.isl_ast_expr_free.argtypes = [c_void_p] 5380isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5381isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5382 5383class ast_expr_op_or(ast_expr_op): 5384 def __init__(self, *args, **keywords): 5385 if "ptr" in keywords: 5386 self.ctx = keywords["ctx"] 5387 self.ptr = keywords["ptr"] 5388 return 5389 raise Error 5390 def __del__(self): 5391 if hasattr(self, 'ptr'): 5392 isl.isl_ast_expr_free(self.ptr) 5393 def __new__(cls, *args, **keywords): 5394 return super(ast_expr_op_or, cls).__new__(cls) 5395 def __str__(arg0): 5396 try: 5397 if not arg0.__class__ is ast_expr_op_or: 5398 arg0 = ast_expr_op_or(arg0) 5399 except: 5400 raise 5401 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5402 res = cast(ptr, c_char_p).value.decode('ascii') 5403 libc.free(ptr) 5404 return res 5405 def __repr__(self): 5406 s = str(self) 5407 if '"' in s: 5408 return 'isl.ast_expr_op_or("""%s""")' % s 5409 else: 5410 return 'isl.ast_expr_op_or("%s")' % s 5411 5412isl.isl_ast_expr_copy.restype = c_void_p 5413isl.isl_ast_expr_copy.argtypes = [c_void_p] 5414isl.isl_ast_expr_free.restype = c_void_p 5415isl.isl_ast_expr_free.argtypes = [c_void_p] 5416isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5417isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5418 5419class ast_expr_op_or_else(ast_expr_op): 5420 def __init__(self, *args, **keywords): 5421 if "ptr" in keywords: 5422 self.ctx = keywords["ctx"] 5423 self.ptr = keywords["ptr"] 5424 return 5425 raise Error 5426 def __del__(self): 5427 if hasattr(self, 'ptr'): 5428 isl.isl_ast_expr_free(self.ptr) 5429 def __new__(cls, *args, **keywords): 5430 return super(ast_expr_op_or_else, cls).__new__(cls) 5431 def __str__(arg0): 5432 try: 5433 if not arg0.__class__ is ast_expr_op_or_else: 5434 arg0 = ast_expr_op_or_else(arg0) 5435 except: 5436 raise 5437 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5438 res = cast(ptr, c_char_p).value.decode('ascii') 5439 libc.free(ptr) 5440 return res 5441 def __repr__(self): 5442 s = str(self) 5443 if '"' in s: 5444 return 'isl.ast_expr_op_or_else("""%s""")' % s 5445 else: 5446 return 'isl.ast_expr_op_or_else("%s")' % s 5447 5448isl.isl_ast_expr_copy.restype = c_void_p 5449isl.isl_ast_expr_copy.argtypes = [c_void_p] 5450isl.isl_ast_expr_free.restype = c_void_p 5451isl.isl_ast_expr_free.argtypes = [c_void_p] 5452isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5453isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5454 5455class ast_expr_op_pdiv_q(ast_expr_op): 5456 def __init__(self, *args, **keywords): 5457 if "ptr" in keywords: 5458 self.ctx = keywords["ctx"] 5459 self.ptr = keywords["ptr"] 5460 return 5461 raise Error 5462 def __del__(self): 5463 if hasattr(self, 'ptr'): 5464 isl.isl_ast_expr_free(self.ptr) 5465 def __new__(cls, *args, **keywords): 5466 return super(ast_expr_op_pdiv_q, cls).__new__(cls) 5467 def __str__(arg0): 5468 try: 5469 if not arg0.__class__ is ast_expr_op_pdiv_q: 5470 arg0 = ast_expr_op_pdiv_q(arg0) 5471 except: 5472 raise 5473 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5474 res = cast(ptr, c_char_p).value.decode('ascii') 5475 libc.free(ptr) 5476 return res 5477 def __repr__(self): 5478 s = str(self) 5479 if '"' in s: 5480 return 'isl.ast_expr_op_pdiv_q("""%s""")' % s 5481 else: 5482 return 'isl.ast_expr_op_pdiv_q("%s")' % s 5483 5484isl.isl_ast_expr_copy.restype = c_void_p 5485isl.isl_ast_expr_copy.argtypes = [c_void_p] 5486isl.isl_ast_expr_free.restype = c_void_p 5487isl.isl_ast_expr_free.argtypes = [c_void_p] 5488isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5489isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5490 5491class ast_expr_op_pdiv_r(ast_expr_op): 5492 def __init__(self, *args, **keywords): 5493 if "ptr" in keywords: 5494 self.ctx = keywords["ctx"] 5495 self.ptr = keywords["ptr"] 5496 return 5497 raise Error 5498 def __del__(self): 5499 if hasattr(self, 'ptr'): 5500 isl.isl_ast_expr_free(self.ptr) 5501 def __new__(cls, *args, **keywords): 5502 return super(ast_expr_op_pdiv_r, cls).__new__(cls) 5503 def __str__(arg0): 5504 try: 5505 if not arg0.__class__ is ast_expr_op_pdiv_r: 5506 arg0 = ast_expr_op_pdiv_r(arg0) 5507 except: 5508 raise 5509 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5510 res = cast(ptr, c_char_p).value.decode('ascii') 5511 libc.free(ptr) 5512 return res 5513 def __repr__(self): 5514 s = str(self) 5515 if '"' in s: 5516 return 'isl.ast_expr_op_pdiv_r("""%s""")' % s 5517 else: 5518 return 'isl.ast_expr_op_pdiv_r("%s")' % s 5519 5520isl.isl_ast_expr_copy.restype = c_void_p 5521isl.isl_ast_expr_copy.argtypes = [c_void_p] 5522isl.isl_ast_expr_free.restype = c_void_p 5523isl.isl_ast_expr_free.argtypes = [c_void_p] 5524isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5525isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5526 5527class ast_expr_op_select(ast_expr_op): 5528 def __init__(self, *args, **keywords): 5529 if "ptr" in keywords: 5530 self.ctx = keywords["ctx"] 5531 self.ptr = keywords["ptr"] 5532 return 5533 raise Error 5534 def __del__(self): 5535 if hasattr(self, 'ptr'): 5536 isl.isl_ast_expr_free(self.ptr) 5537 def __new__(cls, *args, **keywords): 5538 return super(ast_expr_op_select, cls).__new__(cls) 5539 def __str__(arg0): 5540 try: 5541 if not arg0.__class__ is ast_expr_op_select: 5542 arg0 = ast_expr_op_select(arg0) 5543 except: 5544 raise 5545 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5546 res = cast(ptr, c_char_p).value.decode('ascii') 5547 libc.free(ptr) 5548 return res 5549 def __repr__(self): 5550 s = str(self) 5551 if '"' in s: 5552 return 'isl.ast_expr_op_select("""%s""")' % s 5553 else: 5554 return 'isl.ast_expr_op_select("%s")' % s 5555 5556isl.isl_ast_expr_copy.restype = c_void_p 5557isl.isl_ast_expr_copy.argtypes = [c_void_p] 5558isl.isl_ast_expr_free.restype = c_void_p 5559isl.isl_ast_expr_free.argtypes = [c_void_p] 5560isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5561isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5562 5563class ast_expr_op_sub(ast_expr_op): 5564 def __init__(self, *args, **keywords): 5565 if "ptr" in keywords: 5566 self.ctx = keywords["ctx"] 5567 self.ptr = keywords["ptr"] 5568 return 5569 raise Error 5570 def __del__(self): 5571 if hasattr(self, 'ptr'): 5572 isl.isl_ast_expr_free(self.ptr) 5573 def __new__(cls, *args, **keywords): 5574 return super(ast_expr_op_sub, cls).__new__(cls) 5575 def __str__(arg0): 5576 try: 5577 if not arg0.__class__ is ast_expr_op_sub: 5578 arg0 = ast_expr_op_sub(arg0) 5579 except: 5580 raise 5581 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5582 res = cast(ptr, c_char_p).value.decode('ascii') 5583 libc.free(ptr) 5584 return res 5585 def __repr__(self): 5586 s = str(self) 5587 if '"' in s: 5588 return 'isl.ast_expr_op_sub("""%s""")' % s 5589 else: 5590 return 'isl.ast_expr_op_sub("%s")' % s 5591 5592isl.isl_ast_expr_copy.restype = c_void_p 5593isl.isl_ast_expr_copy.argtypes = [c_void_p] 5594isl.isl_ast_expr_free.restype = c_void_p 5595isl.isl_ast_expr_free.argtypes = [c_void_p] 5596isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5597isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5598 5599class ast_expr_op_zdiv_r(ast_expr_op): 5600 def __init__(self, *args, **keywords): 5601 if "ptr" in keywords: 5602 self.ctx = keywords["ctx"] 5603 self.ptr = keywords["ptr"] 5604 return 5605 raise Error 5606 def __del__(self): 5607 if hasattr(self, 'ptr'): 5608 isl.isl_ast_expr_free(self.ptr) 5609 def __new__(cls, *args, **keywords): 5610 return super(ast_expr_op_zdiv_r, cls).__new__(cls) 5611 def __str__(arg0): 5612 try: 5613 if not arg0.__class__ is ast_expr_op_zdiv_r: 5614 arg0 = ast_expr_op_zdiv_r(arg0) 5615 except: 5616 raise 5617 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5618 res = cast(ptr, c_char_p).value.decode('ascii') 5619 libc.free(ptr) 5620 return res 5621 def __repr__(self): 5622 s = str(self) 5623 if '"' in s: 5624 return 'isl.ast_expr_op_zdiv_r("""%s""")' % s 5625 else: 5626 return 'isl.ast_expr_op_zdiv_r("%s")' % s 5627 5628isl.isl_ast_expr_copy.restype = c_void_p 5629isl.isl_ast_expr_copy.argtypes = [c_void_p] 5630isl.isl_ast_expr_free.restype = c_void_p 5631isl.isl_ast_expr_free.argtypes = [c_void_p] 5632isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5633isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5634 5635class ast_node(object): 5636 def __init__(self, *args, **keywords): 5637 if "ptr" in keywords: 5638 self.ctx = keywords["ctx"] 5639 self.ptr = keywords["ptr"] 5640 return 5641 if len(args) == 1 and isinstance(args[0], ast_node_for): 5642 self.ctx = args[0].ctx 5643 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 5644 return 5645 if len(args) == 1 and isinstance(args[0], ast_node_if): 5646 self.ctx = args[0].ctx 5647 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 5648 return 5649 if len(args) == 1 and isinstance(args[0], ast_node_block): 5650 self.ctx = args[0].ctx 5651 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 5652 return 5653 if len(args) == 1 and isinstance(args[0], ast_node_mark): 5654 self.ctx = args[0].ctx 5655 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 5656 return 5657 if len(args) == 1 and isinstance(args[0], ast_node_user): 5658 self.ctx = args[0].ctx 5659 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 5660 return 5661 raise Error 5662 def __del__(self): 5663 if hasattr(self, 'ptr'): 5664 isl.isl_ast_node_free(self.ptr) 5665 def __new__(cls, *args, **keywords): 5666 if "ptr" in keywords: 5667 type = isl.isl_ast_node_get_type(keywords["ptr"]) 5668 if type == 1: 5669 return ast_node_for(**keywords) 5670 if type == 2: 5671 return ast_node_if(**keywords) 5672 if type == 3: 5673 return ast_node_block(**keywords) 5674 if type == 4: 5675 return ast_node_mark(**keywords) 5676 if type == 5: 5677 return ast_node_user(**keywords) 5678 raise 5679 return super(ast_node, cls).__new__(cls) 5680 def __str__(arg0): 5681 try: 5682 if not arg0.__class__ is ast_node: 5683 arg0 = ast_node(arg0) 5684 except: 5685 raise 5686 ptr = isl.isl_ast_node_to_str(arg0.ptr) 5687 res = cast(ptr, c_char_p).value.decode('ascii') 5688 libc.free(ptr) 5689 return res 5690 def __repr__(self): 5691 s = str(self) 5692 if '"' in s: 5693 return 'isl.ast_node("""%s""")' % s 5694 else: 5695 return 'isl.ast_node("%s")' % s 5696 def to_C_str(arg0): 5697 try: 5698 if not arg0.__class__ is ast_node: 5699 arg0 = ast_node(arg0) 5700 except: 5701 raise 5702 ctx = arg0.ctx 5703 res = isl.isl_ast_node_to_C_str(arg0.ptr) 5704 if res == 0: 5705 raise 5706 string = cast(res, c_char_p).value.decode('ascii') 5707 libc.free(res) 5708 return string 5709 5710isl.isl_ast_node_to_C_str.restype = POINTER(c_char) 5711isl.isl_ast_node_to_C_str.argtypes = [c_void_p] 5712isl.isl_ast_node_copy.restype = c_void_p 5713isl.isl_ast_node_copy.argtypes = [c_void_p] 5714isl.isl_ast_node_free.restype = c_void_p 5715isl.isl_ast_node_free.argtypes = [c_void_p] 5716isl.isl_ast_node_to_str.restype = POINTER(c_char) 5717isl.isl_ast_node_to_str.argtypes = [c_void_p] 5718isl.isl_ast_node_get_type.argtypes = [c_void_p] 5719 5720class ast_node_block(ast_node): 5721 def __init__(self, *args, **keywords): 5722 if "ptr" in keywords: 5723 self.ctx = keywords["ctx"] 5724 self.ptr = keywords["ptr"] 5725 return 5726 raise Error 5727 def __del__(self): 5728 if hasattr(self, 'ptr'): 5729 isl.isl_ast_node_free(self.ptr) 5730 def __new__(cls, *args, **keywords): 5731 return super(ast_node_block, cls).__new__(cls) 5732 def __str__(arg0): 5733 try: 5734 if not arg0.__class__ is ast_node_block: 5735 arg0 = ast_node_block(arg0) 5736 except: 5737 raise 5738 ptr = isl.isl_ast_node_to_str(arg0.ptr) 5739 res = cast(ptr, c_char_p).value.decode('ascii') 5740 libc.free(ptr) 5741 return res 5742 def __repr__(self): 5743 s = str(self) 5744 if '"' in s: 5745 return 'isl.ast_node_block("""%s""")' % s 5746 else: 5747 return 'isl.ast_node_block("%s")' % s 5748 def children(arg0): 5749 try: 5750 if not arg0.__class__ is ast_node: 5751 arg0 = ast_node(arg0) 5752 except: 5753 raise 5754 ctx = arg0.ctx 5755 res = isl.isl_ast_node_block_get_children(arg0.ptr) 5756 obj = ast_node_list(ctx=ctx, ptr=res) 5757 return obj 5758 def get_children(arg0): 5759 return arg0.children() 5760 5761isl.isl_ast_node_block_get_children.restype = c_void_p 5762isl.isl_ast_node_block_get_children.argtypes = [c_void_p] 5763isl.isl_ast_node_copy.restype = c_void_p 5764isl.isl_ast_node_copy.argtypes = [c_void_p] 5765isl.isl_ast_node_free.restype = c_void_p 5766isl.isl_ast_node_free.argtypes = [c_void_p] 5767isl.isl_ast_node_to_str.restype = POINTER(c_char) 5768isl.isl_ast_node_to_str.argtypes = [c_void_p] 5769 5770class ast_node_for(ast_node): 5771 def __init__(self, *args, **keywords): 5772 if "ptr" in keywords: 5773 self.ctx = keywords["ctx"] 5774 self.ptr = keywords["ptr"] 5775 return 5776 raise Error 5777 def __del__(self): 5778 if hasattr(self, 'ptr'): 5779 isl.isl_ast_node_free(self.ptr) 5780 def __new__(cls, *args, **keywords): 5781 return super(ast_node_for, cls).__new__(cls) 5782 def __str__(arg0): 5783 try: 5784 if not arg0.__class__ is ast_node_for: 5785 arg0 = ast_node_for(arg0) 5786 except: 5787 raise 5788 ptr = isl.isl_ast_node_to_str(arg0.ptr) 5789 res = cast(ptr, c_char_p).value.decode('ascii') 5790 libc.free(ptr) 5791 return res 5792 def __repr__(self): 5793 s = str(self) 5794 if '"' in s: 5795 return 'isl.ast_node_for("""%s""")' % s 5796 else: 5797 return 'isl.ast_node_for("%s")' % s 5798 def body(arg0): 5799 try: 5800 if not arg0.__class__ is ast_node: 5801 arg0 = ast_node(arg0) 5802 except: 5803 raise 5804 ctx = arg0.ctx 5805 res = isl.isl_ast_node_for_get_body(arg0.ptr) 5806 obj = ast_node(ctx=ctx, ptr=res) 5807 return obj 5808 def get_body(arg0): 5809 return arg0.body() 5810 def cond(arg0): 5811 try: 5812 if not arg0.__class__ is ast_node: 5813 arg0 = ast_node(arg0) 5814 except: 5815 raise 5816 ctx = arg0.ctx 5817 res = isl.isl_ast_node_for_get_cond(arg0.ptr) 5818 obj = ast_expr(ctx=ctx, ptr=res) 5819 return obj 5820 def get_cond(arg0): 5821 return arg0.cond() 5822 def inc(arg0): 5823 try: 5824 if not arg0.__class__ is ast_node: 5825 arg0 = ast_node(arg0) 5826 except: 5827 raise 5828 ctx = arg0.ctx 5829 res = isl.isl_ast_node_for_get_inc(arg0.ptr) 5830 obj = ast_expr(ctx=ctx, ptr=res) 5831 return obj 5832 def get_inc(arg0): 5833 return arg0.inc() 5834 def init(arg0): 5835 try: 5836 if not arg0.__class__ is ast_node: 5837 arg0 = ast_node(arg0) 5838 except: 5839 raise 5840 ctx = arg0.ctx 5841 res = isl.isl_ast_node_for_get_init(arg0.ptr) 5842 obj = ast_expr(ctx=ctx, ptr=res) 5843 return obj 5844 def get_init(arg0): 5845 return arg0.init() 5846 def iterator(arg0): 5847 try: 5848 if not arg0.__class__ is ast_node: 5849 arg0 = ast_node(arg0) 5850 except: 5851 raise 5852 ctx = arg0.ctx 5853 res = isl.isl_ast_node_for_get_iterator(arg0.ptr) 5854 obj = ast_expr(ctx=ctx, ptr=res) 5855 return obj 5856 def get_iterator(arg0): 5857 return arg0.iterator() 5858 def is_degenerate(arg0): 5859 try: 5860 if not arg0.__class__ is ast_node: 5861 arg0 = ast_node(arg0) 5862 except: 5863 raise 5864 ctx = arg0.ctx 5865 res = isl.isl_ast_node_for_is_degenerate(arg0.ptr) 5866 if res < 0: 5867 raise 5868 return bool(res) 5869 5870isl.isl_ast_node_for_get_body.restype = c_void_p 5871isl.isl_ast_node_for_get_body.argtypes = [c_void_p] 5872isl.isl_ast_node_for_get_cond.restype = c_void_p 5873isl.isl_ast_node_for_get_cond.argtypes = [c_void_p] 5874isl.isl_ast_node_for_get_inc.restype = c_void_p 5875isl.isl_ast_node_for_get_inc.argtypes = [c_void_p] 5876isl.isl_ast_node_for_get_init.restype = c_void_p 5877isl.isl_ast_node_for_get_init.argtypes = [c_void_p] 5878isl.isl_ast_node_for_get_iterator.restype = c_void_p 5879isl.isl_ast_node_for_get_iterator.argtypes = [c_void_p] 5880isl.isl_ast_node_for_is_degenerate.argtypes = [c_void_p] 5881isl.isl_ast_node_copy.restype = c_void_p 5882isl.isl_ast_node_copy.argtypes = [c_void_p] 5883isl.isl_ast_node_free.restype = c_void_p 5884isl.isl_ast_node_free.argtypes = [c_void_p] 5885isl.isl_ast_node_to_str.restype = POINTER(c_char) 5886isl.isl_ast_node_to_str.argtypes = [c_void_p] 5887 5888class ast_node_if(ast_node): 5889 def __init__(self, *args, **keywords): 5890 if "ptr" in keywords: 5891 self.ctx = keywords["ctx"] 5892 self.ptr = keywords["ptr"] 5893 return 5894 raise Error 5895 def __del__(self): 5896 if hasattr(self, 'ptr'): 5897 isl.isl_ast_node_free(self.ptr) 5898 def __new__(cls, *args, **keywords): 5899 return super(ast_node_if, cls).__new__(cls) 5900 def __str__(arg0): 5901 try: 5902 if not arg0.__class__ is ast_node_if: 5903 arg0 = ast_node_if(arg0) 5904 except: 5905 raise 5906 ptr = isl.isl_ast_node_to_str(arg0.ptr) 5907 res = cast(ptr, c_char_p).value.decode('ascii') 5908 libc.free(ptr) 5909 return res 5910 def __repr__(self): 5911 s = str(self) 5912 if '"' in s: 5913 return 'isl.ast_node_if("""%s""")' % s 5914 else: 5915 return 'isl.ast_node_if("%s")' % s 5916 def cond(arg0): 5917 try: 5918 if not arg0.__class__ is ast_node: 5919 arg0 = ast_node(arg0) 5920 except: 5921 raise 5922 ctx = arg0.ctx 5923 res = isl.isl_ast_node_if_get_cond(arg0.ptr) 5924 obj = ast_expr(ctx=ctx, ptr=res) 5925 return obj 5926 def get_cond(arg0): 5927 return arg0.cond() 5928 def else_node(arg0): 5929 try: 5930 if not arg0.__class__ is ast_node: 5931 arg0 = ast_node(arg0) 5932 except: 5933 raise 5934 ctx = arg0.ctx 5935 res = isl.isl_ast_node_if_get_else_node(arg0.ptr) 5936 obj = ast_node(ctx=ctx, ptr=res) 5937 return obj 5938 def get_else_node(arg0): 5939 return arg0.else_node() 5940 def then_node(arg0): 5941 try: 5942 if not arg0.__class__ is ast_node: 5943 arg0 = ast_node(arg0) 5944 except: 5945 raise 5946 ctx = arg0.ctx 5947 res = isl.isl_ast_node_if_get_then_node(arg0.ptr) 5948 obj = ast_node(ctx=ctx, ptr=res) 5949 return obj 5950 def get_then_node(arg0): 5951 return arg0.then_node() 5952 def has_else_node(arg0): 5953 try: 5954 if not arg0.__class__ is ast_node: 5955 arg0 = ast_node(arg0) 5956 except: 5957 raise 5958 ctx = arg0.ctx 5959 res = isl.isl_ast_node_if_has_else_node(arg0.ptr) 5960 if res < 0: 5961 raise 5962 return bool(res) 5963 5964isl.isl_ast_node_if_get_cond.restype = c_void_p 5965isl.isl_ast_node_if_get_cond.argtypes = [c_void_p] 5966isl.isl_ast_node_if_get_else_node.restype = c_void_p 5967isl.isl_ast_node_if_get_else_node.argtypes = [c_void_p] 5968isl.isl_ast_node_if_get_then_node.restype = c_void_p 5969isl.isl_ast_node_if_get_then_node.argtypes = [c_void_p] 5970isl.isl_ast_node_if_has_else_node.argtypes = [c_void_p] 5971isl.isl_ast_node_copy.restype = c_void_p 5972isl.isl_ast_node_copy.argtypes = [c_void_p] 5973isl.isl_ast_node_free.restype = c_void_p 5974isl.isl_ast_node_free.argtypes = [c_void_p] 5975isl.isl_ast_node_to_str.restype = POINTER(c_char) 5976isl.isl_ast_node_to_str.argtypes = [c_void_p] 5977 5978class ast_node_list(object): 5979 def __init__(self, *args, **keywords): 5980 if "ptr" in keywords: 5981 self.ctx = keywords["ctx"] 5982 self.ptr = keywords["ptr"] 5983 return 5984 if len(args) == 1 and type(args[0]) == int: 5985 self.ctx = Context.getDefaultInstance() 5986 self.ptr = isl.isl_ast_node_list_alloc(self.ctx, args[0]) 5987 return 5988 if len(args) == 1 and args[0].__class__ is ast_node: 5989 self.ctx = Context.getDefaultInstance() 5990 self.ptr = isl.isl_ast_node_list_from_ast_node(isl.isl_ast_node_copy(args[0].ptr)) 5991 return 5992 raise Error 5993 def __del__(self): 5994 if hasattr(self, 'ptr'): 5995 isl.isl_ast_node_list_free(self.ptr) 5996 def __str__(arg0): 5997 try: 5998 if not arg0.__class__ is ast_node_list: 5999 arg0 = ast_node_list(arg0) 6000 except: 6001 raise 6002 ptr = isl.isl_ast_node_list_to_str(arg0.ptr) 6003 res = cast(ptr, c_char_p).value.decode('ascii') 6004 libc.free(ptr) 6005 return res 6006 def __repr__(self): 6007 s = str(self) 6008 if '"' in s: 6009 return 'isl.ast_node_list("""%s""")' % s 6010 else: 6011 return 'isl.ast_node_list("%s")' % s 6012 def add(arg0, arg1): 6013 try: 6014 if not arg0.__class__ is ast_node_list: 6015 arg0 = ast_node_list(arg0) 6016 except: 6017 raise 6018 try: 6019 if not arg1.__class__ is ast_node: 6020 arg1 = ast_node(arg1) 6021 except: 6022 raise 6023 ctx = arg0.ctx 6024 res = isl.isl_ast_node_list_add(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_copy(arg1.ptr)) 6025 obj = ast_node_list(ctx=ctx, ptr=res) 6026 return obj 6027 def clear(arg0): 6028 try: 6029 if not arg0.__class__ is ast_node_list: 6030 arg0 = ast_node_list(arg0) 6031 except: 6032 raise 6033 ctx = arg0.ctx 6034 res = isl.isl_ast_node_list_clear(isl.isl_ast_node_list_copy(arg0.ptr)) 6035 obj = ast_node_list(ctx=ctx, ptr=res) 6036 return obj 6037 def concat(arg0, arg1): 6038 try: 6039 if not arg0.__class__ is ast_node_list: 6040 arg0 = ast_node_list(arg0) 6041 except: 6042 raise 6043 try: 6044 if not arg1.__class__ is ast_node_list: 6045 arg1 = ast_node_list(arg1) 6046 except: 6047 raise 6048 ctx = arg0.ctx 6049 res = isl.isl_ast_node_list_concat(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_list_copy(arg1.ptr)) 6050 obj = ast_node_list(ctx=ctx, ptr=res) 6051 return obj 6052 def drop(arg0, arg1, arg2): 6053 try: 6054 if not arg0.__class__ is ast_node_list: 6055 arg0 = ast_node_list(arg0) 6056 except: 6057 raise 6058 ctx = arg0.ctx 6059 res = isl.isl_ast_node_list_drop(isl.isl_ast_node_list_copy(arg0.ptr), arg1, arg2) 6060 obj = ast_node_list(ctx=ctx, ptr=res) 6061 return obj 6062 def foreach(arg0, arg1): 6063 try: 6064 if not arg0.__class__ is ast_node_list: 6065 arg0 = ast_node_list(arg0) 6066 except: 6067 raise 6068 exc_info = [None] 6069 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 6070 def cb_func(cb_arg0, cb_arg1): 6071 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 6072 try: 6073 arg1(cb_arg0) 6074 except: 6075 import sys 6076 exc_info[0] = sys.exc_info() 6077 return -1 6078 return 0 6079 cb = fn(cb_func) 6080 ctx = arg0.ctx 6081 res = isl.isl_ast_node_list_foreach(arg0.ptr, cb, None) 6082 if exc_info[0] != None: 6083 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 6084 if res < 0: 6085 raise 6086 def at(arg0, arg1): 6087 try: 6088 if not arg0.__class__ is ast_node_list: 6089 arg0 = ast_node_list(arg0) 6090 except: 6091 raise 6092 ctx = arg0.ctx 6093 res = isl.isl_ast_node_list_get_at(arg0.ptr, arg1) 6094 obj = ast_node(ctx=ctx, ptr=res) 6095 return obj 6096 def get_at(arg0, arg1): 6097 return arg0.at(arg1) 6098 def insert(arg0, arg1, arg2): 6099 try: 6100 if not arg0.__class__ is ast_node_list: 6101 arg0 = ast_node_list(arg0) 6102 except: 6103 raise 6104 try: 6105 if not arg2.__class__ is ast_node: 6106 arg2 = ast_node(arg2) 6107 except: 6108 raise 6109 ctx = arg0.ctx 6110 res = isl.isl_ast_node_list_insert(isl.isl_ast_node_list_copy(arg0.ptr), arg1, isl.isl_ast_node_copy(arg2.ptr)) 6111 obj = ast_node_list(ctx=ctx, ptr=res) 6112 return obj 6113 def size(arg0): 6114 try: 6115 if not arg0.__class__ is ast_node_list: 6116 arg0 = ast_node_list(arg0) 6117 except: 6118 raise 6119 ctx = arg0.ctx 6120 res = isl.isl_ast_node_list_size(arg0.ptr) 6121 if res < 0: 6122 raise 6123 return int(res) 6124 6125isl.isl_ast_node_list_alloc.restype = c_void_p 6126isl.isl_ast_node_list_alloc.argtypes = [Context, c_int] 6127isl.isl_ast_node_list_from_ast_node.restype = c_void_p 6128isl.isl_ast_node_list_from_ast_node.argtypes = [c_void_p] 6129isl.isl_ast_node_list_add.restype = c_void_p 6130isl.isl_ast_node_list_add.argtypes = [c_void_p, c_void_p] 6131isl.isl_ast_node_list_clear.restype = c_void_p 6132isl.isl_ast_node_list_clear.argtypes = [c_void_p] 6133isl.isl_ast_node_list_concat.restype = c_void_p 6134isl.isl_ast_node_list_concat.argtypes = [c_void_p, c_void_p] 6135isl.isl_ast_node_list_drop.restype = c_void_p 6136isl.isl_ast_node_list_drop.argtypes = [c_void_p, c_int, c_int] 6137isl.isl_ast_node_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 6138isl.isl_ast_node_list_get_at.restype = c_void_p 6139isl.isl_ast_node_list_get_at.argtypes = [c_void_p, c_int] 6140isl.isl_ast_node_list_insert.restype = c_void_p 6141isl.isl_ast_node_list_insert.argtypes = [c_void_p, c_int, c_void_p] 6142isl.isl_ast_node_list_size.argtypes = [c_void_p] 6143isl.isl_ast_node_list_copy.restype = c_void_p 6144isl.isl_ast_node_list_copy.argtypes = [c_void_p] 6145isl.isl_ast_node_list_free.restype = c_void_p 6146isl.isl_ast_node_list_free.argtypes = [c_void_p] 6147isl.isl_ast_node_list_to_str.restype = POINTER(c_char) 6148isl.isl_ast_node_list_to_str.argtypes = [c_void_p] 6149 6150class ast_node_mark(ast_node): 6151 def __init__(self, *args, **keywords): 6152 if "ptr" in keywords: 6153 self.ctx = keywords["ctx"] 6154 self.ptr = keywords["ptr"] 6155 return 6156 raise Error 6157 def __del__(self): 6158 if hasattr(self, 'ptr'): 6159 isl.isl_ast_node_free(self.ptr) 6160 def __new__(cls, *args, **keywords): 6161 return super(ast_node_mark, cls).__new__(cls) 6162 def __str__(arg0): 6163 try: 6164 if not arg0.__class__ is ast_node_mark: 6165 arg0 = ast_node_mark(arg0) 6166 except: 6167 raise 6168 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6169 res = cast(ptr, c_char_p).value.decode('ascii') 6170 libc.free(ptr) 6171 return res 6172 def __repr__(self): 6173 s = str(self) 6174 if '"' in s: 6175 return 'isl.ast_node_mark("""%s""")' % s 6176 else: 6177 return 'isl.ast_node_mark("%s")' % s 6178 def id(arg0): 6179 try: 6180 if not arg0.__class__ is ast_node: 6181 arg0 = ast_node(arg0) 6182 except: 6183 raise 6184 ctx = arg0.ctx 6185 res = isl.isl_ast_node_mark_get_id(arg0.ptr) 6186 obj = id(ctx=ctx, ptr=res) 6187 return obj 6188 def get_id(arg0): 6189 return arg0.id() 6190 def node(arg0): 6191 try: 6192 if not arg0.__class__ is ast_node: 6193 arg0 = ast_node(arg0) 6194 except: 6195 raise 6196 ctx = arg0.ctx 6197 res = isl.isl_ast_node_mark_get_node(arg0.ptr) 6198 obj = ast_node(ctx=ctx, ptr=res) 6199 return obj 6200 def get_node(arg0): 6201 return arg0.node() 6202 6203isl.isl_ast_node_mark_get_id.restype = c_void_p 6204isl.isl_ast_node_mark_get_id.argtypes = [c_void_p] 6205isl.isl_ast_node_mark_get_node.restype = c_void_p 6206isl.isl_ast_node_mark_get_node.argtypes = [c_void_p] 6207isl.isl_ast_node_copy.restype = c_void_p 6208isl.isl_ast_node_copy.argtypes = [c_void_p] 6209isl.isl_ast_node_free.restype = c_void_p 6210isl.isl_ast_node_free.argtypes = [c_void_p] 6211isl.isl_ast_node_to_str.restype = POINTER(c_char) 6212isl.isl_ast_node_to_str.argtypes = [c_void_p] 6213 6214class ast_node_user(ast_node): 6215 def __init__(self, *args, **keywords): 6216 if "ptr" in keywords: 6217 self.ctx = keywords["ctx"] 6218 self.ptr = keywords["ptr"] 6219 return 6220 raise Error 6221 def __del__(self): 6222 if hasattr(self, 'ptr'): 6223 isl.isl_ast_node_free(self.ptr) 6224 def __new__(cls, *args, **keywords): 6225 return super(ast_node_user, cls).__new__(cls) 6226 def __str__(arg0): 6227 try: 6228 if not arg0.__class__ is ast_node_user: 6229 arg0 = ast_node_user(arg0) 6230 except: 6231 raise 6232 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6233 res = cast(ptr, c_char_p).value.decode('ascii') 6234 libc.free(ptr) 6235 return res 6236 def __repr__(self): 6237 s = str(self) 6238 if '"' in s: 6239 return 'isl.ast_node_user("""%s""")' % s 6240 else: 6241 return 'isl.ast_node_user("%s")' % s 6242 def expr(arg0): 6243 try: 6244 if not arg0.__class__ is ast_node: 6245 arg0 = ast_node(arg0) 6246 except: 6247 raise 6248 ctx = arg0.ctx 6249 res = isl.isl_ast_node_user_get_expr(arg0.ptr) 6250 obj = ast_expr(ctx=ctx, ptr=res) 6251 return obj 6252 def get_expr(arg0): 6253 return arg0.expr() 6254 6255isl.isl_ast_node_user_get_expr.restype = c_void_p 6256isl.isl_ast_node_user_get_expr.argtypes = [c_void_p] 6257isl.isl_ast_node_copy.restype = c_void_p 6258isl.isl_ast_node_copy.argtypes = [c_void_p] 6259isl.isl_ast_node_free.restype = c_void_p 6260isl.isl_ast_node_free.argtypes = [c_void_p] 6261isl.isl_ast_node_to_str.restype = POINTER(c_char) 6262isl.isl_ast_node_to_str.argtypes = [c_void_p] 6263 6264class union_map(object): 6265 def __init__(self, *args, **keywords): 6266 if "ptr" in keywords: 6267 self.ctx = keywords["ctx"] 6268 self.ptr = keywords["ptr"] 6269 return 6270 if len(args) == 1 and args[0].__class__ is basic_map: 6271 self.ctx = Context.getDefaultInstance() 6272 self.ptr = isl.isl_union_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 6273 return 6274 if len(args) == 1 and args[0].__class__ is map: 6275 self.ctx = Context.getDefaultInstance() 6276 self.ptr = isl.isl_union_map_from_map(isl.isl_map_copy(args[0].ptr)) 6277 return 6278 if len(args) == 1 and type(args[0]) == str: 6279 self.ctx = Context.getDefaultInstance() 6280 self.ptr = isl.isl_union_map_read_from_str(self.ctx, args[0].encode('ascii')) 6281 return 6282 raise Error 6283 def __del__(self): 6284 if hasattr(self, 'ptr'): 6285 isl.isl_union_map_free(self.ptr) 6286 def __str__(arg0): 6287 try: 6288 if not arg0.__class__ is union_map: 6289 arg0 = union_map(arg0) 6290 except: 6291 raise 6292 ptr = isl.isl_union_map_to_str(arg0.ptr) 6293 res = cast(ptr, c_char_p).value.decode('ascii') 6294 libc.free(ptr) 6295 return res 6296 def __repr__(self): 6297 s = str(self) 6298 if '"' in s: 6299 return 'isl.union_map("""%s""")' % s 6300 else: 6301 return 'isl.union_map("%s")' % s 6302 def affine_hull(arg0): 6303 try: 6304 if not arg0.__class__ is union_map: 6305 arg0 = union_map(arg0) 6306 except: 6307 raise 6308 ctx = arg0.ctx 6309 res = isl.isl_union_map_affine_hull(isl.isl_union_map_copy(arg0.ptr)) 6310 obj = union_map(ctx=ctx, ptr=res) 6311 return obj 6312 def apply_domain(arg0, arg1): 6313 try: 6314 if not arg0.__class__ is union_map: 6315 arg0 = union_map(arg0) 6316 except: 6317 raise 6318 try: 6319 if not arg1.__class__ is union_map: 6320 arg1 = union_map(arg1) 6321 except: 6322 raise 6323 ctx = arg0.ctx 6324 res = isl.isl_union_map_apply_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6325 obj = union_map(ctx=ctx, ptr=res) 6326 return obj 6327 def apply_range(arg0, arg1): 6328 try: 6329 if not arg0.__class__ is union_map: 6330 arg0 = union_map(arg0) 6331 except: 6332 raise 6333 try: 6334 if not arg1.__class__ is union_map: 6335 arg1 = union_map(arg1) 6336 except: 6337 raise 6338 ctx = arg0.ctx 6339 res = isl.isl_union_map_apply_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6340 obj = union_map(ctx=ctx, ptr=res) 6341 return obj 6342 def bind_range(arg0, arg1): 6343 try: 6344 if not arg0.__class__ is union_map: 6345 arg0 = union_map(arg0) 6346 except: 6347 raise 6348 try: 6349 if not arg1.__class__ is multi_id: 6350 arg1 = multi_id(arg1) 6351 except: 6352 raise 6353 ctx = arg0.ctx 6354 res = isl.isl_union_map_bind_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 6355 obj = union_set(ctx=ctx, ptr=res) 6356 return obj 6357 def coalesce(arg0): 6358 try: 6359 if not arg0.__class__ is union_map: 6360 arg0 = union_map(arg0) 6361 except: 6362 raise 6363 ctx = arg0.ctx 6364 res = isl.isl_union_map_coalesce(isl.isl_union_map_copy(arg0.ptr)) 6365 obj = union_map(ctx=ctx, ptr=res) 6366 return obj 6367 def compute_divs(arg0): 6368 try: 6369 if not arg0.__class__ is union_map: 6370 arg0 = union_map(arg0) 6371 except: 6372 raise 6373 ctx = arg0.ctx 6374 res = isl.isl_union_map_compute_divs(isl.isl_union_map_copy(arg0.ptr)) 6375 obj = union_map(ctx=ctx, ptr=res) 6376 return obj 6377 def curry(arg0): 6378 try: 6379 if not arg0.__class__ is union_map: 6380 arg0 = union_map(arg0) 6381 except: 6382 raise 6383 ctx = arg0.ctx 6384 res = isl.isl_union_map_curry(isl.isl_union_map_copy(arg0.ptr)) 6385 obj = union_map(ctx=ctx, ptr=res) 6386 return obj 6387 def deltas(arg0): 6388 try: 6389 if not arg0.__class__ is union_map: 6390 arg0 = union_map(arg0) 6391 except: 6392 raise 6393 ctx = arg0.ctx 6394 res = isl.isl_union_map_deltas(isl.isl_union_map_copy(arg0.ptr)) 6395 obj = union_set(ctx=ctx, ptr=res) 6396 return obj 6397 def detect_equalities(arg0): 6398 try: 6399 if not arg0.__class__ is union_map: 6400 arg0 = union_map(arg0) 6401 except: 6402 raise 6403 ctx = arg0.ctx 6404 res = isl.isl_union_map_detect_equalities(isl.isl_union_map_copy(arg0.ptr)) 6405 obj = union_map(ctx=ctx, ptr=res) 6406 return obj 6407 def domain(arg0): 6408 try: 6409 if not arg0.__class__ is union_map: 6410 arg0 = union_map(arg0) 6411 except: 6412 raise 6413 ctx = arg0.ctx 6414 res = isl.isl_union_map_domain(isl.isl_union_map_copy(arg0.ptr)) 6415 obj = union_set(ctx=ctx, ptr=res) 6416 return obj 6417 def domain_factor_domain(arg0): 6418 try: 6419 if not arg0.__class__ is union_map: 6420 arg0 = union_map(arg0) 6421 except: 6422 raise 6423 ctx = arg0.ctx 6424 res = isl.isl_union_map_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 6425 obj = union_map(ctx=ctx, ptr=res) 6426 return obj 6427 def domain_factor_range(arg0): 6428 try: 6429 if not arg0.__class__ is union_map: 6430 arg0 = union_map(arg0) 6431 except: 6432 raise 6433 ctx = arg0.ctx 6434 res = isl.isl_union_map_domain_factor_range(isl.isl_union_map_copy(arg0.ptr)) 6435 obj = union_map(ctx=ctx, ptr=res) 6436 return obj 6437 def domain_map(arg0): 6438 try: 6439 if not arg0.__class__ is union_map: 6440 arg0 = union_map(arg0) 6441 except: 6442 raise 6443 ctx = arg0.ctx 6444 res = isl.isl_union_map_domain_map(isl.isl_union_map_copy(arg0.ptr)) 6445 obj = union_map(ctx=ctx, ptr=res) 6446 return obj 6447 def domain_map_union_pw_multi_aff(arg0): 6448 try: 6449 if not arg0.__class__ is union_map: 6450 arg0 = union_map(arg0) 6451 except: 6452 raise 6453 ctx = arg0.ctx 6454 res = isl.isl_union_map_domain_map_union_pw_multi_aff(isl.isl_union_map_copy(arg0.ptr)) 6455 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 6456 return obj 6457 def domain_product(arg0, arg1): 6458 try: 6459 if not arg0.__class__ is union_map: 6460 arg0 = union_map(arg0) 6461 except: 6462 raise 6463 try: 6464 if not arg1.__class__ is union_map: 6465 arg1 = union_map(arg1) 6466 except: 6467 raise 6468 ctx = arg0.ctx 6469 res = isl.isl_union_map_domain_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6470 obj = union_map(ctx=ctx, ptr=res) 6471 return obj 6472 @staticmethod 6473 def empty(*args): 6474 if len(args) == 0: 6475 ctx = Context.getDefaultInstance() 6476 res = isl.isl_union_map_empty_ctx(ctx) 6477 obj = union_map(ctx=ctx, ptr=res) 6478 return obj 6479 raise Error 6480 def eq_at(*args): 6481 if len(args) == 2 and args[1].__class__ is multi_union_pw_aff: 6482 ctx = args[0].ctx 6483 res = isl.isl_union_map_eq_at_multi_union_pw_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_multi_union_pw_aff_copy(args[1].ptr)) 6484 obj = union_map(ctx=ctx, ptr=res) 6485 return obj 6486 raise Error 6487 def every_map(arg0, arg1): 6488 try: 6489 if not arg0.__class__ is union_map: 6490 arg0 = union_map(arg0) 6491 except: 6492 raise 6493 exc_info = [None] 6494 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 6495 def cb_func(cb_arg0, cb_arg1): 6496 cb_arg0 = map(ctx=arg0.ctx, ptr=isl.isl_map_copy(cb_arg0)) 6497 try: 6498 res = arg1(cb_arg0) 6499 except: 6500 import sys 6501 exc_info[0] = sys.exc_info() 6502 return -1 6503 return 1 if res else 0 6504 cb = fn(cb_func) 6505 ctx = arg0.ctx 6506 res = isl.isl_union_map_every_map(arg0.ptr, cb, None) 6507 if exc_info[0] != None: 6508 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 6509 if res < 0: 6510 raise 6511 return bool(res) 6512 def extract_map(arg0, arg1): 6513 try: 6514 if not arg0.__class__ is union_map: 6515 arg0 = union_map(arg0) 6516 except: 6517 raise 6518 try: 6519 if not arg1.__class__ is space: 6520 arg1 = space(arg1) 6521 except: 6522 raise 6523 ctx = arg0.ctx 6524 res = isl.isl_union_map_extract_map(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 6525 obj = map(ctx=ctx, ptr=res) 6526 return obj 6527 def factor_domain(arg0): 6528 try: 6529 if not arg0.__class__ is union_map: 6530 arg0 = union_map(arg0) 6531 except: 6532 raise 6533 ctx = arg0.ctx 6534 res = isl.isl_union_map_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 6535 obj = union_map(ctx=ctx, ptr=res) 6536 return obj 6537 def factor_range(arg0): 6538 try: 6539 if not arg0.__class__ is union_map: 6540 arg0 = union_map(arg0) 6541 except: 6542 raise 6543 ctx = arg0.ctx 6544 res = isl.isl_union_map_factor_range(isl.isl_union_map_copy(arg0.ptr)) 6545 obj = union_map(ctx=ctx, ptr=res) 6546 return obj 6547 def fixed_power(*args): 6548 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 6549 args = list(args) 6550 try: 6551 if not args[1].__class__ is val: 6552 args[1] = val(args[1]) 6553 except: 6554 raise 6555 ctx = args[0].ctx 6556 res = isl.isl_union_map_fixed_power_val(isl.isl_union_map_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 6557 obj = union_map(ctx=ctx, ptr=res) 6558 return obj 6559 raise Error 6560 def foreach_map(arg0, arg1): 6561 try: 6562 if not arg0.__class__ is union_map: 6563 arg0 = union_map(arg0) 6564 except: 6565 raise 6566 exc_info = [None] 6567 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 6568 def cb_func(cb_arg0, cb_arg1): 6569 cb_arg0 = map(ctx=arg0.ctx, ptr=(cb_arg0)) 6570 try: 6571 arg1(cb_arg0) 6572 except: 6573 import sys 6574 exc_info[0] = sys.exc_info() 6575 return -1 6576 return 0 6577 cb = fn(cb_func) 6578 ctx = arg0.ctx 6579 res = isl.isl_union_map_foreach_map(arg0.ptr, cb, None) 6580 if exc_info[0] != None: 6581 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 6582 if res < 0: 6583 raise 6584 @staticmethod 6585 def convert_from(*args): 6586 if len(args) == 1 and args[0].__class__ is multi_union_pw_aff: 6587 ctx = args[0].ctx 6588 res = isl.isl_union_map_from_multi_union_pw_aff(isl.isl_multi_union_pw_aff_copy(args[0].ptr)) 6589 obj = union_map(ctx=ctx, ptr=res) 6590 return obj 6591 if len(args) == 1 and args[0].__class__ is union_pw_multi_aff: 6592 ctx = args[0].ctx 6593 res = isl.isl_union_map_from_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr)) 6594 obj = union_map(ctx=ctx, ptr=res) 6595 return obj 6596 raise Error 6597 @staticmethod 6598 def from_domain(arg0): 6599 try: 6600 if not arg0.__class__ is union_set: 6601 arg0 = union_set(arg0) 6602 except: 6603 raise 6604 ctx = arg0.ctx 6605 res = isl.isl_union_map_from_domain(isl.isl_union_set_copy(arg0.ptr)) 6606 obj = union_map(ctx=ctx, ptr=res) 6607 return obj 6608 @staticmethod 6609 def from_domain_and_range(arg0, arg1): 6610 try: 6611 if not arg0.__class__ is union_set: 6612 arg0 = union_set(arg0) 6613 except: 6614 raise 6615 try: 6616 if not arg1.__class__ is union_set: 6617 arg1 = union_set(arg1) 6618 except: 6619 raise 6620 ctx = arg0.ctx 6621 res = isl.isl_union_map_from_domain_and_range(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 6622 obj = union_map(ctx=ctx, ptr=res) 6623 return obj 6624 @staticmethod 6625 def from_range(arg0): 6626 try: 6627 if not arg0.__class__ is union_set: 6628 arg0 = union_set(arg0) 6629 except: 6630 raise 6631 ctx = arg0.ctx 6632 res = isl.isl_union_map_from_range(isl.isl_union_set_copy(arg0.ptr)) 6633 obj = union_map(ctx=ctx, ptr=res) 6634 return obj 6635 def space(arg0): 6636 try: 6637 if not arg0.__class__ is union_map: 6638 arg0 = union_map(arg0) 6639 except: 6640 raise 6641 ctx = arg0.ctx 6642 res = isl.isl_union_map_get_space(arg0.ptr) 6643 obj = space(ctx=ctx, ptr=res) 6644 return obj 6645 def get_space(arg0): 6646 return arg0.space() 6647 def gist(arg0, arg1): 6648 try: 6649 if not arg0.__class__ is union_map: 6650 arg0 = union_map(arg0) 6651 except: 6652 raise 6653 try: 6654 if not arg1.__class__ is union_map: 6655 arg1 = union_map(arg1) 6656 except: 6657 raise 6658 ctx = arg0.ctx 6659 res = isl.isl_union_map_gist(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6660 obj = union_map(ctx=ctx, ptr=res) 6661 return obj 6662 def gist_domain(arg0, arg1): 6663 try: 6664 if not arg0.__class__ is union_map: 6665 arg0 = union_map(arg0) 6666 except: 6667 raise 6668 try: 6669 if not arg1.__class__ is union_set: 6670 arg1 = union_set(arg1) 6671 except: 6672 raise 6673 ctx = arg0.ctx 6674 res = isl.isl_union_map_gist_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 6675 obj = union_map(ctx=ctx, ptr=res) 6676 return obj 6677 def gist_params(arg0, arg1): 6678 try: 6679 if not arg0.__class__ is union_map: 6680 arg0 = union_map(arg0) 6681 except: 6682 raise 6683 try: 6684 if not arg1.__class__ is set: 6685 arg1 = set(arg1) 6686 except: 6687 raise 6688 ctx = arg0.ctx 6689 res = isl.isl_union_map_gist_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 6690 obj = union_map(ctx=ctx, ptr=res) 6691 return obj 6692 def gist_range(arg0, arg1): 6693 try: 6694 if not arg0.__class__ is union_map: 6695 arg0 = union_map(arg0) 6696 except: 6697 raise 6698 try: 6699 if not arg1.__class__ is union_set: 6700 arg1 = union_set(arg1) 6701 except: 6702 raise 6703 ctx = arg0.ctx 6704 res = isl.isl_union_map_gist_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 6705 obj = union_map(ctx=ctx, ptr=res) 6706 return obj 6707 def intersect(arg0, arg1): 6708 try: 6709 if not arg0.__class__ is union_map: 6710 arg0 = union_map(arg0) 6711 except: 6712 raise 6713 try: 6714 if not arg1.__class__ is union_map: 6715 arg1 = union_map(arg1) 6716 except: 6717 raise 6718 ctx = arg0.ctx 6719 res = isl.isl_union_map_intersect(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6720 obj = union_map(ctx=ctx, ptr=res) 6721 return obj 6722 def intersect_domain(*args): 6723 if len(args) == 2 and args[1].__class__ is space: 6724 ctx = args[0].ctx 6725 res = isl.isl_union_map_intersect_domain_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 6726 obj = union_map(ctx=ctx, ptr=res) 6727 return obj 6728 if len(args) == 2 and args[1].__class__ is union_set: 6729 ctx = args[0].ctx 6730 res = isl.isl_union_map_intersect_domain_union_set(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 6731 obj = union_map(ctx=ctx, ptr=res) 6732 return obj 6733 raise Error 6734 def intersect_domain_factor_domain(arg0, arg1): 6735 try: 6736 if not arg0.__class__ is union_map: 6737 arg0 = union_map(arg0) 6738 except: 6739 raise 6740 try: 6741 if not arg1.__class__ is union_map: 6742 arg1 = union_map(arg1) 6743 except: 6744 raise 6745 ctx = arg0.ctx 6746 res = isl.isl_union_map_intersect_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6747 obj = union_map(ctx=ctx, ptr=res) 6748 return obj 6749 def intersect_domain_factor_range(arg0, arg1): 6750 try: 6751 if not arg0.__class__ is union_map: 6752 arg0 = union_map(arg0) 6753 except: 6754 raise 6755 try: 6756 if not arg1.__class__ is union_map: 6757 arg1 = union_map(arg1) 6758 except: 6759 raise 6760 ctx = arg0.ctx 6761 res = isl.isl_union_map_intersect_domain_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6762 obj = union_map(ctx=ctx, ptr=res) 6763 return obj 6764 def intersect_params(arg0, arg1): 6765 try: 6766 if not arg0.__class__ is union_map: 6767 arg0 = union_map(arg0) 6768 except: 6769 raise 6770 try: 6771 if not arg1.__class__ is set: 6772 arg1 = set(arg1) 6773 except: 6774 raise 6775 ctx = arg0.ctx 6776 res = isl.isl_union_map_intersect_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 6777 obj = union_map(ctx=ctx, ptr=res) 6778 return obj 6779 def intersect_range(*args): 6780 if len(args) == 2 and args[1].__class__ is space: 6781 ctx = args[0].ctx 6782 res = isl.isl_union_map_intersect_range_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 6783 obj = union_map(ctx=ctx, ptr=res) 6784 return obj 6785 if len(args) == 2 and args[1].__class__ is union_set: 6786 ctx = args[0].ctx 6787 res = isl.isl_union_map_intersect_range_union_set(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 6788 obj = union_map(ctx=ctx, ptr=res) 6789 return obj 6790 raise Error 6791 def intersect_range_factor_domain(arg0, arg1): 6792 try: 6793 if not arg0.__class__ is union_map: 6794 arg0 = union_map(arg0) 6795 except: 6796 raise 6797 try: 6798 if not arg1.__class__ is union_map: 6799 arg1 = union_map(arg1) 6800 except: 6801 raise 6802 ctx = arg0.ctx 6803 res = isl.isl_union_map_intersect_range_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6804 obj = union_map(ctx=ctx, ptr=res) 6805 return obj 6806 def intersect_range_factor_range(arg0, arg1): 6807 try: 6808 if not arg0.__class__ is union_map: 6809 arg0 = union_map(arg0) 6810 except: 6811 raise 6812 try: 6813 if not arg1.__class__ is union_map: 6814 arg1 = union_map(arg1) 6815 except: 6816 raise 6817 ctx = arg0.ctx 6818 res = isl.isl_union_map_intersect_range_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6819 obj = union_map(ctx=ctx, ptr=res) 6820 return obj 6821 def is_bijective(arg0): 6822 try: 6823 if not arg0.__class__ is union_map: 6824 arg0 = union_map(arg0) 6825 except: 6826 raise 6827 ctx = arg0.ctx 6828 res = isl.isl_union_map_is_bijective(arg0.ptr) 6829 if res < 0: 6830 raise 6831 return bool(res) 6832 def is_disjoint(arg0, arg1): 6833 try: 6834 if not arg0.__class__ is union_map: 6835 arg0 = union_map(arg0) 6836 except: 6837 raise 6838 try: 6839 if not arg1.__class__ is union_map: 6840 arg1 = union_map(arg1) 6841 except: 6842 raise 6843 ctx = arg0.ctx 6844 res = isl.isl_union_map_is_disjoint(arg0.ptr, arg1.ptr) 6845 if res < 0: 6846 raise 6847 return bool(res) 6848 def is_empty(arg0): 6849 try: 6850 if not arg0.__class__ is union_map: 6851 arg0 = union_map(arg0) 6852 except: 6853 raise 6854 ctx = arg0.ctx 6855 res = isl.isl_union_map_is_empty(arg0.ptr) 6856 if res < 0: 6857 raise 6858 return bool(res) 6859 def is_equal(arg0, arg1): 6860 try: 6861 if not arg0.__class__ is union_map: 6862 arg0 = union_map(arg0) 6863 except: 6864 raise 6865 try: 6866 if not arg1.__class__ is union_map: 6867 arg1 = union_map(arg1) 6868 except: 6869 raise 6870 ctx = arg0.ctx 6871 res = isl.isl_union_map_is_equal(arg0.ptr, arg1.ptr) 6872 if res < 0: 6873 raise 6874 return bool(res) 6875 def is_injective(arg0): 6876 try: 6877 if not arg0.__class__ is union_map: 6878 arg0 = union_map(arg0) 6879 except: 6880 raise 6881 ctx = arg0.ctx 6882 res = isl.isl_union_map_is_injective(arg0.ptr) 6883 if res < 0: 6884 raise 6885 return bool(res) 6886 def is_single_valued(arg0): 6887 try: 6888 if not arg0.__class__ is union_map: 6889 arg0 = union_map(arg0) 6890 except: 6891 raise 6892 ctx = arg0.ctx 6893 res = isl.isl_union_map_is_single_valued(arg0.ptr) 6894 if res < 0: 6895 raise 6896 return bool(res) 6897 def is_strict_subset(arg0, arg1): 6898 try: 6899 if not arg0.__class__ is union_map: 6900 arg0 = union_map(arg0) 6901 except: 6902 raise 6903 try: 6904 if not arg1.__class__ is union_map: 6905 arg1 = union_map(arg1) 6906 except: 6907 raise 6908 ctx = arg0.ctx 6909 res = isl.isl_union_map_is_strict_subset(arg0.ptr, arg1.ptr) 6910 if res < 0: 6911 raise 6912 return bool(res) 6913 def is_subset(arg0, arg1): 6914 try: 6915 if not arg0.__class__ is union_map: 6916 arg0 = union_map(arg0) 6917 except: 6918 raise 6919 try: 6920 if not arg1.__class__ is union_map: 6921 arg1 = union_map(arg1) 6922 except: 6923 raise 6924 ctx = arg0.ctx 6925 res = isl.isl_union_map_is_subset(arg0.ptr, arg1.ptr) 6926 if res < 0: 6927 raise 6928 return bool(res) 6929 def isa_map(arg0): 6930 try: 6931 if not arg0.__class__ is union_map: 6932 arg0 = union_map(arg0) 6933 except: 6934 raise 6935 ctx = arg0.ctx 6936 res = isl.isl_union_map_isa_map(arg0.ptr) 6937 if res < 0: 6938 raise 6939 return bool(res) 6940 def lexmax(arg0): 6941 try: 6942 if not arg0.__class__ is union_map: 6943 arg0 = union_map(arg0) 6944 except: 6945 raise 6946 ctx = arg0.ctx 6947 res = isl.isl_union_map_lexmax(isl.isl_union_map_copy(arg0.ptr)) 6948 obj = union_map(ctx=ctx, ptr=res) 6949 return obj 6950 def lexmin(arg0): 6951 try: 6952 if not arg0.__class__ is union_map: 6953 arg0 = union_map(arg0) 6954 except: 6955 raise 6956 ctx = arg0.ctx 6957 res = isl.isl_union_map_lexmin(isl.isl_union_map_copy(arg0.ptr)) 6958 obj = union_map(ctx=ctx, ptr=res) 6959 return obj 6960 def polyhedral_hull(arg0): 6961 try: 6962 if not arg0.__class__ is union_map: 6963 arg0 = union_map(arg0) 6964 except: 6965 raise 6966 ctx = arg0.ctx 6967 res = isl.isl_union_map_polyhedral_hull(isl.isl_union_map_copy(arg0.ptr)) 6968 obj = union_map(ctx=ctx, ptr=res) 6969 return obj 6970 def preimage_domain(*args): 6971 if len(args) == 2 and args[1].__class__ is multi_aff: 6972 ctx = args[0].ctx 6973 res = isl.isl_union_map_preimage_domain_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 6974 obj = union_map(ctx=ctx, ptr=res) 6975 return obj 6976 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 6977 ctx = args[0].ctx 6978 res = isl.isl_union_map_preimage_domain_multi_pw_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 6979 obj = union_map(ctx=ctx, ptr=res) 6980 return obj 6981 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 6982 ctx = args[0].ctx 6983 res = isl.isl_union_map_preimage_domain_pw_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 6984 obj = union_map(ctx=ctx, ptr=res) 6985 return obj 6986 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 6987 ctx = args[0].ctx 6988 res = isl.isl_union_map_preimage_domain_union_pw_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 6989 obj = union_map(ctx=ctx, ptr=res) 6990 return obj 6991 raise Error 6992 def preimage_range(*args): 6993 if len(args) == 2 and args[1].__class__ is multi_aff: 6994 ctx = args[0].ctx 6995 res = isl.isl_union_map_preimage_range_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 6996 obj = union_map(ctx=ctx, ptr=res) 6997 return obj 6998 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 6999 ctx = args[0].ctx 7000 res = isl.isl_union_map_preimage_range_pw_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 7001 obj = union_map(ctx=ctx, ptr=res) 7002 return obj 7003 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 7004 ctx = args[0].ctx 7005 res = isl.isl_union_map_preimage_range_union_pw_multi_aff(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 7006 obj = union_map(ctx=ctx, ptr=res) 7007 return obj 7008 raise Error 7009 def product(arg0, arg1): 7010 try: 7011 if not arg0.__class__ is union_map: 7012 arg0 = union_map(arg0) 7013 except: 7014 raise 7015 try: 7016 if not arg1.__class__ is union_map: 7017 arg1 = union_map(arg1) 7018 except: 7019 raise 7020 ctx = arg0.ctx 7021 res = isl.isl_union_map_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7022 obj = union_map(ctx=ctx, ptr=res) 7023 return obj 7024 def project_out_all_params(arg0): 7025 try: 7026 if not arg0.__class__ is union_map: 7027 arg0 = union_map(arg0) 7028 except: 7029 raise 7030 ctx = arg0.ctx 7031 res = isl.isl_union_map_project_out_all_params(isl.isl_union_map_copy(arg0.ptr)) 7032 obj = union_map(ctx=ctx, ptr=res) 7033 return obj 7034 def range(arg0): 7035 try: 7036 if not arg0.__class__ is union_map: 7037 arg0 = union_map(arg0) 7038 except: 7039 raise 7040 ctx = arg0.ctx 7041 res = isl.isl_union_map_range(isl.isl_union_map_copy(arg0.ptr)) 7042 obj = union_set(ctx=ctx, ptr=res) 7043 return obj 7044 def range_factor_domain(arg0): 7045 try: 7046 if not arg0.__class__ is union_map: 7047 arg0 = union_map(arg0) 7048 except: 7049 raise 7050 ctx = arg0.ctx 7051 res = isl.isl_union_map_range_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 7052 obj = union_map(ctx=ctx, ptr=res) 7053 return obj 7054 def range_factor_range(arg0): 7055 try: 7056 if not arg0.__class__ is union_map: 7057 arg0 = union_map(arg0) 7058 except: 7059 raise 7060 ctx = arg0.ctx 7061 res = isl.isl_union_map_range_factor_range(isl.isl_union_map_copy(arg0.ptr)) 7062 obj = union_map(ctx=ctx, ptr=res) 7063 return obj 7064 def range_map(arg0): 7065 try: 7066 if not arg0.__class__ is union_map: 7067 arg0 = union_map(arg0) 7068 except: 7069 raise 7070 ctx = arg0.ctx 7071 res = isl.isl_union_map_range_map(isl.isl_union_map_copy(arg0.ptr)) 7072 obj = union_map(ctx=ctx, ptr=res) 7073 return obj 7074 def range_product(arg0, arg1): 7075 try: 7076 if not arg0.__class__ is union_map: 7077 arg0 = union_map(arg0) 7078 except: 7079 raise 7080 try: 7081 if not arg1.__class__ is union_map: 7082 arg1 = union_map(arg1) 7083 except: 7084 raise 7085 ctx = arg0.ctx 7086 res = isl.isl_union_map_range_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7087 obj = union_map(ctx=ctx, ptr=res) 7088 return obj 7089 def range_reverse(arg0): 7090 try: 7091 if not arg0.__class__ is union_map: 7092 arg0 = union_map(arg0) 7093 except: 7094 raise 7095 ctx = arg0.ctx 7096 res = isl.isl_union_map_range_reverse(isl.isl_union_map_copy(arg0.ptr)) 7097 obj = union_map(ctx=ctx, ptr=res) 7098 return obj 7099 def reverse(arg0): 7100 try: 7101 if not arg0.__class__ is union_map: 7102 arg0 = union_map(arg0) 7103 except: 7104 raise 7105 ctx = arg0.ctx 7106 res = isl.isl_union_map_reverse(isl.isl_union_map_copy(arg0.ptr)) 7107 obj = union_map(ctx=ctx, ptr=res) 7108 return obj 7109 def subtract(arg0, arg1): 7110 try: 7111 if not arg0.__class__ is union_map: 7112 arg0 = union_map(arg0) 7113 except: 7114 raise 7115 try: 7116 if not arg1.__class__ is union_map: 7117 arg1 = union_map(arg1) 7118 except: 7119 raise 7120 ctx = arg0.ctx 7121 res = isl.isl_union_map_subtract(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7122 obj = union_map(ctx=ctx, ptr=res) 7123 return obj 7124 def subtract_domain(arg0, arg1): 7125 try: 7126 if not arg0.__class__ is union_map: 7127 arg0 = union_map(arg0) 7128 except: 7129 raise 7130 try: 7131 if not arg1.__class__ is union_set: 7132 arg1 = union_set(arg1) 7133 except: 7134 raise 7135 ctx = arg0.ctx 7136 res = isl.isl_union_map_subtract_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7137 obj = union_map(ctx=ctx, ptr=res) 7138 return obj 7139 def subtract_range(arg0, arg1): 7140 try: 7141 if not arg0.__class__ is union_map: 7142 arg0 = union_map(arg0) 7143 except: 7144 raise 7145 try: 7146 if not arg1.__class__ is union_set: 7147 arg1 = union_set(arg1) 7148 except: 7149 raise 7150 ctx = arg0.ctx 7151 res = isl.isl_union_map_subtract_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7152 obj = union_map(ctx=ctx, ptr=res) 7153 return obj 7154 def uncurry(arg0): 7155 try: 7156 if not arg0.__class__ is union_map: 7157 arg0 = union_map(arg0) 7158 except: 7159 raise 7160 ctx = arg0.ctx 7161 res = isl.isl_union_map_uncurry(isl.isl_union_map_copy(arg0.ptr)) 7162 obj = union_map(ctx=ctx, ptr=res) 7163 return obj 7164 def union(arg0, arg1): 7165 try: 7166 if not arg0.__class__ is union_map: 7167 arg0 = union_map(arg0) 7168 except: 7169 raise 7170 try: 7171 if not arg1.__class__ is union_map: 7172 arg1 = union_map(arg1) 7173 except: 7174 raise 7175 ctx = arg0.ctx 7176 res = isl.isl_union_map_union(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7177 obj = union_map(ctx=ctx, ptr=res) 7178 return obj 7179 def universe(arg0): 7180 try: 7181 if not arg0.__class__ is union_map: 7182 arg0 = union_map(arg0) 7183 except: 7184 raise 7185 ctx = arg0.ctx 7186 res = isl.isl_union_map_universe(isl.isl_union_map_copy(arg0.ptr)) 7187 obj = union_map(ctx=ctx, ptr=res) 7188 return obj 7189 def wrap(arg0): 7190 try: 7191 if not arg0.__class__ is union_map: 7192 arg0 = union_map(arg0) 7193 except: 7194 raise 7195 ctx = arg0.ctx 7196 res = isl.isl_union_map_wrap(isl.isl_union_map_copy(arg0.ptr)) 7197 obj = union_set(ctx=ctx, ptr=res) 7198 return obj 7199 def zip(arg0): 7200 try: 7201 if not arg0.__class__ is union_map: 7202 arg0 = union_map(arg0) 7203 except: 7204 raise 7205 ctx = arg0.ctx 7206 res = isl.isl_union_map_zip(isl.isl_union_map_copy(arg0.ptr)) 7207 obj = union_map(ctx=ctx, ptr=res) 7208 return obj 7209 7210isl.isl_union_map_from_basic_map.restype = c_void_p 7211isl.isl_union_map_from_basic_map.argtypes = [c_void_p] 7212isl.isl_union_map_from_map.restype = c_void_p 7213isl.isl_union_map_from_map.argtypes = [c_void_p] 7214isl.isl_union_map_read_from_str.restype = c_void_p 7215isl.isl_union_map_read_from_str.argtypes = [Context, c_char_p] 7216isl.isl_union_map_affine_hull.restype = c_void_p 7217isl.isl_union_map_affine_hull.argtypes = [c_void_p] 7218isl.isl_union_map_apply_domain.restype = c_void_p 7219isl.isl_union_map_apply_domain.argtypes = [c_void_p, c_void_p] 7220isl.isl_union_map_apply_range.restype = c_void_p 7221isl.isl_union_map_apply_range.argtypes = [c_void_p, c_void_p] 7222isl.isl_union_map_bind_range.restype = c_void_p 7223isl.isl_union_map_bind_range.argtypes = [c_void_p, c_void_p] 7224isl.isl_union_map_coalesce.restype = c_void_p 7225isl.isl_union_map_coalesce.argtypes = [c_void_p] 7226isl.isl_union_map_compute_divs.restype = c_void_p 7227isl.isl_union_map_compute_divs.argtypes = [c_void_p] 7228isl.isl_union_map_curry.restype = c_void_p 7229isl.isl_union_map_curry.argtypes = [c_void_p] 7230isl.isl_union_map_deltas.restype = c_void_p 7231isl.isl_union_map_deltas.argtypes = [c_void_p] 7232isl.isl_union_map_detect_equalities.restype = c_void_p 7233isl.isl_union_map_detect_equalities.argtypes = [c_void_p] 7234isl.isl_union_map_domain.restype = c_void_p 7235isl.isl_union_map_domain.argtypes = [c_void_p] 7236isl.isl_union_map_domain_factor_domain.restype = c_void_p 7237isl.isl_union_map_domain_factor_domain.argtypes = [c_void_p] 7238isl.isl_union_map_domain_factor_range.restype = c_void_p 7239isl.isl_union_map_domain_factor_range.argtypes = [c_void_p] 7240isl.isl_union_map_domain_map.restype = c_void_p 7241isl.isl_union_map_domain_map.argtypes = [c_void_p] 7242isl.isl_union_map_domain_map_union_pw_multi_aff.restype = c_void_p 7243isl.isl_union_map_domain_map_union_pw_multi_aff.argtypes = [c_void_p] 7244isl.isl_union_map_domain_product.restype = c_void_p 7245isl.isl_union_map_domain_product.argtypes = [c_void_p, c_void_p] 7246isl.isl_union_map_empty_ctx.restype = c_void_p 7247isl.isl_union_map_empty_ctx.argtypes = [Context] 7248isl.isl_union_map_eq_at_multi_union_pw_aff.restype = c_void_p 7249isl.isl_union_map_eq_at_multi_union_pw_aff.argtypes = [c_void_p, c_void_p] 7250isl.isl_union_map_every_map.argtypes = [c_void_p, c_void_p, c_void_p] 7251isl.isl_union_map_extract_map.restype = c_void_p 7252isl.isl_union_map_extract_map.argtypes = [c_void_p, c_void_p] 7253isl.isl_union_map_factor_domain.restype = c_void_p 7254isl.isl_union_map_factor_domain.argtypes = [c_void_p] 7255isl.isl_union_map_factor_range.restype = c_void_p 7256isl.isl_union_map_factor_range.argtypes = [c_void_p] 7257isl.isl_union_map_fixed_power_val.restype = c_void_p 7258isl.isl_union_map_fixed_power_val.argtypes = [c_void_p, c_void_p] 7259isl.isl_union_map_foreach_map.argtypes = [c_void_p, c_void_p, c_void_p] 7260isl.isl_union_map_from_multi_union_pw_aff.restype = c_void_p 7261isl.isl_union_map_from_multi_union_pw_aff.argtypes = [c_void_p] 7262isl.isl_union_map_from_union_pw_multi_aff.restype = c_void_p 7263isl.isl_union_map_from_union_pw_multi_aff.argtypes = [c_void_p] 7264isl.isl_union_map_from_domain.restype = c_void_p 7265isl.isl_union_map_from_domain.argtypes = [c_void_p] 7266isl.isl_union_map_from_domain_and_range.restype = c_void_p 7267isl.isl_union_map_from_domain_and_range.argtypes = [c_void_p, c_void_p] 7268isl.isl_union_map_from_range.restype = c_void_p 7269isl.isl_union_map_from_range.argtypes = [c_void_p] 7270isl.isl_union_map_get_space.restype = c_void_p 7271isl.isl_union_map_get_space.argtypes = [c_void_p] 7272isl.isl_union_map_gist.restype = c_void_p 7273isl.isl_union_map_gist.argtypes = [c_void_p, c_void_p] 7274isl.isl_union_map_gist_domain.restype = c_void_p 7275isl.isl_union_map_gist_domain.argtypes = [c_void_p, c_void_p] 7276isl.isl_union_map_gist_params.restype = c_void_p 7277isl.isl_union_map_gist_params.argtypes = [c_void_p, c_void_p] 7278isl.isl_union_map_gist_range.restype = c_void_p 7279isl.isl_union_map_gist_range.argtypes = [c_void_p, c_void_p] 7280isl.isl_union_map_intersect.restype = c_void_p 7281isl.isl_union_map_intersect.argtypes = [c_void_p, c_void_p] 7282isl.isl_union_map_intersect_domain_space.restype = c_void_p 7283isl.isl_union_map_intersect_domain_space.argtypes = [c_void_p, c_void_p] 7284isl.isl_union_map_intersect_domain_union_set.restype = c_void_p 7285isl.isl_union_map_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 7286isl.isl_union_map_intersect_domain_factor_domain.restype = c_void_p 7287isl.isl_union_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 7288isl.isl_union_map_intersect_domain_factor_range.restype = c_void_p 7289isl.isl_union_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 7290isl.isl_union_map_intersect_params.restype = c_void_p 7291isl.isl_union_map_intersect_params.argtypes = [c_void_p, c_void_p] 7292isl.isl_union_map_intersect_range_space.restype = c_void_p 7293isl.isl_union_map_intersect_range_space.argtypes = [c_void_p, c_void_p] 7294isl.isl_union_map_intersect_range_union_set.restype = c_void_p 7295isl.isl_union_map_intersect_range_union_set.argtypes = [c_void_p, c_void_p] 7296isl.isl_union_map_intersect_range_factor_domain.restype = c_void_p 7297isl.isl_union_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 7298isl.isl_union_map_intersect_range_factor_range.restype = c_void_p 7299isl.isl_union_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 7300isl.isl_union_map_is_bijective.argtypes = [c_void_p] 7301isl.isl_union_map_is_disjoint.argtypes = [c_void_p, c_void_p] 7302isl.isl_union_map_is_empty.argtypes = [c_void_p] 7303isl.isl_union_map_is_equal.argtypes = [c_void_p, c_void_p] 7304isl.isl_union_map_is_injective.argtypes = [c_void_p] 7305isl.isl_union_map_is_single_valued.argtypes = [c_void_p] 7306isl.isl_union_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 7307isl.isl_union_map_is_subset.argtypes = [c_void_p, c_void_p] 7308isl.isl_union_map_isa_map.argtypes = [c_void_p] 7309isl.isl_union_map_lexmax.restype = c_void_p 7310isl.isl_union_map_lexmax.argtypes = [c_void_p] 7311isl.isl_union_map_lexmin.restype = c_void_p 7312isl.isl_union_map_lexmin.argtypes = [c_void_p] 7313isl.isl_union_map_polyhedral_hull.restype = c_void_p 7314isl.isl_union_map_polyhedral_hull.argtypes = [c_void_p] 7315isl.isl_union_map_preimage_domain_multi_aff.restype = c_void_p 7316isl.isl_union_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 7317isl.isl_union_map_preimage_domain_multi_pw_aff.restype = c_void_p 7318isl.isl_union_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 7319isl.isl_union_map_preimage_domain_pw_multi_aff.restype = c_void_p 7320isl.isl_union_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7321isl.isl_union_map_preimage_domain_union_pw_multi_aff.restype = c_void_p 7322isl.isl_union_map_preimage_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7323isl.isl_union_map_preimage_range_multi_aff.restype = c_void_p 7324isl.isl_union_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 7325isl.isl_union_map_preimage_range_pw_multi_aff.restype = c_void_p 7326isl.isl_union_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7327isl.isl_union_map_preimage_range_union_pw_multi_aff.restype = c_void_p 7328isl.isl_union_map_preimage_range_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7329isl.isl_union_map_product.restype = c_void_p 7330isl.isl_union_map_product.argtypes = [c_void_p, c_void_p] 7331isl.isl_union_map_project_out_all_params.restype = c_void_p 7332isl.isl_union_map_project_out_all_params.argtypes = [c_void_p] 7333isl.isl_union_map_range.restype = c_void_p 7334isl.isl_union_map_range.argtypes = [c_void_p] 7335isl.isl_union_map_range_factor_domain.restype = c_void_p 7336isl.isl_union_map_range_factor_domain.argtypes = [c_void_p] 7337isl.isl_union_map_range_factor_range.restype = c_void_p 7338isl.isl_union_map_range_factor_range.argtypes = [c_void_p] 7339isl.isl_union_map_range_map.restype = c_void_p 7340isl.isl_union_map_range_map.argtypes = [c_void_p] 7341isl.isl_union_map_range_product.restype = c_void_p 7342isl.isl_union_map_range_product.argtypes = [c_void_p, c_void_p] 7343isl.isl_union_map_range_reverse.restype = c_void_p 7344isl.isl_union_map_range_reverse.argtypes = [c_void_p] 7345isl.isl_union_map_reverse.restype = c_void_p 7346isl.isl_union_map_reverse.argtypes = [c_void_p] 7347isl.isl_union_map_subtract.restype = c_void_p 7348isl.isl_union_map_subtract.argtypes = [c_void_p, c_void_p] 7349isl.isl_union_map_subtract_domain.restype = c_void_p 7350isl.isl_union_map_subtract_domain.argtypes = [c_void_p, c_void_p] 7351isl.isl_union_map_subtract_range.restype = c_void_p 7352isl.isl_union_map_subtract_range.argtypes = [c_void_p, c_void_p] 7353isl.isl_union_map_uncurry.restype = c_void_p 7354isl.isl_union_map_uncurry.argtypes = [c_void_p] 7355isl.isl_union_map_union.restype = c_void_p 7356isl.isl_union_map_union.argtypes = [c_void_p, c_void_p] 7357isl.isl_union_map_universe.restype = c_void_p 7358isl.isl_union_map_universe.argtypes = [c_void_p] 7359isl.isl_union_map_wrap.restype = c_void_p 7360isl.isl_union_map_wrap.argtypes = [c_void_p] 7361isl.isl_union_map_zip.restype = c_void_p 7362isl.isl_union_map_zip.argtypes = [c_void_p] 7363isl.isl_union_map_copy.restype = c_void_p 7364isl.isl_union_map_copy.argtypes = [c_void_p] 7365isl.isl_union_map_free.restype = c_void_p 7366isl.isl_union_map_free.argtypes = [c_void_p] 7367isl.isl_union_map_to_str.restype = POINTER(c_char) 7368isl.isl_union_map_to_str.argtypes = [c_void_p] 7369 7370class map(union_map): 7371 def __init__(self, *args, **keywords): 7372 if "ptr" in keywords: 7373 self.ctx = keywords["ctx"] 7374 self.ptr = keywords["ptr"] 7375 return 7376 if len(args) == 1 and args[0].__class__ is basic_map: 7377 self.ctx = Context.getDefaultInstance() 7378 self.ptr = isl.isl_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 7379 return 7380 if len(args) == 1 and type(args[0]) == str: 7381 self.ctx = Context.getDefaultInstance() 7382 self.ptr = isl.isl_map_read_from_str(self.ctx, args[0].encode('ascii')) 7383 return 7384 raise Error 7385 def __del__(self): 7386 if hasattr(self, 'ptr'): 7387 isl.isl_map_free(self.ptr) 7388 def __str__(arg0): 7389 try: 7390 if not arg0.__class__ is map: 7391 arg0 = map(arg0) 7392 except: 7393 raise 7394 ptr = isl.isl_map_to_str(arg0.ptr) 7395 res = cast(ptr, c_char_p).value.decode('ascii') 7396 libc.free(ptr) 7397 return res 7398 def __repr__(self): 7399 s = str(self) 7400 if '"' in s: 7401 return 'isl.map("""%s""")' % s 7402 else: 7403 return 'isl.map("%s")' % s 7404 def affine_hull(arg0): 7405 try: 7406 if not arg0.__class__ is map: 7407 arg0 = map(arg0) 7408 except: 7409 raise 7410 ctx = arg0.ctx 7411 res = isl.isl_map_affine_hull(isl.isl_map_copy(arg0.ptr)) 7412 obj = basic_map(ctx=ctx, ptr=res) 7413 return obj 7414 def apply_domain(arg0, arg1): 7415 try: 7416 if not arg0.__class__ is map: 7417 arg0 = map(arg0) 7418 except: 7419 raise 7420 try: 7421 if not arg1.__class__ is map: 7422 arg1 = map(arg1) 7423 except: 7424 return union_map(arg0).apply_domain(arg1) 7425 ctx = arg0.ctx 7426 res = isl.isl_map_apply_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7427 obj = map(ctx=ctx, ptr=res) 7428 return obj 7429 def apply_range(arg0, arg1): 7430 try: 7431 if not arg0.__class__ is map: 7432 arg0 = map(arg0) 7433 except: 7434 raise 7435 try: 7436 if not arg1.__class__ is map: 7437 arg1 = map(arg1) 7438 except: 7439 return union_map(arg0).apply_range(arg1) 7440 ctx = arg0.ctx 7441 res = isl.isl_map_apply_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7442 obj = map(ctx=ctx, ptr=res) 7443 return obj 7444 def bind_domain(arg0, arg1): 7445 try: 7446 if not arg0.__class__ is map: 7447 arg0 = map(arg0) 7448 except: 7449 raise 7450 try: 7451 if not arg1.__class__ is multi_id: 7452 arg1 = multi_id(arg1) 7453 except: 7454 return union_map(arg0).bind_domain(arg1) 7455 ctx = arg0.ctx 7456 res = isl.isl_map_bind_domain(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 7457 obj = set(ctx=ctx, ptr=res) 7458 return obj 7459 def bind_range(arg0, arg1): 7460 try: 7461 if not arg0.__class__ is map: 7462 arg0 = map(arg0) 7463 except: 7464 raise 7465 try: 7466 if not arg1.__class__ is multi_id: 7467 arg1 = multi_id(arg1) 7468 except: 7469 return union_map(arg0).bind_range(arg1) 7470 ctx = arg0.ctx 7471 res = isl.isl_map_bind_range(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 7472 obj = set(ctx=ctx, ptr=res) 7473 return obj 7474 def coalesce(arg0): 7475 try: 7476 if not arg0.__class__ is map: 7477 arg0 = map(arg0) 7478 except: 7479 raise 7480 ctx = arg0.ctx 7481 res = isl.isl_map_coalesce(isl.isl_map_copy(arg0.ptr)) 7482 obj = map(ctx=ctx, ptr=res) 7483 return obj 7484 def complement(arg0): 7485 try: 7486 if not arg0.__class__ is map: 7487 arg0 = map(arg0) 7488 except: 7489 raise 7490 ctx = arg0.ctx 7491 res = isl.isl_map_complement(isl.isl_map_copy(arg0.ptr)) 7492 obj = map(ctx=ctx, ptr=res) 7493 return obj 7494 def curry(arg0): 7495 try: 7496 if not arg0.__class__ is map: 7497 arg0 = map(arg0) 7498 except: 7499 raise 7500 ctx = arg0.ctx 7501 res = isl.isl_map_curry(isl.isl_map_copy(arg0.ptr)) 7502 obj = map(ctx=ctx, ptr=res) 7503 return obj 7504 def deltas(arg0): 7505 try: 7506 if not arg0.__class__ is map: 7507 arg0 = map(arg0) 7508 except: 7509 raise 7510 ctx = arg0.ctx 7511 res = isl.isl_map_deltas(isl.isl_map_copy(arg0.ptr)) 7512 obj = set(ctx=ctx, ptr=res) 7513 return obj 7514 def detect_equalities(arg0): 7515 try: 7516 if not arg0.__class__ is map: 7517 arg0 = map(arg0) 7518 except: 7519 raise 7520 ctx = arg0.ctx 7521 res = isl.isl_map_detect_equalities(isl.isl_map_copy(arg0.ptr)) 7522 obj = map(ctx=ctx, ptr=res) 7523 return obj 7524 def domain(arg0): 7525 try: 7526 if not arg0.__class__ is map: 7527 arg0 = map(arg0) 7528 except: 7529 raise 7530 ctx = arg0.ctx 7531 res = isl.isl_map_domain(isl.isl_map_copy(arg0.ptr)) 7532 obj = set(ctx=ctx, ptr=res) 7533 return obj 7534 def domain_factor_domain(arg0): 7535 try: 7536 if not arg0.__class__ is map: 7537 arg0 = map(arg0) 7538 except: 7539 raise 7540 ctx = arg0.ctx 7541 res = isl.isl_map_domain_factor_domain(isl.isl_map_copy(arg0.ptr)) 7542 obj = map(ctx=ctx, ptr=res) 7543 return obj 7544 def domain_factor_range(arg0): 7545 try: 7546 if not arg0.__class__ is map: 7547 arg0 = map(arg0) 7548 except: 7549 raise 7550 ctx = arg0.ctx 7551 res = isl.isl_map_domain_factor_range(isl.isl_map_copy(arg0.ptr)) 7552 obj = map(ctx=ctx, ptr=res) 7553 return obj 7554 def domain_product(arg0, arg1): 7555 try: 7556 if not arg0.__class__ is map: 7557 arg0 = map(arg0) 7558 except: 7559 raise 7560 try: 7561 if not arg1.__class__ is map: 7562 arg1 = map(arg1) 7563 except: 7564 return union_map(arg0).domain_product(arg1) 7565 ctx = arg0.ctx 7566 res = isl.isl_map_domain_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7567 obj = map(ctx=ctx, ptr=res) 7568 return obj 7569 @staticmethod 7570 def empty(arg0): 7571 try: 7572 if not arg0.__class__ is space: 7573 arg0 = space(arg0) 7574 except: 7575 raise 7576 ctx = arg0.ctx 7577 res = isl.isl_map_empty(isl.isl_space_copy(arg0.ptr)) 7578 obj = map(ctx=ctx, ptr=res) 7579 return obj 7580 def eq_at(*args): 7581 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7582 ctx = args[0].ctx 7583 res = isl.isl_map_eq_at_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 7584 obj = map(ctx=ctx, ptr=res) 7585 return obj 7586 raise Error 7587 def factor_domain(arg0): 7588 try: 7589 if not arg0.__class__ is map: 7590 arg0 = map(arg0) 7591 except: 7592 raise 7593 ctx = arg0.ctx 7594 res = isl.isl_map_factor_domain(isl.isl_map_copy(arg0.ptr)) 7595 obj = map(ctx=ctx, ptr=res) 7596 return obj 7597 def factor_range(arg0): 7598 try: 7599 if not arg0.__class__ is map: 7600 arg0 = map(arg0) 7601 except: 7602 raise 7603 ctx = arg0.ctx 7604 res = isl.isl_map_factor_range(isl.isl_map_copy(arg0.ptr)) 7605 obj = map(ctx=ctx, ptr=res) 7606 return obj 7607 def flatten(arg0): 7608 try: 7609 if not arg0.__class__ is map: 7610 arg0 = map(arg0) 7611 except: 7612 raise 7613 ctx = arg0.ctx 7614 res = isl.isl_map_flatten(isl.isl_map_copy(arg0.ptr)) 7615 obj = map(ctx=ctx, ptr=res) 7616 return obj 7617 def flatten_domain(arg0): 7618 try: 7619 if not arg0.__class__ is map: 7620 arg0 = map(arg0) 7621 except: 7622 raise 7623 ctx = arg0.ctx 7624 res = isl.isl_map_flatten_domain(isl.isl_map_copy(arg0.ptr)) 7625 obj = map(ctx=ctx, ptr=res) 7626 return obj 7627 def flatten_range(arg0): 7628 try: 7629 if not arg0.__class__ is map: 7630 arg0 = map(arg0) 7631 except: 7632 raise 7633 ctx = arg0.ctx 7634 res = isl.isl_map_flatten_range(isl.isl_map_copy(arg0.ptr)) 7635 obj = map(ctx=ctx, ptr=res) 7636 return obj 7637 def foreach_basic_map(arg0, arg1): 7638 try: 7639 if not arg0.__class__ is map: 7640 arg0 = map(arg0) 7641 except: 7642 raise 7643 exc_info = [None] 7644 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7645 def cb_func(cb_arg0, cb_arg1): 7646 cb_arg0 = basic_map(ctx=arg0.ctx, ptr=(cb_arg0)) 7647 try: 7648 arg1(cb_arg0) 7649 except: 7650 import sys 7651 exc_info[0] = sys.exc_info() 7652 return -1 7653 return 0 7654 cb = fn(cb_func) 7655 ctx = arg0.ctx 7656 res = isl.isl_map_foreach_basic_map(arg0.ptr, cb, None) 7657 if exc_info[0] != None: 7658 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 7659 if res < 0: 7660 raise 7661 def range_simple_fixed_box_hull(arg0): 7662 try: 7663 if not arg0.__class__ is map: 7664 arg0 = map(arg0) 7665 except: 7666 raise 7667 ctx = arg0.ctx 7668 res = isl.isl_map_get_range_simple_fixed_box_hull(arg0.ptr) 7669 obj = fixed_box(ctx=ctx, ptr=res) 7670 return obj 7671 def get_range_simple_fixed_box_hull(arg0): 7672 return arg0.range_simple_fixed_box_hull() 7673 def space(arg0): 7674 try: 7675 if not arg0.__class__ is map: 7676 arg0 = map(arg0) 7677 except: 7678 raise 7679 ctx = arg0.ctx 7680 res = isl.isl_map_get_space(arg0.ptr) 7681 obj = space(ctx=ctx, ptr=res) 7682 return obj 7683 def get_space(arg0): 7684 return arg0.space() 7685 def gist(arg0, arg1): 7686 try: 7687 if not arg0.__class__ is map: 7688 arg0 = map(arg0) 7689 except: 7690 raise 7691 try: 7692 if not arg1.__class__ is map: 7693 arg1 = map(arg1) 7694 except: 7695 return union_map(arg0).gist(arg1) 7696 ctx = arg0.ctx 7697 res = isl.isl_map_gist(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7698 obj = map(ctx=ctx, ptr=res) 7699 return obj 7700 def gist_domain(arg0, arg1): 7701 try: 7702 if not arg0.__class__ is map: 7703 arg0 = map(arg0) 7704 except: 7705 raise 7706 try: 7707 if not arg1.__class__ is set: 7708 arg1 = set(arg1) 7709 except: 7710 return union_map(arg0).gist_domain(arg1) 7711 ctx = arg0.ctx 7712 res = isl.isl_map_gist_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7713 obj = map(ctx=ctx, ptr=res) 7714 return obj 7715 def intersect(arg0, arg1): 7716 try: 7717 if not arg0.__class__ is map: 7718 arg0 = map(arg0) 7719 except: 7720 raise 7721 try: 7722 if not arg1.__class__ is map: 7723 arg1 = map(arg1) 7724 except: 7725 return union_map(arg0).intersect(arg1) 7726 ctx = arg0.ctx 7727 res = isl.isl_map_intersect(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7728 obj = map(ctx=ctx, ptr=res) 7729 return obj 7730 def intersect_domain(arg0, arg1): 7731 try: 7732 if not arg0.__class__ is map: 7733 arg0 = map(arg0) 7734 except: 7735 raise 7736 try: 7737 if not arg1.__class__ is set: 7738 arg1 = set(arg1) 7739 except: 7740 return union_map(arg0).intersect_domain(arg1) 7741 ctx = arg0.ctx 7742 res = isl.isl_map_intersect_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7743 obj = map(ctx=ctx, ptr=res) 7744 return obj 7745 def intersect_domain_factor_domain(arg0, arg1): 7746 try: 7747 if not arg0.__class__ is map: 7748 arg0 = map(arg0) 7749 except: 7750 raise 7751 try: 7752 if not arg1.__class__ is map: 7753 arg1 = map(arg1) 7754 except: 7755 return union_map(arg0).intersect_domain_factor_domain(arg1) 7756 ctx = arg0.ctx 7757 res = isl.isl_map_intersect_domain_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7758 obj = map(ctx=ctx, ptr=res) 7759 return obj 7760 def intersect_domain_factor_range(arg0, arg1): 7761 try: 7762 if not arg0.__class__ is map: 7763 arg0 = map(arg0) 7764 except: 7765 raise 7766 try: 7767 if not arg1.__class__ is map: 7768 arg1 = map(arg1) 7769 except: 7770 return union_map(arg0).intersect_domain_factor_range(arg1) 7771 ctx = arg0.ctx 7772 res = isl.isl_map_intersect_domain_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7773 obj = map(ctx=ctx, ptr=res) 7774 return obj 7775 def intersect_params(arg0, arg1): 7776 try: 7777 if not arg0.__class__ is map: 7778 arg0 = map(arg0) 7779 except: 7780 raise 7781 try: 7782 if not arg1.__class__ is set: 7783 arg1 = set(arg1) 7784 except: 7785 return union_map(arg0).intersect_params(arg1) 7786 ctx = arg0.ctx 7787 res = isl.isl_map_intersect_params(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7788 obj = map(ctx=ctx, ptr=res) 7789 return obj 7790 def intersect_range(arg0, arg1): 7791 try: 7792 if not arg0.__class__ is map: 7793 arg0 = map(arg0) 7794 except: 7795 raise 7796 try: 7797 if not arg1.__class__ is set: 7798 arg1 = set(arg1) 7799 except: 7800 return union_map(arg0).intersect_range(arg1) 7801 ctx = arg0.ctx 7802 res = isl.isl_map_intersect_range(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7803 obj = map(ctx=ctx, ptr=res) 7804 return obj 7805 def intersect_range_factor_domain(arg0, arg1): 7806 try: 7807 if not arg0.__class__ is map: 7808 arg0 = map(arg0) 7809 except: 7810 raise 7811 try: 7812 if not arg1.__class__ is map: 7813 arg1 = map(arg1) 7814 except: 7815 return union_map(arg0).intersect_range_factor_domain(arg1) 7816 ctx = arg0.ctx 7817 res = isl.isl_map_intersect_range_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7818 obj = map(ctx=ctx, ptr=res) 7819 return obj 7820 def intersect_range_factor_range(arg0, arg1): 7821 try: 7822 if not arg0.__class__ is map: 7823 arg0 = map(arg0) 7824 except: 7825 raise 7826 try: 7827 if not arg1.__class__ is map: 7828 arg1 = map(arg1) 7829 except: 7830 return union_map(arg0).intersect_range_factor_range(arg1) 7831 ctx = arg0.ctx 7832 res = isl.isl_map_intersect_range_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 7833 obj = map(ctx=ctx, ptr=res) 7834 return obj 7835 def is_bijective(arg0): 7836 try: 7837 if not arg0.__class__ is map: 7838 arg0 = map(arg0) 7839 except: 7840 raise 7841 ctx = arg0.ctx 7842 res = isl.isl_map_is_bijective(arg0.ptr) 7843 if res < 0: 7844 raise 7845 return bool(res) 7846 def is_disjoint(arg0, arg1): 7847 try: 7848 if not arg0.__class__ is map: 7849 arg0 = map(arg0) 7850 except: 7851 raise 7852 try: 7853 if not arg1.__class__ is map: 7854 arg1 = map(arg1) 7855 except: 7856 return union_map(arg0).is_disjoint(arg1) 7857 ctx = arg0.ctx 7858 res = isl.isl_map_is_disjoint(arg0.ptr, arg1.ptr) 7859 if res < 0: 7860 raise 7861 return bool(res) 7862 def is_empty(arg0): 7863 try: 7864 if not arg0.__class__ is map: 7865 arg0 = map(arg0) 7866 except: 7867 raise 7868 ctx = arg0.ctx 7869 res = isl.isl_map_is_empty(arg0.ptr) 7870 if res < 0: 7871 raise 7872 return bool(res) 7873 def is_equal(arg0, arg1): 7874 try: 7875 if not arg0.__class__ is map: 7876 arg0 = map(arg0) 7877 except: 7878 raise 7879 try: 7880 if not arg1.__class__ is map: 7881 arg1 = map(arg1) 7882 except: 7883 return union_map(arg0).is_equal(arg1) 7884 ctx = arg0.ctx 7885 res = isl.isl_map_is_equal(arg0.ptr, arg1.ptr) 7886 if res < 0: 7887 raise 7888 return bool(res) 7889 def is_injective(arg0): 7890 try: 7891 if not arg0.__class__ is map: 7892 arg0 = map(arg0) 7893 except: 7894 raise 7895 ctx = arg0.ctx 7896 res = isl.isl_map_is_injective(arg0.ptr) 7897 if res < 0: 7898 raise 7899 return bool(res) 7900 def is_single_valued(arg0): 7901 try: 7902 if not arg0.__class__ is map: 7903 arg0 = map(arg0) 7904 except: 7905 raise 7906 ctx = arg0.ctx 7907 res = isl.isl_map_is_single_valued(arg0.ptr) 7908 if res < 0: 7909 raise 7910 return bool(res) 7911 def is_strict_subset(arg0, arg1): 7912 try: 7913 if not arg0.__class__ is map: 7914 arg0 = map(arg0) 7915 except: 7916 raise 7917 try: 7918 if not arg1.__class__ is map: 7919 arg1 = map(arg1) 7920 except: 7921 return union_map(arg0).is_strict_subset(arg1) 7922 ctx = arg0.ctx 7923 res = isl.isl_map_is_strict_subset(arg0.ptr, arg1.ptr) 7924 if res < 0: 7925 raise 7926 return bool(res) 7927 def is_subset(arg0, arg1): 7928 try: 7929 if not arg0.__class__ is map: 7930 arg0 = map(arg0) 7931 except: 7932 raise 7933 try: 7934 if not arg1.__class__ is map: 7935 arg1 = map(arg1) 7936 except: 7937 return union_map(arg0).is_subset(arg1) 7938 ctx = arg0.ctx 7939 res = isl.isl_map_is_subset(arg0.ptr, arg1.ptr) 7940 if res < 0: 7941 raise 7942 return bool(res) 7943 def lex_ge_at(*args): 7944 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7945 ctx = args[0].ctx 7946 res = isl.isl_map_lex_ge_at_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 7947 obj = map(ctx=ctx, ptr=res) 7948 return obj 7949 raise Error 7950 def lex_gt_at(*args): 7951 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7952 ctx = args[0].ctx 7953 res = isl.isl_map_lex_gt_at_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 7954 obj = map(ctx=ctx, ptr=res) 7955 return obj 7956 raise Error 7957 def lex_le_at(*args): 7958 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7959 ctx = args[0].ctx 7960 res = isl.isl_map_lex_le_at_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 7961 obj = map(ctx=ctx, ptr=res) 7962 return obj 7963 raise Error 7964 def lex_lt_at(*args): 7965 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7966 ctx = args[0].ctx 7967 res = isl.isl_map_lex_lt_at_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 7968 obj = map(ctx=ctx, ptr=res) 7969 return obj 7970 raise Error 7971 def lexmax(arg0): 7972 try: 7973 if not arg0.__class__ is map: 7974 arg0 = map(arg0) 7975 except: 7976 raise 7977 ctx = arg0.ctx 7978 res = isl.isl_map_lexmax(isl.isl_map_copy(arg0.ptr)) 7979 obj = map(ctx=ctx, ptr=res) 7980 return obj 7981 def lexmax_pw_multi_aff(arg0): 7982 try: 7983 if not arg0.__class__ is map: 7984 arg0 = map(arg0) 7985 except: 7986 raise 7987 ctx = arg0.ctx 7988 res = isl.isl_map_lexmax_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 7989 obj = pw_multi_aff(ctx=ctx, ptr=res) 7990 return obj 7991 def lexmin(arg0): 7992 try: 7993 if not arg0.__class__ is map: 7994 arg0 = map(arg0) 7995 except: 7996 raise 7997 ctx = arg0.ctx 7998 res = isl.isl_map_lexmin(isl.isl_map_copy(arg0.ptr)) 7999 obj = map(ctx=ctx, ptr=res) 8000 return obj 8001 def lexmin_pw_multi_aff(arg0): 8002 try: 8003 if not arg0.__class__ is map: 8004 arg0 = map(arg0) 8005 except: 8006 raise 8007 ctx = arg0.ctx 8008 res = isl.isl_map_lexmin_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 8009 obj = pw_multi_aff(ctx=ctx, ptr=res) 8010 return obj 8011 def lower_bound(*args): 8012 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8013 ctx = args[0].ctx 8014 res = isl.isl_map_lower_bound_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 8015 obj = map(ctx=ctx, ptr=res) 8016 return obj 8017 raise Error 8018 def max_multi_pw_aff(arg0): 8019 try: 8020 if not arg0.__class__ is map: 8021 arg0 = map(arg0) 8022 except: 8023 raise 8024 ctx = arg0.ctx 8025 res = isl.isl_map_max_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 8026 obj = multi_pw_aff(ctx=ctx, ptr=res) 8027 return obj 8028 def min_multi_pw_aff(arg0): 8029 try: 8030 if not arg0.__class__ is map: 8031 arg0 = map(arg0) 8032 except: 8033 raise 8034 ctx = arg0.ctx 8035 res = isl.isl_map_min_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 8036 obj = multi_pw_aff(ctx=ctx, ptr=res) 8037 return obj 8038 def polyhedral_hull(arg0): 8039 try: 8040 if not arg0.__class__ is map: 8041 arg0 = map(arg0) 8042 except: 8043 raise 8044 ctx = arg0.ctx 8045 res = isl.isl_map_polyhedral_hull(isl.isl_map_copy(arg0.ptr)) 8046 obj = basic_map(ctx=ctx, ptr=res) 8047 return obj 8048 def preimage_domain(*args): 8049 if len(args) == 2 and args[1].__class__ is multi_aff: 8050 ctx = args[0].ctx 8051 res = isl.isl_map_preimage_domain_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 8052 obj = map(ctx=ctx, ptr=res) 8053 return obj 8054 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8055 ctx = args[0].ctx 8056 res = isl.isl_map_preimage_domain_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 8057 obj = map(ctx=ctx, ptr=res) 8058 return obj 8059 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8060 ctx = args[0].ctx 8061 res = isl.isl_map_preimage_domain_pw_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 8062 obj = map(ctx=ctx, ptr=res) 8063 return obj 8064 raise Error 8065 def preimage_range(*args): 8066 if len(args) == 2 and args[1].__class__ is multi_aff: 8067 ctx = args[0].ctx 8068 res = isl.isl_map_preimage_range_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 8069 obj = map(ctx=ctx, ptr=res) 8070 return obj 8071 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8072 ctx = args[0].ctx 8073 res = isl.isl_map_preimage_range_pw_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 8074 obj = map(ctx=ctx, ptr=res) 8075 return obj 8076 raise Error 8077 def product(arg0, arg1): 8078 try: 8079 if not arg0.__class__ is map: 8080 arg0 = map(arg0) 8081 except: 8082 raise 8083 try: 8084 if not arg1.__class__ is map: 8085 arg1 = map(arg1) 8086 except: 8087 return union_map(arg0).product(arg1) 8088 ctx = arg0.ctx 8089 res = isl.isl_map_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8090 obj = map(ctx=ctx, ptr=res) 8091 return obj 8092 def project_out_all_params(arg0): 8093 try: 8094 if not arg0.__class__ is map: 8095 arg0 = map(arg0) 8096 except: 8097 raise 8098 ctx = arg0.ctx 8099 res = isl.isl_map_project_out_all_params(isl.isl_map_copy(arg0.ptr)) 8100 obj = map(ctx=ctx, ptr=res) 8101 return obj 8102 def range(arg0): 8103 try: 8104 if not arg0.__class__ is map: 8105 arg0 = map(arg0) 8106 except: 8107 raise 8108 ctx = arg0.ctx 8109 res = isl.isl_map_range(isl.isl_map_copy(arg0.ptr)) 8110 obj = set(ctx=ctx, ptr=res) 8111 return obj 8112 def range_factor_domain(arg0): 8113 try: 8114 if not arg0.__class__ is map: 8115 arg0 = map(arg0) 8116 except: 8117 raise 8118 ctx = arg0.ctx 8119 res = isl.isl_map_range_factor_domain(isl.isl_map_copy(arg0.ptr)) 8120 obj = map(ctx=ctx, ptr=res) 8121 return obj 8122 def range_factor_range(arg0): 8123 try: 8124 if not arg0.__class__ is map: 8125 arg0 = map(arg0) 8126 except: 8127 raise 8128 ctx = arg0.ctx 8129 res = isl.isl_map_range_factor_range(isl.isl_map_copy(arg0.ptr)) 8130 obj = map(ctx=ctx, ptr=res) 8131 return obj 8132 def range_product(arg0, arg1): 8133 try: 8134 if not arg0.__class__ is map: 8135 arg0 = map(arg0) 8136 except: 8137 raise 8138 try: 8139 if not arg1.__class__ is map: 8140 arg1 = map(arg1) 8141 except: 8142 return union_map(arg0).range_product(arg1) 8143 ctx = arg0.ctx 8144 res = isl.isl_map_range_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8145 obj = map(ctx=ctx, ptr=res) 8146 return obj 8147 def range_reverse(arg0): 8148 try: 8149 if not arg0.__class__ is map: 8150 arg0 = map(arg0) 8151 except: 8152 raise 8153 ctx = arg0.ctx 8154 res = isl.isl_map_range_reverse(isl.isl_map_copy(arg0.ptr)) 8155 obj = map(ctx=ctx, ptr=res) 8156 return obj 8157 def reverse(arg0): 8158 try: 8159 if not arg0.__class__ is map: 8160 arg0 = map(arg0) 8161 except: 8162 raise 8163 ctx = arg0.ctx 8164 res = isl.isl_map_reverse(isl.isl_map_copy(arg0.ptr)) 8165 obj = map(ctx=ctx, ptr=res) 8166 return obj 8167 def sample(arg0): 8168 try: 8169 if not arg0.__class__ is map: 8170 arg0 = map(arg0) 8171 except: 8172 raise 8173 ctx = arg0.ctx 8174 res = isl.isl_map_sample(isl.isl_map_copy(arg0.ptr)) 8175 obj = basic_map(ctx=ctx, ptr=res) 8176 return obj 8177 def subtract(arg0, arg1): 8178 try: 8179 if not arg0.__class__ is map: 8180 arg0 = map(arg0) 8181 except: 8182 raise 8183 try: 8184 if not arg1.__class__ is map: 8185 arg1 = map(arg1) 8186 except: 8187 return union_map(arg0).subtract(arg1) 8188 ctx = arg0.ctx 8189 res = isl.isl_map_subtract(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8190 obj = map(ctx=ctx, ptr=res) 8191 return obj 8192 def uncurry(arg0): 8193 try: 8194 if not arg0.__class__ is map: 8195 arg0 = map(arg0) 8196 except: 8197 raise 8198 ctx = arg0.ctx 8199 res = isl.isl_map_uncurry(isl.isl_map_copy(arg0.ptr)) 8200 obj = map(ctx=ctx, ptr=res) 8201 return obj 8202 def union(arg0, arg1): 8203 try: 8204 if not arg0.__class__ is map: 8205 arg0 = map(arg0) 8206 except: 8207 raise 8208 try: 8209 if not arg1.__class__ is map: 8210 arg1 = map(arg1) 8211 except: 8212 return union_map(arg0).union(arg1) 8213 ctx = arg0.ctx 8214 res = isl.isl_map_union(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8215 obj = map(ctx=ctx, ptr=res) 8216 return obj 8217 @staticmethod 8218 def universe(arg0): 8219 try: 8220 if not arg0.__class__ is space: 8221 arg0 = space(arg0) 8222 except: 8223 raise 8224 ctx = arg0.ctx 8225 res = isl.isl_map_universe(isl.isl_space_copy(arg0.ptr)) 8226 obj = map(ctx=ctx, ptr=res) 8227 return obj 8228 def unshifted_simple_hull(arg0): 8229 try: 8230 if not arg0.__class__ is map: 8231 arg0 = map(arg0) 8232 except: 8233 raise 8234 ctx = arg0.ctx 8235 res = isl.isl_map_unshifted_simple_hull(isl.isl_map_copy(arg0.ptr)) 8236 obj = basic_map(ctx=ctx, ptr=res) 8237 return obj 8238 def upper_bound(*args): 8239 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8240 ctx = args[0].ctx 8241 res = isl.isl_map_upper_bound_multi_pw_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 8242 obj = map(ctx=ctx, ptr=res) 8243 return obj 8244 raise Error 8245 def wrap(arg0): 8246 try: 8247 if not arg0.__class__ is map: 8248 arg0 = map(arg0) 8249 except: 8250 raise 8251 ctx = arg0.ctx 8252 res = isl.isl_map_wrap(isl.isl_map_copy(arg0.ptr)) 8253 obj = set(ctx=ctx, ptr=res) 8254 return obj 8255 def zip(arg0): 8256 try: 8257 if not arg0.__class__ is map: 8258 arg0 = map(arg0) 8259 except: 8260 raise 8261 ctx = arg0.ctx 8262 res = isl.isl_map_zip(isl.isl_map_copy(arg0.ptr)) 8263 obj = map(ctx=ctx, ptr=res) 8264 return obj 8265 8266isl.isl_map_from_basic_map.restype = c_void_p 8267isl.isl_map_from_basic_map.argtypes = [c_void_p] 8268isl.isl_map_read_from_str.restype = c_void_p 8269isl.isl_map_read_from_str.argtypes = [Context, c_char_p] 8270isl.isl_map_affine_hull.restype = c_void_p 8271isl.isl_map_affine_hull.argtypes = [c_void_p] 8272isl.isl_map_apply_domain.restype = c_void_p 8273isl.isl_map_apply_domain.argtypes = [c_void_p, c_void_p] 8274isl.isl_map_apply_range.restype = c_void_p 8275isl.isl_map_apply_range.argtypes = [c_void_p, c_void_p] 8276isl.isl_map_bind_domain.restype = c_void_p 8277isl.isl_map_bind_domain.argtypes = [c_void_p, c_void_p] 8278isl.isl_map_bind_range.restype = c_void_p 8279isl.isl_map_bind_range.argtypes = [c_void_p, c_void_p] 8280isl.isl_map_coalesce.restype = c_void_p 8281isl.isl_map_coalesce.argtypes = [c_void_p] 8282isl.isl_map_complement.restype = c_void_p 8283isl.isl_map_complement.argtypes = [c_void_p] 8284isl.isl_map_curry.restype = c_void_p 8285isl.isl_map_curry.argtypes = [c_void_p] 8286isl.isl_map_deltas.restype = c_void_p 8287isl.isl_map_deltas.argtypes = [c_void_p] 8288isl.isl_map_detect_equalities.restype = c_void_p 8289isl.isl_map_detect_equalities.argtypes = [c_void_p] 8290isl.isl_map_domain.restype = c_void_p 8291isl.isl_map_domain.argtypes = [c_void_p] 8292isl.isl_map_domain_factor_domain.restype = c_void_p 8293isl.isl_map_domain_factor_domain.argtypes = [c_void_p] 8294isl.isl_map_domain_factor_range.restype = c_void_p 8295isl.isl_map_domain_factor_range.argtypes = [c_void_p] 8296isl.isl_map_domain_product.restype = c_void_p 8297isl.isl_map_domain_product.argtypes = [c_void_p, c_void_p] 8298isl.isl_map_empty.restype = c_void_p 8299isl.isl_map_empty.argtypes = [c_void_p] 8300isl.isl_map_eq_at_multi_pw_aff.restype = c_void_p 8301isl.isl_map_eq_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8302isl.isl_map_factor_domain.restype = c_void_p 8303isl.isl_map_factor_domain.argtypes = [c_void_p] 8304isl.isl_map_factor_range.restype = c_void_p 8305isl.isl_map_factor_range.argtypes = [c_void_p] 8306isl.isl_map_flatten.restype = c_void_p 8307isl.isl_map_flatten.argtypes = [c_void_p] 8308isl.isl_map_flatten_domain.restype = c_void_p 8309isl.isl_map_flatten_domain.argtypes = [c_void_p] 8310isl.isl_map_flatten_range.restype = c_void_p 8311isl.isl_map_flatten_range.argtypes = [c_void_p] 8312isl.isl_map_foreach_basic_map.argtypes = [c_void_p, c_void_p, c_void_p] 8313isl.isl_map_get_range_simple_fixed_box_hull.restype = c_void_p 8314isl.isl_map_get_range_simple_fixed_box_hull.argtypes = [c_void_p] 8315isl.isl_map_get_space.restype = c_void_p 8316isl.isl_map_get_space.argtypes = [c_void_p] 8317isl.isl_map_gist.restype = c_void_p 8318isl.isl_map_gist.argtypes = [c_void_p, c_void_p] 8319isl.isl_map_gist_domain.restype = c_void_p 8320isl.isl_map_gist_domain.argtypes = [c_void_p, c_void_p] 8321isl.isl_map_intersect.restype = c_void_p 8322isl.isl_map_intersect.argtypes = [c_void_p, c_void_p] 8323isl.isl_map_intersect_domain.restype = c_void_p 8324isl.isl_map_intersect_domain.argtypes = [c_void_p, c_void_p] 8325isl.isl_map_intersect_domain_factor_domain.restype = c_void_p 8326isl.isl_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 8327isl.isl_map_intersect_domain_factor_range.restype = c_void_p 8328isl.isl_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 8329isl.isl_map_intersect_params.restype = c_void_p 8330isl.isl_map_intersect_params.argtypes = [c_void_p, c_void_p] 8331isl.isl_map_intersect_range.restype = c_void_p 8332isl.isl_map_intersect_range.argtypes = [c_void_p, c_void_p] 8333isl.isl_map_intersect_range_factor_domain.restype = c_void_p 8334isl.isl_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 8335isl.isl_map_intersect_range_factor_range.restype = c_void_p 8336isl.isl_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 8337isl.isl_map_is_bijective.argtypes = [c_void_p] 8338isl.isl_map_is_disjoint.argtypes = [c_void_p, c_void_p] 8339isl.isl_map_is_empty.argtypes = [c_void_p] 8340isl.isl_map_is_equal.argtypes = [c_void_p, c_void_p] 8341isl.isl_map_is_injective.argtypes = [c_void_p] 8342isl.isl_map_is_single_valued.argtypes = [c_void_p] 8343isl.isl_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 8344isl.isl_map_is_subset.argtypes = [c_void_p, c_void_p] 8345isl.isl_map_lex_ge_at_multi_pw_aff.restype = c_void_p 8346isl.isl_map_lex_ge_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8347isl.isl_map_lex_gt_at_multi_pw_aff.restype = c_void_p 8348isl.isl_map_lex_gt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8349isl.isl_map_lex_le_at_multi_pw_aff.restype = c_void_p 8350isl.isl_map_lex_le_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8351isl.isl_map_lex_lt_at_multi_pw_aff.restype = c_void_p 8352isl.isl_map_lex_lt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8353isl.isl_map_lexmax.restype = c_void_p 8354isl.isl_map_lexmax.argtypes = [c_void_p] 8355isl.isl_map_lexmax_pw_multi_aff.restype = c_void_p 8356isl.isl_map_lexmax_pw_multi_aff.argtypes = [c_void_p] 8357isl.isl_map_lexmin.restype = c_void_p 8358isl.isl_map_lexmin.argtypes = [c_void_p] 8359isl.isl_map_lexmin_pw_multi_aff.restype = c_void_p 8360isl.isl_map_lexmin_pw_multi_aff.argtypes = [c_void_p] 8361isl.isl_map_lower_bound_multi_pw_aff.restype = c_void_p 8362isl.isl_map_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8363isl.isl_map_max_multi_pw_aff.restype = c_void_p 8364isl.isl_map_max_multi_pw_aff.argtypes = [c_void_p] 8365isl.isl_map_min_multi_pw_aff.restype = c_void_p 8366isl.isl_map_min_multi_pw_aff.argtypes = [c_void_p] 8367isl.isl_map_polyhedral_hull.restype = c_void_p 8368isl.isl_map_polyhedral_hull.argtypes = [c_void_p] 8369isl.isl_map_preimage_domain_multi_aff.restype = c_void_p 8370isl.isl_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 8371isl.isl_map_preimage_domain_multi_pw_aff.restype = c_void_p 8372isl.isl_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8373isl.isl_map_preimage_domain_pw_multi_aff.restype = c_void_p 8374isl.isl_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8375isl.isl_map_preimage_range_multi_aff.restype = c_void_p 8376isl.isl_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 8377isl.isl_map_preimage_range_pw_multi_aff.restype = c_void_p 8378isl.isl_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8379isl.isl_map_product.restype = c_void_p 8380isl.isl_map_product.argtypes = [c_void_p, c_void_p] 8381isl.isl_map_project_out_all_params.restype = c_void_p 8382isl.isl_map_project_out_all_params.argtypes = [c_void_p] 8383isl.isl_map_range.restype = c_void_p 8384isl.isl_map_range.argtypes = [c_void_p] 8385isl.isl_map_range_factor_domain.restype = c_void_p 8386isl.isl_map_range_factor_domain.argtypes = [c_void_p] 8387isl.isl_map_range_factor_range.restype = c_void_p 8388isl.isl_map_range_factor_range.argtypes = [c_void_p] 8389isl.isl_map_range_product.restype = c_void_p 8390isl.isl_map_range_product.argtypes = [c_void_p, c_void_p] 8391isl.isl_map_range_reverse.restype = c_void_p 8392isl.isl_map_range_reverse.argtypes = [c_void_p] 8393isl.isl_map_reverse.restype = c_void_p 8394isl.isl_map_reverse.argtypes = [c_void_p] 8395isl.isl_map_sample.restype = c_void_p 8396isl.isl_map_sample.argtypes = [c_void_p] 8397isl.isl_map_subtract.restype = c_void_p 8398isl.isl_map_subtract.argtypes = [c_void_p, c_void_p] 8399isl.isl_map_uncurry.restype = c_void_p 8400isl.isl_map_uncurry.argtypes = [c_void_p] 8401isl.isl_map_union.restype = c_void_p 8402isl.isl_map_union.argtypes = [c_void_p, c_void_p] 8403isl.isl_map_universe.restype = c_void_p 8404isl.isl_map_universe.argtypes = [c_void_p] 8405isl.isl_map_unshifted_simple_hull.restype = c_void_p 8406isl.isl_map_unshifted_simple_hull.argtypes = [c_void_p] 8407isl.isl_map_upper_bound_multi_pw_aff.restype = c_void_p 8408isl.isl_map_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8409isl.isl_map_wrap.restype = c_void_p 8410isl.isl_map_wrap.argtypes = [c_void_p] 8411isl.isl_map_zip.restype = c_void_p 8412isl.isl_map_zip.argtypes = [c_void_p] 8413isl.isl_map_copy.restype = c_void_p 8414isl.isl_map_copy.argtypes = [c_void_p] 8415isl.isl_map_free.restype = c_void_p 8416isl.isl_map_free.argtypes = [c_void_p] 8417isl.isl_map_to_str.restype = POINTER(c_char) 8418isl.isl_map_to_str.argtypes = [c_void_p] 8419 8420class basic_map(map): 8421 def __init__(self, *args, **keywords): 8422 if "ptr" in keywords: 8423 self.ctx = keywords["ctx"] 8424 self.ptr = keywords["ptr"] 8425 return 8426 if len(args) == 1 and type(args[0]) == str: 8427 self.ctx = Context.getDefaultInstance() 8428 self.ptr = isl.isl_basic_map_read_from_str(self.ctx, args[0].encode('ascii')) 8429 return 8430 raise Error 8431 def __del__(self): 8432 if hasattr(self, 'ptr'): 8433 isl.isl_basic_map_free(self.ptr) 8434 def __str__(arg0): 8435 try: 8436 if not arg0.__class__ is basic_map: 8437 arg0 = basic_map(arg0) 8438 except: 8439 raise 8440 ptr = isl.isl_basic_map_to_str(arg0.ptr) 8441 res = cast(ptr, c_char_p).value.decode('ascii') 8442 libc.free(ptr) 8443 return res 8444 def __repr__(self): 8445 s = str(self) 8446 if '"' in s: 8447 return 'isl.basic_map("""%s""")' % s 8448 else: 8449 return 'isl.basic_map("%s")' % s 8450 def affine_hull(arg0): 8451 try: 8452 if not arg0.__class__ is basic_map: 8453 arg0 = basic_map(arg0) 8454 except: 8455 raise 8456 ctx = arg0.ctx 8457 res = isl.isl_basic_map_affine_hull(isl.isl_basic_map_copy(arg0.ptr)) 8458 obj = basic_map(ctx=ctx, ptr=res) 8459 return obj 8460 def apply_domain(arg0, arg1): 8461 try: 8462 if not arg0.__class__ is basic_map: 8463 arg0 = basic_map(arg0) 8464 except: 8465 raise 8466 try: 8467 if not arg1.__class__ is basic_map: 8468 arg1 = basic_map(arg1) 8469 except: 8470 return map(arg0).apply_domain(arg1) 8471 ctx = arg0.ctx 8472 res = isl.isl_basic_map_apply_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 8473 obj = basic_map(ctx=ctx, ptr=res) 8474 return obj 8475 def apply_range(arg0, arg1): 8476 try: 8477 if not arg0.__class__ is basic_map: 8478 arg0 = basic_map(arg0) 8479 except: 8480 raise 8481 try: 8482 if not arg1.__class__ is basic_map: 8483 arg1 = basic_map(arg1) 8484 except: 8485 return map(arg0).apply_range(arg1) 8486 ctx = arg0.ctx 8487 res = isl.isl_basic_map_apply_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 8488 obj = basic_map(ctx=ctx, ptr=res) 8489 return obj 8490 def deltas(arg0): 8491 try: 8492 if not arg0.__class__ is basic_map: 8493 arg0 = basic_map(arg0) 8494 except: 8495 raise 8496 ctx = arg0.ctx 8497 res = isl.isl_basic_map_deltas(isl.isl_basic_map_copy(arg0.ptr)) 8498 obj = basic_set(ctx=ctx, ptr=res) 8499 return obj 8500 def detect_equalities(arg0): 8501 try: 8502 if not arg0.__class__ is basic_map: 8503 arg0 = basic_map(arg0) 8504 except: 8505 raise 8506 ctx = arg0.ctx 8507 res = isl.isl_basic_map_detect_equalities(isl.isl_basic_map_copy(arg0.ptr)) 8508 obj = basic_map(ctx=ctx, ptr=res) 8509 return obj 8510 def flatten(arg0): 8511 try: 8512 if not arg0.__class__ is basic_map: 8513 arg0 = basic_map(arg0) 8514 except: 8515 raise 8516 ctx = arg0.ctx 8517 res = isl.isl_basic_map_flatten(isl.isl_basic_map_copy(arg0.ptr)) 8518 obj = basic_map(ctx=ctx, ptr=res) 8519 return obj 8520 def flatten_domain(arg0): 8521 try: 8522 if not arg0.__class__ is basic_map: 8523 arg0 = basic_map(arg0) 8524 except: 8525 raise 8526 ctx = arg0.ctx 8527 res = isl.isl_basic_map_flatten_domain(isl.isl_basic_map_copy(arg0.ptr)) 8528 obj = basic_map(ctx=ctx, ptr=res) 8529 return obj 8530 def flatten_range(arg0): 8531 try: 8532 if not arg0.__class__ is basic_map: 8533 arg0 = basic_map(arg0) 8534 except: 8535 raise 8536 ctx = arg0.ctx 8537 res = isl.isl_basic_map_flatten_range(isl.isl_basic_map_copy(arg0.ptr)) 8538 obj = basic_map(ctx=ctx, ptr=res) 8539 return obj 8540 def gist(arg0, arg1): 8541 try: 8542 if not arg0.__class__ is basic_map: 8543 arg0 = basic_map(arg0) 8544 except: 8545 raise 8546 try: 8547 if not arg1.__class__ is basic_map: 8548 arg1 = basic_map(arg1) 8549 except: 8550 return map(arg0).gist(arg1) 8551 ctx = arg0.ctx 8552 res = isl.isl_basic_map_gist(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 8553 obj = basic_map(ctx=ctx, ptr=res) 8554 return obj 8555 def intersect(arg0, arg1): 8556 try: 8557 if not arg0.__class__ is basic_map: 8558 arg0 = basic_map(arg0) 8559 except: 8560 raise 8561 try: 8562 if not arg1.__class__ is basic_map: 8563 arg1 = basic_map(arg1) 8564 except: 8565 return map(arg0).intersect(arg1) 8566 ctx = arg0.ctx 8567 res = isl.isl_basic_map_intersect(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 8568 obj = basic_map(ctx=ctx, ptr=res) 8569 return obj 8570 def intersect_domain(arg0, arg1): 8571 try: 8572 if not arg0.__class__ is basic_map: 8573 arg0 = basic_map(arg0) 8574 except: 8575 raise 8576 try: 8577 if not arg1.__class__ is basic_set: 8578 arg1 = basic_set(arg1) 8579 except: 8580 return map(arg0).intersect_domain(arg1) 8581 ctx = arg0.ctx 8582 res = isl.isl_basic_map_intersect_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 8583 obj = basic_map(ctx=ctx, ptr=res) 8584 return obj 8585 def intersect_range(arg0, arg1): 8586 try: 8587 if not arg0.__class__ is basic_map: 8588 arg0 = basic_map(arg0) 8589 except: 8590 raise 8591 try: 8592 if not arg1.__class__ is basic_set: 8593 arg1 = basic_set(arg1) 8594 except: 8595 return map(arg0).intersect_range(arg1) 8596 ctx = arg0.ctx 8597 res = isl.isl_basic_map_intersect_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 8598 obj = basic_map(ctx=ctx, ptr=res) 8599 return obj 8600 def is_empty(arg0): 8601 try: 8602 if not arg0.__class__ is basic_map: 8603 arg0 = basic_map(arg0) 8604 except: 8605 raise 8606 ctx = arg0.ctx 8607 res = isl.isl_basic_map_is_empty(arg0.ptr) 8608 if res < 0: 8609 raise 8610 return bool(res) 8611 def is_equal(arg0, arg1): 8612 try: 8613 if not arg0.__class__ is basic_map: 8614 arg0 = basic_map(arg0) 8615 except: 8616 raise 8617 try: 8618 if not arg1.__class__ is basic_map: 8619 arg1 = basic_map(arg1) 8620 except: 8621 return map(arg0).is_equal(arg1) 8622 ctx = arg0.ctx 8623 res = isl.isl_basic_map_is_equal(arg0.ptr, arg1.ptr) 8624 if res < 0: 8625 raise 8626 return bool(res) 8627 def is_subset(arg0, arg1): 8628 try: 8629 if not arg0.__class__ is basic_map: 8630 arg0 = basic_map(arg0) 8631 except: 8632 raise 8633 try: 8634 if not arg1.__class__ is basic_map: 8635 arg1 = basic_map(arg1) 8636 except: 8637 return map(arg0).is_subset(arg1) 8638 ctx = arg0.ctx 8639 res = isl.isl_basic_map_is_subset(arg0.ptr, arg1.ptr) 8640 if res < 0: 8641 raise 8642 return bool(res) 8643 def lexmax(arg0): 8644 try: 8645 if not arg0.__class__ is basic_map: 8646 arg0 = basic_map(arg0) 8647 except: 8648 raise 8649 ctx = arg0.ctx 8650 res = isl.isl_basic_map_lexmax(isl.isl_basic_map_copy(arg0.ptr)) 8651 obj = map(ctx=ctx, ptr=res) 8652 return obj 8653 def lexmin(arg0): 8654 try: 8655 if not arg0.__class__ is basic_map: 8656 arg0 = basic_map(arg0) 8657 except: 8658 raise 8659 ctx = arg0.ctx 8660 res = isl.isl_basic_map_lexmin(isl.isl_basic_map_copy(arg0.ptr)) 8661 obj = map(ctx=ctx, ptr=res) 8662 return obj 8663 def reverse(arg0): 8664 try: 8665 if not arg0.__class__ is basic_map: 8666 arg0 = basic_map(arg0) 8667 except: 8668 raise 8669 ctx = arg0.ctx 8670 res = isl.isl_basic_map_reverse(isl.isl_basic_map_copy(arg0.ptr)) 8671 obj = basic_map(ctx=ctx, ptr=res) 8672 return obj 8673 def sample(arg0): 8674 try: 8675 if not arg0.__class__ is basic_map: 8676 arg0 = basic_map(arg0) 8677 except: 8678 raise 8679 ctx = arg0.ctx 8680 res = isl.isl_basic_map_sample(isl.isl_basic_map_copy(arg0.ptr)) 8681 obj = basic_map(ctx=ctx, ptr=res) 8682 return obj 8683 def union(arg0, arg1): 8684 try: 8685 if not arg0.__class__ is basic_map: 8686 arg0 = basic_map(arg0) 8687 except: 8688 raise 8689 try: 8690 if not arg1.__class__ is basic_map: 8691 arg1 = basic_map(arg1) 8692 except: 8693 return map(arg0).union(arg1) 8694 ctx = arg0.ctx 8695 res = isl.isl_basic_map_union(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 8696 obj = map(ctx=ctx, ptr=res) 8697 return obj 8698 8699isl.isl_basic_map_read_from_str.restype = c_void_p 8700isl.isl_basic_map_read_from_str.argtypes = [Context, c_char_p] 8701isl.isl_basic_map_affine_hull.restype = c_void_p 8702isl.isl_basic_map_affine_hull.argtypes = [c_void_p] 8703isl.isl_basic_map_apply_domain.restype = c_void_p 8704isl.isl_basic_map_apply_domain.argtypes = [c_void_p, c_void_p] 8705isl.isl_basic_map_apply_range.restype = c_void_p 8706isl.isl_basic_map_apply_range.argtypes = [c_void_p, c_void_p] 8707isl.isl_basic_map_deltas.restype = c_void_p 8708isl.isl_basic_map_deltas.argtypes = [c_void_p] 8709isl.isl_basic_map_detect_equalities.restype = c_void_p 8710isl.isl_basic_map_detect_equalities.argtypes = [c_void_p] 8711isl.isl_basic_map_flatten.restype = c_void_p 8712isl.isl_basic_map_flatten.argtypes = [c_void_p] 8713isl.isl_basic_map_flatten_domain.restype = c_void_p 8714isl.isl_basic_map_flatten_domain.argtypes = [c_void_p] 8715isl.isl_basic_map_flatten_range.restype = c_void_p 8716isl.isl_basic_map_flatten_range.argtypes = [c_void_p] 8717isl.isl_basic_map_gist.restype = c_void_p 8718isl.isl_basic_map_gist.argtypes = [c_void_p, c_void_p] 8719isl.isl_basic_map_intersect.restype = c_void_p 8720isl.isl_basic_map_intersect.argtypes = [c_void_p, c_void_p] 8721isl.isl_basic_map_intersect_domain.restype = c_void_p 8722isl.isl_basic_map_intersect_domain.argtypes = [c_void_p, c_void_p] 8723isl.isl_basic_map_intersect_range.restype = c_void_p 8724isl.isl_basic_map_intersect_range.argtypes = [c_void_p, c_void_p] 8725isl.isl_basic_map_is_empty.argtypes = [c_void_p] 8726isl.isl_basic_map_is_equal.argtypes = [c_void_p, c_void_p] 8727isl.isl_basic_map_is_subset.argtypes = [c_void_p, c_void_p] 8728isl.isl_basic_map_lexmax.restype = c_void_p 8729isl.isl_basic_map_lexmax.argtypes = [c_void_p] 8730isl.isl_basic_map_lexmin.restype = c_void_p 8731isl.isl_basic_map_lexmin.argtypes = [c_void_p] 8732isl.isl_basic_map_reverse.restype = c_void_p 8733isl.isl_basic_map_reverse.argtypes = [c_void_p] 8734isl.isl_basic_map_sample.restype = c_void_p 8735isl.isl_basic_map_sample.argtypes = [c_void_p] 8736isl.isl_basic_map_union.restype = c_void_p 8737isl.isl_basic_map_union.argtypes = [c_void_p, c_void_p] 8738isl.isl_basic_map_copy.restype = c_void_p 8739isl.isl_basic_map_copy.argtypes = [c_void_p] 8740isl.isl_basic_map_free.restype = c_void_p 8741isl.isl_basic_map_free.argtypes = [c_void_p] 8742isl.isl_basic_map_to_str.restype = POINTER(c_char) 8743isl.isl_basic_map_to_str.argtypes = [c_void_p] 8744 8745class union_set(object): 8746 def __init__(self, *args, **keywords): 8747 if "ptr" in keywords: 8748 self.ctx = keywords["ctx"] 8749 self.ptr = keywords["ptr"] 8750 return 8751 if len(args) == 1 and args[0].__class__ is basic_set: 8752 self.ctx = Context.getDefaultInstance() 8753 self.ptr = isl.isl_union_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 8754 return 8755 if len(args) == 1 and args[0].__class__ is point: 8756 self.ctx = Context.getDefaultInstance() 8757 self.ptr = isl.isl_union_set_from_point(isl.isl_point_copy(args[0].ptr)) 8758 return 8759 if len(args) == 1 and args[0].__class__ is set: 8760 self.ctx = Context.getDefaultInstance() 8761 self.ptr = isl.isl_union_set_from_set(isl.isl_set_copy(args[0].ptr)) 8762 return 8763 if len(args) == 1 and type(args[0]) == str: 8764 self.ctx = Context.getDefaultInstance() 8765 self.ptr = isl.isl_union_set_read_from_str(self.ctx, args[0].encode('ascii')) 8766 return 8767 raise Error 8768 def __del__(self): 8769 if hasattr(self, 'ptr'): 8770 isl.isl_union_set_free(self.ptr) 8771 def __str__(arg0): 8772 try: 8773 if not arg0.__class__ is union_set: 8774 arg0 = union_set(arg0) 8775 except: 8776 raise 8777 ptr = isl.isl_union_set_to_str(arg0.ptr) 8778 res = cast(ptr, c_char_p).value.decode('ascii') 8779 libc.free(ptr) 8780 return res 8781 def __repr__(self): 8782 s = str(self) 8783 if '"' in s: 8784 return 'isl.union_set("""%s""")' % s 8785 else: 8786 return 'isl.union_set("%s")' % s 8787 def affine_hull(arg0): 8788 try: 8789 if not arg0.__class__ is union_set: 8790 arg0 = union_set(arg0) 8791 except: 8792 raise 8793 ctx = arg0.ctx 8794 res = isl.isl_union_set_affine_hull(isl.isl_union_set_copy(arg0.ptr)) 8795 obj = union_set(ctx=ctx, ptr=res) 8796 return obj 8797 def apply(arg0, arg1): 8798 try: 8799 if not arg0.__class__ is union_set: 8800 arg0 = union_set(arg0) 8801 except: 8802 raise 8803 try: 8804 if not arg1.__class__ is union_map: 8805 arg1 = union_map(arg1) 8806 except: 8807 raise 8808 ctx = arg0.ctx 8809 res = isl.isl_union_set_apply(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8810 obj = union_set(ctx=ctx, ptr=res) 8811 return obj 8812 def coalesce(arg0): 8813 try: 8814 if not arg0.__class__ is union_set: 8815 arg0 = union_set(arg0) 8816 except: 8817 raise 8818 ctx = arg0.ctx 8819 res = isl.isl_union_set_coalesce(isl.isl_union_set_copy(arg0.ptr)) 8820 obj = union_set(ctx=ctx, ptr=res) 8821 return obj 8822 def compute_divs(arg0): 8823 try: 8824 if not arg0.__class__ is union_set: 8825 arg0 = union_set(arg0) 8826 except: 8827 raise 8828 ctx = arg0.ctx 8829 res = isl.isl_union_set_compute_divs(isl.isl_union_set_copy(arg0.ptr)) 8830 obj = union_set(ctx=ctx, ptr=res) 8831 return obj 8832 def detect_equalities(arg0): 8833 try: 8834 if not arg0.__class__ is union_set: 8835 arg0 = union_set(arg0) 8836 except: 8837 raise 8838 ctx = arg0.ctx 8839 res = isl.isl_union_set_detect_equalities(isl.isl_union_set_copy(arg0.ptr)) 8840 obj = union_set(ctx=ctx, ptr=res) 8841 return obj 8842 @staticmethod 8843 def empty(*args): 8844 if len(args) == 0: 8845 ctx = Context.getDefaultInstance() 8846 res = isl.isl_union_set_empty_ctx(ctx) 8847 obj = union_set(ctx=ctx, ptr=res) 8848 return obj 8849 raise Error 8850 def every_set(arg0, arg1): 8851 try: 8852 if not arg0.__class__ is union_set: 8853 arg0 = union_set(arg0) 8854 except: 8855 raise 8856 exc_info = [None] 8857 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 8858 def cb_func(cb_arg0, cb_arg1): 8859 cb_arg0 = set(ctx=arg0.ctx, ptr=isl.isl_set_copy(cb_arg0)) 8860 try: 8861 res = arg1(cb_arg0) 8862 except: 8863 import sys 8864 exc_info[0] = sys.exc_info() 8865 return -1 8866 return 1 if res else 0 8867 cb = fn(cb_func) 8868 ctx = arg0.ctx 8869 res = isl.isl_union_set_every_set(arg0.ptr, cb, None) 8870 if exc_info[0] != None: 8871 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 8872 if res < 0: 8873 raise 8874 return bool(res) 8875 def extract_set(arg0, arg1): 8876 try: 8877 if not arg0.__class__ is union_set: 8878 arg0 = union_set(arg0) 8879 except: 8880 raise 8881 try: 8882 if not arg1.__class__ is space: 8883 arg1 = space(arg1) 8884 except: 8885 raise 8886 ctx = arg0.ctx 8887 res = isl.isl_union_set_extract_set(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 8888 obj = set(ctx=ctx, ptr=res) 8889 return obj 8890 def foreach_point(arg0, arg1): 8891 try: 8892 if not arg0.__class__ is union_set: 8893 arg0 = union_set(arg0) 8894 except: 8895 raise 8896 exc_info = [None] 8897 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 8898 def cb_func(cb_arg0, cb_arg1): 8899 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 8900 try: 8901 arg1(cb_arg0) 8902 except: 8903 import sys 8904 exc_info[0] = sys.exc_info() 8905 return -1 8906 return 0 8907 cb = fn(cb_func) 8908 ctx = arg0.ctx 8909 res = isl.isl_union_set_foreach_point(arg0.ptr, cb, None) 8910 if exc_info[0] != None: 8911 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 8912 if res < 0: 8913 raise 8914 def foreach_set(arg0, arg1): 8915 try: 8916 if not arg0.__class__ is union_set: 8917 arg0 = union_set(arg0) 8918 except: 8919 raise 8920 exc_info = [None] 8921 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 8922 def cb_func(cb_arg0, cb_arg1): 8923 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 8924 try: 8925 arg1(cb_arg0) 8926 except: 8927 import sys 8928 exc_info[0] = sys.exc_info() 8929 return -1 8930 return 0 8931 cb = fn(cb_func) 8932 ctx = arg0.ctx 8933 res = isl.isl_union_set_foreach_set(arg0.ptr, cb, None) 8934 if exc_info[0] != None: 8935 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 8936 if res < 0: 8937 raise 8938 def space(arg0): 8939 try: 8940 if not arg0.__class__ is union_set: 8941 arg0 = union_set(arg0) 8942 except: 8943 raise 8944 ctx = arg0.ctx 8945 res = isl.isl_union_set_get_space(arg0.ptr) 8946 obj = space(ctx=ctx, ptr=res) 8947 return obj 8948 def get_space(arg0): 8949 return arg0.space() 8950 def gist(arg0, arg1): 8951 try: 8952 if not arg0.__class__ is union_set: 8953 arg0 = union_set(arg0) 8954 except: 8955 raise 8956 try: 8957 if not arg1.__class__ is union_set: 8958 arg1 = union_set(arg1) 8959 except: 8960 raise 8961 ctx = arg0.ctx 8962 res = isl.isl_union_set_gist(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8963 obj = union_set(ctx=ctx, ptr=res) 8964 return obj 8965 def gist_params(arg0, arg1): 8966 try: 8967 if not arg0.__class__ is union_set: 8968 arg0 = union_set(arg0) 8969 except: 8970 raise 8971 try: 8972 if not arg1.__class__ is set: 8973 arg1 = set(arg1) 8974 except: 8975 raise 8976 ctx = arg0.ctx 8977 res = isl.isl_union_set_gist_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8978 obj = union_set(ctx=ctx, ptr=res) 8979 return obj 8980 def identity(arg0): 8981 try: 8982 if not arg0.__class__ is union_set: 8983 arg0 = union_set(arg0) 8984 except: 8985 raise 8986 ctx = arg0.ctx 8987 res = isl.isl_union_set_identity(isl.isl_union_set_copy(arg0.ptr)) 8988 obj = union_map(ctx=ctx, ptr=res) 8989 return obj 8990 def intersect(arg0, arg1): 8991 try: 8992 if not arg0.__class__ is union_set: 8993 arg0 = union_set(arg0) 8994 except: 8995 raise 8996 try: 8997 if not arg1.__class__ is union_set: 8998 arg1 = union_set(arg1) 8999 except: 9000 raise 9001 ctx = arg0.ctx 9002 res = isl.isl_union_set_intersect(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9003 obj = union_set(ctx=ctx, ptr=res) 9004 return obj 9005 def intersect_params(arg0, arg1): 9006 try: 9007 if not arg0.__class__ is union_set: 9008 arg0 = union_set(arg0) 9009 except: 9010 raise 9011 try: 9012 if not arg1.__class__ is set: 9013 arg1 = set(arg1) 9014 except: 9015 raise 9016 ctx = arg0.ctx 9017 res = isl.isl_union_set_intersect_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9018 obj = union_set(ctx=ctx, ptr=res) 9019 return obj 9020 def is_disjoint(arg0, arg1): 9021 try: 9022 if not arg0.__class__ is union_set: 9023 arg0 = union_set(arg0) 9024 except: 9025 raise 9026 try: 9027 if not arg1.__class__ is union_set: 9028 arg1 = union_set(arg1) 9029 except: 9030 raise 9031 ctx = arg0.ctx 9032 res = isl.isl_union_set_is_disjoint(arg0.ptr, arg1.ptr) 9033 if res < 0: 9034 raise 9035 return bool(res) 9036 def is_empty(arg0): 9037 try: 9038 if not arg0.__class__ is union_set: 9039 arg0 = union_set(arg0) 9040 except: 9041 raise 9042 ctx = arg0.ctx 9043 res = isl.isl_union_set_is_empty(arg0.ptr) 9044 if res < 0: 9045 raise 9046 return bool(res) 9047 def is_equal(arg0, arg1): 9048 try: 9049 if not arg0.__class__ is union_set: 9050 arg0 = union_set(arg0) 9051 except: 9052 raise 9053 try: 9054 if not arg1.__class__ is union_set: 9055 arg1 = union_set(arg1) 9056 except: 9057 raise 9058 ctx = arg0.ctx 9059 res = isl.isl_union_set_is_equal(arg0.ptr, arg1.ptr) 9060 if res < 0: 9061 raise 9062 return bool(res) 9063 def is_strict_subset(arg0, arg1): 9064 try: 9065 if not arg0.__class__ is union_set: 9066 arg0 = union_set(arg0) 9067 except: 9068 raise 9069 try: 9070 if not arg1.__class__ is union_set: 9071 arg1 = union_set(arg1) 9072 except: 9073 raise 9074 ctx = arg0.ctx 9075 res = isl.isl_union_set_is_strict_subset(arg0.ptr, arg1.ptr) 9076 if res < 0: 9077 raise 9078 return bool(res) 9079 def is_subset(arg0, arg1): 9080 try: 9081 if not arg0.__class__ is union_set: 9082 arg0 = union_set(arg0) 9083 except: 9084 raise 9085 try: 9086 if not arg1.__class__ is union_set: 9087 arg1 = union_set(arg1) 9088 except: 9089 raise 9090 ctx = arg0.ctx 9091 res = isl.isl_union_set_is_subset(arg0.ptr, arg1.ptr) 9092 if res < 0: 9093 raise 9094 return bool(res) 9095 def isa_set(arg0): 9096 try: 9097 if not arg0.__class__ is union_set: 9098 arg0 = union_set(arg0) 9099 except: 9100 raise 9101 ctx = arg0.ctx 9102 res = isl.isl_union_set_isa_set(arg0.ptr) 9103 if res < 0: 9104 raise 9105 return bool(res) 9106 def lexmax(arg0): 9107 try: 9108 if not arg0.__class__ is union_set: 9109 arg0 = union_set(arg0) 9110 except: 9111 raise 9112 ctx = arg0.ctx 9113 res = isl.isl_union_set_lexmax(isl.isl_union_set_copy(arg0.ptr)) 9114 obj = union_set(ctx=ctx, ptr=res) 9115 return obj 9116 def lexmin(arg0): 9117 try: 9118 if not arg0.__class__ is union_set: 9119 arg0 = union_set(arg0) 9120 except: 9121 raise 9122 ctx = arg0.ctx 9123 res = isl.isl_union_set_lexmin(isl.isl_union_set_copy(arg0.ptr)) 9124 obj = union_set(ctx=ctx, ptr=res) 9125 return obj 9126 def polyhedral_hull(arg0): 9127 try: 9128 if not arg0.__class__ is union_set: 9129 arg0 = union_set(arg0) 9130 except: 9131 raise 9132 ctx = arg0.ctx 9133 res = isl.isl_union_set_polyhedral_hull(isl.isl_union_set_copy(arg0.ptr)) 9134 obj = union_set(ctx=ctx, ptr=res) 9135 return obj 9136 def preimage(*args): 9137 if len(args) == 2 and args[1].__class__ is multi_aff: 9138 ctx = args[0].ctx 9139 res = isl.isl_union_set_preimage_multi_aff(isl.isl_union_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 9140 obj = union_set(ctx=ctx, ptr=res) 9141 return obj 9142 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 9143 ctx = args[0].ctx 9144 res = isl.isl_union_set_preimage_pw_multi_aff(isl.isl_union_set_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 9145 obj = union_set(ctx=ctx, ptr=res) 9146 return obj 9147 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 9148 ctx = args[0].ctx 9149 res = isl.isl_union_set_preimage_union_pw_multi_aff(isl.isl_union_set_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 9150 obj = union_set(ctx=ctx, ptr=res) 9151 return obj 9152 raise Error 9153 def sample_point(arg0): 9154 try: 9155 if not arg0.__class__ is union_set: 9156 arg0 = union_set(arg0) 9157 except: 9158 raise 9159 ctx = arg0.ctx 9160 res = isl.isl_union_set_sample_point(isl.isl_union_set_copy(arg0.ptr)) 9161 obj = point(ctx=ctx, ptr=res) 9162 return obj 9163 def subtract(arg0, arg1): 9164 try: 9165 if not arg0.__class__ is union_set: 9166 arg0 = union_set(arg0) 9167 except: 9168 raise 9169 try: 9170 if not arg1.__class__ is union_set: 9171 arg1 = union_set(arg1) 9172 except: 9173 raise 9174 ctx = arg0.ctx 9175 res = isl.isl_union_set_subtract(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9176 obj = union_set(ctx=ctx, ptr=res) 9177 return obj 9178 def union(arg0, arg1): 9179 try: 9180 if not arg0.__class__ is union_set: 9181 arg0 = union_set(arg0) 9182 except: 9183 raise 9184 try: 9185 if not arg1.__class__ is union_set: 9186 arg1 = union_set(arg1) 9187 except: 9188 raise 9189 ctx = arg0.ctx 9190 res = isl.isl_union_set_union(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9191 obj = union_set(ctx=ctx, ptr=res) 9192 return obj 9193 def universe(arg0): 9194 try: 9195 if not arg0.__class__ is union_set: 9196 arg0 = union_set(arg0) 9197 except: 9198 raise 9199 ctx = arg0.ctx 9200 res = isl.isl_union_set_universe(isl.isl_union_set_copy(arg0.ptr)) 9201 obj = union_set(ctx=ctx, ptr=res) 9202 return obj 9203 def unwrap(arg0): 9204 try: 9205 if not arg0.__class__ is union_set: 9206 arg0 = union_set(arg0) 9207 except: 9208 raise 9209 ctx = arg0.ctx 9210 res = isl.isl_union_set_unwrap(isl.isl_union_set_copy(arg0.ptr)) 9211 obj = union_map(ctx=ctx, ptr=res) 9212 return obj 9213 9214isl.isl_union_set_from_basic_set.restype = c_void_p 9215isl.isl_union_set_from_basic_set.argtypes = [c_void_p] 9216isl.isl_union_set_from_point.restype = c_void_p 9217isl.isl_union_set_from_point.argtypes = [c_void_p] 9218isl.isl_union_set_from_set.restype = c_void_p 9219isl.isl_union_set_from_set.argtypes = [c_void_p] 9220isl.isl_union_set_read_from_str.restype = c_void_p 9221isl.isl_union_set_read_from_str.argtypes = [Context, c_char_p] 9222isl.isl_union_set_affine_hull.restype = c_void_p 9223isl.isl_union_set_affine_hull.argtypes = [c_void_p] 9224isl.isl_union_set_apply.restype = c_void_p 9225isl.isl_union_set_apply.argtypes = [c_void_p, c_void_p] 9226isl.isl_union_set_coalesce.restype = c_void_p 9227isl.isl_union_set_coalesce.argtypes = [c_void_p] 9228isl.isl_union_set_compute_divs.restype = c_void_p 9229isl.isl_union_set_compute_divs.argtypes = [c_void_p] 9230isl.isl_union_set_detect_equalities.restype = c_void_p 9231isl.isl_union_set_detect_equalities.argtypes = [c_void_p] 9232isl.isl_union_set_empty_ctx.restype = c_void_p 9233isl.isl_union_set_empty_ctx.argtypes = [Context] 9234isl.isl_union_set_every_set.argtypes = [c_void_p, c_void_p, c_void_p] 9235isl.isl_union_set_extract_set.restype = c_void_p 9236isl.isl_union_set_extract_set.argtypes = [c_void_p, c_void_p] 9237isl.isl_union_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 9238isl.isl_union_set_foreach_set.argtypes = [c_void_p, c_void_p, c_void_p] 9239isl.isl_union_set_get_space.restype = c_void_p 9240isl.isl_union_set_get_space.argtypes = [c_void_p] 9241isl.isl_union_set_gist.restype = c_void_p 9242isl.isl_union_set_gist.argtypes = [c_void_p, c_void_p] 9243isl.isl_union_set_gist_params.restype = c_void_p 9244isl.isl_union_set_gist_params.argtypes = [c_void_p, c_void_p] 9245isl.isl_union_set_identity.restype = c_void_p 9246isl.isl_union_set_identity.argtypes = [c_void_p] 9247isl.isl_union_set_intersect.restype = c_void_p 9248isl.isl_union_set_intersect.argtypes = [c_void_p, c_void_p] 9249isl.isl_union_set_intersect_params.restype = c_void_p 9250isl.isl_union_set_intersect_params.argtypes = [c_void_p, c_void_p] 9251isl.isl_union_set_is_disjoint.argtypes = [c_void_p, c_void_p] 9252isl.isl_union_set_is_empty.argtypes = [c_void_p] 9253isl.isl_union_set_is_equal.argtypes = [c_void_p, c_void_p] 9254isl.isl_union_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 9255isl.isl_union_set_is_subset.argtypes = [c_void_p, c_void_p] 9256isl.isl_union_set_isa_set.argtypes = [c_void_p] 9257isl.isl_union_set_lexmax.restype = c_void_p 9258isl.isl_union_set_lexmax.argtypes = [c_void_p] 9259isl.isl_union_set_lexmin.restype = c_void_p 9260isl.isl_union_set_lexmin.argtypes = [c_void_p] 9261isl.isl_union_set_polyhedral_hull.restype = c_void_p 9262isl.isl_union_set_polyhedral_hull.argtypes = [c_void_p] 9263isl.isl_union_set_preimage_multi_aff.restype = c_void_p 9264isl.isl_union_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 9265isl.isl_union_set_preimage_pw_multi_aff.restype = c_void_p 9266isl.isl_union_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 9267isl.isl_union_set_preimage_union_pw_multi_aff.restype = c_void_p 9268isl.isl_union_set_preimage_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 9269isl.isl_union_set_sample_point.restype = c_void_p 9270isl.isl_union_set_sample_point.argtypes = [c_void_p] 9271isl.isl_union_set_subtract.restype = c_void_p 9272isl.isl_union_set_subtract.argtypes = [c_void_p, c_void_p] 9273isl.isl_union_set_union.restype = c_void_p 9274isl.isl_union_set_union.argtypes = [c_void_p, c_void_p] 9275isl.isl_union_set_universe.restype = c_void_p 9276isl.isl_union_set_universe.argtypes = [c_void_p] 9277isl.isl_union_set_unwrap.restype = c_void_p 9278isl.isl_union_set_unwrap.argtypes = [c_void_p] 9279isl.isl_union_set_copy.restype = c_void_p 9280isl.isl_union_set_copy.argtypes = [c_void_p] 9281isl.isl_union_set_free.restype = c_void_p 9282isl.isl_union_set_free.argtypes = [c_void_p] 9283isl.isl_union_set_to_str.restype = POINTER(c_char) 9284isl.isl_union_set_to_str.argtypes = [c_void_p] 9285 9286class set(union_set): 9287 def __init__(self, *args, **keywords): 9288 if "ptr" in keywords: 9289 self.ctx = keywords["ctx"] 9290 self.ptr = keywords["ptr"] 9291 return 9292 if len(args) == 1 and args[0].__class__ is basic_set: 9293 self.ctx = Context.getDefaultInstance() 9294 self.ptr = isl.isl_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 9295 return 9296 if len(args) == 1 and args[0].__class__ is point: 9297 self.ctx = Context.getDefaultInstance() 9298 self.ptr = isl.isl_set_from_point(isl.isl_point_copy(args[0].ptr)) 9299 return 9300 if len(args) == 1 and type(args[0]) == str: 9301 self.ctx = Context.getDefaultInstance() 9302 self.ptr = isl.isl_set_read_from_str(self.ctx, args[0].encode('ascii')) 9303 return 9304 raise Error 9305 def __del__(self): 9306 if hasattr(self, 'ptr'): 9307 isl.isl_set_free(self.ptr) 9308 def __str__(arg0): 9309 try: 9310 if not arg0.__class__ is set: 9311 arg0 = set(arg0) 9312 except: 9313 raise 9314 ptr = isl.isl_set_to_str(arg0.ptr) 9315 res = cast(ptr, c_char_p).value.decode('ascii') 9316 libc.free(ptr) 9317 return res 9318 def __repr__(self): 9319 s = str(self) 9320 if '"' in s: 9321 return 'isl.set("""%s""")' % s 9322 else: 9323 return 'isl.set("%s")' % s 9324 def affine_hull(arg0): 9325 try: 9326 if not arg0.__class__ is set: 9327 arg0 = set(arg0) 9328 except: 9329 raise 9330 ctx = arg0.ctx 9331 res = isl.isl_set_affine_hull(isl.isl_set_copy(arg0.ptr)) 9332 obj = basic_set(ctx=ctx, ptr=res) 9333 return obj 9334 def apply(arg0, arg1): 9335 try: 9336 if not arg0.__class__ is set: 9337 arg0 = set(arg0) 9338 except: 9339 raise 9340 try: 9341 if not arg1.__class__ is map: 9342 arg1 = map(arg1) 9343 except: 9344 return union_set(arg0).apply(arg1) 9345 ctx = arg0.ctx 9346 res = isl.isl_set_apply(isl.isl_set_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9347 obj = set(ctx=ctx, ptr=res) 9348 return obj 9349 def bind(arg0, arg1): 9350 try: 9351 if not arg0.__class__ is set: 9352 arg0 = set(arg0) 9353 except: 9354 raise 9355 try: 9356 if not arg1.__class__ is multi_id: 9357 arg1 = multi_id(arg1) 9358 except: 9359 return union_set(arg0).bind(arg1) 9360 ctx = arg0.ctx 9361 res = isl.isl_set_bind(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 9362 obj = set(ctx=ctx, ptr=res) 9363 return obj 9364 def coalesce(arg0): 9365 try: 9366 if not arg0.__class__ is set: 9367 arg0 = set(arg0) 9368 except: 9369 raise 9370 ctx = arg0.ctx 9371 res = isl.isl_set_coalesce(isl.isl_set_copy(arg0.ptr)) 9372 obj = set(ctx=ctx, ptr=res) 9373 return obj 9374 def complement(arg0): 9375 try: 9376 if not arg0.__class__ is set: 9377 arg0 = set(arg0) 9378 except: 9379 raise 9380 ctx = arg0.ctx 9381 res = isl.isl_set_complement(isl.isl_set_copy(arg0.ptr)) 9382 obj = set(ctx=ctx, ptr=res) 9383 return obj 9384 def detect_equalities(arg0): 9385 try: 9386 if not arg0.__class__ is set: 9387 arg0 = set(arg0) 9388 except: 9389 raise 9390 ctx = arg0.ctx 9391 res = isl.isl_set_detect_equalities(isl.isl_set_copy(arg0.ptr)) 9392 obj = set(ctx=ctx, ptr=res) 9393 return obj 9394 def dim_max_val(arg0, arg1): 9395 try: 9396 if not arg0.__class__ is set: 9397 arg0 = set(arg0) 9398 except: 9399 raise 9400 ctx = arg0.ctx 9401 res = isl.isl_set_dim_max_val(isl.isl_set_copy(arg0.ptr), arg1) 9402 obj = val(ctx=ctx, ptr=res) 9403 return obj 9404 def dim_min_val(arg0, arg1): 9405 try: 9406 if not arg0.__class__ is set: 9407 arg0 = set(arg0) 9408 except: 9409 raise 9410 ctx = arg0.ctx 9411 res = isl.isl_set_dim_min_val(isl.isl_set_copy(arg0.ptr), arg1) 9412 obj = val(ctx=ctx, ptr=res) 9413 return obj 9414 @staticmethod 9415 def empty(arg0): 9416 try: 9417 if not arg0.__class__ is space: 9418 arg0 = space(arg0) 9419 except: 9420 raise 9421 ctx = arg0.ctx 9422 res = isl.isl_set_empty(isl.isl_space_copy(arg0.ptr)) 9423 obj = set(ctx=ctx, ptr=res) 9424 return obj 9425 def flatten(arg0): 9426 try: 9427 if not arg0.__class__ is set: 9428 arg0 = set(arg0) 9429 except: 9430 raise 9431 ctx = arg0.ctx 9432 res = isl.isl_set_flatten(isl.isl_set_copy(arg0.ptr)) 9433 obj = set(ctx=ctx, ptr=res) 9434 return obj 9435 def foreach_basic_set(arg0, arg1): 9436 try: 9437 if not arg0.__class__ is set: 9438 arg0 = set(arg0) 9439 except: 9440 raise 9441 exc_info = [None] 9442 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9443 def cb_func(cb_arg0, cb_arg1): 9444 cb_arg0 = basic_set(ctx=arg0.ctx, ptr=(cb_arg0)) 9445 try: 9446 arg1(cb_arg0) 9447 except: 9448 import sys 9449 exc_info[0] = sys.exc_info() 9450 return -1 9451 return 0 9452 cb = fn(cb_func) 9453 ctx = arg0.ctx 9454 res = isl.isl_set_foreach_basic_set(arg0.ptr, cb, None) 9455 if exc_info[0] != None: 9456 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 9457 if res < 0: 9458 raise 9459 def foreach_point(arg0, arg1): 9460 try: 9461 if not arg0.__class__ is set: 9462 arg0 = set(arg0) 9463 except: 9464 raise 9465 exc_info = [None] 9466 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9467 def cb_func(cb_arg0, cb_arg1): 9468 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 9469 try: 9470 arg1(cb_arg0) 9471 except: 9472 import sys 9473 exc_info[0] = sys.exc_info() 9474 return -1 9475 return 0 9476 cb = fn(cb_func) 9477 ctx = arg0.ctx 9478 res = isl.isl_set_foreach_point(arg0.ptr, cb, None) 9479 if exc_info[0] != None: 9480 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 9481 if res < 0: 9482 raise 9483 def plain_multi_val_if_fixed(arg0): 9484 try: 9485 if not arg0.__class__ is set: 9486 arg0 = set(arg0) 9487 except: 9488 raise 9489 ctx = arg0.ctx 9490 res = isl.isl_set_get_plain_multi_val_if_fixed(arg0.ptr) 9491 obj = multi_val(ctx=ctx, ptr=res) 9492 return obj 9493 def get_plain_multi_val_if_fixed(arg0): 9494 return arg0.plain_multi_val_if_fixed() 9495 def simple_fixed_box_hull(arg0): 9496 try: 9497 if not arg0.__class__ is set: 9498 arg0 = set(arg0) 9499 except: 9500 raise 9501 ctx = arg0.ctx 9502 res = isl.isl_set_get_simple_fixed_box_hull(arg0.ptr) 9503 obj = fixed_box(ctx=ctx, ptr=res) 9504 return obj 9505 def get_simple_fixed_box_hull(arg0): 9506 return arg0.simple_fixed_box_hull() 9507 def space(arg0): 9508 try: 9509 if not arg0.__class__ is set: 9510 arg0 = set(arg0) 9511 except: 9512 raise 9513 ctx = arg0.ctx 9514 res = isl.isl_set_get_space(arg0.ptr) 9515 obj = space(ctx=ctx, ptr=res) 9516 return obj 9517 def get_space(arg0): 9518 return arg0.space() 9519 def stride(arg0, arg1): 9520 try: 9521 if not arg0.__class__ is set: 9522 arg0 = set(arg0) 9523 except: 9524 raise 9525 ctx = arg0.ctx 9526 res = isl.isl_set_get_stride(arg0.ptr, arg1) 9527 obj = val(ctx=ctx, ptr=res) 9528 return obj 9529 def get_stride(arg0, arg1): 9530 return arg0.stride(arg1) 9531 def gist(arg0, arg1): 9532 try: 9533 if not arg0.__class__ is set: 9534 arg0 = set(arg0) 9535 except: 9536 raise 9537 try: 9538 if not arg1.__class__ is set: 9539 arg1 = set(arg1) 9540 except: 9541 return union_set(arg0).gist(arg1) 9542 ctx = arg0.ctx 9543 res = isl.isl_set_gist(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9544 obj = set(ctx=ctx, ptr=res) 9545 return obj 9546 def identity(arg0): 9547 try: 9548 if not arg0.__class__ is set: 9549 arg0 = set(arg0) 9550 except: 9551 raise 9552 ctx = arg0.ctx 9553 res = isl.isl_set_identity(isl.isl_set_copy(arg0.ptr)) 9554 obj = map(ctx=ctx, ptr=res) 9555 return obj 9556 def indicator_function(arg0): 9557 try: 9558 if not arg0.__class__ is set: 9559 arg0 = set(arg0) 9560 except: 9561 raise 9562 ctx = arg0.ctx 9563 res = isl.isl_set_indicator_function(isl.isl_set_copy(arg0.ptr)) 9564 obj = pw_aff(ctx=ctx, ptr=res) 9565 return obj 9566 def insert_domain(arg0, arg1): 9567 try: 9568 if not arg0.__class__ is set: 9569 arg0 = set(arg0) 9570 except: 9571 raise 9572 try: 9573 if not arg1.__class__ is space: 9574 arg1 = space(arg1) 9575 except: 9576 return union_set(arg0).insert_domain(arg1) 9577 ctx = arg0.ctx 9578 res = isl.isl_set_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 9579 obj = map(ctx=ctx, ptr=res) 9580 return obj 9581 def intersect(arg0, arg1): 9582 try: 9583 if not arg0.__class__ is set: 9584 arg0 = set(arg0) 9585 except: 9586 raise 9587 try: 9588 if not arg1.__class__ is set: 9589 arg1 = set(arg1) 9590 except: 9591 return union_set(arg0).intersect(arg1) 9592 ctx = arg0.ctx 9593 res = isl.isl_set_intersect(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9594 obj = set(ctx=ctx, ptr=res) 9595 return obj 9596 def intersect_params(arg0, arg1): 9597 try: 9598 if not arg0.__class__ is set: 9599 arg0 = set(arg0) 9600 except: 9601 raise 9602 try: 9603 if not arg1.__class__ is set: 9604 arg1 = set(arg1) 9605 except: 9606 return union_set(arg0).intersect_params(arg1) 9607 ctx = arg0.ctx 9608 res = isl.isl_set_intersect_params(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9609 obj = set(ctx=ctx, ptr=res) 9610 return obj 9611 def involves_locals(arg0): 9612 try: 9613 if not arg0.__class__ is set: 9614 arg0 = set(arg0) 9615 except: 9616 raise 9617 ctx = arg0.ctx 9618 res = isl.isl_set_involves_locals(arg0.ptr) 9619 if res < 0: 9620 raise 9621 return bool(res) 9622 def is_disjoint(arg0, arg1): 9623 try: 9624 if not arg0.__class__ is set: 9625 arg0 = set(arg0) 9626 except: 9627 raise 9628 try: 9629 if not arg1.__class__ is set: 9630 arg1 = set(arg1) 9631 except: 9632 return union_set(arg0).is_disjoint(arg1) 9633 ctx = arg0.ctx 9634 res = isl.isl_set_is_disjoint(arg0.ptr, arg1.ptr) 9635 if res < 0: 9636 raise 9637 return bool(res) 9638 def is_empty(arg0): 9639 try: 9640 if not arg0.__class__ is set: 9641 arg0 = set(arg0) 9642 except: 9643 raise 9644 ctx = arg0.ctx 9645 res = isl.isl_set_is_empty(arg0.ptr) 9646 if res < 0: 9647 raise 9648 return bool(res) 9649 def is_equal(arg0, arg1): 9650 try: 9651 if not arg0.__class__ is set: 9652 arg0 = set(arg0) 9653 except: 9654 raise 9655 try: 9656 if not arg1.__class__ is set: 9657 arg1 = set(arg1) 9658 except: 9659 return union_set(arg0).is_equal(arg1) 9660 ctx = arg0.ctx 9661 res = isl.isl_set_is_equal(arg0.ptr, arg1.ptr) 9662 if res < 0: 9663 raise 9664 return bool(res) 9665 def is_singleton(arg0): 9666 try: 9667 if not arg0.__class__ is set: 9668 arg0 = set(arg0) 9669 except: 9670 raise 9671 ctx = arg0.ctx 9672 res = isl.isl_set_is_singleton(arg0.ptr) 9673 if res < 0: 9674 raise 9675 return bool(res) 9676 def is_strict_subset(arg0, arg1): 9677 try: 9678 if not arg0.__class__ is set: 9679 arg0 = set(arg0) 9680 except: 9681 raise 9682 try: 9683 if not arg1.__class__ is set: 9684 arg1 = set(arg1) 9685 except: 9686 return union_set(arg0).is_strict_subset(arg1) 9687 ctx = arg0.ctx 9688 res = isl.isl_set_is_strict_subset(arg0.ptr, arg1.ptr) 9689 if res < 0: 9690 raise 9691 return bool(res) 9692 def is_subset(arg0, arg1): 9693 try: 9694 if not arg0.__class__ is set: 9695 arg0 = set(arg0) 9696 except: 9697 raise 9698 try: 9699 if not arg1.__class__ is set: 9700 arg1 = set(arg1) 9701 except: 9702 return union_set(arg0).is_subset(arg1) 9703 ctx = arg0.ctx 9704 res = isl.isl_set_is_subset(arg0.ptr, arg1.ptr) 9705 if res < 0: 9706 raise 9707 return bool(res) 9708 def is_wrapping(arg0): 9709 try: 9710 if not arg0.__class__ is set: 9711 arg0 = set(arg0) 9712 except: 9713 raise 9714 ctx = arg0.ctx 9715 res = isl.isl_set_is_wrapping(arg0.ptr) 9716 if res < 0: 9717 raise 9718 return bool(res) 9719 def lexmax(arg0): 9720 try: 9721 if not arg0.__class__ is set: 9722 arg0 = set(arg0) 9723 except: 9724 raise 9725 ctx = arg0.ctx 9726 res = isl.isl_set_lexmax(isl.isl_set_copy(arg0.ptr)) 9727 obj = set(ctx=ctx, ptr=res) 9728 return obj 9729 def lexmax_pw_multi_aff(arg0): 9730 try: 9731 if not arg0.__class__ is set: 9732 arg0 = set(arg0) 9733 except: 9734 raise 9735 ctx = arg0.ctx 9736 res = isl.isl_set_lexmax_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 9737 obj = pw_multi_aff(ctx=ctx, ptr=res) 9738 return obj 9739 def lexmin(arg0): 9740 try: 9741 if not arg0.__class__ is set: 9742 arg0 = set(arg0) 9743 except: 9744 raise 9745 ctx = arg0.ctx 9746 res = isl.isl_set_lexmin(isl.isl_set_copy(arg0.ptr)) 9747 obj = set(ctx=ctx, ptr=res) 9748 return obj 9749 def lexmin_pw_multi_aff(arg0): 9750 try: 9751 if not arg0.__class__ is set: 9752 arg0 = set(arg0) 9753 except: 9754 raise 9755 ctx = arg0.ctx 9756 res = isl.isl_set_lexmin_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 9757 obj = pw_multi_aff(ctx=ctx, ptr=res) 9758 return obj 9759 def lower_bound(*args): 9760 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9761 ctx = args[0].ctx 9762 res = isl.isl_set_lower_bound_multi_pw_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 9763 obj = set(ctx=ctx, ptr=res) 9764 return obj 9765 if len(args) == 2 and args[1].__class__ is multi_val: 9766 ctx = args[0].ctx 9767 res = isl.isl_set_lower_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 9768 obj = set(ctx=ctx, ptr=res) 9769 return obj 9770 raise Error 9771 def max_multi_pw_aff(arg0): 9772 try: 9773 if not arg0.__class__ is set: 9774 arg0 = set(arg0) 9775 except: 9776 raise 9777 ctx = arg0.ctx 9778 res = isl.isl_set_max_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 9779 obj = multi_pw_aff(ctx=ctx, ptr=res) 9780 return obj 9781 def max_val(arg0, arg1): 9782 try: 9783 if not arg0.__class__ is set: 9784 arg0 = set(arg0) 9785 except: 9786 raise 9787 try: 9788 if not arg1.__class__ is aff: 9789 arg1 = aff(arg1) 9790 except: 9791 return union_set(arg0).max_val(arg1) 9792 ctx = arg0.ctx 9793 res = isl.isl_set_max_val(arg0.ptr, arg1.ptr) 9794 obj = val(ctx=ctx, ptr=res) 9795 return obj 9796 def min_multi_pw_aff(arg0): 9797 try: 9798 if not arg0.__class__ is set: 9799 arg0 = set(arg0) 9800 except: 9801 raise 9802 ctx = arg0.ctx 9803 res = isl.isl_set_min_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 9804 obj = multi_pw_aff(ctx=ctx, ptr=res) 9805 return obj 9806 def min_val(arg0, arg1): 9807 try: 9808 if not arg0.__class__ is set: 9809 arg0 = set(arg0) 9810 except: 9811 raise 9812 try: 9813 if not arg1.__class__ is aff: 9814 arg1 = aff(arg1) 9815 except: 9816 return union_set(arg0).min_val(arg1) 9817 ctx = arg0.ctx 9818 res = isl.isl_set_min_val(arg0.ptr, arg1.ptr) 9819 obj = val(ctx=ctx, ptr=res) 9820 return obj 9821 def params(arg0): 9822 try: 9823 if not arg0.__class__ is set: 9824 arg0 = set(arg0) 9825 except: 9826 raise 9827 ctx = arg0.ctx 9828 res = isl.isl_set_params(isl.isl_set_copy(arg0.ptr)) 9829 obj = set(ctx=ctx, ptr=res) 9830 return obj 9831 def polyhedral_hull(arg0): 9832 try: 9833 if not arg0.__class__ is set: 9834 arg0 = set(arg0) 9835 except: 9836 raise 9837 ctx = arg0.ctx 9838 res = isl.isl_set_polyhedral_hull(isl.isl_set_copy(arg0.ptr)) 9839 obj = basic_set(ctx=ctx, ptr=res) 9840 return obj 9841 def preimage(*args): 9842 if len(args) == 2 and args[1].__class__ is multi_aff: 9843 ctx = args[0].ctx 9844 res = isl.isl_set_preimage_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 9845 obj = set(ctx=ctx, ptr=res) 9846 return obj 9847 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9848 ctx = args[0].ctx 9849 res = isl.isl_set_preimage_multi_pw_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 9850 obj = set(ctx=ctx, ptr=res) 9851 return obj 9852 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 9853 ctx = args[0].ctx 9854 res = isl.isl_set_preimage_pw_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 9855 obj = set(ctx=ctx, ptr=res) 9856 return obj 9857 raise Error 9858 def product(arg0, arg1): 9859 try: 9860 if not arg0.__class__ is set: 9861 arg0 = set(arg0) 9862 except: 9863 raise 9864 try: 9865 if not arg1.__class__ is set: 9866 arg1 = set(arg1) 9867 except: 9868 return union_set(arg0).product(arg1) 9869 ctx = arg0.ctx 9870 res = isl.isl_set_product(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9871 obj = set(ctx=ctx, ptr=res) 9872 return obj 9873 def project_out_all_params(arg0): 9874 try: 9875 if not arg0.__class__ is set: 9876 arg0 = set(arg0) 9877 except: 9878 raise 9879 ctx = arg0.ctx 9880 res = isl.isl_set_project_out_all_params(isl.isl_set_copy(arg0.ptr)) 9881 obj = set(ctx=ctx, ptr=res) 9882 return obj 9883 def project_out_param(*args): 9884 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 9885 args = list(args) 9886 try: 9887 if not args[1].__class__ is id: 9888 args[1] = id(args[1]) 9889 except: 9890 raise 9891 ctx = args[0].ctx 9892 res = isl.isl_set_project_out_param_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 9893 obj = set(ctx=ctx, ptr=res) 9894 return obj 9895 if len(args) == 2 and args[1].__class__ is id_list: 9896 ctx = args[0].ctx 9897 res = isl.isl_set_project_out_param_id_list(isl.isl_set_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 9898 obj = set(ctx=ctx, ptr=res) 9899 return obj 9900 raise Error 9901 def sample(arg0): 9902 try: 9903 if not arg0.__class__ is set: 9904 arg0 = set(arg0) 9905 except: 9906 raise 9907 ctx = arg0.ctx 9908 res = isl.isl_set_sample(isl.isl_set_copy(arg0.ptr)) 9909 obj = basic_set(ctx=ctx, ptr=res) 9910 return obj 9911 def sample_point(arg0): 9912 try: 9913 if not arg0.__class__ is set: 9914 arg0 = set(arg0) 9915 except: 9916 raise 9917 ctx = arg0.ctx 9918 res = isl.isl_set_sample_point(isl.isl_set_copy(arg0.ptr)) 9919 obj = point(ctx=ctx, ptr=res) 9920 return obj 9921 def subtract(arg0, arg1): 9922 try: 9923 if not arg0.__class__ is set: 9924 arg0 = set(arg0) 9925 except: 9926 raise 9927 try: 9928 if not arg1.__class__ is set: 9929 arg1 = set(arg1) 9930 except: 9931 return union_set(arg0).subtract(arg1) 9932 ctx = arg0.ctx 9933 res = isl.isl_set_subtract(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9934 obj = set(ctx=ctx, ptr=res) 9935 return obj 9936 def translation(arg0): 9937 try: 9938 if not arg0.__class__ is set: 9939 arg0 = set(arg0) 9940 except: 9941 raise 9942 ctx = arg0.ctx 9943 res = isl.isl_set_translation(isl.isl_set_copy(arg0.ptr)) 9944 obj = map(ctx=ctx, ptr=res) 9945 return obj 9946 def unbind_params(arg0, arg1): 9947 try: 9948 if not arg0.__class__ is set: 9949 arg0 = set(arg0) 9950 except: 9951 raise 9952 try: 9953 if not arg1.__class__ is multi_id: 9954 arg1 = multi_id(arg1) 9955 except: 9956 return union_set(arg0).unbind_params(arg1) 9957 ctx = arg0.ctx 9958 res = isl.isl_set_unbind_params(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 9959 obj = set(ctx=ctx, ptr=res) 9960 return obj 9961 def unbind_params_insert_domain(arg0, arg1): 9962 try: 9963 if not arg0.__class__ is set: 9964 arg0 = set(arg0) 9965 except: 9966 raise 9967 try: 9968 if not arg1.__class__ is multi_id: 9969 arg1 = multi_id(arg1) 9970 except: 9971 return union_set(arg0).unbind_params_insert_domain(arg1) 9972 ctx = arg0.ctx 9973 res = isl.isl_set_unbind_params_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 9974 obj = map(ctx=ctx, ptr=res) 9975 return obj 9976 def union(arg0, arg1): 9977 try: 9978 if not arg0.__class__ is set: 9979 arg0 = set(arg0) 9980 except: 9981 raise 9982 try: 9983 if not arg1.__class__ is set: 9984 arg1 = set(arg1) 9985 except: 9986 return union_set(arg0).union(arg1) 9987 ctx = arg0.ctx 9988 res = isl.isl_set_union(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9989 obj = set(ctx=ctx, ptr=res) 9990 return obj 9991 @staticmethod 9992 def universe(arg0): 9993 try: 9994 if not arg0.__class__ is space: 9995 arg0 = space(arg0) 9996 except: 9997 raise 9998 ctx = arg0.ctx 9999 res = isl.isl_set_universe(isl.isl_space_copy(arg0.ptr)) 10000 obj = set(ctx=ctx, ptr=res) 10001 return obj 10002 def unshifted_simple_hull(arg0): 10003 try: 10004 if not arg0.__class__ is set: 10005 arg0 = set(arg0) 10006 except: 10007 raise 10008 ctx = arg0.ctx 10009 res = isl.isl_set_unshifted_simple_hull(isl.isl_set_copy(arg0.ptr)) 10010 obj = basic_set(ctx=ctx, ptr=res) 10011 return obj 10012 def unwrap(arg0): 10013 try: 10014 if not arg0.__class__ is set: 10015 arg0 = set(arg0) 10016 except: 10017 raise 10018 ctx = arg0.ctx 10019 res = isl.isl_set_unwrap(isl.isl_set_copy(arg0.ptr)) 10020 obj = map(ctx=ctx, ptr=res) 10021 return obj 10022 def upper_bound(*args): 10023 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 10024 ctx = args[0].ctx 10025 res = isl.isl_set_upper_bound_multi_pw_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 10026 obj = set(ctx=ctx, ptr=res) 10027 return obj 10028 if len(args) == 2 and args[1].__class__ is multi_val: 10029 ctx = args[0].ctx 10030 res = isl.isl_set_upper_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 10031 obj = set(ctx=ctx, ptr=res) 10032 return obj 10033 raise Error 10034 10035isl.isl_set_from_basic_set.restype = c_void_p 10036isl.isl_set_from_basic_set.argtypes = [c_void_p] 10037isl.isl_set_from_point.restype = c_void_p 10038isl.isl_set_from_point.argtypes = [c_void_p] 10039isl.isl_set_read_from_str.restype = c_void_p 10040isl.isl_set_read_from_str.argtypes = [Context, c_char_p] 10041isl.isl_set_affine_hull.restype = c_void_p 10042isl.isl_set_affine_hull.argtypes = [c_void_p] 10043isl.isl_set_apply.restype = c_void_p 10044isl.isl_set_apply.argtypes = [c_void_p, c_void_p] 10045isl.isl_set_bind.restype = c_void_p 10046isl.isl_set_bind.argtypes = [c_void_p, c_void_p] 10047isl.isl_set_coalesce.restype = c_void_p 10048isl.isl_set_coalesce.argtypes = [c_void_p] 10049isl.isl_set_complement.restype = c_void_p 10050isl.isl_set_complement.argtypes = [c_void_p] 10051isl.isl_set_detect_equalities.restype = c_void_p 10052isl.isl_set_detect_equalities.argtypes = [c_void_p] 10053isl.isl_set_dim_max_val.restype = c_void_p 10054isl.isl_set_dim_max_val.argtypes = [c_void_p, c_int] 10055isl.isl_set_dim_min_val.restype = c_void_p 10056isl.isl_set_dim_min_val.argtypes = [c_void_p, c_int] 10057isl.isl_set_empty.restype = c_void_p 10058isl.isl_set_empty.argtypes = [c_void_p] 10059isl.isl_set_flatten.restype = c_void_p 10060isl.isl_set_flatten.argtypes = [c_void_p] 10061isl.isl_set_foreach_basic_set.argtypes = [c_void_p, c_void_p, c_void_p] 10062isl.isl_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 10063isl.isl_set_get_plain_multi_val_if_fixed.restype = c_void_p 10064isl.isl_set_get_plain_multi_val_if_fixed.argtypes = [c_void_p] 10065isl.isl_set_get_simple_fixed_box_hull.restype = c_void_p 10066isl.isl_set_get_simple_fixed_box_hull.argtypes = [c_void_p] 10067isl.isl_set_get_space.restype = c_void_p 10068isl.isl_set_get_space.argtypes = [c_void_p] 10069isl.isl_set_get_stride.restype = c_void_p 10070isl.isl_set_get_stride.argtypes = [c_void_p, c_int] 10071isl.isl_set_gist.restype = c_void_p 10072isl.isl_set_gist.argtypes = [c_void_p, c_void_p] 10073isl.isl_set_identity.restype = c_void_p 10074isl.isl_set_identity.argtypes = [c_void_p] 10075isl.isl_set_indicator_function.restype = c_void_p 10076isl.isl_set_indicator_function.argtypes = [c_void_p] 10077isl.isl_set_insert_domain.restype = c_void_p 10078isl.isl_set_insert_domain.argtypes = [c_void_p, c_void_p] 10079isl.isl_set_intersect.restype = c_void_p 10080isl.isl_set_intersect.argtypes = [c_void_p, c_void_p] 10081isl.isl_set_intersect_params.restype = c_void_p 10082isl.isl_set_intersect_params.argtypes = [c_void_p, c_void_p] 10083isl.isl_set_involves_locals.argtypes = [c_void_p] 10084isl.isl_set_is_disjoint.argtypes = [c_void_p, c_void_p] 10085isl.isl_set_is_empty.argtypes = [c_void_p] 10086isl.isl_set_is_equal.argtypes = [c_void_p, c_void_p] 10087isl.isl_set_is_singleton.argtypes = [c_void_p] 10088isl.isl_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 10089isl.isl_set_is_subset.argtypes = [c_void_p, c_void_p] 10090isl.isl_set_is_wrapping.argtypes = [c_void_p] 10091isl.isl_set_lexmax.restype = c_void_p 10092isl.isl_set_lexmax.argtypes = [c_void_p] 10093isl.isl_set_lexmax_pw_multi_aff.restype = c_void_p 10094isl.isl_set_lexmax_pw_multi_aff.argtypes = [c_void_p] 10095isl.isl_set_lexmin.restype = c_void_p 10096isl.isl_set_lexmin.argtypes = [c_void_p] 10097isl.isl_set_lexmin_pw_multi_aff.restype = c_void_p 10098isl.isl_set_lexmin_pw_multi_aff.argtypes = [c_void_p] 10099isl.isl_set_lower_bound_multi_pw_aff.restype = c_void_p 10100isl.isl_set_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10101isl.isl_set_lower_bound_multi_val.restype = c_void_p 10102isl.isl_set_lower_bound_multi_val.argtypes = [c_void_p, c_void_p] 10103isl.isl_set_max_multi_pw_aff.restype = c_void_p 10104isl.isl_set_max_multi_pw_aff.argtypes = [c_void_p] 10105isl.isl_set_max_val.restype = c_void_p 10106isl.isl_set_max_val.argtypes = [c_void_p, c_void_p] 10107isl.isl_set_min_multi_pw_aff.restype = c_void_p 10108isl.isl_set_min_multi_pw_aff.argtypes = [c_void_p] 10109isl.isl_set_min_val.restype = c_void_p 10110isl.isl_set_min_val.argtypes = [c_void_p, c_void_p] 10111isl.isl_set_params.restype = c_void_p 10112isl.isl_set_params.argtypes = [c_void_p] 10113isl.isl_set_polyhedral_hull.restype = c_void_p 10114isl.isl_set_polyhedral_hull.argtypes = [c_void_p] 10115isl.isl_set_preimage_multi_aff.restype = c_void_p 10116isl.isl_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 10117isl.isl_set_preimage_multi_pw_aff.restype = c_void_p 10118isl.isl_set_preimage_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10119isl.isl_set_preimage_pw_multi_aff.restype = c_void_p 10120isl.isl_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10121isl.isl_set_product.restype = c_void_p 10122isl.isl_set_product.argtypes = [c_void_p, c_void_p] 10123isl.isl_set_project_out_all_params.restype = c_void_p 10124isl.isl_set_project_out_all_params.argtypes = [c_void_p] 10125isl.isl_set_project_out_param_id.restype = c_void_p 10126isl.isl_set_project_out_param_id.argtypes = [c_void_p, c_void_p] 10127isl.isl_set_project_out_param_id_list.restype = c_void_p 10128isl.isl_set_project_out_param_id_list.argtypes = [c_void_p, c_void_p] 10129isl.isl_set_sample.restype = c_void_p 10130isl.isl_set_sample.argtypes = [c_void_p] 10131isl.isl_set_sample_point.restype = c_void_p 10132isl.isl_set_sample_point.argtypes = [c_void_p] 10133isl.isl_set_subtract.restype = c_void_p 10134isl.isl_set_subtract.argtypes = [c_void_p, c_void_p] 10135isl.isl_set_translation.restype = c_void_p 10136isl.isl_set_translation.argtypes = [c_void_p] 10137isl.isl_set_unbind_params.restype = c_void_p 10138isl.isl_set_unbind_params.argtypes = [c_void_p, c_void_p] 10139isl.isl_set_unbind_params_insert_domain.restype = c_void_p 10140isl.isl_set_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 10141isl.isl_set_union.restype = c_void_p 10142isl.isl_set_union.argtypes = [c_void_p, c_void_p] 10143isl.isl_set_universe.restype = c_void_p 10144isl.isl_set_universe.argtypes = [c_void_p] 10145isl.isl_set_unshifted_simple_hull.restype = c_void_p 10146isl.isl_set_unshifted_simple_hull.argtypes = [c_void_p] 10147isl.isl_set_unwrap.restype = c_void_p 10148isl.isl_set_unwrap.argtypes = [c_void_p] 10149isl.isl_set_upper_bound_multi_pw_aff.restype = c_void_p 10150isl.isl_set_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10151isl.isl_set_upper_bound_multi_val.restype = c_void_p 10152isl.isl_set_upper_bound_multi_val.argtypes = [c_void_p, c_void_p] 10153isl.isl_set_copy.restype = c_void_p 10154isl.isl_set_copy.argtypes = [c_void_p] 10155isl.isl_set_free.restype = c_void_p 10156isl.isl_set_free.argtypes = [c_void_p] 10157isl.isl_set_to_str.restype = POINTER(c_char) 10158isl.isl_set_to_str.argtypes = [c_void_p] 10159 10160class basic_set(set): 10161 def __init__(self, *args, **keywords): 10162 if "ptr" in keywords: 10163 self.ctx = keywords["ctx"] 10164 self.ptr = keywords["ptr"] 10165 return 10166 if len(args) == 1 and args[0].__class__ is point: 10167 self.ctx = Context.getDefaultInstance() 10168 self.ptr = isl.isl_basic_set_from_point(isl.isl_point_copy(args[0].ptr)) 10169 return 10170 if len(args) == 1 and type(args[0]) == str: 10171 self.ctx = Context.getDefaultInstance() 10172 self.ptr = isl.isl_basic_set_read_from_str(self.ctx, args[0].encode('ascii')) 10173 return 10174 raise Error 10175 def __del__(self): 10176 if hasattr(self, 'ptr'): 10177 isl.isl_basic_set_free(self.ptr) 10178 def __str__(arg0): 10179 try: 10180 if not arg0.__class__ is basic_set: 10181 arg0 = basic_set(arg0) 10182 except: 10183 raise 10184 ptr = isl.isl_basic_set_to_str(arg0.ptr) 10185 res = cast(ptr, c_char_p).value.decode('ascii') 10186 libc.free(ptr) 10187 return res 10188 def __repr__(self): 10189 s = str(self) 10190 if '"' in s: 10191 return 'isl.basic_set("""%s""")' % s 10192 else: 10193 return 'isl.basic_set("%s")' % s 10194 def affine_hull(arg0): 10195 try: 10196 if not arg0.__class__ is basic_set: 10197 arg0 = basic_set(arg0) 10198 except: 10199 raise 10200 ctx = arg0.ctx 10201 res = isl.isl_basic_set_affine_hull(isl.isl_basic_set_copy(arg0.ptr)) 10202 obj = basic_set(ctx=ctx, ptr=res) 10203 return obj 10204 def apply(arg0, arg1): 10205 try: 10206 if not arg0.__class__ is basic_set: 10207 arg0 = basic_set(arg0) 10208 except: 10209 raise 10210 try: 10211 if not arg1.__class__ is basic_map: 10212 arg1 = basic_map(arg1) 10213 except: 10214 return set(arg0).apply(arg1) 10215 ctx = arg0.ctx 10216 res = isl.isl_basic_set_apply(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10217 obj = basic_set(ctx=ctx, ptr=res) 10218 return obj 10219 def detect_equalities(arg0): 10220 try: 10221 if not arg0.__class__ is basic_set: 10222 arg0 = basic_set(arg0) 10223 except: 10224 raise 10225 ctx = arg0.ctx 10226 res = isl.isl_basic_set_detect_equalities(isl.isl_basic_set_copy(arg0.ptr)) 10227 obj = basic_set(ctx=ctx, ptr=res) 10228 return obj 10229 def dim_max_val(arg0, arg1): 10230 try: 10231 if not arg0.__class__ is basic_set: 10232 arg0 = basic_set(arg0) 10233 except: 10234 raise 10235 ctx = arg0.ctx 10236 res = isl.isl_basic_set_dim_max_val(isl.isl_basic_set_copy(arg0.ptr), arg1) 10237 obj = val(ctx=ctx, ptr=res) 10238 return obj 10239 def flatten(arg0): 10240 try: 10241 if not arg0.__class__ is basic_set: 10242 arg0 = basic_set(arg0) 10243 except: 10244 raise 10245 ctx = arg0.ctx 10246 res = isl.isl_basic_set_flatten(isl.isl_basic_set_copy(arg0.ptr)) 10247 obj = basic_set(ctx=ctx, ptr=res) 10248 return obj 10249 def gist(arg0, arg1): 10250 try: 10251 if not arg0.__class__ is basic_set: 10252 arg0 = basic_set(arg0) 10253 except: 10254 raise 10255 try: 10256 if not arg1.__class__ is basic_set: 10257 arg1 = basic_set(arg1) 10258 except: 10259 return set(arg0).gist(arg1) 10260 ctx = arg0.ctx 10261 res = isl.isl_basic_set_gist(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10262 obj = basic_set(ctx=ctx, ptr=res) 10263 return obj 10264 def intersect(arg0, arg1): 10265 try: 10266 if not arg0.__class__ is basic_set: 10267 arg0 = basic_set(arg0) 10268 except: 10269 raise 10270 try: 10271 if not arg1.__class__ is basic_set: 10272 arg1 = basic_set(arg1) 10273 except: 10274 return set(arg0).intersect(arg1) 10275 ctx = arg0.ctx 10276 res = isl.isl_basic_set_intersect(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10277 obj = basic_set(ctx=ctx, ptr=res) 10278 return obj 10279 def intersect_params(arg0, arg1): 10280 try: 10281 if not arg0.__class__ is basic_set: 10282 arg0 = basic_set(arg0) 10283 except: 10284 raise 10285 try: 10286 if not arg1.__class__ is basic_set: 10287 arg1 = basic_set(arg1) 10288 except: 10289 return set(arg0).intersect_params(arg1) 10290 ctx = arg0.ctx 10291 res = isl.isl_basic_set_intersect_params(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10292 obj = basic_set(ctx=ctx, ptr=res) 10293 return obj 10294 def is_empty(arg0): 10295 try: 10296 if not arg0.__class__ is basic_set: 10297 arg0 = basic_set(arg0) 10298 except: 10299 raise 10300 ctx = arg0.ctx 10301 res = isl.isl_basic_set_is_empty(arg0.ptr) 10302 if res < 0: 10303 raise 10304 return bool(res) 10305 def is_equal(arg0, arg1): 10306 try: 10307 if not arg0.__class__ is basic_set: 10308 arg0 = basic_set(arg0) 10309 except: 10310 raise 10311 try: 10312 if not arg1.__class__ is basic_set: 10313 arg1 = basic_set(arg1) 10314 except: 10315 return set(arg0).is_equal(arg1) 10316 ctx = arg0.ctx 10317 res = isl.isl_basic_set_is_equal(arg0.ptr, arg1.ptr) 10318 if res < 0: 10319 raise 10320 return bool(res) 10321 def is_subset(arg0, arg1): 10322 try: 10323 if not arg0.__class__ is basic_set: 10324 arg0 = basic_set(arg0) 10325 except: 10326 raise 10327 try: 10328 if not arg1.__class__ is basic_set: 10329 arg1 = basic_set(arg1) 10330 except: 10331 return set(arg0).is_subset(arg1) 10332 ctx = arg0.ctx 10333 res = isl.isl_basic_set_is_subset(arg0.ptr, arg1.ptr) 10334 if res < 0: 10335 raise 10336 return bool(res) 10337 def is_wrapping(arg0): 10338 try: 10339 if not arg0.__class__ is basic_set: 10340 arg0 = basic_set(arg0) 10341 except: 10342 raise 10343 ctx = arg0.ctx 10344 res = isl.isl_basic_set_is_wrapping(arg0.ptr) 10345 if res < 0: 10346 raise 10347 return bool(res) 10348 def lexmax(arg0): 10349 try: 10350 if not arg0.__class__ is basic_set: 10351 arg0 = basic_set(arg0) 10352 except: 10353 raise 10354 ctx = arg0.ctx 10355 res = isl.isl_basic_set_lexmax(isl.isl_basic_set_copy(arg0.ptr)) 10356 obj = set(ctx=ctx, ptr=res) 10357 return obj 10358 def lexmin(arg0): 10359 try: 10360 if not arg0.__class__ is basic_set: 10361 arg0 = basic_set(arg0) 10362 except: 10363 raise 10364 ctx = arg0.ctx 10365 res = isl.isl_basic_set_lexmin(isl.isl_basic_set_copy(arg0.ptr)) 10366 obj = set(ctx=ctx, ptr=res) 10367 return obj 10368 def params(arg0): 10369 try: 10370 if not arg0.__class__ is basic_set: 10371 arg0 = basic_set(arg0) 10372 except: 10373 raise 10374 ctx = arg0.ctx 10375 res = isl.isl_basic_set_params(isl.isl_basic_set_copy(arg0.ptr)) 10376 obj = basic_set(ctx=ctx, ptr=res) 10377 return obj 10378 def sample(arg0): 10379 try: 10380 if not arg0.__class__ is basic_set: 10381 arg0 = basic_set(arg0) 10382 except: 10383 raise 10384 ctx = arg0.ctx 10385 res = isl.isl_basic_set_sample(isl.isl_basic_set_copy(arg0.ptr)) 10386 obj = basic_set(ctx=ctx, ptr=res) 10387 return obj 10388 def sample_point(arg0): 10389 try: 10390 if not arg0.__class__ is basic_set: 10391 arg0 = basic_set(arg0) 10392 except: 10393 raise 10394 ctx = arg0.ctx 10395 res = isl.isl_basic_set_sample_point(isl.isl_basic_set_copy(arg0.ptr)) 10396 obj = point(ctx=ctx, ptr=res) 10397 return obj 10398 def union(arg0, arg1): 10399 try: 10400 if not arg0.__class__ is basic_set: 10401 arg0 = basic_set(arg0) 10402 except: 10403 raise 10404 try: 10405 if not arg1.__class__ is basic_set: 10406 arg1 = basic_set(arg1) 10407 except: 10408 return set(arg0).union(arg1) 10409 ctx = arg0.ctx 10410 res = isl.isl_basic_set_union(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10411 obj = set(ctx=ctx, ptr=res) 10412 return obj 10413 10414isl.isl_basic_set_from_point.restype = c_void_p 10415isl.isl_basic_set_from_point.argtypes = [c_void_p] 10416isl.isl_basic_set_read_from_str.restype = c_void_p 10417isl.isl_basic_set_read_from_str.argtypes = [Context, c_char_p] 10418isl.isl_basic_set_affine_hull.restype = c_void_p 10419isl.isl_basic_set_affine_hull.argtypes = [c_void_p] 10420isl.isl_basic_set_apply.restype = c_void_p 10421isl.isl_basic_set_apply.argtypes = [c_void_p, c_void_p] 10422isl.isl_basic_set_detect_equalities.restype = c_void_p 10423isl.isl_basic_set_detect_equalities.argtypes = [c_void_p] 10424isl.isl_basic_set_dim_max_val.restype = c_void_p 10425isl.isl_basic_set_dim_max_val.argtypes = [c_void_p, c_int] 10426isl.isl_basic_set_flatten.restype = c_void_p 10427isl.isl_basic_set_flatten.argtypes = [c_void_p] 10428isl.isl_basic_set_gist.restype = c_void_p 10429isl.isl_basic_set_gist.argtypes = [c_void_p, c_void_p] 10430isl.isl_basic_set_intersect.restype = c_void_p 10431isl.isl_basic_set_intersect.argtypes = [c_void_p, c_void_p] 10432isl.isl_basic_set_intersect_params.restype = c_void_p 10433isl.isl_basic_set_intersect_params.argtypes = [c_void_p, c_void_p] 10434isl.isl_basic_set_is_empty.argtypes = [c_void_p] 10435isl.isl_basic_set_is_equal.argtypes = [c_void_p, c_void_p] 10436isl.isl_basic_set_is_subset.argtypes = [c_void_p, c_void_p] 10437isl.isl_basic_set_is_wrapping.argtypes = [c_void_p] 10438isl.isl_basic_set_lexmax.restype = c_void_p 10439isl.isl_basic_set_lexmax.argtypes = [c_void_p] 10440isl.isl_basic_set_lexmin.restype = c_void_p 10441isl.isl_basic_set_lexmin.argtypes = [c_void_p] 10442isl.isl_basic_set_params.restype = c_void_p 10443isl.isl_basic_set_params.argtypes = [c_void_p] 10444isl.isl_basic_set_sample.restype = c_void_p 10445isl.isl_basic_set_sample.argtypes = [c_void_p] 10446isl.isl_basic_set_sample_point.restype = c_void_p 10447isl.isl_basic_set_sample_point.argtypes = [c_void_p] 10448isl.isl_basic_set_union.restype = c_void_p 10449isl.isl_basic_set_union.argtypes = [c_void_p, c_void_p] 10450isl.isl_basic_set_copy.restype = c_void_p 10451isl.isl_basic_set_copy.argtypes = [c_void_p] 10452isl.isl_basic_set_free.restype = c_void_p 10453isl.isl_basic_set_free.argtypes = [c_void_p] 10454isl.isl_basic_set_to_str.restype = POINTER(c_char) 10455isl.isl_basic_set_to_str.argtypes = [c_void_p] 10456 10457class fixed_box(object): 10458 def __init__(self, *args, **keywords): 10459 if "ptr" in keywords: 10460 self.ctx = keywords["ctx"] 10461 self.ptr = keywords["ptr"] 10462 return 10463 raise Error 10464 def __del__(self): 10465 if hasattr(self, 'ptr'): 10466 isl.isl_fixed_box_free(self.ptr) 10467 def __str__(arg0): 10468 try: 10469 if not arg0.__class__ is fixed_box: 10470 arg0 = fixed_box(arg0) 10471 except: 10472 raise 10473 ptr = isl.isl_fixed_box_to_str(arg0.ptr) 10474 res = cast(ptr, c_char_p).value.decode('ascii') 10475 libc.free(ptr) 10476 return res 10477 def __repr__(self): 10478 s = str(self) 10479 if '"' in s: 10480 return 'isl.fixed_box("""%s""")' % s 10481 else: 10482 return 'isl.fixed_box("%s")' % s 10483 def offset(arg0): 10484 try: 10485 if not arg0.__class__ is fixed_box: 10486 arg0 = fixed_box(arg0) 10487 except: 10488 raise 10489 ctx = arg0.ctx 10490 res = isl.isl_fixed_box_get_offset(arg0.ptr) 10491 obj = multi_aff(ctx=ctx, ptr=res) 10492 return obj 10493 def get_offset(arg0): 10494 return arg0.offset() 10495 def size(arg0): 10496 try: 10497 if not arg0.__class__ is fixed_box: 10498 arg0 = fixed_box(arg0) 10499 except: 10500 raise 10501 ctx = arg0.ctx 10502 res = isl.isl_fixed_box_get_size(arg0.ptr) 10503 obj = multi_val(ctx=ctx, ptr=res) 10504 return obj 10505 def get_size(arg0): 10506 return arg0.size() 10507 def space(arg0): 10508 try: 10509 if not arg0.__class__ is fixed_box: 10510 arg0 = fixed_box(arg0) 10511 except: 10512 raise 10513 ctx = arg0.ctx 10514 res = isl.isl_fixed_box_get_space(arg0.ptr) 10515 obj = space(ctx=ctx, ptr=res) 10516 return obj 10517 def get_space(arg0): 10518 return arg0.space() 10519 def is_valid(arg0): 10520 try: 10521 if not arg0.__class__ is fixed_box: 10522 arg0 = fixed_box(arg0) 10523 except: 10524 raise 10525 ctx = arg0.ctx 10526 res = isl.isl_fixed_box_is_valid(arg0.ptr) 10527 if res < 0: 10528 raise 10529 return bool(res) 10530 10531isl.isl_fixed_box_get_offset.restype = c_void_p 10532isl.isl_fixed_box_get_offset.argtypes = [c_void_p] 10533isl.isl_fixed_box_get_size.restype = c_void_p 10534isl.isl_fixed_box_get_size.argtypes = [c_void_p] 10535isl.isl_fixed_box_get_space.restype = c_void_p 10536isl.isl_fixed_box_get_space.argtypes = [c_void_p] 10537isl.isl_fixed_box_is_valid.argtypes = [c_void_p] 10538isl.isl_fixed_box_copy.restype = c_void_p 10539isl.isl_fixed_box_copy.argtypes = [c_void_p] 10540isl.isl_fixed_box_free.restype = c_void_p 10541isl.isl_fixed_box_free.argtypes = [c_void_p] 10542isl.isl_fixed_box_to_str.restype = POINTER(c_char) 10543isl.isl_fixed_box_to_str.argtypes = [c_void_p] 10544 10545class id(object): 10546 def __init__(self, *args, **keywords): 10547 if "ptr" in keywords: 10548 self.ctx = keywords["ctx"] 10549 self.ptr = keywords["ptr"] 10550 return 10551 if len(args) == 1 and type(args[0]) == str: 10552 self.ctx = Context.getDefaultInstance() 10553 self.ptr = isl.isl_id_read_from_str(self.ctx, args[0].encode('ascii')) 10554 return 10555 raise Error 10556 def __del__(self): 10557 if hasattr(self, 'ptr'): 10558 isl.isl_id_free(self.ptr) 10559 def __str__(arg0): 10560 try: 10561 if not arg0.__class__ is id: 10562 arg0 = id(arg0) 10563 except: 10564 raise 10565 ptr = isl.isl_id_to_str(arg0.ptr) 10566 res = cast(ptr, c_char_p).value.decode('ascii') 10567 libc.free(ptr) 10568 return res 10569 def __repr__(self): 10570 s = str(self) 10571 if '"' in s: 10572 return 'isl.id("""%s""")' % s 10573 else: 10574 return 'isl.id("%s")' % s 10575 def name(arg0): 10576 try: 10577 if not arg0.__class__ is id: 10578 arg0 = id(arg0) 10579 except: 10580 raise 10581 ctx = arg0.ctx 10582 res = isl.isl_id_get_name(arg0.ptr) 10583 if res == 0: 10584 raise 10585 string = cast(res, c_char_p).value.decode('ascii') 10586 return string 10587 def get_name(arg0): 10588 return arg0.name() 10589 10590isl.isl_id_read_from_str.restype = c_void_p 10591isl.isl_id_read_from_str.argtypes = [Context, c_char_p] 10592isl.isl_id_get_name.restype = POINTER(c_char) 10593isl.isl_id_get_name.argtypes = [c_void_p] 10594isl.isl_id_copy.restype = c_void_p 10595isl.isl_id_copy.argtypes = [c_void_p] 10596isl.isl_id_free.restype = c_void_p 10597isl.isl_id_free.argtypes = [c_void_p] 10598isl.isl_id_to_str.restype = POINTER(c_char) 10599isl.isl_id_to_str.argtypes = [c_void_p] 10600 10601class id_list(object): 10602 def __init__(self, *args, **keywords): 10603 if "ptr" in keywords: 10604 self.ctx = keywords["ctx"] 10605 self.ptr = keywords["ptr"] 10606 return 10607 if len(args) == 1 and type(args[0]) == int: 10608 self.ctx = Context.getDefaultInstance() 10609 self.ptr = isl.isl_id_list_alloc(self.ctx, args[0]) 10610 return 10611 if len(args) == 1 and (args[0].__class__ is id or type(args[0]) == str): 10612 args = list(args) 10613 try: 10614 if not args[0].__class__ is id: 10615 args[0] = id(args[0]) 10616 except: 10617 raise 10618 self.ctx = Context.getDefaultInstance() 10619 self.ptr = isl.isl_id_list_from_id(isl.isl_id_copy(args[0].ptr)) 10620 return 10621 raise Error 10622 def __del__(self): 10623 if hasattr(self, 'ptr'): 10624 isl.isl_id_list_free(self.ptr) 10625 def __str__(arg0): 10626 try: 10627 if not arg0.__class__ is id_list: 10628 arg0 = id_list(arg0) 10629 except: 10630 raise 10631 ptr = isl.isl_id_list_to_str(arg0.ptr) 10632 res = cast(ptr, c_char_p).value.decode('ascii') 10633 libc.free(ptr) 10634 return res 10635 def __repr__(self): 10636 s = str(self) 10637 if '"' in s: 10638 return 'isl.id_list("""%s""")' % s 10639 else: 10640 return 'isl.id_list("%s")' % s 10641 def add(arg0, arg1): 10642 try: 10643 if not arg0.__class__ is id_list: 10644 arg0 = id_list(arg0) 10645 except: 10646 raise 10647 try: 10648 if not arg1.__class__ is id: 10649 arg1 = id(arg1) 10650 except: 10651 raise 10652 ctx = arg0.ctx 10653 res = isl.isl_id_list_add(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 10654 obj = id_list(ctx=ctx, ptr=res) 10655 return obj 10656 def clear(arg0): 10657 try: 10658 if not arg0.__class__ is id_list: 10659 arg0 = id_list(arg0) 10660 except: 10661 raise 10662 ctx = arg0.ctx 10663 res = isl.isl_id_list_clear(isl.isl_id_list_copy(arg0.ptr)) 10664 obj = id_list(ctx=ctx, ptr=res) 10665 return obj 10666 def concat(arg0, arg1): 10667 try: 10668 if not arg0.__class__ is id_list: 10669 arg0 = id_list(arg0) 10670 except: 10671 raise 10672 try: 10673 if not arg1.__class__ is id_list: 10674 arg1 = id_list(arg1) 10675 except: 10676 raise 10677 ctx = arg0.ctx 10678 res = isl.isl_id_list_concat(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_list_copy(arg1.ptr)) 10679 obj = id_list(ctx=ctx, ptr=res) 10680 return obj 10681 def drop(arg0, arg1, arg2): 10682 try: 10683 if not arg0.__class__ is id_list: 10684 arg0 = id_list(arg0) 10685 except: 10686 raise 10687 ctx = arg0.ctx 10688 res = isl.isl_id_list_drop(isl.isl_id_list_copy(arg0.ptr), arg1, arg2) 10689 obj = id_list(ctx=ctx, ptr=res) 10690 return obj 10691 def foreach(arg0, arg1): 10692 try: 10693 if not arg0.__class__ is id_list: 10694 arg0 = id_list(arg0) 10695 except: 10696 raise 10697 exc_info = [None] 10698 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10699 def cb_func(cb_arg0, cb_arg1): 10700 cb_arg0 = id(ctx=arg0.ctx, ptr=(cb_arg0)) 10701 try: 10702 arg1(cb_arg0) 10703 except: 10704 import sys 10705 exc_info[0] = sys.exc_info() 10706 return -1 10707 return 0 10708 cb = fn(cb_func) 10709 ctx = arg0.ctx 10710 res = isl.isl_id_list_foreach(arg0.ptr, cb, None) 10711 if exc_info[0] != None: 10712 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 10713 if res < 0: 10714 raise 10715 def at(arg0, arg1): 10716 try: 10717 if not arg0.__class__ is id_list: 10718 arg0 = id_list(arg0) 10719 except: 10720 raise 10721 ctx = arg0.ctx 10722 res = isl.isl_id_list_get_at(arg0.ptr, arg1) 10723 obj = id(ctx=ctx, ptr=res) 10724 return obj 10725 def get_at(arg0, arg1): 10726 return arg0.at(arg1) 10727 def insert(arg0, arg1, arg2): 10728 try: 10729 if not arg0.__class__ is id_list: 10730 arg0 = id_list(arg0) 10731 except: 10732 raise 10733 try: 10734 if not arg2.__class__ is id: 10735 arg2 = id(arg2) 10736 except: 10737 raise 10738 ctx = arg0.ctx 10739 res = isl.isl_id_list_insert(isl.isl_id_list_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 10740 obj = id_list(ctx=ctx, ptr=res) 10741 return obj 10742 def size(arg0): 10743 try: 10744 if not arg0.__class__ is id_list: 10745 arg0 = id_list(arg0) 10746 except: 10747 raise 10748 ctx = arg0.ctx 10749 res = isl.isl_id_list_size(arg0.ptr) 10750 if res < 0: 10751 raise 10752 return int(res) 10753 10754isl.isl_id_list_alloc.restype = c_void_p 10755isl.isl_id_list_alloc.argtypes = [Context, c_int] 10756isl.isl_id_list_from_id.restype = c_void_p 10757isl.isl_id_list_from_id.argtypes = [c_void_p] 10758isl.isl_id_list_add.restype = c_void_p 10759isl.isl_id_list_add.argtypes = [c_void_p, c_void_p] 10760isl.isl_id_list_clear.restype = c_void_p 10761isl.isl_id_list_clear.argtypes = [c_void_p] 10762isl.isl_id_list_concat.restype = c_void_p 10763isl.isl_id_list_concat.argtypes = [c_void_p, c_void_p] 10764isl.isl_id_list_drop.restype = c_void_p 10765isl.isl_id_list_drop.argtypes = [c_void_p, c_int, c_int] 10766isl.isl_id_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 10767isl.isl_id_list_get_at.restype = c_void_p 10768isl.isl_id_list_get_at.argtypes = [c_void_p, c_int] 10769isl.isl_id_list_insert.restype = c_void_p 10770isl.isl_id_list_insert.argtypes = [c_void_p, c_int, c_void_p] 10771isl.isl_id_list_size.argtypes = [c_void_p] 10772isl.isl_id_list_copy.restype = c_void_p 10773isl.isl_id_list_copy.argtypes = [c_void_p] 10774isl.isl_id_list_free.restype = c_void_p 10775isl.isl_id_list_free.argtypes = [c_void_p] 10776isl.isl_id_list_to_str.restype = POINTER(c_char) 10777isl.isl_id_list_to_str.argtypes = [c_void_p] 10778 10779class multi_id(object): 10780 def __init__(self, *args, **keywords): 10781 if "ptr" in keywords: 10782 self.ctx = keywords["ctx"] 10783 self.ptr = keywords["ptr"] 10784 return 10785 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is id_list: 10786 self.ctx = Context.getDefaultInstance() 10787 self.ptr = isl.isl_multi_id_from_id_list(isl.isl_space_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 10788 return 10789 if len(args) == 1 and type(args[0]) == str: 10790 self.ctx = Context.getDefaultInstance() 10791 self.ptr = isl.isl_multi_id_read_from_str(self.ctx, args[0].encode('ascii')) 10792 return 10793 raise Error 10794 def __del__(self): 10795 if hasattr(self, 'ptr'): 10796 isl.isl_multi_id_free(self.ptr) 10797 def __str__(arg0): 10798 try: 10799 if not arg0.__class__ is multi_id: 10800 arg0 = multi_id(arg0) 10801 except: 10802 raise 10803 ptr = isl.isl_multi_id_to_str(arg0.ptr) 10804 res = cast(ptr, c_char_p).value.decode('ascii') 10805 libc.free(ptr) 10806 return res 10807 def __repr__(self): 10808 s = str(self) 10809 if '"' in s: 10810 return 'isl.multi_id("""%s""")' % s 10811 else: 10812 return 'isl.multi_id("%s")' % s 10813 def flat_range_product(arg0, arg1): 10814 try: 10815 if not arg0.__class__ is multi_id: 10816 arg0 = multi_id(arg0) 10817 except: 10818 raise 10819 try: 10820 if not arg1.__class__ is multi_id: 10821 arg1 = multi_id(arg1) 10822 except: 10823 raise 10824 ctx = arg0.ctx 10825 res = isl.isl_multi_id_flat_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 10826 obj = multi_id(ctx=ctx, ptr=res) 10827 return obj 10828 def at(arg0, arg1): 10829 try: 10830 if not arg0.__class__ is multi_id: 10831 arg0 = multi_id(arg0) 10832 except: 10833 raise 10834 ctx = arg0.ctx 10835 res = isl.isl_multi_id_get_at(arg0.ptr, arg1) 10836 obj = id(ctx=ctx, ptr=res) 10837 return obj 10838 def get_at(arg0, arg1): 10839 return arg0.at(arg1) 10840 def list(arg0): 10841 try: 10842 if not arg0.__class__ is multi_id: 10843 arg0 = multi_id(arg0) 10844 except: 10845 raise 10846 ctx = arg0.ctx 10847 res = isl.isl_multi_id_get_list(arg0.ptr) 10848 obj = id_list(ctx=ctx, ptr=res) 10849 return obj 10850 def get_list(arg0): 10851 return arg0.list() 10852 def space(arg0): 10853 try: 10854 if not arg0.__class__ is multi_id: 10855 arg0 = multi_id(arg0) 10856 except: 10857 raise 10858 ctx = arg0.ctx 10859 res = isl.isl_multi_id_get_space(arg0.ptr) 10860 obj = space(ctx=ctx, ptr=res) 10861 return obj 10862 def get_space(arg0): 10863 return arg0.space() 10864 def plain_is_equal(arg0, arg1): 10865 try: 10866 if not arg0.__class__ is multi_id: 10867 arg0 = multi_id(arg0) 10868 except: 10869 raise 10870 try: 10871 if not arg1.__class__ is multi_id: 10872 arg1 = multi_id(arg1) 10873 except: 10874 raise 10875 ctx = arg0.ctx 10876 res = isl.isl_multi_id_plain_is_equal(arg0.ptr, arg1.ptr) 10877 if res < 0: 10878 raise 10879 return bool(res) 10880 def range_product(arg0, arg1): 10881 try: 10882 if not arg0.__class__ is multi_id: 10883 arg0 = multi_id(arg0) 10884 except: 10885 raise 10886 try: 10887 if not arg1.__class__ is multi_id: 10888 arg1 = multi_id(arg1) 10889 except: 10890 raise 10891 ctx = arg0.ctx 10892 res = isl.isl_multi_id_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 10893 obj = multi_id(ctx=ctx, ptr=res) 10894 return obj 10895 def set_at(arg0, arg1, arg2): 10896 try: 10897 if not arg0.__class__ is multi_id: 10898 arg0 = multi_id(arg0) 10899 except: 10900 raise 10901 try: 10902 if not arg2.__class__ is id: 10903 arg2 = id(arg2) 10904 except: 10905 raise 10906 ctx = arg0.ctx 10907 res = isl.isl_multi_id_set_at(isl.isl_multi_id_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 10908 obj = multi_id(ctx=ctx, ptr=res) 10909 return obj 10910 def size(arg0): 10911 try: 10912 if not arg0.__class__ is multi_id: 10913 arg0 = multi_id(arg0) 10914 except: 10915 raise 10916 ctx = arg0.ctx 10917 res = isl.isl_multi_id_size(arg0.ptr) 10918 if res < 0: 10919 raise 10920 return int(res) 10921 10922isl.isl_multi_id_from_id_list.restype = c_void_p 10923isl.isl_multi_id_from_id_list.argtypes = [c_void_p, c_void_p] 10924isl.isl_multi_id_read_from_str.restype = c_void_p 10925isl.isl_multi_id_read_from_str.argtypes = [Context, c_char_p] 10926isl.isl_multi_id_flat_range_product.restype = c_void_p 10927isl.isl_multi_id_flat_range_product.argtypes = [c_void_p, c_void_p] 10928isl.isl_multi_id_get_at.restype = c_void_p 10929isl.isl_multi_id_get_at.argtypes = [c_void_p, c_int] 10930isl.isl_multi_id_get_list.restype = c_void_p 10931isl.isl_multi_id_get_list.argtypes = [c_void_p] 10932isl.isl_multi_id_get_space.restype = c_void_p 10933isl.isl_multi_id_get_space.argtypes = [c_void_p] 10934isl.isl_multi_id_plain_is_equal.argtypes = [c_void_p, c_void_p] 10935isl.isl_multi_id_range_product.restype = c_void_p 10936isl.isl_multi_id_range_product.argtypes = [c_void_p, c_void_p] 10937isl.isl_multi_id_set_at.restype = c_void_p 10938isl.isl_multi_id_set_at.argtypes = [c_void_p, c_int, c_void_p] 10939isl.isl_multi_id_size.argtypes = [c_void_p] 10940isl.isl_multi_id_copy.restype = c_void_p 10941isl.isl_multi_id_copy.argtypes = [c_void_p] 10942isl.isl_multi_id_free.restype = c_void_p 10943isl.isl_multi_id_free.argtypes = [c_void_p] 10944isl.isl_multi_id_to_str.restype = POINTER(c_char) 10945isl.isl_multi_id_to_str.argtypes = [c_void_p] 10946 10947class multi_val(object): 10948 def __init__(self, *args, **keywords): 10949 if "ptr" in keywords: 10950 self.ctx = keywords["ctx"] 10951 self.ptr = keywords["ptr"] 10952 return 10953 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is val_list: 10954 self.ctx = Context.getDefaultInstance() 10955 self.ptr = isl.isl_multi_val_from_val_list(isl.isl_space_copy(args[0].ptr), isl.isl_val_list_copy(args[1].ptr)) 10956 return 10957 if len(args) == 1 and type(args[0]) == str: 10958 self.ctx = Context.getDefaultInstance() 10959 self.ptr = isl.isl_multi_val_read_from_str(self.ctx, args[0].encode('ascii')) 10960 return 10961 raise Error 10962 def __del__(self): 10963 if hasattr(self, 'ptr'): 10964 isl.isl_multi_val_free(self.ptr) 10965 def __str__(arg0): 10966 try: 10967 if not arg0.__class__ is multi_val: 10968 arg0 = multi_val(arg0) 10969 except: 10970 raise 10971 ptr = isl.isl_multi_val_to_str(arg0.ptr) 10972 res = cast(ptr, c_char_p).value.decode('ascii') 10973 libc.free(ptr) 10974 return res 10975 def __repr__(self): 10976 s = str(self) 10977 if '"' in s: 10978 return 'isl.multi_val("""%s""")' % s 10979 else: 10980 return 'isl.multi_val("%s")' % s 10981 def add(*args): 10982 if len(args) == 2 and args[1].__class__ is multi_val: 10983 ctx = args[0].ctx 10984 res = isl.isl_multi_val_add(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 10985 obj = multi_val(ctx=ctx, ptr=res) 10986 return obj 10987 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 10988 args = list(args) 10989 try: 10990 if not args[1].__class__ is val: 10991 args[1] = val(args[1]) 10992 except: 10993 raise 10994 ctx = args[0].ctx 10995 res = isl.isl_multi_val_add_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 10996 obj = multi_val(ctx=ctx, ptr=res) 10997 return obj 10998 raise Error 10999 def flat_range_product(arg0, arg1): 11000 try: 11001 if not arg0.__class__ is multi_val: 11002 arg0 = multi_val(arg0) 11003 except: 11004 raise 11005 try: 11006 if not arg1.__class__ is multi_val: 11007 arg1 = multi_val(arg1) 11008 except: 11009 raise 11010 ctx = arg0.ctx 11011 res = isl.isl_multi_val_flat_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11012 obj = multi_val(ctx=ctx, ptr=res) 11013 return obj 11014 def at(arg0, arg1): 11015 try: 11016 if not arg0.__class__ is multi_val: 11017 arg0 = multi_val(arg0) 11018 except: 11019 raise 11020 ctx = arg0.ctx 11021 res = isl.isl_multi_val_get_at(arg0.ptr, arg1) 11022 obj = val(ctx=ctx, ptr=res) 11023 return obj 11024 def get_at(arg0, arg1): 11025 return arg0.at(arg1) 11026 def list(arg0): 11027 try: 11028 if not arg0.__class__ is multi_val: 11029 arg0 = multi_val(arg0) 11030 except: 11031 raise 11032 ctx = arg0.ctx 11033 res = isl.isl_multi_val_get_list(arg0.ptr) 11034 obj = val_list(ctx=ctx, ptr=res) 11035 return obj 11036 def get_list(arg0): 11037 return arg0.list() 11038 def space(arg0): 11039 try: 11040 if not arg0.__class__ is multi_val: 11041 arg0 = multi_val(arg0) 11042 except: 11043 raise 11044 ctx = arg0.ctx 11045 res = isl.isl_multi_val_get_space(arg0.ptr) 11046 obj = space(ctx=ctx, ptr=res) 11047 return obj 11048 def get_space(arg0): 11049 return arg0.space() 11050 def involves_nan(arg0): 11051 try: 11052 if not arg0.__class__ is multi_val: 11053 arg0 = multi_val(arg0) 11054 except: 11055 raise 11056 ctx = arg0.ctx 11057 res = isl.isl_multi_val_involves_nan(arg0.ptr) 11058 if res < 0: 11059 raise 11060 return bool(res) 11061 def max(arg0, arg1): 11062 try: 11063 if not arg0.__class__ is multi_val: 11064 arg0 = multi_val(arg0) 11065 except: 11066 raise 11067 try: 11068 if not arg1.__class__ is multi_val: 11069 arg1 = multi_val(arg1) 11070 except: 11071 raise 11072 ctx = arg0.ctx 11073 res = isl.isl_multi_val_max(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11074 obj = multi_val(ctx=ctx, ptr=res) 11075 return obj 11076 def min(arg0, arg1): 11077 try: 11078 if not arg0.__class__ is multi_val: 11079 arg0 = multi_val(arg0) 11080 except: 11081 raise 11082 try: 11083 if not arg1.__class__ is multi_val: 11084 arg1 = multi_val(arg1) 11085 except: 11086 raise 11087 ctx = arg0.ctx 11088 res = isl.isl_multi_val_min(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11089 obj = multi_val(ctx=ctx, ptr=res) 11090 return obj 11091 def neg(arg0): 11092 try: 11093 if not arg0.__class__ is multi_val: 11094 arg0 = multi_val(arg0) 11095 except: 11096 raise 11097 ctx = arg0.ctx 11098 res = isl.isl_multi_val_neg(isl.isl_multi_val_copy(arg0.ptr)) 11099 obj = multi_val(ctx=ctx, ptr=res) 11100 return obj 11101 def plain_is_equal(arg0, arg1): 11102 try: 11103 if not arg0.__class__ is multi_val: 11104 arg0 = multi_val(arg0) 11105 except: 11106 raise 11107 try: 11108 if not arg1.__class__ is multi_val: 11109 arg1 = multi_val(arg1) 11110 except: 11111 raise 11112 ctx = arg0.ctx 11113 res = isl.isl_multi_val_plain_is_equal(arg0.ptr, arg1.ptr) 11114 if res < 0: 11115 raise 11116 return bool(res) 11117 def product(arg0, arg1): 11118 try: 11119 if not arg0.__class__ is multi_val: 11120 arg0 = multi_val(arg0) 11121 except: 11122 raise 11123 try: 11124 if not arg1.__class__ is multi_val: 11125 arg1 = multi_val(arg1) 11126 except: 11127 raise 11128 ctx = arg0.ctx 11129 res = isl.isl_multi_val_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11130 obj = multi_val(ctx=ctx, ptr=res) 11131 return obj 11132 def range_product(arg0, arg1): 11133 try: 11134 if not arg0.__class__ is multi_val: 11135 arg0 = multi_val(arg0) 11136 except: 11137 raise 11138 try: 11139 if not arg1.__class__ is multi_val: 11140 arg1 = multi_val(arg1) 11141 except: 11142 raise 11143 ctx = arg0.ctx 11144 res = isl.isl_multi_val_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11145 obj = multi_val(ctx=ctx, ptr=res) 11146 return obj 11147 def scale(*args): 11148 if len(args) == 2 and args[1].__class__ is multi_val: 11149 ctx = args[0].ctx 11150 res = isl.isl_multi_val_scale_multi_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 11151 obj = multi_val(ctx=ctx, ptr=res) 11152 return obj 11153 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 11154 args = list(args) 11155 try: 11156 if not args[1].__class__ is val: 11157 args[1] = val(args[1]) 11158 except: 11159 raise 11160 ctx = args[0].ctx 11161 res = isl.isl_multi_val_scale_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 11162 obj = multi_val(ctx=ctx, ptr=res) 11163 return obj 11164 raise Error 11165 def scale_down(*args): 11166 if len(args) == 2 and args[1].__class__ is multi_val: 11167 ctx = args[0].ctx 11168 res = isl.isl_multi_val_scale_down_multi_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 11169 obj = multi_val(ctx=ctx, ptr=res) 11170 return obj 11171 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 11172 args = list(args) 11173 try: 11174 if not args[1].__class__ is val: 11175 args[1] = val(args[1]) 11176 except: 11177 raise 11178 ctx = args[0].ctx 11179 res = isl.isl_multi_val_scale_down_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 11180 obj = multi_val(ctx=ctx, ptr=res) 11181 return obj 11182 raise Error 11183 def set_at(arg0, arg1, arg2): 11184 try: 11185 if not arg0.__class__ is multi_val: 11186 arg0 = multi_val(arg0) 11187 except: 11188 raise 11189 try: 11190 if not arg2.__class__ is val: 11191 arg2 = val(arg2) 11192 except: 11193 raise 11194 ctx = arg0.ctx 11195 res = isl.isl_multi_val_set_at(isl.isl_multi_val_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 11196 obj = multi_val(ctx=ctx, ptr=res) 11197 return obj 11198 def size(arg0): 11199 try: 11200 if not arg0.__class__ is multi_val: 11201 arg0 = multi_val(arg0) 11202 except: 11203 raise 11204 ctx = arg0.ctx 11205 res = isl.isl_multi_val_size(arg0.ptr) 11206 if res < 0: 11207 raise 11208 return int(res) 11209 def sub(arg0, arg1): 11210 try: 11211 if not arg0.__class__ is multi_val: 11212 arg0 = multi_val(arg0) 11213 except: 11214 raise 11215 try: 11216 if not arg1.__class__ is multi_val: 11217 arg1 = multi_val(arg1) 11218 except: 11219 raise 11220 ctx = arg0.ctx 11221 res = isl.isl_multi_val_sub(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 11222 obj = multi_val(ctx=ctx, ptr=res) 11223 return obj 11224 @staticmethod 11225 def zero(arg0): 11226 try: 11227 if not arg0.__class__ is space: 11228 arg0 = space(arg0) 11229 except: 11230 raise 11231 ctx = arg0.ctx 11232 res = isl.isl_multi_val_zero(isl.isl_space_copy(arg0.ptr)) 11233 obj = multi_val(ctx=ctx, ptr=res) 11234 return obj 11235 11236isl.isl_multi_val_from_val_list.restype = c_void_p 11237isl.isl_multi_val_from_val_list.argtypes = [c_void_p, c_void_p] 11238isl.isl_multi_val_read_from_str.restype = c_void_p 11239isl.isl_multi_val_read_from_str.argtypes = [Context, c_char_p] 11240isl.isl_multi_val_add.restype = c_void_p 11241isl.isl_multi_val_add.argtypes = [c_void_p, c_void_p] 11242isl.isl_multi_val_add_val.restype = c_void_p 11243isl.isl_multi_val_add_val.argtypes = [c_void_p, c_void_p] 11244isl.isl_multi_val_flat_range_product.restype = c_void_p 11245isl.isl_multi_val_flat_range_product.argtypes = [c_void_p, c_void_p] 11246isl.isl_multi_val_get_at.restype = c_void_p 11247isl.isl_multi_val_get_at.argtypes = [c_void_p, c_int] 11248isl.isl_multi_val_get_list.restype = c_void_p 11249isl.isl_multi_val_get_list.argtypes = [c_void_p] 11250isl.isl_multi_val_get_space.restype = c_void_p 11251isl.isl_multi_val_get_space.argtypes = [c_void_p] 11252isl.isl_multi_val_involves_nan.argtypes = [c_void_p] 11253isl.isl_multi_val_max.restype = c_void_p 11254isl.isl_multi_val_max.argtypes = [c_void_p, c_void_p] 11255isl.isl_multi_val_min.restype = c_void_p 11256isl.isl_multi_val_min.argtypes = [c_void_p, c_void_p] 11257isl.isl_multi_val_neg.restype = c_void_p 11258isl.isl_multi_val_neg.argtypes = [c_void_p] 11259isl.isl_multi_val_plain_is_equal.argtypes = [c_void_p, c_void_p] 11260isl.isl_multi_val_product.restype = c_void_p 11261isl.isl_multi_val_product.argtypes = [c_void_p, c_void_p] 11262isl.isl_multi_val_range_product.restype = c_void_p 11263isl.isl_multi_val_range_product.argtypes = [c_void_p, c_void_p] 11264isl.isl_multi_val_scale_multi_val.restype = c_void_p 11265isl.isl_multi_val_scale_multi_val.argtypes = [c_void_p, c_void_p] 11266isl.isl_multi_val_scale_val.restype = c_void_p 11267isl.isl_multi_val_scale_val.argtypes = [c_void_p, c_void_p] 11268isl.isl_multi_val_scale_down_multi_val.restype = c_void_p 11269isl.isl_multi_val_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 11270isl.isl_multi_val_scale_down_val.restype = c_void_p 11271isl.isl_multi_val_scale_down_val.argtypes = [c_void_p, c_void_p] 11272isl.isl_multi_val_set_at.restype = c_void_p 11273isl.isl_multi_val_set_at.argtypes = [c_void_p, c_int, c_void_p] 11274isl.isl_multi_val_size.argtypes = [c_void_p] 11275isl.isl_multi_val_sub.restype = c_void_p 11276isl.isl_multi_val_sub.argtypes = [c_void_p, c_void_p] 11277isl.isl_multi_val_zero.restype = c_void_p 11278isl.isl_multi_val_zero.argtypes = [c_void_p] 11279isl.isl_multi_val_copy.restype = c_void_p 11280isl.isl_multi_val_copy.argtypes = [c_void_p] 11281isl.isl_multi_val_free.restype = c_void_p 11282isl.isl_multi_val_free.argtypes = [c_void_p] 11283isl.isl_multi_val_to_str.restype = POINTER(c_char) 11284isl.isl_multi_val_to_str.argtypes = [c_void_p] 11285 11286class point(basic_set): 11287 def __init__(self, *args, **keywords): 11288 if "ptr" in keywords: 11289 self.ctx = keywords["ctx"] 11290 self.ptr = keywords["ptr"] 11291 return 11292 raise Error 11293 def __del__(self): 11294 if hasattr(self, 'ptr'): 11295 isl.isl_point_free(self.ptr) 11296 def __str__(arg0): 11297 try: 11298 if not arg0.__class__ is point: 11299 arg0 = point(arg0) 11300 except: 11301 raise 11302 ptr = isl.isl_point_to_str(arg0.ptr) 11303 res = cast(ptr, c_char_p).value.decode('ascii') 11304 libc.free(ptr) 11305 return res 11306 def __repr__(self): 11307 s = str(self) 11308 if '"' in s: 11309 return 'isl.point("""%s""")' % s 11310 else: 11311 return 'isl.point("%s")' % s 11312 def multi_val(arg0): 11313 try: 11314 if not arg0.__class__ is point: 11315 arg0 = point(arg0) 11316 except: 11317 raise 11318 ctx = arg0.ctx 11319 res = isl.isl_point_get_multi_val(arg0.ptr) 11320 obj = multi_val(ctx=ctx, ptr=res) 11321 return obj 11322 def get_multi_val(arg0): 11323 return arg0.multi_val() 11324 11325isl.isl_point_get_multi_val.restype = c_void_p 11326isl.isl_point_get_multi_val.argtypes = [c_void_p] 11327isl.isl_point_copy.restype = c_void_p 11328isl.isl_point_copy.argtypes = [c_void_p] 11329isl.isl_point_free.restype = c_void_p 11330isl.isl_point_free.argtypes = [c_void_p] 11331isl.isl_point_to_str.restype = POINTER(c_char) 11332isl.isl_point_to_str.argtypes = [c_void_p] 11333 11334class pw_aff_list(object): 11335 def __init__(self, *args, **keywords): 11336 if "ptr" in keywords: 11337 self.ctx = keywords["ctx"] 11338 self.ptr = keywords["ptr"] 11339 return 11340 if len(args) == 1 and type(args[0]) == int: 11341 self.ctx = Context.getDefaultInstance() 11342 self.ptr = isl.isl_pw_aff_list_alloc(self.ctx, args[0]) 11343 return 11344 if len(args) == 1 and args[0].__class__ is pw_aff: 11345 self.ctx = Context.getDefaultInstance() 11346 self.ptr = isl.isl_pw_aff_list_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 11347 return 11348 raise Error 11349 def __del__(self): 11350 if hasattr(self, 'ptr'): 11351 isl.isl_pw_aff_list_free(self.ptr) 11352 def __str__(arg0): 11353 try: 11354 if not arg0.__class__ is pw_aff_list: 11355 arg0 = pw_aff_list(arg0) 11356 except: 11357 raise 11358 ptr = isl.isl_pw_aff_list_to_str(arg0.ptr) 11359 res = cast(ptr, c_char_p).value.decode('ascii') 11360 libc.free(ptr) 11361 return res 11362 def __repr__(self): 11363 s = str(self) 11364 if '"' in s: 11365 return 'isl.pw_aff_list("""%s""")' % s 11366 else: 11367 return 'isl.pw_aff_list("%s")' % s 11368 def add(arg0, arg1): 11369 try: 11370 if not arg0.__class__ is pw_aff_list: 11371 arg0 = pw_aff_list(arg0) 11372 except: 11373 raise 11374 try: 11375 if not arg1.__class__ is pw_aff: 11376 arg1 = pw_aff(arg1) 11377 except: 11378 raise 11379 ctx = arg0.ctx 11380 res = isl.isl_pw_aff_list_add(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 11381 obj = pw_aff_list(ctx=ctx, ptr=res) 11382 return obj 11383 def clear(arg0): 11384 try: 11385 if not arg0.__class__ is pw_aff_list: 11386 arg0 = pw_aff_list(arg0) 11387 except: 11388 raise 11389 ctx = arg0.ctx 11390 res = isl.isl_pw_aff_list_clear(isl.isl_pw_aff_list_copy(arg0.ptr)) 11391 obj = pw_aff_list(ctx=ctx, ptr=res) 11392 return obj 11393 def concat(arg0, arg1): 11394 try: 11395 if not arg0.__class__ is pw_aff_list: 11396 arg0 = pw_aff_list(arg0) 11397 except: 11398 raise 11399 try: 11400 if not arg1.__class__ is pw_aff_list: 11401 arg1 = pw_aff_list(arg1) 11402 except: 11403 raise 11404 ctx = arg0.ctx 11405 res = isl.isl_pw_aff_list_concat(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_list_copy(arg1.ptr)) 11406 obj = pw_aff_list(ctx=ctx, ptr=res) 11407 return obj 11408 def drop(arg0, arg1, arg2): 11409 try: 11410 if not arg0.__class__ is pw_aff_list: 11411 arg0 = pw_aff_list(arg0) 11412 except: 11413 raise 11414 ctx = arg0.ctx 11415 res = isl.isl_pw_aff_list_drop(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, arg2) 11416 obj = pw_aff_list(ctx=ctx, ptr=res) 11417 return obj 11418 def foreach(arg0, arg1): 11419 try: 11420 if not arg0.__class__ is pw_aff_list: 11421 arg0 = pw_aff_list(arg0) 11422 except: 11423 raise 11424 exc_info = [None] 11425 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11426 def cb_func(cb_arg0, cb_arg1): 11427 cb_arg0 = pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 11428 try: 11429 arg1(cb_arg0) 11430 except: 11431 import sys 11432 exc_info[0] = sys.exc_info() 11433 return -1 11434 return 0 11435 cb = fn(cb_func) 11436 ctx = arg0.ctx 11437 res = isl.isl_pw_aff_list_foreach(arg0.ptr, cb, None) 11438 if exc_info[0] != None: 11439 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 11440 if res < 0: 11441 raise 11442 def at(arg0, arg1): 11443 try: 11444 if not arg0.__class__ is pw_aff_list: 11445 arg0 = pw_aff_list(arg0) 11446 except: 11447 raise 11448 ctx = arg0.ctx 11449 res = isl.isl_pw_aff_list_get_at(arg0.ptr, arg1) 11450 obj = pw_aff(ctx=ctx, ptr=res) 11451 return obj 11452 def get_at(arg0, arg1): 11453 return arg0.at(arg1) 11454 def insert(arg0, arg1, arg2): 11455 try: 11456 if not arg0.__class__ is pw_aff_list: 11457 arg0 = pw_aff_list(arg0) 11458 except: 11459 raise 11460 try: 11461 if not arg2.__class__ is pw_aff: 11462 arg2 = pw_aff(arg2) 11463 except: 11464 raise 11465 ctx = arg0.ctx 11466 res = isl.isl_pw_aff_list_insert(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 11467 obj = pw_aff_list(ctx=ctx, ptr=res) 11468 return obj 11469 def size(arg0): 11470 try: 11471 if not arg0.__class__ is pw_aff_list: 11472 arg0 = pw_aff_list(arg0) 11473 except: 11474 raise 11475 ctx = arg0.ctx 11476 res = isl.isl_pw_aff_list_size(arg0.ptr) 11477 if res < 0: 11478 raise 11479 return int(res) 11480 11481isl.isl_pw_aff_list_alloc.restype = c_void_p 11482isl.isl_pw_aff_list_alloc.argtypes = [Context, c_int] 11483isl.isl_pw_aff_list_from_pw_aff.restype = c_void_p 11484isl.isl_pw_aff_list_from_pw_aff.argtypes = [c_void_p] 11485isl.isl_pw_aff_list_add.restype = c_void_p 11486isl.isl_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 11487isl.isl_pw_aff_list_clear.restype = c_void_p 11488isl.isl_pw_aff_list_clear.argtypes = [c_void_p] 11489isl.isl_pw_aff_list_concat.restype = c_void_p 11490isl.isl_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 11491isl.isl_pw_aff_list_drop.restype = c_void_p 11492isl.isl_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 11493isl.isl_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 11494isl.isl_pw_aff_list_get_at.restype = c_void_p 11495isl.isl_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 11496isl.isl_pw_aff_list_insert.restype = c_void_p 11497isl.isl_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 11498isl.isl_pw_aff_list_size.argtypes = [c_void_p] 11499isl.isl_pw_aff_list_copy.restype = c_void_p 11500isl.isl_pw_aff_list_copy.argtypes = [c_void_p] 11501isl.isl_pw_aff_list_free.restype = c_void_p 11502isl.isl_pw_aff_list_free.argtypes = [c_void_p] 11503isl.isl_pw_aff_list_to_str.restype = POINTER(c_char) 11504isl.isl_pw_aff_list_to_str.argtypes = [c_void_p] 11505 11506class pw_multi_aff_list(object): 11507 def __init__(self, *args, **keywords): 11508 if "ptr" in keywords: 11509 self.ctx = keywords["ctx"] 11510 self.ptr = keywords["ptr"] 11511 return 11512 if len(args) == 1 and type(args[0]) == int: 11513 self.ctx = Context.getDefaultInstance() 11514 self.ptr = isl.isl_pw_multi_aff_list_alloc(self.ctx, args[0]) 11515 return 11516 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 11517 self.ctx = Context.getDefaultInstance() 11518 self.ptr = isl.isl_pw_multi_aff_list_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 11519 return 11520 raise Error 11521 def __del__(self): 11522 if hasattr(self, 'ptr'): 11523 isl.isl_pw_multi_aff_list_free(self.ptr) 11524 def __str__(arg0): 11525 try: 11526 if not arg0.__class__ is pw_multi_aff_list: 11527 arg0 = pw_multi_aff_list(arg0) 11528 except: 11529 raise 11530 ptr = isl.isl_pw_multi_aff_list_to_str(arg0.ptr) 11531 res = cast(ptr, c_char_p).value.decode('ascii') 11532 libc.free(ptr) 11533 return res 11534 def __repr__(self): 11535 s = str(self) 11536 if '"' in s: 11537 return 'isl.pw_multi_aff_list("""%s""")' % s 11538 else: 11539 return 'isl.pw_multi_aff_list("%s")' % s 11540 def add(arg0, arg1): 11541 try: 11542 if not arg0.__class__ is pw_multi_aff_list: 11543 arg0 = pw_multi_aff_list(arg0) 11544 except: 11545 raise 11546 try: 11547 if not arg1.__class__ is pw_multi_aff: 11548 arg1 = pw_multi_aff(arg1) 11549 except: 11550 raise 11551 ctx = arg0.ctx 11552 res = isl.isl_pw_multi_aff_list_add(isl.isl_pw_multi_aff_list_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 11553 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 11554 return obj 11555 def clear(arg0): 11556 try: 11557 if not arg0.__class__ is pw_multi_aff_list: 11558 arg0 = pw_multi_aff_list(arg0) 11559 except: 11560 raise 11561 ctx = arg0.ctx 11562 res = isl.isl_pw_multi_aff_list_clear(isl.isl_pw_multi_aff_list_copy(arg0.ptr)) 11563 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 11564 return obj 11565 def concat(arg0, arg1): 11566 try: 11567 if not arg0.__class__ is pw_multi_aff_list: 11568 arg0 = pw_multi_aff_list(arg0) 11569 except: 11570 raise 11571 try: 11572 if not arg1.__class__ is pw_multi_aff_list: 11573 arg1 = pw_multi_aff_list(arg1) 11574 except: 11575 raise 11576 ctx = arg0.ctx 11577 res = isl.isl_pw_multi_aff_list_concat(isl.isl_pw_multi_aff_list_copy(arg0.ptr), isl.isl_pw_multi_aff_list_copy(arg1.ptr)) 11578 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 11579 return obj 11580 def drop(arg0, arg1, arg2): 11581 try: 11582 if not arg0.__class__ is pw_multi_aff_list: 11583 arg0 = pw_multi_aff_list(arg0) 11584 except: 11585 raise 11586 ctx = arg0.ctx 11587 res = isl.isl_pw_multi_aff_list_drop(isl.isl_pw_multi_aff_list_copy(arg0.ptr), arg1, arg2) 11588 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 11589 return obj 11590 def foreach(arg0, arg1): 11591 try: 11592 if not arg0.__class__ is pw_multi_aff_list: 11593 arg0 = pw_multi_aff_list(arg0) 11594 except: 11595 raise 11596 exc_info = [None] 11597 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11598 def cb_func(cb_arg0, cb_arg1): 11599 cb_arg0 = pw_multi_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 11600 try: 11601 arg1(cb_arg0) 11602 except: 11603 import sys 11604 exc_info[0] = sys.exc_info() 11605 return -1 11606 return 0 11607 cb = fn(cb_func) 11608 ctx = arg0.ctx 11609 res = isl.isl_pw_multi_aff_list_foreach(arg0.ptr, cb, None) 11610 if exc_info[0] != None: 11611 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 11612 if res < 0: 11613 raise 11614 def at(arg0, arg1): 11615 try: 11616 if not arg0.__class__ is pw_multi_aff_list: 11617 arg0 = pw_multi_aff_list(arg0) 11618 except: 11619 raise 11620 ctx = arg0.ctx 11621 res = isl.isl_pw_multi_aff_list_get_at(arg0.ptr, arg1) 11622 obj = pw_multi_aff(ctx=ctx, ptr=res) 11623 return obj 11624 def get_at(arg0, arg1): 11625 return arg0.at(arg1) 11626 def insert(arg0, arg1, arg2): 11627 try: 11628 if not arg0.__class__ is pw_multi_aff_list: 11629 arg0 = pw_multi_aff_list(arg0) 11630 except: 11631 raise 11632 try: 11633 if not arg2.__class__ is pw_multi_aff: 11634 arg2 = pw_multi_aff(arg2) 11635 except: 11636 raise 11637 ctx = arg0.ctx 11638 res = isl.isl_pw_multi_aff_list_insert(isl.isl_pw_multi_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_multi_aff_copy(arg2.ptr)) 11639 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 11640 return obj 11641 def size(arg0): 11642 try: 11643 if not arg0.__class__ is pw_multi_aff_list: 11644 arg0 = pw_multi_aff_list(arg0) 11645 except: 11646 raise 11647 ctx = arg0.ctx 11648 res = isl.isl_pw_multi_aff_list_size(arg0.ptr) 11649 if res < 0: 11650 raise 11651 return int(res) 11652 11653isl.isl_pw_multi_aff_list_alloc.restype = c_void_p 11654isl.isl_pw_multi_aff_list_alloc.argtypes = [Context, c_int] 11655isl.isl_pw_multi_aff_list_from_pw_multi_aff.restype = c_void_p 11656isl.isl_pw_multi_aff_list_from_pw_multi_aff.argtypes = [c_void_p] 11657isl.isl_pw_multi_aff_list_add.restype = c_void_p 11658isl.isl_pw_multi_aff_list_add.argtypes = [c_void_p, c_void_p] 11659isl.isl_pw_multi_aff_list_clear.restype = c_void_p 11660isl.isl_pw_multi_aff_list_clear.argtypes = [c_void_p] 11661isl.isl_pw_multi_aff_list_concat.restype = c_void_p 11662isl.isl_pw_multi_aff_list_concat.argtypes = [c_void_p, c_void_p] 11663isl.isl_pw_multi_aff_list_drop.restype = c_void_p 11664isl.isl_pw_multi_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 11665isl.isl_pw_multi_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 11666isl.isl_pw_multi_aff_list_get_at.restype = c_void_p 11667isl.isl_pw_multi_aff_list_get_at.argtypes = [c_void_p, c_int] 11668isl.isl_pw_multi_aff_list_insert.restype = c_void_p 11669isl.isl_pw_multi_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 11670isl.isl_pw_multi_aff_list_size.argtypes = [c_void_p] 11671isl.isl_pw_multi_aff_list_copy.restype = c_void_p 11672isl.isl_pw_multi_aff_list_copy.argtypes = [c_void_p] 11673isl.isl_pw_multi_aff_list_free.restype = c_void_p 11674isl.isl_pw_multi_aff_list_free.argtypes = [c_void_p] 11675isl.isl_pw_multi_aff_list_to_str.restype = POINTER(c_char) 11676isl.isl_pw_multi_aff_list_to_str.argtypes = [c_void_p] 11677 11678class schedule(object): 11679 def __init__(self, *args, **keywords): 11680 if "ptr" in keywords: 11681 self.ctx = keywords["ctx"] 11682 self.ptr = keywords["ptr"] 11683 return 11684 if len(args) == 1 and type(args[0]) == str: 11685 self.ctx = Context.getDefaultInstance() 11686 self.ptr = isl.isl_schedule_read_from_str(self.ctx, args[0].encode('ascii')) 11687 return 11688 raise Error 11689 def __del__(self): 11690 if hasattr(self, 'ptr'): 11691 isl.isl_schedule_free(self.ptr) 11692 def __str__(arg0): 11693 try: 11694 if not arg0.__class__ is schedule: 11695 arg0 = schedule(arg0) 11696 except: 11697 raise 11698 ptr = isl.isl_schedule_to_str(arg0.ptr) 11699 res = cast(ptr, c_char_p).value.decode('ascii') 11700 libc.free(ptr) 11701 return res 11702 def __repr__(self): 11703 s = str(self) 11704 if '"' in s: 11705 return 'isl.schedule("""%s""")' % s 11706 else: 11707 return 'isl.schedule("%s")' % s 11708 @staticmethod 11709 def from_domain(arg0): 11710 try: 11711 if not arg0.__class__ is union_set: 11712 arg0 = union_set(arg0) 11713 except: 11714 raise 11715 ctx = arg0.ctx 11716 res = isl.isl_schedule_from_domain(isl.isl_union_set_copy(arg0.ptr)) 11717 obj = schedule(ctx=ctx, ptr=res) 11718 return obj 11719 def domain(arg0): 11720 try: 11721 if not arg0.__class__ is schedule: 11722 arg0 = schedule(arg0) 11723 except: 11724 raise 11725 ctx = arg0.ctx 11726 res = isl.isl_schedule_get_domain(arg0.ptr) 11727 obj = union_set(ctx=ctx, ptr=res) 11728 return obj 11729 def get_domain(arg0): 11730 return arg0.domain() 11731 def map(arg0): 11732 try: 11733 if not arg0.__class__ is schedule: 11734 arg0 = schedule(arg0) 11735 except: 11736 raise 11737 ctx = arg0.ctx 11738 res = isl.isl_schedule_get_map(arg0.ptr) 11739 obj = union_map(ctx=ctx, ptr=res) 11740 return obj 11741 def get_map(arg0): 11742 return arg0.map() 11743 def root(arg0): 11744 try: 11745 if not arg0.__class__ is schedule: 11746 arg0 = schedule(arg0) 11747 except: 11748 raise 11749 ctx = arg0.ctx 11750 res = isl.isl_schedule_get_root(arg0.ptr) 11751 obj = schedule_node(ctx=ctx, ptr=res) 11752 return obj 11753 def get_root(arg0): 11754 return arg0.root() 11755 def pullback(*args): 11756 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 11757 ctx = args[0].ctx 11758 res = isl.isl_schedule_pullback_union_pw_multi_aff(isl.isl_schedule_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 11759 obj = schedule(ctx=ctx, ptr=res) 11760 return obj 11761 raise Error 11762 11763isl.isl_schedule_read_from_str.restype = c_void_p 11764isl.isl_schedule_read_from_str.argtypes = [Context, c_char_p] 11765isl.isl_schedule_from_domain.restype = c_void_p 11766isl.isl_schedule_from_domain.argtypes = [c_void_p] 11767isl.isl_schedule_get_domain.restype = c_void_p 11768isl.isl_schedule_get_domain.argtypes = [c_void_p] 11769isl.isl_schedule_get_map.restype = c_void_p 11770isl.isl_schedule_get_map.argtypes = [c_void_p] 11771isl.isl_schedule_get_root.restype = c_void_p 11772isl.isl_schedule_get_root.argtypes = [c_void_p] 11773isl.isl_schedule_pullback_union_pw_multi_aff.restype = c_void_p 11774isl.isl_schedule_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 11775isl.isl_schedule_copy.restype = c_void_p 11776isl.isl_schedule_copy.argtypes = [c_void_p] 11777isl.isl_schedule_free.restype = c_void_p 11778isl.isl_schedule_free.argtypes = [c_void_p] 11779isl.isl_schedule_to_str.restype = POINTER(c_char) 11780isl.isl_schedule_to_str.argtypes = [c_void_p] 11781 11782class schedule_constraints(object): 11783 def __init__(self, *args, **keywords): 11784 if "ptr" in keywords: 11785 self.ctx = keywords["ctx"] 11786 self.ptr = keywords["ptr"] 11787 return 11788 if len(args) == 1 and type(args[0]) == str: 11789 self.ctx = Context.getDefaultInstance() 11790 self.ptr = isl.isl_schedule_constraints_read_from_str(self.ctx, args[0].encode('ascii')) 11791 return 11792 raise Error 11793 def __del__(self): 11794 if hasattr(self, 'ptr'): 11795 isl.isl_schedule_constraints_free(self.ptr) 11796 def __str__(arg0): 11797 try: 11798 if not arg0.__class__ is schedule_constraints: 11799 arg0 = schedule_constraints(arg0) 11800 except: 11801 raise 11802 ptr = isl.isl_schedule_constraints_to_str(arg0.ptr) 11803 res = cast(ptr, c_char_p).value.decode('ascii') 11804 libc.free(ptr) 11805 return res 11806 def __repr__(self): 11807 s = str(self) 11808 if '"' in s: 11809 return 'isl.schedule_constraints("""%s""")' % s 11810 else: 11811 return 'isl.schedule_constraints("%s")' % s 11812 def compute_schedule(arg0): 11813 try: 11814 if not arg0.__class__ is schedule_constraints: 11815 arg0 = schedule_constraints(arg0) 11816 except: 11817 raise 11818 ctx = arg0.ctx 11819 res = isl.isl_schedule_constraints_compute_schedule(isl.isl_schedule_constraints_copy(arg0.ptr)) 11820 obj = schedule(ctx=ctx, ptr=res) 11821 return obj 11822 def coincidence(arg0): 11823 try: 11824 if not arg0.__class__ is schedule_constraints: 11825 arg0 = schedule_constraints(arg0) 11826 except: 11827 raise 11828 ctx = arg0.ctx 11829 res = isl.isl_schedule_constraints_get_coincidence(arg0.ptr) 11830 obj = union_map(ctx=ctx, ptr=res) 11831 return obj 11832 def get_coincidence(arg0): 11833 return arg0.coincidence() 11834 def conditional_validity(arg0): 11835 try: 11836 if not arg0.__class__ is schedule_constraints: 11837 arg0 = schedule_constraints(arg0) 11838 except: 11839 raise 11840 ctx = arg0.ctx 11841 res = isl.isl_schedule_constraints_get_conditional_validity(arg0.ptr) 11842 obj = union_map(ctx=ctx, ptr=res) 11843 return obj 11844 def get_conditional_validity(arg0): 11845 return arg0.conditional_validity() 11846 def conditional_validity_condition(arg0): 11847 try: 11848 if not arg0.__class__ is schedule_constraints: 11849 arg0 = schedule_constraints(arg0) 11850 except: 11851 raise 11852 ctx = arg0.ctx 11853 res = isl.isl_schedule_constraints_get_conditional_validity_condition(arg0.ptr) 11854 obj = union_map(ctx=ctx, ptr=res) 11855 return obj 11856 def get_conditional_validity_condition(arg0): 11857 return arg0.conditional_validity_condition() 11858 def context(arg0): 11859 try: 11860 if not arg0.__class__ is schedule_constraints: 11861 arg0 = schedule_constraints(arg0) 11862 except: 11863 raise 11864 ctx = arg0.ctx 11865 res = isl.isl_schedule_constraints_get_context(arg0.ptr) 11866 obj = set(ctx=ctx, ptr=res) 11867 return obj 11868 def get_context(arg0): 11869 return arg0.context() 11870 def domain(arg0): 11871 try: 11872 if not arg0.__class__ is schedule_constraints: 11873 arg0 = schedule_constraints(arg0) 11874 except: 11875 raise 11876 ctx = arg0.ctx 11877 res = isl.isl_schedule_constraints_get_domain(arg0.ptr) 11878 obj = union_set(ctx=ctx, ptr=res) 11879 return obj 11880 def get_domain(arg0): 11881 return arg0.domain() 11882 def proximity(arg0): 11883 try: 11884 if not arg0.__class__ is schedule_constraints: 11885 arg0 = schedule_constraints(arg0) 11886 except: 11887 raise 11888 ctx = arg0.ctx 11889 res = isl.isl_schedule_constraints_get_proximity(arg0.ptr) 11890 obj = union_map(ctx=ctx, ptr=res) 11891 return obj 11892 def get_proximity(arg0): 11893 return arg0.proximity() 11894 def validity(arg0): 11895 try: 11896 if not arg0.__class__ is schedule_constraints: 11897 arg0 = schedule_constraints(arg0) 11898 except: 11899 raise 11900 ctx = arg0.ctx 11901 res = isl.isl_schedule_constraints_get_validity(arg0.ptr) 11902 obj = union_map(ctx=ctx, ptr=res) 11903 return obj 11904 def get_validity(arg0): 11905 return arg0.validity() 11906 @staticmethod 11907 def on_domain(arg0): 11908 try: 11909 if not arg0.__class__ is union_set: 11910 arg0 = union_set(arg0) 11911 except: 11912 raise 11913 ctx = arg0.ctx 11914 res = isl.isl_schedule_constraints_on_domain(isl.isl_union_set_copy(arg0.ptr)) 11915 obj = schedule_constraints(ctx=ctx, ptr=res) 11916 return obj 11917 def set_coincidence(arg0, arg1): 11918 try: 11919 if not arg0.__class__ is schedule_constraints: 11920 arg0 = schedule_constraints(arg0) 11921 except: 11922 raise 11923 try: 11924 if not arg1.__class__ is union_map: 11925 arg1 = union_map(arg1) 11926 except: 11927 raise 11928 ctx = arg0.ctx 11929 res = isl.isl_schedule_constraints_set_coincidence(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 11930 obj = schedule_constraints(ctx=ctx, ptr=res) 11931 return obj 11932 def set_conditional_validity(arg0, arg1, arg2): 11933 try: 11934 if not arg0.__class__ is schedule_constraints: 11935 arg0 = schedule_constraints(arg0) 11936 except: 11937 raise 11938 try: 11939 if not arg1.__class__ is union_map: 11940 arg1 = union_map(arg1) 11941 except: 11942 raise 11943 try: 11944 if not arg2.__class__ is union_map: 11945 arg2 = union_map(arg2) 11946 except: 11947 raise 11948 ctx = arg0.ctx 11949 res = isl.isl_schedule_constraints_set_conditional_validity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr), isl.isl_union_map_copy(arg2.ptr)) 11950 obj = schedule_constraints(ctx=ctx, ptr=res) 11951 return obj 11952 def set_context(arg0, arg1): 11953 try: 11954 if not arg0.__class__ is schedule_constraints: 11955 arg0 = schedule_constraints(arg0) 11956 except: 11957 raise 11958 try: 11959 if not arg1.__class__ is set: 11960 arg1 = set(arg1) 11961 except: 11962 raise 11963 ctx = arg0.ctx 11964 res = isl.isl_schedule_constraints_set_context(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11965 obj = schedule_constraints(ctx=ctx, ptr=res) 11966 return obj 11967 def set_proximity(arg0, arg1): 11968 try: 11969 if not arg0.__class__ is schedule_constraints: 11970 arg0 = schedule_constraints(arg0) 11971 except: 11972 raise 11973 try: 11974 if not arg1.__class__ is union_map: 11975 arg1 = union_map(arg1) 11976 except: 11977 raise 11978 ctx = arg0.ctx 11979 res = isl.isl_schedule_constraints_set_proximity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 11980 obj = schedule_constraints(ctx=ctx, ptr=res) 11981 return obj 11982 def set_validity(arg0, arg1): 11983 try: 11984 if not arg0.__class__ is schedule_constraints: 11985 arg0 = schedule_constraints(arg0) 11986 except: 11987 raise 11988 try: 11989 if not arg1.__class__ is union_map: 11990 arg1 = union_map(arg1) 11991 except: 11992 raise 11993 ctx = arg0.ctx 11994 res = isl.isl_schedule_constraints_set_validity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 11995 obj = schedule_constraints(ctx=ctx, ptr=res) 11996 return obj 11997 11998isl.isl_schedule_constraints_read_from_str.restype = c_void_p 11999isl.isl_schedule_constraints_read_from_str.argtypes = [Context, c_char_p] 12000isl.isl_schedule_constraints_compute_schedule.restype = c_void_p 12001isl.isl_schedule_constraints_compute_schedule.argtypes = [c_void_p] 12002isl.isl_schedule_constraints_get_coincidence.restype = c_void_p 12003isl.isl_schedule_constraints_get_coincidence.argtypes = [c_void_p] 12004isl.isl_schedule_constraints_get_conditional_validity.restype = c_void_p 12005isl.isl_schedule_constraints_get_conditional_validity.argtypes = [c_void_p] 12006isl.isl_schedule_constraints_get_conditional_validity_condition.restype = c_void_p 12007isl.isl_schedule_constraints_get_conditional_validity_condition.argtypes = [c_void_p] 12008isl.isl_schedule_constraints_get_context.restype = c_void_p 12009isl.isl_schedule_constraints_get_context.argtypes = [c_void_p] 12010isl.isl_schedule_constraints_get_domain.restype = c_void_p 12011isl.isl_schedule_constraints_get_domain.argtypes = [c_void_p] 12012isl.isl_schedule_constraints_get_proximity.restype = c_void_p 12013isl.isl_schedule_constraints_get_proximity.argtypes = [c_void_p] 12014isl.isl_schedule_constraints_get_validity.restype = c_void_p 12015isl.isl_schedule_constraints_get_validity.argtypes = [c_void_p] 12016isl.isl_schedule_constraints_on_domain.restype = c_void_p 12017isl.isl_schedule_constraints_on_domain.argtypes = [c_void_p] 12018isl.isl_schedule_constraints_set_coincidence.restype = c_void_p 12019isl.isl_schedule_constraints_set_coincidence.argtypes = [c_void_p, c_void_p] 12020isl.isl_schedule_constraints_set_conditional_validity.restype = c_void_p 12021isl.isl_schedule_constraints_set_conditional_validity.argtypes = [c_void_p, c_void_p, c_void_p] 12022isl.isl_schedule_constraints_set_context.restype = c_void_p 12023isl.isl_schedule_constraints_set_context.argtypes = [c_void_p, c_void_p] 12024isl.isl_schedule_constraints_set_proximity.restype = c_void_p 12025isl.isl_schedule_constraints_set_proximity.argtypes = [c_void_p, c_void_p] 12026isl.isl_schedule_constraints_set_validity.restype = c_void_p 12027isl.isl_schedule_constraints_set_validity.argtypes = [c_void_p, c_void_p] 12028isl.isl_schedule_constraints_copy.restype = c_void_p 12029isl.isl_schedule_constraints_copy.argtypes = [c_void_p] 12030isl.isl_schedule_constraints_free.restype = c_void_p 12031isl.isl_schedule_constraints_free.argtypes = [c_void_p] 12032isl.isl_schedule_constraints_to_str.restype = POINTER(c_char) 12033isl.isl_schedule_constraints_to_str.argtypes = [c_void_p] 12034 12035class schedule_node(object): 12036 def __init__(self, *args, **keywords): 12037 if "ptr" in keywords: 12038 self.ctx = keywords["ctx"] 12039 self.ptr = keywords["ptr"] 12040 return 12041 if len(args) == 1 and isinstance(args[0], schedule_node_band): 12042 self.ctx = args[0].ctx 12043 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12044 return 12045 if len(args) == 1 and isinstance(args[0], schedule_node_context): 12046 self.ctx = args[0].ctx 12047 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12048 return 12049 if len(args) == 1 and isinstance(args[0], schedule_node_domain): 12050 self.ctx = args[0].ctx 12051 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12052 return 12053 if len(args) == 1 and isinstance(args[0], schedule_node_expansion): 12054 self.ctx = args[0].ctx 12055 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12056 return 12057 if len(args) == 1 and isinstance(args[0], schedule_node_extension): 12058 self.ctx = args[0].ctx 12059 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12060 return 12061 if len(args) == 1 and isinstance(args[0], schedule_node_filter): 12062 self.ctx = args[0].ctx 12063 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12064 return 12065 if len(args) == 1 and isinstance(args[0], schedule_node_leaf): 12066 self.ctx = args[0].ctx 12067 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12068 return 12069 if len(args) == 1 and isinstance(args[0], schedule_node_guard): 12070 self.ctx = args[0].ctx 12071 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12072 return 12073 if len(args) == 1 and isinstance(args[0], schedule_node_mark): 12074 self.ctx = args[0].ctx 12075 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12076 return 12077 if len(args) == 1 and isinstance(args[0], schedule_node_sequence): 12078 self.ctx = args[0].ctx 12079 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12080 return 12081 if len(args) == 1 and isinstance(args[0], schedule_node_set): 12082 self.ctx = args[0].ctx 12083 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 12084 return 12085 raise Error 12086 def __del__(self): 12087 if hasattr(self, 'ptr'): 12088 isl.isl_schedule_node_free(self.ptr) 12089 def __new__(cls, *args, **keywords): 12090 if "ptr" in keywords: 12091 type = isl.isl_schedule_node_get_type(keywords["ptr"]) 12092 if type == 0: 12093 return schedule_node_band(**keywords) 12094 if type == 1: 12095 return schedule_node_context(**keywords) 12096 if type == 2: 12097 return schedule_node_domain(**keywords) 12098 if type == 3: 12099 return schedule_node_expansion(**keywords) 12100 if type == 4: 12101 return schedule_node_extension(**keywords) 12102 if type == 5: 12103 return schedule_node_filter(**keywords) 12104 if type == 6: 12105 return schedule_node_leaf(**keywords) 12106 if type == 7: 12107 return schedule_node_guard(**keywords) 12108 if type == 8: 12109 return schedule_node_mark(**keywords) 12110 if type == 9: 12111 return schedule_node_sequence(**keywords) 12112 if type == 10: 12113 return schedule_node_set(**keywords) 12114 raise 12115 return super(schedule_node, cls).__new__(cls) 12116 def __str__(arg0): 12117 try: 12118 if not arg0.__class__ is schedule_node: 12119 arg0 = schedule_node(arg0) 12120 except: 12121 raise 12122 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 12123 res = cast(ptr, c_char_p).value.decode('ascii') 12124 libc.free(ptr) 12125 return res 12126 def __repr__(self): 12127 s = str(self) 12128 if '"' in s: 12129 return 'isl.schedule_node("""%s""")' % s 12130 else: 12131 return 'isl.schedule_node("%s")' % s 12132 def ancestor(arg0, arg1): 12133 try: 12134 if not arg0.__class__ is schedule_node: 12135 arg0 = schedule_node(arg0) 12136 except: 12137 raise 12138 ctx = arg0.ctx 12139 res = isl.isl_schedule_node_ancestor(isl.isl_schedule_node_copy(arg0.ptr), arg1) 12140 obj = schedule_node(ctx=ctx, ptr=res) 12141 return obj 12142 def child(arg0, arg1): 12143 try: 12144 if not arg0.__class__ is schedule_node: 12145 arg0 = schedule_node(arg0) 12146 except: 12147 raise 12148 ctx = arg0.ctx 12149 res = isl.isl_schedule_node_child(isl.isl_schedule_node_copy(arg0.ptr), arg1) 12150 obj = schedule_node(ctx=ctx, ptr=res) 12151 return obj 12152 def every_descendant(arg0, arg1): 12153 try: 12154 if not arg0.__class__ is schedule_node: 12155 arg0 = schedule_node(arg0) 12156 except: 12157 raise 12158 exc_info = [None] 12159 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 12160 def cb_func(cb_arg0, cb_arg1): 12161 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 12162 try: 12163 res = arg1(cb_arg0) 12164 except: 12165 import sys 12166 exc_info[0] = sys.exc_info() 12167 return -1 12168 return 1 if res else 0 12169 cb = fn(cb_func) 12170 ctx = arg0.ctx 12171 res = isl.isl_schedule_node_every_descendant(arg0.ptr, cb, None) 12172 if exc_info[0] != None: 12173 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 12174 if res < 0: 12175 raise 12176 return bool(res) 12177 def first_child(arg0): 12178 try: 12179 if not arg0.__class__ is schedule_node: 12180 arg0 = schedule_node(arg0) 12181 except: 12182 raise 12183 ctx = arg0.ctx 12184 res = isl.isl_schedule_node_first_child(isl.isl_schedule_node_copy(arg0.ptr)) 12185 obj = schedule_node(ctx=ctx, ptr=res) 12186 return obj 12187 def foreach_ancestor_top_down(arg0, arg1): 12188 try: 12189 if not arg0.__class__ is schedule_node: 12190 arg0 = schedule_node(arg0) 12191 except: 12192 raise 12193 exc_info = [None] 12194 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 12195 def cb_func(cb_arg0, cb_arg1): 12196 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 12197 try: 12198 arg1(cb_arg0) 12199 except: 12200 import sys 12201 exc_info[0] = sys.exc_info() 12202 return -1 12203 return 0 12204 cb = fn(cb_func) 12205 ctx = arg0.ctx 12206 res = isl.isl_schedule_node_foreach_ancestor_top_down(arg0.ptr, cb, None) 12207 if exc_info[0] != None: 12208 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 12209 if res < 0: 12210 raise 12211 def foreach_descendant_top_down(arg0, arg1): 12212 try: 12213 if not arg0.__class__ is schedule_node: 12214 arg0 = schedule_node(arg0) 12215 except: 12216 raise 12217 exc_info = [None] 12218 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 12219 def cb_func(cb_arg0, cb_arg1): 12220 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 12221 try: 12222 res = arg1(cb_arg0) 12223 except: 12224 import sys 12225 exc_info[0] = sys.exc_info() 12226 return -1 12227 return 1 if res else 0 12228 cb = fn(cb_func) 12229 ctx = arg0.ctx 12230 res = isl.isl_schedule_node_foreach_descendant_top_down(arg0.ptr, cb, None) 12231 if exc_info[0] != None: 12232 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 12233 if res < 0: 12234 raise 12235 @staticmethod 12236 def from_domain(arg0): 12237 try: 12238 if not arg0.__class__ is union_set: 12239 arg0 = union_set(arg0) 12240 except: 12241 raise 12242 ctx = arg0.ctx 12243 res = isl.isl_schedule_node_from_domain(isl.isl_union_set_copy(arg0.ptr)) 12244 obj = schedule_node(ctx=ctx, ptr=res) 12245 return obj 12246 @staticmethod 12247 def from_extension(arg0): 12248 try: 12249 if not arg0.__class__ is union_map: 12250 arg0 = union_map(arg0) 12251 except: 12252 raise 12253 ctx = arg0.ctx 12254 res = isl.isl_schedule_node_from_extension(isl.isl_union_map_copy(arg0.ptr)) 12255 obj = schedule_node(ctx=ctx, ptr=res) 12256 return obj 12257 def ancestor_child_position(arg0, arg1): 12258 try: 12259 if not arg0.__class__ is schedule_node: 12260 arg0 = schedule_node(arg0) 12261 except: 12262 raise 12263 try: 12264 if not arg1.__class__ is schedule_node: 12265 arg1 = schedule_node(arg1) 12266 except: 12267 raise 12268 ctx = arg0.ctx 12269 res = isl.isl_schedule_node_get_ancestor_child_position(arg0.ptr, arg1.ptr) 12270 if res < 0: 12271 raise 12272 return int(res) 12273 def get_ancestor_child_position(arg0, arg1): 12274 return arg0.ancestor_child_position(arg1) 12275 def child_position(arg0): 12276 try: 12277 if not arg0.__class__ is schedule_node: 12278 arg0 = schedule_node(arg0) 12279 except: 12280 raise 12281 ctx = arg0.ctx 12282 res = isl.isl_schedule_node_get_child_position(arg0.ptr) 12283 if res < 0: 12284 raise 12285 return int(res) 12286 def get_child_position(arg0): 12287 return arg0.child_position() 12288 def prefix_schedule_multi_union_pw_aff(arg0): 12289 try: 12290 if not arg0.__class__ is schedule_node: 12291 arg0 = schedule_node(arg0) 12292 except: 12293 raise 12294 ctx = arg0.ctx 12295 res = isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(arg0.ptr) 12296 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 12297 return obj 12298 def get_prefix_schedule_multi_union_pw_aff(arg0): 12299 return arg0.prefix_schedule_multi_union_pw_aff() 12300 def prefix_schedule_union_map(arg0): 12301 try: 12302 if not arg0.__class__ is schedule_node: 12303 arg0 = schedule_node(arg0) 12304 except: 12305 raise 12306 ctx = arg0.ctx 12307 res = isl.isl_schedule_node_get_prefix_schedule_union_map(arg0.ptr) 12308 obj = union_map(ctx=ctx, ptr=res) 12309 return obj 12310 def get_prefix_schedule_union_map(arg0): 12311 return arg0.prefix_schedule_union_map() 12312 def prefix_schedule_union_pw_multi_aff(arg0): 12313 try: 12314 if not arg0.__class__ is schedule_node: 12315 arg0 = schedule_node(arg0) 12316 except: 12317 raise 12318 ctx = arg0.ctx 12319 res = isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(arg0.ptr) 12320 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 12321 return obj 12322 def get_prefix_schedule_union_pw_multi_aff(arg0): 12323 return arg0.prefix_schedule_union_pw_multi_aff() 12324 def schedule(arg0): 12325 try: 12326 if not arg0.__class__ is schedule_node: 12327 arg0 = schedule_node(arg0) 12328 except: 12329 raise 12330 ctx = arg0.ctx 12331 res = isl.isl_schedule_node_get_schedule(arg0.ptr) 12332 obj = schedule(ctx=ctx, ptr=res) 12333 return obj 12334 def get_schedule(arg0): 12335 return arg0.schedule() 12336 def shared_ancestor(arg0, arg1): 12337 try: 12338 if not arg0.__class__ is schedule_node: 12339 arg0 = schedule_node(arg0) 12340 except: 12341 raise 12342 try: 12343 if not arg1.__class__ is schedule_node: 12344 arg1 = schedule_node(arg1) 12345 except: 12346 raise 12347 ctx = arg0.ctx 12348 res = isl.isl_schedule_node_get_shared_ancestor(arg0.ptr, arg1.ptr) 12349 obj = schedule_node(ctx=ctx, ptr=res) 12350 return obj 12351 def get_shared_ancestor(arg0, arg1): 12352 return arg0.shared_ancestor(arg1) 12353 def tree_depth(arg0): 12354 try: 12355 if not arg0.__class__ is schedule_node: 12356 arg0 = schedule_node(arg0) 12357 except: 12358 raise 12359 ctx = arg0.ctx 12360 res = isl.isl_schedule_node_get_tree_depth(arg0.ptr) 12361 if res < 0: 12362 raise 12363 return int(res) 12364 def get_tree_depth(arg0): 12365 return arg0.tree_depth() 12366 def graft_after(arg0, arg1): 12367 try: 12368 if not arg0.__class__ is schedule_node: 12369 arg0 = schedule_node(arg0) 12370 except: 12371 raise 12372 try: 12373 if not arg1.__class__ is schedule_node: 12374 arg1 = schedule_node(arg1) 12375 except: 12376 raise 12377 ctx = arg0.ctx 12378 res = isl.isl_schedule_node_graft_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 12379 obj = schedule_node(ctx=ctx, ptr=res) 12380 return obj 12381 def graft_before(arg0, arg1): 12382 try: 12383 if not arg0.__class__ is schedule_node: 12384 arg0 = schedule_node(arg0) 12385 except: 12386 raise 12387 try: 12388 if not arg1.__class__ is schedule_node: 12389 arg1 = schedule_node(arg1) 12390 except: 12391 raise 12392 ctx = arg0.ctx 12393 res = isl.isl_schedule_node_graft_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 12394 obj = schedule_node(ctx=ctx, ptr=res) 12395 return obj 12396 def has_children(arg0): 12397 try: 12398 if not arg0.__class__ is schedule_node: 12399 arg0 = schedule_node(arg0) 12400 except: 12401 raise 12402 ctx = arg0.ctx 12403 res = isl.isl_schedule_node_has_children(arg0.ptr) 12404 if res < 0: 12405 raise 12406 return bool(res) 12407 def has_next_sibling(arg0): 12408 try: 12409 if not arg0.__class__ is schedule_node: 12410 arg0 = schedule_node(arg0) 12411 except: 12412 raise 12413 ctx = arg0.ctx 12414 res = isl.isl_schedule_node_has_next_sibling(arg0.ptr) 12415 if res < 0: 12416 raise 12417 return bool(res) 12418 def has_parent(arg0): 12419 try: 12420 if not arg0.__class__ is schedule_node: 12421 arg0 = schedule_node(arg0) 12422 except: 12423 raise 12424 ctx = arg0.ctx 12425 res = isl.isl_schedule_node_has_parent(arg0.ptr) 12426 if res < 0: 12427 raise 12428 return bool(res) 12429 def has_previous_sibling(arg0): 12430 try: 12431 if not arg0.__class__ is schedule_node: 12432 arg0 = schedule_node(arg0) 12433 except: 12434 raise 12435 ctx = arg0.ctx 12436 res = isl.isl_schedule_node_has_previous_sibling(arg0.ptr) 12437 if res < 0: 12438 raise 12439 return bool(res) 12440 def insert_context(arg0, arg1): 12441 try: 12442 if not arg0.__class__ is schedule_node: 12443 arg0 = schedule_node(arg0) 12444 except: 12445 raise 12446 try: 12447 if not arg1.__class__ is set: 12448 arg1 = set(arg1) 12449 except: 12450 raise 12451 ctx = arg0.ctx 12452 res = isl.isl_schedule_node_insert_context(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 12453 obj = schedule_node(ctx=ctx, ptr=res) 12454 return obj 12455 def insert_filter(arg0, arg1): 12456 try: 12457 if not arg0.__class__ is schedule_node: 12458 arg0 = schedule_node(arg0) 12459 except: 12460 raise 12461 try: 12462 if not arg1.__class__ is union_set: 12463 arg1 = union_set(arg1) 12464 except: 12465 raise 12466 ctx = arg0.ctx 12467 res = isl.isl_schedule_node_insert_filter(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 12468 obj = schedule_node(ctx=ctx, ptr=res) 12469 return obj 12470 def insert_guard(arg0, arg1): 12471 try: 12472 if not arg0.__class__ is schedule_node: 12473 arg0 = schedule_node(arg0) 12474 except: 12475 raise 12476 try: 12477 if not arg1.__class__ is set: 12478 arg1 = set(arg1) 12479 except: 12480 raise 12481 ctx = arg0.ctx 12482 res = isl.isl_schedule_node_insert_guard(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 12483 obj = schedule_node(ctx=ctx, ptr=res) 12484 return obj 12485 def insert_mark(arg0, arg1): 12486 try: 12487 if not arg0.__class__ is schedule_node: 12488 arg0 = schedule_node(arg0) 12489 except: 12490 raise 12491 try: 12492 if not arg1.__class__ is id: 12493 arg1 = id(arg1) 12494 except: 12495 raise 12496 ctx = arg0.ctx 12497 res = isl.isl_schedule_node_insert_mark(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 12498 obj = schedule_node(ctx=ctx, ptr=res) 12499 return obj 12500 def insert_partial_schedule(arg0, arg1): 12501 try: 12502 if not arg0.__class__ is schedule_node: 12503 arg0 = schedule_node(arg0) 12504 except: 12505 raise 12506 try: 12507 if not arg1.__class__ is multi_union_pw_aff: 12508 arg1 = multi_union_pw_aff(arg1) 12509 except: 12510 raise 12511 ctx = arg0.ctx 12512 res = isl.isl_schedule_node_insert_partial_schedule(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 12513 obj = schedule_node(ctx=ctx, ptr=res) 12514 return obj 12515 def insert_sequence(arg0, arg1): 12516 try: 12517 if not arg0.__class__ is schedule_node: 12518 arg0 = schedule_node(arg0) 12519 except: 12520 raise 12521 try: 12522 if not arg1.__class__ is union_set_list: 12523 arg1 = union_set_list(arg1) 12524 except: 12525 raise 12526 ctx = arg0.ctx 12527 res = isl.isl_schedule_node_insert_sequence(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 12528 obj = schedule_node(ctx=ctx, ptr=res) 12529 return obj 12530 def insert_set(arg0, arg1): 12531 try: 12532 if not arg0.__class__ is schedule_node: 12533 arg0 = schedule_node(arg0) 12534 except: 12535 raise 12536 try: 12537 if not arg1.__class__ is union_set_list: 12538 arg1 = union_set_list(arg1) 12539 except: 12540 raise 12541 ctx = arg0.ctx 12542 res = isl.isl_schedule_node_insert_set(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 12543 obj = schedule_node(ctx=ctx, ptr=res) 12544 return obj 12545 def is_equal(arg0, arg1): 12546 try: 12547 if not arg0.__class__ is schedule_node: 12548 arg0 = schedule_node(arg0) 12549 except: 12550 raise 12551 try: 12552 if not arg1.__class__ is schedule_node: 12553 arg1 = schedule_node(arg1) 12554 except: 12555 raise 12556 ctx = arg0.ctx 12557 res = isl.isl_schedule_node_is_equal(arg0.ptr, arg1.ptr) 12558 if res < 0: 12559 raise 12560 return bool(res) 12561 def is_subtree_anchored(arg0): 12562 try: 12563 if not arg0.__class__ is schedule_node: 12564 arg0 = schedule_node(arg0) 12565 except: 12566 raise 12567 ctx = arg0.ctx 12568 res = isl.isl_schedule_node_is_subtree_anchored(arg0.ptr) 12569 if res < 0: 12570 raise 12571 return bool(res) 12572 def map_descendant_bottom_up(arg0, arg1): 12573 try: 12574 if not arg0.__class__ is schedule_node: 12575 arg0 = schedule_node(arg0) 12576 except: 12577 raise 12578 exc_info = [None] 12579 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p) 12580 def cb_func(cb_arg0, cb_arg1): 12581 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=(cb_arg0)) 12582 try: 12583 res = arg1(cb_arg0) 12584 except: 12585 import sys 12586 exc_info[0] = sys.exc_info() 12587 return None 12588 return isl.isl_schedule_node_copy(res.ptr) 12589 cb = fn(cb_func) 12590 ctx = arg0.ctx 12591 res = isl.isl_schedule_node_map_descendant_bottom_up(isl.isl_schedule_node_copy(arg0.ptr), cb, None) 12592 if exc_info[0] != None: 12593 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 12594 obj = schedule_node(ctx=ctx, ptr=res) 12595 return obj 12596 def n_children(arg0): 12597 try: 12598 if not arg0.__class__ is schedule_node: 12599 arg0 = schedule_node(arg0) 12600 except: 12601 raise 12602 ctx = arg0.ctx 12603 res = isl.isl_schedule_node_n_children(arg0.ptr) 12604 if res < 0: 12605 raise 12606 return int(res) 12607 def next_sibling(arg0): 12608 try: 12609 if not arg0.__class__ is schedule_node: 12610 arg0 = schedule_node(arg0) 12611 except: 12612 raise 12613 ctx = arg0.ctx 12614 res = isl.isl_schedule_node_next_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 12615 obj = schedule_node(ctx=ctx, ptr=res) 12616 return obj 12617 def order_after(arg0, arg1): 12618 try: 12619 if not arg0.__class__ is schedule_node: 12620 arg0 = schedule_node(arg0) 12621 except: 12622 raise 12623 try: 12624 if not arg1.__class__ is union_set: 12625 arg1 = union_set(arg1) 12626 except: 12627 raise 12628 ctx = arg0.ctx 12629 res = isl.isl_schedule_node_order_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 12630 obj = schedule_node(ctx=ctx, ptr=res) 12631 return obj 12632 def order_before(arg0, arg1): 12633 try: 12634 if not arg0.__class__ is schedule_node: 12635 arg0 = schedule_node(arg0) 12636 except: 12637 raise 12638 try: 12639 if not arg1.__class__ is union_set: 12640 arg1 = union_set(arg1) 12641 except: 12642 raise 12643 ctx = arg0.ctx 12644 res = isl.isl_schedule_node_order_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 12645 obj = schedule_node(ctx=ctx, ptr=res) 12646 return obj 12647 def parent(arg0): 12648 try: 12649 if not arg0.__class__ is schedule_node: 12650 arg0 = schedule_node(arg0) 12651 except: 12652 raise 12653 ctx = arg0.ctx 12654 res = isl.isl_schedule_node_parent(isl.isl_schedule_node_copy(arg0.ptr)) 12655 obj = schedule_node(ctx=ctx, ptr=res) 12656 return obj 12657 def previous_sibling(arg0): 12658 try: 12659 if not arg0.__class__ is schedule_node: 12660 arg0 = schedule_node(arg0) 12661 except: 12662 raise 12663 ctx = arg0.ctx 12664 res = isl.isl_schedule_node_previous_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 12665 obj = schedule_node(ctx=ctx, ptr=res) 12666 return obj 12667 def root(arg0): 12668 try: 12669 if not arg0.__class__ is schedule_node: 12670 arg0 = schedule_node(arg0) 12671 except: 12672 raise 12673 ctx = arg0.ctx 12674 res = isl.isl_schedule_node_root(isl.isl_schedule_node_copy(arg0.ptr)) 12675 obj = schedule_node(ctx=ctx, ptr=res) 12676 return obj 12677 12678isl.isl_schedule_node_ancestor.restype = c_void_p 12679isl.isl_schedule_node_ancestor.argtypes = [c_void_p, c_int] 12680isl.isl_schedule_node_child.restype = c_void_p 12681isl.isl_schedule_node_child.argtypes = [c_void_p, c_int] 12682isl.isl_schedule_node_every_descendant.argtypes = [c_void_p, c_void_p, c_void_p] 12683isl.isl_schedule_node_first_child.restype = c_void_p 12684isl.isl_schedule_node_first_child.argtypes = [c_void_p] 12685isl.isl_schedule_node_foreach_ancestor_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 12686isl.isl_schedule_node_foreach_descendant_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 12687isl.isl_schedule_node_from_domain.restype = c_void_p 12688isl.isl_schedule_node_from_domain.argtypes = [c_void_p] 12689isl.isl_schedule_node_from_extension.restype = c_void_p 12690isl.isl_schedule_node_from_extension.argtypes = [c_void_p] 12691isl.isl_schedule_node_get_ancestor_child_position.argtypes = [c_void_p, c_void_p] 12692isl.isl_schedule_node_get_child_position.argtypes = [c_void_p] 12693isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.restype = c_void_p 12694isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.argtypes = [c_void_p] 12695isl.isl_schedule_node_get_prefix_schedule_union_map.restype = c_void_p 12696isl.isl_schedule_node_get_prefix_schedule_union_map.argtypes = [c_void_p] 12697isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.restype = c_void_p 12698isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.argtypes = [c_void_p] 12699isl.isl_schedule_node_get_schedule.restype = c_void_p 12700isl.isl_schedule_node_get_schedule.argtypes = [c_void_p] 12701isl.isl_schedule_node_get_shared_ancestor.restype = c_void_p 12702isl.isl_schedule_node_get_shared_ancestor.argtypes = [c_void_p, c_void_p] 12703isl.isl_schedule_node_get_tree_depth.argtypes = [c_void_p] 12704isl.isl_schedule_node_graft_after.restype = c_void_p 12705isl.isl_schedule_node_graft_after.argtypes = [c_void_p, c_void_p] 12706isl.isl_schedule_node_graft_before.restype = c_void_p 12707isl.isl_schedule_node_graft_before.argtypes = [c_void_p, c_void_p] 12708isl.isl_schedule_node_has_children.argtypes = [c_void_p] 12709isl.isl_schedule_node_has_next_sibling.argtypes = [c_void_p] 12710isl.isl_schedule_node_has_parent.argtypes = [c_void_p] 12711isl.isl_schedule_node_has_previous_sibling.argtypes = [c_void_p] 12712isl.isl_schedule_node_insert_context.restype = c_void_p 12713isl.isl_schedule_node_insert_context.argtypes = [c_void_p, c_void_p] 12714isl.isl_schedule_node_insert_filter.restype = c_void_p 12715isl.isl_schedule_node_insert_filter.argtypes = [c_void_p, c_void_p] 12716isl.isl_schedule_node_insert_guard.restype = c_void_p 12717isl.isl_schedule_node_insert_guard.argtypes = [c_void_p, c_void_p] 12718isl.isl_schedule_node_insert_mark.restype = c_void_p 12719isl.isl_schedule_node_insert_mark.argtypes = [c_void_p, c_void_p] 12720isl.isl_schedule_node_insert_partial_schedule.restype = c_void_p 12721isl.isl_schedule_node_insert_partial_schedule.argtypes = [c_void_p, c_void_p] 12722isl.isl_schedule_node_insert_sequence.restype = c_void_p 12723isl.isl_schedule_node_insert_sequence.argtypes = [c_void_p, c_void_p] 12724isl.isl_schedule_node_insert_set.restype = c_void_p 12725isl.isl_schedule_node_insert_set.argtypes = [c_void_p, c_void_p] 12726isl.isl_schedule_node_is_equal.argtypes = [c_void_p, c_void_p] 12727isl.isl_schedule_node_is_subtree_anchored.argtypes = [c_void_p] 12728isl.isl_schedule_node_map_descendant_bottom_up.restype = c_void_p 12729isl.isl_schedule_node_map_descendant_bottom_up.argtypes = [c_void_p, c_void_p, c_void_p] 12730isl.isl_schedule_node_n_children.argtypes = [c_void_p] 12731isl.isl_schedule_node_next_sibling.restype = c_void_p 12732isl.isl_schedule_node_next_sibling.argtypes = [c_void_p] 12733isl.isl_schedule_node_order_after.restype = c_void_p 12734isl.isl_schedule_node_order_after.argtypes = [c_void_p, c_void_p] 12735isl.isl_schedule_node_order_before.restype = c_void_p 12736isl.isl_schedule_node_order_before.argtypes = [c_void_p, c_void_p] 12737isl.isl_schedule_node_parent.restype = c_void_p 12738isl.isl_schedule_node_parent.argtypes = [c_void_p] 12739isl.isl_schedule_node_previous_sibling.restype = c_void_p 12740isl.isl_schedule_node_previous_sibling.argtypes = [c_void_p] 12741isl.isl_schedule_node_root.restype = c_void_p 12742isl.isl_schedule_node_root.argtypes = [c_void_p] 12743isl.isl_schedule_node_copy.restype = c_void_p 12744isl.isl_schedule_node_copy.argtypes = [c_void_p] 12745isl.isl_schedule_node_free.restype = c_void_p 12746isl.isl_schedule_node_free.argtypes = [c_void_p] 12747isl.isl_schedule_node_to_str.restype = POINTER(c_char) 12748isl.isl_schedule_node_to_str.argtypes = [c_void_p] 12749isl.isl_schedule_node_get_type.argtypes = [c_void_p] 12750 12751class schedule_node_band(schedule_node): 12752 def __init__(self, *args, **keywords): 12753 if "ptr" in keywords: 12754 self.ctx = keywords["ctx"] 12755 self.ptr = keywords["ptr"] 12756 return 12757 raise Error 12758 def __del__(self): 12759 if hasattr(self, 'ptr'): 12760 isl.isl_schedule_node_free(self.ptr) 12761 def __new__(cls, *args, **keywords): 12762 return super(schedule_node_band, cls).__new__(cls) 12763 def __str__(arg0): 12764 try: 12765 if not arg0.__class__ is schedule_node_band: 12766 arg0 = schedule_node_band(arg0) 12767 except: 12768 raise 12769 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 12770 res = cast(ptr, c_char_p).value.decode('ascii') 12771 libc.free(ptr) 12772 return res 12773 def __repr__(self): 12774 s = str(self) 12775 if '"' in s: 12776 return 'isl.schedule_node_band("""%s""")' % s 12777 else: 12778 return 'isl.schedule_node_band("%s")' % s 12779 def ast_build_options(arg0): 12780 try: 12781 if not arg0.__class__ is schedule_node: 12782 arg0 = schedule_node(arg0) 12783 except: 12784 raise 12785 ctx = arg0.ctx 12786 res = isl.isl_schedule_node_band_get_ast_build_options(arg0.ptr) 12787 obj = union_set(ctx=ctx, ptr=res) 12788 return obj 12789 def get_ast_build_options(arg0): 12790 return arg0.ast_build_options() 12791 def ast_isolate_option(arg0): 12792 try: 12793 if not arg0.__class__ is schedule_node: 12794 arg0 = schedule_node(arg0) 12795 except: 12796 raise 12797 ctx = arg0.ctx 12798 res = isl.isl_schedule_node_band_get_ast_isolate_option(arg0.ptr) 12799 obj = set(ctx=ctx, ptr=res) 12800 return obj 12801 def get_ast_isolate_option(arg0): 12802 return arg0.ast_isolate_option() 12803 def partial_schedule(arg0): 12804 try: 12805 if not arg0.__class__ is schedule_node: 12806 arg0 = schedule_node(arg0) 12807 except: 12808 raise 12809 ctx = arg0.ctx 12810 res = isl.isl_schedule_node_band_get_partial_schedule(arg0.ptr) 12811 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 12812 return obj 12813 def get_partial_schedule(arg0): 12814 return arg0.partial_schedule() 12815 def permutable(arg0): 12816 try: 12817 if not arg0.__class__ is schedule_node: 12818 arg0 = schedule_node(arg0) 12819 except: 12820 raise 12821 ctx = arg0.ctx 12822 res = isl.isl_schedule_node_band_get_permutable(arg0.ptr) 12823 if res < 0: 12824 raise 12825 return bool(res) 12826 def get_permutable(arg0): 12827 return arg0.permutable() 12828 def member_get_coincident(arg0, arg1): 12829 try: 12830 if not arg0.__class__ is schedule_node: 12831 arg0 = schedule_node(arg0) 12832 except: 12833 raise 12834 ctx = arg0.ctx 12835 res = isl.isl_schedule_node_band_member_get_coincident(arg0.ptr, arg1) 12836 if res < 0: 12837 raise 12838 return bool(res) 12839 def member_set_coincident(arg0, arg1, arg2): 12840 try: 12841 if not arg0.__class__ is schedule_node: 12842 arg0 = schedule_node(arg0) 12843 except: 12844 raise 12845 ctx = arg0.ctx 12846 res = isl.isl_schedule_node_band_member_set_coincident(isl.isl_schedule_node_copy(arg0.ptr), arg1, arg2) 12847 obj = schedule_node(ctx=ctx, ptr=res) 12848 return obj 12849 def mod(arg0, arg1): 12850 try: 12851 if not arg0.__class__ is schedule_node: 12852 arg0 = schedule_node(arg0) 12853 except: 12854 raise 12855 try: 12856 if not arg1.__class__ is multi_val: 12857 arg1 = multi_val(arg1) 12858 except: 12859 raise 12860 ctx = arg0.ctx 12861 res = isl.isl_schedule_node_band_mod(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12862 obj = schedule_node(ctx=ctx, ptr=res) 12863 return obj 12864 def n_member(arg0): 12865 try: 12866 if not arg0.__class__ is schedule_node: 12867 arg0 = schedule_node(arg0) 12868 except: 12869 raise 12870 ctx = arg0.ctx 12871 res = isl.isl_schedule_node_band_n_member(arg0.ptr) 12872 if res < 0: 12873 raise 12874 return int(res) 12875 def scale(arg0, arg1): 12876 try: 12877 if not arg0.__class__ is schedule_node: 12878 arg0 = schedule_node(arg0) 12879 except: 12880 raise 12881 try: 12882 if not arg1.__class__ is multi_val: 12883 arg1 = multi_val(arg1) 12884 except: 12885 raise 12886 ctx = arg0.ctx 12887 res = isl.isl_schedule_node_band_scale(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12888 obj = schedule_node(ctx=ctx, ptr=res) 12889 return obj 12890 def scale_down(arg0, arg1): 12891 try: 12892 if not arg0.__class__ is schedule_node: 12893 arg0 = schedule_node(arg0) 12894 except: 12895 raise 12896 try: 12897 if not arg1.__class__ is multi_val: 12898 arg1 = multi_val(arg1) 12899 except: 12900 raise 12901 ctx = arg0.ctx 12902 res = isl.isl_schedule_node_band_scale_down(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12903 obj = schedule_node(ctx=ctx, ptr=res) 12904 return obj 12905 def set_ast_build_options(arg0, arg1): 12906 try: 12907 if not arg0.__class__ is schedule_node: 12908 arg0 = schedule_node(arg0) 12909 except: 12910 raise 12911 try: 12912 if not arg1.__class__ is union_set: 12913 arg1 = union_set(arg1) 12914 except: 12915 raise 12916 ctx = arg0.ctx 12917 res = isl.isl_schedule_node_band_set_ast_build_options(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 12918 obj = schedule_node(ctx=ctx, ptr=res) 12919 return obj 12920 def set_permutable(arg0, arg1): 12921 try: 12922 if not arg0.__class__ is schedule_node: 12923 arg0 = schedule_node(arg0) 12924 except: 12925 raise 12926 ctx = arg0.ctx 12927 res = isl.isl_schedule_node_band_set_permutable(isl.isl_schedule_node_copy(arg0.ptr), arg1) 12928 obj = schedule_node(ctx=ctx, ptr=res) 12929 return obj 12930 def shift(arg0, arg1): 12931 try: 12932 if not arg0.__class__ is schedule_node: 12933 arg0 = schedule_node(arg0) 12934 except: 12935 raise 12936 try: 12937 if not arg1.__class__ is multi_union_pw_aff: 12938 arg1 = multi_union_pw_aff(arg1) 12939 except: 12940 raise 12941 ctx = arg0.ctx 12942 res = isl.isl_schedule_node_band_shift(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 12943 obj = schedule_node(ctx=ctx, ptr=res) 12944 return obj 12945 def split(arg0, arg1): 12946 try: 12947 if not arg0.__class__ is schedule_node: 12948 arg0 = schedule_node(arg0) 12949 except: 12950 raise 12951 ctx = arg0.ctx 12952 res = isl.isl_schedule_node_band_split(isl.isl_schedule_node_copy(arg0.ptr), arg1) 12953 obj = schedule_node(ctx=ctx, ptr=res) 12954 return obj 12955 def tile(arg0, arg1): 12956 try: 12957 if not arg0.__class__ is schedule_node: 12958 arg0 = schedule_node(arg0) 12959 except: 12960 raise 12961 try: 12962 if not arg1.__class__ is multi_val: 12963 arg1 = multi_val(arg1) 12964 except: 12965 raise 12966 ctx = arg0.ctx 12967 res = isl.isl_schedule_node_band_tile(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12968 obj = schedule_node(ctx=ctx, ptr=res) 12969 return obj 12970 def member_set_ast_loop_default(arg0, arg1): 12971 try: 12972 if not arg0.__class__ is schedule_node: 12973 arg0 = schedule_node(arg0) 12974 except: 12975 raise 12976 ctx = arg0.ctx 12977 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 0) 12978 obj = schedule_node(ctx=ctx, ptr=res) 12979 return obj 12980 def member_set_ast_loop_atomic(arg0, arg1): 12981 try: 12982 if not arg0.__class__ is schedule_node: 12983 arg0 = schedule_node(arg0) 12984 except: 12985 raise 12986 ctx = arg0.ctx 12987 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 1) 12988 obj = schedule_node(ctx=ctx, ptr=res) 12989 return obj 12990 def member_set_ast_loop_unroll(arg0, arg1): 12991 try: 12992 if not arg0.__class__ is schedule_node: 12993 arg0 = schedule_node(arg0) 12994 except: 12995 raise 12996 ctx = arg0.ctx 12997 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 2) 12998 obj = schedule_node(ctx=ctx, ptr=res) 12999 return obj 13000 def member_set_ast_loop_separate(arg0, arg1): 13001 try: 13002 if not arg0.__class__ is schedule_node: 13003 arg0 = schedule_node(arg0) 13004 except: 13005 raise 13006 ctx = arg0.ctx 13007 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 3) 13008 obj = schedule_node(ctx=ctx, ptr=res) 13009 return obj 13010 13011isl.isl_schedule_node_band_get_ast_build_options.restype = c_void_p 13012isl.isl_schedule_node_band_get_ast_build_options.argtypes = [c_void_p] 13013isl.isl_schedule_node_band_get_ast_isolate_option.restype = c_void_p 13014isl.isl_schedule_node_band_get_ast_isolate_option.argtypes = [c_void_p] 13015isl.isl_schedule_node_band_get_partial_schedule.restype = c_void_p 13016isl.isl_schedule_node_band_get_partial_schedule.argtypes = [c_void_p] 13017isl.isl_schedule_node_band_get_permutable.argtypes = [c_void_p] 13018isl.isl_schedule_node_band_member_get_coincident.argtypes = [c_void_p, c_int] 13019isl.isl_schedule_node_band_member_set_coincident.restype = c_void_p 13020isl.isl_schedule_node_band_member_set_coincident.argtypes = [c_void_p, c_int, c_int] 13021isl.isl_schedule_node_band_mod.restype = c_void_p 13022isl.isl_schedule_node_band_mod.argtypes = [c_void_p, c_void_p] 13023isl.isl_schedule_node_band_n_member.argtypes = [c_void_p] 13024isl.isl_schedule_node_band_scale.restype = c_void_p 13025isl.isl_schedule_node_band_scale.argtypes = [c_void_p, c_void_p] 13026isl.isl_schedule_node_band_scale_down.restype = c_void_p 13027isl.isl_schedule_node_band_scale_down.argtypes = [c_void_p, c_void_p] 13028isl.isl_schedule_node_band_set_ast_build_options.restype = c_void_p 13029isl.isl_schedule_node_band_set_ast_build_options.argtypes = [c_void_p, c_void_p] 13030isl.isl_schedule_node_band_set_permutable.restype = c_void_p 13031isl.isl_schedule_node_band_set_permutable.argtypes = [c_void_p, c_int] 13032isl.isl_schedule_node_band_shift.restype = c_void_p 13033isl.isl_schedule_node_band_shift.argtypes = [c_void_p, c_void_p] 13034isl.isl_schedule_node_band_split.restype = c_void_p 13035isl.isl_schedule_node_band_split.argtypes = [c_void_p, c_int] 13036isl.isl_schedule_node_band_tile.restype = c_void_p 13037isl.isl_schedule_node_band_tile.argtypes = [c_void_p, c_void_p] 13038isl.isl_schedule_node_band_member_set_ast_loop_type.restype = c_void_p 13039isl.isl_schedule_node_band_member_set_ast_loop_type.argtypes = [c_void_p, c_int, c_int] 13040isl.isl_schedule_node_copy.restype = c_void_p 13041isl.isl_schedule_node_copy.argtypes = [c_void_p] 13042isl.isl_schedule_node_free.restype = c_void_p 13043isl.isl_schedule_node_free.argtypes = [c_void_p] 13044isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13045isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13046 13047class schedule_node_context(schedule_node): 13048 def __init__(self, *args, **keywords): 13049 if "ptr" in keywords: 13050 self.ctx = keywords["ctx"] 13051 self.ptr = keywords["ptr"] 13052 return 13053 raise Error 13054 def __del__(self): 13055 if hasattr(self, 'ptr'): 13056 isl.isl_schedule_node_free(self.ptr) 13057 def __new__(cls, *args, **keywords): 13058 return super(schedule_node_context, cls).__new__(cls) 13059 def __str__(arg0): 13060 try: 13061 if not arg0.__class__ is schedule_node_context: 13062 arg0 = schedule_node_context(arg0) 13063 except: 13064 raise 13065 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13066 res = cast(ptr, c_char_p).value.decode('ascii') 13067 libc.free(ptr) 13068 return res 13069 def __repr__(self): 13070 s = str(self) 13071 if '"' in s: 13072 return 'isl.schedule_node_context("""%s""")' % s 13073 else: 13074 return 'isl.schedule_node_context("%s")' % s 13075 def context(arg0): 13076 try: 13077 if not arg0.__class__ is schedule_node: 13078 arg0 = schedule_node(arg0) 13079 except: 13080 raise 13081 ctx = arg0.ctx 13082 res = isl.isl_schedule_node_context_get_context(arg0.ptr) 13083 obj = set(ctx=ctx, ptr=res) 13084 return obj 13085 def get_context(arg0): 13086 return arg0.context() 13087 13088isl.isl_schedule_node_context_get_context.restype = c_void_p 13089isl.isl_schedule_node_context_get_context.argtypes = [c_void_p] 13090isl.isl_schedule_node_copy.restype = c_void_p 13091isl.isl_schedule_node_copy.argtypes = [c_void_p] 13092isl.isl_schedule_node_free.restype = c_void_p 13093isl.isl_schedule_node_free.argtypes = [c_void_p] 13094isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13095isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13096 13097class schedule_node_domain(schedule_node): 13098 def __init__(self, *args, **keywords): 13099 if "ptr" in keywords: 13100 self.ctx = keywords["ctx"] 13101 self.ptr = keywords["ptr"] 13102 return 13103 raise Error 13104 def __del__(self): 13105 if hasattr(self, 'ptr'): 13106 isl.isl_schedule_node_free(self.ptr) 13107 def __new__(cls, *args, **keywords): 13108 return super(schedule_node_domain, cls).__new__(cls) 13109 def __str__(arg0): 13110 try: 13111 if not arg0.__class__ is schedule_node_domain: 13112 arg0 = schedule_node_domain(arg0) 13113 except: 13114 raise 13115 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13116 res = cast(ptr, c_char_p).value.decode('ascii') 13117 libc.free(ptr) 13118 return res 13119 def __repr__(self): 13120 s = str(self) 13121 if '"' in s: 13122 return 'isl.schedule_node_domain("""%s""")' % s 13123 else: 13124 return 'isl.schedule_node_domain("%s")' % s 13125 def domain(arg0): 13126 try: 13127 if not arg0.__class__ is schedule_node: 13128 arg0 = schedule_node(arg0) 13129 except: 13130 raise 13131 ctx = arg0.ctx 13132 res = isl.isl_schedule_node_domain_get_domain(arg0.ptr) 13133 obj = union_set(ctx=ctx, ptr=res) 13134 return obj 13135 def get_domain(arg0): 13136 return arg0.domain() 13137 13138isl.isl_schedule_node_domain_get_domain.restype = c_void_p 13139isl.isl_schedule_node_domain_get_domain.argtypes = [c_void_p] 13140isl.isl_schedule_node_copy.restype = c_void_p 13141isl.isl_schedule_node_copy.argtypes = [c_void_p] 13142isl.isl_schedule_node_free.restype = c_void_p 13143isl.isl_schedule_node_free.argtypes = [c_void_p] 13144isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13145isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13146 13147class schedule_node_expansion(schedule_node): 13148 def __init__(self, *args, **keywords): 13149 if "ptr" in keywords: 13150 self.ctx = keywords["ctx"] 13151 self.ptr = keywords["ptr"] 13152 return 13153 raise Error 13154 def __del__(self): 13155 if hasattr(self, 'ptr'): 13156 isl.isl_schedule_node_free(self.ptr) 13157 def __new__(cls, *args, **keywords): 13158 return super(schedule_node_expansion, cls).__new__(cls) 13159 def __str__(arg0): 13160 try: 13161 if not arg0.__class__ is schedule_node_expansion: 13162 arg0 = schedule_node_expansion(arg0) 13163 except: 13164 raise 13165 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13166 res = cast(ptr, c_char_p).value.decode('ascii') 13167 libc.free(ptr) 13168 return res 13169 def __repr__(self): 13170 s = str(self) 13171 if '"' in s: 13172 return 'isl.schedule_node_expansion("""%s""")' % s 13173 else: 13174 return 'isl.schedule_node_expansion("%s")' % s 13175 def contraction(arg0): 13176 try: 13177 if not arg0.__class__ is schedule_node: 13178 arg0 = schedule_node(arg0) 13179 except: 13180 raise 13181 ctx = arg0.ctx 13182 res = isl.isl_schedule_node_expansion_get_contraction(arg0.ptr) 13183 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 13184 return obj 13185 def get_contraction(arg0): 13186 return arg0.contraction() 13187 def expansion(arg0): 13188 try: 13189 if not arg0.__class__ is schedule_node: 13190 arg0 = schedule_node(arg0) 13191 except: 13192 raise 13193 ctx = arg0.ctx 13194 res = isl.isl_schedule_node_expansion_get_expansion(arg0.ptr) 13195 obj = union_map(ctx=ctx, ptr=res) 13196 return obj 13197 def get_expansion(arg0): 13198 return arg0.expansion() 13199 13200isl.isl_schedule_node_expansion_get_contraction.restype = c_void_p 13201isl.isl_schedule_node_expansion_get_contraction.argtypes = [c_void_p] 13202isl.isl_schedule_node_expansion_get_expansion.restype = c_void_p 13203isl.isl_schedule_node_expansion_get_expansion.argtypes = [c_void_p] 13204isl.isl_schedule_node_copy.restype = c_void_p 13205isl.isl_schedule_node_copy.argtypes = [c_void_p] 13206isl.isl_schedule_node_free.restype = c_void_p 13207isl.isl_schedule_node_free.argtypes = [c_void_p] 13208isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13209isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13210 13211class schedule_node_extension(schedule_node): 13212 def __init__(self, *args, **keywords): 13213 if "ptr" in keywords: 13214 self.ctx = keywords["ctx"] 13215 self.ptr = keywords["ptr"] 13216 return 13217 raise Error 13218 def __del__(self): 13219 if hasattr(self, 'ptr'): 13220 isl.isl_schedule_node_free(self.ptr) 13221 def __new__(cls, *args, **keywords): 13222 return super(schedule_node_extension, cls).__new__(cls) 13223 def __str__(arg0): 13224 try: 13225 if not arg0.__class__ is schedule_node_extension: 13226 arg0 = schedule_node_extension(arg0) 13227 except: 13228 raise 13229 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13230 res = cast(ptr, c_char_p).value.decode('ascii') 13231 libc.free(ptr) 13232 return res 13233 def __repr__(self): 13234 s = str(self) 13235 if '"' in s: 13236 return 'isl.schedule_node_extension("""%s""")' % s 13237 else: 13238 return 'isl.schedule_node_extension("%s")' % s 13239 def extension(arg0): 13240 try: 13241 if not arg0.__class__ is schedule_node: 13242 arg0 = schedule_node(arg0) 13243 except: 13244 raise 13245 ctx = arg0.ctx 13246 res = isl.isl_schedule_node_extension_get_extension(arg0.ptr) 13247 obj = union_map(ctx=ctx, ptr=res) 13248 return obj 13249 def get_extension(arg0): 13250 return arg0.extension() 13251 13252isl.isl_schedule_node_extension_get_extension.restype = c_void_p 13253isl.isl_schedule_node_extension_get_extension.argtypes = [c_void_p] 13254isl.isl_schedule_node_copy.restype = c_void_p 13255isl.isl_schedule_node_copy.argtypes = [c_void_p] 13256isl.isl_schedule_node_free.restype = c_void_p 13257isl.isl_schedule_node_free.argtypes = [c_void_p] 13258isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13259isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13260 13261class schedule_node_filter(schedule_node): 13262 def __init__(self, *args, **keywords): 13263 if "ptr" in keywords: 13264 self.ctx = keywords["ctx"] 13265 self.ptr = keywords["ptr"] 13266 return 13267 raise Error 13268 def __del__(self): 13269 if hasattr(self, 'ptr'): 13270 isl.isl_schedule_node_free(self.ptr) 13271 def __new__(cls, *args, **keywords): 13272 return super(schedule_node_filter, cls).__new__(cls) 13273 def __str__(arg0): 13274 try: 13275 if not arg0.__class__ is schedule_node_filter: 13276 arg0 = schedule_node_filter(arg0) 13277 except: 13278 raise 13279 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13280 res = cast(ptr, c_char_p).value.decode('ascii') 13281 libc.free(ptr) 13282 return res 13283 def __repr__(self): 13284 s = str(self) 13285 if '"' in s: 13286 return 'isl.schedule_node_filter("""%s""")' % s 13287 else: 13288 return 'isl.schedule_node_filter("%s")' % s 13289 def filter(arg0): 13290 try: 13291 if not arg0.__class__ is schedule_node: 13292 arg0 = schedule_node(arg0) 13293 except: 13294 raise 13295 ctx = arg0.ctx 13296 res = isl.isl_schedule_node_filter_get_filter(arg0.ptr) 13297 obj = union_set(ctx=ctx, ptr=res) 13298 return obj 13299 def get_filter(arg0): 13300 return arg0.filter() 13301 13302isl.isl_schedule_node_filter_get_filter.restype = c_void_p 13303isl.isl_schedule_node_filter_get_filter.argtypes = [c_void_p] 13304isl.isl_schedule_node_copy.restype = c_void_p 13305isl.isl_schedule_node_copy.argtypes = [c_void_p] 13306isl.isl_schedule_node_free.restype = c_void_p 13307isl.isl_schedule_node_free.argtypes = [c_void_p] 13308isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13309isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13310 13311class schedule_node_guard(schedule_node): 13312 def __init__(self, *args, **keywords): 13313 if "ptr" in keywords: 13314 self.ctx = keywords["ctx"] 13315 self.ptr = keywords["ptr"] 13316 return 13317 raise Error 13318 def __del__(self): 13319 if hasattr(self, 'ptr'): 13320 isl.isl_schedule_node_free(self.ptr) 13321 def __new__(cls, *args, **keywords): 13322 return super(schedule_node_guard, cls).__new__(cls) 13323 def __str__(arg0): 13324 try: 13325 if not arg0.__class__ is schedule_node_guard: 13326 arg0 = schedule_node_guard(arg0) 13327 except: 13328 raise 13329 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13330 res = cast(ptr, c_char_p).value.decode('ascii') 13331 libc.free(ptr) 13332 return res 13333 def __repr__(self): 13334 s = str(self) 13335 if '"' in s: 13336 return 'isl.schedule_node_guard("""%s""")' % s 13337 else: 13338 return 'isl.schedule_node_guard("%s")' % s 13339 def guard(arg0): 13340 try: 13341 if not arg0.__class__ is schedule_node: 13342 arg0 = schedule_node(arg0) 13343 except: 13344 raise 13345 ctx = arg0.ctx 13346 res = isl.isl_schedule_node_guard_get_guard(arg0.ptr) 13347 obj = set(ctx=ctx, ptr=res) 13348 return obj 13349 def get_guard(arg0): 13350 return arg0.guard() 13351 13352isl.isl_schedule_node_guard_get_guard.restype = c_void_p 13353isl.isl_schedule_node_guard_get_guard.argtypes = [c_void_p] 13354isl.isl_schedule_node_copy.restype = c_void_p 13355isl.isl_schedule_node_copy.argtypes = [c_void_p] 13356isl.isl_schedule_node_free.restype = c_void_p 13357isl.isl_schedule_node_free.argtypes = [c_void_p] 13358isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13359isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13360 13361class schedule_node_leaf(schedule_node): 13362 def __init__(self, *args, **keywords): 13363 if "ptr" in keywords: 13364 self.ctx = keywords["ctx"] 13365 self.ptr = keywords["ptr"] 13366 return 13367 raise Error 13368 def __del__(self): 13369 if hasattr(self, 'ptr'): 13370 isl.isl_schedule_node_free(self.ptr) 13371 def __new__(cls, *args, **keywords): 13372 return super(schedule_node_leaf, cls).__new__(cls) 13373 def __str__(arg0): 13374 try: 13375 if not arg0.__class__ is schedule_node_leaf: 13376 arg0 = schedule_node_leaf(arg0) 13377 except: 13378 raise 13379 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13380 res = cast(ptr, c_char_p).value.decode('ascii') 13381 libc.free(ptr) 13382 return res 13383 def __repr__(self): 13384 s = str(self) 13385 if '"' in s: 13386 return 'isl.schedule_node_leaf("""%s""")' % s 13387 else: 13388 return 'isl.schedule_node_leaf("%s")' % s 13389 13390isl.isl_schedule_node_copy.restype = c_void_p 13391isl.isl_schedule_node_copy.argtypes = [c_void_p] 13392isl.isl_schedule_node_free.restype = c_void_p 13393isl.isl_schedule_node_free.argtypes = [c_void_p] 13394isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13395isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13396 13397class schedule_node_mark(schedule_node): 13398 def __init__(self, *args, **keywords): 13399 if "ptr" in keywords: 13400 self.ctx = keywords["ctx"] 13401 self.ptr = keywords["ptr"] 13402 return 13403 raise Error 13404 def __del__(self): 13405 if hasattr(self, 'ptr'): 13406 isl.isl_schedule_node_free(self.ptr) 13407 def __new__(cls, *args, **keywords): 13408 return super(schedule_node_mark, cls).__new__(cls) 13409 def __str__(arg0): 13410 try: 13411 if not arg0.__class__ is schedule_node_mark: 13412 arg0 = schedule_node_mark(arg0) 13413 except: 13414 raise 13415 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13416 res = cast(ptr, c_char_p).value.decode('ascii') 13417 libc.free(ptr) 13418 return res 13419 def __repr__(self): 13420 s = str(self) 13421 if '"' in s: 13422 return 'isl.schedule_node_mark("""%s""")' % s 13423 else: 13424 return 'isl.schedule_node_mark("%s")' % s 13425 13426isl.isl_schedule_node_copy.restype = c_void_p 13427isl.isl_schedule_node_copy.argtypes = [c_void_p] 13428isl.isl_schedule_node_free.restype = c_void_p 13429isl.isl_schedule_node_free.argtypes = [c_void_p] 13430isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13431isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13432 13433class schedule_node_sequence(schedule_node): 13434 def __init__(self, *args, **keywords): 13435 if "ptr" in keywords: 13436 self.ctx = keywords["ctx"] 13437 self.ptr = keywords["ptr"] 13438 return 13439 raise Error 13440 def __del__(self): 13441 if hasattr(self, 'ptr'): 13442 isl.isl_schedule_node_free(self.ptr) 13443 def __new__(cls, *args, **keywords): 13444 return super(schedule_node_sequence, cls).__new__(cls) 13445 def __str__(arg0): 13446 try: 13447 if not arg0.__class__ is schedule_node_sequence: 13448 arg0 = schedule_node_sequence(arg0) 13449 except: 13450 raise 13451 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13452 res = cast(ptr, c_char_p).value.decode('ascii') 13453 libc.free(ptr) 13454 return res 13455 def __repr__(self): 13456 s = str(self) 13457 if '"' in s: 13458 return 'isl.schedule_node_sequence("""%s""")' % s 13459 else: 13460 return 'isl.schedule_node_sequence("%s")' % s 13461 13462isl.isl_schedule_node_copy.restype = c_void_p 13463isl.isl_schedule_node_copy.argtypes = [c_void_p] 13464isl.isl_schedule_node_free.restype = c_void_p 13465isl.isl_schedule_node_free.argtypes = [c_void_p] 13466isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13467isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13468 13469class schedule_node_set(schedule_node): 13470 def __init__(self, *args, **keywords): 13471 if "ptr" in keywords: 13472 self.ctx = keywords["ctx"] 13473 self.ptr = keywords["ptr"] 13474 return 13475 raise Error 13476 def __del__(self): 13477 if hasattr(self, 'ptr'): 13478 isl.isl_schedule_node_free(self.ptr) 13479 def __new__(cls, *args, **keywords): 13480 return super(schedule_node_set, cls).__new__(cls) 13481 def __str__(arg0): 13482 try: 13483 if not arg0.__class__ is schedule_node_set: 13484 arg0 = schedule_node_set(arg0) 13485 except: 13486 raise 13487 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13488 res = cast(ptr, c_char_p).value.decode('ascii') 13489 libc.free(ptr) 13490 return res 13491 def __repr__(self): 13492 s = str(self) 13493 if '"' in s: 13494 return 'isl.schedule_node_set("""%s""")' % s 13495 else: 13496 return 'isl.schedule_node_set("%s")' % s 13497 13498isl.isl_schedule_node_copy.restype = c_void_p 13499isl.isl_schedule_node_copy.argtypes = [c_void_p] 13500isl.isl_schedule_node_free.restype = c_void_p 13501isl.isl_schedule_node_free.argtypes = [c_void_p] 13502isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13503isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13504 13505class space(object): 13506 def __init__(self, *args, **keywords): 13507 if "ptr" in keywords: 13508 self.ctx = keywords["ctx"] 13509 self.ptr = keywords["ptr"] 13510 return 13511 raise Error 13512 def __del__(self): 13513 if hasattr(self, 'ptr'): 13514 isl.isl_space_free(self.ptr) 13515 def __str__(arg0): 13516 try: 13517 if not arg0.__class__ is space: 13518 arg0 = space(arg0) 13519 except: 13520 raise 13521 ptr = isl.isl_space_to_str(arg0.ptr) 13522 res = cast(ptr, c_char_p).value.decode('ascii') 13523 libc.free(ptr) 13524 return res 13525 def __repr__(self): 13526 s = str(self) 13527 if '"' in s: 13528 return 'isl.space("""%s""")' % s 13529 else: 13530 return 'isl.space("%s")' % s 13531 def add_named_tuple(*args): 13532 if len(args) == 3 and (args[1].__class__ is id or type(args[1]) == str) and type(args[2]) == int: 13533 args = list(args) 13534 try: 13535 if not args[1].__class__ is id: 13536 args[1] = id(args[1]) 13537 except: 13538 raise 13539 ctx = args[0].ctx 13540 res = isl.isl_space_add_named_tuple_id_ui(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr), args[2]) 13541 obj = space(ctx=ctx, ptr=res) 13542 return obj 13543 raise Error 13544 def add_unnamed_tuple(*args): 13545 if len(args) == 2 and type(args[1]) == int: 13546 ctx = args[0].ctx 13547 res = isl.isl_space_add_unnamed_tuple_ui(isl.isl_space_copy(args[0].ptr), args[1]) 13548 obj = space(ctx=ctx, ptr=res) 13549 return obj 13550 raise Error 13551 def curry(arg0): 13552 try: 13553 if not arg0.__class__ is space: 13554 arg0 = space(arg0) 13555 except: 13556 raise 13557 ctx = arg0.ctx 13558 res = isl.isl_space_curry(isl.isl_space_copy(arg0.ptr)) 13559 obj = space(ctx=ctx, ptr=res) 13560 return obj 13561 def domain(arg0): 13562 try: 13563 if not arg0.__class__ is space: 13564 arg0 = space(arg0) 13565 except: 13566 raise 13567 ctx = arg0.ctx 13568 res = isl.isl_space_domain(isl.isl_space_copy(arg0.ptr)) 13569 obj = space(ctx=ctx, ptr=res) 13570 return obj 13571 def flatten_domain(arg0): 13572 try: 13573 if not arg0.__class__ is space: 13574 arg0 = space(arg0) 13575 except: 13576 raise 13577 ctx = arg0.ctx 13578 res = isl.isl_space_flatten_domain(isl.isl_space_copy(arg0.ptr)) 13579 obj = space(ctx=ctx, ptr=res) 13580 return obj 13581 def flatten_range(arg0): 13582 try: 13583 if not arg0.__class__ is space: 13584 arg0 = space(arg0) 13585 except: 13586 raise 13587 ctx = arg0.ctx 13588 res = isl.isl_space_flatten_range(isl.isl_space_copy(arg0.ptr)) 13589 obj = space(ctx=ctx, ptr=res) 13590 return obj 13591 def is_equal(arg0, arg1): 13592 try: 13593 if not arg0.__class__ is space: 13594 arg0 = space(arg0) 13595 except: 13596 raise 13597 try: 13598 if not arg1.__class__ is space: 13599 arg1 = space(arg1) 13600 except: 13601 raise 13602 ctx = arg0.ctx 13603 res = isl.isl_space_is_equal(arg0.ptr, arg1.ptr) 13604 if res < 0: 13605 raise 13606 return bool(res) 13607 def is_wrapping(arg0): 13608 try: 13609 if not arg0.__class__ is space: 13610 arg0 = space(arg0) 13611 except: 13612 raise 13613 ctx = arg0.ctx 13614 res = isl.isl_space_is_wrapping(arg0.ptr) 13615 if res < 0: 13616 raise 13617 return bool(res) 13618 def map_from_set(arg0): 13619 try: 13620 if not arg0.__class__ is space: 13621 arg0 = space(arg0) 13622 except: 13623 raise 13624 ctx = arg0.ctx 13625 res = isl.isl_space_map_from_set(isl.isl_space_copy(arg0.ptr)) 13626 obj = space(ctx=ctx, ptr=res) 13627 return obj 13628 def params(arg0): 13629 try: 13630 if not arg0.__class__ is space: 13631 arg0 = space(arg0) 13632 except: 13633 raise 13634 ctx = arg0.ctx 13635 res = isl.isl_space_params(isl.isl_space_copy(arg0.ptr)) 13636 obj = space(ctx=ctx, ptr=res) 13637 return obj 13638 def product(arg0, arg1): 13639 try: 13640 if not arg0.__class__ is space: 13641 arg0 = space(arg0) 13642 except: 13643 raise 13644 try: 13645 if not arg1.__class__ is space: 13646 arg1 = space(arg1) 13647 except: 13648 raise 13649 ctx = arg0.ctx 13650 res = isl.isl_space_product(isl.isl_space_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 13651 obj = space(ctx=ctx, ptr=res) 13652 return obj 13653 def range(arg0): 13654 try: 13655 if not arg0.__class__ is space: 13656 arg0 = space(arg0) 13657 except: 13658 raise 13659 ctx = arg0.ctx 13660 res = isl.isl_space_range(isl.isl_space_copy(arg0.ptr)) 13661 obj = space(ctx=ctx, ptr=res) 13662 return obj 13663 def range_reverse(arg0): 13664 try: 13665 if not arg0.__class__ is space: 13666 arg0 = space(arg0) 13667 except: 13668 raise 13669 ctx = arg0.ctx 13670 res = isl.isl_space_range_reverse(isl.isl_space_copy(arg0.ptr)) 13671 obj = space(ctx=ctx, ptr=res) 13672 return obj 13673 def reverse(arg0): 13674 try: 13675 if not arg0.__class__ is space: 13676 arg0 = space(arg0) 13677 except: 13678 raise 13679 ctx = arg0.ctx 13680 res = isl.isl_space_reverse(isl.isl_space_copy(arg0.ptr)) 13681 obj = space(ctx=ctx, ptr=res) 13682 return obj 13683 def uncurry(arg0): 13684 try: 13685 if not arg0.__class__ is space: 13686 arg0 = space(arg0) 13687 except: 13688 raise 13689 ctx = arg0.ctx 13690 res = isl.isl_space_uncurry(isl.isl_space_copy(arg0.ptr)) 13691 obj = space(ctx=ctx, ptr=res) 13692 return obj 13693 @staticmethod 13694 def unit(): 13695 ctx = Context.getDefaultInstance() 13696 res = isl.isl_space_unit(ctx) 13697 obj = space(ctx=ctx, ptr=res) 13698 return obj 13699 def unwrap(arg0): 13700 try: 13701 if not arg0.__class__ is space: 13702 arg0 = space(arg0) 13703 except: 13704 raise 13705 ctx = arg0.ctx 13706 res = isl.isl_space_unwrap(isl.isl_space_copy(arg0.ptr)) 13707 obj = space(ctx=ctx, ptr=res) 13708 return obj 13709 def wrap(arg0): 13710 try: 13711 if not arg0.__class__ is space: 13712 arg0 = space(arg0) 13713 except: 13714 raise 13715 ctx = arg0.ctx 13716 res = isl.isl_space_wrap(isl.isl_space_copy(arg0.ptr)) 13717 obj = space(ctx=ctx, ptr=res) 13718 return obj 13719 13720isl.isl_space_add_named_tuple_id_ui.restype = c_void_p 13721isl.isl_space_add_named_tuple_id_ui.argtypes = [c_void_p, c_void_p, c_int] 13722isl.isl_space_add_unnamed_tuple_ui.restype = c_void_p 13723isl.isl_space_add_unnamed_tuple_ui.argtypes = [c_void_p, c_int] 13724isl.isl_space_curry.restype = c_void_p 13725isl.isl_space_curry.argtypes = [c_void_p] 13726isl.isl_space_domain.restype = c_void_p 13727isl.isl_space_domain.argtypes = [c_void_p] 13728isl.isl_space_flatten_domain.restype = c_void_p 13729isl.isl_space_flatten_domain.argtypes = [c_void_p] 13730isl.isl_space_flatten_range.restype = c_void_p 13731isl.isl_space_flatten_range.argtypes = [c_void_p] 13732isl.isl_space_is_equal.argtypes = [c_void_p, c_void_p] 13733isl.isl_space_is_wrapping.argtypes = [c_void_p] 13734isl.isl_space_map_from_set.restype = c_void_p 13735isl.isl_space_map_from_set.argtypes = [c_void_p] 13736isl.isl_space_params.restype = c_void_p 13737isl.isl_space_params.argtypes = [c_void_p] 13738isl.isl_space_product.restype = c_void_p 13739isl.isl_space_product.argtypes = [c_void_p, c_void_p] 13740isl.isl_space_range.restype = c_void_p 13741isl.isl_space_range.argtypes = [c_void_p] 13742isl.isl_space_range_reverse.restype = c_void_p 13743isl.isl_space_range_reverse.argtypes = [c_void_p] 13744isl.isl_space_reverse.restype = c_void_p 13745isl.isl_space_reverse.argtypes = [c_void_p] 13746isl.isl_space_uncurry.restype = c_void_p 13747isl.isl_space_uncurry.argtypes = [c_void_p] 13748isl.isl_space_unit.restype = c_void_p 13749isl.isl_space_unit.argtypes = [Context] 13750isl.isl_space_unwrap.restype = c_void_p 13751isl.isl_space_unwrap.argtypes = [c_void_p] 13752isl.isl_space_wrap.restype = c_void_p 13753isl.isl_space_wrap.argtypes = [c_void_p] 13754isl.isl_space_copy.restype = c_void_p 13755isl.isl_space_copy.argtypes = [c_void_p] 13756isl.isl_space_free.restype = c_void_p 13757isl.isl_space_free.argtypes = [c_void_p] 13758isl.isl_space_to_str.restype = POINTER(c_char) 13759isl.isl_space_to_str.argtypes = [c_void_p] 13760 13761class union_access_info(object): 13762 def __init__(self, *args, **keywords): 13763 if "ptr" in keywords: 13764 self.ctx = keywords["ctx"] 13765 self.ptr = keywords["ptr"] 13766 return 13767 if len(args) == 1 and args[0].__class__ is union_map: 13768 self.ctx = Context.getDefaultInstance() 13769 self.ptr = isl.isl_union_access_info_from_sink(isl.isl_union_map_copy(args[0].ptr)) 13770 return 13771 raise Error 13772 def __del__(self): 13773 if hasattr(self, 'ptr'): 13774 isl.isl_union_access_info_free(self.ptr) 13775 def __str__(arg0): 13776 try: 13777 if not arg0.__class__ is union_access_info: 13778 arg0 = union_access_info(arg0) 13779 except: 13780 raise 13781 ptr = isl.isl_union_access_info_to_str(arg0.ptr) 13782 res = cast(ptr, c_char_p).value.decode('ascii') 13783 libc.free(ptr) 13784 return res 13785 def __repr__(self): 13786 s = str(self) 13787 if '"' in s: 13788 return 'isl.union_access_info("""%s""")' % s 13789 else: 13790 return 'isl.union_access_info("%s")' % s 13791 def compute_flow(arg0): 13792 try: 13793 if not arg0.__class__ is union_access_info: 13794 arg0 = union_access_info(arg0) 13795 except: 13796 raise 13797 ctx = arg0.ctx 13798 res = isl.isl_union_access_info_compute_flow(isl.isl_union_access_info_copy(arg0.ptr)) 13799 obj = union_flow(ctx=ctx, ptr=res) 13800 return obj 13801 def set_kill(arg0, arg1): 13802 try: 13803 if not arg0.__class__ is union_access_info: 13804 arg0 = union_access_info(arg0) 13805 except: 13806 raise 13807 try: 13808 if not arg1.__class__ is union_map: 13809 arg1 = union_map(arg1) 13810 except: 13811 raise 13812 ctx = arg0.ctx 13813 res = isl.isl_union_access_info_set_kill(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13814 obj = union_access_info(ctx=ctx, ptr=res) 13815 return obj 13816 def set_may_source(arg0, arg1): 13817 try: 13818 if not arg0.__class__ is union_access_info: 13819 arg0 = union_access_info(arg0) 13820 except: 13821 raise 13822 try: 13823 if not arg1.__class__ is union_map: 13824 arg1 = union_map(arg1) 13825 except: 13826 raise 13827 ctx = arg0.ctx 13828 res = isl.isl_union_access_info_set_may_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13829 obj = union_access_info(ctx=ctx, ptr=res) 13830 return obj 13831 def set_must_source(arg0, arg1): 13832 try: 13833 if not arg0.__class__ is union_access_info: 13834 arg0 = union_access_info(arg0) 13835 except: 13836 raise 13837 try: 13838 if not arg1.__class__ is union_map: 13839 arg1 = union_map(arg1) 13840 except: 13841 raise 13842 ctx = arg0.ctx 13843 res = isl.isl_union_access_info_set_must_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13844 obj = union_access_info(ctx=ctx, ptr=res) 13845 return obj 13846 def set_schedule(arg0, arg1): 13847 try: 13848 if not arg0.__class__ is union_access_info: 13849 arg0 = union_access_info(arg0) 13850 except: 13851 raise 13852 try: 13853 if not arg1.__class__ is schedule: 13854 arg1 = schedule(arg1) 13855 except: 13856 raise 13857 ctx = arg0.ctx 13858 res = isl.isl_union_access_info_set_schedule(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_schedule_copy(arg1.ptr)) 13859 obj = union_access_info(ctx=ctx, ptr=res) 13860 return obj 13861 def set_schedule_map(arg0, arg1): 13862 try: 13863 if not arg0.__class__ is union_access_info: 13864 arg0 = union_access_info(arg0) 13865 except: 13866 raise 13867 try: 13868 if not arg1.__class__ is union_map: 13869 arg1 = union_map(arg1) 13870 except: 13871 raise 13872 ctx = arg0.ctx 13873 res = isl.isl_union_access_info_set_schedule_map(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13874 obj = union_access_info(ctx=ctx, ptr=res) 13875 return obj 13876 13877isl.isl_union_access_info_from_sink.restype = c_void_p 13878isl.isl_union_access_info_from_sink.argtypes = [c_void_p] 13879isl.isl_union_access_info_compute_flow.restype = c_void_p 13880isl.isl_union_access_info_compute_flow.argtypes = [c_void_p] 13881isl.isl_union_access_info_set_kill.restype = c_void_p 13882isl.isl_union_access_info_set_kill.argtypes = [c_void_p, c_void_p] 13883isl.isl_union_access_info_set_may_source.restype = c_void_p 13884isl.isl_union_access_info_set_may_source.argtypes = [c_void_p, c_void_p] 13885isl.isl_union_access_info_set_must_source.restype = c_void_p 13886isl.isl_union_access_info_set_must_source.argtypes = [c_void_p, c_void_p] 13887isl.isl_union_access_info_set_schedule.restype = c_void_p 13888isl.isl_union_access_info_set_schedule.argtypes = [c_void_p, c_void_p] 13889isl.isl_union_access_info_set_schedule_map.restype = c_void_p 13890isl.isl_union_access_info_set_schedule_map.argtypes = [c_void_p, c_void_p] 13891isl.isl_union_access_info_copy.restype = c_void_p 13892isl.isl_union_access_info_copy.argtypes = [c_void_p] 13893isl.isl_union_access_info_free.restype = c_void_p 13894isl.isl_union_access_info_free.argtypes = [c_void_p] 13895isl.isl_union_access_info_to_str.restype = POINTER(c_char) 13896isl.isl_union_access_info_to_str.argtypes = [c_void_p] 13897 13898class union_flow(object): 13899 def __init__(self, *args, **keywords): 13900 if "ptr" in keywords: 13901 self.ctx = keywords["ctx"] 13902 self.ptr = keywords["ptr"] 13903 return 13904 raise Error 13905 def __del__(self): 13906 if hasattr(self, 'ptr'): 13907 isl.isl_union_flow_free(self.ptr) 13908 def __str__(arg0): 13909 try: 13910 if not arg0.__class__ is union_flow: 13911 arg0 = union_flow(arg0) 13912 except: 13913 raise 13914 ptr = isl.isl_union_flow_to_str(arg0.ptr) 13915 res = cast(ptr, c_char_p).value.decode('ascii') 13916 libc.free(ptr) 13917 return res 13918 def __repr__(self): 13919 s = str(self) 13920 if '"' in s: 13921 return 'isl.union_flow("""%s""")' % s 13922 else: 13923 return 'isl.union_flow("%s")' % s 13924 def full_may_dependence(arg0): 13925 try: 13926 if not arg0.__class__ is union_flow: 13927 arg0 = union_flow(arg0) 13928 except: 13929 raise 13930 ctx = arg0.ctx 13931 res = isl.isl_union_flow_get_full_may_dependence(arg0.ptr) 13932 obj = union_map(ctx=ctx, ptr=res) 13933 return obj 13934 def get_full_may_dependence(arg0): 13935 return arg0.full_may_dependence() 13936 def full_must_dependence(arg0): 13937 try: 13938 if not arg0.__class__ is union_flow: 13939 arg0 = union_flow(arg0) 13940 except: 13941 raise 13942 ctx = arg0.ctx 13943 res = isl.isl_union_flow_get_full_must_dependence(arg0.ptr) 13944 obj = union_map(ctx=ctx, ptr=res) 13945 return obj 13946 def get_full_must_dependence(arg0): 13947 return arg0.full_must_dependence() 13948 def may_dependence(arg0): 13949 try: 13950 if not arg0.__class__ is union_flow: 13951 arg0 = union_flow(arg0) 13952 except: 13953 raise 13954 ctx = arg0.ctx 13955 res = isl.isl_union_flow_get_may_dependence(arg0.ptr) 13956 obj = union_map(ctx=ctx, ptr=res) 13957 return obj 13958 def get_may_dependence(arg0): 13959 return arg0.may_dependence() 13960 def may_no_source(arg0): 13961 try: 13962 if not arg0.__class__ is union_flow: 13963 arg0 = union_flow(arg0) 13964 except: 13965 raise 13966 ctx = arg0.ctx 13967 res = isl.isl_union_flow_get_may_no_source(arg0.ptr) 13968 obj = union_map(ctx=ctx, ptr=res) 13969 return obj 13970 def get_may_no_source(arg0): 13971 return arg0.may_no_source() 13972 def must_dependence(arg0): 13973 try: 13974 if not arg0.__class__ is union_flow: 13975 arg0 = union_flow(arg0) 13976 except: 13977 raise 13978 ctx = arg0.ctx 13979 res = isl.isl_union_flow_get_must_dependence(arg0.ptr) 13980 obj = union_map(ctx=ctx, ptr=res) 13981 return obj 13982 def get_must_dependence(arg0): 13983 return arg0.must_dependence() 13984 def must_no_source(arg0): 13985 try: 13986 if not arg0.__class__ is union_flow: 13987 arg0 = union_flow(arg0) 13988 except: 13989 raise 13990 ctx = arg0.ctx 13991 res = isl.isl_union_flow_get_must_no_source(arg0.ptr) 13992 obj = union_map(ctx=ctx, ptr=res) 13993 return obj 13994 def get_must_no_source(arg0): 13995 return arg0.must_no_source() 13996 13997isl.isl_union_flow_get_full_may_dependence.restype = c_void_p 13998isl.isl_union_flow_get_full_may_dependence.argtypes = [c_void_p] 13999isl.isl_union_flow_get_full_must_dependence.restype = c_void_p 14000isl.isl_union_flow_get_full_must_dependence.argtypes = [c_void_p] 14001isl.isl_union_flow_get_may_dependence.restype = c_void_p 14002isl.isl_union_flow_get_may_dependence.argtypes = [c_void_p] 14003isl.isl_union_flow_get_may_no_source.restype = c_void_p 14004isl.isl_union_flow_get_may_no_source.argtypes = [c_void_p] 14005isl.isl_union_flow_get_must_dependence.restype = c_void_p 14006isl.isl_union_flow_get_must_dependence.argtypes = [c_void_p] 14007isl.isl_union_flow_get_must_no_source.restype = c_void_p 14008isl.isl_union_flow_get_must_no_source.argtypes = [c_void_p] 14009isl.isl_union_flow_copy.restype = c_void_p 14010isl.isl_union_flow_copy.argtypes = [c_void_p] 14011isl.isl_union_flow_free.restype = c_void_p 14012isl.isl_union_flow_free.argtypes = [c_void_p] 14013isl.isl_union_flow_to_str.restype = POINTER(c_char) 14014isl.isl_union_flow_to_str.argtypes = [c_void_p] 14015 14016class union_pw_aff_list(object): 14017 def __init__(self, *args, **keywords): 14018 if "ptr" in keywords: 14019 self.ctx = keywords["ctx"] 14020 self.ptr = keywords["ptr"] 14021 return 14022 if len(args) == 1 and type(args[0]) == int: 14023 self.ctx = Context.getDefaultInstance() 14024 self.ptr = isl.isl_union_pw_aff_list_alloc(self.ctx, args[0]) 14025 return 14026 if len(args) == 1 and args[0].__class__ is union_pw_aff: 14027 self.ctx = Context.getDefaultInstance() 14028 self.ptr = isl.isl_union_pw_aff_list_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 14029 return 14030 raise Error 14031 def __del__(self): 14032 if hasattr(self, 'ptr'): 14033 isl.isl_union_pw_aff_list_free(self.ptr) 14034 def __str__(arg0): 14035 try: 14036 if not arg0.__class__ is union_pw_aff_list: 14037 arg0 = union_pw_aff_list(arg0) 14038 except: 14039 raise 14040 ptr = isl.isl_union_pw_aff_list_to_str(arg0.ptr) 14041 res = cast(ptr, c_char_p).value.decode('ascii') 14042 libc.free(ptr) 14043 return res 14044 def __repr__(self): 14045 s = str(self) 14046 if '"' in s: 14047 return 'isl.union_pw_aff_list("""%s""")' % s 14048 else: 14049 return 'isl.union_pw_aff_list("%s")' % s 14050 def add(arg0, arg1): 14051 try: 14052 if not arg0.__class__ is union_pw_aff_list: 14053 arg0 = union_pw_aff_list(arg0) 14054 except: 14055 raise 14056 try: 14057 if not arg1.__class__ is union_pw_aff: 14058 arg1 = union_pw_aff(arg1) 14059 except: 14060 raise 14061 ctx = arg0.ctx 14062 res = isl.isl_union_pw_aff_list_add(isl.isl_union_pw_aff_list_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 14063 obj = union_pw_aff_list(ctx=ctx, ptr=res) 14064 return obj 14065 def clear(arg0): 14066 try: 14067 if not arg0.__class__ is union_pw_aff_list: 14068 arg0 = union_pw_aff_list(arg0) 14069 except: 14070 raise 14071 ctx = arg0.ctx 14072 res = isl.isl_union_pw_aff_list_clear(isl.isl_union_pw_aff_list_copy(arg0.ptr)) 14073 obj = union_pw_aff_list(ctx=ctx, ptr=res) 14074 return obj 14075 def concat(arg0, arg1): 14076 try: 14077 if not arg0.__class__ is union_pw_aff_list: 14078 arg0 = union_pw_aff_list(arg0) 14079 except: 14080 raise 14081 try: 14082 if not arg1.__class__ is union_pw_aff_list: 14083 arg1 = union_pw_aff_list(arg1) 14084 except: 14085 raise 14086 ctx = arg0.ctx 14087 res = isl.isl_union_pw_aff_list_concat(isl.isl_union_pw_aff_list_copy(arg0.ptr), isl.isl_union_pw_aff_list_copy(arg1.ptr)) 14088 obj = union_pw_aff_list(ctx=ctx, ptr=res) 14089 return obj 14090 def drop(arg0, arg1, arg2): 14091 try: 14092 if not arg0.__class__ is union_pw_aff_list: 14093 arg0 = union_pw_aff_list(arg0) 14094 except: 14095 raise 14096 ctx = arg0.ctx 14097 res = isl.isl_union_pw_aff_list_drop(isl.isl_union_pw_aff_list_copy(arg0.ptr), arg1, arg2) 14098 obj = union_pw_aff_list(ctx=ctx, ptr=res) 14099 return obj 14100 def foreach(arg0, arg1): 14101 try: 14102 if not arg0.__class__ is union_pw_aff_list: 14103 arg0 = union_pw_aff_list(arg0) 14104 except: 14105 raise 14106 exc_info = [None] 14107 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14108 def cb_func(cb_arg0, cb_arg1): 14109 cb_arg0 = union_pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 14110 try: 14111 arg1(cb_arg0) 14112 except: 14113 import sys 14114 exc_info[0] = sys.exc_info() 14115 return -1 14116 return 0 14117 cb = fn(cb_func) 14118 ctx = arg0.ctx 14119 res = isl.isl_union_pw_aff_list_foreach(arg0.ptr, cb, None) 14120 if exc_info[0] != None: 14121 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 14122 if res < 0: 14123 raise 14124 def at(arg0, arg1): 14125 try: 14126 if not arg0.__class__ is union_pw_aff_list: 14127 arg0 = union_pw_aff_list(arg0) 14128 except: 14129 raise 14130 ctx = arg0.ctx 14131 res = isl.isl_union_pw_aff_list_get_at(arg0.ptr, arg1) 14132 obj = union_pw_aff(ctx=ctx, ptr=res) 14133 return obj 14134 def get_at(arg0, arg1): 14135 return arg0.at(arg1) 14136 def insert(arg0, arg1, arg2): 14137 try: 14138 if not arg0.__class__ is union_pw_aff_list: 14139 arg0 = union_pw_aff_list(arg0) 14140 except: 14141 raise 14142 try: 14143 if not arg2.__class__ is union_pw_aff: 14144 arg2 = union_pw_aff(arg2) 14145 except: 14146 raise 14147 ctx = arg0.ctx 14148 res = isl.isl_union_pw_aff_list_insert(isl.isl_union_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_union_pw_aff_copy(arg2.ptr)) 14149 obj = union_pw_aff_list(ctx=ctx, ptr=res) 14150 return obj 14151 def size(arg0): 14152 try: 14153 if not arg0.__class__ is union_pw_aff_list: 14154 arg0 = union_pw_aff_list(arg0) 14155 except: 14156 raise 14157 ctx = arg0.ctx 14158 res = isl.isl_union_pw_aff_list_size(arg0.ptr) 14159 if res < 0: 14160 raise 14161 return int(res) 14162 14163isl.isl_union_pw_aff_list_alloc.restype = c_void_p 14164isl.isl_union_pw_aff_list_alloc.argtypes = [Context, c_int] 14165isl.isl_union_pw_aff_list_from_union_pw_aff.restype = c_void_p 14166isl.isl_union_pw_aff_list_from_union_pw_aff.argtypes = [c_void_p] 14167isl.isl_union_pw_aff_list_add.restype = c_void_p 14168isl.isl_union_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 14169isl.isl_union_pw_aff_list_clear.restype = c_void_p 14170isl.isl_union_pw_aff_list_clear.argtypes = [c_void_p] 14171isl.isl_union_pw_aff_list_concat.restype = c_void_p 14172isl.isl_union_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 14173isl.isl_union_pw_aff_list_drop.restype = c_void_p 14174isl.isl_union_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 14175isl.isl_union_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 14176isl.isl_union_pw_aff_list_get_at.restype = c_void_p 14177isl.isl_union_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 14178isl.isl_union_pw_aff_list_insert.restype = c_void_p 14179isl.isl_union_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 14180isl.isl_union_pw_aff_list_size.argtypes = [c_void_p] 14181isl.isl_union_pw_aff_list_copy.restype = c_void_p 14182isl.isl_union_pw_aff_list_copy.argtypes = [c_void_p] 14183isl.isl_union_pw_aff_list_free.restype = c_void_p 14184isl.isl_union_pw_aff_list_free.argtypes = [c_void_p] 14185isl.isl_union_pw_aff_list_to_str.restype = POINTER(c_char) 14186isl.isl_union_pw_aff_list_to_str.argtypes = [c_void_p] 14187 14188class union_set_list(object): 14189 def __init__(self, *args, **keywords): 14190 if "ptr" in keywords: 14191 self.ctx = keywords["ctx"] 14192 self.ptr = keywords["ptr"] 14193 return 14194 if len(args) == 1 and type(args[0]) == int: 14195 self.ctx = Context.getDefaultInstance() 14196 self.ptr = isl.isl_union_set_list_alloc(self.ctx, args[0]) 14197 return 14198 if len(args) == 1 and args[0].__class__ is union_set: 14199 self.ctx = Context.getDefaultInstance() 14200 self.ptr = isl.isl_union_set_list_from_union_set(isl.isl_union_set_copy(args[0].ptr)) 14201 return 14202 raise Error 14203 def __del__(self): 14204 if hasattr(self, 'ptr'): 14205 isl.isl_union_set_list_free(self.ptr) 14206 def __str__(arg0): 14207 try: 14208 if not arg0.__class__ is union_set_list: 14209 arg0 = union_set_list(arg0) 14210 except: 14211 raise 14212 ptr = isl.isl_union_set_list_to_str(arg0.ptr) 14213 res = cast(ptr, c_char_p).value.decode('ascii') 14214 libc.free(ptr) 14215 return res 14216 def __repr__(self): 14217 s = str(self) 14218 if '"' in s: 14219 return 'isl.union_set_list("""%s""")' % s 14220 else: 14221 return 'isl.union_set_list("%s")' % s 14222 def add(arg0, arg1): 14223 try: 14224 if not arg0.__class__ is union_set_list: 14225 arg0 = union_set_list(arg0) 14226 except: 14227 raise 14228 try: 14229 if not arg1.__class__ is union_set: 14230 arg1 = union_set(arg1) 14231 except: 14232 raise 14233 ctx = arg0.ctx 14234 res = isl.isl_union_set_list_add(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 14235 obj = union_set_list(ctx=ctx, ptr=res) 14236 return obj 14237 def clear(arg0): 14238 try: 14239 if not arg0.__class__ is union_set_list: 14240 arg0 = union_set_list(arg0) 14241 except: 14242 raise 14243 ctx = arg0.ctx 14244 res = isl.isl_union_set_list_clear(isl.isl_union_set_list_copy(arg0.ptr)) 14245 obj = union_set_list(ctx=ctx, ptr=res) 14246 return obj 14247 def concat(arg0, arg1): 14248 try: 14249 if not arg0.__class__ is union_set_list: 14250 arg0 = union_set_list(arg0) 14251 except: 14252 raise 14253 try: 14254 if not arg1.__class__ is union_set_list: 14255 arg1 = union_set_list(arg1) 14256 except: 14257 raise 14258 ctx = arg0.ctx 14259 res = isl.isl_union_set_list_concat(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 14260 obj = union_set_list(ctx=ctx, ptr=res) 14261 return obj 14262 def drop(arg0, arg1, arg2): 14263 try: 14264 if not arg0.__class__ is union_set_list: 14265 arg0 = union_set_list(arg0) 14266 except: 14267 raise 14268 ctx = arg0.ctx 14269 res = isl.isl_union_set_list_drop(isl.isl_union_set_list_copy(arg0.ptr), arg1, arg2) 14270 obj = union_set_list(ctx=ctx, ptr=res) 14271 return obj 14272 def foreach(arg0, arg1): 14273 try: 14274 if not arg0.__class__ is union_set_list: 14275 arg0 = union_set_list(arg0) 14276 except: 14277 raise 14278 exc_info = [None] 14279 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14280 def cb_func(cb_arg0, cb_arg1): 14281 cb_arg0 = union_set(ctx=arg0.ctx, ptr=(cb_arg0)) 14282 try: 14283 arg1(cb_arg0) 14284 except: 14285 import sys 14286 exc_info[0] = sys.exc_info() 14287 return -1 14288 return 0 14289 cb = fn(cb_func) 14290 ctx = arg0.ctx 14291 res = isl.isl_union_set_list_foreach(arg0.ptr, cb, None) 14292 if exc_info[0] != None: 14293 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 14294 if res < 0: 14295 raise 14296 def at(arg0, arg1): 14297 try: 14298 if not arg0.__class__ is union_set_list: 14299 arg0 = union_set_list(arg0) 14300 except: 14301 raise 14302 ctx = arg0.ctx 14303 res = isl.isl_union_set_list_get_at(arg0.ptr, arg1) 14304 obj = union_set(ctx=ctx, ptr=res) 14305 return obj 14306 def get_at(arg0, arg1): 14307 return arg0.at(arg1) 14308 def insert(arg0, arg1, arg2): 14309 try: 14310 if not arg0.__class__ is union_set_list: 14311 arg0 = union_set_list(arg0) 14312 except: 14313 raise 14314 try: 14315 if not arg2.__class__ is union_set: 14316 arg2 = union_set(arg2) 14317 except: 14318 raise 14319 ctx = arg0.ctx 14320 res = isl.isl_union_set_list_insert(isl.isl_union_set_list_copy(arg0.ptr), arg1, isl.isl_union_set_copy(arg2.ptr)) 14321 obj = union_set_list(ctx=ctx, ptr=res) 14322 return obj 14323 def size(arg0): 14324 try: 14325 if not arg0.__class__ is union_set_list: 14326 arg0 = union_set_list(arg0) 14327 except: 14328 raise 14329 ctx = arg0.ctx 14330 res = isl.isl_union_set_list_size(arg0.ptr) 14331 if res < 0: 14332 raise 14333 return int(res) 14334 14335isl.isl_union_set_list_alloc.restype = c_void_p 14336isl.isl_union_set_list_alloc.argtypes = [Context, c_int] 14337isl.isl_union_set_list_from_union_set.restype = c_void_p 14338isl.isl_union_set_list_from_union_set.argtypes = [c_void_p] 14339isl.isl_union_set_list_add.restype = c_void_p 14340isl.isl_union_set_list_add.argtypes = [c_void_p, c_void_p] 14341isl.isl_union_set_list_clear.restype = c_void_p 14342isl.isl_union_set_list_clear.argtypes = [c_void_p] 14343isl.isl_union_set_list_concat.restype = c_void_p 14344isl.isl_union_set_list_concat.argtypes = [c_void_p, c_void_p] 14345isl.isl_union_set_list_drop.restype = c_void_p 14346isl.isl_union_set_list_drop.argtypes = [c_void_p, c_int, c_int] 14347isl.isl_union_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 14348isl.isl_union_set_list_get_at.restype = c_void_p 14349isl.isl_union_set_list_get_at.argtypes = [c_void_p, c_int] 14350isl.isl_union_set_list_insert.restype = c_void_p 14351isl.isl_union_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] 14352isl.isl_union_set_list_size.argtypes = [c_void_p] 14353isl.isl_union_set_list_copy.restype = c_void_p 14354isl.isl_union_set_list_copy.argtypes = [c_void_p] 14355isl.isl_union_set_list_free.restype = c_void_p 14356isl.isl_union_set_list_free.argtypes = [c_void_p] 14357isl.isl_union_set_list_to_str.restype = POINTER(c_char) 14358isl.isl_union_set_list_to_str.argtypes = [c_void_p] 14359 14360class val(object): 14361 def __init__(self, *args, **keywords): 14362 if "ptr" in keywords: 14363 self.ctx = keywords["ctx"] 14364 self.ptr = keywords["ptr"] 14365 return 14366 if len(args) == 1 and type(args[0]) == int: 14367 self.ctx = Context.getDefaultInstance() 14368 self.ptr = isl.isl_val_int_from_si(self.ctx, args[0]) 14369 return 14370 if len(args) == 1 and type(args[0]) == str: 14371 self.ctx = Context.getDefaultInstance() 14372 self.ptr = isl.isl_val_read_from_str(self.ctx, args[0].encode('ascii')) 14373 return 14374 raise Error 14375 def __del__(self): 14376 if hasattr(self, 'ptr'): 14377 isl.isl_val_free(self.ptr) 14378 def __str__(arg0): 14379 try: 14380 if not arg0.__class__ is val: 14381 arg0 = val(arg0) 14382 except: 14383 raise 14384 ptr = isl.isl_val_to_str(arg0.ptr) 14385 res = cast(ptr, c_char_p).value.decode('ascii') 14386 libc.free(ptr) 14387 return res 14388 def __repr__(self): 14389 s = str(self) 14390 if '"' in s: 14391 return 'isl.val("""%s""")' % s 14392 else: 14393 return 'isl.val("%s")' % s 14394 def abs(arg0): 14395 try: 14396 if not arg0.__class__ is val: 14397 arg0 = val(arg0) 14398 except: 14399 raise 14400 ctx = arg0.ctx 14401 res = isl.isl_val_abs(isl.isl_val_copy(arg0.ptr)) 14402 obj = val(ctx=ctx, ptr=res) 14403 return obj 14404 def abs_eq(arg0, arg1): 14405 try: 14406 if not arg0.__class__ is val: 14407 arg0 = val(arg0) 14408 except: 14409 raise 14410 try: 14411 if not arg1.__class__ is val: 14412 arg1 = val(arg1) 14413 except: 14414 raise 14415 ctx = arg0.ctx 14416 res = isl.isl_val_abs_eq(arg0.ptr, arg1.ptr) 14417 if res < 0: 14418 raise 14419 return bool(res) 14420 def add(arg0, arg1): 14421 try: 14422 if not arg0.__class__ is val: 14423 arg0 = val(arg0) 14424 except: 14425 raise 14426 try: 14427 if not arg1.__class__ is val: 14428 arg1 = val(arg1) 14429 except: 14430 raise 14431 ctx = arg0.ctx 14432 res = isl.isl_val_add(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14433 obj = val(ctx=ctx, ptr=res) 14434 return obj 14435 def ceil(arg0): 14436 try: 14437 if not arg0.__class__ is val: 14438 arg0 = val(arg0) 14439 except: 14440 raise 14441 ctx = arg0.ctx 14442 res = isl.isl_val_ceil(isl.isl_val_copy(arg0.ptr)) 14443 obj = val(ctx=ctx, ptr=res) 14444 return obj 14445 def cmp_si(arg0, arg1): 14446 try: 14447 if not arg0.__class__ is val: 14448 arg0 = val(arg0) 14449 except: 14450 raise 14451 ctx = arg0.ctx 14452 res = isl.isl_val_cmp_si(arg0.ptr, arg1) 14453 return res 14454 def div(arg0, arg1): 14455 try: 14456 if not arg0.__class__ is val: 14457 arg0 = val(arg0) 14458 except: 14459 raise 14460 try: 14461 if not arg1.__class__ is val: 14462 arg1 = val(arg1) 14463 except: 14464 raise 14465 ctx = arg0.ctx 14466 res = isl.isl_val_div(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14467 obj = val(ctx=ctx, ptr=res) 14468 return obj 14469 def eq(arg0, arg1): 14470 try: 14471 if not arg0.__class__ is val: 14472 arg0 = val(arg0) 14473 except: 14474 raise 14475 try: 14476 if not arg1.__class__ is val: 14477 arg1 = val(arg1) 14478 except: 14479 raise 14480 ctx = arg0.ctx 14481 res = isl.isl_val_eq(arg0.ptr, arg1.ptr) 14482 if res < 0: 14483 raise 14484 return bool(res) 14485 def floor(arg0): 14486 try: 14487 if not arg0.__class__ is val: 14488 arg0 = val(arg0) 14489 except: 14490 raise 14491 ctx = arg0.ctx 14492 res = isl.isl_val_floor(isl.isl_val_copy(arg0.ptr)) 14493 obj = val(ctx=ctx, ptr=res) 14494 return obj 14495 def gcd(arg0, arg1): 14496 try: 14497 if not arg0.__class__ is val: 14498 arg0 = val(arg0) 14499 except: 14500 raise 14501 try: 14502 if not arg1.__class__ is val: 14503 arg1 = val(arg1) 14504 except: 14505 raise 14506 ctx = arg0.ctx 14507 res = isl.isl_val_gcd(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14508 obj = val(ctx=ctx, ptr=res) 14509 return obj 14510 def ge(arg0, arg1): 14511 try: 14512 if not arg0.__class__ is val: 14513 arg0 = val(arg0) 14514 except: 14515 raise 14516 try: 14517 if not arg1.__class__ is val: 14518 arg1 = val(arg1) 14519 except: 14520 raise 14521 ctx = arg0.ctx 14522 res = isl.isl_val_ge(arg0.ptr, arg1.ptr) 14523 if res < 0: 14524 raise 14525 return bool(res) 14526 def den_si(arg0): 14527 try: 14528 if not arg0.__class__ is val: 14529 arg0 = val(arg0) 14530 except: 14531 raise 14532 ctx = arg0.ctx 14533 res = isl.isl_val_get_den_si(arg0.ptr) 14534 return res 14535 def get_den_si(arg0): 14536 return arg0.den_si() 14537 def num_si(arg0): 14538 try: 14539 if not arg0.__class__ is val: 14540 arg0 = val(arg0) 14541 except: 14542 raise 14543 ctx = arg0.ctx 14544 res = isl.isl_val_get_num_si(arg0.ptr) 14545 return res 14546 def get_num_si(arg0): 14547 return arg0.num_si() 14548 def gt(arg0, arg1): 14549 try: 14550 if not arg0.__class__ is val: 14551 arg0 = val(arg0) 14552 except: 14553 raise 14554 try: 14555 if not arg1.__class__ is val: 14556 arg1 = val(arg1) 14557 except: 14558 raise 14559 ctx = arg0.ctx 14560 res = isl.isl_val_gt(arg0.ptr, arg1.ptr) 14561 if res < 0: 14562 raise 14563 return bool(res) 14564 @staticmethod 14565 def infty(): 14566 ctx = Context.getDefaultInstance() 14567 res = isl.isl_val_infty(ctx) 14568 obj = val(ctx=ctx, ptr=res) 14569 return obj 14570 def inv(arg0): 14571 try: 14572 if not arg0.__class__ is val: 14573 arg0 = val(arg0) 14574 except: 14575 raise 14576 ctx = arg0.ctx 14577 res = isl.isl_val_inv(isl.isl_val_copy(arg0.ptr)) 14578 obj = val(ctx=ctx, ptr=res) 14579 return obj 14580 def is_divisible_by(arg0, arg1): 14581 try: 14582 if not arg0.__class__ is val: 14583 arg0 = val(arg0) 14584 except: 14585 raise 14586 try: 14587 if not arg1.__class__ is val: 14588 arg1 = val(arg1) 14589 except: 14590 raise 14591 ctx = arg0.ctx 14592 res = isl.isl_val_is_divisible_by(arg0.ptr, arg1.ptr) 14593 if res < 0: 14594 raise 14595 return bool(res) 14596 def is_infty(arg0): 14597 try: 14598 if not arg0.__class__ is val: 14599 arg0 = val(arg0) 14600 except: 14601 raise 14602 ctx = arg0.ctx 14603 res = isl.isl_val_is_infty(arg0.ptr) 14604 if res < 0: 14605 raise 14606 return bool(res) 14607 def is_int(arg0): 14608 try: 14609 if not arg0.__class__ is val: 14610 arg0 = val(arg0) 14611 except: 14612 raise 14613 ctx = arg0.ctx 14614 res = isl.isl_val_is_int(arg0.ptr) 14615 if res < 0: 14616 raise 14617 return bool(res) 14618 def is_nan(arg0): 14619 try: 14620 if not arg0.__class__ is val: 14621 arg0 = val(arg0) 14622 except: 14623 raise 14624 ctx = arg0.ctx 14625 res = isl.isl_val_is_nan(arg0.ptr) 14626 if res < 0: 14627 raise 14628 return bool(res) 14629 def is_neg(arg0): 14630 try: 14631 if not arg0.__class__ is val: 14632 arg0 = val(arg0) 14633 except: 14634 raise 14635 ctx = arg0.ctx 14636 res = isl.isl_val_is_neg(arg0.ptr) 14637 if res < 0: 14638 raise 14639 return bool(res) 14640 def is_neginfty(arg0): 14641 try: 14642 if not arg0.__class__ is val: 14643 arg0 = val(arg0) 14644 except: 14645 raise 14646 ctx = arg0.ctx 14647 res = isl.isl_val_is_neginfty(arg0.ptr) 14648 if res < 0: 14649 raise 14650 return bool(res) 14651 def is_negone(arg0): 14652 try: 14653 if not arg0.__class__ is val: 14654 arg0 = val(arg0) 14655 except: 14656 raise 14657 ctx = arg0.ctx 14658 res = isl.isl_val_is_negone(arg0.ptr) 14659 if res < 0: 14660 raise 14661 return bool(res) 14662 def is_nonneg(arg0): 14663 try: 14664 if not arg0.__class__ is val: 14665 arg0 = val(arg0) 14666 except: 14667 raise 14668 ctx = arg0.ctx 14669 res = isl.isl_val_is_nonneg(arg0.ptr) 14670 if res < 0: 14671 raise 14672 return bool(res) 14673 def is_nonpos(arg0): 14674 try: 14675 if not arg0.__class__ is val: 14676 arg0 = val(arg0) 14677 except: 14678 raise 14679 ctx = arg0.ctx 14680 res = isl.isl_val_is_nonpos(arg0.ptr) 14681 if res < 0: 14682 raise 14683 return bool(res) 14684 def is_one(arg0): 14685 try: 14686 if not arg0.__class__ is val: 14687 arg0 = val(arg0) 14688 except: 14689 raise 14690 ctx = arg0.ctx 14691 res = isl.isl_val_is_one(arg0.ptr) 14692 if res < 0: 14693 raise 14694 return bool(res) 14695 def is_pos(arg0): 14696 try: 14697 if not arg0.__class__ is val: 14698 arg0 = val(arg0) 14699 except: 14700 raise 14701 ctx = arg0.ctx 14702 res = isl.isl_val_is_pos(arg0.ptr) 14703 if res < 0: 14704 raise 14705 return bool(res) 14706 def is_rat(arg0): 14707 try: 14708 if not arg0.__class__ is val: 14709 arg0 = val(arg0) 14710 except: 14711 raise 14712 ctx = arg0.ctx 14713 res = isl.isl_val_is_rat(arg0.ptr) 14714 if res < 0: 14715 raise 14716 return bool(res) 14717 def is_zero(arg0): 14718 try: 14719 if not arg0.__class__ is val: 14720 arg0 = val(arg0) 14721 except: 14722 raise 14723 ctx = arg0.ctx 14724 res = isl.isl_val_is_zero(arg0.ptr) 14725 if res < 0: 14726 raise 14727 return bool(res) 14728 def le(arg0, arg1): 14729 try: 14730 if not arg0.__class__ is val: 14731 arg0 = val(arg0) 14732 except: 14733 raise 14734 try: 14735 if not arg1.__class__ is val: 14736 arg1 = val(arg1) 14737 except: 14738 raise 14739 ctx = arg0.ctx 14740 res = isl.isl_val_le(arg0.ptr, arg1.ptr) 14741 if res < 0: 14742 raise 14743 return bool(res) 14744 def lt(arg0, arg1): 14745 try: 14746 if not arg0.__class__ is val: 14747 arg0 = val(arg0) 14748 except: 14749 raise 14750 try: 14751 if not arg1.__class__ is val: 14752 arg1 = val(arg1) 14753 except: 14754 raise 14755 ctx = arg0.ctx 14756 res = isl.isl_val_lt(arg0.ptr, arg1.ptr) 14757 if res < 0: 14758 raise 14759 return bool(res) 14760 def max(arg0, arg1): 14761 try: 14762 if not arg0.__class__ is val: 14763 arg0 = val(arg0) 14764 except: 14765 raise 14766 try: 14767 if not arg1.__class__ is val: 14768 arg1 = val(arg1) 14769 except: 14770 raise 14771 ctx = arg0.ctx 14772 res = isl.isl_val_max(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14773 obj = val(ctx=ctx, ptr=res) 14774 return obj 14775 def min(arg0, arg1): 14776 try: 14777 if not arg0.__class__ is val: 14778 arg0 = val(arg0) 14779 except: 14780 raise 14781 try: 14782 if not arg1.__class__ is val: 14783 arg1 = val(arg1) 14784 except: 14785 raise 14786 ctx = arg0.ctx 14787 res = isl.isl_val_min(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14788 obj = val(ctx=ctx, ptr=res) 14789 return obj 14790 def mod(arg0, arg1): 14791 try: 14792 if not arg0.__class__ is val: 14793 arg0 = val(arg0) 14794 except: 14795 raise 14796 try: 14797 if not arg1.__class__ is val: 14798 arg1 = val(arg1) 14799 except: 14800 raise 14801 ctx = arg0.ctx 14802 res = isl.isl_val_mod(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14803 obj = val(ctx=ctx, ptr=res) 14804 return obj 14805 def mul(arg0, arg1): 14806 try: 14807 if not arg0.__class__ is val: 14808 arg0 = val(arg0) 14809 except: 14810 raise 14811 try: 14812 if not arg1.__class__ is val: 14813 arg1 = val(arg1) 14814 except: 14815 raise 14816 ctx = arg0.ctx 14817 res = isl.isl_val_mul(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14818 obj = val(ctx=ctx, ptr=res) 14819 return obj 14820 @staticmethod 14821 def nan(): 14822 ctx = Context.getDefaultInstance() 14823 res = isl.isl_val_nan(ctx) 14824 obj = val(ctx=ctx, ptr=res) 14825 return obj 14826 def ne(arg0, arg1): 14827 try: 14828 if not arg0.__class__ is val: 14829 arg0 = val(arg0) 14830 except: 14831 raise 14832 try: 14833 if not arg1.__class__ is val: 14834 arg1 = val(arg1) 14835 except: 14836 raise 14837 ctx = arg0.ctx 14838 res = isl.isl_val_ne(arg0.ptr, arg1.ptr) 14839 if res < 0: 14840 raise 14841 return bool(res) 14842 def neg(arg0): 14843 try: 14844 if not arg0.__class__ is val: 14845 arg0 = val(arg0) 14846 except: 14847 raise 14848 ctx = arg0.ctx 14849 res = isl.isl_val_neg(isl.isl_val_copy(arg0.ptr)) 14850 obj = val(ctx=ctx, ptr=res) 14851 return obj 14852 @staticmethod 14853 def neginfty(): 14854 ctx = Context.getDefaultInstance() 14855 res = isl.isl_val_neginfty(ctx) 14856 obj = val(ctx=ctx, ptr=res) 14857 return obj 14858 @staticmethod 14859 def negone(): 14860 ctx = Context.getDefaultInstance() 14861 res = isl.isl_val_negone(ctx) 14862 obj = val(ctx=ctx, ptr=res) 14863 return obj 14864 @staticmethod 14865 def one(): 14866 ctx = Context.getDefaultInstance() 14867 res = isl.isl_val_one(ctx) 14868 obj = val(ctx=ctx, ptr=res) 14869 return obj 14870 def pow2(arg0): 14871 try: 14872 if not arg0.__class__ is val: 14873 arg0 = val(arg0) 14874 except: 14875 raise 14876 ctx = arg0.ctx 14877 res = isl.isl_val_pow2(isl.isl_val_copy(arg0.ptr)) 14878 obj = val(ctx=ctx, ptr=res) 14879 return obj 14880 def sgn(arg0): 14881 try: 14882 if not arg0.__class__ is val: 14883 arg0 = val(arg0) 14884 except: 14885 raise 14886 ctx = arg0.ctx 14887 res = isl.isl_val_sgn(arg0.ptr) 14888 return res 14889 def sub(arg0, arg1): 14890 try: 14891 if not arg0.__class__ is val: 14892 arg0 = val(arg0) 14893 except: 14894 raise 14895 try: 14896 if not arg1.__class__ is val: 14897 arg1 = val(arg1) 14898 except: 14899 raise 14900 ctx = arg0.ctx 14901 res = isl.isl_val_sub(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 14902 obj = val(ctx=ctx, ptr=res) 14903 return obj 14904 def trunc(arg0): 14905 try: 14906 if not arg0.__class__ is val: 14907 arg0 = val(arg0) 14908 except: 14909 raise 14910 ctx = arg0.ctx 14911 res = isl.isl_val_trunc(isl.isl_val_copy(arg0.ptr)) 14912 obj = val(ctx=ctx, ptr=res) 14913 return obj 14914 @staticmethod 14915 def zero(): 14916 ctx = Context.getDefaultInstance() 14917 res = isl.isl_val_zero(ctx) 14918 obj = val(ctx=ctx, ptr=res) 14919 return obj 14920 14921isl.isl_val_int_from_si.restype = c_void_p 14922isl.isl_val_int_from_si.argtypes = [Context, c_long] 14923isl.isl_val_read_from_str.restype = c_void_p 14924isl.isl_val_read_from_str.argtypes = [Context, c_char_p] 14925isl.isl_val_abs.restype = c_void_p 14926isl.isl_val_abs.argtypes = [c_void_p] 14927isl.isl_val_abs_eq.argtypes = [c_void_p, c_void_p] 14928isl.isl_val_add.restype = c_void_p 14929isl.isl_val_add.argtypes = [c_void_p, c_void_p] 14930isl.isl_val_ceil.restype = c_void_p 14931isl.isl_val_ceil.argtypes = [c_void_p] 14932isl.isl_val_cmp_si.argtypes = [c_void_p, c_long] 14933isl.isl_val_div.restype = c_void_p 14934isl.isl_val_div.argtypes = [c_void_p, c_void_p] 14935isl.isl_val_eq.argtypes = [c_void_p, c_void_p] 14936isl.isl_val_floor.restype = c_void_p 14937isl.isl_val_floor.argtypes = [c_void_p] 14938isl.isl_val_gcd.restype = c_void_p 14939isl.isl_val_gcd.argtypes = [c_void_p, c_void_p] 14940isl.isl_val_ge.argtypes = [c_void_p, c_void_p] 14941isl.isl_val_get_den_si.argtypes = [c_void_p] 14942isl.isl_val_get_num_si.argtypes = [c_void_p] 14943isl.isl_val_gt.argtypes = [c_void_p, c_void_p] 14944isl.isl_val_infty.restype = c_void_p 14945isl.isl_val_infty.argtypes = [Context] 14946isl.isl_val_inv.restype = c_void_p 14947isl.isl_val_inv.argtypes = [c_void_p] 14948isl.isl_val_is_divisible_by.argtypes = [c_void_p, c_void_p] 14949isl.isl_val_is_infty.argtypes = [c_void_p] 14950isl.isl_val_is_int.argtypes = [c_void_p] 14951isl.isl_val_is_nan.argtypes = [c_void_p] 14952isl.isl_val_is_neg.argtypes = [c_void_p] 14953isl.isl_val_is_neginfty.argtypes = [c_void_p] 14954isl.isl_val_is_negone.argtypes = [c_void_p] 14955isl.isl_val_is_nonneg.argtypes = [c_void_p] 14956isl.isl_val_is_nonpos.argtypes = [c_void_p] 14957isl.isl_val_is_one.argtypes = [c_void_p] 14958isl.isl_val_is_pos.argtypes = [c_void_p] 14959isl.isl_val_is_rat.argtypes = [c_void_p] 14960isl.isl_val_is_zero.argtypes = [c_void_p] 14961isl.isl_val_le.argtypes = [c_void_p, c_void_p] 14962isl.isl_val_lt.argtypes = [c_void_p, c_void_p] 14963isl.isl_val_max.restype = c_void_p 14964isl.isl_val_max.argtypes = [c_void_p, c_void_p] 14965isl.isl_val_min.restype = c_void_p 14966isl.isl_val_min.argtypes = [c_void_p, c_void_p] 14967isl.isl_val_mod.restype = c_void_p 14968isl.isl_val_mod.argtypes = [c_void_p, c_void_p] 14969isl.isl_val_mul.restype = c_void_p 14970isl.isl_val_mul.argtypes = [c_void_p, c_void_p] 14971isl.isl_val_nan.restype = c_void_p 14972isl.isl_val_nan.argtypes = [Context] 14973isl.isl_val_ne.argtypes = [c_void_p, c_void_p] 14974isl.isl_val_neg.restype = c_void_p 14975isl.isl_val_neg.argtypes = [c_void_p] 14976isl.isl_val_neginfty.restype = c_void_p 14977isl.isl_val_neginfty.argtypes = [Context] 14978isl.isl_val_negone.restype = c_void_p 14979isl.isl_val_negone.argtypes = [Context] 14980isl.isl_val_one.restype = c_void_p 14981isl.isl_val_one.argtypes = [Context] 14982isl.isl_val_pow2.restype = c_void_p 14983isl.isl_val_pow2.argtypes = [c_void_p] 14984isl.isl_val_sgn.argtypes = [c_void_p] 14985isl.isl_val_sub.restype = c_void_p 14986isl.isl_val_sub.argtypes = [c_void_p, c_void_p] 14987isl.isl_val_trunc.restype = c_void_p 14988isl.isl_val_trunc.argtypes = [c_void_p] 14989isl.isl_val_zero.restype = c_void_p 14990isl.isl_val_zero.argtypes = [Context] 14991isl.isl_val_copy.restype = c_void_p 14992isl.isl_val_copy.argtypes = [c_void_p] 14993isl.isl_val_free.restype = c_void_p 14994isl.isl_val_free.argtypes = [c_void_p] 14995isl.isl_val_to_str.restype = POINTER(c_char) 14996isl.isl_val_to_str.argtypes = [c_void_p] 14997 14998class val_list(object): 14999 def __init__(self, *args, **keywords): 15000 if "ptr" in keywords: 15001 self.ctx = keywords["ctx"] 15002 self.ptr = keywords["ptr"] 15003 return 15004 if len(args) == 1 and type(args[0]) == int: 15005 self.ctx = Context.getDefaultInstance() 15006 self.ptr = isl.isl_val_list_alloc(self.ctx, args[0]) 15007 return 15008 if len(args) == 1 and (args[0].__class__ is val or type(args[0]) == int): 15009 args = list(args) 15010 try: 15011 if not args[0].__class__ is val: 15012 args[0] = val(args[0]) 15013 except: 15014 raise 15015 self.ctx = Context.getDefaultInstance() 15016 self.ptr = isl.isl_val_list_from_val(isl.isl_val_copy(args[0].ptr)) 15017 return 15018 raise Error 15019 def __del__(self): 15020 if hasattr(self, 'ptr'): 15021 isl.isl_val_list_free(self.ptr) 15022 def __str__(arg0): 15023 try: 15024 if not arg0.__class__ is val_list: 15025 arg0 = val_list(arg0) 15026 except: 15027 raise 15028 ptr = isl.isl_val_list_to_str(arg0.ptr) 15029 res = cast(ptr, c_char_p).value.decode('ascii') 15030 libc.free(ptr) 15031 return res 15032 def __repr__(self): 15033 s = str(self) 15034 if '"' in s: 15035 return 'isl.val_list("""%s""")' % s 15036 else: 15037 return 'isl.val_list("%s")' % s 15038 def add(arg0, arg1): 15039 try: 15040 if not arg0.__class__ is val_list: 15041 arg0 = val_list(arg0) 15042 except: 15043 raise 15044 try: 15045 if not arg1.__class__ is val: 15046 arg1 = val(arg1) 15047 except: 15048 raise 15049 ctx = arg0.ctx 15050 res = isl.isl_val_list_add(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 15051 obj = val_list(ctx=ctx, ptr=res) 15052 return obj 15053 def clear(arg0): 15054 try: 15055 if not arg0.__class__ is val_list: 15056 arg0 = val_list(arg0) 15057 except: 15058 raise 15059 ctx = arg0.ctx 15060 res = isl.isl_val_list_clear(isl.isl_val_list_copy(arg0.ptr)) 15061 obj = val_list(ctx=ctx, ptr=res) 15062 return obj 15063 def concat(arg0, arg1): 15064 try: 15065 if not arg0.__class__ is val_list: 15066 arg0 = val_list(arg0) 15067 except: 15068 raise 15069 try: 15070 if not arg1.__class__ is val_list: 15071 arg1 = val_list(arg1) 15072 except: 15073 raise 15074 ctx = arg0.ctx 15075 res = isl.isl_val_list_concat(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_list_copy(arg1.ptr)) 15076 obj = val_list(ctx=ctx, ptr=res) 15077 return obj 15078 def drop(arg0, arg1, arg2): 15079 try: 15080 if not arg0.__class__ is val_list: 15081 arg0 = val_list(arg0) 15082 except: 15083 raise 15084 ctx = arg0.ctx 15085 res = isl.isl_val_list_drop(isl.isl_val_list_copy(arg0.ptr), arg1, arg2) 15086 obj = val_list(ctx=ctx, ptr=res) 15087 return obj 15088 def foreach(arg0, arg1): 15089 try: 15090 if not arg0.__class__ is val_list: 15091 arg0 = val_list(arg0) 15092 except: 15093 raise 15094 exc_info = [None] 15095 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15096 def cb_func(cb_arg0, cb_arg1): 15097 cb_arg0 = val(ctx=arg0.ctx, ptr=(cb_arg0)) 15098 try: 15099 arg1(cb_arg0) 15100 except: 15101 import sys 15102 exc_info[0] = sys.exc_info() 15103 return -1 15104 return 0 15105 cb = fn(cb_func) 15106 ctx = arg0.ctx 15107 res = isl.isl_val_list_foreach(arg0.ptr, cb, None) 15108 if exc_info[0] != None: 15109 raise (exc_info[0][0], exc_info[0][1], exc_info[0][2]) 15110 if res < 0: 15111 raise 15112 def at(arg0, arg1): 15113 try: 15114 if not arg0.__class__ is val_list: 15115 arg0 = val_list(arg0) 15116 except: 15117 raise 15118 ctx = arg0.ctx 15119 res = isl.isl_val_list_get_at(arg0.ptr, arg1) 15120 obj = val(ctx=ctx, ptr=res) 15121 return obj 15122 def get_at(arg0, arg1): 15123 return arg0.at(arg1) 15124 def insert(arg0, arg1, arg2): 15125 try: 15126 if not arg0.__class__ is val_list: 15127 arg0 = val_list(arg0) 15128 except: 15129 raise 15130 try: 15131 if not arg2.__class__ is val: 15132 arg2 = val(arg2) 15133 except: 15134 raise 15135 ctx = arg0.ctx 15136 res = isl.isl_val_list_insert(isl.isl_val_list_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 15137 obj = val_list(ctx=ctx, ptr=res) 15138 return obj 15139 def size(arg0): 15140 try: 15141 if not arg0.__class__ is val_list: 15142 arg0 = val_list(arg0) 15143 except: 15144 raise 15145 ctx = arg0.ctx 15146 res = isl.isl_val_list_size(arg0.ptr) 15147 if res < 0: 15148 raise 15149 return int(res) 15150 15151isl.isl_val_list_alloc.restype = c_void_p 15152isl.isl_val_list_alloc.argtypes = [Context, c_int] 15153isl.isl_val_list_from_val.restype = c_void_p 15154isl.isl_val_list_from_val.argtypes = [c_void_p] 15155isl.isl_val_list_add.restype = c_void_p 15156isl.isl_val_list_add.argtypes = [c_void_p, c_void_p] 15157isl.isl_val_list_clear.restype = c_void_p 15158isl.isl_val_list_clear.argtypes = [c_void_p] 15159isl.isl_val_list_concat.restype = c_void_p 15160isl.isl_val_list_concat.argtypes = [c_void_p, c_void_p] 15161isl.isl_val_list_drop.restype = c_void_p 15162isl.isl_val_list_drop.argtypes = [c_void_p, c_int, c_int] 15163isl.isl_val_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 15164isl.isl_val_list_get_at.restype = c_void_p 15165isl.isl_val_list_get_at.argtypes = [c_void_p, c_int] 15166isl.isl_val_list_insert.restype = c_void_p 15167isl.isl_val_list_insert.argtypes = [c_void_p, c_int, c_void_p] 15168isl.isl_val_list_size.argtypes = [c_void_p] 15169isl.isl_val_list_copy.restype = c_void_p 15170isl.isl_val_list_copy.argtypes = [c_void_p] 15171isl.isl_val_list_free.restype = c_void_p 15172isl.isl_val_list_free.argtypes = [c_void_p] 15173isl.isl_val_list_to_str.restype = POINTER(c_char) 15174isl.isl_val_list_to_str.argtypes = [c_void_p] 15175