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 37 @CFUNCTYPE(None, py_object) 38 def free_user(user): 39 pythonapi.Py_DecRef(py_object(user)) 40 41isl.isl_ctx_alloc.restype = c_void_p 42isl.isl_ctx_free.argtypes = [Context] 43isl.isl_id_alloc.restype = c_void_p 44isl.isl_id_alloc.argtypes = [Context, c_char_p, py_object] 45isl.isl_id_set_free_user.restype = c_void_p 46isl.isl_id_set_free_user.argtypes = [c_void_p, c_void_p] 47isl.isl_id_get_free_user.restype = c_void_p 48isl.isl_id_get_free_user.argtypes = [c_void_p] 49isl.isl_id_get_user.restype = py_object 50isl.isl_id_get_user.argtypes = [c_void_p] 51 52class union_pw_multi_aff(object): 53 def __init__(self, *args, **keywords): 54 if "ptr" in keywords: 55 self.ctx = keywords["ctx"] 56 self.ptr = keywords["ptr"] 57 return 58 if len(args) == 1 and args[0].__class__ is multi_aff: 59 self.ctx = Context.getDefaultInstance() 60 self.ptr = isl.isl_union_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 61 return 62 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 63 self.ctx = Context.getDefaultInstance() 64 self.ptr = isl.isl_union_pw_multi_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 65 return 66 if len(args) == 1 and args[0].__class__ is union_pw_aff: 67 self.ctx = Context.getDefaultInstance() 68 self.ptr = isl.isl_union_pw_multi_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 69 return 70 if len(args) == 1 and type(args[0]) == str: 71 self.ctx = Context.getDefaultInstance() 72 self.ptr = isl.isl_union_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 73 return 74 raise Error 75 def __del__(self): 76 if hasattr(self, 'ptr'): 77 isl.isl_union_pw_multi_aff_free(self.ptr) 78 def __str__(arg0): 79 try: 80 if not arg0.__class__ is union_pw_multi_aff: 81 arg0 = union_pw_multi_aff(arg0) 82 except: 83 raise 84 ptr = isl.isl_union_pw_multi_aff_to_str(arg0.ptr) 85 res = cast(ptr, c_char_p).value.decode('ascii') 86 libc.free(ptr) 87 return res 88 def __repr__(self): 89 s = str(self) 90 if '"' in s: 91 return 'isl.union_pw_multi_aff("""%s""")' % s 92 else: 93 return 'isl.union_pw_multi_aff("%s")' % s 94 def add(arg0, arg1): 95 try: 96 if not arg0.__class__ is union_pw_multi_aff: 97 arg0 = union_pw_multi_aff(arg0) 98 except: 99 raise 100 try: 101 if not arg1.__class__ is union_pw_multi_aff: 102 arg1 = union_pw_multi_aff(arg1) 103 except: 104 raise 105 ctx = arg0.ctx 106 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)) 107 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 108 return obj 109 def apply(*args): 110 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 111 args = list(args) 112 try: 113 if not args[0].__class__ is union_pw_multi_aff: 114 args[0] = union_pw_multi_aff(args[0]) 115 except: 116 raise 117 ctx = args[0].ctx 118 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)) 119 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 120 return obj 121 raise Error 122 def as_multi_union_pw_aff(arg0): 123 try: 124 if not arg0.__class__ is union_pw_multi_aff: 125 arg0 = union_pw_multi_aff(arg0) 126 except: 127 raise 128 ctx = arg0.ctx 129 res = isl.isl_union_pw_multi_aff_as_multi_union_pw_aff(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 130 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 131 return obj 132 def as_pw_multi_aff(arg0): 133 try: 134 if not arg0.__class__ is union_pw_multi_aff: 135 arg0 = union_pw_multi_aff(arg0) 136 except: 137 raise 138 ctx = arg0.ctx 139 res = isl.isl_union_pw_multi_aff_as_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 140 obj = pw_multi_aff(ctx=ctx, ptr=res) 141 return obj 142 def as_union_map(arg0): 143 try: 144 if not arg0.__class__ is union_pw_multi_aff: 145 arg0 = union_pw_multi_aff(arg0) 146 except: 147 raise 148 ctx = arg0.ctx 149 res = isl.isl_union_pw_multi_aff_as_union_map(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 150 obj = union_map(ctx=ctx, ptr=res) 151 return obj 152 def coalesce(arg0): 153 try: 154 if not arg0.__class__ is union_pw_multi_aff: 155 arg0 = union_pw_multi_aff(arg0) 156 except: 157 raise 158 ctx = arg0.ctx 159 res = isl.isl_union_pw_multi_aff_coalesce(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 160 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 161 return obj 162 def domain(arg0): 163 try: 164 if not arg0.__class__ is union_pw_multi_aff: 165 arg0 = union_pw_multi_aff(arg0) 166 except: 167 raise 168 ctx = arg0.ctx 169 res = isl.isl_union_pw_multi_aff_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 170 obj = union_set(ctx=ctx, ptr=res) 171 return obj 172 def drop_unused_params(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_drop_unused_params(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 180 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 181 return obj 182 @staticmethod 183 def empty(*args): 184 if len(args) == 0: 185 ctx = Context.getDefaultInstance() 186 res = isl.isl_union_pw_multi_aff_empty_ctx(ctx) 187 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 188 return obj 189 raise Error 190 def extract_pw_multi_aff(arg0, arg1): 191 try: 192 if not arg0.__class__ is union_pw_multi_aff: 193 arg0 = union_pw_multi_aff(arg0) 194 except: 195 raise 196 try: 197 if not arg1.__class__ is space: 198 arg1 = space(arg1) 199 except: 200 raise 201 ctx = arg0.ctx 202 res = isl.isl_union_pw_multi_aff_extract_pw_multi_aff(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 203 obj = pw_multi_aff(ctx=ctx, ptr=res) 204 return obj 205 def flat_range_product(arg0, arg1): 206 try: 207 if not arg0.__class__ is union_pw_multi_aff: 208 arg0 = union_pw_multi_aff(arg0) 209 except: 210 raise 211 try: 212 if not arg1.__class__ is union_pw_multi_aff: 213 arg1 = union_pw_multi_aff(arg1) 214 except: 215 raise 216 ctx = arg0.ctx 217 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)) 218 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 219 return obj 220 def gist(arg0, arg1): 221 try: 222 if not arg0.__class__ is union_pw_multi_aff: 223 arg0 = union_pw_multi_aff(arg0) 224 except: 225 raise 226 try: 227 if not arg1.__class__ is union_set: 228 arg1 = union_set(arg1) 229 except: 230 raise 231 ctx = arg0.ctx 232 res = isl.isl_union_pw_multi_aff_gist(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 233 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 234 return obj 235 def intersect_domain(*args): 236 if len(args) == 2 and args[1].__class__ is space: 237 args = list(args) 238 try: 239 if not args[0].__class__ is union_pw_multi_aff: 240 args[0] = union_pw_multi_aff(args[0]) 241 except: 242 raise 243 ctx = args[0].ctx 244 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)) 245 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 246 return obj 247 if len(args) == 2 and args[1].__class__ is union_set: 248 args = list(args) 249 try: 250 if not args[0].__class__ is union_pw_multi_aff: 251 args[0] = union_pw_multi_aff(args[0]) 252 except: 253 raise 254 ctx = args[0].ctx 255 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)) 256 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 257 return obj 258 raise Error 259 def intersect_domain_wrapped_domain(arg0, arg1): 260 try: 261 if not arg0.__class__ is union_pw_multi_aff: 262 arg0 = union_pw_multi_aff(arg0) 263 except: 264 raise 265 try: 266 if not arg1.__class__ is union_set: 267 arg1 = union_set(arg1) 268 except: 269 raise 270 ctx = arg0.ctx 271 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)) 272 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 273 return obj 274 def intersect_domain_wrapped_range(arg0, arg1): 275 try: 276 if not arg0.__class__ is union_pw_multi_aff: 277 arg0 = union_pw_multi_aff(arg0) 278 except: 279 raise 280 try: 281 if not arg1.__class__ is union_set: 282 arg1 = union_set(arg1) 283 except: 284 raise 285 ctx = arg0.ctx 286 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)) 287 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 288 return obj 289 def intersect_params(arg0, arg1): 290 try: 291 if not arg0.__class__ is union_pw_multi_aff: 292 arg0 = union_pw_multi_aff(arg0) 293 except: 294 raise 295 try: 296 if not arg1.__class__ is set: 297 arg1 = set(arg1) 298 except: 299 raise 300 ctx = arg0.ctx 301 res = isl.isl_union_pw_multi_aff_intersect_params(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 302 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 303 return obj 304 def involves_locals(arg0): 305 try: 306 if not arg0.__class__ is union_pw_multi_aff: 307 arg0 = union_pw_multi_aff(arg0) 308 except: 309 raise 310 ctx = arg0.ctx 311 res = isl.isl_union_pw_multi_aff_involves_locals(arg0.ptr) 312 if res < 0: 313 raise Error 314 return bool(res) 315 def isa_pw_multi_aff(arg0): 316 try: 317 if not arg0.__class__ is union_pw_multi_aff: 318 arg0 = union_pw_multi_aff(arg0) 319 except: 320 raise 321 ctx = arg0.ctx 322 res = isl.isl_union_pw_multi_aff_isa_pw_multi_aff(arg0.ptr) 323 if res < 0: 324 raise Error 325 return bool(res) 326 def plain_is_empty(arg0): 327 try: 328 if not arg0.__class__ is union_pw_multi_aff: 329 arg0 = union_pw_multi_aff(arg0) 330 except: 331 raise 332 ctx = arg0.ctx 333 res = isl.isl_union_pw_multi_aff_plain_is_empty(arg0.ptr) 334 if res < 0: 335 raise Error 336 return bool(res) 337 def plain_is_equal(arg0, arg1): 338 try: 339 if not arg0.__class__ is union_pw_multi_aff: 340 arg0 = union_pw_multi_aff(arg0) 341 except: 342 raise 343 try: 344 if not arg1.__class__ is union_pw_multi_aff: 345 arg1 = union_pw_multi_aff(arg1) 346 except: 347 raise 348 ctx = arg0.ctx 349 res = isl.isl_union_pw_multi_aff_plain_is_equal(arg0.ptr, arg1.ptr) 350 if res < 0: 351 raise Error 352 return bool(res) 353 def preimage_domain_wrapped_domain(*args): 354 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 355 args = list(args) 356 try: 357 if not args[0].__class__ is union_pw_multi_aff: 358 args[0] = union_pw_multi_aff(args[0]) 359 except: 360 raise 361 ctx = args[0].ctx 362 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)) 363 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 364 return obj 365 raise Error 366 def pullback(*args): 367 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 368 args = list(args) 369 try: 370 if not args[0].__class__ is union_pw_multi_aff: 371 args[0] = union_pw_multi_aff(args[0]) 372 except: 373 raise 374 ctx = args[0].ctx 375 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)) 376 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 377 return obj 378 raise Error 379 def pw_multi_aff_list(arg0): 380 try: 381 if not arg0.__class__ is union_pw_multi_aff: 382 arg0 = union_pw_multi_aff(arg0) 383 except: 384 raise 385 ctx = arg0.ctx 386 res = isl.isl_union_pw_multi_aff_get_pw_multi_aff_list(arg0.ptr) 387 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 388 return obj 389 def get_pw_multi_aff_list(arg0): 390 return arg0.pw_multi_aff_list() 391 def range_factor_domain(arg0): 392 try: 393 if not arg0.__class__ is union_pw_multi_aff: 394 arg0 = union_pw_multi_aff(arg0) 395 except: 396 raise 397 ctx = arg0.ctx 398 res = isl.isl_union_pw_multi_aff_range_factor_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 399 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 400 return obj 401 def range_factor_range(arg0): 402 try: 403 if not arg0.__class__ is union_pw_multi_aff: 404 arg0 = union_pw_multi_aff(arg0) 405 except: 406 raise 407 ctx = arg0.ctx 408 res = isl.isl_union_pw_multi_aff_range_factor_range(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 409 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 410 return obj 411 def range_product(arg0, arg1): 412 try: 413 if not arg0.__class__ is union_pw_multi_aff: 414 arg0 = union_pw_multi_aff(arg0) 415 except: 416 raise 417 try: 418 if not arg1.__class__ is union_pw_multi_aff: 419 arg1 = union_pw_multi_aff(arg1) 420 except: 421 raise 422 ctx = arg0.ctx 423 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)) 424 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 425 return obj 426 def space(arg0): 427 try: 428 if not arg0.__class__ is union_pw_multi_aff: 429 arg0 = union_pw_multi_aff(arg0) 430 except: 431 raise 432 ctx = arg0.ctx 433 res = isl.isl_union_pw_multi_aff_get_space(arg0.ptr) 434 obj = space(ctx=ctx, ptr=res) 435 return obj 436 def get_space(arg0): 437 return arg0.space() 438 def sub(arg0, arg1): 439 try: 440 if not arg0.__class__ is union_pw_multi_aff: 441 arg0 = union_pw_multi_aff(arg0) 442 except: 443 raise 444 try: 445 if not arg1.__class__ is union_pw_multi_aff: 446 arg1 = union_pw_multi_aff(arg1) 447 except: 448 raise 449 ctx = arg0.ctx 450 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)) 451 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 452 return obj 453 def subtract_domain(*args): 454 if len(args) == 2 and args[1].__class__ is space: 455 args = list(args) 456 try: 457 if not args[0].__class__ is union_pw_multi_aff: 458 args[0] = union_pw_multi_aff(args[0]) 459 except: 460 raise 461 ctx = args[0].ctx 462 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)) 463 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 464 return obj 465 if len(args) == 2 and args[1].__class__ is union_set: 466 args = list(args) 467 try: 468 if not args[0].__class__ is union_pw_multi_aff: 469 args[0] = union_pw_multi_aff(args[0]) 470 except: 471 raise 472 ctx = args[0].ctx 473 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)) 474 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 475 return obj 476 raise Error 477 def union_add(arg0, arg1): 478 try: 479 if not arg0.__class__ is union_pw_multi_aff: 480 arg0 = union_pw_multi_aff(arg0) 481 except: 482 raise 483 try: 484 if not arg1.__class__ is union_pw_multi_aff: 485 arg1 = union_pw_multi_aff(arg1) 486 except: 487 raise 488 ctx = arg0.ctx 489 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)) 490 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 491 return obj 492 493isl.isl_union_pw_multi_aff_from_multi_aff.restype = c_void_p 494isl.isl_union_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 495isl.isl_union_pw_multi_aff_from_pw_multi_aff.restype = c_void_p 496isl.isl_union_pw_multi_aff_from_pw_multi_aff.argtypes = [c_void_p] 497isl.isl_union_pw_multi_aff_from_union_pw_aff.restype = c_void_p 498isl.isl_union_pw_multi_aff_from_union_pw_aff.argtypes = [c_void_p] 499isl.isl_union_pw_multi_aff_read_from_str.restype = c_void_p 500isl.isl_union_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 501isl.isl_union_pw_multi_aff_add.restype = c_void_p 502isl.isl_union_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 503isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.restype = c_void_p 504isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 505isl.isl_union_pw_multi_aff_as_multi_union_pw_aff.restype = c_void_p 506isl.isl_union_pw_multi_aff_as_multi_union_pw_aff.argtypes = [c_void_p] 507isl.isl_union_pw_multi_aff_as_pw_multi_aff.restype = c_void_p 508isl.isl_union_pw_multi_aff_as_pw_multi_aff.argtypes = [c_void_p] 509isl.isl_union_pw_multi_aff_as_union_map.restype = c_void_p 510isl.isl_union_pw_multi_aff_as_union_map.argtypes = [c_void_p] 511isl.isl_union_pw_multi_aff_coalesce.restype = c_void_p 512isl.isl_union_pw_multi_aff_coalesce.argtypes = [c_void_p] 513isl.isl_union_pw_multi_aff_domain.restype = c_void_p 514isl.isl_union_pw_multi_aff_domain.argtypes = [c_void_p] 515isl.isl_union_pw_multi_aff_drop_unused_params.restype = c_void_p 516isl.isl_union_pw_multi_aff_drop_unused_params.argtypes = [c_void_p] 517isl.isl_union_pw_multi_aff_empty_ctx.restype = c_void_p 518isl.isl_union_pw_multi_aff_empty_ctx.argtypes = [Context] 519isl.isl_union_pw_multi_aff_extract_pw_multi_aff.restype = c_void_p 520isl.isl_union_pw_multi_aff_extract_pw_multi_aff.argtypes = [c_void_p, c_void_p] 521isl.isl_union_pw_multi_aff_flat_range_product.restype = c_void_p 522isl.isl_union_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 523isl.isl_union_pw_multi_aff_gist.restype = c_void_p 524isl.isl_union_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 525isl.isl_union_pw_multi_aff_intersect_domain_space.restype = c_void_p 526isl.isl_union_pw_multi_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 527isl.isl_union_pw_multi_aff_intersect_domain_union_set.restype = c_void_p 528isl.isl_union_pw_multi_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 529isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.restype = c_void_p 530isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 531isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.restype = c_void_p 532isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 533isl.isl_union_pw_multi_aff_intersect_params.restype = c_void_p 534isl.isl_union_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 535isl.isl_union_pw_multi_aff_involves_locals.argtypes = [c_void_p] 536isl.isl_union_pw_multi_aff_isa_pw_multi_aff.argtypes = [c_void_p] 537isl.isl_union_pw_multi_aff_plain_is_empty.argtypes = [c_void_p] 538isl.isl_union_pw_multi_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 539isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.restype = c_void_p 540isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 541isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.restype = c_void_p 542isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 543isl.isl_union_pw_multi_aff_get_pw_multi_aff_list.restype = c_void_p 544isl.isl_union_pw_multi_aff_get_pw_multi_aff_list.argtypes = [c_void_p] 545isl.isl_union_pw_multi_aff_range_factor_domain.restype = c_void_p 546isl.isl_union_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 547isl.isl_union_pw_multi_aff_range_factor_range.restype = c_void_p 548isl.isl_union_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 549isl.isl_union_pw_multi_aff_range_product.restype = c_void_p 550isl.isl_union_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 551isl.isl_union_pw_multi_aff_get_space.restype = c_void_p 552isl.isl_union_pw_multi_aff_get_space.argtypes = [c_void_p] 553isl.isl_union_pw_multi_aff_sub.restype = c_void_p 554isl.isl_union_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 555isl.isl_union_pw_multi_aff_subtract_domain_space.restype = c_void_p 556isl.isl_union_pw_multi_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 557isl.isl_union_pw_multi_aff_subtract_domain_union_set.restype = c_void_p 558isl.isl_union_pw_multi_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 559isl.isl_union_pw_multi_aff_union_add.restype = c_void_p 560isl.isl_union_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 561isl.isl_union_pw_multi_aff_copy.restype = c_void_p 562isl.isl_union_pw_multi_aff_copy.argtypes = [c_void_p] 563isl.isl_union_pw_multi_aff_free.restype = c_void_p 564isl.isl_union_pw_multi_aff_free.argtypes = [c_void_p] 565isl.isl_union_pw_multi_aff_to_str.restype = POINTER(c_char) 566isl.isl_union_pw_multi_aff_to_str.argtypes = [c_void_p] 567 568class multi_union_pw_aff(object): 569 def __init__(self, *args, **keywords): 570 if "ptr" in keywords: 571 self.ctx = keywords["ctx"] 572 self.ptr = keywords["ptr"] 573 return 574 if len(args) == 1 and args[0].__class__ is multi_pw_aff: 575 self.ctx = Context.getDefaultInstance() 576 self.ptr = isl.isl_multi_union_pw_aff_from_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 577 return 578 if len(args) == 1 and args[0].__class__ is union_pw_aff: 579 self.ctx = Context.getDefaultInstance() 580 self.ptr = isl.isl_multi_union_pw_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 581 return 582 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is union_pw_aff_list: 583 self.ctx = Context.getDefaultInstance() 584 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)) 585 return 586 if len(args) == 1 and type(args[0]) == str: 587 self.ctx = Context.getDefaultInstance() 588 self.ptr = isl.isl_multi_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 589 return 590 raise Error 591 def __del__(self): 592 if hasattr(self, 'ptr'): 593 isl.isl_multi_union_pw_aff_free(self.ptr) 594 def __str__(arg0): 595 try: 596 if not arg0.__class__ is multi_union_pw_aff: 597 arg0 = multi_union_pw_aff(arg0) 598 except: 599 raise 600 ptr = isl.isl_multi_union_pw_aff_to_str(arg0.ptr) 601 res = cast(ptr, c_char_p).value.decode('ascii') 602 libc.free(ptr) 603 return res 604 def __repr__(self): 605 s = str(self) 606 if '"' in s: 607 return 'isl.multi_union_pw_aff("""%s""")' % s 608 else: 609 return 'isl.multi_union_pw_aff("%s")' % s 610 def add(arg0, arg1): 611 try: 612 if not arg0.__class__ is multi_union_pw_aff: 613 arg0 = multi_union_pw_aff(arg0) 614 except: 615 raise 616 try: 617 if not arg1.__class__ is multi_union_pw_aff: 618 arg1 = multi_union_pw_aff(arg1) 619 except: 620 raise 621 ctx = arg0.ctx 622 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)) 623 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 624 return obj 625 def at(arg0, arg1): 626 try: 627 if not arg0.__class__ is multi_union_pw_aff: 628 arg0 = multi_union_pw_aff(arg0) 629 except: 630 raise 631 ctx = arg0.ctx 632 res = isl.isl_multi_union_pw_aff_get_at(arg0.ptr, arg1) 633 obj = union_pw_aff(ctx=ctx, ptr=res) 634 return obj 635 def get_at(arg0, arg1): 636 return arg0.at(arg1) 637 def bind(arg0, arg1): 638 try: 639 if not arg0.__class__ is multi_union_pw_aff: 640 arg0 = multi_union_pw_aff(arg0) 641 except: 642 raise 643 try: 644 if not arg1.__class__ is multi_id: 645 arg1 = multi_id(arg1) 646 except: 647 raise 648 ctx = arg0.ctx 649 res = isl.isl_multi_union_pw_aff_bind(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 650 obj = union_set(ctx=ctx, ptr=res) 651 return obj 652 def coalesce(arg0): 653 try: 654 if not arg0.__class__ is multi_union_pw_aff: 655 arg0 = multi_union_pw_aff(arg0) 656 except: 657 raise 658 ctx = arg0.ctx 659 res = isl.isl_multi_union_pw_aff_coalesce(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 660 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 661 return obj 662 def domain(arg0): 663 try: 664 if not arg0.__class__ is multi_union_pw_aff: 665 arg0 = multi_union_pw_aff(arg0) 666 except: 667 raise 668 ctx = arg0.ctx 669 res = isl.isl_multi_union_pw_aff_domain(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 670 obj = union_set(ctx=ctx, ptr=res) 671 return obj 672 def flat_range_product(arg0, arg1): 673 try: 674 if not arg0.__class__ is multi_union_pw_aff: 675 arg0 = multi_union_pw_aff(arg0) 676 except: 677 raise 678 try: 679 if not arg1.__class__ is multi_union_pw_aff: 680 arg1 = multi_union_pw_aff(arg1) 681 except: 682 raise 683 ctx = arg0.ctx 684 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)) 685 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 686 return obj 687 def gist(arg0, arg1): 688 try: 689 if not arg0.__class__ is multi_union_pw_aff: 690 arg0 = multi_union_pw_aff(arg0) 691 except: 692 raise 693 try: 694 if not arg1.__class__ is union_set: 695 arg1 = union_set(arg1) 696 except: 697 raise 698 ctx = arg0.ctx 699 res = isl.isl_multi_union_pw_aff_gist(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 700 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 701 return obj 702 def gist_params(arg0, arg1): 703 try: 704 if not arg0.__class__ is multi_union_pw_aff: 705 arg0 = multi_union_pw_aff(arg0) 706 except: 707 raise 708 try: 709 if not arg1.__class__ is set: 710 arg1 = set(arg1) 711 except: 712 raise 713 ctx = arg0.ctx 714 res = isl.isl_multi_union_pw_aff_gist_params(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 715 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 716 return obj 717 def has_range_tuple_id(arg0): 718 try: 719 if not arg0.__class__ is multi_union_pw_aff: 720 arg0 = multi_union_pw_aff(arg0) 721 except: 722 raise 723 ctx = arg0.ctx 724 res = isl.isl_multi_union_pw_aff_has_range_tuple_id(arg0.ptr) 725 if res < 0: 726 raise Error 727 return bool(res) 728 def intersect_domain(arg0, arg1): 729 try: 730 if not arg0.__class__ is multi_union_pw_aff: 731 arg0 = multi_union_pw_aff(arg0) 732 except: 733 raise 734 try: 735 if not arg1.__class__ is union_set: 736 arg1 = union_set(arg1) 737 except: 738 raise 739 ctx = arg0.ctx 740 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)) 741 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 742 return obj 743 def intersect_params(arg0, arg1): 744 try: 745 if not arg0.__class__ is multi_union_pw_aff: 746 arg0 = multi_union_pw_aff(arg0) 747 except: 748 raise 749 try: 750 if not arg1.__class__ is set: 751 arg1 = set(arg1) 752 except: 753 raise 754 ctx = arg0.ctx 755 res = isl.isl_multi_union_pw_aff_intersect_params(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 756 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 757 return obj 758 def involves_nan(arg0): 759 try: 760 if not arg0.__class__ is multi_union_pw_aff: 761 arg0 = multi_union_pw_aff(arg0) 762 except: 763 raise 764 ctx = arg0.ctx 765 res = isl.isl_multi_union_pw_aff_involves_nan(arg0.ptr) 766 if res < 0: 767 raise Error 768 return bool(res) 769 def list(arg0): 770 try: 771 if not arg0.__class__ is multi_union_pw_aff: 772 arg0 = multi_union_pw_aff(arg0) 773 except: 774 raise 775 ctx = arg0.ctx 776 res = isl.isl_multi_union_pw_aff_get_list(arg0.ptr) 777 obj = union_pw_aff_list(ctx=ctx, ptr=res) 778 return obj 779 def get_list(arg0): 780 return arg0.list() 781 def neg(arg0): 782 try: 783 if not arg0.__class__ is multi_union_pw_aff: 784 arg0 = multi_union_pw_aff(arg0) 785 except: 786 raise 787 ctx = arg0.ctx 788 res = isl.isl_multi_union_pw_aff_neg(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 789 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 790 return obj 791 def plain_is_equal(arg0, arg1): 792 try: 793 if not arg0.__class__ is multi_union_pw_aff: 794 arg0 = multi_union_pw_aff(arg0) 795 except: 796 raise 797 try: 798 if not arg1.__class__ is multi_union_pw_aff: 799 arg1 = multi_union_pw_aff(arg1) 800 except: 801 raise 802 ctx = arg0.ctx 803 res = isl.isl_multi_union_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 804 if res < 0: 805 raise Error 806 return bool(res) 807 def pullback(*args): 808 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 809 args = list(args) 810 try: 811 if not args[0].__class__ is multi_union_pw_aff: 812 args[0] = multi_union_pw_aff(args[0]) 813 except: 814 raise 815 ctx = args[0].ctx 816 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)) 817 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 818 return obj 819 raise Error 820 def range_product(arg0, arg1): 821 try: 822 if not arg0.__class__ is multi_union_pw_aff: 823 arg0 = multi_union_pw_aff(arg0) 824 except: 825 raise 826 try: 827 if not arg1.__class__ is multi_union_pw_aff: 828 arg1 = multi_union_pw_aff(arg1) 829 except: 830 raise 831 ctx = arg0.ctx 832 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)) 833 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 834 return obj 835 def range_tuple_id(arg0): 836 try: 837 if not arg0.__class__ is multi_union_pw_aff: 838 arg0 = multi_union_pw_aff(arg0) 839 except: 840 raise 841 ctx = arg0.ctx 842 res = isl.isl_multi_union_pw_aff_get_range_tuple_id(arg0.ptr) 843 obj = id(ctx=ctx, ptr=res) 844 return obj 845 def get_range_tuple_id(arg0): 846 return arg0.range_tuple_id() 847 def reset_range_tuple_id(arg0): 848 try: 849 if not arg0.__class__ is multi_union_pw_aff: 850 arg0 = multi_union_pw_aff(arg0) 851 except: 852 raise 853 ctx = arg0.ctx 854 res = isl.isl_multi_union_pw_aff_reset_range_tuple_id(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 855 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 856 return obj 857 def scale(*args): 858 if len(args) == 2 and args[1].__class__ is multi_val: 859 args = list(args) 860 try: 861 if not args[0].__class__ is multi_union_pw_aff: 862 args[0] = multi_union_pw_aff(args[0]) 863 except: 864 raise 865 ctx = args[0].ctx 866 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)) 867 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 868 return obj 869 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 870 args = list(args) 871 try: 872 if not args[0].__class__ is multi_union_pw_aff: 873 args[0] = multi_union_pw_aff(args[0]) 874 except: 875 raise 876 try: 877 if not args[1].__class__ is val: 878 args[1] = val(args[1]) 879 except: 880 raise 881 ctx = args[0].ctx 882 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)) 883 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 884 return obj 885 raise Error 886 def scale_down(*args): 887 if len(args) == 2 and args[1].__class__ is multi_val: 888 args = list(args) 889 try: 890 if not args[0].__class__ is multi_union_pw_aff: 891 args[0] = multi_union_pw_aff(args[0]) 892 except: 893 raise 894 ctx = args[0].ctx 895 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)) 896 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 897 return obj 898 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 899 args = list(args) 900 try: 901 if not args[0].__class__ is multi_union_pw_aff: 902 args[0] = multi_union_pw_aff(args[0]) 903 except: 904 raise 905 try: 906 if not args[1].__class__ is val: 907 args[1] = val(args[1]) 908 except: 909 raise 910 ctx = args[0].ctx 911 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)) 912 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 913 return obj 914 raise Error 915 def set_at(arg0, arg1, arg2): 916 try: 917 if not arg0.__class__ is multi_union_pw_aff: 918 arg0 = multi_union_pw_aff(arg0) 919 except: 920 raise 921 try: 922 if not arg2.__class__ is union_pw_aff: 923 arg2 = union_pw_aff(arg2) 924 except: 925 raise 926 ctx = arg0.ctx 927 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)) 928 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 929 return obj 930 def set_range_tuple(*args): 931 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 932 args = list(args) 933 try: 934 if not args[0].__class__ is multi_union_pw_aff: 935 args[0] = multi_union_pw_aff(args[0]) 936 except: 937 raise 938 try: 939 if not args[1].__class__ is id: 940 args[1] = id(args[1]) 941 except: 942 raise 943 ctx = args[0].ctx 944 res = isl.isl_multi_union_pw_aff_set_range_tuple_id(isl.isl_multi_union_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 945 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 946 return obj 947 raise Error 948 def size(arg0): 949 try: 950 if not arg0.__class__ is multi_union_pw_aff: 951 arg0 = multi_union_pw_aff(arg0) 952 except: 953 raise 954 ctx = arg0.ctx 955 res = isl.isl_multi_union_pw_aff_size(arg0.ptr) 956 if res < 0: 957 raise Error 958 return int(res) 959 def space(arg0): 960 try: 961 if not arg0.__class__ is multi_union_pw_aff: 962 arg0 = multi_union_pw_aff(arg0) 963 except: 964 raise 965 ctx = arg0.ctx 966 res = isl.isl_multi_union_pw_aff_get_space(arg0.ptr) 967 obj = space(ctx=ctx, ptr=res) 968 return obj 969 def get_space(arg0): 970 return arg0.space() 971 def sub(arg0, arg1): 972 try: 973 if not arg0.__class__ is multi_union_pw_aff: 974 arg0 = multi_union_pw_aff(arg0) 975 except: 976 raise 977 try: 978 if not arg1.__class__ is multi_union_pw_aff: 979 arg1 = multi_union_pw_aff(arg1) 980 except: 981 raise 982 ctx = arg0.ctx 983 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)) 984 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 985 return obj 986 def union_add(arg0, arg1): 987 try: 988 if not arg0.__class__ is multi_union_pw_aff: 989 arg0 = multi_union_pw_aff(arg0) 990 except: 991 raise 992 try: 993 if not arg1.__class__ is multi_union_pw_aff: 994 arg1 = multi_union_pw_aff(arg1) 995 except: 996 raise 997 ctx = arg0.ctx 998 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)) 999 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 1000 return obj 1001 @staticmethod 1002 def zero(arg0): 1003 try: 1004 if not arg0.__class__ is space: 1005 arg0 = space(arg0) 1006 except: 1007 raise 1008 ctx = arg0.ctx 1009 res = isl.isl_multi_union_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 1010 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 1011 return obj 1012 1013isl.isl_multi_union_pw_aff_from_multi_pw_aff.restype = c_void_p 1014isl.isl_multi_union_pw_aff_from_multi_pw_aff.argtypes = [c_void_p] 1015isl.isl_multi_union_pw_aff_from_union_pw_aff.restype = c_void_p 1016isl.isl_multi_union_pw_aff_from_union_pw_aff.argtypes = [c_void_p] 1017isl.isl_multi_union_pw_aff_from_union_pw_aff_list.restype = c_void_p 1018isl.isl_multi_union_pw_aff_from_union_pw_aff_list.argtypes = [c_void_p, c_void_p] 1019isl.isl_multi_union_pw_aff_read_from_str.restype = c_void_p 1020isl.isl_multi_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1021isl.isl_multi_union_pw_aff_add.restype = c_void_p 1022isl.isl_multi_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 1023isl.isl_multi_union_pw_aff_get_at.restype = c_void_p 1024isl.isl_multi_union_pw_aff_get_at.argtypes = [c_void_p, c_int] 1025isl.isl_multi_union_pw_aff_bind.restype = c_void_p 1026isl.isl_multi_union_pw_aff_bind.argtypes = [c_void_p, c_void_p] 1027isl.isl_multi_union_pw_aff_coalesce.restype = c_void_p 1028isl.isl_multi_union_pw_aff_coalesce.argtypes = [c_void_p] 1029isl.isl_multi_union_pw_aff_domain.restype = c_void_p 1030isl.isl_multi_union_pw_aff_domain.argtypes = [c_void_p] 1031isl.isl_multi_union_pw_aff_flat_range_product.restype = c_void_p 1032isl.isl_multi_union_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 1033isl.isl_multi_union_pw_aff_gist.restype = c_void_p 1034isl.isl_multi_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1035isl.isl_multi_union_pw_aff_gist_params.restype = c_void_p 1036isl.isl_multi_union_pw_aff_gist_params.argtypes = [c_void_p, c_void_p] 1037isl.isl_multi_union_pw_aff_has_range_tuple_id.argtypes = [c_void_p] 1038isl.isl_multi_union_pw_aff_intersect_domain.restype = c_void_p 1039isl.isl_multi_union_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 1040isl.isl_multi_union_pw_aff_intersect_params.restype = c_void_p 1041isl.isl_multi_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1042isl.isl_multi_union_pw_aff_involves_nan.argtypes = [c_void_p] 1043isl.isl_multi_union_pw_aff_get_list.restype = c_void_p 1044isl.isl_multi_union_pw_aff_get_list.argtypes = [c_void_p] 1045isl.isl_multi_union_pw_aff_neg.restype = c_void_p 1046isl.isl_multi_union_pw_aff_neg.argtypes = [c_void_p] 1047isl.isl_multi_union_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 1048isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 1049isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1050isl.isl_multi_union_pw_aff_range_product.restype = c_void_p 1051isl.isl_multi_union_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 1052isl.isl_multi_union_pw_aff_get_range_tuple_id.restype = c_void_p 1053isl.isl_multi_union_pw_aff_get_range_tuple_id.argtypes = [c_void_p] 1054isl.isl_multi_union_pw_aff_reset_range_tuple_id.restype = c_void_p 1055isl.isl_multi_union_pw_aff_reset_range_tuple_id.argtypes = [c_void_p] 1056isl.isl_multi_union_pw_aff_scale_multi_val.restype = c_void_p 1057isl.isl_multi_union_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 1058isl.isl_multi_union_pw_aff_scale_val.restype = c_void_p 1059isl.isl_multi_union_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 1060isl.isl_multi_union_pw_aff_scale_down_multi_val.restype = c_void_p 1061isl.isl_multi_union_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 1062isl.isl_multi_union_pw_aff_scale_down_val.restype = c_void_p 1063isl.isl_multi_union_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 1064isl.isl_multi_union_pw_aff_set_at.restype = c_void_p 1065isl.isl_multi_union_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 1066isl.isl_multi_union_pw_aff_set_range_tuple_id.restype = c_void_p 1067isl.isl_multi_union_pw_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 1068isl.isl_multi_union_pw_aff_size.argtypes = [c_void_p] 1069isl.isl_multi_union_pw_aff_get_space.restype = c_void_p 1070isl.isl_multi_union_pw_aff_get_space.argtypes = [c_void_p] 1071isl.isl_multi_union_pw_aff_sub.restype = c_void_p 1072isl.isl_multi_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1073isl.isl_multi_union_pw_aff_union_add.restype = c_void_p 1074isl.isl_multi_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1075isl.isl_multi_union_pw_aff_zero.restype = c_void_p 1076isl.isl_multi_union_pw_aff_zero.argtypes = [c_void_p] 1077isl.isl_multi_union_pw_aff_copy.restype = c_void_p 1078isl.isl_multi_union_pw_aff_copy.argtypes = [c_void_p] 1079isl.isl_multi_union_pw_aff_free.restype = c_void_p 1080isl.isl_multi_union_pw_aff_free.argtypes = [c_void_p] 1081isl.isl_multi_union_pw_aff_to_str.restype = POINTER(c_char) 1082isl.isl_multi_union_pw_aff_to_str.argtypes = [c_void_p] 1083 1084class union_pw_aff(union_pw_multi_aff, multi_union_pw_aff): 1085 def __init__(self, *args, **keywords): 1086 if "ptr" in keywords: 1087 self.ctx = keywords["ctx"] 1088 self.ptr = keywords["ptr"] 1089 return 1090 if len(args) == 1 and args[0].__class__ is aff: 1091 self.ctx = Context.getDefaultInstance() 1092 self.ptr = isl.isl_union_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 1093 return 1094 if len(args) == 1 and args[0].__class__ is pw_aff: 1095 self.ctx = Context.getDefaultInstance() 1096 self.ptr = isl.isl_union_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1097 return 1098 if len(args) == 1 and type(args[0]) == str: 1099 self.ctx = Context.getDefaultInstance() 1100 self.ptr = isl.isl_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1101 return 1102 raise Error 1103 def __del__(self): 1104 if hasattr(self, 'ptr'): 1105 isl.isl_union_pw_aff_free(self.ptr) 1106 def __str__(arg0): 1107 try: 1108 if not arg0.__class__ is union_pw_aff: 1109 arg0 = union_pw_aff(arg0) 1110 except: 1111 raise 1112 ptr = isl.isl_union_pw_aff_to_str(arg0.ptr) 1113 res = cast(ptr, c_char_p).value.decode('ascii') 1114 libc.free(ptr) 1115 return res 1116 def __repr__(self): 1117 s = str(self) 1118 if '"' in s: 1119 return 'isl.union_pw_aff("""%s""")' % s 1120 else: 1121 return 'isl.union_pw_aff("%s")' % s 1122 def add(arg0, arg1): 1123 try: 1124 if not arg0.__class__ is union_pw_aff: 1125 arg0 = union_pw_aff(arg0) 1126 except: 1127 raise 1128 try: 1129 if not arg1.__class__ is union_pw_aff: 1130 arg1 = union_pw_aff(arg1) 1131 except: 1132 return union_pw_multi_aff(arg0).add(arg1) 1133 ctx = arg0.ctx 1134 res = isl.isl_union_pw_aff_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1135 obj = union_pw_aff(ctx=ctx, ptr=res) 1136 return obj 1137 def bind(*args): 1138 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 1139 args = list(args) 1140 try: 1141 if not args[0].__class__ is union_pw_aff: 1142 args[0] = union_pw_aff(args[0]) 1143 except: 1144 raise 1145 try: 1146 if not args[1].__class__ is id: 1147 args[1] = id(args[1]) 1148 except: 1149 raise 1150 ctx = args[0].ctx 1151 res = isl.isl_union_pw_aff_bind_id(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 1152 obj = union_set(ctx=ctx, ptr=res) 1153 return obj 1154 raise Error 1155 def coalesce(arg0): 1156 try: 1157 if not arg0.__class__ is union_pw_aff: 1158 arg0 = union_pw_aff(arg0) 1159 except: 1160 raise 1161 ctx = arg0.ctx 1162 res = isl.isl_union_pw_aff_coalesce(isl.isl_union_pw_aff_copy(arg0.ptr)) 1163 obj = union_pw_aff(ctx=ctx, ptr=res) 1164 return obj 1165 def domain(arg0): 1166 try: 1167 if not arg0.__class__ is union_pw_aff: 1168 arg0 = union_pw_aff(arg0) 1169 except: 1170 raise 1171 ctx = arg0.ctx 1172 res = isl.isl_union_pw_aff_domain(isl.isl_union_pw_aff_copy(arg0.ptr)) 1173 obj = union_set(ctx=ctx, ptr=res) 1174 return obj 1175 def drop_unused_params(arg0): 1176 try: 1177 if not arg0.__class__ is union_pw_aff: 1178 arg0 = union_pw_aff(arg0) 1179 except: 1180 raise 1181 ctx = arg0.ctx 1182 res = isl.isl_union_pw_aff_drop_unused_params(isl.isl_union_pw_aff_copy(arg0.ptr)) 1183 obj = union_pw_aff(ctx=ctx, ptr=res) 1184 return obj 1185 def gist(arg0, arg1): 1186 try: 1187 if not arg0.__class__ is union_pw_aff: 1188 arg0 = union_pw_aff(arg0) 1189 except: 1190 raise 1191 try: 1192 if not arg1.__class__ is union_set: 1193 arg1 = union_set(arg1) 1194 except: 1195 return union_pw_multi_aff(arg0).gist(arg1) 1196 ctx = arg0.ctx 1197 res = isl.isl_union_pw_aff_gist(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 1198 obj = union_pw_aff(ctx=ctx, ptr=res) 1199 return obj 1200 def intersect_domain(*args): 1201 if len(args) == 2 and args[1].__class__ is space: 1202 args = list(args) 1203 try: 1204 if not args[0].__class__ is union_pw_aff: 1205 args[0] = union_pw_aff(args[0]) 1206 except: 1207 raise 1208 ctx = args[0].ctx 1209 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)) 1210 obj = union_pw_aff(ctx=ctx, ptr=res) 1211 return obj 1212 if len(args) == 2 and args[1].__class__ is union_set: 1213 args = list(args) 1214 try: 1215 if not args[0].__class__ is union_pw_aff: 1216 args[0] = union_pw_aff(args[0]) 1217 except: 1218 raise 1219 ctx = args[0].ctx 1220 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)) 1221 obj = union_pw_aff(ctx=ctx, ptr=res) 1222 return obj 1223 raise Error 1224 def intersect_domain_wrapped_domain(arg0, arg1): 1225 try: 1226 if not arg0.__class__ is union_pw_aff: 1227 arg0 = union_pw_aff(arg0) 1228 except: 1229 raise 1230 try: 1231 if not arg1.__class__ is union_set: 1232 arg1 = union_set(arg1) 1233 except: 1234 return union_pw_multi_aff(arg0).intersect_domain_wrapped_domain(arg1) 1235 ctx = arg0.ctx 1236 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)) 1237 obj = union_pw_aff(ctx=ctx, ptr=res) 1238 return obj 1239 def intersect_domain_wrapped_range(arg0, arg1): 1240 try: 1241 if not arg0.__class__ is union_pw_aff: 1242 arg0 = union_pw_aff(arg0) 1243 except: 1244 raise 1245 try: 1246 if not arg1.__class__ is union_set: 1247 arg1 = union_set(arg1) 1248 except: 1249 return union_pw_multi_aff(arg0).intersect_domain_wrapped_range(arg1) 1250 ctx = arg0.ctx 1251 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)) 1252 obj = union_pw_aff(ctx=ctx, ptr=res) 1253 return obj 1254 def intersect_params(arg0, arg1): 1255 try: 1256 if not arg0.__class__ is union_pw_aff: 1257 arg0 = union_pw_aff(arg0) 1258 except: 1259 raise 1260 try: 1261 if not arg1.__class__ is set: 1262 arg1 = set(arg1) 1263 except: 1264 return union_pw_multi_aff(arg0).intersect_params(arg1) 1265 ctx = arg0.ctx 1266 res = isl.isl_union_pw_aff_intersect_params(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1267 obj = union_pw_aff(ctx=ctx, ptr=res) 1268 return obj 1269 def plain_is_equal(arg0, arg1): 1270 try: 1271 if not arg0.__class__ is union_pw_aff: 1272 arg0 = union_pw_aff(arg0) 1273 except: 1274 raise 1275 try: 1276 if not arg1.__class__ is union_pw_aff: 1277 arg1 = union_pw_aff(arg1) 1278 except: 1279 return union_pw_multi_aff(arg0).plain_is_equal(arg1) 1280 ctx = arg0.ctx 1281 res = isl.isl_union_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 1282 if res < 0: 1283 raise Error 1284 return bool(res) 1285 def pullback(*args): 1286 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 1287 args = list(args) 1288 try: 1289 if not args[0].__class__ is union_pw_aff: 1290 args[0] = union_pw_aff(args[0]) 1291 except: 1292 raise 1293 ctx = args[0].ctx 1294 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)) 1295 obj = union_pw_aff(ctx=ctx, ptr=res) 1296 return obj 1297 raise Error 1298 def space(arg0): 1299 try: 1300 if not arg0.__class__ is union_pw_aff: 1301 arg0 = union_pw_aff(arg0) 1302 except: 1303 raise 1304 ctx = arg0.ctx 1305 res = isl.isl_union_pw_aff_get_space(arg0.ptr) 1306 obj = space(ctx=ctx, ptr=res) 1307 return obj 1308 def get_space(arg0): 1309 return arg0.space() 1310 def sub(arg0, arg1): 1311 try: 1312 if not arg0.__class__ is union_pw_aff: 1313 arg0 = union_pw_aff(arg0) 1314 except: 1315 raise 1316 try: 1317 if not arg1.__class__ is union_pw_aff: 1318 arg1 = union_pw_aff(arg1) 1319 except: 1320 return union_pw_multi_aff(arg0).sub(arg1) 1321 ctx = arg0.ctx 1322 res = isl.isl_union_pw_aff_sub(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1323 obj = union_pw_aff(ctx=ctx, ptr=res) 1324 return obj 1325 def subtract_domain(*args): 1326 if len(args) == 2 and args[1].__class__ is space: 1327 args = list(args) 1328 try: 1329 if not args[0].__class__ is union_pw_aff: 1330 args[0] = union_pw_aff(args[0]) 1331 except: 1332 raise 1333 ctx = args[0].ctx 1334 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)) 1335 obj = union_pw_aff(ctx=ctx, ptr=res) 1336 return obj 1337 if len(args) == 2 and args[1].__class__ is union_set: 1338 args = list(args) 1339 try: 1340 if not args[0].__class__ is union_pw_aff: 1341 args[0] = union_pw_aff(args[0]) 1342 except: 1343 raise 1344 ctx = args[0].ctx 1345 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)) 1346 obj = union_pw_aff(ctx=ctx, ptr=res) 1347 return obj 1348 raise Error 1349 def to_list(arg0): 1350 try: 1351 if not arg0.__class__ is union_pw_aff: 1352 arg0 = union_pw_aff(arg0) 1353 except: 1354 raise 1355 ctx = arg0.ctx 1356 res = isl.isl_union_pw_aff_to_list(isl.isl_union_pw_aff_copy(arg0.ptr)) 1357 obj = union_pw_aff_list(ctx=ctx, ptr=res) 1358 return obj 1359 def union_add(arg0, arg1): 1360 try: 1361 if not arg0.__class__ is union_pw_aff: 1362 arg0 = union_pw_aff(arg0) 1363 except: 1364 raise 1365 try: 1366 if not arg1.__class__ is union_pw_aff: 1367 arg1 = union_pw_aff(arg1) 1368 except: 1369 return union_pw_multi_aff(arg0).union_add(arg1) 1370 ctx = arg0.ctx 1371 res = isl.isl_union_pw_aff_union_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1372 obj = union_pw_aff(ctx=ctx, ptr=res) 1373 return obj 1374 1375isl.isl_union_pw_aff_from_aff.restype = c_void_p 1376isl.isl_union_pw_aff_from_aff.argtypes = [c_void_p] 1377isl.isl_union_pw_aff_from_pw_aff.restype = c_void_p 1378isl.isl_union_pw_aff_from_pw_aff.argtypes = [c_void_p] 1379isl.isl_union_pw_aff_read_from_str.restype = c_void_p 1380isl.isl_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1381isl.isl_union_pw_aff_add.restype = c_void_p 1382isl.isl_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 1383isl.isl_union_pw_aff_bind_id.restype = c_void_p 1384isl.isl_union_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 1385isl.isl_union_pw_aff_coalesce.restype = c_void_p 1386isl.isl_union_pw_aff_coalesce.argtypes = [c_void_p] 1387isl.isl_union_pw_aff_domain.restype = c_void_p 1388isl.isl_union_pw_aff_domain.argtypes = [c_void_p] 1389isl.isl_union_pw_aff_drop_unused_params.restype = c_void_p 1390isl.isl_union_pw_aff_drop_unused_params.argtypes = [c_void_p] 1391isl.isl_union_pw_aff_gist.restype = c_void_p 1392isl.isl_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1393isl.isl_union_pw_aff_intersect_domain_space.restype = c_void_p 1394isl.isl_union_pw_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 1395isl.isl_union_pw_aff_intersect_domain_union_set.restype = c_void_p 1396isl.isl_union_pw_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 1397isl.isl_union_pw_aff_intersect_domain_wrapped_domain.restype = c_void_p 1398isl.isl_union_pw_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 1399isl.isl_union_pw_aff_intersect_domain_wrapped_range.restype = c_void_p 1400isl.isl_union_pw_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 1401isl.isl_union_pw_aff_intersect_params.restype = c_void_p 1402isl.isl_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1403isl.isl_union_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 1404isl.isl_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 1405isl.isl_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1406isl.isl_union_pw_aff_get_space.restype = c_void_p 1407isl.isl_union_pw_aff_get_space.argtypes = [c_void_p] 1408isl.isl_union_pw_aff_sub.restype = c_void_p 1409isl.isl_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1410isl.isl_union_pw_aff_subtract_domain_space.restype = c_void_p 1411isl.isl_union_pw_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 1412isl.isl_union_pw_aff_subtract_domain_union_set.restype = c_void_p 1413isl.isl_union_pw_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 1414isl.isl_union_pw_aff_to_list.restype = c_void_p 1415isl.isl_union_pw_aff_to_list.argtypes = [c_void_p] 1416isl.isl_union_pw_aff_union_add.restype = c_void_p 1417isl.isl_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1418isl.isl_union_pw_aff_copy.restype = c_void_p 1419isl.isl_union_pw_aff_copy.argtypes = [c_void_p] 1420isl.isl_union_pw_aff_free.restype = c_void_p 1421isl.isl_union_pw_aff_free.argtypes = [c_void_p] 1422isl.isl_union_pw_aff_to_str.restype = POINTER(c_char) 1423isl.isl_union_pw_aff_to_str.argtypes = [c_void_p] 1424 1425class multi_pw_aff(multi_union_pw_aff): 1426 def __init__(self, *args, **keywords): 1427 if "ptr" in keywords: 1428 self.ctx = keywords["ctx"] 1429 self.ptr = keywords["ptr"] 1430 return 1431 if len(args) == 1 and args[0].__class__ is aff: 1432 self.ctx = Context.getDefaultInstance() 1433 self.ptr = isl.isl_multi_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 1434 return 1435 if len(args) == 1 and args[0].__class__ is multi_aff: 1436 self.ctx = Context.getDefaultInstance() 1437 self.ptr = isl.isl_multi_pw_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 1438 return 1439 if len(args) == 1 and args[0].__class__ is pw_aff: 1440 self.ctx = Context.getDefaultInstance() 1441 self.ptr = isl.isl_multi_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1442 return 1443 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is pw_aff_list: 1444 self.ctx = Context.getDefaultInstance() 1445 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)) 1446 return 1447 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 1448 self.ctx = Context.getDefaultInstance() 1449 self.ptr = isl.isl_multi_pw_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 1450 return 1451 if len(args) == 1 and type(args[0]) == str: 1452 self.ctx = Context.getDefaultInstance() 1453 self.ptr = isl.isl_multi_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1454 return 1455 raise Error 1456 def __del__(self): 1457 if hasattr(self, 'ptr'): 1458 isl.isl_multi_pw_aff_free(self.ptr) 1459 def __str__(arg0): 1460 try: 1461 if not arg0.__class__ is multi_pw_aff: 1462 arg0 = multi_pw_aff(arg0) 1463 except: 1464 raise 1465 ptr = isl.isl_multi_pw_aff_to_str(arg0.ptr) 1466 res = cast(ptr, c_char_p).value.decode('ascii') 1467 libc.free(ptr) 1468 return res 1469 def __repr__(self): 1470 s = str(self) 1471 if '"' in s: 1472 return 'isl.multi_pw_aff("""%s""")' % s 1473 else: 1474 return 'isl.multi_pw_aff("%s")' % s 1475 def add(arg0, arg1): 1476 try: 1477 if not arg0.__class__ is multi_pw_aff: 1478 arg0 = multi_pw_aff(arg0) 1479 except: 1480 raise 1481 try: 1482 if not arg1.__class__ is multi_pw_aff: 1483 arg1 = multi_pw_aff(arg1) 1484 except: 1485 return multi_union_pw_aff(arg0).add(arg1) 1486 ctx = arg0.ctx 1487 res = isl.isl_multi_pw_aff_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1488 obj = multi_pw_aff(ctx=ctx, ptr=res) 1489 return obj 1490 def add_constant(*args): 1491 if len(args) == 2 and args[1].__class__ is multi_val: 1492 args = list(args) 1493 try: 1494 if not args[0].__class__ is multi_pw_aff: 1495 args[0] = multi_pw_aff(args[0]) 1496 except: 1497 raise 1498 ctx = args[0].ctx 1499 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)) 1500 obj = multi_pw_aff(ctx=ctx, ptr=res) 1501 return obj 1502 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1503 args = list(args) 1504 try: 1505 if not args[0].__class__ is multi_pw_aff: 1506 args[0] = multi_pw_aff(args[0]) 1507 except: 1508 raise 1509 try: 1510 if not args[1].__class__ is val: 1511 args[1] = val(args[1]) 1512 except: 1513 raise 1514 ctx = args[0].ctx 1515 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)) 1516 obj = multi_pw_aff(ctx=ctx, ptr=res) 1517 return obj 1518 raise Error 1519 def as_map(arg0): 1520 try: 1521 if not arg0.__class__ is multi_pw_aff: 1522 arg0 = multi_pw_aff(arg0) 1523 except: 1524 raise 1525 ctx = arg0.ctx 1526 res = isl.isl_multi_pw_aff_as_map(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1527 obj = map(ctx=ctx, ptr=res) 1528 return obj 1529 def as_multi_aff(arg0): 1530 try: 1531 if not arg0.__class__ is multi_pw_aff: 1532 arg0 = multi_pw_aff(arg0) 1533 except: 1534 raise 1535 ctx = arg0.ctx 1536 res = isl.isl_multi_pw_aff_as_multi_aff(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1537 obj = multi_aff(ctx=ctx, ptr=res) 1538 return obj 1539 def as_set(arg0): 1540 try: 1541 if not arg0.__class__ is multi_pw_aff: 1542 arg0 = multi_pw_aff(arg0) 1543 except: 1544 raise 1545 ctx = arg0.ctx 1546 res = isl.isl_multi_pw_aff_as_set(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1547 obj = set(ctx=ctx, ptr=res) 1548 return obj 1549 def at(arg0, arg1): 1550 try: 1551 if not arg0.__class__ is multi_pw_aff: 1552 arg0 = multi_pw_aff(arg0) 1553 except: 1554 raise 1555 ctx = arg0.ctx 1556 res = isl.isl_multi_pw_aff_get_at(arg0.ptr, arg1) 1557 obj = pw_aff(ctx=ctx, ptr=res) 1558 return obj 1559 def get_at(arg0, arg1): 1560 return arg0.at(arg1) 1561 def bind(arg0, arg1): 1562 try: 1563 if not arg0.__class__ is multi_pw_aff: 1564 arg0 = multi_pw_aff(arg0) 1565 except: 1566 raise 1567 try: 1568 if not arg1.__class__ is multi_id: 1569 arg1 = multi_id(arg1) 1570 except: 1571 return multi_union_pw_aff(arg0).bind(arg1) 1572 ctx = arg0.ctx 1573 res = isl.isl_multi_pw_aff_bind(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1574 obj = set(ctx=ctx, ptr=res) 1575 return obj 1576 def bind_domain(arg0, arg1): 1577 try: 1578 if not arg0.__class__ is multi_pw_aff: 1579 arg0 = multi_pw_aff(arg0) 1580 except: 1581 raise 1582 try: 1583 if not arg1.__class__ is multi_id: 1584 arg1 = multi_id(arg1) 1585 except: 1586 return multi_union_pw_aff(arg0).bind_domain(arg1) 1587 ctx = arg0.ctx 1588 res = isl.isl_multi_pw_aff_bind_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1589 obj = multi_pw_aff(ctx=ctx, ptr=res) 1590 return obj 1591 def bind_domain_wrapped_domain(arg0, arg1): 1592 try: 1593 if not arg0.__class__ is multi_pw_aff: 1594 arg0 = multi_pw_aff(arg0) 1595 except: 1596 raise 1597 try: 1598 if not arg1.__class__ is multi_id: 1599 arg1 = multi_id(arg1) 1600 except: 1601 return multi_union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 1602 ctx = arg0.ctx 1603 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)) 1604 obj = multi_pw_aff(ctx=ctx, ptr=res) 1605 return obj 1606 def coalesce(arg0): 1607 try: 1608 if not arg0.__class__ is multi_pw_aff: 1609 arg0 = multi_pw_aff(arg0) 1610 except: 1611 raise 1612 ctx = arg0.ctx 1613 res = isl.isl_multi_pw_aff_coalesce(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1614 obj = multi_pw_aff(ctx=ctx, ptr=res) 1615 return obj 1616 def domain(arg0): 1617 try: 1618 if not arg0.__class__ is multi_pw_aff: 1619 arg0 = multi_pw_aff(arg0) 1620 except: 1621 raise 1622 ctx = arg0.ctx 1623 res = isl.isl_multi_pw_aff_domain(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1624 obj = set(ctx=ctx, ptr=res) 1625 return obj 1626 def domain_reverse(arg0): 1627 try: 1628 if not arg0.__class__ is multi_pw_aff: 1629 arg0 = multi_pw_aff(arg0) 1630 except: 1631 raise 1632 ctx = arg0.ctx 1633 res = isl.isl_multi_pw_aff_domain_reverse(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1634 obj = multi_pw_aff(ctx=ctx, ptr=res) 1635 return obj 1636 def flat_range_product(arg0, arg1): 1637 try: 1638 if not arg0.__class__ is multi_pw_aff: 1639 arg0 = multi_pw_aff(arg0) 1640 except: 1641 raise 1642 try: 1643 if not arg1.__class__ is multi_pw_aff: 1644 arg1 = multi_pw_aff(arg1) 1645 except: 1646 return multi_union_pw_aff(arg0).flat_range_product(arg1) 1647 ctx = arg0.ctx 1648 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)) 1649 obj = multi_pw_aff(ctx=ctx, ptr=res) 1650 return obj 1651 def gist(arg0, arg1): 1652 try: 1653 if not arg0.__class__ is multi_pw_aff: 1654 arg0 = multi_pw_aff(arg0) 1655 except: 1656 raise 1657 try: 1658 if not arg1.__class__ is set: 1659 arg1 = set(arg1) 1660 except: 1661 return multi_union_pw_aff(arg0).gist(arg1) 1662 ctx = arg0.ctx 1663 res = isl.isl_multi_pw_aff_gist(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1664 obj = multi_pw_aff(ctx=ctx, ptr=res) 1665 return obj 1666 def gist_params(arg0, arg1): 1667 try: 1668 if not arg0.__class__ is multi_pw_aff: 1669 arg0 = multi_pw_aff(arg0) 1670 except: 1671 raise 1672 try: 1673 if not arg1.__class__ is set: 1674 arg1 = set(arg1) 1675 except: 1676 return multi_union_pw_aff(arg0).gist_params(arg1) 1677 ctx = arg0.ctx 1678 res = isl.isl_multi_pw_aff_gist_params(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1679 obj = multi_pw_aff(ctx=ctx, ptr=res) 1680 return obj 1681 def has_range_tuple_id(arg0): 1682 try: 1683 if not arg0.__class__ is multi_pw_aff: 1684 arg0 = multi_pw_aff(arg0) 1685 except: 1686 raise 1687 ctx = arg0.ctx 1688 res = isl.isl_multi_pw_aff_has_range_tuple_id(arg0.ptr) 1689 if res < 0: 1690 raise Error 1691 return bool(res) 1692 def identity(*args): 1693 if len(args) == 1: 1694 args = list(args) 1695 try: 1696 if not args[0].__class__ is multi_pw_aff: 1697 args[0] = multi_pw_aff(args[0]) 1698 except: 1699 raise 1700 ctx = args[0].ctx 1701 res = isl.isl_multi_pw_aff_identity_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 1702 obj = multi_pw_aff(ctx=ctx, ptr=res) 1703 return obj 1704 raise Error 1705 @staticmethod 1706 def identity_on_domain(*args): 1707 if len(args) == 1 and args[0].__class__ is space: 1708 ctx = args[0].ctx 1709 res = isl.isl_multi_pw_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 1710 obj = multi_pw_aff(ctx=ctx, ptr=res) 1711 return obj 1712 raise Error 1713 def insert_domain(arg0, arg1): 1714 try: 1715 if not arg0.__class__ is multi_pw_aff: 1716 arg0 = multi_pw_aff(arg0) 1717 except: 1718 raise 1719 try: 1720 if not arg1.__class__ is space: 1721 arg1 = space(arg1) 1722 except: 1723 return multi_union_pw_aff(arg0).insert_domain(arg1) 1724 ctx = arg0.ctx 1725 res = isl.isl_multi_pw_aff_insert_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 1726 obj = multi_pw_aff(ctx=ctx, ptr=res) 1727 return obj 1728 def intersect_domain(arg0, arg1): 1729 try: 1730 if not arg0.__class__ is multi_pw_aff: 1731 arg0 = multi_pw_aff(arg0) 1732 except: 1733 raise 1734 try: 1735 if not arg1.__class__ is set: 1736 arg1 = set(arg1) 1737 except: 1738 return multi_union_pw_aff(arg0).intersect_domain(arg1) 1739 ctx = arg0.ctx 1740 res = isl.isl_multi_pw_aff_intersect_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1741 obj = multi_pw_aff(ctx=ctx, ptr=res) 1742 return obj 1743 def intersect_params(arg0, arg1): 1744 try: 1745 if not arg0.__class__ is multi_pw_aff: 1746 arg0 = multi_pw_aff(arg0) 1747 except: 1748 raise 1749 try: 1750 if not arg1.__class__ is set: 1751 arg1 = set(arg1) 1752 except: 1753 return multi_union_pw_aff(arg0).intersect_params(arg1) 1754 ctx = arg0.ctx 1755 res = isl.isl_multi_pw_aff_intersect_params(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1756 obj = multi_pw_aff(ctx=ctx, ptr=res) 1757 return obj 1758 def involves_nan(arg0): 1759 try: 1760 if not arg0.__class__ is multi_pw_aff: 1761 arg0 = multi_pw_aff(arg0) 1762 except: 1763 raise 1764 ctx = arg0.ctx 1765 res = isl.isl_multi_pw_aff_involves_nan(arg0.ptr) 1766 if res < 0: 1767 raise Error 1768 return bool(res) 1769 def involves_param(*args): 1770 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 1771 args = list(args) 1772 try: 1773 if not args[0].__class__ is multi_pw_aff: 1774 args[0] = multi_pw_aff(args[0]) 1775 except: 1776 raise 1777 try: 1778 if not args[1].__class__ is id: 1779 args[1] = id(args[1]) 1780 except: 1781 raise 1782 ctx = args[0].ctx 1783 res = isl.isl_multi_pw_aff_involves_param_id(args[0].ptr, args[1].ptr) 1784 if res < 0: 1785 raise Error 1786 return bool(res) 1787 if len(args) == 2 and args[1].__class__ is id_list: 1788 args = list(args) 1789 try: 1790 if not args[0].__class__ is multi_pw_aff: 1791 args[0] = multi_pw_aff(args[0]) 1792 except: 1793 raise 1794 ctx = args[0].ctx 1795 res = isl.isl_multi_pw_aff_involves_param_id_list(args[0].ptr, args[1].ptr) 1796 if res < 0: 1797 raise Error 1798 return bool(res) 1799 raise Error 1800 def isa_multi_aff(arg0): 1801 try: 1802 if not arg0.__class__ is multi_pw_aff: 1803 arg0 = multi_pw_aff(arg0) 1804 except: 1805 raise 1806 ctx = arg0.ctx 1807 res = isl.isl_multi_pw_aff_isa_multi_aff(arg0.ptr) 1808 if res < 0: 1809 raise Error 1810 return bool(res) 1811 def list(arg0): 1812 try: 1813 if not arg0.__class__ is multi_pw_aff: 1814 arg0 = multi_pw_aff(arg0) 1815 except: 1816 raise 1817 ctx = arg0.ctx 1818 res = isl.isl_multi_pw_aff_get_list(arg0.ptr) 1819 obj = pw_aff_list(ctx=ctx, ptr=res) 1820 return obj 1821 def get_list(arg0): 1822 return arg0.list() 1823 def max(arg0, arg1): 1824 try: 1825 if not arg0.__class__ is multi_pw_aff: 1826 arg0 = multi_pw_aff(arg0) 1827 except: 1828 raise 1829 try: 1830 if not arg1.__class__ is multi_pw_aff: 1831 arg1 = multi_pw_aff(arg1) 1832 except: 1833 return multi_union_pw_aff(arg0).max(arg1) 1834 ctx = arg0.ctx 1835 res = isl.isl_multi_pw_aff_max(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1836 obj = multi_pw_aff(ctx=ctx, ptr=res) 1837 return obj 1838 def max_multi_val(arg0): 1839 try: 1840 if not arg0.__class__ is multi_pw_aff: 1841 arg0 = multi_pw_aff(arg0) 1842 except: 1843 raise 1844 ctx = arg0.ctx 1845 res = isl.isl_multi_pw_aff_max_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1846 obj = multi_val(ctx=ctx, ptr=res) 1847 return obj 1848 def min(arg0, arg1): 1849 try: 1850 if not arg0.__class__ is multi_pw_aff: 1851 arg0 = multi_pw_aff(arg0) 1852 except: 1853 raise 1854 try: 1855 if not arg1.__class__ is multi_pw_aff: 1856 arg1 = multi_pw_aff(arg1) 1857 except: 1858 return multi_union_pw_aff(arg0).min(arg1) 1859 ctx = arg0.ctx 1860 res = isl.isl_multi_pw_aff_min(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1861 obj = multi_pw_aff(ctx=ctx, ptr=res) 1862 return obj 1863 def min_multi_val(arg0): 1864 try: 1865 if not arg0.__class__ is multi_pw_aff: 1866 arg0 = multi_pw_aff(arg0) 1867 except: 1868 raise 1869 ctx = arg0.ctx 1870 res = isl.isl_multi_pw_aff_min_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1871 obj = multi_val(ctx=ctx, ptr=res) 1872 return obj 1873 def neg(arg0): 1874 try: 1875 if not arg0.__class__ is multi_pw_aff: 1876 arg0 = multi_pw_aff(arg0) 1877 except: 1878 raise 1879 ctx = arg0.ctx 1880 res = isl.isl_multi_pw_aff_neg(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1881 obj = multi_pw_aff(ctx=ctx, ptr=res) 1882 return obj 1883 def plain_is_equal(arg0, arg1): 1884 try: 1885 if not arg0.__class__ is multi_pw_aff: 1886 arg0 = multi_pw_aff(arg0) 1887 except: 1888 raise 1889 try: 1890 if not arg1.__class__ is multi_pw_aff: 1891 arg1 = multi_pw_aff(arg1) 1892 except: 1893 return multi_union_pw_aff(arg0).plain_is_equal(arg1) 1894 ctx = arg0.ctx 1895 res = isl.isl_multi_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 1896 if res < 0: 1897 raise Error 1898 return bool(res) 1899 def product(arg0, arg1): 1900 try: 1901 if not arg0.__class__ is multi_pw_aff: 1902 arg0 = multi_pw_aff(arg0) 1903 except: 1904 raise 1905 try: 1906 if not arg1.__class__ is multi_pw_aff: 1907 arg1 = multi_pw_aff(arg1) 1908 except: 1909 return multi_union_pw_aff(arg0).product(arg1) 1910 ctx = arg0.ctx 1911 res = isl.isl_multi_pw_aff_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1912 obj = multi_pw_aff(ctx=ctx, ptr=res) 1913 return obj 1914 def pullback(*args): 1915 if len(args) == 2 and args[1].__class__ is multi_aff: 1916 args = list(args) 1917 try: 1918 if not args[0].__class__ is multi_pw_aff: 1919 args[0] = multi_pw_aff(args[0]) 1920 except: 1921 raise 1922 ctx = args[0].ctx 1923 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)) 1924 obj = multi_pw_aff(ctx=ctx, ptr=res) 1925 return obj 1926 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 1927 args = list(args) 1928 try: 1929 if not args[0].__class__ is multi_pw_aff: 1930 args[0] = multi_pw_aff(args[0]) 1931 except: 1932 raise 1933 ctx = args[0].ctx 1934 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)) 1935 obj = multi_pw_aff(ctx=ctx, ptr=res) 1936 return obj 1937 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 1938 args = list(args) 1939 try: 1940 if not args[0].__class__ is multi_pw_aff: 1941 args[0] = multi_pw_aff(args[0]) 1942 except: 1943 raise 1944 ctx = args[0].ctx 1945 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)) 1946 obj = multi_pw_aff(ctx=ctx, ptr=res) 1947 return obj 1948 raise Error 1949 def range_product(arg0, arg1): 1950 try: 1951 if not arg0.__class__ is multi_pw_aff: 1952 arg0 = multi_pw_aff(arg0) 1953 except: 1954 raise 1955 try: 1956 if not arg1.__class__ is multi_pw_aff: 1957 arg1 = multi_pw_aff(arg1) 1958 except: 1959 return multi_union_pw_aff(arg0).range_product(arg1) 1960 ctx = arg0.ctx 1961 res = isl.isl_multi_pw_aff_range_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1962 obj = multi_pw_aff(ctx=ctx, ptr=res) 1963 return obj 1964 def range_tuple_id(arg0): 1965 try: 1966 if not arg0.__class__ is multi_pw_aff: 1967 arg0 = multi_pw_aff(arg0) 1968 except: 1969 raise 1970 ctx = arg0.ctx 1971 res = isl.isl_multi_pw_aff_get_range_tuple_id(arg0.ptr) 1972 obj = id(ctx=ctx, ptr=res) 1973 return obj 1974 def get_range_tuple_id(arg0): 1975 return arg0.range_tuple_id() 1976 def reset_range_tuple_id(arg0): 1977 try: 1978 if not arg0.__class__ is multi_pw_aff: 1979 arg0 = multi_pw_aff(arg0) 1980 except: 1981 raise 1982 ctx = arg0.ctx 1983 res = isl.isl_multi_pw_aff_reset_range_tuple_id(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1984 obj = multi_pw_aff(ctx=ctx, ptr=res) 1985 return obj 1986 def scale(*args): 1987 if len(args) == 2 and args[1].__class__ is multi_val: 1988 args = list(args) 1989 try: 1990 if not args[0].__class__ is multi_pw_aff: 1991 args[0] = multi_pw_aff(args[0]) 1992 except: 1993 raise 1994 ctx = args[0].ctx 1995 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)) 1996 obj = multi_pw_aff(ctx=ctx, ptr=res) 1997 return obj 1998 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1999 args = list(args) 2000 try: 2001 if not args[0].__class__ is multi_pw_aff: 2002 args[0] = multi_pw_aff(args[0]) 2003 except: 2004 raise 2005 try: 2006 if not args[1].__class__ is val: 2007 args[1] = val(args[1]) 2008 except: 2009 raise 2010 ctx = args[0].ctx 2011 res = isl.isl_multi_pw_aff_scale_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2012 obj = multi_pw_aff(ctx=ctx, ptr=res) 2013 return obj 2014 raise Error 2015 def scale_down(*args): 2016 if len(args) == 2 and args[1].__class__ is multi_val: 2017 args = list(args) 2018 try: 2019 if not args[0].__class__ is multi_pw_aff: 2020 args[0] = multi_pw_aff(args[0]) 2021 except: 2022 raise 2023 ctx = args[0].ctx 2024 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)) 2025 obj = multi_pw_aff(ctx=ctx, ptr=res) 2026 return obj 2027 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2028 args = list(args) 2029 try: 2030 if not args[0].__class__ is multi_pw_aff: 2031 args[0] = multi_pw_aff(args[0]) 2032 except: 2033 raise 2034 try: 2035 if not args[1].__class__ is val: 2036 args[1] = val(args[1]) 2037 except: 2038 raise 2039 ctx = args[0].ctx 2040 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)) 2041 obj = multi_pw_aff(ctx=ctx, ptr=res) 2042 return obj 2043 raise Error 2044 def set_at(arg0, arg1, arg2): 2045 try: 2046 if not arg0.__class__ is multi_pw_aff: 2047 arg0 = multi_pw_aff(arg0) 2048 except: 2049 raise 2050 try: 2051 if not arg2.__class__ is pw_aff: 2052 arg2 = pw_aff(arg2) 2053 except: 2054 return multi_union_pw_aff(arg0).set_at(arg1, arg2) 2055 ctx = arg0.ctx 2056 res = isl.isl_multi_pw_aff_set_at(isl.isl_multi_pw_aff_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 2057 obj = multi_pw_aff(ctx=ctx, ptr=res) 2058 return obj 2059 def set_range_tuple(*args): 2060 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 2061 args = list(args) 2062 try: 2063 if not args[0].__class__ is multi_pw_aff: 2064 args[0] = multi_pw_aff(args[0]) 2065 except: 2066 raise 2067 try: 2068 if not args[1].__class__ is id: 2069 args[1] = id(args[1]) 2070 except: 2071 raise 2072 ctx = args[0].ctx 2073 res = isl.isl_multi_pw_aff_set_range_tuple_id(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 2074 obj = multi_pw_aff(ctx=ctx, ptr=res) 2075 return obj 2076 raise Error 2077 def size(arg0): 2078 try: 2079 if not arg0.__class__ is multi_pw_aff: 2080 arg0 = multi_pw_aff(arg0) 2081 except: 2082 raise 2083 ctx = arg0.ctx 2084 res = isl.isl_multi_pw_aff_size(arg0.ptr) 2085 if res < 0: 2086 raise Error 2087 return int(res) 2088 def space(arg0): 2089 try: 2090 if not arg0.__class__ is multi_pw_aff: 2091 arg0 = multi_pw_aff(arg0) 2092 except: 2093 raise 2094 ctx = arg0.ctx 2095 res = isl.isl_multi_pw_aff_get_space(arg0.ptr) 2096 obj = space(ctx=ctx, ptr=res) 2097 return obj 2098 def get_space(arg0): 2099 return arg0.space() 2100 def sub(arg0, arg1): 2101 try: 2102 if not arg0.__class__ is multi_pw_aff: 2103 arg0 = multi_pw_aff(arg0) 2104 except: 2105 raise 2106 try: 2107 if not arg1.__class__ is multi_pw_aff: 2108 arg1 = multi_pw_aff(arg1) 2109 except: 2110 return multi_union_pw_aff(arg0).sub(arg1) 2111 ctx = arg0.ctx 2112 res = isl.isl_multi_pw_aff_sub(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 2113 obj = multi_pw_aff(ctx=ctx, ptr=res) 2114 return obj 2115 def unbind_params_insert_domain(arg0, arg1): 2116 try: 2117 if not arg0.__class__ is multi_pw_aff: 2118 arg0 = multi_pw_aff(arg0) 2119 except: 2120 raise 2121 try: 2122 if not arg1.__class__ is multi_id: 2123 arg1 = multi_id(arg1) 2124 except: 2125 return multi_union_pw_aff(arg0).unbind_params_insert_domain(arg1) 2126 ctx = arg0.ctx 2127 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)) 2128 obj = multi_pw_aff(ctx=ctx, ptr=res) 2129 return obj 2130 def union_add(arg0, arg1): 2131 try: 2132 if not arg0.__class__ is multi_pw_aff: 2133 arg0 = multi_pw_aff(arg0) 2134 except: 2135 raise 2136 try: 2137 if not arg1.__class__ is multi_pw_aff: 2138 arg1 = multi_pw_aff(arg1) 2139 except: 2140 return multi_union_pw_aff(arg0).union_add(arg1) 2141 ctx = arg0.ctx 2142 res = isl.isl_multi_pw_aff_union_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 2143 obj = multi_pw_aff(ctx=ctx, ptr=res) 2144 return obj 2145 @staticmethod 2146 def zero(arg0): 2147 try: 2148 if not arg0.__class__ is space: 2149 arg0 = space(arg0) 2150 except: 2151 raise 2152 ctx = arg0.ctx 2153 res = isl.isl_multi_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 2154 obj = multi_pw_aff(ctx=ctx, ptr=res) 2155 return obj 2156 2157isl.isl_multi_pw_aff_from_aff.restype = c_void_p 2158isl.isl_multi_pw_aff_from_aff.argtypes = [c_void_p] 2159isl.isl_multi_pw_aff_from_multi_aff.restype = c_void_p 2160isl.isl_multi_pw_aff_from_multi_aff.argtypes = [c_void_p] 2161isl.isl_multi_pw_aff_from_pw_aff.restype = c_void_p 2162isl.isl_multi_pw_aff_from_pw_aff.argtypes = [c_void_p] 2163isl.isl_multi_pw_aff_from_pw_aff_list.restype = c_void_p 2164isl.isl_multi_pw_aff_from_pw_aff_list.argtypes = [c_void_p, c_void_p] 2165isl.isl_multi_pw_aff_from_pw_multi_aff.restype = c_void_p 2166isl.isl_multi_pw_aff_from_pw_multi_aff.argtypes = [c_void_p] 2167isl.isl_multi_pw_aff_read_from_str.restype = c_void_p 2168isl.isl_multi_pw_aff_read_from_str.argtypes = [Context, c_char_p] 2169isl.isl_multi_pw_aff_add.restype = c_void_p 2170isl.isl_multi_pw_aff_add.argtypes = [c_void_p, c_void_p] 2171isl.isl_multi_pw_aff_add_constant_multi_val.restype = c_void_p 2172isl.isl_multi_pw_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 2173isl.isl_multi_pw_aff_add_constant_val.restype = c_void_p 2174isl.isl_multi_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 2175isl.isl_multi_pw_aff_as_map.restype = c_void_p 2176isl.isl_multi_pw_aff_as_map.argtypes = [c_void_p] 2177isl.isl_multi_pw_aff_as_multi_aff.restype = c_void_p 2178isl.isl_multi_pw_aff_as_multi_aff.argtypes = [c_void_p] 2179isl.isl_multi_pw_aff_as_set.restype = c_void_p 2180isl.isl_multi_pw_aff_as_set.argtypes = [c_void_p] 2181isl.isl_multi_pw_aff_get_at.restype = c_void_p 2182isl.isl_multi_pw_aff_get_at.argtypes = [c_void_p, c_int] 2183isl.isl_multi_pw_aff_bind.restype = c_void_p 2184isl.isl_multi_pw_aff_bind.argtypes = [c_void_p, c_void_p] 2185isl.isl_multi_pw_aff_bind_domain.restype = c_void_p 2186isl.isl_multi_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 2187isl.isl_multi_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 2188isl.isl_multi_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 2189isl.isl_multi_pw_aff_coalesce.restype = c_void_p 2190isl.isl_multi_pw_aff_coalesce.argtypes = [c_void_p] 2191isl.isl_multi_pw_aff_domain.restype = c_void_p 2192isl.isl_multi_pw_aff_domain.argtypes = [c_void_p] 2193isl.isl_multi_pw_aff_domain_reverse.restype = c_void_p 2194isl.isl_multi_pw_aff_domain_reverse.argtypes = [c_void_p] 2195isl.isl_multi_pw_aff_flat_range_product.restype = c_void_p 2196isl.isl_multi_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 2197isl.isl_multi_pw_aff_gist.restype = c_void_p 2198isl.isl_multi_pw_aff_gist.argtypes = [c_void_p, c_void_p] 2199isl.isl_multi_pw_aff_gist_params.restype = c_void_p 2200isl.isl_multi_pw_aff_gist_params.argtypes = [c_void_p, c_void_p] 2201isl.isl_multi_pw_aff_has_range_tuple_id.argtypes = [c_void_p] 2202isl.isl_multi_pw_aff_identity_multi_pw_aff.restype = c_void_p 2203isl.isl_multi_pw_aff_identity_multi_pw_aff.argtypes = [c_void_p] 2204isl.isl_multi_pw_aff_identity_on_domain_space.restype = c_void_p 2205isl.isl_multi_pw_aff_identity_on_domain_space.argtypes = [c_void_p] 2206isl.isl_multi_pw_aff_insert_domain.restype = c_void_p 2207isl.isl_multi_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 2208isl.isl_multi_pw_aff_intersect_domain.restype = c_void_p 2209isl.isl_multi_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 2210isl.isl_multi_pw_aff_intersect_params.restype = c_void_p 2211isl.isl_multi_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 2212isl.isl_multi_pw_aff_involves_nan.argtypes = [c_void_p] 2213isl.isl_multi_pw_aff_involves_param_id.argtypes = [c_void_p, c_void_p] 2214isl.isl_multi_pw_aff_involves_param_id_list.argtypes = [c_void_p, c_void_p] 2215isl.isl_multi_pw_aff_isa_multi_aff.argtypes = [c_void_p] 2216isl.isl_multi_pw_aff_get_list.restype = c_void_p 2217isl.isl_multi_pw_aff_get_list.argtypes = [c_void_p] 2218isl.isl_multi_pw_aff_max.restype = c_void_p 2219isl.isl_multi_pw_aff_max.argtypes = [c_void_p, c_void_p] 2220isl.isl_multi_pw_aff_max_multi_val.restype = c_void_p 2221isl.isl_multi_pw_aff_max_multi_val.argtypes = [c_void_p] 2222isl.isl_multi_pw_aff_min.restype = c_void_p 2223isl.isl_multi_pw_aff_min.argtypes = [c_void_p, c_void_p] 2224isl.isl_multi_pw_aff_min_multi_val.restype = c_void_p 2225isl.isl_multi_pw_aff_min_multi_val.argtypes = [c_void_p] 2226isl.isl_multi_pw_aff_neg.restype = c_void_p 2227isl.isl_multi_pw_aff_neg.argtypes = [c_void_p] 2228isl.isl_multi_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 2229isl.isl_multi_pw_aff_product.restype = c_void_p 2230isl.isl_multi_pw_aff_product.argtypes = [c_void_p, c_void_p] 2231isl.isl_multi_pw_aff_pullback_multi_aff.restype = c_void_p 2232isl.isl_multi_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 2233isl.isl_multi_pw_aff_pullback_multi_pw_aff.restype = c_void_p 2234isl.isl_multi_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 2235isl.isl_multi_pw_aff_pullback_pw_multi_aff.restype = c_void_p 2236isl.isl_multi_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2237isl.isl_multi_pw_aff_range_product.restype = c_void_p 2238isl.isl_multi_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 2239isl.isl_multi_pw_aff_get_range_tuple_id.restype = c_void_p 2240isl.isl_multi_pw_aff_get_range_tuple_id.argtypes = [c_void_p] 2241isl.isl_multi_pw_aff_reset_range_tuple_id.restype = c_void_p 2242isl.isl_multi_pw_aff_reset_range_tuple_id.argtypes = [c_void_p] 2243isl.isl_multi_pw_aff_scale_multi_val.restype = c_void_p 2244isl.isl_multi_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 2245isl.isl_multi_pw_aff_scale_val.restype = c_void_p 2246isl.isl_multi_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 2247isl.isl_multi_pw_aff_scale_down_multi_val.restype = c_void_p 2248isl.isl_multi_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 2249isl.isl_multi_pw_aff_scale_down_val.restype = c_void_p 2250isl.isl_multi_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 2251isl.isl_multi_pw_aff_set_at.restype = c_void_p 2252isl.isl_multi_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 2253isl.isl_multi_pw_aff_set_range_tuple_id.restype = c_void_p 2254isl.isl_multi_pw_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 2255isl.isl_multi_pw_aff_size.argtypes = [c_void_p] 2256isl.isl_multi_pw_aff_get_space.restype = c_void_p 2257isl.isl_multi_pw_aff_get_space.argtypes = [c_void_p] 2258isl.isl_multi_pw_aff_sub.restype = c_void_p 2259isl.isl_multi_pw_aff_sub.argtypes = [c_void_p, c_void_p] 2260isl.isl_multi_pw_aff_unbind_params_insert_domain.restype = c_void_p 2261isl.isl_multi_pw_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 2262isl.isl_multi_pw_aff_union_add.restype = c_void_p 2263isl.isl_multi_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 2264isl.isl_multi_pw_aff_zero.restype = c_void_p 2265isl.isl_multi_pw_aff_zero.argtypes = [c_void_p] 2266isl.isl_multi_pw_aff_copy.restype = c_void_p 2267isl.isl_multi_pw_aff_copy.argtypes = [c_void_p] 2268isl.isl_multi_pw_aff_free.restype = c_void_p 2269isl.isl_multi_pw_aff_free.argtypes = [c_void_p] 2270isl.isl_multi_pw_aff_to_str.restype = POINTER(c_char) 2271isl.isl_multi_pw_aff_to_str.argtypes = [c_void_p] 2272 2273class pw_multi_aff(union_pw_multi_aff, multi_pw_aff): 2274 def __init__(self, *args, **keywords): 2275 if "ptr" in keywords: 2276 self.ctx = keywords["ctx"] 2277 self.ptr = keywords["ptr"] 2278 return 2279 if len(args) == 1 and args[0].__class__ is multi_aff: 2280 self.ctx = Context.getDefaultInstance() 2281 self.ptr = isl.isl_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 2282 return 2283 if len(args) == 1 and args[0].__class__ is pw_aff: 2284 self.ctx = Context.getDefaultInstance() 2285 self.ptr = isl.isl_pw_multi_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 2286 return 2287 if len(args) == 1 and type(args[0]) == str: 2288 self.ctx = Context.getDefaultInstance() 2289 self.ptr = isl.isl_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 2290 return 2291 raise Error 2292 def __del__(self): 2293 if hasattr(self, 'ptr'): 2294 isl.isl_pw_multi_aff_free(self.ptr) 2295 def __str__(arg0): 2296 try: 2297 if not arg0.__class__ is pw_multi_aff: 2298 arg0 = pw_multi_aff(arg0) 2299 except: 2300 raise 2301 ptr = isl.isl_pw_multi_aff_to_str(arg0.ptr) 2302 res = cast(ptr, c_char_p).value.decode('ascii') 2303 libc.free(ptr) 2304 return res 2305 def __repr__(self): 2306 s = str(self) 2307 if '"' in s: 2308 return 'isl.pw_multi_aff("""%s""")' % s 2309 else: 2310 return 'isl.pw_multi_aff("%s")' % s 2311 def add(arg0, arg1): 2312 try: 2313 if not arg0.__class__ is pw_multi_aff: 2314 arg0 = pw_multi_aff(arg0) 2315 except: 2316 raise 2317 try: 2318 if not arg1.__class__ is pw_multi_aff: 2319 arg1 = pw_multi_aff(arg1) 2320 except: 2321 return union_pw_multi_aff(arg0).add(arg1) 2322 ctx = arg0.ctx 2323 res = isl.isl_pw_multi_aff_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2324 obj = pw_multi_aff(ctx=ctx, ptr=res) 2325 return obj 2326 def add_constant(*args): 2327 if len(args) == 2 and args[1].__class__ is multi_val: 2328 args = list(args) 2329 try: 2330 if not args[0].__class__ is pw_multi_aff: 2331 args[0] = pw_multi_aff(args[0]) 2332 except: 2333 raise 2334 ctx = args[0].ctx 2335 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)) 2336 obj = pw_multi_aff(ctx=ctx, ptr=res) 2337 return obj 2338 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2339 args = list(args) 2340 try: 2341 if not args[0].__class__ is pw_multi_aff: 2342 args[0] = pw_multi_aff(args[0]) 2343 except: 2344 raise 2345 try: 2346 if not args[1].__class__ is val: 2347 args[1] = val(args[1]) 2348 except: 2349 raise 2350 ctx = args[0].ctx 2351 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)) 2352 obj = pw_multi_aff(ctx=ctx, ptr=res) 2353 return obj 2354 raise Error 2355 def as_map(arg0): 2356 try: 2357 if not arg0.__class__ is pw_multi_aff: 2358 arg0 = pw_multi_aff(arg0) 2359 except: 2360 raise 2361 ctx = arg0.ctx 2362 res = isl.isl_pw_multi_aff_as_map(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2363 obj = map(ctx=ctx, ptr=res) 2364 return obj 2365 def as_multi_aff(arg0): 2366 try: 2367 if not arg0.__class__ is pw_multi_aff: 2368 arg0 = pw_multi_aff(arg0) 2369 except: 2370 raise 2371 ctx = arg0.ctx 2372 res = isl.isl_pw_multi_aff_as_multi_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2373 obj = multi_aff(ctx=ctx, ptr=res) 2374 return obj 2375 def as_set(arg0): 2376 try: 2377 if not arg0.__class__ is pw_multi_aff: 2378 arg0 = pw_multi_aff(arg0) 2379 except: 2380 raise 2381 ctx = arg0.ctx 2382 res = isl.isl_pw_multi_aff_as_set(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2383 obj = set(ctx=ctx, ptr=res) 2384 return obj 2385 def at(arg0, arg1): 2386 try: 2387 if not arg0.__class__ is pw_multi_aff: 2388 arg0 = pw_multi_aff(arg0) 2389 except: 2390 raise 2391 ctx = arg0.ctx 2392 res = isl.isl_pw_multi_aff_get_at(arg0.ptr, arg1) 2393 obj = pw_aff(ctx=ctx, ptr=res) 2394 return obj 2395 def get_at(arg0, arg1): 2396 return arg0.at(arg1) 2397 def bind_domain(arg0, arg1): 2398 try: 2399 if not arg0.__class__ is pw_multi_aff: 2400 arg0 = pw_multi_aff(arg0) 2401 except: 2402 raise 2403 try: 2404 if not arg1.__class__ is multi_id: 2405 arg1 = multi_id(arg1) 2406 except: 2407 return union_pw_multi_aff(arg0).bind_domain(arg1) 2408 ctx = arg0.ctx 2409 res = isl.isl_pw_multi_aff_bind_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2410 obj = pw_multi_aff(ctx=ctx, ptr=res) 2411 return obj 2412 def bind_domain_wrapped_domain(arg0, arg1): 2413 try: 2414 if not arg0.__class__ is pw_multi_aff: 2415 arg0 = pw_multi_aff(arg0) 2416 except: 2417 raise 2418 try: 2419 if not arg1.__class__ is multi_id: 2420 arg1 = multi_id(arg1) 2421 except: 2422 return union_pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 2423 ctx = arg0.ctx 2424 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)) 2425 obj = pw_multi_aff(ctx=ctx, ptr=res) 2426 return obj 2427 def coalesce(arg0): 2428 try: 2429 if not arg0.__class__ is pw_multi_aff: 2430 arg0 = pw_multi_aff(arg0) 2431 except: 2432 raise 2433 ctx = arg0.ctx 2434 res = isl.isl_pw_multi_aff_coalesce(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2435 obj = pw_multi_aff(ctx=ctx, ptr=res) 2436 return obj 2437 def domain(arg0): 2438 try: 2439 if not arg0.__class__ is pw_multi_aff: 2440 arg0 = pw_multi_aff(arg0) 2441 except: 2442 raise 2443 ctx = arg0.ctx 2444 res = isl.isl_pw_multi_aff_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2445 obj = set(ctx=ctx, ptr=res) 2446 return obj 2447 @staticmethod 2448 def domain_map(arg0): 2449 try: 2450 if not arg0.__class__ is space: 2451 arg0 = space(arg0) 2452 except: 2453 raise 2454 ctx = arg0.ctx 2455 res = isl.isl_pw_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 2456 obj = pw_multi_aff(ctx=ctx, ptr=res) 2457 return obj 2458 def domain_reverse(arg0): 2459 try: 2460 if not arg0.__class__ is pw_multi_aff: 2461 arg0 = pw_multi_aff(arg0) 2462 except: 2463 raise 2464 ctx = arg0.ctx 2465 res = isl.isl_pw_multi_aff_domain_reverse(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2466 obj = pw_multi_aff(ctx=ctx, ptr=res) 2467 return obj 2468 def drop_unused_params(arg0): 2469 try: 2470 if not arg0.__class__ is pw_multi_aff: 2471 arg0 = pw_multi_aff(arg0) 2472 except: 2473 raise 2474 ctx = arg0.ctx 2475 res = isl.isl_pw_multi_aff_drop_unused_params(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2476 obj = pw_multi_aff(ctx=ctx, ptr=res) 2477 return obj 2478 def flat_range_product(arg0, arg1): 2479 try: 2480 if not arg0.__class__ is pw_multi_aff: 2481 arg0 = pw_multi_aff(arg0) 2482 except: 2483 raise 2484 try: 2485 if not arg1.__class__ is pw_multi_aff: 2486 arg1 = pw_multi_aff(arg1) 2487 except: 2488 return union_pw_multi_aff(arg0).flat_range_product(arg1) 2489 ctx = arg0.ctx 2490 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)) 2491 obj = pw_multi_aff(ctx=ctx, ptr=res) 2492 return obj 2493 def foreach_piece(arg0, arg1): 2494 try: 2495 if not arg0.__class__ is pw_multi_aff: 2496 arg0 = pw_multi_aff(arg0) 2497 except: 2498 raise 2499 exc_info = [None] 2500 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 2501 def cb_func(cb_arg0, cb_arg1, cb_arg2): 2502 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 2503 cb_arg1 = multi_aff(ctx=arg0.ctx, ptr=(cb_arg1)) 2504 try: 2505 arg1(cb_arg0, cb_arg1) 2506 except BaseException as e: 2507 exc_info[0] = e 2508 return -1 2509 return 0 2510 cb1 = fn(cb_func) 2511 ctx = arg0.ctx 2512 res = isl.isl_pw_multi_aff_foreach_piece(arg0.ptr, cb1, None) 2513 if exc_info[0] is not None: 2514 raise exc_info[0] 2515 if res < 0: 2516 raise Error 2517 def gist(arg0, arg1): 2518 try: 2519 if not arg0.__class__ is pw_multi_aff: 2520 arg0 = pw_multi_aff(arg0) 2521 except: 2522 raise 2523 try: 2524 if not arg1.__class__ is set: 2525 arg1 = set(arg1) 2526 except: 2527 return union_pw_multi_aff(arg0).gist(arg1) 2528 ctx = arg0.ctx 2529 res = isl.isl_pw_multi_aff_gist(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2530 obj = pw_multi_aff(ctx=ctx, ptr=res) 2531 return obj 2532 def gist_params(arg0, arg1): 2533 try: 2534 if not arg0.__class__ is pw_multi_aff: 2535 arg0 = pw_multi_aff(arg0) 2536 except: 2537 raise 2538 try: 2539 if not arg1.__class__ is set: 2540 arg1 = set(arg1) 2541 except: 2542 return union_pw_multi_aff(arg0).gist_params(arg1) 2543 ctx = arg0.ctx 2544 res = isl.isl_pw_multi_aff_gist_params(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2545 obj = pw_multi_aff(ctx=ctx, ptr=res) 2546 return obj 2547 def has_range_tuple_id(arg0): 2548 try: 2549 if not arg0.__class__ is pw_multi_aff: 2550 arg0 = pw_multi_aff(arg0) 2551 except: 2552 raise 2553 ctx = arg0.ctx 2554 res = isl.isl_pw_multi_aff_has_range_tuple_id(arg0.ptr) 2555 if res < 0: 2556 raise Error 2557 return bool(res) 2558 @staticmethod 2559 def identity_on_domain(*args): 2560 if len(args) == 1 and args[0].__class__ is space: 2561 ctx = args[0].ctx 2562 res = isl.isl_pw_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 2563 obj = pw_multi_aff(ctx=ctx, ptr=res) 2564 return obj 2565 raise Error 2566 def insert_domain(arg0, arg1): 2567 try: 2568 if not arg0.__class__ is pw_multi_aff: 2569 arg0 = pw_multi_aff(arg0) 2570 except: 2571 raise 2572 try: 2573 if not arg1.__class__ is space: 2574 arg1 = space(arg1) 2575 except: 2576 return union_pw_multi_aff(arg0).insert_domain(arg1) 2577 ctx = arg0.ctx 2578 res = isl.isl_pw_multi_aff_insert_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 2579 obj = pw_multi_aff(ctx=ctx, ptr=res) 2580 return obj 2581 def intersect_domain(arg0, arg1): 2582 try: 2583 if not arg0.__class__ is pw_multi_aff: 2584 arg0 = pw_multi_aff(arg0) 2585 except: 2586 raise 2587 try: 2588 if not arg1.__class__ is set: 2589 arg1 = set(arg1) 2590 except: 2591 return union_pw_multi_aff(arg0).intersect_domain(arg1) 2592 ctx = arg0.ctx 2593 res = isl.isl_pw_multi_aff_intersect_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2594 obj = pw_multi_aff(ctx=ctx, ptr=res) 2595 return obj 2596 def intersect_params(arg0, arg1): 2597 try: 2598 if not arg0.__class__ is pw_multi_aff: 2599 arg0 = pw_multi_aff(arg0) 2600 except: 2601 raise 2602 try: 2603 if not arg1.__class__ is set: 2604 arg1 = set(arg1) 2605 except: 2606 return union_pw_multi_aff(arg0).intersect_params(arg1) 2607 ctx = arg0.ctx 2608 res = isl.isl_pw_multi_aff_intersect_params(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2609 obj = pw_multi_aff(ctx=ctx, ptr=res) 2610 return obj 2611 def involves_locals(arg0): 2612 try: 2613 if not arg0.__class__ is pw_multi_aff: 2614 arg0 = pw_multi_aff(arg0) 2615 except: 2616 raise 2617 ctx = arg0.ctx 2618 res = isl.isl_pw_multi_aff_involves_locals(arg0.ptr) 2619 if res < 0: 2620 raise Error 2621 return bool(res) 2622 def isa_multi_aff(arg0): 2623 try: 2624 if not arg0.__class__ is pw_multi_aff: 2625 arg0 = pw_multi_aff(arg0) 2626 except: 2627 raise 2628 ctx = arg0.ctx 2629 res = isl.isl_pw_multi_aff_isa_multi_aff(arg0.ptr) 2630 if res < 0: 2631 raise Error 2632 return bool(res) 2633 def max_multi_val(arg0): 2634 try: 2635 if not arg0.__class__ is pw_multi_aff: 2636 arg0 = pw_multi_aff(arg0) 2637 except: 2638 raise 2639 ctx = arg0.ctx 2640 res = isl.isl_pw_multi_aff_max_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2641 obj = multi_val(ctx=ctx, ptr=res) 2642 return obj 2643 def min_multi_val(arg0): 2644 try: 2645 if not arg0.__class__ is pw_multi_aff: 2646 arg0 = pw_multi_aff(arg0) 2647 except: 2648 raise 2649 ctx = arg0.ctx 2650 res = isl.isl_pw_multi_aff_min_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2651 obj = multi_val(ctx=ctx, ptr=res) 2652 return obj 2653 @staticmethod 2654 def multi_val_on_domain(arg0, arg1): 2655 try: 2656 if not arg0.__class__ is set: 2657 arg0 = set(arg0) 2658 except: 2659 raise 2660 try: 2661 if not arg1.__class__ is multi_val: 2662 arg1 = multi_val(arg1) 2663 except: 2664 return union_pw_multi_aff(arg0).multi_val_on_domain(arg1) 2665 ctx = arg0.ctx 2666 res = isl.isl_pw_multi_aff_multi_val_on_domain(isl.isl_set_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 2667 obj = pw_multi_aff(ctx=ctx, ptr=res) 2668 return obj 2669 def n_piece(arg0): 2670 try: 2671 if not arg0.__class__ is pw_multi_aff: 2672 arg0 = pw_multi_aff(arg0) 2673 except: 2674 raise 2675 ctx = arg0.ctx 2676 res = isl.isl_pw_multi_aff_n_piece(arg0.ptr) 2677 if res < 0: 2678 raise Error 2679 return int(res) 2680 def plain_is_equal(arg0, arg1): 2681 try: 2682 if not arg0.__class__ is pw_multi_aff: 2683 arg0 = pw_multi_aff(arg0) 2684 except: 2685 raise 2686 try: 2687 if not arg1.__class__ is pw_multi_aff: 2688 arg1 = pw_multi_aff(arg1) 2689 except: 2690 return union_pw_multi_aff(arg0).plain_is_equal(arg1) 2691 ctx = arg0.ctx 2692 res = isl.isl_pw_multi_aff_plain_is_equal(arg0.ptr, arg1.ptr) 2693 if res < 0: 2694 raise Error 2695 return bool(res) 2696 def preimage_domain_wrapped_domain(*args): 2697 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2698 args = list(args) 2699 try: 2700 if not args[0].__class__ is pw_multi_aff: 2701 args[0] = pw_multi_aff(args[0]) 2702 except: 2703 raise 2704 ctx = args[0].ctx 2705 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)) 2706 obj = pw_multi_aff(ctx=ctx, ptr=res) 2707 return obj 2708 raise Error 2709 def product(arg0, arg1): 2710 try: 2711 if not arg0.__class__ is pw_multi_aff: 2712 arg0 = pw_multi_aff(arg0) 2713 except: 2714 raise 2715 try: 2716 if not arg1.__class__ is pw_multi_aff: 2717 arg1 = pw_multi_aff(arg1) 2718 except: 2719 return union_pw_multi_aff(arg0).product(arg1) 2720 ctx = arg0.ctx 2721 res = isl.isl_pw_multi_aff_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2722 obj = pw_multi_aff(ctx=ctx, ptr=res) 2723 return obj 2724 def pullback(*args): 2725 if len(args) == 2 and args[1].__class__ is multi_aff: 2726 args = list(args) 2727 try: 2728 if not args[0].__class__ is pw_multi_aff: 2729 args[0] = pw_multi_aff(args[0]) 2730 except: 2731 raise 2732 ctx = args[0].ctx 2733 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)) 2734 obj = pw_multi_aff(ctx=ctx, ptr=res) 2735 return obj 2736 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2737 args = list(args) 2738 try: 2739 if not args[0].__class__ is pw_multi_aff: 2740 args[0] = pw_multi_aff(args[0]) 2741 except: 2742 raise 2743 ctx = args[0].ctx 2744 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)) 2745 obj = pw_multi_aff(ctx=ctx, ptr=res) 2746 return obj 2747 raise Error 2748 def range_factor_domain(arg0): 2749 try: 2750 if not arg0.__class__ is pw_multi_aff: 2751 arg0 = pw_multi_aff(arg0) 2752 except: 2753 raise 2754 ctx = arg0.ctx 2755 res = isl.isl_pw_multi_aff_range_factor_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2756 obj = pw_multi_aff(ctx=ctx, ptr=res) 2757 return obj 2758 def range_factor_range(arg0): 2759 try: 2760 if not arg0.__class__ is pw_multi_aff: 2761 arg0 = pw_multi_aff(arg0) 2762 except: 2763 raise 2764 ctx = arg0.ctx 2765 res = isl.isl_pw_multi_aff_range_factor_range(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2766 obj = pw_multi_aff(ctx=ctx, ptr=res) 2767 return obj 2768 @staticmethod 2769 def range_map(arg0): 2770 try: 2771 if not arg0.__class__ is space: 2772 arg0 = space(arg0) 2773 except: 2774 raise 2775 ctx = arg0.ctx 2776 res = isl.isl_pw_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 2777 obj = pw_multi_aff(ctx=ctx, ptr=res) 2778 return obj 2779 def range_product(arg0, arg1): 2780 try: 2781 if not arg0.__class__ is pw_multi_aff: 2782 arg0 = pw_multi_aff(arg0) 2783 except: 2784 raise 2785 try: 2786 if not arg1.__class__ is pw_multi_aff: 2787 arg1 = pw_multi_aff(arg1) 2788 except: 2789 return union_pw_multi_aff(arg0).range_product(arg1) 2790 ctx = arg0.ctx 2791 res = isl.isl_pw_multi_aff_range_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2792 obj = pw_multi_aff(ctx=ctx, ptr=res) 2793 return obj 2794 def range_tuple_id(arg0): 2795 try: 2796 if not arg0.__class__ is pw_multi_aff: 2797 arg0 = pw_multi_aff(arg0) 2798 except: 2799 raise 2800 ctx = arg0.ctx 2801 res = isl.isl_pw_multi_aff_get_range_tuple_id(arg0.ptr) 2802 obj = id(ctx=ctx, ptr=res) 2803 return obj 2804 def get_range_tuple_id(arg0): 2805 return arg0.range_tuple_id() 2806 def scale(*args): 2807 if len(args) == 2 and args[1].__class__ is multi_val: 2808 args = list(args) 2809 try: 2810 if not args[0].__class__ is pw_multi_aff: 2811 args[0] = pw_multi_aff(args[0]) 2812 except: 2813 raise 2814 ctx = args[0].ctx 2815 res = isl.isl_pw_multi_aff_scale_multi_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 2816 obj = pw_multi_aff(ctx=ctx, ptr=res) 2817 return obj 2818 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2819 args = list(args) 2820 try: 2821 if not args[0].__class__ is pw_multi_aff: 2822 args[0] = pw_multi_aff(args[0]) 2823 except: 2824 raise 2825 try: 2826 if not args[1].__class__ is val: 2827 args[1] = val(args[1]) 2828 except: 2829 raise 2830 ctx = args[0].ctx 2831 res = isl.isl_pw_multi_aff_scale_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2832 obj = pw_multi_aff(ctx=ctx, ptr=res) 2833 return obj 2834 raise Error 2835 def scale_down(*args): 2836 if len(args) == 2 and args[1].__class__ is multi_val: 2837 args = list(args) 2838 try: 2839 if not args[0].__class__ is pw_multi_aff: 2840 args[0] = pw_multi_aff(args[0]) 2841 except: 2842 raise 2843 ctx = args[0].ctx 2844 res = isl.isl_pw_multi_aff_scale_down_multi_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 2845 obj = pw_multi_aff(ctx=ctx, ptr=res) 2846 return obj 2847 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2848 args = list(args) 2849 try: 2850 if not args[0].__class__ is pw_multi_aff: 2851 args[0] = pw_multi_aff(args[0]) 2852 except: 2853 raise 2854 try: 2855 if not args[1].__class__ is val: 2856 args[1] = val(args[1]) 2857 except: 2858 raise 2859 ctx = args[0].ctx 2860 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)) 2861 obj = pw_multi_aff(ctx=ctx, ptr=res) 2862 return obj 2863 raise Error 2864 def set_range_tuple(*args): 2865 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 2866 args = list(args) 2867 try: 2868 if not args[0].__class__ is pw_multi_aff: 2869 args[0] = pw_multi_aff(args[0]) 2870 except: 2871 raise 2872 try: 2873 if not args[1].__class__ is id: 2874 args[1] = id(args[1]) 2875 except: 2876 raise 2877 ctx = args[0].ctx 2878 res = isl.isl_pw_multi_aff_set_range_tuple_id(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 2879 obj = pw_multi_aff(ctx=ctx, ptr=res) 2880 return obj 2881 raise Error 2882 def space(arg0): 2883 try: 2884 if not arg0.__class__ is pw_multi_aff: 2885 arg0 = pw_multi_aff(arg0) 2886 except: 2887 raise 2888 ctx = arg0.ctx 2889 res = isl.isl_pw_multi_aff_get_space(arg0.ptr) 2890 obj = space(ctx=ctx, ptr=res) 2891 return obj 2892 def get_space(arg0): 2893 return arg0.space() 2894 def sub(arg0, arg1): 2895 try: 2896 if not arg0.__class__ is pw_multi_aff: 2897 arg0 = pw_multi_aff(arg0) 2898 except: 2899 raise 2900 try: 2901 if not arg1.__class__ is pw_multi_aff: 2902 arg1 = pw_multi_aff(arg1) 2903 except: 2904 return union_pw_multi_aff(arg0).sub(arg1) 2905 ctx = arg0.ctx 2906 res = isl.isl_pw_multi_aff_sub(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2907 obj = pw_multi_aff(ctx=ctx, ptr=res) 2908 return obj 2909 def subtract_domain(arg0, arg1): 2910 try: 2911 if not arg0.__class__ is pw_multi_aff: 2912 arg0 = pw_multi_aff(arg0) 2913 except: 2914 raise 2915 try: 2916 if not arg1.__class__ is set: 2917 arg1 = set(arg1) 2918 except: 2919 return union_pw_multi_aff(arg0).subtract_domain(arg1) 2920 ctx = arg0.ctx 2921 res = isl.isl_pw_multi_aff_subtract_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2922 obj = pw_multi_aff(ctx=ctx, ptr=res) 2923 return obj 2924 def to_list(arg0): 2925 try: 2926 if not arg0.__class__ is pw_multi_aff: 2927 arg0 = pw_multi_aff(arg0) 2928 except: 2929 raise 2930 ctx = arg0.ctx 2931 res = isl.isl_pw_multi_aff_to_list(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2932 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 2933 return obj 2934 def to_multi_pw_aff(arg0): 2935 try: 2936 if not arg0.__class__ is pw_multi_aff: 2937 arg0 = pw_multi_aff(arg0) 2938 except: 2939 raise 2940 ctx = arg0.ctx 2941 res = isl.isl_pw_multi_aff_to_multi_pw_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2942 obj = multi_pw_aff(ctx=ctx, ptr=res) 2943 return obj 2944 def to_union_pw_multi_aff(arg0): 2945 try: 2946 if not arg0.__class__ is pw_multi_aff: 2947 arg0 = pw_multi_aff(arg0) 2948 except: 2949 raise 2950 ctx = arg0.ctx 2951 res = isl.isl_pw_multi_aff_to_union_pw_multi_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2952 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 2953 return obj 2954 def union_add(arg0, arg1): 2955 try: 2956 if not arg0.__class__ is pw_multi_aff: 2957 arg0 = pw_multi_aff(arg0) 2958 except: 2959 raise 2960 try: 2961 if not arg1.__class__ is pw_multi_aff: 2962 arg1 = pw_multi_aff(arg1) 2963 except: 2964 return union_pw_multi_aff(arg0).union_add(arg1) 2965 ctx = arg0.ctx 2966 res = isl.isl_pw_multi_aff_union_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2967 obj = pw_multi_aff(ctx=ctx, ptr=res) 2968 return obj 2969 @staticmethod 2970 def zero(arg0): 2971 try: 2972 if not arg0.__class__ is space: 2973 arg0 = space(arg0) 2974 except: 2975 raise 2976 ctx = arg0.ctx 2977 res = isl.isl_pw_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 2978 obj = pw_multi_aff(ctx=ctx, ptr=res) 2979 return obj 2980 2981isl.isl_pw_multi_aff_from_multi_aff.restype = c_void_p 2982isl.isl_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 2983isl.isl_pw_multi_aff_from_pw_aff.restype = c_void_p 2984isl.isl_pw_multi_aff_from_pw_aff.argtypes = [c_void_p] 2985isl.isl_pw_multi_aff_read_from_str.restype = c_void_p 2986isl.isl_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 2987isl.isl_pw_multi_aff_add.restype = c_void_p 2988isl.isl_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 2989isl.isl_pw_multi_aff_add_constant_multi_val.restype = c_void_p 2990isl.isl_pw_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 2991isl.isl_pw_multi_aff_add_constant_val.restype = c_void_p 2992isl.isl_pw_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 2993isl.isl_pw_multi_aff_as_map.restype = c_void_p 2994isl.isl_pw_multi_aff_as_map.argtypes = [c_void_p] 2995isl.isl_pw_multi_aff_as_multi_aff.restype = c_void_p 2996isl.isl_pw_multi_aff_as_multi_aff.argtypes = [c_void_p] 2997isl.isl_pw_multi_aff_as_set.restype = c_void_p 2998isl.isl_pw_multi_aff_as_set.argtypes = [c_void_p] 2999isl.isl_pw_multi_aff_get_at.restype = c_void_p 3000isl.isl_pw_multi_aff_get_at.argtypes = [c_void_p, c_int] 3001isl.isl_pw_multi_aff_bind_domain.restype = c_void_p 3002isl.isl_pw_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 3003isl.isl_pw_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 3004isl.isl_pw_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 3005isl.isl_pw_multi_aff_coalesce.restype = c_void_p 3006isl.isl_pw_multi_aff_coalesce.argtypes = [c_void_p] 3007isl.isl_pw_multi_aff_domain.restype = c_void_p 3008isl.isl_pw_multi_aff_domain.argtypes = [c_void_p] 3009isl.isl_pw_multi_aff_domain_map.restype = c_void_p 3010isl.isl_pw_multi_aff_domain_map.argtypes = [c_void_p] 3011isl.isl_pw_multi_aff_domain_reverse.restype = c_void_p 3012isl.isl_pw_multi_aff_domain_reverse.argtypes = [c_void_p] 3013isl.isl_pw_multi_aff_drop_unused_params.restype = c_void_p 3014isl.isl_pw_multi_aff_drop_unused_params.argtypes = [c_void_p] 3015isl.isl_pw_multi_aff_flat_range_product.restype = c_void_p 3016isl.isl_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 3017isl.isl_pw_multi_aff_foreach_piece.argtypes = [c_void_p, c_void_p, c_void_p] 3018isl.isl_pw_multi_aff_gist.restype = c_void_p 3019isl.isl_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 3020isl.isl_pw_multi_aff_gist_params.restype = c_void_p 3021isl.isl_pw_multi_aff_gist_params.argtypes = [c_void_p, c_void_p] 3022isl.isl_pw_multi_aff_has_range_tuple_id.argtypes = [c_void_p] 3023isl.isl_pw_multi_aff_identity_on_domain_space.restype = c_void_p 3024isl.isl_pw_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 3025isl.isl_pw_multi_aff_insert_domain.restype = c_void_p 3026isl.isl_pw_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 3027isl.isl_pw_multi_aff_intersect_domain.restype = c_void_p 3028isl.isl_pw_multi_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 3029isl.isl_pw_multi_aff_intersect_params.restype = c_void_p 3030isl.isl_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 3031isl.isl_pw_multi_aff_involves_locals.argtypes = [c_void_p] 3032isl.isl_pw_multi_aff_isa_multi_aff.argtypes = [c_void_p] 3033isl.isl_pw_multi_aff_max_multi_val.restype = c_void_p 3034isl.isl_pw_multi_aff_max_multi_val.argtypes = [c_void_p] 3035isl.isl_pw_multi_aff_min_multi_val.restype = c_void_p 3036isl.isl_pw_multi_aff_min_multi_val.argtypes = [c_void_p] 3037isl.isl_pw_multi_aff_multi_val_on_domain.restype = c_void_p 3038isl.isl_pw_multi_aff_multi_val_on_domain.argtypes = [c_void_p, c_void_p] 3039isl.isl_pw_multi_aff_n_piece.argtypes = [c_void_p] 3040isl.isl_pw_multi_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 3041isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.restype = c_void_p 3042isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 3043isl.isl_pw_multi_aff_product.restype = c_void_p 3044isl.isl_pw_multi_aff_product.argtypes = [c_void_p, c_void_p] 3045isl.isl_pw_multi_aff_pullback_multi_aff.restype = c_void_p 3046isl.isl_pw_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3047isl.isl_pw_multi_aff_pullback_pw_multi_aff.restype = c_void_p 3048isl.isl_pw_multi_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 3049isl.isl_pw_multi_aff_range_factor_domain.restype = c_void_p 3050isl.isl_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 3051isl.isl_pw_multi_aff_range_factor_range.restype = c_void_p 3052isl.isl_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 3053isl.isl_pw_multi_aff_range_map.restype = c_void_p 3054isl.isl_pw_multi_aff_range_map.argtypes = [c_void_p] 3055isl.isl_pw_multi_aff_range_product.restype = c_void_p 3056isl.isl_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 3057isl.isl_pw_multi_aff_get_range_tuple_id.restype = c_void_p 3058isl.isl_pw_multi_aff_get_range_tuple_id.argtypes = [c_void_p] 3059isl.isl_pw_multi_aff_scale_multi_val.restype = c_void_p 3060isl.isl_pw_multi_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 3061isl.isl_pw_multi_aff_scale_val.restype = c_void_p 3062isl.isl_pw_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 3063isl.isl_pw_multi_aff_scale_down_multi_val.restype = c_void_p 3064isl.isl_pw_multi_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 3065isl.isl_pw_multi_aff_scale_down_val.restype = c_void_p 3066isl.isl_pw_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3067isl.isl_pw_multi_aff_set_range_tuple_id.restype = c_void_p 3068isl.isl_pw_multi_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 3069isl.isl_pw_multi_aff_get_space.restype = c_void_p 3070isl.isl_pw_multi_aff_get_space.argtypes = [c_void_p] 3071isl.isl_pw_multi_aff_sub.restype = c_void_p 3072isl.isl_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 3073isl.isl_pw_multi_aff_subtract_domain.restype = c_void_p 3074isl.isl_pw_multi_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 3075isl.isl_pw_multi_aff_to_list.restype = c_void_p 3076isl.isl_pw_multi_aff_to_list.argtypes = [c_void_p] 3077isl.isl_pw_multi_aff_to_multi_pw_aff.restype = c_void_p 3078isl.isl_pw_multi_aff_to_multi_pw_aff.argtypes = [c_void_p] 3079isl.isl_pw_multi_aff_to_union_pw_multi_aff.restype = c_void_p 3080isl.isl_pw_multi_aff_to_union_pw_multi_aff.argtypes = [c_void_p] 3081isl.isl_pw_multi_aff_union_add.restype = c_void_p 3082isl.isl_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 3083isl.isl_pw_multi_aff_zero.restype = c_void_p 3084isl.isl_pw_multi_aff_zero.argtypes = [c_void_p] 3085isl.isl_pw_multi_aff_copy.restype = c_void_p 3086isl.isl_pw_multi_aff_copy.argtypes = [c_void_p] 3087isl.isl_pw_multi_aff_free.restype = c_void_p 3088isl.isl_pw_multi_aff_free.argtypes = [c_void_p] 3089isl.isl_pw_multi_aff_to_str.restype = POINTER(c_char) 3090isl.isl_pw_multi_aff_to_str.argtypes = [c_void_p] 3091 3092class pw_aff(union_pw_aff, pw_multi_aff, multi_pw_aff): 3093 def __init__(self, *args, **keywords): 3094 if "ptr" in keywords: 3095 self.ctx = keywords["ctx"] 3096 self.ptr = keywords["ptr"] 3097 return 3098 if len(args) == 1 and args[0].__class__ is aff: 3099 self.ctx = Context.getDefaultInstance() 3100 self.ptr = isl.isl_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 3101 return 3102 if len(args) == 1 and type(args[0]) == str: 3103 self.ctx = Context.getDefaultInstance() 3104 self.ptr = isl.isl_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 3105 return 3106 raise Error 3107 def __del__(self): 3108 if hasattr(self, 'ptr'): 3109 isl.isl_pw_aff_free(self.ptr) 3110 def __str__(arg0): 3111 try: 3112 if not arg0.__class__ is pw_aff: 3113 arg0 = pw_aff(arg0) 3114 except: 3115 raise 3116 ptr = isl.isl_pw_aff_to_str(arg0.ptr) 3117 res = cast(ptr, c_char_p).value.decode('ascii') 3118 libc.free(ptr) 3119 return res 3120 def __repr__(self): 3121 s = str(self) 3122 if '"' in s: 3123 return 'isl.pw_aff("""%s""")' % s 3124 else: 3125 return 'isl.pw_aff("%s")' % s 3126 def add(arg0, arg1): 3127 try: 3128 if not arg0.__class__ is pw_aff: 3129 arg0 = pw_aff(arg0) 3130 except: 3131 raise 3132 try: 3133 if not arg1.__class__ is pw_aff: 3134 arg1 = pw_aff(arg1) 3135 except: 3136 return union_pw_aff(arg0).add(arg1) 3137 ctx = arg0.ctx 3138 res = isl.isl_pw_aff_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3139 obj = pw_aff(ctx=ctx, ptr=res) 3140 return obj 3141 def add_constant(*args): 3142 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3143 args = list(args) 3144 try: 3145 if not args[0].__class__ is pw_aff: 3146 args[0] = pw_aff(args[0]) 3147 except: 3148 raise 3149 try: 3150 if not args[1].__class__ is val: 3151 args[1] = val(args[1]) 3152 except: 3153 raise 3154 ctx = args[0].ctx 3155 res = isl.isl_pw_aff_add_constant_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3156 obj = pw_aff(ctx=ctx, ptr=res) 3157 return obj 3158 raise Error 3159 def as_aff(arg0): 3160 try: 3161 if not arg0.__class__ is pw_aff: 3162 arg0 = pw_aff(arg0) 3163 except: 3164 raise 3165 ctx = arg0.ctx 3166 res = isl.isl_pw_aff_as_aff(isl.isl_pw_aff_copy(arg0.ptr)) 3167 obj = aff(ctx=ctx, ptr=res) 3168 return obj 3169 def as_map(arg0): 3170 try: 3171 if not arg0.__class__ is pw_aff: 3172 arg0 = pw_aff(arg0) 3173 except: 3174 raise 3175 ctx = arg0.ctx 3176 res = isl.isl_pw_aff_as_map(isl.isl_pw_aff_copy(arg0.ptr)) 3177 obj = map(ctx=ctx, ptr=res) 3178 return obj 3179 def bind(*args): 3180 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 3181 args = list(args) 3182 try: 3183 if not args[0].__class__ is pw_aff: 3184 args[0] = pw_aff(args[0]) 3185 except: 3186 raise 3187 try: 3188 if not args[1].__class__ is id: 3189 args[1] = id(args[1]) 3190 except: 3191 raise 3192 ctx = args[0].ctx 3193 res = isl.isl_pw_aff_bind_id(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 3194 obj = set(ctx=ctx, ptr=res) 3195 return obj 3196 raise Error 3197 def bind_domain(arg0, arg1): 3198 try: 3199 if not arg0.__class__ is pw_aff: 3200 arg0 = pw_aff(arg0) 3201 except: 3202 raise 3203 try: 3204 if not arg1.__class__ is multi_id: 3205 arg1 = multi_id(arg1) 3206 except: 3207 return union_pw_aff(arg0).bind_domain(arg1) 3208 ctx = arg0.ctx 3209 res = isl.isl_pw_aff_bind_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3210 obj = pw_aff(ctx=ctx, ptr=res) 3211 return obj 3212 def bind_domain_wrapped_domain(arg0, arg1): 3213 try: 3214 if not arg0.__class__ is pw_aff: 3215 arg0 = pw_aff(arg0) 3216 except: 3217 raise 3218 try: 3219 if not arg1.__class__ is multi_id: 3220 arg1 = multi_id(arg1) 3221 except: 3222 return union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 3223 ctx = arg0.ctx 3224 res = isl.isl_pw_aff_bind_domain_wrapped_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3225 obj = pw_aff(ctx=ctx, ptr=res) 3226 return obj 3227 def ceil(arg0): 3228 try: 3229 if not arg0.__class__ is pw_aff: 3230 arg0 = pw_aff(arg0) 3231 except: 3232 raise 3233 ctx = arg0.ctx 3234 res = isl.isl_pw_aff_ceil(isl.isl_pw_aff_copy(arg0.ptr)) 3235 obj = pw_aff(ctx=ctx, ptr=res) 3236 return obj 3237 def coalesce(arg0): 3238 try: 3239 if not arg0.__class__ is pw_aff: 3240 arg0 = pw_aff(arg0) 3241 except: 3242 raise 3243 ctx = arg0.ctx 3244 res = isl.isl_pw_aff_coalesce(isl.isl_pw_aff_copy(arg0.ptr)) 3245 obj = pw_aff(ctx=ctx, ptr=res) 3246 return obj 3247 def cond(arg0, arg1, arg2): 3248 try: 3249 if not arg0.__class__ is pw_aff: 3250 arg0 = pw_aff(arg0) 3251 except: 3252 raise 3253 try: 3254 if not arg1.__class__ is pw_aff: 3255 arg1 = pw_aff(arg1) 3256 except: 3257 return union_pw_aff(arg0).cond(arg1, arg2) 3258 try: 3259 if not arg2.__class__ is pw_aff: 3260 arg2 = pw_aff(arg2) 3261 except: 3262 return union_pw_aff(arg0).cond(arg1, arg2) 3263 ctx = arg0.ctx 3264 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)) 3265 obj = pw_aff(ctx=ctx, ptr=res) 3266 return obj 3267 def div(arg0, arg1): 3268 try: 3269 if not arg0.__class__ is pw_aff: 3270 arg0 = pw_aff(arg0) 3271 except: 3272 raise 3273 try: 3274 if not arg1.__class__ is pw_aff: 3275 arg1 = pw_aff(arg1) 3276 except: 3277 return union_pw_aff(arg0).div(arg1) 3278 ctx = arg0.ctx 3279 res = isl.isl_pw_aff_div(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3280 obj = pw_aff(ctx=ctx, ptr=res) 3281 return obj 3282 def domain(arg0): 3283 try: 3284 if not arg0.__class__ is pw_aff: 3285 arg0 = pw_aff(arg0) 3286 except: 3287 raise 3288 ctx = arg0.ctx 3289 res = isl.isl_pw_aff_domain(isl.isl_pw_aff_copy(arg0.ptr)) 3290 obj = set(ctx=ctx, ptr=res) 3291 return obj 3292 def domain_reverse(arg0): 3293 try: 3294 if not arg0.__class__ is pw_aff: 3295 arg0 = pw_aff(arg0) 3296 except: 3297 raise 3298 ctx = arg0.ctx 3299 res = isl.isl_pw_aff_domain_reverse(isl.isl_pw_aff_copy(arg0.ptr)) 3300 obj = pw_aff(ctx=ctx, ptr=res) 3301 return obj 3302 def drop_unused_params(arg0): 3303 try: 3304 if not arg0.__class__ is pw_aff: 3305 arg0 = pw_aff(arg0) 3306 except: 3307 raise 3308 ctx = arg0.ctx 3309 res = isl.isl_pw_aff_drop_unused_params(isl.isl_pw_aff_copy(arg0.ptr)) 3310 obj = pw_aff(ctx=ctx, ptr=res) 3311 return obj 3312 def eq_set(arg0, arg1): 3313 try: 3314 if not arg0.__class__ is pw_aff: 3315 arg0 = pw_aff(arg0) 3316 except: 3317 raise 3318 try: 3319 if not arg1.__class__ is pw_aff: 3320 arg1 = pw_aff(arg1) 3321 except: 3322 return union_pw_aff(arg0).eq_set(arg1) 3323 ctx = arg0.ctx 3324 res = isl.isl_pw_aff_eq_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3325 obj = set(ctx=ctx, ptr=res) 3326 return obj 3327 def eval(arg0, arg1): 3328 try: 3329 if not arg0.__class__ is pw_aff: 3330 arg0 = pw_aff(arg0) 3331 except: 3332 raise 3333 try: 3334 if not arg1.__class__ is point: 3335 arg1 = point(arg1) 3336 except: 3337 return union_pw_aff(arg0).eval(arg1) 3338 ctx = arg0.ctx 3339 res = isl.isl_pw_aff_eval(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 3340 obj = val(ctx=ctx, ptr=res) 3341 return obj 3342 def floor(arg0): 3343 try: 3344 if not arg0.__class__ is pw_aff: 3345 arg0 = pw_aff(arg0) 3346 except: 3347 raise 3348 ctx = arg0.ctx 3349 res = isl.isl_pw_aff_floor(isl.isl_pw_aff_copy(arg0.ptr)) 3350 obj = pw_aff(ctx=ctx, ptr=res) 3351 return obj 3352 def ge_set(arg0, arg1): 3353 try: 3354 if not arg0.__class__ is pw_aff: 3355 arg0 = pw_aff(arg0) 3356 except: 3357 raise 3358 try: 3359 if not arg1.__class__ is pw_aff: 3360 arg1 = pw_aff(arg1) 3361 except: 3362 return union_pw_aff(arg0).ge_set(arg1) 3363 ctx = arg0.ctx 3364 res = isl.isl_pw_aff_ge_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3365 obj = set(ctx=ctx, ptr=res) 3366 return obj 3367 def gist(arg0, arg1): 3368 try: 3369 if not arg0.__class__ is pw_aff: 3370 arg0 = pw_aff(arg0) 3371 except: 3372 raise 3373 try: 3374 if not arg1.__class__ is set: 3375 arg1 = set(arg1) 3376 except: 3377 return union_pw_aff(arg0).gist(arg1) 3378 ctx = arg0.ctx 3379 res = isl.isl_pw_aff_gist(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3380 obj = pw_aff(ctx=ctx, ptr=res) 3381 return obj 3382 def gist_params(arg0, arg1): 3383 try: 3384 if not arg0.__class__ is pw_aff: 3385 arg0 = pw_aff(arg0) 3386 except: 3387 raise 3388 try: 3389 if not arg1.__class__ is set: 3390 arg1 = set(arg1) 3391 except: 3392 return union_pw_aff(arg0).gist_params(arg1) 3393 ctx = arg0.ctx 3394 res = isl.isl_pw_aff_gist_params(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3395 obj = pw_aff(ctx=ctx, ptr=res) 3396 return obj 3397 def gt_set(arg0, arg1): 3398 try: 3399 if not arg0.__class__ is pw_aff: 3400 arg0 = pw_aff(arg0) 3401 except: 3402 raise 3403 try: 3404 if not arg1.__class__ is pw_aff: 3405 arg1 = pw_aff(arg1) 3406 except: 3407 return union_pw_aff(arg0).gt_set(arg1) 3408 ctx = arg0.ctx 3409 res = isl.isl_pw_aff_gt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3410 obj = set(ctx=ctx, ptr=res) 3411 return obj 3412 def insert_domain(arg0, arg1): 3413 try: 3414 if not arg0.__class__ is pw_aff: 3415 arg0 = pw_aff(arg0) 3416 except: 3417 raise 3418 try: 3419 if not arg1.__class__ is space: 3420 arg1 = space(arg1) 3421 except: 3422 return union_pw_aff(arg0).insert_domain(arg1) 3423 ctx = arg0.ctx 3424 res = isl.isl_pw_aff_insert_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 3425 obj = pw_aff(ctx=ctx, ptr=res) 3426 return obj 3427 def intersect_domain(arg0, arg1): 3428 try: 3429 if not arg0.__class__ is pw_aff: 3430 arg0 = pw_aff(arg0) 3431 except: 3432 raise 3433 try: 3434 if not arg1.__class__ is set: 3435 arg1 = set(arg1) 3436 except: 3437 return union_pw_aff(arg0).intersect_domain(arg1) 3438 ctx = arg0.ctx 3439 res = isl.isl_pw_aff_intersect_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3440 obj = pw_aff(ctx=ctx, ptr=res) 3441 return obj 3442 def intersect_params(arg0, arg1): 3443 try: 3444 if not arg0.__class__ is pw_aff: 3445 arg0 = pw_aff(arg0) 3446 except: 3447 raise 3448 try: 3449 if not arg1.__class__ is set: 3450 arg1 = set(arg1) 3451 except: 3452 return union_pw_aff(arg0).intersect_params(arg1) 3453 ctx = arg0.ctx 3454 res = isl.isl_pw_aff_intersect_params(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3455 obj = pw_aff(ctx=ctx, ptr=res) 3456 return obj 3457 def isa_aff(arg0): 3458 try: 3459 if not arg0.__class__ is pw_aff: 3460 arg0 = pw_aff(arg0) 3461 except: 3462 raise 3463 ctx = arg0.ctx 3464 res = isl.isl_pw_aff_isa_aff(arg0.ptr) 3465 if res < 0: 3466 raise Error 3467 return bool(res) 3468 def le_set(arg0, arg1): 3469 try: 3470 if not arg0.__class__ is pw_aff: 3471 arg0 = pw_aff(arg0) 3472 except: 3473 raise 3474 try: 3475 if not arg1.__class__ is pw_aff: 3476 arg1 = pw_aff(arg1) 3477 except: 3478 return union_pw_aff(arg0).le_set(arg1) 3479 ctx = arg0.ctx 3480 res = isl.isl_pw_aff_le_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3481 obj = set(ctx=ctx, ptr=res) 3482 return obj 3483 def lt_set(arg0, arg1): 3484 try: 3485 if not arg0.__class__ is pw_aff: 3486 arg0 = pw_aff(arg0) 3487 except: 3488 raise 3489 try: 3490 if not arg1.__class__ is pw_aff: 3491 arg1 = pw_aff(arg1) 3492 except: 3493 return union_pw_aff(arg0).lt_set(arg1) 3494 ctx = arg0.ctx 3495 res = isl.isl_pw_aff_lt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3496 obj = set(ctx=ctx, ptr=res) 3497 return obj 3498 def max(arg0, arg1): 3499 try: 3500 if not arg0.__class__ is pw_aff: 3501 arg0 = pw_aff(arg0) 3502 except: 3503 raise 3504 try: 3505 if not arg1.__class__ is pw_aff: 3506 arg1 = pw_aff(arg1) 3507 except: 3508 return union_pw_aff(arg0).max(arg1) 3509 ctx = arg0.ctx 3510 res = isl.isl_pw_aff_max(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3511 obj = pw_aff(ctx=ctx, ptr=res) 3512 return obj 3513 def max_val(arg0): 3514 try: 3515 if not arg0.__class__ is pw_aff: 3516 arg0 = pw_aff(arg0) 3517 except: 3518 raise 3519 ctx = arg0.ctx 3520 res = isl.isl_pw_aff_max_val(isl.isl_pw_aff_copy(arg0.ptr)) 3521 obj = val(ctx=ctx, ptr=res) 3522 return obj 3523 def min(arg0, arg1): 3524 try: 3525 if not arg0.__class__ is pw_aff: 3526 arg0 = pw_aff(arg0) 3527 except: 3528 raise 3529 try: 3530 if not arg1.__class__ is pw_aff: 3531 arg1 = pw_aff(arg1) 3532 except: 3533 return union_pw_aff(arg0).min(arg1) 3534 ctx = arg0.ctx 3535 res = isl.isl_pw_aff_min(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3536 obj = pw_aff(ctx=ctx, ptr=res) 3537 return obj 3538 def min_val(arg0): 3539 try: 3540 if not arg0.__class__ is pw_aff: 3541 arg0 = pw_aff(arg0) 3542 except: 3543 raise 3544 ctx = arg0.ctx 3545 res = isl.isl_pw_aff_min_val(isl.isl_pw_aff_copy(arg0.ptr)) 3546 obj = val(ctx=ctx, ptr=res) 3547 return obj 3548 def mod(*args): 3549 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3550 args = list(args) 3551 try: 3552 if not args[0].__class__ is pw_aff: 3553 args[0] = pw_aff(args[0]) 3554 except: 3555 raise 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_pw_aff_mod_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3563 obj = pw_aff(ctx=ctx, ptr=res) 3564 return obj 3565 raise Error 3566 def mul(arg0, arg1): 3567 try: 3568 if not arg0.__class__ is pw_aff: 3569 arg0 = pw_aff(arg0) 3570 except: 3571 raise 3572 try: 3573 if not arg1.__class__ is pw_aff: 3574 arg1 = pw_aff(arg1) 3575 except: 3576 return union_pw_aff(arg0).mul(arg1) 3577 ctx = arg0.ctx 3578 res = isl.isl_pw_aff_mul(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3579 obj = pw_aff(ctx=ctx, ptr=res) 3580 return obj 3581 def ne_set(arg0, arg1): 3582 try: 3583 if not arg0.__class__ is pw_aff: 3584 arg0 = pw_aff(arg0) 3585 except: 3586 raise 3587 try: 3588 if not arg1.__class__ is pw_aff: 3589 arg1 = pw_aff(arg1) 3590 except: 3591 return union_pw_aff(arg0).ne_set(arg1) 3592 ctx = arg0.ctx 3593 res = isl.isl_pw_aff_ne_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3594 obj = set(ctx=ctx, ptr=res) 3595 return obj 3596 def neg(arg0): 3597 try: 3598 if not arg0.__class__ is pw_aff: 3599 arg0 = pw_aff(arg0) 3600 except: 3601 raise 3602 ctx = arg0.ctx 3603 res = isl.isl_pw_aff_neg(isl.isl_pw_aff_copy(arg0.ptr)) 3604 obj = pw_aff(ctx=ctx, ptr=res) 3605 return obj 3606 @staticmethod 3607 def param_on_domain(*args): 3608 if len(args) == 2 and args[0].__class__ is set and (args[1].__class__ is id or type(args[1]) == str): 3609 args = list(args) 3610 try: 3611 if not args[1].__class__ is id: 3612 args[1] = id(args[1]) 3613 except: 3614 raise 3615 ctx = args[0].ctx 3616 res = isl.isl_pw_aff_param_on_domain_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 3617 obj = pw_aff(ctx=ctx, ptr=res) 3618 return obj 3619 raise Error 3620 def params(arg0): 3621 try: 3622 if not arg0.__class__ is pw_aff: 3623 arg0 = pw_aff(arg0) 3624 except: 3625 raise 3626 ctx = arg0.ctx 3627 res = isl.isl_pw_aff_params(isl.isl_pw_aff_copy(arg0.ptr)) 3628 obj = set(ctx=ctx, ptr=res) 3629 return obj 3630 def plain_is_equal(arg0, arg1): 3631 try: 3632 if not arg0.__class__ is pw_aff: 3633 arg0 = pw_aff(arg0) 3634 except: 3635 raise 3636 try: 3637 if not arg1.__class__ is pw_aff: 3638 arg1 = pw_aff(arg1) 3639 except: 3640 return union_pw_aff(arg0).plain_is_equal(arg1) 3641 ctx = arg0.ctx 3642 res = isl.isl_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 3643 if res < 0: 3644 raise Error 3645 return bool(res) 3646 def pullback(*args): 3647 if len(args) == 2 and args[1].__class__ is multi_aff: 3648 args = list(args) 3649 try: 3650 if not args[0].__class__ is pw_aff: 3651 args[0] = pw_aff(args[0]) 3652 except: 3653 raise 3654 ctx = args[0].ctx 3655 res = isl.isl_pw_aff_pullback_multi_aff(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 3656 obj = pw_aff(ctx=ctx, ptr=res) 3657 return obj 3658 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 3659 args = list(args) 3660 try: 3661 if not args[0].__class__ is pw_aff: 3662 args[0] = pw_aff(args[0]) 3663 except: 3664 raise 3665 ctx = args[0].ctx 3666 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)) 3667 obj = pw_aff(ctx=ctx, ptr=res) 3668 return obj 3669 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 3670 args = list(args) 3671 try: 3672 if not args[0].__class__ is pw_aff: 3673 args[0] = pw_aff(args[0]) 3674 except: 3675 raise 3676 ctx = args[0].ctx 3677 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)) 3678 obj = pw_aff(ctx=ctx, ptr=res) 3679 return obj 3680 raise Error 3681 def scale(*args): 3682 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3683 args = list(args) 3684 try: 3685 if not args[0].__class__ is pw_aff: 3686 args[0] = pw_aff(args[0]) 3687 except: 3688 raise 3689 try: 3690 if not args[1].__class__ is val: 3691 args[1] = val(args[1]) 3692 except: 3693 raise 3694 ctx = args[0].ctx 3695 res = isl.isl_pw_aff_scale_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3696 obj = pw_aff(ctx=ctx, ptr=res) 3697 return obj 3698 raise Error 3699 def scale_down(*args): 3700 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3701 args = list(args) 3702 try: 3703 if not args[0].__class__ is pw_aff: 3704 args[0] = pw_aff(args[0]) 3705 except: 3706 raise 3707 try: 3708 if not args[1].__class__ is val: 3709 args[1] = val(args[1]) 3710 except: 3711 raise 3712 ctx = args[0].ctx 3713 res = isl.isl_pw_aff_scale_down_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3714 obj = pw_aff(ctx=ctx, ptr=res) 3715 return obj 3716 raise Error 3717 def space(arg0): 3718 try: 3719 if not arg0.__class__ is pw_aff: 3720 arg0 = pw_aff(arg0) 3721 except: 3722 raise 3723 ctx = arg0.ctx 3724 res = isl.isl_pw_aff_get_space(arg0.ptr) 3725 obj = space(ctx=ctx, ptr=res) 3726 return obj 3727 def get_space(arg0): 3728 return arg0.space() 3729 def sub(arg0, arg1): 3730 try: 3731 if not arg0.__class__ is pw_aff: 3732 arg0 = pw_aff(arg0) 3733 except: 3734 raise 3735 try: 3736 if not arg1.__class__ is pw_aff: 3737 arg1 = pw_aff(arg1) 3738 except: 3739 return union_pw_aff(arg0).sub(arg1) 3740 ctx = arg0.ctx 3741 res = isl.isl_pw_aff_sub(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3742 obj = pw_aff(ctx=ctx, ptr=res) 3743 return obj 3744 def subtract_domain(arg0, arg1): 3745 try: 3746 if not arg0.__class__ is pw_aff: 3747 arg0 = pw_aff(arg0) 3748 except: 3749 raise 3750 try: 3751 if not arg1.__class__ is set: 3752 arg1 = set(arg1) 3753 except: 3754 return union_pw_aff(arg0).subtract_domain(arg1) 3755 ctx = arg0.ctx 3756 res = isl.isl_pw_aff_subtract_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3757 obj = pw_aff(ctx=ctx, ptr=res) 3758 return obj 3759 def tdiv_q(arg0, arg1): 3760 try: 3761 if not arg0.__class__ is pw_aff: 3762 arg0 = pw_aff(arg0) 3763 except: 3764 raise 3765 try: 3766 if not arg1.__class__ is pw_aff: 3767 arg1 = pw_aff(arg1) 3768 except: 3769 return union_pw_aff(arg0).tdiv_q(arg1) 3770 ctx = arg0.ctx 3771 res = isl.isl_pw_aff_tdiv_q(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3772 obj = pw_aff(ctx=ctx, ptr=res) 3773 return obj 3774 def tdiv_r(arg0, arg1): 3775 try: 3776 if not arg0.__class__ is pw_aff: 3777 arg0 = pw_aff(arg0) 3778 except: 3779 raise 3780 try: 3781 if not arg1.__class__ is pw_aff: 3782 arg1 = pw_aff(arg1) 3783 except: 3784 return union_pw_aff(arg0).tdiv_r(arg1) 3785 ctx = arg0.ctx 3786 res = isl.isl_pw_aff_tdiv_r(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3787 obj = pw_aff(ctx=ctx, ptr=res) 3788 return obj 3789 def to_list(arg0): 3790 try: 3791 if not arg0.__class__ is pw_aff: 3792 arg0 = pw_aff(arg0) 3793 except: 3794 raise 3795 ctx = arg0.ctx 3796 res = isl.isl_pw_aff_to_list(isl.isl_pw_aff_copy(arg0.ptr)) 3797 obj = pw_aff_list(ctx=ctx, ptr=res) 3798 return obj 3799 def to_union_pw_aff(arg0): 3800 try: 3801 if not arg0.__class__ is pw_aff: 3802 arg0 = pw_aff(arg0) 3803 except: 3804 raise 3805 ctx = arg0.ctx 3806 res = isl.isl_pw_aff_to_union_pw_aff(isl.isl_pw_aff_copy(arg0.ptr)) 3807 obj = union_pw_aff(ctx=ctx, ptr=res) 3808 return obj 3809 def union_add(arg0, arg1): 3810 try: 3811 if not arg0.__class__ is pw_aff: 3812 arg0 = pw_aff(arg0) 3813 except: 3814 raise 3815 try: 3816 if not arg1.__class__ is pw_aff: 3817 arg1 = pw_aff(arg1) 3818 except: 3819 return union_pw_aff(arg0).union_add(arg1) 3820 ctx = arg0.ctx 3821 res = isl.isl_pw_aff_union_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3822 obj = pw_aff(ctx=ctx, ptr=res) 3823 return obj 3824 3825isl.isl_pw_aff_from_aff.restype = c_void_p 3826isl.isl_pw_aff_from_aff.argtypes = [c_void_p] 3827isl.isl_pw_aff_read_from_str.restype = c_void_p 3828isl.isl_pw_aff_read_from_str.argtypes = [Context, c_char_p] 3829isl.isl_pw_aff_add.restype = c_void_p 3830isl.isl_pw_aff_add.argtypes = [c_void_p, c_void_p] 3831isl.isl_pw_aff_add_constant_val.restype = c_void_p 3832isl.isl_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 3833isl.isl_pw_aff_as_aff.restype = c_void_p 3834isl.isl_pw_aff_as_aff.argtypes = [c_void_p] 3835isl.isl_pw_aff_as_map.restype = c_void_p 3836isl.isl_pw_aff_as_map.argtypes = [c_void_p] 3837isl.isl_pw_aff_bind_id.restype = c_void_p 3838isl.isl_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 3839isl.isl_pw_aff_bind_domain.restype = c_void_p 3840isl.isl_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 3841isl.isl_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 3842isl.isl_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 3843isl.isl_pw_aff_ceil.restype = c_void_p 3844isl.isl_pw_aff_ceil.argtypes = [c_void_p] 3845isl.isl_pw_aff_coalesce.restype = c_void_p 3846isl.isl_pw_aff_coalesce.argtypes = [c_void_p] 3847isl.isl_pw_aff_cond.restype = c_void_p 3848isl.isl_pw_aff_cond.argtypes = [c_void_p, c_void_p, c_void_p] 3849isl.isl_pw_aff_div.restype = c_void_p 3850isl.isl_pw_aff_div.argtypes = [c_void_p, c_void_p] 3851isl.isl_pw_aff_domain.restype = c_void_p 3852isl.isl_pw_aff_domain.argtypes = [c_void_p] 3853isl.isl_pw_aff_domain_reverse.restype = c_void_p 3854isl.isl_pw_aff_domain_reverse.argtypes = [c_void_p] 3855isl.isl_pw_aff_drop_unused_params.restype = c_void_p 3856isl.isl_pw_aff_drop_unused_params.argtypes = [c_void_p] 3857isl.isl_pw_aff_eq_set.restype = c_void_p 3858isl.isl_pw_aff_eq_set.argtypes = [c_void_p, c_void_p] 3859isl.isl_pw_aff_eval.restype = c_void_p 3860isl.isl_pw_aff_eval.argtypes = [c_void_p, c_void_p] 3861isl.isl_pw_aff_floor.restype = c_void_p 3862isl.isl_pw_aff_floor.argtypes = [c_void_p] 3863isl.isl_pw_aff_ge_set.restype = c_void_p 3864isl.isl_pw_aff_ge_set.argtypes = [c_void_p, c_void_p] 3865isl.isl_pw_aff_gist.restype = c_void_p 3866isl.isl_pw_aff_gist.argtypes = [c_void_p, c_void_p] 3867isl.isl_pw_aff_gist_params.restype = c_void_p 3868isl.isl_pw_aff_gist_params.argtypes = [c_void_p, c_void_p] 3869isl.isl_pw_aff_gt_set.restype = c_void_p 3870isl.isl_pw_aff_gt_set.argtypes = [c_void_p, c_void_p] 3871isl.isl_pw_aff_insert_domain.restype = c_void_p 3872isl.isl_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 3873isl.isl_pw_aff_intersect_domain.restype = c_void_p 3874isl.isl_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 3875isl.isl_pw_aff_intersect_params.restype = c_void_p 3876isl.isl_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 3877isl.isl_pw_aff_isa_aff.argtypes = [c_void_p] 3878isl.isl_pw_aff_le_set.restype = c_void_p 3879isl.isl_pw_aff_le_set.argtypes = [c_void_p, c_void_p] 3880isl.isl_pw_aff_lt_set.restype = c_void_p 3881isl.isl_pw_aff_lt_set.argtypes = [c_void_p, c_void_p] 3882isl.isl_pw_aff_max.restype = c_void_p 3883isl.isl_pw_aff_max.argtypes = [c_void_p, c_void_p] 3884isl.isl_pw_aff_max_val.restype = c_void_p 3885isl.isl_pw_aff_max_val.argtypes = [c_void_p] 3886isl.isl_pw_aff_min.restype = c_void_p 3887isl.isl_pw_aff_min.argtypes = [c_void_p, c_void_p] 3888isl.isl_pw_aff_min_val.restype = c_void_p 3889isl.isl_pw_aff_min_val.argtypes = [c_void_p] 3890isl.isl_pw_aff_mod_val.restype = c_void_p 3891isl.isl_pw_aff_mod_val.argtypes = [c_void_p, c_void_p] 3892isl.isl_pw_aff_mul.restype = c_void_p 3893isl.isl_pw_aff_mul.argtypes = [c_void_p, c_void_p] 3894isl.isl_pw_aff_ne_set.restype = c_void_p 3895isl.isl_pw_aff_ne_set.argtypes = [c_void_p, c_void_p] 3896isl.isl_pw_aff_neg.restype = c_void_p 3897isl.isl_pw_aff_neg.argtypes = [c_void_p] 3898isl.isl_pw_aff_param_on_domain_id.restype = c_void_p 3899isl.isl_pw_aff_param_on_domain_id.argtypes = [c_void_p, c_void_p] 3900isl.isl_pw_aff_params.restype = c_void_p 3901isl.isl_pw_aff_params.argtypes = [c_void_p] 3902isl.isl_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 3903isl.isl_pw_aff_pullback_multi_aff.restype = c_void_p 3904isl.isl_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3905isl.isl_pw_aff_pullback_multi_pw_aff.restype = c_void_p 3906isl.isl_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 3907isl.isl_pw_aff_pullback_pw_multi_aff.restype = c_void_p 3908isl.isl_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 3909isl.isl_pw_aff_scale_val.restype = c_void_p 3910isl.isl_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 3911isl.isl_pw_aff_scale_down_val.restype = c_void_p 3912isl.isl_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3913isl.isl_pw_aff_get_space.restype = c_void_p 3914isl.isl_pw_aff_get_space.argtypes = [c_void_p] 3915isl.isl_pw_aff_sub.restype = c_void_p 3916isl.isl_pw_aff_sub.argtypes = [c_void_p, c_void_p] 3917isl.isl_pw_aff_subtract_domain.restype = c_void_p 3918isl.isl_pw_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 3919isl.isl_pw_aff_tdiv_q.restype = c_void_p 3920isl.isl_pw_aff_tdiv_q.argtypes = [c_void_p, c_void_p] 3921isl.isl_pw_aff_tdiv_r.restype = c_void_p 3922isl.isl_pw_aff_tdiv_r.argtypes = [c_void_p, c_void_p] 3923isl.isl_pw_aff_to_list.restype = c_void_p 3924isl.isl_pw_aff_to_list.argtypes = [c_void_p] 3925isl.isl_pw_aff_to_union_pw_aff.restype = c_void_p 3926isl.isl_pw_aff_to_union_pw_aff.argtypes = [c_void_p] 3927isl.isl_pw_aff_union_add.restype = c_void_p 3928isl.isl_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 3929isl.isl_pw_aff_copy.restype = c_void_p 3930isl.isl_pw_aff_copy.argtypes = [c_void_p] 3931isl.isl_pw_aff_free.restype = c_void_p 3932isl.isl_pw_aff_free.argtypes = [c_void_p] 3933isl.isl_pw_aff_to_str.restype = POINTER(c_char) 3934isl.isl_pw_aff_to_str.argtypes = [c_void_p] 3935 3936class multi_aff(pw_multi_aff, multi_pw_aff): 3937 def __init__(self, *args, **keywords): 3938 if "ptr" in keywords: 3939 self.ctx = keywords["ctx"] 3940 self.ptr = keywords["ptr"] 3941 return 3942 if len(args) == 1 and args[0].__class__ is aff: 3943 self.ctx = Context.getDefaultInstance() 3944 self.ptr = isl.isl_multi_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 3945 return 3946 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is aff_list: 3947 self.ctx = Context.getDefaultInstance() 3948 self.ptr = isl.isl_multi_aff_from_aff_list(isl.isl_space_copy(args[0].ptr), isl.isl_aff_list_copy(args[1].ptr)) 3949 return 3950 if len(args) == 1 and type(args[0]) == str: 3951 self.ctx = Context.getDefaultInstance() 3952 self.ptr = isl.isl_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 3953 return 3954 raise Error 3955 def __del__(self): 3956 if hasattr(self, 'ptr'): 3957 isl.isl_multi_aff_free(self.ptr) 3958 def __str__(arg0): 3959 try: 3960 if not arg0.__class__ is multi_aff: 3961 arg0 = multi_aff(arg0) 3962 except: 3963 raise 3964 ptr = isl.isl_multi_aff_to_str(arg0.ptr) 3965 res = cast(ptr, c_char_p).value.decode('ascii') 3966 libc.free(ptr) 3967 return res 3968 def __repr__(self): 3969 s = str(self) 3970 if '"' in s: 3971 return 'isl.multi_aff("""%s""")' % s 3972 else: 3973 return 'isl.multi_aff("%s")' % s 3974 def add(arg0, arg1): 3975 try: 3976 if not arg0.__class__ is multi_aff: 3977 arg0 = multi_aff(arg0) 3978 except: 3979 raise 3980 try: 3981 if not arg1.__class__ is multi_aff: 3982 arg1 = multi_aff(arg1) 3983 except: 3984 return pw_multi_aff(arg0).add(arg1) 3985 ctx = arg0.ctx 3986 res = isl.isl_multi_aff_add(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3987 obj = multi_aff(ctx=ctx, ptr=res) 3988 return obj 3989 def add_constant(*args): 3990 if len(args) == 2 and args[1].__class__ is multi_val: 3991 args = list(args) 3992 try: 3993 if not args[0].__class__ is multi_aff: 3994 args[0] = multi_aff(args[0]) 3995 except: 3996 raise 3997 ctx = args[0].ctx 3998 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)) 3999 obj = multi_aff(ctx=ctx, ptr=res) 4000 return obj 4001 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4002 args = list(args) 4003 try: 4004 if not args[0].__class__ is multi_aff: 4005 args[0] = multi_aff(args[0]) 4006 except: 4007 raise 4008 try: 4009 if not args[1].__class__ is val: 4010 args[1] = val(args[1]) 4011 except: 4012 raise 4013 ctx = args[0].ctx 4014 res = isl.isl_multi_aff_add_constant_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4015 obj = multi_aff(ctx=ctx, ptr=res) 4016 return obj 4017 raise Error 4018 def as_map(arg0): 4019 try: 4020 if not arg0.__class__ is multi_aff: 4021 arg0 = multi_aff(arg0) 4022 except: 4023 raise 4024 ctx = arg0.ctx 4025 res = isl.isl_multi_aff_as_map(isl.isl_multi_aff_copy(arg0.ptr)) 4026 obj = map(ctx=ctx, ptr=res) 4027 return obj 4028 def as_set(arg0): 4029 try: 4030 if not arg0.__class__ is multi_aff: 4031 arg0 = multi_aff(arg0) 4032 except: 4033 raise 4034 ctx = arg0.ctx 4035 res = isl.isl_multi_aff_as_set(isl.isl_multi_aff_copy(arg0.ptr)) 4036 obj = set(ctx=ctx, ptr=res) 4037 return obj 4038 def at(arg0, arg1): 4039 try: 4040 if not arg0.__class__ is multi_aff: 4041 arg0 = multi_aff(arg0) 4042 except: 4043 raise 4044 ctx = arg0.ctx 4045 res = isl.isl_multi_aff_get_at(arg0.ptr, arg1) 4046 obj = aff(ctx=ctx, ptr=res) 4047 return obj 4048 def get_at(arg0, arg1): 4049 return arg0.at(arg1) 4050 def bind(arg0, arg1): 4051 try: 4052 if not arg0.__class__ is multi_aff: 4053 arg0 = multi_aff(arg0) 4054 except: 4055 raise 4056 try: 4057 if not arg1.__class__ is multi_id: 4058 arg1 = multi_id(arg1) 4059 except: 4060 return pw_multi_aff(arg0).bind(arg1) 4061 ctx = arg0.ctx 4062 res = isl.isl_multi_aff_bind(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 4063 obj = basic_set(ctx=ctx, ptr=res) 4064 return obj 4065 def bind_domain(arg0, arg1): 4066 try: 4067 if not arg0.__class__ is multi_aff: 4068 arg0 = multi_aff(arg0) 4069 except: 4070 raise 4071 try: 4072 if not arg1.__class__ is multi_id: 4073 arg1 = multi_id(arg1) 4074 except: 4075 return pw_multi_aff(arg0).bind_domain(arg1) 4076 ctx = arg0.ctx 4077 res = isl.isl_multi_aff_bind_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 4078 obj = multi_aff(ctx=ctx, ptr=res) 4079 return obj 4080 def bind_domain_wrapped_domain(arg0, arg1): 4081 try: 4082 if not arg0.__class__ is multi_aff: 4083 arg0 = multi_aff(arg0) 4084 except: 4085 raise 4086 try: 4087 if not arg1.__class__ is multi_id: 4088 arg1 = multi_id(arg1) 4089 except: 4090 return pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 4091 ctx = arg0.ctx 4092 res = isl.isl_multi_aff_bind_domain_wrapped_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 4093 obj = multi_aff(ctx=ctx, ptr=res) 4094 return obj 4095 def constant_multi_val(arg0): 4096 try: 4097 if not arg0.__class__ is multi_aff: 4098 arg0 = multi_aff(arg0) 4099 except: 4100 raise 4101 ctx = arg0.ctx 4102 res = isl.isl_multi_aff_get_constant_multi_val(arg0.ptr) 4103 obj = multi_val(ctx=ctx, ptr=res) 4104 return obj 4105 def get_constant_multi_val(arg0): 4106 return arg0.constant_multi_val() 4107 @staticmethod 4108 def domain_map(arg0): 4109 try: 4110 if not arg0.__class__ is space: 4111 arg0 = space(arg0) 4112 except: 4113 raise 4114 ctx = arg0.ctx 4115 res = isl.isl_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 4116 obj = multi_aff(ctx=ctx, ptr=res) 4117 return obj 4118 def domain_reverse(arg0): 4119 try: 4120 if not arg0.__class__ is multi_aff: 4121 arg0 = multi_aff(arg0) 4122 except: 4123 raise 4124 ctx = arg0.ctx 4125 res = isl.isl_multi_aff_domain_reverse(isl.isl_multi_aff_copy(arg0.ptr)) 4126 obj = multi_aff(ctx=ctx, ptr=res) 4127 return obj 4128 def flat_range_product(arg0, arg1): 4129 try: 4130 if not arg0.__class__ is multi_aff: 4131 arg0 = multi_aff(arg0) 4132 except: 4133 raise 4134 try: 4135 if not arg1.__class__ is multi_aff: 4136 arg1 = multi_aff(arg1) 4137 except: 4138 return pw_multi_aff(arg0).flat_range_product(arg1) 4139 ctx = arg0.ctx 4140 res = isl.isl_multi_aff_flat_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 4141 obj = multi_aff(ctx=ctx, ptr=res) 4142 return obj 4143 def floor(arg0): 4144 try: 4145 if not arg0.__class__ is multi_aff: 4146 arg0 = multi_aff(arg0) 4147 except: 4148 raise 4149 ctx = arg0.ctx 4150 res = isl.isl_multi_aff_floor(isl.isl_multi_aff_copy(arg0.ptr)) 4151 obj = multi_aff(ctx=ctx, ptr=res) 4152 return obj 4153 def gist(arg0, arg1): 4154 try: 4155 if not arg0.__class__ is multi_aff: 4156 arg0 = multi_aff(arg0) 4157 except: 4158 raise 4159 try: 4160 if not arg1.__class__ is set: 4161 arg1 = set(arg1) 4162 except: 4163 return pw_multi_aff(arg0).gist(arg1) 4164 ctx = arg0.ctx 4165 res = isl.isl_multi_aff_gist(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 4166 obj = multi_aff(ctx=ctx, ptr=res) 4167 return obj 4168 def gist_params(arg0, arg1): 4169 try: 4170 if not arg0.__class__ is multi_aff: 4171 arg0 = multi_aff(arg0) 4172 except: 4173 raise 4174 try: 4175 if not arg1.__class__ is set: 4176 arg1 = set(arg1) 4177 except: 4178 return pw_multi_aff(arg0).gist_params(arg1) 4179 ctx = arg0.ctx 4180 res = isl.isl_multi_aff_gist_params(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 4181 obj = multi_aff(ctx=ctx, ptr=res) 4182 return obj 4183 def has_range_tuple_id(arg0): 4184 try: 4185 if not arg0.__class__ is multi_aff: 4186 arg0 = multi_aff(arg0) 4187 except: 4188 raise 4189 ctx = arg0.ctx 4190 res = isl.isl_multi_aff_has_range_tuple_id(arg0.ptr) 4191 if res < 0: 4192 raise Error 4193 return bool(res) 4194 def identity(*args): 4195 if len(args) == 1: 4196 args = list(args) 4197 try: 4198 if not args[0].__class__ is multi_aff: 4199 args[0] = multi_aff(args[0]) 4200 except: 4201 raise 4202 ctx = args[0].ctx 4203 res = isl.isl_multi_aff_identity_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 4204 obj = multi_aff(ctx=ctx, ptr=res) 4205 return obj 4206 raise Error 4207 @staticmethod 4208 def identity_on_domain(*args): 4209 if len(args) == 1 and args[0].__class__ is space: 4210 ctx = args[0].ctx 4211 res = isl.isl_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 4212 obj = multi_aff(ctx=ctx, ptr=res) 4213 return obj 4214 raise Error 4215 def insert_domain(arg0, arg1): 4216 try: 4217 if not arg0.__class__ is multi_aff: 4218 arg0 = multi_aff(arg0) 4219 except: 4220 raise 4221 try: 4222 if not arg1.__class__ is space: 4223 arg1 = space(arg1) 4224 except: 4225 return pw_multi_aff(arg0).insert_domain(arg1) 4226 ctx = arg0.ctx 4227 res = isl.isl_multi_aff_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 4228 obj = multi_aff(ctx=ctx, ptr=res) 4229 return obj 4230 def involves_locals(arg0): 4231 try: 4232 if not arg0.__class__ is multi_aff: 4233 arg0 = multi_aff(arg0) 4234 except: 4235 raise 4236 ctx = arg0.ctx 4237 res = isl.isl_multi_aff_involves_locals(arg0.ptr) 4238 if res < 0: 4239 raise Error 4240 return bool(res) 4241 def involves_nan(arg0): 4242 try: 4243 if not arg0.__class__ is multi_aff: 4244 arg0 = multi_aff(arg0) 4245 except: 4246 raise 4247 ctx = arg0.ctx 4248 res = isl.isl_multi_aff_involves_nan(arg0.ptr) 4249 if res < 0: 4250 raise Error 4251 return bool(res) 4252 def list(arg0): 4253 try: 4254 if not arg0.__class__ is multi_aff: 4255 arg0 = multi_aff(arg0) 4256 except: 4257 raise 4258 ctx = arg0.ctx 4259 res = isl.isl_multi_aff_get_list(arg0.ptr) 4260 obj = aff_list(ctx=ctx, ptr=res) 4261 return obj 4262 def get_list(arg0): 4263 return arg0.list() 4264 @staticmethod 4265 def multi_val_on_domain(*args): 4266 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is multi_val: 4267 ctx = args[0].ctx 4268 res = isl.isl_multi_aff_multi_val_on_domain_space(isl.isl_space_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 4269 obj = multi_aff(ctx=ctx, ptr=res) 4270 return obj 4271 raise Error 4272 def neg(arg0): 4273 try: 4274 if not arg0.__class__ is multi_aff: 4275 arg0 = multi_aff(arg0) 4276 except: 4277 raise 4278 ctx = arg0.ctx 4279 res = isl.isl_multi_aff_neg(isl.isl_multi_aff_copy(arg0.ptr)) 4280 obj = multi_aff(ctx=ctx, ptr=res) 4281 return obj 4282 def plain_is_equal(arg0, arg1): 4283 try: 4284 if not arg0.__class__ is multi_aff: 4285 arg0 = multi_aff(arg0) 4286 except: 4287 raise 4288 try: 4289 if not arg1.__class__ is multi_aff: 4290 arg1 = multi_aff(arg1) 4291 except: 4292 return pw_multi_aff(arg0).plain_is_equal(arg1) 4293 ctx = arg0.ctx 4294 res = isl.isl_multi_aff_plain_is_equal(arg0.ptr, arg1.ptr) 4295 if res < 0: 4296 raise Error 4297 return bool(res) 4298 def product(arg0, arg1): 4299 try: 4300 if not arg0.__class__ is multi_aff: 4301 arg0 = multi_aff(arg0) 4302 except: 4303 raise 4304 try: 4305 if not arg1.__class__ is multi_aff: 4306 arg1 = multi_aff(arg1) 4307 except: 4308 return pw_multi_aff(arg0).product(arg1) 4309 ctx = arg0.ctx 4310 res = isl.isl_multi_aff_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 4311 obj = multi_aff(ctx=ctx, ptr=res) 4312 return obj 4313 def pullback(*args): 4314 if len(args) == 2 and args[1].__class__ is multi_aff: 4315 args = list(args) 4316 try: 4317 if not args[0].__class__ is multi_aff: 4318 args[0] = multi_aff(args[0]) 4319 except: 4320 raise 4321 ctx = args[0].ctx 4322 res = isl.isl_multi_aff_pullback_multi_aff(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 4323 obj = multi_aff(ctx=ctx, ptr=res) 4324 return obj 4325 raise Error 4326 @staticmethod 4327 def range_map(arg0): 4328 try: 4329 if not arg0.__class__ is space: 4330 arg0 = space(arg0) 4331 except: 4332 raise 4333 ctx = arg0.ctx 4334 res = isl.isl_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 4335 obj = multi_aff(ctx=ctx, ptr=res) 4336 return obj 4337 def range_product(arg0, arg1): 4338 try: 4339 if not arg0.__class__ is multi_aff: 4340 arg0 = multi_aff(arg0) 4341 except: 4342 raise 4343 try: 4344 if not arg1.__class__ is multi_aff: 4345 arg1 = multi_aff(arg1) 4346 except: 4347 return pw_multi_aff(arg0).range_product(arg1) 4348 ctx = arg0.ctx 4349 res = isl.isl_multi_aff_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 4350 obj = multi_aff(ctx=ctx, ptr=res) 4351 return obj 4352 def range_tuple_id(arg0): 4353 try: 4354 if not arg0.__class__ is multi_aff: 4355 arg0 = multi_aff(arg0) 4356 except: 4357 raise 4358 ctx = arg0.ctx 4359 res = isl.isl_multi_aff_get_range_tuple_id(arg0.ptr) 4360 obj = id(ctx=ctx, ptr=res) 4361 return obj 4362 def get_range_tuple_id(arg0): 4363 return arg0.range_tuple_id() 4364 def reset_range_tuple_id(arg0): 4365 try: 4366 if not arg0.__class__ is multi_aff: 4367 arg0 = multi_aff(arg0) 4368 except: 4369 raise 4370 ctx = arg0.ctx 4371 res = isl.isl_multi_aff_reset_range_tuple_id(isl.isl_multi_aff_copy(arg0.ptr)) 4372 obj = multi_aff(ctx=ctx, ptr=res) 4373 return obj 4374 def scale(*args): 4375 if len(args) == 2 and args[1].__class__ is multi_val: 4376 args = list(args) 4377 try: 4378 if not args[0].__class__ is multi_aff: 4379 args[0] = multi_aff(args[0]) 4380 except: 4381 raise 4382 ctx = args[0].ctx 4383 res = isl.isl_multi_aff_scale_multi_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 4384 obj = multi_aff(ctx=ctx, ptr=res) 4385 return obj 4386 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4387 args = list(args) 4388 try: 4389 if not args[0].__class__ is multi_aff: 4390 args[0] = multi_aff(args[0]) 4391 except: 4392 raise 4393 try: 4394 if not args[1].__class__ is val: 4395 args[1] = val(args[1]) 4396 except: 4397 raise 4398 ctx = args[0].ctx 4399 res = isl.isl_multi_aff_scale_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4400 obj = multi_aff(ctx=ctx, ptr=res) 4401 return obj 4402 raise Error 4403 def scale_down(*args): 4404 if len(args) == 2 and args[1].__class__ is multi_val: 4405 args = list(args) 4406 try: 4407 if not args[0].__class__ is multi_aff: 4408 args[0] = multi_aff(args[0]) 4409 except: 4410 raise 4411 ctx = args[0].ctx 4412 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)) 4413 obj = multi_aff(ctx=ctx, ptr=res) 4414 return obj 4415 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4416 args = list(args) 4417 try: 4418 if not args[0].__class__ is multi_aff: 4419 args[0] = multi_aff(args[0]) 4420 except: 4421 raise 4422 try: 4423 if not args[1].__class__ is val: 4424 args[1] = val(args[1]) 4425 except: 4426 raise 4427 ctx = args[0].ctx 4428 res = isl.isl_multi_aff_scale_down_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4429 obj = multi_aff(ctx=ctx, ptr=res) 4430 return obj 4431 raise Error 4432 def set_at(arg0, arg1, arg2): 4433 try: 4434 if not arg0.__class__ is multi_aff: 4435 arg0 = multi_aff(arg0) 4436 except: 4437 raise 4438 try: 4439 if not arg2.__class__ is aff: 4440 arg2 = aff(arg2) 4441 except: 4442 return pw_multi_aff(arg0).set_at(arg1, arg2) 4443 ctx = arg0.ctx 4444 res = isl.isl_multi_aff_set_at(isl.isl_multi_aff_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 4445 obj = multi_aff(ctx=ctx, ptr=res) 4446 return obj 4447 def set_range_tuple(*args): 4448 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 4449 args = list(args) 4450 try: 4451 if not args[0].__class__ is multi_aff: 4452 args[0] = multi_aff(args[0]) 4453 except: 4454 raise 4455 try: 4456 if not args[1].__class__ is id: 4457 args[1] = id(args[1]) 4458 except: 4459 raise 4460 ctx = args[0].ctx 4461 res = isl.isl_multi_aff_set_range_tuple_id(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 4462 obj = multi_aff(ctx=ctx, ptr=res) 4463 return obj 4464 raise Error 4465 def size(arg0): 4466 try: 4467 if not arg0.__class__ is multi_aff: 4468 arg0 = multi_aff(arg0) 4469 except: 4470 raise 4471 ctx = arg0.ctx 4472 res = isl.isl_multi_aff_size(arg0.ptr) 4473 if res < 0: 4474 raise Error 4475 return int(res) 4476 def space(arg0): 4477 try: 4478 if not arg0.__class__ is multi_aff: 4479 arg0 = multi_aff(arg0) 4480 except: 4481 raise 4482 ctx = arg0.ctx 4483 res = isl.isl_multi_aff_get_space(arg0.ptr) 4484 obj = space(ctx=ctx, ptr=res) 4485 return obj 4486 def get_space(arg0): 4487 return arg0.space() 4488 def sub(arg0, arg1): 4489 try: 4490 if not arg0.__class__ is multi_aff: 4491 arg0 = multi_aff(arg0) 4492 except: 4493 raise 4494 try: 4495 if not arg1.__class__ is multi_aff: 4496 arg1 = multi_aff(arg1) 4497 except: 4498 return pw_multi_aff(arg0).sub(arg1) 4499 ctx = arg0.ctx 4500 res = isl.isl_multi_aff_sub(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 4501 obj = multi_aff(ctx=ctx, ptr=res) 4502 return obj 4503 def to_multi_pw_aff(arg0): 4504 try: 4505 if not arg0.__class__ is multi_aff: 4506 arg0 = multi_aff(arg0) 4507 except: 4508 raise 4509 ctx = arg0.ctx 4510 res = isl.isl_multi_aff_to_multi_pw_aff(isl.isl_multi_aff_copy(arg0.ptr)) 4511 obj = multi_pw_aff(ctx=ctx, ptr=res) 4512 return obj 4513 def to_multi_union_pw_aff(arg0): 4514 try: 4515 if not arg0.__class__ is multi_aff: 4516 arg0 = multi_aff(arg0) 4517 except: 4518 raise 4519 ctx = arg0.ctx 4520 res = isl.isl_multi_aff_to_multi_union_pw_aff(isl.isl_multi_aff_copy(arg0.ptr)) 4521 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 4522 return obj 4523 def to_pw_multi_aff(arg0): 4524 try: 4525 if not arg0.__class__ is multi_aff: 4526 arg0 = multi_aff(arg0) 4527 except: 4528 raise 4529 ctx = arg0.ctx 4530 res = isl.isl_multi_aff_to_pw_multi_aff(isl.isl_multi_aff_copy(arg0.ptr)) 4531 obj = pw_multi_aff(ctx=ctx, ptr=res) 4532 return obj 4533 def unbind_params_insert_domain(arg0, arg1): 4534 try: 4535 if not arg0.__class__ is multi_aff: 4536 arg0 = multi_aff(arg0) 4537 except: 4538 raise 4539 try: 4540 if not arg1.__class__ is multi_id: 4541 arg1 = multi_id(arg1) 4542 except: 4543 return pw_multi_aff(arg0).unbind_params_insert_domain(arg1) 4544 ctx = arg0.ctx 4545 res = isl.isl_multi_aff_unbind_params_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 4546 obj = multi_aff(ctx=ctx, ptr=res) 4547 return obj 4548 @staticmethod 4549 def zero(arg0): 4550 try: 4551 if not arg0.__class__ is space: 4552 arg0 = space(arg0) 4553 except: 4554 raise 4555 ctx = arg0.ctx 4556 res = isl.isl_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 4557 obj = multi_aff(ctx=ctx, ptr=res) 4558 return obj 4559 4560isl.isl_multi_aff_from_aff.restype = c_void_p 4561isl.isl_multi_aff_from_aff.argtypes = [c_void_p] 4562isl.isl_multi_aff_from_aff_list.restype = c_void_p 4563isl.isl_multi_aff_from_aff_list.argtypes = [c_void_p, c_void_p] 4564isl.isl_multi_aff_read_from_str.restype = c_void_p 4565isl.isl_multi_aff_read_from_str.argtypes = [Context, c_char_p] 4566isl.isl_multi_aff_add.restype = c_void_p 4567isl.isl_multi_aff_add.argtypes = [c_void_p, c_void_p] 4568isl.isl_multi_aff_add_constant_multi_val.restype = c_void_p 4569isl.isl_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 4570isl.isl_multi_aff_add_constant_val.restype = c_void_p 4571isl.isl_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 4572isl.isl_multi_aff_as_map.restype = c_void_p 4573isl.isl_multi_aff_as_map.argtypes = [c_void_p] 4574isl.isl_multi_aff_as_set.restype = c_void_p 4575isl.isl_multi_aff_as_set.argtypes = [c_void_p] 4576isl.isl_multi_aff_get_at.restype = c_void_p 4577isl.isl_multi_aff_get_at.argtypes = [c_void_p, c_int] 4578isl.isl_multi_aff_bind.restype = c_void_p 4579isl.isl_multi_aff_bind.argtypes = [c_void_p, c_void_p] 4580isl.isl_multi_aff_bind_domain.restype = c_void_p 4581isl.isl_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 4582isl.isl_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 4583isl.isl_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 4584isl.isl_multi_aff_get_constant_multi_val.restype = c_void_p 4585isl.isl_multi_aff_get_constant_multi_val.argtypes = [c_void_p] 4586isl.isl_multi_aff_domain_map.restype = c_void_p 4587isl.isl_multi_aff_domain_map.argtypes = [c_void_p] 4588isl.isl_multi_aff_domain_reverse.restype = c_void_p 4589isl.isl_multi_aff_domain_reverse.argtypes = [c_void_p] 4590isl.isl_multi_aff_flat_range_product.restype = c_void_p 4591isl.isl_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 4592isl.isl_multi_aff_floor.restype = c_void_p 4593isl.isl_multi_aff_floor.argtypes = [c_void_p] 4594isl.isl_multi_aff_gist.restype = c_void_p 4595isl.isl_multi_aff_gist.argtypes = [c_void_p, c_void_p] 4596isl.isl_multi_aff_gist_params.restype = c_void_p 4597isl.isl_multi_aff_gist_params.argtypes = [c_void_p, c_void_p] 4598isl.isl_multi_aff_has_range_tuple_id.argtypes = [c_void_p] 4599isl.isl_multi_aff_identity_multi_aff.restype = c_void_p 4600isl.isl_multi_aff_identity_multi_aff.argtypes = [c_void_p] 4601isl.isl_multi_aff_identity_on_domain_space.restype = c_void_p 4602isl.isl_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 4603isl.isl_multi_aff_insert_domain.restype = c_void_p 4604isl.isl_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 4605isl.isl_multi_aff_involves_locals.argtypes = [c_void_p] 4606isl.isl_multi_aff_involves_nan.argtypes = [c_void_p] 4607isl.isl_multi_aff_get_list.restype = c_void_p 4608isl.isl_multi_aff_get_list.argtypes = [c_void_p] 4609isl.isl_multi_aff_multi_val_on_domain_space.restype = c_void_p 4610isl.isl_multi_aff_multi_val_on_domain_space.argtypes = [c_void_p, c_void_p] 4611isl.isl_multi_aff_neg.restype = c_void_p 4612isl.isl_multi_aff_neg.argtypes = [c_void_p] 4613isl.isl_multi_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 4614isl.isl_multi_aff_product.restype = c_void_p 4615isl.isl_multi_aff_product.argtypes = [c_void_p, c_void_p] 4616isl.isl_multi_aff_pullback_multi_aff.restype = c_void_p 4617isl.isl_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 4618isl.isl_multi_aff_range_map.restype = c_void_p 4619isl.isl_multi_aff_range_map.argtypes = [c_void_p] 4620isl.isl_multi_aff_range_product.restype = c_void_p 4621isl.isl_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 4622isl.isl_multi_aff_get_range_tuple_id.restype = c_void_p 4623isl.isl_multi_aff_get_range_tuple_id.argtypes = [c_void_p] 4624isl.isl_multi_aff_reset_range_tuple_id.restype = c_void_p 4625isl.isl_multi_aff_reset_range_tuple_id.argtypes = [c_void_p] 4626isl.isl_multi_aff_scale_multi_val.restype = c_void_p 4627isl.isl_multi_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 4628isl.isl_multi_aff_scale_val.restype = c_void_p 4629isl.isl_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 4630isl.isl_multi_aff_scale_down_multi_val.restype = c_void_p 4631isl.isl_multi_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 4632isl.isl_multi_aff_scale_down_val.restype = c_void_p 4633isl.isl_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 4634isl.isl_multi_aff_set_at.restype = c_void_p 4635isl.isl_multi_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 4636isl.isl_multi_aff_set_range_tuple_id.restype = c_void_p 4637isl.isl_multi_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 4638isl.isl_multi_aff_size.argtypes = [c_void_p] 4639isl.isl_multi_aff_get_space.restype = c_void_p 4640isl.isl_multi_aff_get_space.argtypes = [c_void_p] 4641isl.isl_multi_aff_sub.restype = c_void_p 4642isl.isl_multi_aff_sub.argtypes = [c_void_p, c_void_p] 4643isl.isl_multi_aff_to_multi_pw_aff.restype = c_void_p 4644isl.isl_multi_aff_to_multi_pw_aff.argtypes = [c_void_p] 4645isl.isl_multi_aff_to_multi_union_pw_aff.restype = c_void_p 4646isl.isl_multi_aff_to_multi_union_pw_aff.argtypes = [c_void_p] 4647isl.isl_multi_aff_to_pw_multi_aff.restype = c_void_p 4648isl.isl_multi_aff_to_pw_multi_aff.argtypes = [c_void_p] 4649isl.isl_multi_aff_unbind_params_insert_domain.restype = c_void_p 4650isl.isl_multi_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 4651isl.isl_multi_aff_zero.restype = c_void_p 4652isl.isl_multi_aff_zero.argtypes = [c_void_p] 4653isl.isl_multi_aff_copy.restype = c_void_p 4654isl.isl_multi_aff_copy.argtypes = [c_void_p] 4655isl.isl_multi_aff_free.restype = c_void_p 4656isl.isl_multi_aff_free.argtypes = [c_void_p] 4657isl.isl_multi_aff_to_str.restype = POINTER(c_char) 4658isl.isl_multi_aff_to_str.argtypes = [c_void_p] 4659 4660class aff(pw_aff, multi_aff): 4661 def __init__(self, *args, **keywords): 4662 if "ptr" in keywords: 4663 self.ctx = keywords["ctx"] 4664 self.ptr = keywords["ptr"] 4665 return 4666 if len(args) == 1 and type(args[0]) == str: 4667 self.ctx = Context.getDefaultInstance() 4668 self.ptr = isl.isl_aff_read_from_str(self.ctx, args[0].encode('ascii')) 4669 return 4670 raise Error 4671 def __del__(self): 4672 if hasattr(self, 'ptr'): 4673 isl.isl_aff_free(self.ptr) 4674 def __str__(arg0): 4675 try: 4676 if not arg0.__class__ is aff: 4677 arg0 = aff(arg0) 4678 except: 4679 raise 4680 ptr = isl.isl_aff_to_str(arg0.ptr) 4681 res = cast(ptr, c_char_p).value.decode('ascii') 4682 libc.free(ptr) 4683 return res 4684 def __repr__(self): 4685 s = str(self) 4686 if '"' in s: 4687 return 'isl.aff("""%s""")' % s 4688 else: 4689 return 'isl.aff("%s")' % s 4690 def add(arg0, arg1): 4691 try: 4692 if not arg0.__class__ is aff: 4693 arg0 = aff(arg0) 4694 except: 4695 raise 4696 try: 4697 if not arg1.__class__ is aff: 4698 arg1 = aff(arg1) 4699 except: 4700 return pw_aff(arg0).add(arg1) 4701 ctx = arg0.ctx 4702 res = isl.isl_aff_add(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4703 obj = aff(ctx=ctx, ptr=res) 4704 return obj 4705 def add_constant(*args): 4706 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4707 args = list(args) 4708 try: 4709 if not args[0].__class__ is aff: 4710 args[0] = aff(args[0]) 4711 except: 4712 raise 4713 try: 4714 if not args[1].__class__ is val: 4715 args[1] = val(args[1]) 4716 except: 4717 raise 4718 ctx = args[0].ctx 4719 res = isl.isl_aff_add_constant_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4720 obj = aff(ctx=ctx, ptr=res) 4721 return obj 4722 raise Error 4723 def bind(*args): 4724 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 4725 args = list(args) 4726 try: 4727 if not args[0].__class__ is aff: 4728 args[0] = aff(args[0]) 4729 except: 4730 raise 4731 try: 4732 if not args[1].__class__ is id: 4733 args[1] = id(args[1]) 4734 except: 4735 raise 4736 ctx = args[0].ctx 4737 res = isl.isl_aff_bind_id(isl.isl_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 4738 obj = basic_set(ctx=ctx, ptr=res) 4739 return obj 4740 raise Error 4741 def ceil(arg0): 4742 try: 4743 if not arg0.__class__ is aff: 4744 arg0 = aff(arg0) 4745 except: 4746 raise 4747 ctx = arg0.ctx 4748 res = isl.isl_aff_ceil(isl.isl_aff_copy(arg0.ptr)) 4749 obj = aff(ctx=ctx, ptr=res) 4750 return obj 4751 def constant_val(arg0): 4752 try: 4753 if not arg0.__class__ is aff: 4754 arg0 = aff(arg0) 4755 except: 4756 raise 4757 ctx = arg0.ctx 4758 res = isl.isl_aff_get_constant_val(arg0.ptr) 4759 obj = val(ctx=ctx, ptr=res) 4760 return obj 4761 def get_constant_val(arg0): 4762 return arg0.constant_val() 4763 def div(arg0, arg1): 4764 try: 4765 if not arg0.__class__ is aff: 4766 arg0 = aff(arg0) 4767 except: 4768 raise 4769 try: 4770 if not arg1.__class__ is aff: 4771 arg1 = aff(arg1) 4772 except: 4773 return pw_aff(arg0).div(arg1) 4774 ctx = arg0.ctx 4775 res = isl.isl_aff_div(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4776 obj = aff(ctx=ctx, ptr=res) 4777 return obj 4778 def domain_reverse(arg0): 4779 try: 4780 if not arg0.__class__ is aff: 4781 arg0 = aff(arg0) 4782 except: 4783 raise 4784 ctx = arg0.ctx 4785 res = isl.isl_aff_domain_reverse(isl.isl_aff_copy(arg0.ptr)) 4786 obj = aff(ctx=ctx, ptr=res) 4787 return obj 4788 def eq_set(arg0, arg1): 4789 try: 4790 if not arg0.__class__ is aff: 4791 arg0 = aff(arg0) 4792 except: 4793 raise 4794 try: 4795 if not arg1.__class__ is aff: 4796 arg1 = aff(arg1) 4797 except: 4798 return pw_aff(arg0).eq_set(arg1) 4799 ctx = arg0.ctx 4800 res = isl.isl_aff_eq_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4801 obj = set(ctx=ctx, ptr=res) 4802 return obj 4803 def eval(arg0, arg1): 4804 try: 4805 if not arg0.__class__ is aff: 4806 arg0 = aff(arg0) 4807 except: 4808 raise 4809 try: 4810 if not arg1.__class__ is point: 4811 arg1 = point(arg1) 4812 except: 4813 return pw_aff(arg0).eval(arg1) 4814 ctx = arg0.ctx 4815 res = isl.isl_aff_eval(isl.isl_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 4816 obj = val(ctx=ctx, ptr=res) 4817 return obj 4818 def floor(arg0): 4819 try: 4820 if not arg0.__class__ is aff: 4821 arg0 = aff(arg0) 4822 except: 4823 raise 4824 ctx = arg0.ctx 4825 res = isl.isl_aff_floor(isl.isl_aff_copy(arg0.ptr)) 4826 obj = aff(ctx=ctx, ptr=res) 4827 return obj 4828 def ge_set(arg0, arg1): 4829 try: 4830 if not arg0.__class__ is aff: 4831 arg0 = aff(arg0) 4832 except: 4833 raise 4834 try: 4835 if not arg1.__class__ is aff: 4836 arg1 = aff(arg1) 4837 except: 4838 return pw_aff(arg0).ge_set(arg1) 4839 ctx = arg0.ctx 4840 res = isl.isl_aff_ge_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4841 obj = set(ctx=ctx, ptr=res) 4842 return obj 4843 def gist(arg0, arg1): 4844 try: 4845 if not arg0.__class__ is aff: 4846 arg0 = aff(arg0) 4847 except: 4848 raise 4849 try: 4850 if not arg1.__class__ is set: 4851 arg1 = set(arg1) 4852 except: 4853 return pw_aff(arg0).gist(arg1) 4854 ctx = arg0.ctx 4855 res = isl.isl_aff_gist(isl.isl_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 4856 obj = aff(ctx=ctx, ptr=res) 4857 return obj 4858 def gist_params(arg0, arg1): 4859 try: 4860 if not arg0.__class__ is aff: 4861 arg0 = aff(arg0) 4862 except: 4863 raise 4864 try: 4865 if not arg1.__class__ is set: 4866 arg1 = set(arg1) 4867 except: 4868 return pw_aff(arg0).gist_params(arg1) 4869 ctx = arg0.ctx 4870 res = isl.isl_aff_gist_params(isl.isl_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 4871 obj = aff(ctx=ctx, ptr=res) 4872 return obj 4873 def gt_set(arg0, arg1): 4874 try: 4875 if not arg0.__class__ is aff: 4876 arg0 = aff(arg0) 4877 except: 4878 raise 4879 try: 4880 if not arg1.__class__ is aff: 4881 arg1 = aff(arg1) 4882 except: 4883 return pw_aff(arg0).gt_set(arg1) 4884 ctx = arg0.ctx 4885 res = isl.isl_aff_gt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4886 obj = set(ctx=ctx, ptr=res) 4887 return obj 4888 def is_cst(arg0): 4889 try: 4890 if not arg0.__class__ is aff: 4891 arg0 = aff(arg0) 4892 except: 4893 raise 4894 ctx = arg0.ctx 4895 res = isl.isl_aff_is_cst(arg0.ptr) 4896 if res < 0: 4897 raise Error 4898 return bool(res) 4899 def le_set(arg0, arg1): 4900 try: 4901 if not arg0.__class__ is aff: 4902 arg0 = aff(arg0) 4903 except: 4904 raise 4905 try: 4906 if not arg1.__class__ is aff: 4907 arg1 = aff(arg1) 4908 except: 4909 return pw_aff(arg0).le_set(arg1) 4910 ctx = arg0.ctx 4911 res = isl.isl_aff_le_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4912 obj = set(ctx=ctx, ptr=res) 4913 return obj 4914 def lt_set(arg0, arg1): 4915 try: 4916 if not arg0.__class__ is aff: 4917 arg0 = aff(arg0) 4918 except: 4919 raise 4920 try: 4921 if not arg1.__class__ is aff: 4922 arg1 = aff(arg1) 4923 except: 4924 return pw_aff(arg0).lt_set(arg1) 4925 ctx = arg0.ctx 4926 res = isl.isl_aff_lt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4927 obj = set(ctx=ctx, ptr=res) 4928 return obj 4929 def mod(*args): 4930 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4931 args = list(args) 4932 try: 4933 if not args[0].__class__ is aff: 4934 args[0] = aff(args[0]) 4935 except: 4936 raise 4937 try: 4938 if not args[1].__class__ is val: 4939 args[1] = val(args[1]) 4940 except: 4941 raise 4942 ctx = args[0].ctx 4943 res = isl.isl_aff_mod_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4944 obj = aff(ctx=ctx, ptr=res) 4945 return obj 4946 raise Error 4947 def mul(arg0, arg1): 4948 try: 4949 if not arg0.__class__ is aff: 4950 arg0 = aff(arg0) 4951 except: 4952 raise 4953 try: 4954 if not arg1.__class__ is aff: 4955 arg1 = aff(arg1) 4956 except: 4957 return pw_aff(arg0).mul(arg1) 4958 ctx = arg0.ctx 4959 res = isl.isl_aff_mul(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4960 obj = aff(ctx=ctx, ptr=res) 4961 return obj 4962 def ne_set(arg0, arg1): 4963 try: 4964 if not arg0.__class__ is aff: 4965 arg0 = aff(arg0) 4966 except: 4967 raise 4968 try: 4969 if not arg1.__class__ is aff: 4970 arg1 = aff(arg1) 4971 except: 4972 return pw_aff(arg0).ne_set(arg1) 4973 ctx = arg0.ctx 4974 res = isl.isl_aff_ne_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4975 obj = set(ctx=ctx, ptr=res) 4976 return obj 4977 def neg(arg0): 4978 try: 4979 if not arg0.__class__ is aff: 4980 arg0 = aff(arg0) 4981 except: 4982 raise 4983 ctx = arg0.ctx 4984 res = isl.isl_aff_neg(isl.isl_aff_copy(arg0.ptr)) 4985 obj = aff(ctx=ctx, ptr=res) 4986 return obj 4987 def plain_is_equal(arg0, arg1): 4988 try: 4989 if not arg0.__class__ is aff: 4990 arg0 = aff(arg0) 4991 except: 4992 raise 4993 try: 4994 if not arg1.__class__ is aff: 4995 arg1 = aff(arg1) 4996 except: 4997 return pw_aff(arg0).plain_is_equal(arg1) 4998 ctx = arg0.ctx 4999 res = isl.isl_aff_plain_is_equal(arg0.ptr, arg1.ptr) 5000 if res < 0: 5001 raise Error 5002 return bool(res) 5003 def pullback(*args): 5004 if len(args) == 2 and args[1].__class__ is multi_aff: 5005 args = list(args) 5006 try: 5007 if not args[0].__class__ is aff: 5008 args[0] = aff(args[0]) 5009 except: 5010 raise 5011 ctx = args[0].ctx 5012 res = isl.isl_aff_pullback_multi_aff(isl.isl_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 5013 obj = aff(ctx=ctx, ptr=res) 5014 return obj 5015 raise Error 5016 def scale(*args): 5017 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 5018 args = list(args) 5019 try: 5020 if not args[0].__class__ is aff: 5021 args[0] = aff(args[0]) 5022 except: 5023 raise 5024 try: 5025 if not args[1].__class__ is val: 5026 args[1] = val(args[1]) 5027 except: 5028 raise 5029 ctx = args[0].ctx 5030 res = isl.isl_aff_scale_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 5031 obj = aff(ctx=ctx, ptr=res) 5032 return obj 5033 raise Error 5034 def scale_down(*args): 5035 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 5036 args = list(args) 5037 try: 5038 if not args[0].__class__ is aff: 5039 args[0] = aff(args[0]) 5040 except: 5041 raise 5042 try: 5043 if not args[1].__class__ is val: 5044 args[1] = val(args[1]) 5045 except: 5046 raise 5047 ctx = args[0].ctx 5048 res = isl.isl_aff_scale_down_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 5049 obj = aff(ctx=ctx, ptr=res) 5050 return obj 5051 raise Error 5052 def sub(arg0, arg1): 5053 try: 5054 if not arg0.__class__ is aff: 5055 arg0 = aff(arg0) 5056 except: 5057 raise 5058 try: 5059 if not arg1.__class__ is aff: 5060 arg1 = aff(arg1) 5061 except: 5062 return pw_aff(arg0).sub(arg1) 5063 ctx = arg0.ctx 5064 res = isl.isl_aff_sub(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 5065 obj = aff(ctx=ctx, ptr=res) 5066 return obj 5067 def to_list(arg0): 5068 try: 5069 if not arg0.__class__ is aff: 5070 arg0 = aff(arg0) 5071 except: 5072 raise 5073 ctx = arg0.ctx 5074 res = isl.isl_aff_to_list(isl.isl_aff_copy(arg0.ptr)) 5075 obj = aff_list(ctx=ctx, ptr=res) 5076 return obj 5077 def unbind_params_insert_domain(arg0, arg1): 5078 try: 5079 if not arg0.__class__ is aff: 5080 arg0 = aff(arg0) 5081 except: 5082 raise 5083 try: 5084 if not arg1.__class__ is multi_id: 5085 arg1 = multi_id(arg1) 5086 except: 5087 return pw_aff(arg0).unbind_params_insert_domain(arg1) 5088 ctx = arg0.ctx 5089 res = isl.isl_aff_unbind_params_insert_domain(isl.isl_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 5090 obj = aff(ctx=ctx, ptr=res) 5091 return obj 5092 @staticmethod 5093 def zero_on_domain(*args): 5094 if len(args) == 1 and args[0].__class__ is space: 5095 ctx = args[0].ctx 5096 res = isl.isl_aff_zero_on_domain_space(isl.isl_space_copy(args[0].ptr)) 5097 obj = aff(ctx=ctx, ptr=res) 5098 return obj 5099 raise Error 5100 5101isl.isl_aff_read_from_str.restype = c_void_p 5102isl.isl_aff_read_from_str.argtypes = [Context, c_char_p] 5103isl.isl_aff_add.restype = c_void_p 5104isl.isl_aff_add.argtypes = [c_void_p, c_void_p] 5105isl.isl_aff_add_constant_val.restype = c_void_p 5106isl.isl_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 5107isl.isl_aff_bind_id.restype = c_void_p 5108isl.isl_aff_bind_id.argtypes = [c_void_p, c_void_p] 5109isl.isl_aff_ceil.restype = c_void_p 5110isl.isl_aff_ceil.argtypes = [c_void_p] 5111isl.isl_aff_get_constant_val.restype = c_void_p 5112isl.isl_aff_get_constant_val.argtypes = [c_void_p] 5113isl.isl_aff_div.restype = c_void_p 5114isl.isl_aff_div.argtypes = [c_void_p, c_void_p] 5115isl.isl_aff_domain_reverse.restype = c_void_p 5116isl.isl_aff_domain_reverse.argtypes = [c_void_p] 5117isl.isl_aff_eq_set.restype = c_void_p 5118isl.isl_aff_eq_set.argtypes = [c_void_p, c_void_p] 5119isl.isl_aff_eval.restype = c_void_p 5120isl.isl_aff_eval.argtypes = [c_void_p, c_void_p] 5121isl.isl_aff_floor.restype = c_void_p 5122isl.isl_aff_floor.argtypes = [c_void_p] 5123isl.isl_aff_ge_set.restype = c_void_p 5124isl.isl_aff_ge_set.argtypes = [c_void_p, c_void_p] 5125isl.isl_aff_gist.restype = c_void_p 5126isl.isl_aff_gist.argtypes = [c_void_p, c_void_p] 5127isl.isl_aff_gist_params.restype = c_void_p 5128isl.isl_aff_gist_params.argtypes = [c_void_p, c_void_p] 5129isl.isl_aff_gt_set.restype = c_void_p 5130isl.isl_aff_gt_set.argtypes = [c_void_p, c_void_p] 5131isl.isl_aff_is_cst.argtypes = [c_void_p] 5132isl.isl_aff_le_set.restype = c_void_p 5133isl.isl_aff_le_set.argtypes = [c_void_p, c_void_p] 5134isl.isl_aff_lt_set.restype = c_void_p 5135isl.isl_aff_lt_set.argtypes = [c_void_p, c_void_p] 5136isl.isl_aff_mod_val.restype = c_void_p 5137isl.isl_aff_mod_val.argtypes = [c_void_p, c_void_p] 5138isl.isl_aff_mul.restype = c_void_p 5139isl.isl_aff_mul.argtypes = [c_void_p, c_void_p] 5140isl.isl_aff_ne_set.restype = c_void_p 5141isl.isl_aff_ne_set.argtypes = [c_void_p, c_void_p] 5142isl.isl_aff_neg.restype = c_void_p 5143isl.isl_aff_neg.argtypes = [c_void_p] 5144isl.isl_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 5145isl.isl_aff_pullback_multi_aff.restype = c_void_p 5146isl.isl_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 5147isl.isl_aff_scale_val.restype = c_void_p 5148isl.isl_aff_scale_val.argtypes = [c_void_p, c_void_p] 5149isl.isl_aff_scale_down_val.restype = c_void_p 5150isl.isl_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 5151isl.isl_aff_sub.restype = c_void_p 5152isl.isl_aff_sub.argtypes = [c_void_p, c_void_p] 5153isl.isl_aff_to_list.restype = c_void_p 5154isl.isl_aff_to_list.argtypes = [c_void_p] 5155isl.isl_aff_unbind_params_insert_domain.restype = c_void_p 5156isl.isl_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 5157isl.isl_aff_zero_on_domain_space.restype = c_void_p 5158isl.isl_aff_zero_on_domain_space.argtypes = [c_void_p] 5159isl.isl_aff_copy.restype = c_void_p 5160isl.isl_aff_copy.argtypes = [c_void_p] 5161isl.isl_aff_free.restype = c_void_p 5162isl.isl_aff_free.argtypes = [c_void_p] 5163isl.isl_aff_to_str.restype = POINTER(c_char) 5164isl.isl_aff_to_str.argtypes = [c_void_p] 5165 5166class aff_list(object): 5167 def __init__(self, *args, **keywords): 5168 if "ptr" in keywords: 5169 self.ctx = keywords["ctx"] 5170 self.ptr = keywords["ptr"] 5171 return 5172 if len(args) == 1 and type(args[0]) == int: 5173 self.ctx = Context.getDefaultInstance() 5174 self.ptr = isl.isl_aff_list_alloc(self.ctx, args[0]) 5175 return 5176 if len(args) == 1 and args[0].__class__ is aff: 5177 self.ctx = Context.getDefaultInstance() 5178 self.ptr = isl.isl_aff_list_from_aff(isl.isl_aff_copy(args[0].ptr)) 5179 return 5180 if len(args) == 1 and type(args[0]) == str: 5181 self.ctx = Context.getDefaultInstance() 5182 self.ptr = isl.isl_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 5183 return 5184 raise Error 5185 def __del__(self): 5186 if hasattr(self, 'ptr'): 5187 isl.isl_aff_list_free(self.ptr) 5188 def __str__(arg0): 5189 try: 5190 if not arg0.__class__ is aff_list: 5191 arg0 = aff_list(arg0) 5192 except: 5193 raise 5194 ptr = isl.isl_aff_list_to_str(arg0.ptr) 5195 res = cast(ptr, c_char_p).value.decode('ascii') 5196 libc.free(ptr) 5197 return res 5198 def __repr__(self): 5199 s = str(self) 5200 if '"' in s: 5201 return 'isl.aff_list("""%s""")' % s 5202 else: 5203 return 'isl.aff_list("%s")' % s 5204 def add(arg0, arg1): 5205 try: 5206 if not arg0.__class__ is aff_list: 5207 arg0 = aff_list(arg0) 5208 except: 5209 raise 5210 try: 5211 if not arg1.__class__ is aff: 5212 arg1 = aff(arg1) 5213 except: 5214 raise 5215 ctx = arg0.ctx 5216 res = isl.isl_aff_list_add(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 5217 obj = aff_list(ctx=ctx, ptr=res) 5218 return obj 5219 def at(arg0, arg1): 5220 try: 5221 if not arg0.__class__ is aff_list: 5222 arg0 = aff_list(arg0) 5223 except: 5224 raise 5225 ctx = arg0.ctx 5226 res = isl.isl_aff_list_get_at(arg0.ptr, arg1) 5227 obj = aff(ctx=ctx, ptr=res) 5228 return obj 5229 def get_at(arg0, arg1): 5230 return arg0.at(arg1) 5231 def clear(arg0): 5232 try: 5233 if not arg0.__class__ is aff_list: 5234 arg0 = aff_list(arg0) 5235 except: 5236 raise 5237 ctx = arg0.ctx 5238 res = isl.isl_aff_list_clear(isl.isl_aff_list_copy(arg0.ptr)) 5239 obj = aff_list(ctx=ctx, ptr=res) 5240 return obj 5241 def concat(arg0, arg1): 5242 try: 5243 if not arg0.__class__ is aff_list: 5244 arg0 = aff_list(arg0) 5245 except: 5246 raise 5247 try: 5248 if not arg1.__class__ is aff_list: 5249 arg1 = aff_list(arg1) 5250 except: 5251 raise 5252 ctx = arg0.ctx 5253 res = isl.isl_aff_list_concat(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_list_copy(arg1.ptr)) 5254 obj = aff_list(ctx=ctx, ptr=res) 5255 return obj 5256 def drop(arg0, arg1, arg2): 5257 try: 5258 if not arg0.__class__ is aff_list: 5259 arg0 = aff_list(arg0) 5260 except: 5261 raise 5262 ctx = arg0.ctx 5263 res = isl.isl_aff_list_drop(isl.isl_aff_list_copy(arg0.ptr), arg1, arg2) 5264 obj = aff_list(ctx=ctx, ptr=res) 5265 return obj 5266 def foreach(arg0, arg1): 5267 try: 5268 if not arg0.__class__ is aff_list: 5269 arg0 = aff_list(arg0) 5270 except: 5271 raise 5272 exc_info = [None] 5273 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 5274 def cb_func(cb_arg0, cb_arg1): 5275 cb_arg0 = aff(ctx=arg0.ctx, ptr=(cb_arg0)) 5276 try: 5277 arg1(cb_arg0) 5278 except BaseException as e: 5279 exc_info[0] = e 5280 return -1 5281 return 0 5282 cb1 = fn(cb_func) 5283 ctx = arg0.ctx 5284 res = isl.isl_aff_list_foreach(arg0.ptr, cb1, None) 5285 if exc_info[0] is not None: 5286 raise exc_info[0] 5287 if res < 0: 5288 raise Error 5289 def foreach_scc(arg0, arg1, arg2): 5290 try: 5291 if not arg0.__class__ is aff_list: 5292 arg0 = aff_list(arg0) 5293 except: 5294 raise 5295 exc_info = [None] 5296 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 5297 def cb_func(cb_arg0, cb_arg1, cb_arg2): 5298 cb_arg0 = aff(ctx=arg0.ctx, ptr=isl.isl_aff_copy(cb_arg0)) 5299 cb_arg1 = aff(ctx=arg0.ctx, ptr=isl.isl_aff_copy(cb_arg1)) 5300 try: 5301 res = arg1(cb_arg0, cb_arg1) 5302 except BaseException as e: 5303 exc_info[0] = e 5304 return -1 5305 return 1 if res else 0 5306 cb1 = fn(cb_func) 5307 exc_info = [None] 5308 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 5309 def cb_func(cb_arg0, cb_arg1): 5310 cb_arg0 = aff_list(ctx=arg0.ctx, ptr=(cb_arg0)) 5311 try: 5312 arg2(cb_arg0) 5313 except BaseException as e: 5314 exc_info[0] = e 5315 return -1 5316 return 0 5317 cb2 = fn(cb_func) 5318 ctx = arg0.ctx 5319 res = isl.isl_aff_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 5320 if exc_info[0] is not None: 5321 raise exc_info[0] 5322 if res < 0: 5323 raise Error 5324 def insert(arg0, arg1, arg2): 5325 try: 5326 if not arg0.__class__ is aff_list: 5327 arg0 = aff_list(arg0) 5328 except: 5329 raise 5330 try: 5331 if not arg2.__class__ is aff: 5332 arg2 = aff(arg2) 5333 except: 5334 raise 5335 ctx = arg0.ctx 5336 res = isl.isl_aff_list_insert(isl.isl_aff_list_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 5337 obj = aff_list(ctx=ctx, ptr=res) 5338 return obj 5339 def set_at(arg0, arg1, arg2): 5340 try: 5341 if not arg0.__class__ is aff_list: 5342 arg0 = aff_list(arg0) 5343 except: 5344 raise 5345 try: 5346 if not arg2.__class__ is aff: 5347 arg2 = aff(arg2) 5348 except: 5349 raise 5350 ctx = arg0.ctx 5351 res = isl.isl_aff_list_set_at(isl.isl_aff_list_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 5352 obj = aff_list(ctx=ctx, ptr=res) 5353 return obj 5354 def size(arg0): 5355 try: 5356 if not arg0.__class__ is aff_list: 5357 arg0 = aff_list(arg0) 5358 except: 5359 raise 5360 ctx = arg0.ctx 5361 res = isl.isl_aff_list_size(arg0.ptr) 5362 if res < 0: 5363 raise Error 5364 return int(res) 5365 5366isl.isl_aff_list_alloc.restype = c_void_p 5367isl.isl_aff_list_alloc.argtypes = [Context, c_int] 5368isl.isl_aff_list_from_aff.restype = c_void_p 5369isl.isl_aff_list_from_aff.argtypes = [c_void_p] 5370isl.isl_aff_list_read_from_str.restype = c_void_p 5371isl.isl_aff_list_read_from_str.argtypes = [Context, c_char_p] 5372isl.isl_aff_list_add.restype = c_void_p 5373isl.isl_aff_list_add.argtypes = [c_void_p, c_void_p] 5374isl.isl_aff_list_get_at.restype = c_void_p 5375isl.isl_aff_list_get_at.argtypes = [c_void_p, c_int] 5376isl.isl_aff_list_clear.restype = c_void_p 5377isl.isl_aff_list_clear.argtypes = [c_void_p] 5378isl.isl_aff_list_concat.restype = c_void_p 5379isl.isl_aff_list_concat.argtypes = [c_void_p, c_void_p] 5380isl.isl_aff_list_drop.restype = c_void_p 5381isl.isl_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 5382isl.isl_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 5383isl.isl_aff_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 5384isl.isl_aff_list_insert.restype = c_void_p 5385isl.isl_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 5386isl.isl_aff_list_set_at.restype = c_void_p 5387isl.isl_aff_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 5388isl.isl_aff_list_size.argtypes = [c_void_p] 5389isl.isl_aff_list_copy.restype = c_void_p 5390isl.isl_aff_list_copy.argtypes = [c_void_p] 5391isl.isl_aff_list_free.restype = c_void_p 5392isl.isl_aff_list_free.argtypes = [c_void_p] 5393isl.isl_aff_list_to_str.restype = POINTER(c_char) 5394isl.isl_aff_list_to_str.argtypes = [c_void_p] 5395 5396class ast_build(object): 5397 def __init__(self, *args, **keywords): 5398 if "ptr" in keywords: 5399 self.ctx = keywords["ctx"] 5400 self.ptr = keywords["ptr"] 5401 return 5402 if len(args) == 0: 5403 self.ctx = Context.getDefaultInstance() 5404 self.ptr = isl.isl_ast_build_alloc(self.ctx) 5405 return 5406 raise Error 5407 def __del__(self): 5408 if hasattr(self, 'ptr'): 5409 isl.isl_ast_build_free(self.ptr) 5410 def copy_callbacks(self, obj): 5411 if hasattr(obj, 'at_each_domain'): 5412 self.at_each_domain = obj.at_each_domain 5413 def set_at_each_domain(arg0, arg1): 5414 try: 5415 if not arg0.__class__ is ast_build: 5416 arg0 = ast_build(arg0) 5417 except: 5418 raise 5419 exc_info = [None] 5420 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_void_p) 5421 def cb_func(cb_arg0, cb_arg1, cb_arg2): 5422 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 5423 cb_arg1 = ast_build(ctx=arg0.ctx, ptr=isl.isl_ast_build_copy(cb_arg1)) 5424 try: 5425 res = arg1(cb_arg0, cb_arg1) 5426 except BaseException as e: 5427 exc_info[0] = e 5428 return None 5429 return isl.isl_ast_node_copy(res.ptr) 5430 cb1 = fn(cb_func) 5431 ctx = arg0.ctx 5432 res = isl.isl_ast_build_set_at_each_domain(isl.isl_ast_build_copy(arg0.ptr), cb1, None) 5433 if exc_info[0] is not None: 5434 raise exc_info[0] 5435 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 5436 exc_info = arg0.at_each_domain['exc_info'][0] 5437 arg0.at_each_domain['exc_info'][0] = None 5438 if exc_info is not None: 5439 raise exc_info 5440 obj = ast_build(ctx=ctx, ptr=res) 5441 obj.copy_callbacks(arg0) 5442 obj.at_each_domain = { 'func': cb1, 'exc_info': exc_info } 5443 return obj 5444 def access_from(*args): 5445 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 5446 args = list(args) 5447 try: 5448 if not args[0].__class__ is ast_build: 5449 args[0] = ast_build(args[0]) 5450 except: 5451 raise 5452 ctx = args[0].ctx 5453 res = isl.isl_ast_build_access_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 5454 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5455 exc_info = args[0].at_each_domain['exc_info'][0] 5456 args[0].at_each_domain['exc_info'][0] = None 5457 if exc_info is not None: 5458 raise exc_info 5459 obj = ast_expr(ctx=ctx, ptr=res) 5460 return obj 5461 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 5462 args = list(args) 5463 try: 5464 if not args[0].__class__ is ast_build: 5465 args[0] = ast_build(args[0]) 5466 except: 5467 raise 5468 ctx = args[0].ctx 5469 res = isl.isl_ast_build_access_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 5470 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5471 exc_info = args[0].at_each_domain['exc_info'][0] 5472 args[0].at_each_domain['exc_info'][0] = None 5473 if exc_info is not None: 5474 raise exc_info 5475 obj = ast_expr(ctx=ctx, ptr=res) 5476 return obj 5477 raise Error 5478 def call_from(*args): 5479 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 5480 args = list(args) 5481 try: 5482 if not args[0].__class__ is ast_build: 5483 args[0] = ast_build(args[0]) 5484 except: 5485 raise 5486 ctx = args[0].ctx 5487 res = isl.isl_ast_build_call_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 5488 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5489 exc_info = args[0].at_each_domain['exc_info'][0] 5490 args[0].at_each_domain['exc_info'][0] = None 5491 if exc_info is not None: 5492 raise exc_info 5493 obj = ast_expr(ctx=ctx, ptr=res) 5494 return obj 5495 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 5496 args = list(args) 5497 try: 5498 if not args[0].__class__ is ast_build: 5499 args[0] = ast_build(args[0]) 5500 except: 5501 raise 5502 ctx = args[0].ctx 5503 res = isl.isl_ast_build_call_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 5504 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5505 exc_info = args[0].at_each_domain['exc_info'][0] 5506 args[0].at_each_domain['exc_info'][0] = None 5507 if exc_info is not None: 5508 raise exc_info 5509 obj = ast_expr(ctx=ctx, ptr=res) 5510 return obj 5511 raise Error 5512 def expr_from(*args): 5513 if len(args) == 2 and args[1].__class__ is pw_aff: 5514 args = list(args) 5515 try: 5516 if not args[0].__class__ is ast_build: 5517 args[0] = ast_build(args[0]) 5518 except: 5519 raise 5520 ctx = args[0].ctx 5521 res = isl.isl_ast_build_expr_from_pw_aff(args[0].ptr, isl.isl_pw_aff_copy(args[1].ptr)) 5522 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5523 exc_info = args[0].at_each_domain['exc_info'][0] 5524 args[0].at_each_domain['exc_info'][0] = None 5525 if exc_info is not None: 5526 raise exc_info 5527 obj = ast_expr(ctx=ctx, ptr=res) 5528 return obj 5529 if len(args) == 2 and args[1].__class__ is set: 5530 args = list(args) 5531 try: 5532 if not args[0].__class__ is ast_build: 5533 args[0] = ast_build(args[0]) 5534 except: 5535 raise 5536 ctx = args[0].ctx 5537 res = isl.isl_ast_build_expr_from_set(args[0].ptr, isl.isl_set_copy(args[1].ptr)) 5538 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5539 exc_info = args[0].at_each_domain['exc_info'][0] 5540 args[0].at_each_domain['exc_info'][0] = None 5541 if exc_info is not None: 5542 raise exc_info 5543 obj = ast_expr(ctx=ctx, ptr=res) 5544 return obj 5545 raise Error 5546 @staticmethod 5547 def from_context(arg0): 5548 try: 5549 if not arg0.__class__ is set: 5550 arg0 = set(arg0) 5551 except: 5552 raise 5553 ctx = arg0.ctx 5554 res = isl.isl_ast_build_from_context(isl.isl_set_copy(arg0.ptr)) 5555 obj = ast_build(ctx=ctx, ptr=res) 5556 return obj 5557 def node_from(*args): 5558 if len(args) == 2 and args[1].__class__ is schedule: 5559 args = list(args) 5560 try: 5561 if not args[0].__class__ is ast_build: 5562 args[0] = ast_build(args[0]) 5563 except: 5564 raise 5565 ctx = args[0].ctx 5566 res = isl.isl_ast_build_node_from_schedule(args[0].ptr, isl.isl_schedule_copy(args[1].ptr)) 5567 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 5568 exc_info = args[0].at_each_domain['exc_info'][0] 5569 args[0].at_each_domain['exc_info'][0] = None 5570 if exc_info is not None: 5571 raise exc_info 5572 obj = ast_node(ctx=ctx, ptr=res) 5573 return obj 5574 raise Error 5575 def node_from_schedule_map(arg0, arg1): 5576 try: 5577 if not arg0.__class__ is ast_build: 5578 arg0 = ast_build(arg0) 5579 except: 5580 raise 5581 try: 5582 if not arg1.__class__ is union_map: 5583 arg1 = union_map(arg1) 5584 except: 5585 raise 5586 ctx = arg0.ctx 5587 res = isl.isl_ast_build_node_from_schedule_map(arg0.ptr, isl.isl_union_map_copy(arg1.ptr)) 5588 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 5589 exc_info = arg0.at_each_domain['exc_info'][0] 5590 arg0.at_each_domain['exc_info'][0] = None 5591 if exc_info is not None: 5592 raise exc_info 5593 obj = ast_node(ctx=ctx, ptr=res) 5594 return obj 5595 def schedule(arg0): 5596 try: 5597 if not arg0.__class__ is ast_build: 5598 arg0 = ast_build(arg0) 5599 except: 5600 raise 5601 ctx = arg0.ctx 5602 res = isl.isl_ast_build_get_schedule(arg0.ptr) 5603 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 5604 exc_info = arg0.at_each_domain['exc_info'][0] 5605 arg0.at_each_domain['exc_info'][0] = None 5606 if exc_info is not None: 5607 raise exc_info 5608 obj = union_map(ctx=ctx, ptr=res) 5609 return obj 5610 def get_schedule(arg0): 5611 return arg0.schedule() 5612 5613isl.isl_ast_build_alloc.restype = c_void_p 5614isl.isl_ast_build_alloc.argtypes = [Context] 5615isl.isl_ast_build_set_at_each_domain.restype = c_void_p 5616isl.isl_ast_build_set_at_each_domain.argtypes = [c_void_p, c_void_p, c_void_p] 5617isl.isl_ast_build_access_from_multi_pw_aff.restype = c_void_p 5618isl.isl_ast_build_access_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 5619isl.isl_ast_build_access_from_pw_multi_aff.restype = c_void_p 5620isl.isl_ast_build_access_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 5621isl.isl_ast_build_call_from_multi_pw_aff.restype = c_void_p 5622isl.isl_ast_build_call_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 5623isl.isl_ast_build_call_from_pw_multi_aff.restype = c_void_p 5624isl.isl_ast_build_call_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 5625isl.isl_ast_build_expr_from_pw_aff.restype = c_void_p 5626isl.isl_ast_build_expr_from_pw_aff.argtypes = [c_void_p, c_void_p] 5627isl.isl_ast_build_expr_from_set.restype = c_void_p 5628isl.isl_ast_build_expr_from_set.argtypes = [c_void_p, c_void_p] 5629isl.isl_ast_build_from_context.restype = c_void_p 5630isl.isl_ast_build_from_context.argtypes = [c_void_p] 5631isl.isl_ast_build_node_from_schedule.restype = c_void_p 5632isl.isl_ast_build_node_from_schedule.argtypes = [c_void_p, c_void_p] 5633isl.isl_ast_build_node_from_schedule_map.restype = c_void_p 5634isl.isl_ast_build_node_from_schedule_map.argtypes = [c_void_p, c_void_p] 5635isl.isl_ast_build_get_schedule.restype = c_void_p 5636isl.isl_ast_build_get_schedule.argtypes = [c_void_p] 5637isl.isl_ast_build_copy.restype = c_void_p 5638isl.isl_ast_build_copy.argtypes = [c_void_p] 5639isl.isl_ast_build_free.restype = c_void_p 5640isl.isl_ast_build_free.argtypes = [c_void_p] 5641 5642class ast_expr(object): 5643 def __init__(self, *args, **keywords): 5644 if "ptr" in keywords: 5645 self.ctx = keywords["ctx"] 5646 self.ptr = keywords["ptr"] 5647 return 5648 if len(args) == 1 and isinstance(args[0], ast_expr_op): 5649 self.ctx = args[0].ctx 5650 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5651 return 5652 if len(args) == 1 and isinstance(args[0], ast_expr_id): 5653 self.ctx = args[0].ctx 5654 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5655 return 5656 if len(args) == 1 and isinstance(args[0], ast_expr_int): 5657 self.ctx = args[0].ctx 5658 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5659 return 5660 raise Error 5661 def __del__(self): 5662 if hasattr(self, 'ptr'): 5663 isl.isl_ast_expr_free(self.ptr) 5664 def __new__(cls, *args, **keywords): 5665 if "ptr" in keywords: 5666 type = isl.isl_ast_expr_get_type(keywords["ptr"]) 5667 if type == 0: 5668 return ast_expr_op(**keywords) 5669 if type == 1: 5670 return ast_expr_id(**keywords) 5671 if type == 2: 5672 return ast_expr_int(**keywords) 5673 raise Error 5674 return super(ast_expr, cls).__new__(cls) 5675 def __str__(arg0): 5676 try: 5677 if not arg0.__class__ is ast_expr: 5678 arg0 = ast_expr(arg0) 5679 except: 5680 raise 5681 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5682 res = cast(ptr, c_char_p).value.decode('ascii') 5683 libc.free(ptr) 5684 return res 5685 def __repr__(self): 5686 s = str(self) 5687 if '"' in s: 5688 return 'isl.ast_expr("""%s""")' % s 5689 else: 5690 return 'isl.ast_expr("%s")' % s 5691 def to_C_str(arg0): 5692 try: 5693 if not arg0.__class__ is ast_expr: 5694 arg0 = ast_expr(arg0) 5695 except: 5696 raise 5697 ctx = arg0.ctx 5698 res = isl.isl_ast_expr_to_C_str(arg0.ptr) 5699 if res == 0: 5700 raise Error 5701 string = cast(res, c_char_p).value.decode('ascii') 5702 libc.free(res) 5703 return string 5704 5705isl.isl_ast_expr_to_C_str.restype = POINTER(c_char) 5706isl.isl_ast_expr_to_C_str.argtypes = [c_void_p] 5707isl.isl_ast_expr_copy.restype = c_void_p 5708isl.isl_ast_expr_copy.argtypes = [c_void_p] 5709isl.isl_ast_expr_free.restype = c_void_p 5710isl.isl_ast_expr_free.argtypes = [c_void_p] 5711isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5712isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5713isl.isl_ast_expr_get_type.argtypes = [c_void_p] 5714 5715class ast_expr_id(ast_expr): 5716 def __init__(self, *args, **keywords): 5717 if "ptr" in keywords: 5718 self.ctx = keywords["ctx"] 5719 self.ptr = keywords["ptr"] 5720 return 5721 raise Error 5722 def __del__(self): 5723 if hasattr(self, 'ptr'): 5724 isl.isl_ast_expr_free(self.ptr) 5725 def __new__(cls, *args, **keywords): 5726 return super(ast_expr_id, cls).__new__(cls) 5727 def __str__(arg0): 5728 try: 5729 if not arg0.__class__ is ast_expr_id: 5730 arg0 = ast_expr_id(arg0) 5731 except: 5732 raise 5733 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5734 res = cast(ptr, c_char_p).value.decode('ascii') 5735 libc.free(ptr) 5736 return res 5737 def __repr__(self): 5738 s = str(self) 5739 if '"' in s: 5740 return 'isl.ast_expr_id("""%s""")' % s 5741 else: 5742 return 'isl.ast_expr_id("%s")' % s 5743 def id(arg0): 5744 try: 5745 if not arg0.__class__ is ast_expr: 5746 arg0 = ast_expr(arg0) 5747 except: 5748 raise 5749 ctx = arg0.ctx 5750 res = isl.isl_ast_expr_id_get_id(arg0.ptr) 5751 obj = id(ctx=ctx, ptr=res) 5752 return obj 5753 def get_id(arg0): 5754 return arg0.id() 5755 5756isl.isl_ast_expr_id_get_id.restype = c_void_p 5757isl.isl_ast_expr_id_get_id.argtypes = [c_void_p] 5758isl.isl_ast_expr_copy.restype = c_void_p 5759isl.isl_ast_expr_copy.argtypes = [c_void_p] 5760isl.isl_ast_expr_free.restype = c_void_p 5761isl.isl_ast_expr_free.argtypes = [c_void_p] 5762isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5763isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5764 5765class ast_expr_int(ast_expr): 5766 def __init__(self, *args, **keywords): 5767 if "ptr" in keywords: 5768 self.ctx = keywords["ctx"] 5769 self.ptr = keywords["ptr"] 5770 return 5771 raise Error 5772 def __del__(self): 5773 if hasattr(self, 'ptr'): 5774 isl.isl_ast_expr_free(self.ptr) 5775 def __new__(cls, *args, **keywords): 5776 return super(ast_expr_int, cls).__new__(cls) 5777 def __str__(arg0): 5778 try: 5779 if not arg0.__class__ is ast_expr_int: 5780 arg0 = ast_expr_int(arg0) 5781 except: 5782 raise 5783 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5784 res = cast(ptr, c_char_p).value.decode('ascii') 5785 libc.free(ptr) 5786 return res 5787 def __repr__(self): 5788 s = str(self) 5789 if '"' in s: 5790 return 'isl.ast_expr_int("""%s""")' % s 5791 else: 5792 return 'isl.ast_expr_int("%s")' % s 5793 def val(arg0): 5794 try: 5795 if not arg0.__class__ is ast_expr: 5796 arg0 = ast_expr(arg0) 5797 except: 5798 raise 5799 ctx = arg0.ctx 5800 res = isl.isl_ast_expr_int_get_val(arg0.ptr) 5801 obj = val(ctx=ctx, ptr=res) 5802 return obj 5803 def get_val(arg0): 5804 return arg0.val() 5805 5806isl.isl_ast_expr_int_get_val.restype = c_void_p 5807isl.isl_ast_expr_int_get_val.argtypes = [c_void_p] 5808isl.isl_ast_expr_copy.restype = c_void_p 5809isl.isl_ast_expr_copy.argtypes = [c_void_p] 5810isl.isl_ast_expr_free.restype = c_void_p 5811isl.isl_ast_expr_free.argtypes = [c_void_p] 5812isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5813isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5814 5815class ast_expr_op(ast_expr): 5816 def __init__(self, *args, **keywords): 5817 if "ptr" in keywords: 5818 self.ctx = keywords["ctx"] 5819 self.ptr = keywords["ptr"] 5820 return 5821 if len(args) == 1 and isinstance(args[0], ast_expr_op_and): 5822 self.ctx = args[0].ctx 5823 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5824 return 5825 if len(args) == 1 and isinstance(args[0], ast_expr_op_and_then): 5826 self.ctx = args[0].ctx 5827 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5828 return 5829 if len(args) == 1 and isinstance(args[0], ast_expr_op_or): 5830 self.ctx = args[0].ctx 5831 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5832 return 5833 if len(args) == 1 and isinstance(args[0], ast_expr_op_or_else): 5834 self.ctx = args[0].ctx 5835 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5836 return 5837 if len(args) == 1 and isinstance(args[0], ast_expr_op_max): 5838 self.ctx = args[0].ctx 5839 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5840 return 5841 if len(args) == 1 and isinstance(args[0], ast_expr_op_min): 5842 self.ctx = args[0].ctx 5843 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5844 return 5845 if len(args) == 1 and isinstance(args[0], ast_expr_op_minus): 5846 self.ctx = args[0].ctx 5847 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5848 return 5849 if len(args) == 1 and isinstance(args[0], ast_expr_op_add): 5850 self.ctx = args[0].ctx 5851 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5852 return 5853 if len(args) == 1 and isinstance(args[0], ast_expr_op_sub): 5854 self.ctx = args[0].ctx 5855 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5856 return 5857 if len(args) == 1 and isinstance(args[0], ast_expr_op_mul): 5858 self.ctx = args[0].ctx 5859 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5860 return 5861 if len(args) == 1 and isinstance(args[0], ast_expr_op_div): 5862 self.ctx = args[0].ctx 5863 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5864 return 5865 if len(args) == 1 and isinstance(args[0], ast_expr_op_fdiv_q): 5866 self.ctx = args[0].ctx 5867 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5868 return 5869 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_q): 5870 self.ctx = args[0].ctx 5871 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5872 return 5873 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_r): 5874 self.ctx = args[0].ctx 5875 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5876 return 5877 if len(args) == 1 and isinstance(args[0], ast_expr_op_zdiv_r): 5878 self.ctx = args[0].ctx 5879 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5880 return 5881 if len(args) == 1 and isinstance(args[0], ast_expr_op_cond): 5882 self.ctx = args[0].ctx 5883 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5884 return 5885 if len(args) == 1 and isinstance(args[0], ast_expr_op_select): 5886 self.ctx = args[0].ctx 5887 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5888 return 5889 if len(args) == 1 and isinstance(args[0], ast_expr_op_eq): 5890 self.ctx = args[0].ctx 5891 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5892 return 5893 if len(args) == 1 and isinstance(args[0], ast_expr_op_le): 5894 self.ctx = args[0].ctx 5895 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5896 return 5897 if len(args) == 1 and isinstance(args[0], ast_expr_op_lt): 5898 self.ctx = args[0].ctx 5899 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5900 return 5901 if len(args) == 1 and isinstance(args[0], ast_expr_op_ge): 5902 self.ctx = args[0].ctx 5903 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5904 return 5905 if len(args) == 1 and isinstance(args[0], ast_expr_op_gt): 5906 self.ctx = args[0].ctx 5907 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5908 return 5909 if len(args) == 1 and isinstance(args[0], ast_expr_op_call): 5910 self.ctx = args[0].ctx 5911 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5912 return 5913 if len(args) == 1 and isinstance(args[0], ast_expr_op_access): 5914 self.ctx = args[0].ctx 5915 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5916 return 5917 if len(args) == 1 and isinstance(args[0], ast_expr_op_member): 5918 self.ctx = args[0].ctx 5919 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5920 return 5921 if len(args) == 1 and isinstance(args[0], ast_expr_op_address_of): 5922 self.ctx = args[0].ctx 5923 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5924 return 5925 raise Error 5926 def __del__(self): 5927 if hasattr(self, 'ptr'): 5928 isl.isl_ast_expr_free(self.ptr) 5929 def __new__(cls, *args, **keywords): 5930 if "ptr" in keywords: 5931 type = isl.isl_ast_expr_op_get_type(keywords["ptr"]) 5932 if type == 0: 5933 return ast_expr_op_and(**keywords) 5934 if type == 1: 5935 return ast_expr_op_and_then(**keywords) 5936 if type == 2: 5937 return ast_expr_op_or(**keywords) 5938 if type == 3: 5939 return ast_expr_op_or_else(**keywords) 5940 if type == 4: 5941 return ast_expr_op_max(**keywords) 5942 if type == 5: 5943 return ast_expr_op_min(**keywords) 5944 if type == 6: 5945 return ast_expr_op_minus(**keywords) 5946 if type == 7: 5947 return ast_expr_op_add(**keywords) 5948 if type == 8: 5949 return ast_expr_op_sub(**keywords) 5950 if type == 9: 5951 return ast_expr_op_mul(**keywords) 5952 if type == 10: 5953 return ast_expr_op_div(**keywords) 5954 if type == 11: 5955 return ast_expr_op_fdiv_q(**keywords) 5956 if type == 12: 5957 return ast_expr_op_pdiv_q(**keywords) 5958 if type == 13: 5959 return ast_expr_op_pdiv_r(**keywords) 5960 if type == 14: 5961 return ast_expr_op_zdiv_r(**keywords) 5962 if type == 15: 5963 return ast_expr_op_cond(**keywords) 5964 if type == 16: 5965 return ast_expr_op_select(**keywords) 5966 if type == 17: 5967 return ast_expr_op_eq(**keywords) 5968 if type == 18: 5969 return ast_expr_op_le(**keywords) 5970 if type == 19: 5971 return ast_expr_op_lt(**keywords) 5972 if type == 20: 5973 return ast_expr_op_ge(**keywords) 5974 if type == 21: 5975 return ast_expr_op_gt(**keywords) 5976 if type == 22: 5977 return ast_expr_op_call(**keywords) 5978 if type == 23: 5979 return ast_expr_op_access(**keywords) 5980 if type == 24: 5981 return ast_expr_op_member(**keywords) 5982 if type == 25: 5983 return ast_expr_op_address_of(**keywords) 5984 raise Error 5985 return super(ast_expr_op, cls).__new__(cls) 5986 def __str__(arg0): 5987 try: 5988 if not arg0.__class__ is ast_expr_op: 5989 arg0 = ast_expr_op(arg0) 5990 except: 5991 raise 5992 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5993 res = cast(ptr, c_char_p).value.decode('ascii') 5994 libc.free(ptr) 5995 return res 5996 def __repr__(self): 5997 s = str(self) 5998 if '"' in s: 5999 return 'isl.ast_expr_op("""%s""")' % s 6000 else: 6001 return 'isl.ast_expr_op("%s")' % s 6002 def arg(arg0, arg1): 6003 try: 6004 if not arg0.__class__ is ast_expr: 6005 arg0 = ast_expr(arg0) 6006 except: 6007 raise 6008 ctx = arg0.ctx 6009 res = isl.isl_ast_expr_op_get_arg(arg0.ptr, arg1) 6010 obj = ast_expr(ctx=ctx, ptr=res) 6011 return obj 6012 def get_arg(arg0, arg1): 6013 return arg0.arg(arg1) 6014 def n_arg(arg0): 6015 try: 6016 if not arg0.__class__ is ast_expr: 6017 arg0 = ast_expr(arg0) 6018 except: 6019 raise 6020 ctx = arg0.ctx 6021 res = isl.isl_ast_expr_op_get_n_arg(arg0.ptr) 6022 if res < 0: 6023 raise Error 6024 return int(res) 6025 def get_n_arg(arg0): 6026 return arg0.n_arg() 6027 6028isl.isl_ast_expr_op_get_arg.restype = c_void_p 6029isl.isl_ast_expr_op_get_arg.argtypes = [c_void_p, c_int] 6030isl.isl_ast_expr_op_get_n_arg.argtypes = [c_void_p] 6031isl.isl_ast_expr_copy.restype = c_void_p 6032isl.isl_ast_expr_copy.argtypes = [c_void_p] 6033isl.isl_ast_expr_free.restype = c_void_p 6034isl.isl_ast_expr_free.argtypes = [c_void_p] 6035isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6036isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6037isl.isl_ast_expr_op_get_type.argtypes = [c_void_p] 6038 6039class ast_expr_op_access(ast_expr_op): 6040 def __init__(self, *args, **keywords): 6041 if "ptr" in keywords: 6042 self.ctx = keywords["ctx"] 6043 self.ptr = keywords["ptr"] 6044 return 6045 raise Error 6046 def __del__(self): 6047 if hasattr(self, 'ptr'): 6048 isl.isl_ast_expr_free(self.ptr) 6049 def __new__(cls, *args, **keywords): 6050 return super(ast_expr_op_access, cls).__new__(cls) 6051 def __str__(arg0): 6052 try: 6053 if not arg0.__class__ is ast_expr_op_access: 6054 arg0 = ast_expr_op_access(arg0) 6055 except: 6056 raise 6057 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6058 res = cast(ptr, c_char_p).value.decode('ascii') 6059 libc.free(ptr) 6060 return res 6061 def __repr__(self): 6062 s = str(self) 6063 if '"' in s: 6064 return 'isl.ast_expr_op_access("""%s""")' % s 6065 else: 6066 return 'isl.ast_expr_op_access("%s")' % s 6067 6068isl.isl_ast_expr_copy.restype = c_void_p 6069isl.isl_ast_expr_copy.argtypes = [c_void_p] 6070isl.isl_ast_expr_free.restype = c_void_p 6071isl.isl_ast_expr_free.argtypes = [c_void_p] 6072isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6073isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6074 6075class ast_expr_op_add(ast_expr_op): 6076 def __init__(self, *args, **keywords): 6077 if "ptr" in keywords: 6078 self.ctx = keywords["ctx"] 6079 self.ptr = keywords["ptr"] 6080 return 6081 raise Error 6082 def __del__(self): 6083 if hasattr(self, 'ptr'): 6084 isl.isl_ast_expr_free(self.ptr) 6085 def __new__(cls, *args, **keywords): 6086 return super(ast_expr_op_add, cls).__new__(cls) 6087 def __str__(arg0): 6088 try: 6089 if not arg0.__class__ is ast_expr_op_add: 6090 arg0 = ast_expr_op_add(arg0) 6091 except: 6092 raise 6093 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6094 res = cast(ptr, c_char_p).value.decode('ascii') 6095 libc.free(ptr) 6096 return res 6097 def __repr__(self): 6098 s = str(self) 6099 if '"' in s: 6100 return 'isl.ast_expr_op_add("""%s""")' % s 6101 else: 6102 return 'isl.ast_expr_op_add("%s")' % s 6103 6104isl.isl_ast_expr_copy.restype = c_void_p 6105isl.isl_ast_expr_copy.argtypes = [c_void_p] 6106isl.isl_ast_expr_free.restype = c_void_p 6107isl.isl_ast_expr_free.argtypes = [c_void_p] 6108isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6109isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6110 6111class ast_expr_op_address_of(ast_expr_op): 6112 def __init__(self, *args, **keywords): 6113 if "ptr" in keywords: 6114 self.ctx = keywords["ctx"] 6115 self.ptr = keywords["ptr"] 6116 return 6117 raise Error 6118 def __del__(self): 6119 if hasattr(self, 'ptr'): 6120 isl.isl_ast_expr_free(self.ptr) 6121 def __new__(cls, *args, **keywords): 6122 return super(ast_expr_op_address_of, cls).__new__(cls) 6123 def __str__(arg0): 6124 try: 6125 if not arg0.__class__ is ast_expr_op_address_of: 6126 arg0 = ast_expr_op_address_of(arg0) 6127 except: 6128 raise 6129 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6130 res = cast(ptr, c_char_p).value.decode('ascii') 6131 libc.free(ptr) 6132 return res 6133 def __repr__(self): 6134 s = str(self) 6135 if '"' in s: 6136 return 'isl.ast_expr_op_address_of("""%s""")' % s 6137 else: 6138 return 'isl.ast_expr_op_address_of("%s")' % s 6139 6140isl.isl_ast_expr_copy.restype = c_void_p 6141isl.isl_ast_expr_copy.argtypes = [c_void_p] 6142isl.isl_ast_expr_free.restype = c_void_p 6143isl.isl_ast_expr_free.argtypes = [c_void_p] 6144isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6145isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6146 6147class ast_expr_op_and(ast_expr_op): 6148 def __init__(self, *args, **keywords): 6149 if "ptr" in keywords: 6150 self.ctx = keywords["ctx"] 6151 self.ptr = keywords["ptr"] 6152 return 6153 raise Error 6154 def __del__(self): 6155 if hasattr(self, 'ptr'): 6156 isl.isl_ast_expr_free(self.ptr) 6157 def __new__(cls, *args, **keywords): 6158 return super(ast_expr_op_and, cls).__new__(cls) 6159 def __str__(arg0): 6160 try: 6161 if not arg0.__class__ is ast_expr_op_and: 6162 arg0 = ast_expr_op_and(arg0) 6163 except: 6164 raise 6165 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6166 res = cast(ptr, c_char_p).value.decode('ascii') 6167 libc.free(ptr) 6168 return res 6169 def __repr__(self): 6170 s = str(self) 6171 if '"' in s: 6172 return 'isl.ast_expr_op_and("""%s""")' % s 6173 else: 6174 return 'isl.ast_expr_op_and("%s")' % s 6175 6176isl.isl_ast_expr_copy.restype = c_void_p 6177isl.isl_ast_expr_copy.argtypes = [c_void_p] 6178isl.isl_ast_expr_free.restype = c_void_p 6179isl.isl_ast_expr_free.argtypes = [c_void_p] 6180isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6181isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6182 6183class ast_expr_op_and_then(ast_expr_op): 6184 def __init__(self, *args, **keywords): 6185 if "ptr" in keywords: 6186 self.ctx = keywords["ctx"] 6187 self.ptr = keywords["ptr"] 6188 return 6189 raise Error 6190 def __del__(self): 6191 if hasattr(self, 'ptr'): 6192 isl.isl_ast_expr_free(self.ptr) 6193 def __new__(cls, *args, **keywords): 6194 return super(ast_expr_op_and_then, cls).__new__(cls) 6195 def __str__(arg0): 6196 try: 6197 if not arg0.__class__ is ast_expr_op_and_then: 6198 arg0 = ast_expr_op_and_then(arg0) 6199 except: 6200 raise 6201 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6202 res = cast(ptr, c_char_p).value.decode('ascii') 6203 libc.free(ptr) 6204 return res 6205 def __repr__(self): 6206 s = str(self) 6207 if '"' in s: 6208 return 'isl.ast_expr_op_and_then("""%s""")' % s 6209 else: 6210 return 'isl.ast_expr_op_and_then("%s")' % s 6211 6212isl.isl_ast_expr_copy.restype = c_void_p 6213isl.isl_ast_expr_copy.argtypes = [c_void_p] 6214isl.isl_ast_expr_free.restype = c_void_p 6215isl.isl_ast_expr_free.argtypes = [c_void_p] 6216isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6217isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6218 6219class ast_expr_op_call(ast_expr_op): 6220 def __init__(self, *args, **keywords): 6221 if "ptr" in keywords: 6222 self.ctx = keywords["ctx"] 6223 self.ptr = keywords["ptr"] 6224 return 6225 raise Error 6226 def __del__(self): 6227 if hasattr(self, 'ptr'): 6228 isl.isl_ast_expr_free(self.ptr) 6229 def __new__(cls, *args, **keywords): 6230 return super(ast_expr_op_call, cls).__new__(cls) 6231 def __str__(arg0): 6232 try: 6233 if not arg0.__class__ is ast_expr_op_call: 6234 arg0 = ast_expr_op_call(arg0) 6235 except: 6236 raise 6237 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6238 res = cast(ptr, c_char_p).value.decode('ascii') 6239 libc.free(ptr) 6240 return res 6241 def __repr__(self): 6242 s = str(self) 6243 if '"' in s: 6244 return 'isl.ast_expr_op_call("""%s""")' % s 6245 else: 6246 return 'isl.ast_expr_op_call("%s")' % s 6247 6248isl.isl_ast_expr_copy.restype = c_void_p 6249isl.isl_ast_expr_copy.argtypes = [c_void_p] 6250isl.isl_ast_expr_free.restype = c_void_p 6251isl.isl_ast_expr_free.argtypes = [c_void_p] 6252isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6253isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6254 6255class ast_expr_op_cond(ast_expr_op): 6256 def __init__(self, *args, **keywords): 6257 if "ptr" in keywords: 6258 self.ctx = keywords["ctx"] 6259 self.ptr = keywords["ptr"] 6260 return 6261 raise Error 6262 def __del__(self): 6263 if hasattr(self, 'ptr'): 6264 isl.isl_ast_expr_free(self.ptr) 6265 def __new__(cls, *args, **keywords): 6266 return super(ast_expr_op_cond, cls).__new__(cls) 6267 def __str__(arg0): 6268 try: 6269 if not arg0.__class__ is ast_expr_op_cond: 6270 arg0 = ast_expr_op_cond(arg0) 6271 except: 6272 raise 6273 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6274 res = cast(ptr, c_char_p).value.decode('ascii') 6275 libc.free(ptr) 6276 return res 6277 def __repr__(self): 6278 s = str(self) 6279 if '"' in s: 6280 return 'isl.ast_expr_op_cond("""%s""")' % s 6281 else: 6282 return 'isl.ast_expr_op_cond("%s")' % s 6283 6284isl.isl_ast_expr_copy.restype = c_void_p 6285isl.isl_ast_expr_copy.argtypes = [c_void_p] 6286isl.isl_ast_expr_free.restype = c_void_p 6287isl.isl_ast_expr_free.argtypes = [c_void_p] 6288isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6289isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6290 6291class ast_expr_op_div(ast_expr_op): 6292 def __init__(self, *args, **keywords): 6293 if "ptr" in keywords: 6294 self.ctx = keywords["ctx"] 6295 self.ptr = keywords["ptr"] 6296 return 6297 raise Error 6298 def __del__(self): 6299 if hasattr(self, 'ptr'): 6300 isl.isl_ast_expr_free(self.ptr) 6301 def __new__(cls, *args, **keywords): 6302 return super(ast_expr_op_div, cls).__new__(cls) 6303 def __str__(arg0): 6304 try: 6305 if not arg0.__class__ is ast_expr_op_div: 6306 arg0 = ast_expr_op_div(arg0) 6307 except: 6308 raise 6309 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6310 res = cast(ptr, c_char_p).value.decode('ascii') 6311 libc.free(ptr) 6312 return res 6313 def __repr__(self): 6314 s = str(self) 6315 if '"' in s: 6316 return 'isl.ast_expr_op_div("""%s""")' % s 6317 else: 6318 return 'isl.ast_expr_op_div("%s")' % s 6319 6320isl.isl_ast_expr_copy.restype = c_void_p 6321isl.isl_ast_expr_copy.argtypes = [c_void_p] 6322isl.isl_ast_expr_free.restype = c_void_p 6323isl.isl_ast_expr_free.argtypes = [c_void_p] 6324isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6325isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6326 6327class ast_expr_op_eq(ast_expr_op): 6328 def __init__(self, *args, **keywords): 6329 if "ptr" in keywords: 6330 self.ctx = keywords["ctx"] 6331 self.ptr = keywords["ptr"] 6332 return 6333 raise Error 6334 def __del__(self): 6335 if hasattr(self, 'ptr'): 6336 isl.isl_ast_expr_free(self.ptr) 6337 def __new__(cls, *args, **keywords): 6338 return super(ast_expr_op_eq, cls).__new__(cls) 6339 def __str__(arg0): 6340 try: 6341 if not arg0.__class__ is ast_expr_op_eq: 6342 arg0 = ast_expr_op_eq(arg0) 6343 except: 6344 raise 6345 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6346 res = cast(ptr, c_char_p).value.decode('ascii') 6347 libc.free(ptr) 6348 return res 6349 def __repr__(self): 6350 s = str(self) 6351 if '"' in s: 6352 return 'isl.ast_expr_op_eq("""%s""")' % s 6353 else: 6354 return 'isl.ast_expr_op_eq("%s")' % s 6355 6356isl.isl_ast_expr_copy.restype = c_void_p 6357isl.isl_ast_expr_copy.argtypes = [c_void_p] 6358isl.isl_ast_expr_free.restype = c_void_p 6359isl.isl_ast_expr_free.argtypes = [c_void_p] 6360isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6361isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6362 6363class ast_expr_op_fdiv_q(ast_expr_op): 6364 def __init__(self, *args, **keywords): 6365 if "ptr" in keywords: 6366 self.ctx = keywords["ctx"] 6367 self.ptr = keywords["ptr"] 6368 return 6369 raise Error 6370 def __del__(self): 6371 if hasattr(self, 'ptr'): 6372 isl.isl_ast_expr_free(self.ptr) 6373 def __new__(cls, *args, **keywords): 6374 return super(ast_expr_op_fdiv_q, cls).__new__(cls) 6375 def __str__(arg0): 6376 try: 6377 if not arg0.__class__ is ast_expr_op_fdiv_q: 6378 arg0 = ast_expr_op_fdiv_q(arg0) 6379 except: 6380 raise 6381 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6382 res = cast(ptr, c_char_p).value.decode('ascii') 6383 libc.free(ptr) 6384 return res 6385 def __repr__(self): 6386 s = str(self) 6387 if '"' in s: 6388 return 'isl.ast_expr_op_fdiv_q("""%s""")' % s 6389 else: 6390 return 'isl.ast_expr_op_fdiv_q("%s")' % s 6391 6392isl.isl_ast_expr_copy.restype = c_void_p 6393isl.isl_ast_expr_copy.argtypes = [c_void_p] 6394isl.isl_ast_expr_free.restype = c_void_p 6395isl.isl_ast_expr_free.argtypes = [c_void_p] 6396isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6397isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6398 6399class ast_expr_op_ge(ast_expr_op): 6400 def __init__(self, *args, **keywords): 6401 if "ptr" in keywords: 6402 self.ctx = keywords["ctx"] 6403 self.ptr = keywords["ptr"] 6404 return 6405 raise Error 6406 def __del__(self): 6407 if hasattr(self, 'ptr'): 6408 isl.isl_ast_expr_free(self.ptr) 6409 def __new__(cls, *args, **keywords): 6410 return super(ast_expr_op_ge, cls).__new__(cls) 6411 def __str__(arg0): 6412 try: 6413 if not arg0.__class__ is ast_expr_op_ge: 6414 arg0 = ast_expr_op_ge(arg0) 6415 except: 6416 raise 6417 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6418 res = cast(ptr, c_char_p).value.decode('ascii') 6419 libc.free(ptr) 6420 return res 6421 def __repr__(self): 6422 s = str(self) 6423 if '"' in s: 6424 return 'isl.ast_expr_op_ge("""%s""")' % s 6425 else: 6426 return 'isl.ast_expr_op_ge("%s")' % s 6427 6428isl.isl_ast_expr_copy.restype = c_void_p 6429isl.isl_ast_expr_copy.argtypes = [c_void_p] 6430isl.isl_ast_expr_free.restype = c_void_p 6431isl.isl_ast_expr_free.argtypes = [c_void_p] 6432isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6433isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6434 6435class ast_expr_op_gt(ast_expr_op): 6436 def __init__(self, *args, **keywords): 6437 if "ptr" in keywords: 6438 self.ctx = keywords["ctx"] 6439 self.ptr = keywords["ptr"] 6440 return 6441 raise Error 6442 def __del__(self): 6443 if hasattr(self, 'ptr'): 6444 isl.isl_ast_expr_free(self.ptr) 6445 def __new__(cls, *args, **keywords): 6446 return super(ast_expr_op_gt, cls).__new__(cls) 6447 def __str__(arg0): 6448 try: 6449 if not arg0.__class__ is ast_expr_op_gt: 6450 arg0 = ast_expr_op_gt(arg0) 6451 except: 6452 raise 6453 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6454 res = cast(ptr, c_char_p).value.decode('ascii') 6455 libc.free(ptr) 6456 return res 6457 def __repr__(self): 6458 s = str(self) 6459 if '"' in s: 6460 return 'isl.ast_expr_op_gt("""%s""")' % s 6461 else: 6462 return 'isl.ast_expr_op_gt("%s")' % s 6463 6464isl.isl_ast_expr_copy.restype = c_void_p 6465isl.isl_ast_expr_copy.argtypes = [c_void_p] 6466isl.isl_ast_expr_free.restype = c_void_p 6467isl.isl_ast_expr_free.argtypes = [c_void_p] 6468isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6469isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6470 6471class ast_expr_op_le(ast_expr_op): 6472 def __init__(self, *args, **keywords): 6473 if "ptr" in keywords: 6474 self.ctx = keywords["ctx"] 6475 self.ptr = keywords["ptr"] 6476 return 6477 raise Error 6478 def __del__(self): 6479 if hasattr(self, 'ptr'): 6480 isl.isl_ast_expr_free(self.ptr) 6481 def __new__(cls, *args, **keywords): 6482 return super(ast_expr_op_le, cls).__new__(cls) 6483 def __str__(arg0): 6484 try: 6485 if not arg0.__class__ is ast_expr_op_le: 6486 arg0 = ast_expr_op_le(arg0) 6487 except: 6488 raise 6489 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6490 res = cast(ptr, c_char_p).value.decode('ascii') 6491 libc.free(ptr) 6492 return res 6493 def __repr__(self): 6494 s = str(self) 6495 if '"' in s: 6496 return 'isl.ast_expr_op_le("""%s""")' % s 6497 else: 6498 return 'isl.ast_expr_op_le("%s")' % s 6499 6500isl.isl_ast_expr_copy.restype = c_void_p 6501isl.isl_ast_expr_copy.argtypes = [c_void_p] 6502isl.isl_ast_expr_free.restype = c_void_p 6503isl.isl_ast_expr_free.argtypes = [c_void_p] 6504isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6505isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6506 6507class ast_expr_op_lt(ast_expr_op): 6508 def __init__(self, *args, **keywords): 6509 if "ptr" in keywords: 6510 self.ctx = keywords["ctx"] 6511 self.ptr = keywords["ptr"] 6512 return 6513 raise Error 6514 def __del__(self): 6515 if hasattr(self, 'ptr'): 6516 isl.isl_ast_expr_free(self.ptr) 6517 def __new__(cls, *args, **keywords): 6518 return super(ast_expr_op_lt, cls).__new__(cls) 6519 def __str__(arg0): 6520 try: 6521 if not arg0.__class__ is ast_expr_op_lt: 6522 arg0 = ast_expr_op_lt(arg0) 6523 except: 6524 raise 6525 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6526 res = cast(ptr, c_char_p).value.decode('ascii') 6527 libc.free(ptr) 6528 return res 6529 def __repr__(self): 6530 s = str(self) 6531 if '"' in s: 6532 return 'isl.ast_expr_op_lt("""%s""")' % s 6533 else: 6534 return 'isl.ast_expr_op_lt("%s")' % s 6535 6536isl.isl_ast_expr_copy.restype = c_void_p 6537isl.isl_ast_expr_copy.argtypes = [c_void_p] 6538isl.isl_ast_expr_free.restype = c_void_p 6539isl.isl_ast_expr_free.argtypes = [c_void_p] 6540isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6541isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6542 6543class ast_expr_op_max(ast_expr_op): 6544 def __init__(self, *args, **keywords): 6545 if "ptr" in keywords: 6546 self.ctx = keywords["ctx"] 6547 self.ptr = keywords["ptr"] 6548 return 6549 raise Error 6550 def __del__(self): 6551 if hasattr(self, 'ptr'): 6552 isl.isl_ast_expr_free(self.ptr) 6553 def __new__(cls, *args, **keywords): 6554 return super(ast_expr_op_max, cls).__new__(cls) 6555 def __str__(arg0): 6556 try: 6557 if not arg0.__class__ is ast_expr_op_max: 6558 arg0 = ast_expr_op_max(arg0) 6559 except: 6560 raise 6561 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6562 res = cast(ptr, c_char_p).value.decode('ascii') 6563 libc.free(ptr) 6564 return res 6565 def __repr__(self): 6566 s = str(self) 6567 if '"' in s: 6568 return 'isl.ast_expr_op_max("""%s""")' % s 6569 else: 6570 return 'isl.ast_expr_op_max("%s")' % s 6571 6572isl.isl_ast_expr_copy.restype = c_void_p 6573isl.isl_ast_expr_copy.argtypes = [c_void_p] 6574isl.isl_ast_expr_free.restype = c_void_p 6575isl.isl_ast_expr_free.argtypes = [c_void_p] 6576isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6577isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6578 6579class ast_expr_op_member(ast_expr_op): 6580 def __init__(self, *args, **keywords): 6581 if "ptr" in keywords: 6582 self.ctx = keywords["ctx"] 6583 self.ptr = keywords["ptr"] 6584 return 6585 raise Error 6586 def __del__(self): 6587 if hasattr(self, 'ptr'): 6588 isl.isl_ast_expr_free(self.ptr) 6589 def __new__(cls, *args, **keywords): 6590 return super(ast_expr_op_member, cls).__new__(cls) 6591 def __str__(arg0): 6592 try: 6593 if not arg0.__class__ is ast_expr_op_member: 6594 arg0 = ast_expr_op_member(arg0) 6595 except: 6596 raise 6597 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6598 res = cast(ptr, c_char_p).value.decode('ascii') 6599 libc.free(ptr) 6600 return res 6601 def __repr__(self): 6602 s = str(self) 6603 if '"' in s: 6604 return 'isl.ast_expr_op_member("""%s""")' % s 6605 else: 6606 return 'isl.ast_expr_op_member("%s")' % s 6607 6608isl.isl_ast_expr_copy.restype = c_void_p 6609isl.isl_ast_expr_copy.argtypes = [c_void_p] 6610isl.isl_ast_expr_free.restype = c_void_p 6611isl.isl_ast_expr_free.argtypes = [c_void_p] 6612isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6613isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6614 6615class ast_expr_op_min(ast_expr_op): 6616 def __init__(self, *args, **keywords): 6617 if "ptr" in keywords: 6618 self.ctx = keywords["ctx"] 6619 self.ptr = keywords["ptr"] 6620 return 6621 raise Error 6622 def __del__(self): 6623 if hasattr(self, 'ptr'): 6624 isl.isl_ast_expr_free(self.ptr) 6625 def __new__(cls, *args, **keywords): 6626 return super(ast_expr_op_min, cls).__new__(cls) 6627 def __str__(arg0): 6628 try: 6629 if not arg0.__class__ is ast_expr_op_min: 6630 arg0 = ast_expr_op_min(arg0) 6631 except: 6632 raise 6633 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6634 res = cast(ptr, c_char_p).value.decode('ascii') 6635 libc.free(ptr) 6636 return res 6637 def __repr__(self): 6638 s = str(self) 6639 if '"' in s: 6640 return 'isl.ast_expr_op_min("""%s""")' % s 6641 else: 6642 return 'isl.ast_expr_op_min("%s")' % s 6643 6644isl.isl_ast_expr_copy.restype = c_void_p 6645isl.isl_ast_expr_copy.argtypes = [c_void_p] 6646isl.isl_ast_expr_free.restype = c_void_p 6647isl.isl_ast_expr_free.argtypes = [c_void_p] 6648isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6649isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6650 6651class ast_expr_op_minus(ast_expr_op): 6652 def __init__(self, *args, **keywords): 6653 if "ptr" in keywords: 6654 self.ctx = keywords["ctx"] 6655 self.ptr = keywords["ptr"] 6656 return 6657 raise Error 6658 def __del__(self): 6659 if hasattr(self, 'ptr'): 6660 isl.isl_ast_expr_free(self.ptr) 6661 def __new__(cls, *args, **keywords): 6662 return super(ast_expr_op_minus, cls).__new__(cls) 6663 def __str__(arg0): 6664 try: 6665 if not arg0.__class__ is ast_expr_op_minus: 6666 arg0 = ast_expr_op_minus(arg0) 6667 except: 6668 raise 6669 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6670 res = cast(ptr, c_char_p).value.decode('ascii') 6671 libc.free(ptr) 6672 return res 6673 def __repr__(self): 6674 s = str(self) 6675 if '"' in s: 6676 return 'isl.ast_expr_op_minus("""%s""")' % s 6677 else: 6678 return 'isl.ast_expr_op_minus("%s")' % s 6679 6680isl.isl_ast_expr_copy.restype = c_void_p 6681isl.isl_ast_expr_copy.argtypes = [c_void_p] 6682isl.isl_ast_expr_free.restype = c_void_p 6683isl.isl_ast_expr_free.argtypes = [c_void_p] 6684isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6685isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6686 6687class ast_expr_op_mul(ast_expr_op): 6688 def __init__(self, *args, **keywords): 6689 if "ptr" in keywords: 6690 self.ctx = keywords["ctx"] 6691 self.ptr = keywords["ptr"] 6692 return 6693 raise Error 6694 def __del__(self): 6695 if hasattr(self, 'ptr'): 6696 isl.isl_ast_expr_free(self.ptr) 6697 def __new__(cls, *args, **keywords): 6698 return super(ast_expr_op_mul, cls).__new__(cls) 6699 def __str__(arg0): 6700 try: 6701 if not arg0.__class__ is ast_expr_op_mul: 6702 arg0 = ast_expr_op_mul(arg0) 6703 except: 6704 raise 6705 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6706 res = cast(ptr, c_char_p).value.decode('ascii') 6707 libc.free(ptr) 6708 return res 6709 def __repr__(self): 6710 s = str(self) 6711 if '"' in s: 6712 return 'isl.ast_expr_op_mul("""%s""")' % s 6713 else: 6714 return 'isl.ast_expr_op_mul("%s")' % s 6715 6716isl.isl_ast_expr_copy.restype = c_void_p 6717isl.isl_ast_expr_copy.argtypes = [c_void_p] 6718isl.isl_ast_expr_free.restype = c_void_p 6719isl.isl_ast_expr_free.argtypes = [c_void_p] 6720isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6721isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6722 6723class ast_expr_op_or(ast_expr_op): 6724 def __init__(self, *args, **keywords): 6725 if "ptr" in keywords: 6726 self.ctx = keywords["ctx"] 6727 self.ptr = keywords["ptr"] 6728 return 6729 raise Error 6730 def __del__(self): 6731 if hasattr(self, 'ptr'): 6732 isl.isl_ast_expr_free(self.ptr) 6733 def __new__(cls, *args, **keywords): 6734 return super(ast_expr_op_or, cls).__new__(cls) 6735 def __str__(arg0): 6736 try: 6737 if not arg0.__class__ is ast_expr_op_or: 6738 arg0 = ast_expr_op_or(arg0) 6739 except: 6740 raise 6741 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6742 res = cast(ptr, c_char_p).value.decode('ascii') 6743 libc.free(ptr) 6744 return res 6745 def __repr__(self): 6746 s = str(self) 6747 if '"' in s: 6748 return 'isl.ast_expr_op_or("""%s""")' % s 6749 else: 6750 return 'isl.ast_expr_op_or("%s")' % s 6751 6752isl.isl_ast_expr_copy.restype = c_void_p 6753isl.isl_ast_expr_copy.argtypes = [c_void_p] 6754isl.isl_ast_expr_free.restype = c_void_p 6755isl.isl_ast_expr_free.argtypes = [c_void_p] 6756isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6757isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6758 6759class ast_expr_op_or_else(ast_expr_op): 6760 def __init__(self, *args, **keywords): 6761 if "ptr" in keywords: 6762 self.ctx = keywords["ctx"] 6763 self.ptr = keywords["ptr"] 6764 return 6765 raise Error 6766 def __del__(self): 6767 if hasattr(self, 'ptr'): 6768 isl.isl_ast_expr_free(self.ptr) 6769 def __new__(cls, *args, **keywords): 6770 return super(ast_expr_op_or_else, cls).__new__(cls) 6771 def __str__(arg0): 6772 try: 6773 if not arg0.__class__ is ast_expr_op_or_else: 6774 arg0 = ast_expr_op_or_else(arg0) 6775 except: 6776 raise 6777 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6778 res = cast(ptr, c_char_p).value.decode('ascii') 6779 libc.free(ptr) 6780 return res 6781 def __repr__(self): 6782 s = str(self) 6783 if '"' in s: 6784 return 'isl.ast_expr_op_or_else("""%s""")' % s 6785 else: 6786 return 'isl.ast_expr_op_or_else("%s")' % s 6787 6788isl.isl_ast_expr_copy.restype = c_void_p 6789isl.isl_ast_expr_copy.argtypes = [c_void_p] 6790isl.isl_ast_expr_free.restype = c_void_p 6791isl.isl_ast_expr_free.argtypes = [c_void_p] 6792isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6793isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6794 6795class ast_expr_op_pdiv_q(ast_expr_op): 6796 def __init__(self, *args, **keywords): 6797 if "ptr" in keywords: 6798 self.ctx = keywords["ctx"] 6799 self.ptr = keywords["ptr"] 6800 return 6801 raise Error 6802 def __del__(self): 6803 if hasattr(self, 'ptr'): 6804 isl.isl_ast_expr_free(self.ptr) 6805 def __new__(cls, *args, **keywords): 6806 return super(ast_expr_op_pdiv_q, cls).__new__(cls) 6807 def __str__(arg0): 6808 try: 6809 if not arg0.__class__ is ast_expr_op_pdiv_q: 6810 arg0 = ast_expr_op_pdiv_q(arg0) 6811 except: 6812 raise 6813 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6814 res = cast(ptr, c_char_p).value.decode('ascii') 6815 libc.free(ptr) 6816 return res 6817 def __repr__(self): 6818 s = str(self) 6819 if '"' in s: 6820 return 'isl.ast_expr_op_pdiv_q("""%s""")' % s 6821 else: 6822 return 'isl.ast_expr_op_pdiv_q("%s")' % s 6823 6824isl.isl_ast_expr_copy.restype = c_void_p 6825isl.isl_ast_expr_copy.argtypes = [c_void_p] 6826isl.isl_ast_expr_free.restype = c_void_p 6827isl.isl_ast_expr_free.argtypes = [c_void_p] 6828isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6829isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6830 6831class ast_expr_op_pdiv_r(ast_expr_op): 6832 def __init__(self, *args, **keywords): 6833 if "ptr" in keywords: 6834 self.ctx = keywords["ctx"] 6835 self.ptr = keywords["ptr"] 6836 return 6837 raise Error 6838 def __del__(self): 6839 if hasattr(self, 'ptr'): 6840 isl.isl_ast_expr_free(self.ptr) 6841 def __new__(cls, *args, **keywords): 6842 return super(ast_expr_op_pdiv_r, cls).__new__(cls) 6843 def __str__(arg0): 6844 try: 6845 if not arg0.__class__ is ast_expr_op_pdiv_r: 6846 arg0 = ast_expr_op_pdiv_r(arg0) 6847 except: 6848 raise 6849 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6850 res = cast(ptr, c_char_p).value.decode('ascii') 6851 libc.free(ptr) 6852 return res 6853 def __repr__(self): 6854 s = str(self) 6855 if '"' in s: 6856 return 'isl.ast_expr_op_pdiv_r("""%s""")' % s 6857 else: 6858 return 'isl.ast_expr_op_pdiv_r("%s")' % s 6859 6860isl.isl_ast_expr_copy.restype = c_void_p 6861isl.isl_ast_expr_copy.argtypes = [c_void_p] 6862isl.isl_ast_expr_free.restype = c_void_p 6863isl.isl_ast_expr_free.argtypes = [c_void_p] 6864isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6865isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6866 6867class ast_expr_op_select(ast_expr_op): 6868 def __init__(self, *args, **keywords): 6869 if "ptr" in keywords: 6870 self.ctx = keywords["ctx"] 6871 self.ptr = keywords["ptr"] 6872 return 6873 raise Error 6874 def __del__(self): 6875 if hasattr(self, 'ptr'): 6876 isl.isl_ast_expr_free(self.ptr) 6877 def __new__(cls, *args, **keywords): 6878 return super(ast_expr_op_select, cls).__new__(cls) 6879 def __str__(arg0): 6880 try: 6881 if not arg0.__class__ is ast_expr_op_select: 6882 arg0 = ast_expr_op_select(arg0) 6883 except: 6884 raise 6885 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6886 res = cast(ptr, c_char_p).value.decode('ascii') 6887 libc.free(ptr) 6888 return res 6889 def __repr__(self): 6890 s = str(self) 6891 if '"' in s: 6892 return 'isl.ast_expr_op_select("""%s""")' % s 6893 else: 6894 return 'isl.ast_expr_op_select("%s")' % s 6895 6896isl.isl_ast_expr_copy.restype = c_void_p 6897isl.isl_ast_expr_copy.argtypes = [c_void_p] 6898isl.isl_ast_expr_free.restype = c_void_p 6899isl.isl_ast_expr_free.argtypes = [c_void_p] 6900isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6901isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6902 6903class ast_expr_op_sub(ast_expr_op): 6904 def __init__(self, *args, **keywords): 6905 if "ptr" in keywords: 6906 self.ctx = keywords["ctx"] 6907 self.ptr = keywords["ptr"] 6908 return 6909 raise Error 6910 def __del__(self): 6911 if hasattr(self, 'ptr'): 6912 isl.isl_ast_expr_free(self.ptr) 6913 def __new__(cls, *args, **keywords): 6914 return super(ast_expr_op_sub, cls).__new__(cls) 6915 def __str__(arg0): 6916 try: 6917 if not arg0.__class__ is ast_expr_op_sub: 6918 arg0 = ast_expr_op_sub(arg0) 6919 except: 6920 raise 6921 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6922 res = cast(ptr, c_char_p).value.decode('ascii') 6923 libc.free(ptr) 6924 return res 6925 def __repr__(self): 6926 s = str(self) 6927 if '"' in s: 6928 return 'isl.ast_expr_op_sub("""%s""")' % s 6929 else: 6930 return 'isl.ast_expr_op_sub("%s")' % s 6931 6932isl.isl_ast_expr_copy.restype = c_void_p 6933isl.isl_ast_expr_copy.argtypes = [c_void_p] 6934isl.isl_ast_expr_free.restype = c_void_p 6935isl.isl_ast_expr_free.argtypes = [c_void_p] 6936isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6937isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6938 6939class ast_expr_op_zdiv_r(ast_expr_op): 6940 def __init__(self, *args, **keywords): 6941 if "ptr" in keywords: 6942 self.ctx = keywords["ctx"] 6943 self.ptr = keywords["ptr"] 6944 return 6945 raise Error 6946 def __del__(self): 6947 if hasattr(self, 'ptr'): 6948 isl.isl_ast_expr_free(self.ptr) 6949 def __new__(cls, *args, **keywords): 6950 return super(ast_expr_op_zdiv_r, cls).__new__(cls) 6951 def __str__(arg0): 6952 try: 6953 if not arg0.__class__ is ast_expr_op_zdiv_r: 6954 arg0 = ast_expr_op_zdiv_r(arg0) 6955 except: 6956 raise 6957 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6958 res = cast(ptr, c_char_p).value.decode('ascii') 6959 libc.free(ptr) 6960 return res 6961 def __repr__(self): 6962 s = str(self) 6963 if '"' in s: 6964 return 'isl.ast_expr_op_zdiv_r("""%s""")' % s 6965 else: 6966 return 'isl.ast_expr_op_zdiv_r("%s")' % s 6967 6968isl.isl_ast_expr_copy.restype = c_void_p 6969isl.isl_ast_expr_copy.argtypes = [c_void_p] 6970isl.isl_ast_expr_free.restype = c_void_p 6971isl.isl_ast_expr_free.argtypes = [c_void_p] 6972isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6973isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6974 6975class ast_node(object): 6976 def __init__(self, *args, **keywords): 6977 if "ptr" in keywords: 6978 self.ctx = keywords["ctx"] 6979 self.ptr = keywords["ptr"] 6980 return 6981 if len(args) == 1 and isinstance(args[0], ast_node_for): 6982 self.ctx = args[0].ctx 6983 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6984 return 6985 if len(args) == 1 and isinstance(args[0], ast_node_if): 6986 self.ctx = args[0].ctx 6987 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6988 return 6989 if len(args) == 1 and isinstance(args[0], ast_node_block): 6990 self.ctx = args[0].ctx 6991 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6992 return 6993 if len(args) == 1 and isinstance(args[0], ast_node_mark): 6994 self.ctx = args[0].ctx 6995 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6996 return 6997 if len(args) == 1 and isinstance(args[0], ast_node_user): 6998 self.ctx = args[0].ctx 6999 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 7000 return 7001 raise Error 7002 def __del__(self): 7003 if hasattr(self, 'ptr'): 7004 isl.isl_ast_node_free(self.ptr) 7005 def __new__(cls, *args, **keywords): 7006 if "ptr" in keywords: 7007 type = isl.isl_ast_node_get_type(keywords["ptr"]) 7008 if type == 1: 7009 return ast_node_for(**keywords) 7010 if type == 2: 7011 return ast_node_if(**keywords) 7012 if type == 3: 7013 return ast_node_block(**keywords) 7014 if type == 4: 7015 return ast_node_mark(**keywords) 7016 if type == 5: 7017 return ast_node_user(**keywords) 7018 raise Error 7019 return super(ast_node, cls).__new__(cls) 7020 def __str__(arg0): 7021 try: 7022 if not arg0.__class__ is ast_node: 7023 arg0 = ast_node(arg0) 7024 except: 7025 raise 7026 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7027 res = cast(ptr, c_char_p).value.decode('ascii') 7028 libc.free(ptr) 7029 return res 7030 def __repr__(self): 7031 s = str(self) 7032 if '"' in s: 7033 return 'isl.ast_node("""%s""")' % s 7034 else: 7035 return 'isl.ast_node("%s")' % s 7036 def map_descendant_bottom_up(arg0, arg1): 7037 try: 7038 if not arg0.__class__ is ast_node: 7039 arg0 = ast_node(arg0) 7040 except: 7041 raise 7042 exc_info = [None] 7043 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p) 7044 def cb_func(cb_arg0, cb_arg1): 7045 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 7046 try: 7047 res = arg1(cb_arg0) 7048 except BaseException as e: 7049 exc_info[0] = e 7050 return None 7051 return isl.isl_ast_node_copy(res.ptr) 7052 cb1 = fn(cb_func) 7053 ctx = arg0.ctx 7054 res = isl.isl_ast_node_map_descendant_bottom_up(isl.isl_ast_node_copy(arg0.ptr), cb1, None) 7055 if exc_info[0] is not None: 7056 raise exc_info[0] 7057 obj = ast_node(ctx=ctx, ptr=res) 7058 return obj 7059 def to_C_str(arg0): 7060 try: 7061 if not arg0.__class__ is ast_node: 7062 arg0 = ast_node(arg0) 7063 except: 7064 raise 7065 ctx = arg0.ctx 7066 res = isl.isl_ast_node_to_C_str(arg0.ptr) 7067 if res == 0: 7068 raise Error 7069 string = cast(res, c_char_p).value.decode('ascii') 7070 libc.free(res) 7071 return string 7072 def to_list(arg0): 7073 try: 7074 if not arg0.__class__ is ast_node: 7075 arg0 = ast_node(arg0) 7076 except: 7077 raise 7078 ctx = arg0.ctx 7079 res = isl.isl_ast_node_to_list(isl.isl_ast_node_copy(arg0.ptr)) 7080 obj = ast_node_list(ctx=ctx, ptr=res) 7081 return obj 7082 7083isl.isl_ast_node_map_descendant_bottom_up.restype = c_void_p 7084isl.isl_ast_node_map_descendant_bottom_up.argtypes = [c_void_p, c_void_p, c_void_p] 7085isl.isl_ast_node_to_C_str.restype = POINTER(c_char) 7086isl.isl_ast_node_to_C_str.argtypes = [c_void_p] 7087isl.isl_ast_node_to_list.restype = c_void_p 7088isl.isl_ast_node_to_list.argtypes = [c_void_p] 7089isl.isl_ast_node_copy.restype = c_void_p 7090isl.isl_ast_node_copy.argtypes = [c_void_p] 7091isl.isl_ast_node_free.restype = c_void_p 7092isl.isl_ast_node_free.argtypes = [c_void_p] 7093isl.isl_ast_node_to_str.restype = POINTER(c_char) 7094isl.isl_ast_node_to_str.argtypes = [c_void_p] 7095isl.isl_ast_node_get_type.argtypes = [c_void_p] 7096 7097class ast_node_block(ast_node): 7098 def __init__(self, *args, **keywords): 7099 if "ptr" in keywords: 7100 self.ctx = keywords["ctx"] 7101 self.ptr = keywords["ptr"] 7102 return 7103 if len(args) == 1 and args[0].__class__ is ast_node_list: 7104 self.ctx = Context.getDefaultInstance() 7105 self.ptr = isl.isl_ast_node_block_from_children(isl.isl_ast_node_list_copy(args[0].ptr)) 7106 return 7107 raise Error 7108 def __del__(self): 7109 if hasattr(self, 'ptr'): 7110 isl.isl_ast_node_free(self.ptr) 7111 def __new__(cls, *args, **keywords): 7112 return super(ast_node_block, cls).__new__(cls) 7113 def __str__(arg0): 7114 try: 7115 if not arg0.__class__ is ast_node_block: 7116 arg0 = ast_node_block(arg0) 7117 except: 7118 raise 7119 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7120 res = cast(ptr, c_char_p).value.decode('ascii') 7121 libc.free(ptr) 7122 return res 7123 def __repr__(self): 7124 s = str(self) 7125 if '"' in s: 7126 return 'isl.ast_node_block("""%s""")' % s 7127 else: 7128 return 'isl.ast_node_block("%s")' % s 7129 def children(arg0): 7130 try: 7131 if not arg0.__class__ is ast_node: 7132 arg0 = ast_node(arg0) 7133 except: 7134 raise 7135 ctx = arg0.ctx 7136 res = isl.isl_ast_node_block_get_children(arg0.ptr) 7137 obj = ast_node_list(ctx=ctx, ptr=res) 7138 return obj 7139 def get_children(arg0): 7140 return arg0.children() 7141 7142isl.isl_ast_node_block_from_children.restype = c_void_p 7143isl.isl_ast_node_block_from_children.argtypes = [c_void_p] 7144isl.isl_ast_node_block_get_children.restype = c_void_p 7145isl.isl_ast_node_block_get_children.argtypes = [c_void_p] 7146isl.isl_ast_node_copy.restype = c_void_p 7147isl.isl_ast_node_copy.argtypes = [c_void_p] 7148isl.isl_ast_node_free.restype = c_void_p 7149isl.isl_ast_node_free.argtypes = [c_void_p] 7150isl.isl_ast_node_to_str.restype = POINTER(c_char) 7151isl.isl_ast_node_to_str.argtypes = [c_void_p] 7152 7153class ast_node_for(ast_node): 7154 def __init__(self, *args, **keywords): 7155 if "ptr" in keywords: 7156 self.ctx = keywords["ctx"] 7157 self.ptr = keywords["ptr"] 7158 return 7159 raise Error 7160 def __del__(self): 7161 if hasattr(self, 'ptr'): 7162 isl.isl_ast_node_free(self.ptr) 7163 def __new__(cls, *args, **keywords): 7164 return super(ast_node_for, cls).__new__(cls) 7165 def __str__(arg0): 7166 try: 7167 if not arg0.__class__ is ast_node_for: 7168 arg0 = ast_node_for(arg0) 7169 except: 7170 raise 7171 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7172 res = cast(ptr, c_char_p).value.decode('ascii') 7173 libc.free(ptr) 7174 return res 7175 def __repr__(self): 7176 s = str(self) 7177 if '"' in s: 7178 return 'isl.ast_node_for("""%s""")' % s 7179 else: 7180 return 'isl.ast_node_for("%s")' % s 7181 def body(arg0): 7182 try: 7183 if not arg0.__class__ is ast_node: 7184 arg0 = ast_node(arg0) 7185 except: 7186 raise 7187 ctx = arg0.ctx 7188 res = isl.isl_ast_node_for_get_body(arg0.ptr) 7189 obj = ast_node(ctx=ctx, ptr=res) 7190 return obj 7191 def get_body(arg0): 7192 return arg0.body() 7193 def cond(arg0): 7194 try: 7195 if not arg0.__class__ is ast_node: 7196 arg0 = ast_node(arg0) 7197 except: 7198 raise 7199 ctx = arg0.ctx 7200 res = isl.isl_ast_node_for_get_cond(arg0.ptr) 7201 obj = ast_expr(ctx=ctx, ptr=res) 7202 return obj 7203 def get_cond(arg0): 7204 return arg0.cond() 7205 def inc(arg0): 7206 try: 7207 if not arg0.__class__ is ast_node: 7208 arg0 = ast_node(arg0) 7209 except: 7210 raise 7211 ctx = arg0.ctx 7212 res = isl.isl_ast_node_for_get_inc(arg0.ptr) 7213 obj = ast_expr(ctx=ctx, ptr=res) 7214 return obj 7215 def get_inc(arg0): 7216 return arg0.inc() 7217 def init(arg0): 7218 try: 7219 if not arg0.__class__ is ast_node: 7220 arg0 = ast_node(arg0) 7221 except: 7222 raise 7223 ctx = arg0.ctx 7224 res = isl.isl_ast_node_for_get_init(arg0.ptr) 7225 obj = ast_expr(ctx=ctx, ptr=res) 7226 return obj 7227 def get_init(arg0): 7228 return arg0.init() 7229 def is_degenerate(arg0): 7230 try: 7231 if not arg0.__class__ is ast_node: 7232 arg0 = ast_node(arg0) 7233 except: 7234 raise 7235 ctx = arg0.ctx 7236 res = isl.isl_ast_node_for_is_degenerate(arg0.ptr) 7237 if res < 0: 7238 raise Error 7239 return bool(res) 7240 def iterator(arg0): 7241 try: 7242 if not arg0.__class__ is ast_node: 7243 arg0 = ast_node(arg0) 7244 except: 7245 raise 7246 ctx = arg0.ctx 7247 res = isl.isl_ast_node_for_get_iterator(arg0.ptr) 7248 obj = ast_expr(ctx=ctx, ptr=res) 7249 return obj 7250 def get_iterator(arg0): 7251 return arg0.iterator() 7252 7253isl.isl_ast_node_for_get_body.restype = c_void_p 7254isl.isl_ast_node_for_get_body.argtypes = [c_void_p] 7255isl.isl_ast_node_for_get_cond.restype = c_void_p 7256isl.isl_ast_node_for_get_cond.argtypes = [c_void_p] 7257isl.isl_ast_node_for_get_inc.restype = c_void_p 7258isl.isl_ast_node_for_get_inc.argtypes = [c_void_p] 7259isl.isl_ast_node_for_get_init.restype = c_void_p 7260isl.isl_ast_node_for_get_init.argtypes = [c_void_p] 7261isl.isl_ast_node_for_is_degenerate.argtypes = [c_void_p] 7262isl.isl_ast_node_for_get_iterator.restype = c_void_p 7263isl.isl_ast_node_for_get_iterator.argtypes = [c_void_p] 7264isl.isl_ast_node_copy.restype = c_void_p 7265isl.isl_ast_node_copy.argtypes = [c_void_p] 7266isl.isl_ast_node_free.restype = c_void_p 7267isl.isl_ast_node_free.argtypes = [c_void_p] 7268isl.isl_ast_node_to_str.restype = POINTER(c_char) 7269isl.isl_ast_node_to_str.argtypes = [c_void_p] 7270 7271class ast_node_if(ast_node): 7272 def __init__(self, *args, **keywords): 7273 if "ptr" in keywords: 7274 self.ctx = keywords["ctx"] 7275 self.ptr = keywords["ptr"] 7276 return 7277 raise Error 7278 def __del__(self): 7279 if hasattr(self, 'ptr'): 7280 isl.isl_ast_node_free(self.ptr) 7281 def __new__(cls, *args, **keywords): 7282 return super(ast_node_if, cls).__new__(cls) 7283 def __str__(arg0): 7284 try: 7285 if not arg0.__class__ is ast_node_if: 7286 arg0 = ast_node_if(arg0) 7287 except: 7288 raise 7289 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7290 res = cast(ptr, c_char_p).value.decode('ascii') 7291 libc.free(ptr) 7292 return res 7293 def __repr__(self): 7294 s = str(self) 7295 if '"' in s: 7296 return 'isl.ast_node_if("""%s""")' % s 7297 else: 7298 return 'isl.ast_node_if("%s")' % s 7299 def cond(arg0): 7300 try: 7301 if not arg0.__class__ is ast_node: 7302 arg0 = ast_node(arg0) 7303 except: 7304 raise 7305 ctx = arg0.ctx 7306 res = isl.isl_ast_node_if_get_cond(arg0.ptr) 7307 obj = ast_expr(ctx=ctx, ptr=res) 7308 return obj 7309 def get_cond(arg0): 7310 return arg0.cond() 7311 def else_node(arg0): 7312 try: 7313 if not arg0.__class__ is ast_node: 7314 arg0 = ast_node(arg0) 7315 except: 7316 raise 7317 ctx = arg0.ctx 7318 res = isl.isl_ast_node_if_get_else_node(arg0.ptr) 7319 obj = ast_node(ctx=ctx, ptr=res) 7320 return obj 7321 def get_else_node(arg0): 7322 return arg0.else_node() 7323 def has_else_node(arg0): 7324 try: 7325 if not arg0.__class__ is ast_node: 7326 arg0 = ast_node(arg0) 7327 except: 7328 raise 7329 ctx = arg0.ctx 7330 res = isl.isl_ast_node_if_has_else_node(arg0.ptr) 7331 if res < 0: 7332 raise Error 7333 return bool(res) 7334 def then_node(arg0): 7335 try: 7336 if not arg0.__class__ is ast_node: 7337 arg0 = ast_node(arg0) 7338 except: 7339 raise 7340 ctx = arg0.ctx 7341 res = isl.isl_ast_node_if_get_then_node(arg0.ptr) 7342 obj = ast_node(ctx=ctx, ptr=res) 7343 return obj 7344 def get_then_node(arg0): 7345 return arg0.then_node() 7346 7347isl.isl_ast_node_if_get_cond.restype = c_void_p 7348isl.isl_ast_node_if_get_cond.argtypes = [c_void_p] 7349isl.isl_ast_node_if_get_else_node.restype = c_void_p 7350isl.isl_ast_node_if_get_else_node.argtypes = [c_void_p] 7351isl.isl_ast_node_if_has_else_node.argtypes = [c_void_p] 7352isl.isl_ast_node_if_get_then_node.restype = c_void_p 7353isl.isl_ast_node_if_get_then_node.argtypes = [c_void_p] 7354isl.isl_ast_node_copy.restype = c_void_p 7355isl.isl_ast_node_copy.argtypes = [c_void_p] 7356isl.isl_ast_node_free.restype = c_void_p 7357isl.isl_ast_node_free.argtypes = [c_void_p] 7358isl.isl_ast_node_to_str.restype = POINTER(c_char) 7359isl.isl_ast_node_to_str.argtypes = [c_void_p] 7360 7361class ast_node_list(object): 7362 def __init__(self, *args, **keywords): 7363 if "ptr" in keywords: 7364 self.ctx = keywords["ctx"] 7365 self.ptr = keywords["ptr"] 7366 return 7367 if len(args) == 1 and type(args[0]) == int: 7368 self.ctx = Context.getDefaultInstance() 7369 self.ptr = isl.isl_ast_node_list_alloc(self.ctx, args[0]) 7370 return 7371 if len(args) == 1 and args[0].__class__ is ast_node: 7372 self.ctx = Context.getDefaultInstance() 7373 self.ptr = isl.isl_ast_node_list_from_ast_node(isl.isl_ast_node_copy(args[0].ptr)) 7374 return 7375 raise Error 7376 def __del__(self): 7377 if hasattr(self, 'ptr'): 7378 isl.isl_ast_node_list_free(self.ptr) 7379 def __str__(arg0): 7380 try: 7381 if not arg0.__class__ is ast_node_list: 7382 arg0 = ast_node_list(arg0) 7383 except: 7384 raise 7385 ptr = isl.isl_ast_node_list_to_str(arg0.ptr) 7386 res = cast(ptr, c_char_p).value.decode('ascii') 7387 libc.free(ptr) 7388 return res 7389 def __repr__(self): 7390 s = str(self) 7391 if '"' in s: 7392 return 'isl.ast_node_list("""%s""")' % s 7393 else: 7394 return 'isl.ast_node_list("%s")' % s 7395 def add(arg0, arg1): 7396 try: 7397 if not arg0.__class__ is ast_node_list: 7398 arg0 = ast_node_list(arg0) 7399 except: 7400 raise 7401 try: 7402 if not arg1.__class__ is ast_node: 7403 arg1 = ast_node(arg1) 7404 except: 7405 raise 7406 ctx = arg0.ctx 7407 res = isl.isl_ast_node_list_add(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_copy(arg1.ptr)) 7408 obj = ast_node_list(ctx=ctx, ptr=res) 7409 return obj 7410 def at(arg0, arg1): 7411 try: 7412 if not arg0.__class__ is ast_node_list: 7413 arg0 = ast_node_list(arg0) 7414 except: 7415 raise 7416 ctx = arg0.ctx 7417 res = isl.isl_ast_node_list_get_at(arg0.ptr, arg1) 7418 obj = ast_node(ctx=ctx, ptr=res) 7419 return obj 7420 def get_at(arg0, arg1): 7421 return arg0.at(arg1) 7422 def clear(arg0): 7423 try: 7424 if not arg0.__class__ is ast_node_list: 7425 arg0 = ast_node_list(arg0) 7426 except: 7427 raise 7428 ctx = arg0.ctx 7429 res = isl.isl_ast_node_list_clear(isl.isl_ast_node_list_copy(arg0.ptr)) 7430 obj = ast_node_list(ctx=ctx, ptr=res) 7431 return obj 7432 def concat(arg0, arg1): 7433 try: 7434 if not arg0.__class__ is ast_node_list: 7435 arg0 = ast_node_list(arg0) 7436 except: 7437 raise 7438 try: 7439 if not arg1.__class__ is ast_node_list: 7440 arg1 = ast_node_list(arg1) 7441 except: 7442 raise 7443 ctx = arg0.ctx 7444 res = isl.isl_ast_node_list_concat(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_list_copy(arg1.ptr)) 7445 obj = ast_node_list(ctx=ctx, ptr=res) 7446 return obj 7447 def drop(arg0, arg1, arg2): 7448 try: 7449 if not arg0.__class__ is ast_node_list: 7450 arg0 = ast_node_list(arg0) 7451 except: 7452 raise 7453 ctx = arg0.ctx 7454 res = isl.isl_ast_node_list_drop(isl.isl_ast_node_list_copy(arg0.ptr), arg1, arg2) 7455 obj = ast_node_list(ctx=ctx, ptr=res) 7456 return obj 7457 def foreach(arg0, arg1): 7458 try: 7459 if not arg0.__class__ is ast_node_list: 7460 arg0 = ast_node_list(arg0) 7461 except: 7462 raise 7463 exc_info = [None] 7464 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7465 def cb_func(cb_arg0, cb_arg1): 7466 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 7467 try: 7468 arg1(cb_arg0) 7469 except BaseException as e: 7470 exc_info[0] = e 7471 return -1 7472 return 0 7473 cb1 = fn(cb_func) 7474 ctx = arg0.ctx 7475 res = isl.isl_ast_node_list_foreach(arg0.ptr, cb1, None) 7476 if exc_info[0] is not None: 7477 raise exc_info[0] 7478 if res < 0: 7479 raise Error 7480 def foreach_scc(arg0, arg1, arg2): 7481 try: 7482 if not arg0.__class__ is ast_node_list: 7483 arg0 = ast_node_list(arg0) 7484 except: 7485 raise 7486 exc_info = [None] 7487 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 7488 def cb_func(cb_arg0, cb_arg1, cb_arg2): 7489 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=isl.isl_ast_node_copy(cb_arg0)) 7490 cb_arg1 = ast_node(ctx=arg0.ctx, ptr=isl.isl_ast_node_copy(cb_arg1)) 7491 try: 7492 res = arg1(cb_arg0, cb_arg1) 7493 except BaseException as e: 7494 exc_info[0] = e 7495 return -1 7496 return 1 if res else 0 7497 cb1 = fn(cb_func) 7498 exc_info = [None] 7499 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7500 def cb_func(cb_arg0, cb_arg1): 7501 cb_arg0 = ast_node_list(ctx=arg0.ctx, ptr=(cb_arg0)) 7502 try: 7503 arg2(cb_arg0) 7504 except BaseException as e: 7505 exc_info[0] = e 7506 return -1 7507 return 0 7508 cb2 = fn(cb_func) 7509 ctx = arg0.ctx 7510 res = isl.isl_ast_node_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 7511 if exc_info[0] is not None: 7512 raise exc_info[0] 7513 if res < 0: 7514 raise Error 7515 def insert(arg0, arg1, arg2): 7516 try: 7517 if not arg0.__class__ is ast_node_list: 7518 arg0 = ast_node_list(arg0) 7519 except: 7520 raise 7521 try: 7522 if not arg2.__class__ is ast_node: 7523 arg2 = ast_node(arg2) 7524 except: 7525 raise 7526 ctx = arg0.ctx 7527 res = isl.isl_ast_node_list_insert(isl.isl_ast_node_list_copy(arg0.ptr), arg1, isl.isl_ast_node_copy(arg2.ptr)) 7528 obj = ast_node_list(ctx=ctx, ptr=res) 7529 return obj 7530 def set_at(arg0, arg1, arg2): 7531 try: 7532 if not arg0.__class__ is ast_node_list: 7533 arg0 = ast_node_list(arg0) 7534 except: 7535 raise 7536 try: 7537 if not arg2.__class__ is ast_node: 7538 arg2 = ast_node(arg2) 7539 except: 7540 raise 7541 ctx = arg0.ctx 7542 res = isl.isl_ast_node_list_set_at(isl.isl_ast_node_list_copy(arg0.ptr), arg1, isl.isl_ast_node_copy(arg2.ptr)) 7543 obj = ast_node_list(ctx=ctx, ptr=res) 7544 return obj 7545 def size(arg0): 7546 try: 7547 if not arg0.__class__ is ast_node_list: 7548 arg0 = ast_node_list(arg0) 7549 except: 7550 raise 7551 ctx = arg0.ctx 7552 res = isl.isl_ast_node_list_size(arg0.ptr) 7553 if res < 0: 7554 raise Error 7555 return int(res) 7556 7557isl.isl_ast_node_list_alloc.restype = c_void_p 7558isl.isl_ast_node_list_alloc.argtypes = [Context, c_int] 7559isl.isl_ast_node_list_from_ast_node.restype = c_void_p 7560isl.isl_ast_node_list_from_ast_node.argtypes = [c_void_p] 7561isl.isl_ast_node_list_add.restype = c_void_p 7562isl.isl_ast_node_list_add.argtypes = [c_void_p, c_void_p] 7563isl.isl_ast_node_list_get_at.restype = c_void_p 7564isl.isl_ast_node_list_get_at.argtypes = [c_void_p, c_int] 7565isl.isl_ast_node_list_clear.restype = c_void_p 7566isl.isl_ast_node_list_clear.argtypes = [c_void_p] 7567isl.isl_ast_node_list_concat.restype = c_void_p 7568isl.isl_ast_node_list_concat.argtypes = [c_void_p, c_void_p] 7569isl.isl_ast_node_list_drop.restype = c_void_p 7570isl.isl_ast_node_list_drop.argtypes = [c_void_p, c_int, c_int] 7571isl.isl_ast_node_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 7572isl.isl_ast_node_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 7573isl.isl_ast_node_list_insert.restype = c_void_p 7574isl.isl_ast_node_list_insert.argtypes = [c_void_p, c_int, c_void_p] 7575isl.isl_ast_node_list_set_at.restype = c_void_p 7576isl.isl_ast_node_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 7577isl.isl_ast_node_list_size.argtypes = [c_void_p] 7578isl.isl_ast_node_list_copy.restype = c_void_p 7579isl.isl_ast_node_list_copy.argtypes = [c_void_p] 7580isl.isl_ast_node_list_free.restype = c_void_p 7581isl.isl_ast_node_list_free.argtypes = [c_void_p] 7582isl.isl_ast_node_list_to_str.restype = POINTER(c_char) 7583isl.isl_ast_node_list_to_str.argtypes = [c_void_p] 7584 7585class ast_node_mark(ast_node): 7586 def __init__(self, *args, **keywords): 7587 if "ptr" in keywords: 7588 self.ctx = keywords["ctx"] 7589 self.ptr = keywords["ptr"] 7590 return 7591 raise Error 7592 def __del__(self): 7593 if hasattr(self, 'ptr'): 7594 isl.isl_ast_node_free(self.ptr) 7595 def __new__(cls, *args, **keywords): 7596 return super(ast_node_mark, cls).__new__(cls) 7597 def __str__(arg0): 7598 try: 7599 if not arg0.__class__ is ast_node_mark: 7600 arg0 = ast_node_mark(arg0) 7601 except: 7602 raise 7603 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7604 res = cast(ptr, c_char_p).value.decode('ascii') 7605 libc.free(ptr) 7606 return res 7607 def __repr__(self): 7608 s = str(self) 7609 if '"' in s: 7610 return 'isl.ast_node_mark("""%s""")' % s 7611 else: 7612 return 'isl.ast_node_mark("%s")' % s 7613 def id(arg0): 7614 try: 7615 if not arg0.__class__ is ast_node: 7616 arg0 = ast_node(arg0) 7617 except: 7618 raise 7619 ctx = arg0.ctx 7620 res = isl.isl_ast_node_mark_get_id(arg0.ptr) 7621 obj = id(ctx=ctx, ptr=res) 7622 return obj 7623 def get_id(arg0): 7624 return arg0.id() 7625 def node(arg0): 7626 try: 7627 if not arg0.__class__ is ast_node: 7628 arg0 = ast_node(arg0) 7629 except: 7630 raise 7631 ctx = arg0.ctx 7632 res = isl.isl_ast_node_mark_get_node(arg0.ptr) 7633 obj = ast_node(ctx=ctx, ptr=res) 7634 return obj 7635 def get_node(arg0): 7636 return arg0.node() 7637 7638isl.isl_ast_node_mark_get_id.restype = c_void_p 7639isl.isl_ast_node_mark_get_id.argtypes = [c_void_p] 7640isl.isl_ast_node_mark_get_node.restype = c_void_p 7641isl.isl_ast_node_mark_get_node.argtypes = [c_void_p] 7642isl.isl_ast_node_copy.restype = c_void_p 7643isl.isl_ast_node_copy.argtypes = [c_void_p] 7644isl.isl_ast_node_free.restype = c_void_p 7645isl.isl_ast_node_free.argtypes = [c_void_p] 7646isl.isl_ast_node_to_str.restype = POINTER(c_char) 7647isl.isl_ast_node_to_str.argtypes = [c_void_p] 7648 7649class ast_node_user(ast_node): 7650 def __init__(self, *args, **keywords): 7651 if "ptr" in keywords: 7652 self.ctx = keywords["ctx"] 7653 self.ptr = keywords["ptr"] 7654 return 7655 if len(args) == 1 and args[0].__class__ is ast_expr: 7656 self.ctx = Context.getDefaultInstance() 7657 self.ptr = isl.isl_ast_node_user_from_expr(isl.isl_ast_expr_copy(args[0].ptr)) 7658 return 7659 raise Error 7660 def __del__(self): 7661 if hasattr(self, 'ptr'): 7662 isl.isl_ast_node_free(self.ptr) 7663 def __new__(cls, *args, **keywords): 7664 return super(ast_node_user, cls).__new__(cls) 7665 def __str__(arg0): 7666 try: 7667 if not arg0.__class__ is ast_node_user: 7668 arg0 = ast_node_user(arg0) 7669 except: 7670 raise 7671 ptr = isl.isl_ast_node_to_str(arg0.ptr) 7672 res = cast(ptr, c_char_p).value.decode('ascii') 7673 libc.free(ptr) 7674 return res 7675 def __repr__(self): 7676 s = str(self) 7677 if '"' in s: 7678 return 'isl.ast_node_user("""%s""")' % s 7679 else: 7680 return 'isl.ast_node_user("%s")' % s 7681 def expr(arg0): 7682 try: 7683 if not arg0.__class__ is ast_node: 7684 arg0 = ast_node(arg0) 7685 except: 7686 raise 7687 ctx = arg0.ctx 7688 res = isl.isl_ast_node_user_get_expr(arg0.ptr) 7689 obj = ast_expr(ctx=ctx, ptr=res) 7690 return obj 7691 def get_expr(arg0): 7692 return arg0.expr() 7693 7694isl.isl_ast_node_user_from_expr.restype = c_void_p 7695isl.isl_ast_node_user_from_expr.argtypes = [c_void_p] 7696isl.isl_ast_node_user_get_expr.restype = c_void_p 7697isl.isl_ast_node_user_get_expr.argtypes = [c_void_p] 7698isl.isl_ast_node_copy.restype = c_void_p 7699isl.isl_ast_node_copy.argtypes = [c_void_p] 7700isl.isl_ast_node_free.restype = c_void_p 7701isl.isl_ast_node_free.argtypes = [c_void_p] 7702isl.isl_ast_node_to_str.restype = POINTER(c_char) 7703isl.isl_ast_node_to_str.argtypes = [c_void_p] 7704 7705class union_map(object): 7706 def __init__(self, *args, **keywords): 7707 if "ptr" in keywords: 7708 self.ctx = keywords["ctx"] 7709 self.ptr = keywords["ptr"] 7710 return 7711 if len(args) == 1 and args[0].__class__ is basic_map: 7712 self.ctx = Context.getDefaultInstance() 7713 self.ptr = isl.isl_union_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 7714 return 7715 if len(args) == 1 and args[0].__class__ is map: 7716 self.ctx = Context.getDefaultInstance() 7717 self.ptr = isl.isl_union_map_from_map(isl.isl_map_copy(args[0].ptr)) 7718 return 7719 if len(args) == 1 and type(args[0]) == str: 7720 self.ctx = Context.getDefaultInstance() 7721 self.ptr = isl.isl_union_map_read_from_str(self.ctx, args[0].encode('ascii')) 7722 return 7723 raise Error 7724 def __del__(self): 7725 if hasattr(self, 'ptr'): 7726 isl.isl_union_map_free(self.ptr) 7727 def __str__(arg0): 7728 try: 7729 if not arg0.__class__ is union_map: 7730 arg0 = union_map(arg0) 7731 except: 7732 raise 7733 ptr = isl.isl_union_map_to_str(arg0.ptr) 7734 res = cast(ptr, c_char_p).value.decode('ascii') 7735 libc.free(ptr) 7736 return res 7737 def __repr__(self): 7738 s = str(self) 7739 if '"' in s: 7740 return 'isl.union_map("""%s""")' % s 7741 else: 7742 return 'isl.union_map("%s")' % s 7743 def affine_hull(arg0): 7744 try: 7745 if not arg0.__class__ is union_map: 7746 arg0 = union_map(arg0) 7747 except: 7748 raise 7749 ctx = arg0.ctx 7750 res = isl.isl_union_map_affine_hull(isl.isl_union_map_copy(arg0.ptr)) 7751 obj = union_map(ctx=ctx, ptr=res) 7752 return obj 7753 def apply_domain(arg0, arg1): 7754 try: 7755 if not arg0.__class__ is union_map: 7756 arg0 = union_map(arg0) 7757 except: 7758 raise 7759 try: 7760 if not arg1.__class__ is union_map: 7761 arg1 = union_map(arg1) 7762 except: 7763 raise 7764 ctx = arg0.ctx 7765 res = isl.isl_union_map_apply_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7766 obj = union_map(ctx=ctx, ptr=res) 7767 return obj 7768 def apply_range(arg0, arg1): 7769 try: 7770 if not arg0.__class__ is union_map: 7771 arg0 = union_map(arg0) 7772 except: 7773 raise 7774 try: 7775 if not arg1.__class__ is union_map: 7776 arg1 = union_map(arg1) 7777 except: 7778 raise 7779 ctx = arg0.ctx 7780 res = isl.isl_union_map_apply_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7781 obj = union_map(ctx=ctx, ptr=res) 7782 return obj 7783 def as_map(arg0): 7784 try: 7785 if not arg0.__class__ is union_map: 7786 arg0 = union_map(arg0) 7787 except: 7788 raise 7789 ctx = arg0.ctx 7790 res = isl.isl_union_map_as_map(isl.isl_union_map_copy(arg0.ptr)) 7791 obj = map(ctx=ctx, ptr=res) 7792 return obj 7793 def as_multi_union_pw_aff(arg0): 7794 try: 7795 if not arg0.__class__ is union_map: 7796 arg0 = union_map(arg0) 7797 except: 7798 raise 7799 ctx = arg0.ctx 7800 res = isl.isl_union_map_as_multi_union_pw_aff(isl.isl_union_map_copy(arg0.ptr)) 7801 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 7802 return obj 7803 def as_union_pw_multi_aff(arg0): 7804 try: 7805 if not arg0.__class__ is union_map: 7806 arg0 = union_map(arg0) 7807 except: 7808 raise 7809 ctx = arg0.ctx 7810 res = isl.isl_union_map_as_union_pw_multi_aff(isl.isl_union_map_copy(arg0.ptr)) 7811 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 7812 return obj 7813 def bind_range(arg0, arg1): 7814 try: 7815 if not arg0.__class__ is union_map: 7816 arg0 = union_map(arg0) 7817 except: 7818 raise 7819 try: 7820 if not arg1.__class__ is multi_id: 7821 arg1 = multi_id(arg1) 7822 except: 7823 raise 7824 ctx = arg0.ctx 7825 res = isl.isl_union_map_bind_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 7826 obj = union_set(ctx=ctx, ptr=res) 7827 return obj 7828 def coalesce(arg0): 7829 try: 7830 if not arg0.__class__ is union_map: 7831 arg0 = union_map(arg0) 7832 except: 7833 raise 7834 ctx = arg0.ctx 7835 res = isl.isl_union_map_coalesce(isl.isl_union_map_copy(arg0.ptr)) 7836 obj = union_map(ctx=ctx, ptr=res) 7837 return obj 7838 def compute_divs(arg0): 7839 try: 7840 if not arg0.__class__ is union_map: 7841 arg0 = union_map(arg0) 7842 except: 7843 raise 7844 ctx = arg0.ctx 7845 res = isl.isl_union_map_compute_divs(isl.isl_union_map_copy(arg0.ptr)) 7846 obj = union_map(ctx=ctx, ptr=res) 7847 return obj 7848 def curry(arg0): 7849 try: 7850 if not arg0.__class__ is union_map: 7851 arg0 = union_map(arg0) 7852 except: 7853 raise 7854 ctx = arg0.ctx 7855 res = isl.isl_union_map_curry(isl.isl_union_map_copy(arg0.ptr)) 7856 obj = union_map(ctx=ctx, ptr=res) 7857 return obj 7858 def deltas(arg0): 7859 try: 7860 if not arg0.__class__ is union_map: 7861 arg0 = union_map(arg0) 7862 except: 7863 raise 7864 ctx = arg0.ctx 7865 res = isl.isl_union_map_deltas(isl.isl_union_map_copy(arg0.ptr)) 7866 obj = union_set(ctx=ctx, ptr=res) 7867 return obj 7868 def detect_equalities(arg0): 7869 try: 7870 if not arg0.__class__ is union_map: 7871 arg0 = union_map(arg0) 7872 except: 7873 raise 7874 ctx = arg0.ctx 7875 res = isl.isl_union_map_detect_equalities(isl.isl_union_map_copy(arg0.ptr)) 7876 obj = union_map(ctx=ctx, ptr=res) 7877 return obj 7878 def domain(arg0): 7879 try: 7880 if not arg0.__class__ is union_map: 7881 arg0 = union_map(arg0) 7882 except: 7883 raise 7884 ctx = arg0.ctx 7885 res = isl.isl_union_map_domain(isl.isl_union_map_copy(arg0.ptr)) 7886 obj = union_set(ctx=ctx, ptr=res) 7887 return obj 7888 def domain_factor_domain(arg0): 7889 try: 7890 if not arg0.__class__ is union_map: 7891 arg0 = union_map(arg0) 7892 except: 7893 raise 7894 ctx = arg0.ctx 7895 res = isl.isl_union_map_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 7896 obj = union_map(ctx=ctx, ptr=res) 7897 return obj 7898 def domain_factor_range(arg0): 7899 try: 7900 if not arg0.__class__ is union_map: 7901 arg0 = union_map(arg0) 7902 except: 7903 raise 7904 ctx = arg0.ctx 7905 res = isl.isl_union_map_domain_factor_range(isl.isl_union_map_copy(arg0.ptr)) 7906 obj = union_map(ctx=ctx, ptr=res) 7907 return obj 7908 def domain_map(arg0): 7909 try: 7910 if not arg0.__class__ is union_map: 7911 arg0 = union_map(arg0) 7912 except: 7913 raise 7914 ctx = arg0.ctx 7915 res = isl.isl_union_map_domain_map(isl.isl_union_map_copy(arg0.ptr)) 7916 obj = union_map(ctx=ctx, ptr=res) 7917 return obj 7918 def domain_map_union_pw_multi_aff(arg0): 7919 try: 7920 if not arg0.__class__ is union_map: 7921 arg0 = union_map(arg0) 7922 except: 7923 raise 7924 ctx = arg0.ctx 7925 res = isl.isl_union_map_domain_map_union_pw_multi_aff(isl.isl_union_map_copy(arg0.ptr)) 7926 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 7927 return obj 7928 def domain_product(arg0, arg1): 7929 try: 7930 if not arg0.__class__ is union_map: 7931 arg0 = union_map(arg0) 7932 except: 7933 raise 7934 try: 7935 if not arg1.__class__ is union_map: 7936 arg1 = union_map(arg1) 7937 except: 7938 raise 7939 ctx = arg0.ctx 7940 res = isl.isl_union_map_domain_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7941 obj = union_map(ctx=ctx, ptr=res) 7942 return obj 7943 def domain_reverse(arg0): 7944 try: 7945 if not arg0.__class__ is union_map: 7946 arg0 = union_map(arg0) 7947 except: 7948 raise 7949 ctx = arg0.ctx 7950 res = isl.isl_union_map_domain_reverse(isl.isl_union_map_copy(arg0.ptr)) 7951 obj = union_map(ctx=ctx, ptr=res) 7952 return obj 7953 def drop_unused_params(arg0): 7954 try: 7955 if not arg0.__class__ is union_map: 7956 arg0 = union_map(arg0) 7957 except: 7958 raise 7959 ctx = arg0.ctx 7960 res = isl.isl_union_map_drop_unused_params(isl.isl_union_map_copy(arg0.ptr)) 7961 obj = union_map(ctx=ctx, ptr=res) 7962 return obj 7963 @staticmethod 7964 def empty(*args): 7965 if len(args) == 0: 7966 ctx = Context.getDefaultInstance() 7967 res = isl.isl_union_map_empty_ctx(ctx) 7968 obj = union_map(ctx=ctx, ptr=res) 7969 return obj 7970 raise Error 7971 def eq_at(*args): 7972 if len(args) == 2 and args[1].__class__ is multi_union_pw_aff: 7973 args = list(args) 7974 try: 7975 if not args[0].__class__ is union_map: 7976 args[0] = union_map(args[0]) 7977 except: 7978 raise 7979 ctx = args[0].ctx 7980 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)) 7981 obj = union_map(ctx=ctx, ptr=res) 7982 return obj 7983 raise Error 7984 def every_map(arg0, arg1): 7985 try: 7986 if not arg0.__class__ is union_map: 7987 arg0 = union_map(arg0) 7988 except: 7989 raise 7990 exc_info = [None] 7991 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7992 def cb_func(cb_arg0, cb_arg1): 7993 cb_arg0 = map(ctx=arg0.ctx, ptr=isl.isl_map_copy(cb_arg0)) 7994 try: 7995 res = arg1(cb_arg0) 7996 except BaseException as e: 7997 exc_info[0] = e 7998 return -1 7999 return 1 if res else 0 8000 cb1 = fn(cb_func) 8001 ctx = arg0.ctx 8002 res = isl.isl_union_map_every_map(arg0.ptr, cb1, None) 8003 if exc_info[0] is not None: 8004 raise exc_info[0] 8005 if res < 0: 8006 raise Error 8007 return bool(res) 8008 def extract_map(arg0, arg1): 8009 try: 8010 if not arg0.__class__ is union_map: 8011 arg0 = union_map(arg0) 8012 except: 8013 raise 8014 try: 8015 if not arg1.__class__ is space: 8016 arg1 = space(arg1) 8017 except: 8018 raise 8019 ctx = arg0.ctx 8020 res = isl.isl_union_map_extract_map(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 8021 obj = map(ctx=ctx, ptr=res) 8022 return obj 8023 def factor_domain(arg0): 8024 try: 8025 if not arg0.__class__ is union_map: 8026 arg0 = union_map(arg0) 8027 except: 8028 raise 8029 ctx = arg0.ctx 8030 res = isl.isl_union_map_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 8031 obj = union_map(ctx=ctx, ptr=res) 8032 return obj 8033 def factor_range(arg0): 8034 try: 8035 if not arg0.__class__ is union_map: 8036 arg0 = union_map(arg0) 8037 except: 8038 raise 8039 ctx = arg0.ctx 8040 res = isl.isl_union_map_factor_range(isl.isl_union_map_copy(arg0.ptr)) 8041 obj = union_map(ctx=ctx, ptr=res) 8042 return obj 8043 def fixed_power(*args): 8044 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 8045 args = list(args) 8046 try: 8047 if not args[0].__class__ is union_map: 8048 args[0] = union_map(args[0]) 8049 except: 8050 raise 8051 try: 8052 if not args[1].__class__ is val: 8053 args[1] = val(args[1]) 8054 except: 8055 raise 8056 ctx = args[0].ctx 8057 res = isl.isl_union_map_fixed_power_val(isl.isl_union_map_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 8058 obj = union_map(ctx=ctx, ptr=res) 8059 return obj 8060 raise Error 8061 def foreach_map(arg0, arg1): 8062 try: 8063 if not arg0.__class__ is union_map: 8064 arg0 = union_map(arg0) 8065 except: 8066 raise 8067 exc_info = [None] 8068 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 8069 def cb_func(cb_arg0, cb_arg1): 8070 cb_arg0 = map(ctx=arg0.ctx, ptr=(cb_arg0)) 8071 try: 8072 arg1(cb_arg0) 8073 except BaseException as e: 8074 exc_info[0] = e 8075 return -1 8076 return 0 8077 cb1 = fn(cb_func) 8078 ctx = arg0.ctx 8079 res = isl.isl_union_map_foreach_map(arg0.ptr, cb1, None) 8080 if exc_info[0] is not None: 8081 raise exc_info[0] 8082 if res < 0: 8083 raise Error 8084 @staticmethod 8085 def convert_from(*args): 8086 if len(args) == 1 and args[0].__class__ is multi_union_pw_aff: 8087 ctx = args[0].ctx 8088 res = isl.isl_union_map_from_multi_union_pw_aff(isl.isl_multi_union_pw_aff_copy(args[0].ptr)) 8089 obj = union_map(ctx=ctx, ptr=res) 8090 return obj 8091 if len(args) == 1 and args[0].__class__ is union_pw_multi_aff: 8092 ctx = args[0].ctx 8093 res = isl.isl_union_map_from_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr)) 8094 obj = union_map(ctx=ctx, ptr=res) 8095 return obj 8096 raise Error 8097 @staticmethod 8098 def from_domain(arg0): 8099 try: 8100 if not arg0.__class__ is union_set: 8101 arg0 = union_set(arg0) 8102 except: 8103 raise 8104 ctx = arg0.ctx 8105 res = isl.isl_union_map_from_domain(isl.isl_union_set_copy(arg0.ptr)) 8106 obj = union_map(ctx=ctx, ptr=res) 8107 return obj 8108 @staticmethod 8109 def from_domain_and_range(arg0, arg1): 8110 try: 8111 if not arg0.__class__ is union_set: 8112 arg0 = union_set(arg0) 8113 except: 8114 raise 8115 try: 8116 if not arg1.__class__ is union_set: 8117 arg1 = union_set(arg1) 8118 except: 8119 raise 8120 ctx = arg0.ctx 8121 res = isl.isl_union_map_from_domain_and_range(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8122 obj = union_map(ctx=ctx, ptr=res) 8123 return obj 8124 @staticmethod 8125 def from_range(arg0): 8126 try: 8127 if not arg0.__class__ is union_set: 8128 arg0 = union_set(arg0) 8129 except: 8130 raise 8131 ctx = arg0.ctx 8132 res = isl.isl_union_map_from_range(isl.isl_union_set_copy(arg0.ptr)) 8133 obj = union_map(ctx=ctx, ptr=res) 8134 return obj 8135 def gist(arg0, arg1): 8136 try: 8137 if not arg0.__class__ is union_map: 8138 arg0 = union_map(arg0) 8139 except: 8140 raise 8141 try: 8142 if not arg1.__class__ is union_map: 8143 arg1 = union_map(arg1) 8144 except: 8145 raise 8146 ctx = arg0.ctx 8147 res = isl.isl_union_map_gist(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8148 obj = union_map(ctx=ctx, ptr=res) 8149 return obj 8150 def gist_domain(arg0, arg1): 8151 try: 8152 if not arg0.__class__ is union_map: 8153 arg0 = union_map(arg0) 8154 except: 8155 raise 8156 try: 8157 if not arg1.__class__ is union_set: 8158 arg1 = union_set(arg1) 8159 except: 8160 raise 8161 ctx = arg0.ctx 8162 res = isl.isl_union_map_gist_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8163 obj = union_map(ctx=ctx, ptr=res) 8164 return obj 8165 def gist_params(arg0, arg1): 8166 try: 8167 if not arg0.__class__ is union_map: 8168 arg0 = union_map(arg0) 8169 except: 8170 raise 8171 try: 8172 if not arg1.__class__ is set: 8173 arg1 = set(arg1) 8174 except: 8175 raise 8176 ctx = arg0.ctx 8177 res = isl.isl_union_map_gist_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8178 obj = union_map(ctx=ctx, ptr=res) 8179 return obj 8180 def gist_range(arg0, arg1): 8181 try: 8182 if not arg0.__class__ is union_map: 8183 arg0 = union_map(arg0) 8184 except: 8185 raise 8186 try: 8187 if not arg1.__class__ is union_set: 8188 arg1 = union_set(arg1) 8189 except: 8190 raise 8191 ctx = arg0.ctx 8192 res = isl.isl_union_map_gist_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8193 obj = union_map(ctx=ctx, ptr=res) 8194 return obj 8195 def intersect(arg0, arg1): 8196 try: 8197 if not arg0.__class__ is union_map: 8198 arg0 = union_map(arg0) 8199 except: 8200 raise 8201 try: 8202 if not arg1.__class__ is union_map: 8203 arg1 = union_map(arg1) 8204 except: 8205 raise 8206 ctx = arg0.ctx 8207 res = isl.isl_union_map_intersect(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8208 obj = union_map(ctx=ctx, ptr=res) 8209 return obj 8210 def intersect_domain(*args): 8211 if len(args) == 2 and args[1].__class__ is space: 8212 args = list(args) 8213 try: 8214 if not args[0].__class__ is union_map: 8215 args[0] = union_map(args[0]) 8216 except: 8217 raise 8218 ctx = args[0].ctx 8219 res = isl.isl_union_map_intersect_domain_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 8220 obj = union_map(ctx=ctx, ptr=res) 8221 return obj 8222 if len(args) == 2 and args[1].__class__ is union_set: 8223 args = list(args) 8224 try: 8225 if not args[0].__class__ is union_map: 8226 args[0] = union_map(args[0]) 8227 except: 8228 raise 8229 ctx = args[0].ctx 8230 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)) 8231 obj = union_map(ctx=ctx, ptr=res) 8232 return obj 8233 raise Error 8234 def intersect_domain_factor_domain(arg0, arg1): 8235 try: 8236 if not arg0.__class__ is union_map: 8237 arg0 = union_map(arg0) 8238 except: 8239 raise 8240 try: 8241 if not arg1.__class__ is union_map: 8242 arg1 = union_map(arg1) 8243 except: 8244 raise 8245 ctx = arg0.ctx 8246 res = isl.isl_union_map_intersect_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8247 obj = union_map(ctx=ctx, ptr=res) 8248 return obj 8249 def intersect_domain_factor_range(arg0, arg1): 8250 try: 8251 if not arg0.__class__ is union_map: 8252 arg0 = union_map(arg0) 8253 except: 8254 raise 8255 try: 8256 if not arg1.__class__ is union_map: 8257 arg1 = union_map(arg1) 8258 except: 8259 raise 8260 ctx = arg0.ctx 8261 res = isl.isl_union_map_intersect_domain_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8262 obj = union_map(ctx=ctx, ptr=res) 8263 return obj 8264 def intersect_domain_wrapped_domain(*args): 8265 if len(args) == 2 and args[1].__class__ is union_set: 8266 args = list(args) 8267 try: 8268 if not args[0].__class__ is union_map: 8269 args[0] = union_map(args[0]) 8270 except: 8271 raise 8272 ctx = args[0].ctx 8273 res = isl.isl_union_map_intersect_domain_wrapped_domain_union_set(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 8274 obj = union_map(ctx=ctx, ptr=res) 8275 return obj 8276 raise Error 8277 def intersect_params(arg0, arg1): 8278 try: 8279 if not arg0.__class__ is union_map: 8280 arg0 = union_map(arg0) 8281 except: 8282 raise 8283 try: 8284 if not arg1.__class__ is set: 8285 arg1 = set(arg1) 8286 except: 8287 raise 8288 ctx = arg0.ctx 8289 res = isl.isl_union_map_intersect_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8290 obj = union_map(ctx=ctx, ptr=res) 8291 return obj 8292 def intersect_range(*args): 8293 if len(args) == 2 and args[1].__class__ is space: 8294 args = list(args) 8295 try: 8296 if not args[0].__class__ is union_map: 8297 args[0] = union_map(args[0]) 8298 except: 8299 raise 8300 ctx = args[0].ctx 8301 res = isl.isl_union_map_intersect_range_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 8302 obj = union_map(ctx=ctx, ptr=res) 8303 return obj 8304 if len(args) == 2 and args[1].__class__ is union_set: 8305 args = list(args) 8306 try: 8307 if not args[0].__class__ is union_map: 8308 args[0] = union_map(args[0]) 8309 except: 8310 raise 8311 ctx = args[0].ctx 8312 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)) 8313 obj = union_map(ctx=ctx, ptr=res) 8314 return obj 8315 raise Error 8316 def intersect_range_factor_domain(arg0, arg1): 8317 try: 8318 if not arg0.__class__ is union_map: 8319 arg0 = union_map(arg0) 8320 except: 8321 raise 8322 try: 8323 if not arg1.__class__ is union_map: 8324 arg1 = union_map(arg1) 8325 except: 8326 raise 8327 ctx = arg0.ctx 8328 res = isl.isl_union_map_intersect_range_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8329 obj = union_map(ctx=ctx, ptr=res) 8330 return obj 8331 def intersect_range_factor_range(arg0, arg1): 8332 try: 8333 if not arg0.__class__ is union_map: 8334 arg0 = union_map(arg0) 8335 except: 8336 raise 8337 try: 8338 if not arg1.__class__ is union_map: 8339 arg1 = union_map(arg1) 8340 except: 8341 raise 8342 ctx = arg0.ctx 8343 res = isl.isl_union_map_intersect_range_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8344 obj = union_map(ctx=ctx, ptr=res) 8345 return obj 8346 def intersect_range_wrapped_domain(*args): 8347 if len(args) == 2 and args[1].__class__ is union_set: 8348 args = list(args) 8349 try: 8350 if not args[0].__class__ is union_map: 8351 args[0] = union_map(args[0]) 8352 except: 8353 raise 8354 ctx = args[0].ctx 8355 res = isl.isl_union_map_intersect_range_wrapped_domain_union_set(isl.isl_union_map_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 8356 obj = union_map(ctx=ctx, ptr=res) 8357 return obj 8358 raise Error 8359 def is_bijective(arg0): 8360 try: 8361 if not arg0.__class__ is union_map: 8362 arg0 = union_map(arg0) 8363 except: 8364 raise 8365 ctx = arg0.ctx 8366 res = isl.isl_union_map_is_bijective(arg0.ptr) 8367 if res < 0: 8368 raise Error 8369 return bool(res) 8370 def is_disjoint(arg0, arg1): 8371 try: 8372 if not arg0.__class__ is union_map: 8373 arg0 = union_map(arg0) 8374 except: 8375 raise 8376 try: 8377 if not arg1.__class__ is union_map: 8378 arg1 = union_map(arg1) 8379 except: 8380 raise 8381 ctx = arg0.ctx 8382 res = isl.isl_union_map_is_disjoint(arg0.ptr, arg1.ptr) 8383 if res < 0: 8384 raise Error 8385 return bool(res) 8386 def is_empty(arg0): 8387 try: 8388 if not arg0.__class__ is union_map: 8389 arg0 = union_map(arg0) 8390 except: 8391 raise 8392 ctx = arg0.ctx 8393 res = isl.isl_union_map_is_empty(arg0.ptr) 8394 if res < 0: 8395 raise Error 8396 return bool(res) 8397 def is_equal(arg0, arg1): 8398 try: 8399 if not arg0.__class__ is union_map: 8400 arg0 = union_map(arg0) 8401 except: 8402 raise 8403 try: 8404 if not arg1.__class__ is union_map: 8405 arg1 = union_map(arg1) 8406 except: 8407 raise 8408 ctx = arg0.ctx 8409 res = isl.isl_union_map_is_equal(arg0.ptr, arg1.ptr) 8410 if res < 0: 8411 raise Error 8412 return bool(res) 8413 def is_injective(arg0): 8414 try: 8415 if not arg0.__class__ is union_map: 8416 arg0 = union_map(arg0) 8417 except: 8418 raise 8419 ctx = arg0.ctx 8420 res = isl.isl_union_map_is_injective(arg0.ptr) 8421 if res < 0: 8422 raise Error 8423 return bool(res) 8424 def is_single_valued(arg0): 8425 try: 8426 if not arg0.__class__ is union_map: 8427 arg0 = union_map(arg0) 8428 except: 8429 raise 8430 ctx = arg0.ctx 8431 res = isl.isl_union_map_is_single_valued(arg0.ptr) 8432 if res < 0: 8433 raise Error 8434 return bool(res) 8435 def is_strict_subset(arg0, arg1): 8436 try: 8437 if not arg0.__class__ is union_map: 8438 arg0 = union_map(arg0) 8439 except: 8440 raise 8441 try: 8442 if not arg1.__class__ is union_map: 8443 arg1 = union_map(arg1) 8444 except: 8445 raise 8446 ctx = arg0.ctx 8447 res = isl.isl_union_map_is_strict_subset(arg0.ptr, arg1.ptr) 8448 if res < 0: 8449 raise Error 8450 return bool(res) 8451 def is_subset(arg0, arg1): 8452 try: 8453 if not arg0.__class__ is union_map: 8454 arg0 = union_map(arg0) 8455 except: 8456 raise 8457 try: 8458 if not arg1.__class__ is union_map: 8459 arg1 = union_map(arg1) 8460 except: 8461 raise 8462 ctx = arg0.ctx 8463 res = isl.isl_union_map_is_subset(arg0.ptr, arg1.ptr) 8464 if res < 0: 8465 raise Error 8466 return bool(res) 8467 def isa_map(arg0): 8468 try: 8469 if not arg0.__class__ is union_map: 8470 arg0 = union_map(arg0) 8471 except: 8472 raise 8473 ctx = arg0.ctx 8474 res = isl.isl_union_map_isa_map(arg0.ptr) 8475 if res < 0: 8476 raise Error 8477 return bool(res) 8478 def lexmax(arg0): 8479 try: 8480 if not arg0.__class__ is union_map: 8481 arg0 = union_map(arg0) 8482 except: 8483 raise 8484 ctx = arg0.ctx 8485 res = isl.isl_union_map_lexmax(isl.isl_union_map_copy(arg0.ptr)) 8486 obj = union_map(ctx=ctx, ptr=res) 8487 return obj 8488 def lexmin(arg0): 8489 try: 8490 if not arg0.__class__ is union_map: 8491 arg0 = union_map(arg0) 8492 except: 8493 raise 8494 ctx = arg0.ctx 8495 res = isl.isl_union_map_lexmin(isl.isl_union_map_copy(arg0.ptr)) 8496 obj = union_map(ctx=ctx, ptr=res) 8497 return obj 8498 def map_list(arg0): 8499 try: 8500 if not arg0.__class__ is union_map: 8501 arg0 = union_map(arg0) 8502 except: 8503 raise 8504 ctx = arg0.ctx 8505 res = isl.isl_union_map_get_map_list(arg0.ptr) 8506 obj = map_list(ctx=ctx, ptr=res) 8507 return obj 8508 def get_map_list(arg0): 8509 return arg0.map_list() 8510 def params(arg0): 8511 try: 8512 if not arg0.__class__ is union_map: 8513 arg0 = union_map(arg0) 8514 except: 8515 raise 8516 ctx = arg0.ctx 8517 res = isl.isl_union_map_params(isl.isl_union_map_copy(arg0.ptr)) 8518 obj = set(ctx=ctx, ptr=res) 8519 return obj 8520 def polyhedral_hull(arg0): 8521 try: 8522 if not arg0.__class__ is union_map: 8523 arg0 = union_map(arg0) 8524 except: 8525 raise 8526 ctx = arg0.ctx 8527 res = isl.isl_union_map_polyhedral_hull(isl.isl_union_map_copy(arg0.ptr)) 8528 obj = union_map(ctx=ctx, ptr=res) 8529 return obj 8530 def preimage_domain(*args): 8531 if len(args) == 2 and args[1].__class__ is multi_aff: 8532 args = list(args) 8533 try: 8534 if not args[0].__class__ is union_map: 8535 args[0] = union_map(args[0]) 8536 except: 8537 raise 8538 ctx = args[0].ctx 8539 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)) 8540 obj = union_map(ctx=ctx, ptr=res) 8541 return obj 8542 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8543 args = list(args) 8544 try: 8545 if not args[0].__class__ is union_map: 8546 args[0] = union_map(args[0]) 8547 except: 8548 raise 8549 ctx = args[0].ctx 8550 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)) 8551 obj = union_map(ctx=ctx, ptr=res) 8552 return obj 8553 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8554 args = list(args) 8555 try: 8556 if not args[0].__class__ is union_map: 8557 args[0] = union_map(args[0]) 8558 except: 8559 raise 8560 ctx = args[0].ctx 8561 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)) 8562 obj = union_map(ctx=ctx, ptr=res) 8563 return obj 8564 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 8565 args = list(args) 8566 try: 8567 if not args[0].__class__ is union_map: 8568 args[0] = union_map(args[0]) 8569 except: 8570 raise 8571 ctx = args[0].ctx 8572 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)) 8573 obj = union_map(ctx=ctx, ptr=res) 8574 return obj 8575 raise Error 8576 def preimage_range(*args): 8577 if len(args) == 2 and args[1].__class__ is multi_aff: 8578 args = list(args) 8579 try: 8580 if not args[0].__class__ is union_map: 8581 args[0] = union_map(args[0]) 8582 except: 8583 raise 8584 ctx = args[0].ctx 8585 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)) 8586 obj = union_map(ctx=ctx, ptr=res) 8587 return obj 8588 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8589 args = list(args) 8590 try: 8591 if not args[0].__class__ is union_map: 8592 args[0] = union_map(args[0]) 8593 except: 8594 raise 8595 ctx = args[0].ctx 8596 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)) 8597 obj = union_map(ctx=ctx, ptr=res) 8598 return obj 8599 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 8600 args = list(args) 8601 try: 8602 if not args[0].__class__ is union_map: 8603 args[0] = union_map(args[0]) 8604 except: 8605 raise 8606 ctx = args[0].ctx 8607 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)) 8608 obj = union_map(ctx=ctx, ptr=res) 8609 return obj 8610 raise Error 8611 def product(arg0, arg1): 8612 try: 8613 if not arg0.__class__ is union_map: 8614 arg0 = union_map(arg0) 8615 except: 8616 raise 8617 try: 8618 if not arg1.__class__ is union_map: 8619 arg1 = union_map(arg1) 8620 except: 8621 raise 8622 ctx = arg0.ctx 8623 res = isl.isl_union_map_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8624 obj = union_map(ctx=ctx, ptr=res) 8625 return obj 8626 def project_out_all_params(arg0): 8627 try: 8628 if not arg0.__class__ is union_map: 8629 arg0 = union_map(arg0) 8630 except: 8631 raise 8632 ctx = arg0.ctx 8633 res = isl.isl_union_map_project_out_all_params(isl.isl_union_map_copy(arg0.ptr)) 8634 obj = union_map(ctx=ctx, ptr=res) 8635 return obj 8636 def project_out_param(*args): 8637 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 8638 args = list(args) 8639 try: 8640 if not args[0].__class__ is union_map: 8641 args[0] = union_map(args[0]) 8642 except: 8643 raise 8644 try: 8645 if not args[1].__class__ is id: 8646 args[1] = id(args[1]) 8647 except: 8648 raise 8649 ctx = args[0].ctx 8650 res = isl.isl_union_map_project_out_param_id(isl.isl_union_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 8651 obj = union_map(ctx=ctx, ptr=res) 8652 return obj 8653 if len(args) == 2 and args[1].__class__ is id_list: 8654 args = list(args) 8655 try: 8656 if not args[0].__class__ is union_map: 8657 args[0] = union_map(args[0]) 8658 except: 8659 raise 8660 ctx = args[0].ctx 8661 res = isl.isl_union_map_project_out_param_id_list(isl.isl_union_map_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 8662 obj = union_map(ctx=ctx, ptr=res) 8663 return obj 8664 raise Error 8665 def range(arg0): 8666 try: 8667 if not arg0.__class__ is union_map: 8668 arg0 = union_map(arg0) 8669 except: 8670 raise 8671 ctx = arg0.ctx 8672 res = isl.isl_union_map_range(isl.isl_union_map_copy(arg0.ptr)) 8673 obj = union_set(ctx=ctx, ptr=res) 8674 return obj 8675 def range_factor_domain(arg0): 8676 try: 8677 if not arg0.__class__ is union_map: 8678 arg0 = union_map(arg0) 8679 except: 8680 raise 8681 ctx = arg0.ctx 8682 res = isl.isl_union_map_range_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 8683 obj = union_map(ctx=ctx, ptr=res) 8684 return obj 8685 def range_factor_range(arg0): 8686 try: 8687 if not arg0.__class__ is union_map: 8688 arg0 = union_map(arg0) 8689 except: 8690 raise 8691 ctx = arg0.ctx 8692 res = isl.isl_union_map_range_factor_range(isl.isl_union_map_copy(arg0.ptr)) 8693 obj = union_map(ctx=ctx, ptr=res) 8694 return obj 8695 def range_map(arg0): 8696 try: 8697 if not arg0.__class__ is union_map: 8698 arg0 = union_map(arg0) 8699 except: 8700 raise 8701 ctx = arg0.ctx 8702 res = isl.isl_union_map_range_map(isl.isl_union_map_copy(arg0.ptr)) 8703 obj = union_map(ctx=ctx, ptr=res) 8704 return obj 8705 def range_product(arg0, arg1): 8706 try: 8707 if not arg0.__class__ is union_map: 8708 arg0 = union_map(arg0) 8709 except: 8710 raise 8711 try: 8712 if not arg1.__class__ is union_map: 8713 arg1 = union_map(arg1) 8714 except: 8715 raise 8716 ctx = arg0.ctx 8717 res = isl.isl_union_map_range_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8718 obj = union_map(ctx=ctx, ptr=res) 8719 return obj 8720 def range_reverse(arg0): 8721 try: 8722 if not arg0.__class__ is union_map: 8723 arg0 = union_map(arg0) 8724 except: 8725 raise 8726 ctx = arg0.ctx 8727 res = isl.isl_union_map_range_reverse(isl.isl_union_map_copy(arg0.ptr)) 8728 obj = union_map(ctx=ctx, ptr=res) 8729 return obj 8730 def reverse(arg0): 8731 try: 8732 if not arg0.__class__ is union_map: 8733 arg0 = union_map(arg0) 8734 except: 8735 raise 8736 ctx = arg0.ctx 8737 res = isl.isl_union_map_reverse(isl.isl_union_map_copy(arg0.ptr)) 8738 obj = union_map(ctx=ctx, ptr=res) 8739 return obj 8740 def space(arg0): 8741 try: 8742 if not arg0.__class__ is union_map: 8743 arg0 = union_map(arg0) 8744 except: 8745 raise 8746 ctx = arg0.ctx 8747 res = isl.isl_union_map_get_space(arg0.ptr) 8748 obj = space(ctx=ctx, ptr=res) 8749 return obj 8750 def get_space(arg0): 8751 return arg0.space() 8752 def subtract(arg0, arg1): 8753 try: 8754 if not arg0.__class__ is union_map: 8755 arg0 = union_map(arg0) 8756 except: 8757 raise 8758 try: 8759 if not arg1.__class__ is union_map: 8760 arg1 = union_map(arg1) 8761 except: 8762 raise 8763 ctx = arg0.ctx 8764 res = isl.isl_union_map_subtract(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8765 obj = union_map(ctx=ctx, ptr=res) 8766 return obj 8767 def subtract_domain(arg0, arg1): 8768 try: 8769 if not arg0.__class__ is union_map: 8770 arg0 = union_map(arg0) 8771 except: 8772 raise 8773 try: 8774 if not arg1.__class__ is union_set: 8775 arg1 = union_set(arg1) 8776 except: 8777 raise 8778 ctx = arg0.ctx 8779 res = isl.isl_union_map_subtract_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8780 obj = union_map(ctx=ctx, ptr=res) 8781 return obj 8782 def subtract_range(arg0, arg1): 8783 try: 8784 if not arg0.__class__ is union_map: 8785 arg0 = union_map(arg0) 8786 except: 8787 raise 8788 try: 8789 if not arg1.__class__ is union_set: 8790 arg1 = union_set(arg1) 8791 except: 8792 raise 8793 ctx = arg0.ctx 8794 res = isl.isl_union_map_subtract_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 8795 obj = union_map(ctx=ctx, ptr=res) 8796 return obj 8797 def uncurry(arg0): 8798 try: 8799 if not arg0.__class__ is union_map: 8800 arg0 = union_map(arg0) 8801 except: 8802 raise 8803 ctx = arg0.ctx 8804 res = isl.isl_union_map_uncurry(isl.isl_union_map_copy(arg0.ptr)) 8805 obj = union_map(ctx=ctx, ptr=res) 8806 return obj 8807 def union(arg0, arg1): 8808 try: 8809 if not arg0.__class__ is union_map: 8810 arg0 = union_map(arg0) 8811 except: 8812 raise 8813 try: 8814 if not arg1.__class__ is union_map: 8815 arg1 = union_map(arg1) 8816 except: 8817 raise 8818 ctx = arg0.ctx 8819 res = isl.isl_union_map_union(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 8820 obj = union_map(ctx=ctx, ptr=res) 8821 return obj 8822 def universe(arg0): 8823 try: 8824 if not arg0.__class__ is union_map: 8825 arg0 = union_map(arg0) 8826 except: 8827 raise 8828 ctx = arg0.ctx 8829 res = isl.isl_union_map_universe(isl.isl_union_map_copy(arg0.ptr)) 8830 obj = union_map(ctx=ctx, ptr=res) 8831 return obj 8832 def wrap(arg0): 8833 try: 8834 if not arg0.__class__ is union_map: 8835 arg0 = union_map(arg0) 8836 except: 8837 raise 8838 ctx = arg0.ctx 8839 res = isl.isl_union_map_wrap(isl.isl_union_map_copy(arg0.ptr)) 8840 obj = union_set(ctx=ctx, ptr=res) 8841 return obj 8842 def zip(arg0): 8843 try: 8844 if not arg0.__class__ is union_map: 8845 arg0 = union_map(arg0) 8846 except: 8847 raise 8848 ctx = arg0.ctx 8849 res = isl.isl_union_map_zip(isl.isl_union_map_copy(arg0.ptr)) 8850 obj = union_map(ctx=ctx, ptr=res) 8851 return obj 8852 8853isl.isl_union_map_from_basic_map.restype = c_void_p 8854isl.isl_union_map_from_basic_map.argtypes = [c_void_p] 8855isl.isl_union_map_from_map.restype = c_void_p 8856isl.isl_union_map_from_map.argtypes = [c_void_p] 8857isl.isl_union_map_read_from_str.restype = c_void_p 8858isl.isl_union_map_read_from_str.argtypes = [Context, c_char_p] 8859isl.isl_union_map_affine_hull.restype = c_void_p 8860isl.isl_union_map_affine_hull.argtypes = [c_void_p] 8861isl.isl_union_map_apply_domain.restype = c_void_p 8862isl.isl_union_map_apply_domain.argtypes = [c_void_p, c_void_p] 8863isl.isl_union_map_apply_range.restype = c_void_p 8864isl.isl_union_map_apply_range.argtypes = [c_void_p, c_void_p] 8865isl.isl_union_map_as_map.restype = c_void_p 8866isl.isl_union_map_as_map.argtypes = [c_void_p] 8867isl.isl_union_map_as_multi_union_pw_aff.restype = c_void_p 8868isl.isl_union_map_as_multi_union_pw_aff.argtypes = [c_void_p] 8869isl.isl_union_map_as_union_pw_multi_aff.restype = c_void_p 8870isl.isl_union_map_as_union_pw_multi_aff.argtypes = [c_void_p] 8871isl.isl_union_map_bind_range.restype = c_void_p 8872isl.isl_union_map_bind_range.argtypes = [c_void_p, c_void_p] 8873isl.isl_union_map_coalesce.restype = c_void_p 8874isl.isl_union_map_coalesce.argtypes = [c_void_p] 8875isl.isl_union_map_compute_divs.restype = c_void_p 8876isl.isl_union_map_compute_divs.argtypes = [c_void_p] 8877isl.isl_union_map_curry.restype = c_void_p 8878isl.isl_union_map_curry.argtypes = [c_void_p] 8879isl.isl_union_map_deltas.restype = c_void_p 8880isl.isl_union_map_deltas.argtypes = [c_void_p] 8881isl.isl_union_map_detect_equalities.restype = c_void_p 8882isl.isl_union_map_detect_equalities.argtypes = [c_void_p] 8883isl.isl_union_map_domain.restype = c_void_p 8884isl.isl_union_map_domain.argtypes = [c_void_p] 8885isl.isl_union_map_domain_factor_domain.restype = c_void_p 8886isl.isl_union_map_domain_factor_domain.argtypes = [c_void_p] 8887isl.isl_union_map_domain_factor_range.restype = c_void_p 8888isl.isl_union_map_domain_factor_range.argtypes = [c_void_p] 8889isl.isl_union_map_domain_map.restype = c_void_p 8890isl.isl_union_map_domain_map.argtypes = [c_void_p] 8891isl.isl_union_map_domain_map_union_pw_multi_aff.restype = c_void_p 8892isl.isl_union_map_domain_map_union_pw_multi_aff.argtypes = [c_void_p] 8893isl.isl_union_map_domain_product.restype = c_void_p 8894isl.isl_union_map_domain_product.argtypes = [c_void_p, c_void_p] 8895isl.isl_union_map_domain_reverse.restype = c_void_p 8896isl.isl_union_map_domain_reverse.argtypes = [c_void_p] 8897isl.isl_union_map_drop_unused_params.restype = c_void_p 8898isl.isl_union_map_drop_unused_params.argtypes = [c_void_p] 8899isl.isl_union_map_empty_ctx.restype = c_void_p 8900isl.isl_union_map_empty_ctx.argtypes = [Context] 8901isl.isl_union_map_eq_at_multi_union_pw_aff.restype = c_void_p 8902isl.isl_union_map_eq_at_multi_union_pw_aff.argtypes = [c_void_p, c_void_p] 8903isl.isl_union_map_every_map.argtypes = [c_void_p, c_void_p, c_void_p] 8904isl.isl_union_map_extract_map.restype = c_void_p 8905isl.isl_union_map_extract_map.argtypes = [c_void_p, c_void_p] 8906isl.isl_union_map_factor_domain.restype = c_void_p 8907isl.isl_union_map_factor_domain.argtypes = [c_void_p] 8908isl.isl_union_map_factor_range.restype = c_void_p 8909isl.isl_union_map_factor_range.argtypes = [c_void_p] 8910isl.isl_union_map_fixed_power_val.restype = c_void_p 8911isl.isl_union_map_fixed_power_val.argtypes = [c_void_p, c_void_p] 8912isl.isl_union_map_foreach_map.argtypes = [c_void_p, c_void_p, c_void_p] 8913isl.isl_union_map_from_multi_union_pw_aff.restype = c_void_p 8914isl.isl_union_map_from_multi_union_pw_aff.argtypes = [c_void_p] 8915isl.isl_union_map_from_union_pw_multi_aff.restype = c_void_p 8916isl.isl_union_map_from_union_pw_multi_aff.argtypes = [c_void_p] 8917isl.isl_union_map_from_domain.restype = c_void_p 8918isl.isl_union_map_from_domain.argtypes = [c_void_p] 8919isl.isl_union_map_from_domain_and_range.restype = c_void_p 8920isl.isl_union_map_from_domain_and_range.argtypes = [c_void_p, c_void_p] 8921isl.isl_union_map_from_range.restype = c_void_p 8922isl.isl_union_map_from_range.argtypes = [c_void_p] 8923isl.isl_union_map_gist.restype = c_void_p 8924isl.isl_union_map_gist.argtypes = [c_void_p, c_void_p] 8925isl.isl_union_map_gist_domain.restype = c_void_p 8926isl.isl_union_map_gist_domain.argtypes = [c_void_p, c_void_p] 8927isl.isl_union_map_gist_params.restype = c_void_p 8928isl.isl_union_map_gist_params.argtypes = [c_void_p, c_void_p] 8929isl.isl_union_map_gist_range.restype = c_void_p 8930isl.isl_union_map_gist_range.argtypes = [c_void_p, c_void_p] 8931isl.isl_union_map_intersect.restype = c_void_p 8932isl.isl_union_map_intersect.argtypes = [c_void_p, c_void_p] 8933isl.isl_union_map_intersect_domain_space.restype = c_void_p 8934isl.isl_union_map_intersect_domain_space.argtypes = [c_void_p, c_void_p] 8935isl.isl_union_map_intersect_domain_union_set.restype = c_void_p 8936isl.isl_union_map_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 8937isl.isl_union_map_intersect_domain_factor_domain.restype = c_void_p 8938isl.isl_union_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 8939isl.isl_union_map_intersect_domain_factor_range.restype = c_void_p 8940isl.isl_union_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 8941isl.isl_union_map_intersect_domain_wrapped_domain_union_set.restype = c_void_p 8942isl.isl_union_map_intersect_domain_wrapped_domain_union_set.argtypes = [c_void_p, c_void_p] 8943isl.isl_union_map_intersect_params.restype = c_void_p 8944isl.isl_union_map_intersect_params.argtypes = [c_void_p, c_void_p] 8945isl.isl_union_map_intersect_range_space.restype = c_void_p 8946isl.isl_union_map_intersect_range_space.argtypes = [c_void_p, c_void_p] 8947isl.isl_union_map_intersect_range_union_set.restype = c_void_p 8948isl.isl_union_map_intersect_range_union_set.argtypes = [c_void_p, c_void_p] 8949isl.isl_union_map_intersect_range_factor_domain.restype = c_void_p 8950isl.isl_union_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 8951isl.isl_union_map_intersect_range_factor_range.restype = c_void_p 8952isl.isl_union_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 8953isl.isl_union_map_intersect_range_wrapped_domain_union_set.restype = c_void_p 8954isl.isl_union_map_intersect_range_wrapped_domain_union_set.argtypes = [c_void_p, c_void_p] 8955isl.isl_union_map_is_bijective.argtypes = [c_void_p] 8956isl.isl_union_map_is_disjoint.argtypes = [c_void_p, c_void_p] 8957isl.isl_union_map_is_empty.argtypes = [c_void_p] 8958isl.isl_union_map_is_equal.argtypes = [c_void_p, c_void_p] 8959isl.isl_union_map_is_injective.argtypes = [c_void_p] 8960isl.isl_union_map_is_single_valued.argtypes = [c_void_p] 8961isl.isl_union_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 8962isl.isl_union_map_is_subset.argtypes = [c_void_p, c_void_p] 8963isl.isl_union_map_isa_map.argtypes = [c_void_p] 8964isl.isl_union_map_lexmax.restype = c_void_p 8965isl.isl_union_map_lexmax.argtypes = [c_void_p] 8966isl.isl_union_map_lexmin.restype = c_void_p 8967isl.isl_union_map_lexmin.argtypes = [c_void_p] 8968isl.isl_union_map_get_map_list.restype = c_void_p 8969isl.isl_union_map_get_map_list.argtypes = [c_void_p] 8970isl.isl_union_map_params.restype = c_void_p 8971isl.isl_union_map_params.argtypes = [c_void_p] 8972isl.isl_union_map_polyhedral_hull.restype = c_void_p 8973isl.isl_union_map_polyhedral_hull.argtypes = [c_void_p] 8974isl.isl_union_map_preimage_domain_multi_aff.restype = c_void_p 8975isl.isl_union_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 8976isl.isl_union_map_preimage_domain_multi_pw_aff.restype = c_void_p 8977isl.isl_union_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 8978isl.isl_union_map_preimage_domain_pw_multi_aff.restype = c_void_p 8979isl.isl_union_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8980isl.isl_union_map_preimage_domain_union_pw_multi_aff.restype = c_void_p 8981isl.isl_union_map_preimage_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8982isl.isl_union_map_preimage_range_multi_aff.restype = c_void_p 8983isl.isl_union_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 8984isl.isl_union_map_preimage_range_pw_multi_aff.restype = c_void_p 8985isl.isl_union_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8986isl.isl_union_map_preimage_range_union_pw_multi_aff.restype = c_void_p 8987isl.isl_union_map_preimage_range_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 8988isl.isl_union_map_product.restype = c_void_p 8989isl.isl_union_map_product.argtypes = [c_void_p, c_void_p] 8990isl.isl_union_map_project_out_all_params.restype = c_void_p 8991isl.isl_union_map_project_out_all_params.argtypes = [c_void_p] 8992isl.isl_union_map_project_out_param_id.restype = c_void_p 8993isl.isl_union_map_project_out_param_id.argtypes = [c_void_p, c_void_p] 8994isl.isl_union_map_project_out_param_id_list.restype = c_void_p 8995isl.isl_union_map_project_out_param_id_list.argtypes = [c_void_p, c_void_p] 8996isl.isl_union_map_range.restype = c_void_p 8997isl.isl_union_map_range.argtypes = [c_void_p] 8998isl.isl_union_map_range_factor_domain.restype = c_void_p 8999isl.isl_union_map_range_factor_domain.argtypes = [c_void_p] 9000isl.isl_union_map_range_factor_range.restype = c_void_p 9001isl.isl_union_map_range_factor_range.argtypes = [c_void_p] 9002isl.isl_union_map_range_map.restype = c_void_p 9003isl.isl_union_map_range_map.argtypes = [c_void_p] 9004isl.isl_union_map_range_product.restype = c_void_p 9005isl.isl_union_map_range_product.argtypes = [c_void_p, c_void_p] 9006isl.isl_union_map_range_reverse.restype = c_void_p 9007isl.isl_union_map_range_reverse.argtypes = [c_void_p] 9008isl.isl_union_map_reverse.restype = c_void_p 9009isl.isl_union_map_reverse.argtypes = [c_void_p] 9010isl.isl_union_map_get_space.restype = c_void_p 9011isl.isl_union_map_get_space.argtypes = [c_void_p] 9012isl.isl_union_map_subtract.restype = c_void_p 9013isl.isl_union_map_subtract.argtypes = [c_void_p, c_void_p] 9014isl.isl_union_map_subtract_domain.restype = c_void_p 9015isl.isl_union_map_subtract_domain.argtypes = [c_void_p, c_void_p] 9016isl.isl_union_map_subtract_range.restype = c_void_p 9017isl.isl_union_map_subtract_range.argtypes = [c_void_p, c_void_p] 9018isl.isl_union_map_uncurry.restype = c_void_p 9019isl.isl_union_map_uncurry.argtypes = [c_void_p] 9020isl.isl_union_map_union.restype = c_void_p 9021isl.isl_union_map_union.argtypes = [c_void_p, c_void_p] 9022isl.isl_union_map_universe.restype = c_void_p 9023isl.isl_union_map_universe.argtypes = [c_void_p] 9024isl.isl_union_map_wrap.restype = c_void_p 9025isl.isl_union_map_wrap.argtypes = [c_void_p] 9026isl.isl_union_map_zip.restype = c_void_p 9027isl.isl_union_map_zip.argtypes = [c_void_p] 9028isl.isl_union_map_copy.restype = c_void_p 9029isl.isl_union_map_copy.argtypes = [c_void_p] 9030isl.isl_union_map_free.restype = c_void_p 9031isl.isl_union_map_free.argtypes = [c_void_p] 9032isl.isl_union_map_to_str.restype = POINTER(c_char) 9033isl.isl_union_map_to_str.argtypes = [c_void_p] 9034 9035class map(union_map): 9036 def __init__(self, *args, **keywords): 9037 if "ptr" in keywords: 9038 self.ctx = keywords["ctx"] 9039 self.ptr = keywords["ptr"] 9040 return 9041 if len(args) == 1 and args[0].__class__ is basic_map: 9042 self.ctx = Context.getDefaultInstance() 9043 self.ptr = isl.isl_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 9044 return 9045 if len(args) == 1 and type(args[0]) == str: 9046 self.ctx = Context.getDefaultInstance() 9047 self.ptr = isl.isl_map_read_from_str(self.ctx, args[0].encode('ascii')) 9048 return 9049 raise Error 9050 def __del__(self): 9051 if hasattr(self, 'ptr'): 9052 isl.isl_map_free(self.ptr) 9053 def __str__(arg0): 9054 try: 9055 if not arg0.__class__ is map: 9056 arg0 = map(arg0) 9057 except: 9058 raise 9059 ptr = isl.isl_map_to_str(arg0.ptr) 9060 res = cast(ptr, c_char_p).value.decode('ascii') 9061 libc.free(ptr) 9062 return res 9063 def __repr__(self): 9064 s = str(self) 9065 if '"' in s: 9066 return 'isl.map("""%s""")' % s 9067 else: 9068 return 'isl.map("%s")' % s 9069 def affine_hull(arg0): 9070 try: 9071 if not arg0.__class__ is map: 9072 arg0 = map(arg0) 9073 except: 9074 raise 9075 ctx = arg0.ctx 9076 res = isl.isl_map_affine_hull(isl.isl_map_copy(arg0.ptr)) 9077 obj = basic_map(ctx=ctx, ptr=res) 9078 return obj 9079 def apply_domain(arg0, arg1): 9080 try: 9081 if not arg0.__class__ is map: 9082 arg0 = map(arg0) 9083 except: 9084 raise 9085 try: 9086 if not arg1.__class__ is map: 9087 arg1 = map(arg1) 9088 except: 9089 return union_map(arg0).apply_domain(arg1) 9090 ctx = arg0.ctx 9091 res = isl.isl_map_apply_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9092 obj = map(ctx=ctx, ptr=res) 9093 return obj 9094 def apply_range(arg0, arg1): 9095 try: 9096 if not arg0.__class__ is map: 9097 arg0 = map(arg0) 9098 except: 9099 raise 9100 try: 9101 if not arg1.__class__ is map: 9102 arg1 = map(arg1) 9103 except: 9104 return union_map(arg0).apply_range(arg1) 9105 ctx = arg0.ctx 9106 res = isl.isl_map_apply_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9107 obj = map(ctx=ctx, ptr=res) 9108 return obj 9109 def as_pw_multi_aff(arg0): 9110 try: 9111 if not arg0.__class__ is map: 9112 arg0 = map(arg0) 9113 except: 9114 raise 9115 ctx = arg0.ctx 9116 res = isl.isl_map_as_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 9117 obj = pw_multi_aff(ctx=ctx, ptr=res) 9118 return obj 9119 def bind_domain(arg0, arg1): 9120 try: 9121 if not arg0.__class__ is map: 9122 arg0 = map(arg0) 9123 except: 9124 raise 9125 try: 9126 if not arg1.__class__ is multi_id: 9127 arg1 = multi_id(arg1) 9128 except: 9129 return union_map(arg0).bind_domain(arg1) 9130 ctx = arg0.ctx 9131 res = isl.isl_map_bind_domain(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 9132 obj = set(ctx=ctx, ptr=res) 9133 return obj 9134 def bind_range(arg0, arg1): 9135 try: 9136 if not arg0.__class__ is map: 9137 arg0 = map(arg0) 9138 except: 9139 raise 9140 try: 9141 if not arg1.__class__ is multi_id: 9142 arg1 = multi_id(arg1) 9143 except: 9144 return union_map(arg0).bind_range(arg1) 9145 ctx = arg0.ctx 9146 res = isl.isl_map_bind_range(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 9147 obj = set(ctx=ctx, ptr=res) 9148 return obj 9149 def coalesce(arg0): 9150 try: 9151 if not arg0.__class__ is map: 9152 arg0 = map(arg0) 9153 except: 9154 raise 9155 ctx = arg0.ctx 9156 res = isl.isl_map_coalesce(isl.isl_map_copy(arg0.ptr)) 9157 obj = map(ctx=ctx, ptr=res) 9158 return obj 9159 def complement(arg0): 9160 try: 9161 if not arg0.__class__ is map: 9162 arg0 = map(arg0) 9163 except: 9164 raise 9165 ctx = arg0.ctx 9166 res = isl.isl_map_complement(isl.isl_map_copy(arg0.ptr)) 9167 obj = map(ctx=ctx, ptr=res) 9168 return obj 9169 def curry(arg0): 9170 try: 9171 if not arg0.__class__ is map: 9172 arg0 = map(arg0) 9173 except: 9174 raise 9175 ctx = arg0.ctx 9176 res = isl.isl_map_curry(isl.isl_map_copy(arg0.ptr)) 9177 obj = map(ctx=ctx, ptr=res) 9178 return obj 9179 def deltas(arg0): 9180 try: 9181 if not arg0.__class__ is map: 9182 arg0 = map(arg0) 9183 except: 9184 raise 9185 ctx = arg0.ctx 9186 res = isl.isl_map_deltas(isl.isl_map_copy(arg0.ptr)) 9187 obj = set(ctx=ctx, ptr=res) 9188 return obj 9189 def detect_equalities(arg0): 9190 try: 9191 if not arg0.__class__ is map: 9192 arg0 = map(arg0) 9193 except: 9194 raise 9195 ctx = arg0.ctx 9196 res = isl.isl_map_detect_equalities(isl.isl_map_copy(arg0.ptr)) 9197 obj = map(ctx=ctx, ptr=res) 9198 return obj 9199 def domain(arg0): 9200 try: 9201 if not arg0.__class__ is map: 9202 arg0 = map(arg0) 9203 except: 9204 raise 9205 ctx = arg0.ctx 9206 res = isl.isl_map_domain(isl.isl_map_copy(arg0.ptr)) 9207 obj = set(ctx=ctx, ptr=res) 9208 return obj 9209 def domain_factor_domain(arg0): 9210 try: 9211 if not arg0.__class__ is map: 9212 arg0 = map(arg0) 9213 except: 9214 raise 9215 ctx = arg0.ctx 9216 res = isl.isl_map_domain_factor_domain(isl.isl_map_copy(arg0.ptr)) 9217 obj = map(ctx=ctx, ptr=res) 9218 return obj 9219 def domain_factor_range(arg0): 9220 try: 9221 if not arg0.__class__ is map: 9222 arg0 = map(arg0) 9223 except: 9224 raise 9225 ctx = arg0.ctx 9226 res = isl.isl_map_domain_factor_range(isl.isl_map_copy(arg0.ptr)) 9227 obj = map(ctx=ctx, ptr=res) 9228 return obj 9229 def domain_product(arg0, arg1): 9230 try: 9231 if not arg0.__class__ is map: 9232 arg0 = map(arg0) 9233 except: 9234 raise 9235 try: 9236 if not arg1.__class__ is map: 9237 arg1 = map(arg1) 9238 except: 9239 return union_map(arg0).domain_product(arg1) 9240 ctx = arg0.ctx 9241 res = isl.isl_map_domain_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9242 obj = map(ctx=ctx, ptr=res) 9243 return obj 9244 def domain_reverse(arg0): 9245 try: 9246 if not arg0.__class__ is map: 9247 arg0 = map(arg0) 9248 except: 9249 raise 9250 ctx = arg0.ctx 9251 res = isl.isl_map_domain_reverse(isl.isl_map_copy(arg0.ptr)) 9252 obj = map(ctx=ctx, ptr=res) 9253 return obj 9254 def domain_tuple_dim(arg0): 9255 try: 9256 if not arg0.__class__ is map: 9257 arg0 = map(arg0) 9258 except: 9259 raise 9260 ctx = arg0.ctx 9261 res = isl.isl_map_domain_tuple_dim(arg0.ptr) 9262 if res < 0: 9263 raise Error 9264 return int(res) 9265 def domain_tuple_id(arg0): 9266 try: 9267 if not arg0.__class__ is map: 9268 arg0 = map(arg0) 9269 except: 9270 raise 9271 ctx = arg0.ctx 9272 res = isl.isl_map_get_domain_tuple_id(arg0.ptr) 9273 obj = id(ctx=ctx, ptr=res) 9274 return obj 9275 def get_domain_tuple_id(arg0): 9276 return arg0.domain_tuple_id() 9277 def drop_unused_params(arg0): 9278 try: 9279 if not arg0.__class__ is map: 9280 arg0 = map(arg0) 9281 except: 9282 raise 9283 ctx = arg0.ctx 9284 res = isl.isl_map_drop_unused_params(isl.isl_map_copy(arg0.ptr)) 9285 obj = map(ctx=ctx, ptr=res) 9286 return obj 9287 @staticmethod 9288 def empty(arg0): 9289 try: 9290 if not arg0.__class__ is space: 9291 arg0 = space(arg0) 9292 except: 9293 raise 9294 ctx = arg0.ctx 9295 res = isl.isl_map_empty(isl.isl_space_copy(arg0.ptr)) 9296 obj = map(ctx=ctx, ptr=res) 9297 return obj 9298 def eq_at(*args): 9299 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9300 args = list(args) 9301 try: 9302 if not args[0].__class__ is map: 9303 args[0] = map(args[0]) 9304 except: 9305 raise 9306 ctx = args[0].ctx 9307 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)) 9308 obj = map(ctx=ctx, ptr=res) 9309 return obj 9310 raise Error 9311 def factor_domain(arg0): 9312 try: 9313 if not arg0.__class__ is map: 9314 arg0 = map(arg0) 9315 except: 9316 raise 9317 ctx = arg0.ctx 9318 res = isl.isl_map_factor_domain(isl.isl_map_copy(arg0.ptr)) 9319 obj = map(ctx=ctx, ptr=res) 9320 return obj 9321 def factor_range(arg0): 9322 try: 9323 if not arg0.__class__ is map: 9324 arg0 = map(arg0) 9325 except: 9326 raise 9327 ctx = arg0.ctx 9328 res = isl.isl_map_factor_range(isl.isl_map_copy(arg0.ptr)) 9329 obj = map(ctx=ctx, ptr=res) 9330 return obj 9331 def fixed_power(*args): 9332 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 9333 args = list(args) 9334 try: 9335 if not args[0].__class__ is map: 9336 args[0] = map(args[0]) 9337 except: 9338 raise 9339 try: 9340 if not args[1].__class__ is val: 9341 args[1] = val(args[1]) 9342 except: 9343 raise 9344 ctx = args[0].ctx 9345 res = isl.isl_map_fixed_power_val(isl.isl_map_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 9346 obj = map(ctx=ctx, ptr=res) 9347 return obj 9348 raise Error 9349 def flatten(arg0): 9350 try: 9351 if not arg0.__class__ is map: 9352 arg0 = map(arg0) 9353 except: 9354 raise 9355 ctx = arg0.ctx 9356 res = isl.isl_map_flatten(isl.isl_map_copy(arg0.ptr)) 9357 obj = map(ctx=ctx, ptr=res) 9358 return obj 9359 def flatten_domain(arg0): 9360 try: 9361 if not arg0.__class__ is map: 9362 arg0 = map(arg0) 9363 except: 9364 raise 9365 ctx = arg0.ctx 9366 res = isl.isl_map_flatten_domain(isl.isl_map_copy(arg0.ptr)) 9367 obj = map(ctx=ctx, ptr=res) 9368 return obj 9369 def flatten_range(arg0): 9370 try: 9371 if not arg0.__class__ is map: 9372 arg0 = map(arg0) 9373 except: 9374 raise 9375 ctx = arg0.ctx 9376 res = isl.isl_map_flatten_range(isl.isl_map_copy(arg0.ptr)) 9377 obj = map(ctx=ctx, ptr=res) 9378 return obj 9379 def foreach_basic_map(arg0, arg1): 9380 try: 9381 if not arg0.__class__ is map: 9382 arg0 = map(arg0) 9383 except: 9384 raise 9385 exc_info = [None] 9386 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9387 def cb_func(cb_arg0, cb_arg1): 9388 cb_arg0 = basic_map(ctx=arg0.ctx, ptr=(cb_arg0)) 9389 try: 9390 arg1(cb_arg0) 9391 except BaseException as e: 9392 exc_info[0] = e 9393 return -1 9394 return 0 9395 cb1 = fn(cb_func) 9396 ctx = arg0.ctx 9397 res = isl.isl_map_foreach_basic_map(arg0.ptr, cb1, None) 9398 if exc_info[0] is not None: 9399 raise exc_info[0] 9400 if res < 0: 9401 raise Error 9402 def gist(arg0, arg1): 9403 try: 9404 if not arg0.__class__ is map: 9405 arg0 = map(arg0) 9406 except: 9407 raise 9408 try: 9409 if not arg1.__class__ is map: 9410 arg1 = map(arg1) 9411 except: 9412 return union_map(arg0).gist(arg1) 9413 ctx = arg0.ctx 9414 res = isl.isl_map_gist(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9415 obj = map(ctx=ctx, ptr=res) 9416 return obj 9417 def gist_domain(arg0, arg1): 9418 try: 9419 if not arg0.__class__ is map: 9420 arg0 = map(arg0) 9421 except: 9422 raise 9423 try: 9424 if not arg1.__class__ is set: 9425 arg1 = set(arg1) 9426 except: 9427 return union_map(arg0).gist_domain(arg1) 9428 ctx = arg0.ctx 9429 res = isl.isl_map_gist_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9430 obj = map(ctx=ctx, ptr=res) 9431 return obj 9432 def gist_params(arg0, arg1): 9433 try: 9434 if not arg0.__class__ is map: 9435 arg0 = map(arg0) 9436 except: 9437 raise 9438 try: 9439 if not arg1.__class__ is set: 9440 arg1 = set(arg1) 9441 except: 9442 return union_map(arg0).gist_params(arg1) 9443 ctx = arg0.ctx 9444 res = isl.isl_map_gist_params(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9445 obj = map(ctx=ctx, ptr=res) 9446 return obj 9447 def has_domain_tuple_id(arg0): 9448 try: 9449 if not arg0.__class__ is map: 9450 arg0 = map(arg0) 9451 except: 9452 raise 9453 ctx = arg0.ctx 9454 res = isl.isl_map_has_domain_tuple_id(arg0.ptr) 9455 if res < 0: 9456 raise Error 9457 return bool(res) 9458 def has_range_tuple_id(arg0): 9459 try: 9460 if not arg0.__class__ is map: 9461 arg0 = map(arg0) 9462 except: 9463 raise 9464 ctx = arg0.ctx 9465 res = isl.isl_map_has_range_tuple_id(arg0.ptr) 9466 if res < 0: 9467 raise Error 9468 return bool(res) 9469 def intersect(arg0, arg1): 9470 try: 9471 if not arg0.__class__ is map: 9472 arg0 = map(arg0) 9473 except: 9474 raise 9475 try: 9476 if not arg1.__class__ is map: 9477 arg1 = map(arg1) 9478 except: 9479 return union_map(arg0).intersect(arg1) 9480 ctx = arg0.ctx 9481 res = isl.isl_map_intersect(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9482 obj = map(ctx=ctx, ptr=res) 9483 return obj 9484 def intersect_domain(arg0, arg1): 9485 try: 9486 if not arg0.__class__ is map: 9487 arg0 = map(arg0) 9488 except: 9489 raise 9490 try: 9491 if not arg1.__class__ is set: 9492 arg1 = set(arg1) 9493 except: 9494 return union_map(arg0).intersect_domain(arg1) 9495 ctx = arg0.ctx 9496 res = isl.isl_map_intersect_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9497 obj = map(ctx=ctx, ptr=res) 9498 return obj 9499 def intersect_domain_factor_domain(arg0, arg1): 9500 try: 9501 if not arg0.__class__ is map: 9502 arg0 = map(arg0) 9503 except: 9504 raise 9505 try: 9506 if not arg1.__class__ is map: 9507 arg1 = map(arg1) 9508 except: 9509 return union_map(arg0).intersect_domain_factor_domain(arg1) 9510 ctx = arg0.ctx 9511 res = isl.isl_map_intersect_domain_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9512 obj = map(ctx=ctx, ptr=res) 9513 return obj 9514 def intersect_domain_factor_range(arg0, arg1): 9515 try: 9516 if not arg0.__class__ is map: 9517 arg0 = map(arg0) 9518 except: 9519 raise 9520 try: 9521 if not arg1.__class__ is map: 9522 arg1 = map(arg1) 9523 except: 9524 return union_map(arg0).intersect_domain_factor_range(arg1) 9525 ctx = arg0.ctx 9526 res = isl.isl_map_intersect_domain_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9527 obj = map(ctx=ctx, ptr=res) 9528 return obj 9529 def intersect_domain_wrapped_domain(arg0, arg1): 9530 try: 9531 if not arg0.__class__ is map: 9532 arg0 = map(arg0) 9533 except: 9534 raise 9535 try: 9536 if not arg1.__class__ is set: 9537 arg1 = set(arg1) 9538 except: 9539 return union_map(arg0).intersect_domain_wrapped_domain(arg1) 9540 ctx = arg0.ctx 9541 res = isl.isl_map_intersect_domain_wrapped_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9542 obj = map(ctx=ctx, ptr=res) 9543 return obj 9544 def intersect_params(arg0, arg1): 9545 try: 9546 if not arg0.__class__ is map: 9547 arg0 = map(arg0) 9548 except: 9549 raise 9550 try: 9551 if not arg1.__class__ is set: 9552 arg1 = set(arg1) 9553 except: 9554 return union_map(arg0).intersect_params(arg1) 9555 ctx = arg0.ctx 9556 res = isl.isl_map_intersect_params(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9557 obj = map(ctx=ctx, ptr=res) 9558 return obj 9559 def intersect_range(arg0, arg1): 9560 try: 9561 if not arg0.__class__ is map: 9562 arg0 = map(arg0) 9563 except: 9564 raise 9565 try: 9566 if not arg1.__class__ is set: 9567 arg1 = set(arg1) 9568 except: 9569 return union_map(arg0).intersect_range(arg1) 9570 ctx = arg0.ctx 9571 res = isl.isl_map_intersect_range(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9572 obj = map(ctx=ctx, ptr=res) 9573 return obj 9574 def intersect_range_factor_domain(arg0, arg1): 9575 try: 9576 if not arg0.__class__ is map: 9577 arg0 = map(arg0) 9578 except: 9579 raise 9580 try: 9581 if not arg1.__class__ is map: 9582 arg1 = map(arg1) 9583 except: 9584 return union_map(arg0).intersect_range_factor_domain(arg1) 9585 ctx = arg0.ctx 9586 res = isl.isl_map_intersect_range_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9587 obj = map(ctx=ctx, ptr=res) 9588 return obj 9589 def intersect_range_factor_range(arg0, arg1): 9590 try: 9591 if not arg0.__class__ is map: 9592 arg0 = map(arg0) 9593 except: 9594 raise 9595 try: 9596 if not arg1.__class__ is map: 9597 arg1 = map(arg1) 9598 except: 9599 return union_map(arg0).intersect_range_factor_range(arg1) 9600 ctx = arg0.ctx 9601 res = isl.isl_map_intersect_range_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9602 obj = map(ctx=ctx, ptr=res) 9603 return obj 9604 def intersect_range_wrapped_domain(arg0, arg1): 9605 try: 9606 if not arg0.__class__ is map: 9607 arg0 = map(arg0) 9608 except: 9609 raise 9610 try: 9611 if not arg1.__class__ is set: 9612 arg1 = set(arg1) 9613 except: 9614 return union_map(arg0).intersect_range_wrapped_domain(arg1) 9615 ctx = arg0.ctx 9616 res = isl.isl_map_intersect_range_wrapped_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9617 obj = map(ctx=ctx, ptr=res) 9618 return obj 9619 def is_bijective(arg0): 9620 try: 9621 if not arg0.__class__ is map: 9622 arg0 = map(arg0) 9623 except: 9624 raise 9625 ctx = arg0.ctx 9626 res = isl.isl_map_is_bijective(arg0.ptr) 9627 if res < 0: 9628 raise Error 9629 return bool(res) 9630 def is_disjoint(arg0, arg1): 9631 try: 9632 if not arg0.__class__ is map: 9633 arg0 = map(arg0) 9634 except: 9635 raise 9636 try: 9637 if not arg1.__class__ is map: 9638 arg1 = map(arg1) 9639 except: 9640 return union_map(arg0).is_disjoint(arg1) 9641 ctx = arg0.ctx 9642 res = isl.isl_map_is_disjoint(arg0.ptr, arg1.ptr) 9643 if res < 0: 9644 raise Error 9645 return bool(res) 9646 def is_empty(arg0): 9647 try: 9648 if not arg0.__class__ is map: 9649 arg0 = map(arg0) 9650 except: 9651 raise 9652 ctx = arg0.ctx 9653 res = isl.isl_map_is_empty(arg0.ptr) 9654 if res < 0: 9655 raise Error 9656 return bool(res) 9657 def is_equal(arg0, arg1): 9658 try: 9659 if not arg0.__class__ is map: 9660 arg0 = map(arg0) 9661 except: 9662 raise 9663 try: 9664 if not arg1.__class__ is map: 9665 arg1 = map(arg1) 9666 except: 9667 return union_map(arg0).is_equal(arg1) 9668 ctx = arg0.ctx 9669 res = isl.isl_map_is_equal(arg0.ptr, arg1.ptr) 9670 if res < 0: 9671 raise Error 9672 return bool(res) 9673 def is_injective(arg0): 9674 try: 9675 if not arg0.__class__ is map: 9676 arg0 = map(arg0) 9677 except: 9678 raise 9679 ctx = arg0.ctx 9680 res = isl.isl_map_is_injective(arg0.ptr) 9681 if res < 0: 9682 raise Error 9683 return bool(res) 9684 def is_single_valued(arg0): 9685 try: 9686 if not arg0.__class__ is map: 9687 arg0 = map(arg0) 9688 except: 9689 raise 9690 ctx = arg0.ctx 9691 res = isl.isl_map_is_single_valued(arg0.ptr) 9692 if res < 0: 9693 raise Error 9694 return bool(res) 9695 def is_strict_subset(arg0, arg1): 9696 try: 9697 if not arg0.__class__ is map: 9698 arg0 = map(arg0) 9699 except: 9700 raise 9701 try: 9702 if not arg1.__class__ is map: 9703 arg1 = map(arg1) 9704 except: 9705 return union_map(arg0).is_strict_subset(arg1) 9706 ctx = arg0.ctx 9707 res = isl.isl_map_is_strict_subset(arg0.ptr, arg1.ptr) 9708 if res < 0: 9709 raise Error 9710 return bool(res) 9711 def is_subset(arg0, arg1): 9712 try: 9713 if not arg0.__class__ is map: 9714 arg0 = map(arg0) 9715 except: 9716 raise 9717 try: 9718 if not arg1.__class__ is map: 9719 arg1 = map(arg1) 9720 except: 9721 return union_map(arg0).is_subset(arg1) 9722 ctx = arg0.ctx 9723 res = isl.isl_map_is_subset(arg0.ptr, arg1.ptr) 9724 if res < 0: 9725 raise Error 9726 return bool(res) 9727 def lex_ge_at(*args): 9728 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9729 args = list(args) 9730 try: 9731 if not args[0].__class__ is map: 9732 args[0] = map(args[0]) 9733 except: 9734 raise 9735 ctx = args[0].ctx 9736 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)) 9737 obj = map(ctx=ctx, ptr=res) 9738 return obj 9739 raise Error 9740 def lex_gt_at(*args): 9741 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9742 args = list(args) 9743 try: 9744 if not args[0].__class__ is map: 9745 args[0] = map(args[0]) 9746 except: 9747 raise 9748 ctx = args[0].ctx 9749 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)) 9750 obj = map(ctx=ctx, ptr=res) 9751 return obj 9752 raise Error 9753 def lex_le_at(*args): 9754 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9755 args = list(args) 9756 try: 9757 if not args[0].__class__ is map: 9758 args[0] = map(args[0]) 9759 except: 9760 raise 9761 ctx = args[0].ctx 9762 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)) 9763 obj = map(ctx=ctx, ptr=res) 9764 return obj 9765 raise Error 9766 def lex_lt_at(*args): 9767 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9768 args = list(args) 9769 try: 9770 if not args[0].__class__ is map: 9771 args[0] = map(args[0]) 9772 except: 9773 raise 9774 ctx = args[0].ctx 9775 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)) 9776 obj = map(ctx=ctx, ptr=res) 9777 return obj 9778 raise Error 9779 def lexmax(arg0): 9780 try: 9781 if not arg0.__class__ is map: 9782 arg0 = map(arg0) 9783 except: 9784 raise 9785 ctx = arg0.ctx 9786 res = isl.isl_map_lexmax(isl.isl_map_copy(arg0.ptr)) 9787 obj = map(ctx=ctx, ptr=res) 9788 return obj 9789 def lexmax_pw_multi_aff(arg0): 9790 try: 9791 if not arg0.__class__ is map: 9792 arg0 = map(arg0) 9793 except: 9794 raise 9795 ctx = arg0.ctx 9796 res = isl.isl_map_lexmax_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 9797 obj = pw_multi_aff(ctx=ctx, ptr=res) 9798 return obj 9799 def lexmin(arg0): 9800 try: 9801 if not arg0.__class__ is map: 9802 arg0 = map(arg0) 9803 except: 9804 raise 9805 ctx = arg0.ctx 9806 res = isl.isl_map_lexmin(isl.isl_map_copy(arg0.ptr)) 9807 obj = map(ctx=ctx, ptr=res) 9808 return obj 9809 def lexmin_pw_multi_aff(arg0): 9810 try: 9811 if not arg0.__class__ is map: 9812 arg0 = map(arg0) 9813 except: 9814 raise 9815 ctx = arg0.ctx 9816 res = isl.isl_map_lexmin_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 9817 obj = pw_multi_aff(ctx=ctx, ptr=res) 9818 return obj 9819 def lower_bound(*args): 9820 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9821 args = list(args) 9822 try: 9823 if not args[0].__class__ is map: 9824 args[0] = map(args[0]) 9825 except: 9826 raise 9827 ctx = args[0].ctx 9828 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)) 9829 obj = map(ctx=ctx, ptr=res) 9830 return obj 9831 raise Error 9832 def max_multi_pw_aff(arg0): 9833 try: 9834 if not arg0.__class__ is map: 9835 arg0 = map(arg0) 9836 except: 9837 raise 9838 ctx = arg0.ctx 9839 res = isl.isl_map_max_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 9840 obj = multi_pw_aff(ctx=ctx, ptr=res) 9841 return obj 9842 def min_multi_pw_aff(arg0): 9843 try: 9844 if not arg0.__class__ is map: 9845 arg0 = map(arg0) 9846 except: 9847 raise 9848 ctx = arg0.ctx 9849 res = isl.isl_map_min_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 9850 obj = multi_pw_aff(ctx=ctx, ptr=res) 9851 return obj 9852 def n_basic_map(arg0): 9853 try: 9854 if not arg0.__class__ is map: 9855 arg0 = map(arg0) 9856 except: 9857 raise 9858 ctx = arg0.ctx 9859 res = isl.isl_map_n_basic_map(arg0.ptr) 9860 if res < 0: 9861 raise Error 9862 return int(res) 9863 def params(arg0): 9864 try: 9865 if not arg0.__class__ is map: 9866 arg0 = map(arg0) 9867 except: 9868 raise 9869 ctx = arg0.ctx 9870 res = isl.isl_map_params(isl.isl_map_copy(arg0.ptr)) 9871 obj = set(ctx=ctx, ptr=res) 9872 return obj 9873 def polyhedral_hull(arg0): 9874 try: 9875 if not arg0.__class__ is map: 9876 arg0 = map(arg0) 9877 except: 9878 raise 9879 ctx = arg0.ctx 9880 res = isl.isl_map_polyhedral_hull(isl.isl_map_copy(arg0.ptr)) 9881 obj = basic_map(ctx=ctx, ptr=res) 9882 return obj 9883 def preimage_domain(*args): 9884 if len(args) == 2 and args[1].__class__ is multi_aff: 9885 args = list(args) 9886 try: 9887 if not args[0].__class__ is map: 9888 args[0] = map(args[0]) 9889 except: 9890 raise 9891 ctx = args[0].ctx 9892 res = isl.isl_map_preimage_domain_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 9893 obj = map(ctx=ctx, ptr=res) 9894 return obj 9895 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 9896 args = list(args) 9897 try: 9898 if not args[0].__class__ is map: 9899 args[0] = map(args[0]) 9900 except: 9901 raise 9902 ctx = args[0].ctx 9903 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)) 9904 obj = map(ctx=ctx, ptr=res) 9905 return obj 9906 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 9907 args = list(args) 9908 try: 9909 if not args[0].__class__ is map: 9910 args[0] = map(args[0]) 9911 except: 9912 raise 9913 ctx = args[0].ctx 9914 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)) 9915 obj = map(ctx=ctx, ptr=res) 9916 return obj 9917 raise Error 9918 def preimage_range(*args): 9919 if len(args) == 2 and args[1].__class__ is multi_aff: 9920 args = list(args) 9921 try: 9922 if not args[0].__class__ is map: 9923 args[0] = map(args[0]) 9924 except: 9925 raise 9926 ctx = args[0].ctx 9927 res = isl.isl_map_preimage_range_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 9928 obj = map(ctx=ctx, ptr=res) 9929 return obj 9930 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 9931 args = list(args) 9932 try: 9933 if not args[0].__class__ is map: 9934 args[0] = map(args[0]) 9935 except: 9936 raise 9937 ctx = args[0].ctx 9938 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)) 9939 obj = map(ctx=ctx, ptr=res) 9940 return obj 9941 raise Error 9942 def product(arg0, arg1): 9943 try: 9944 if not arg0.__class__ is map: 9945 arg0 = map(arg0) 9946 except: 9947 raise 9948 try: 9949 if not arg1.__class__ is map: 9950 arg1 = map(arg1) 9951 except: 9952 return union_map(arg0).product(arg1) 9953 ctx = arg0.ctx 9954 res = isl.isl_map_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 9955 obj = map(ctx=ctx, ptr=res) 9956 return obj 9957 def project_out_all_params(arg0): 9958 try: 9959 if not arg0.__class__ is map: 9960 arg0 = map(arg0) 9961 except: 9962 raise 9963 ctx = arg0.ctx 9964 res = isl.isl_map_project_out_all_params(isl.isl_map_copy(arg0.ptr)) 9965 obj = map(ctx=ctx, ptr=res) 9966 return obj 9967 def project_out_param(*args): 9968 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 9969 args = list(args) 9970 try: 9971 if not args[0].__class__ is map: 9972 args[0] = map(args[0]) 9973 except: 9974 raise 9975 try: 9976 if not args[1].__class__ is id: 9977 args[1] = id(args[1]) 9978 except: 9979 raise 9980 ctx = args[0].ctx 9981 res = isl.isl_map_project_out_param_id(isl.isl_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 9982 obj = map(ctx=ctx, ptr=res) 9983 return obj 9984 if len(args) == 2 and args[1].__class__ is id_list: 9985 args = list(args) 9986 try: 9987 if not args[0].__class__ is map: 9988 args[0] = map(args[0]) 9989 except: 9990 raise 9991 ctx = args[0].ctx 9992 res = isl.isl_map_project_out_param_id_list(isl.isl_map_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 9993 obj = map(ctx=ctx, ptr=res) 9994 return obj 9995 raise Error 9996 def range(arg0): 9997 try: 9998 if not arg0.__class__ is map: 9999 arg0 = map(arg0) 10000 except: 10001 raise 10002 ctx = arg0.ctx 10003 res = isl.isl_map_range(isl.isl_map_copy(arg0.ptr)) 10004 obj = set(ctx=ctx, ptr=res) 10005 return obj 10006 def range_factor_domain(arg0): 10007 try: 10008 if not arg0.__class__ is map: 10009 arg0 = map(arg0) 10010 except: 10011 raise 10012 ctx = arg0.ctx 10013 res = isl.isl_map_range_factor_domain(isl.isl_map_copy(arg0.ptr)) 10014 obj = map(ctx=ctx, ptr=res) 10015 return obj 10016 def range_factor_range(arg0): 10017 try: 10018 if not arg0.__class__ is map: 10019 arg0 = map(arg0) 10020 except: 10021 raise 10022 ctx = arg0.ctx 10023 res = isl.isl_map_range_factor_range(isl.isl_map_copy(arg0.ptr)) 10024 obj = map(ctx=ctx, ptr=res) 10025 return obj 10026 def range_lattice_tile(arg0): 10027 try: 10028 if not arg0.__class__ is map: 10029 arg0 = map(arg0) 10030 except: 10031 raise 10032 ctx = arg0.ctx 10033 res = isl.isl_map_get_range_lattice_tile(arg0.ptr) 10034 obj = fixed_box(ctx=ctx, ptr=res) 10035 return obj 10036 def get_range_lattice_tile(arg0): 10037 return arg0.range_lattice_tile() 10038 def range_product(arg0, arg1): 10039 try: 10040 if not arg0.__class__ is map: 10041 arg0 = map(arg0) 10042 except: 10043 raise 10044 try: 10045 if not arg1.__class__ is map: 10046 arg1 = map(arg1) 10047 except: 10048 return union_map(arg0).range_product(arg1) 10049 ctx = arg0.ctx 10050 res = isl.isl_map_range_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 10051 obj = map(ctx=ctx, ptr=res) 10052 return obj 10053 def range_reverse(arg0): 10054 try: 10055 if not arg0.__class__ is map: 10056 arg0 = map(arg0) 10057 except: 10058 raise 10059 ctx = arg0.ctx 10060 res = isl.isl_map_range_reverse(isl.isl_map_copy(arg0.ptr)) 10061 obj = map(ctx=ctx, ptr=res) 10062 return obj 10063 def range_simple_fixed_box_hull(arg0): 10064 try: 10065 if not arg0.__class__ is map: 10066 arg0 = map(arg0) 10067 except: 10068 raise 10069 ctx = arg0.ctx 10070 res = isl.isl_map_get_range_simple_fixed_box_hull(arg0.ptr) 10071 obj = fixed_box(ctx=ctx, ptr=res) 10072 return obj 10073 def get_range_simple_fixed_box_hull(arg0): 10074 return arg0.range_simple_fixed_box_hull() 10075 def range_tuple_dim(arg0): 10076 try: 10077 if not arg0.__class__ is map: 10078 arg0 = map(arg0) 10079 except: 10080 raise 10081 ctx = arg0.ctx 10082 res = isl.isl_map_range_tuple_dim(arg0.ptr) 10083 if res < 0: 10084 raise Error 10085 return int(res) 10086 def range_tuple_id(arg0): 10087 try: 10088 if not arg0.__class__ is map: 10089 arg0 = map(arg0) 10090 except: 10091 raise 10092 ctx = arg0.ctx 10093 res = isl.isl_map_get_range_tuple_id(arg0.ptr) 10094 obj = id(ctx=ctx, ptr=res) 10095 return obj 10096 def get_range_tuple_id(arg0): 10097 return arg0.range_tuple_id() 10098 def reverse(arg0): 10099 try: 10100 if not arg0.__class__ is map: 10101 arg0 = map(arg0) 10102 except: 10103 raise 10104 ctx = arg0.ctx 10105 res = isl.isl_map_reverse(isl.isl_map_copy(arg0.ptr)) 10106 obj = map(ctx=ctx, ptr=res) 10107 return obj 10108 def sample(arg0): 10109 try: 10110 if not arg0.__class__ is map: 10111 arg0 = map(arg0) 10112 except: 10113 raise 10114 ctx = arg0.ctx 10115 res = isl.isl_map_sample(isl.isl_map_copy(arg0.ptr)) 10116 obj = basic_map(ctx=ctx, ptr=res) 10117 return obj 10118 def set_domain_tuple(*args): 10119 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 10120 args = list(args) 10121 try: 10122 if not args[0].__class__ is map: 10123 args[0] = map(args[0]) 10124 except: 10125 raise 10126 try: 10127 if not args[1].__class__ is id: 10128 args[1] = id(args[1]) 10129 except: 10130 raise 10131 ctx = args[0].ctx 10132 res = isl.isl_map_set_domain_tuple_id(isl.isl_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 10133 obj = map(ctx=ctx, ptr=res) 10134 return obj 10135 raise Error 10136 def set_range_tuple(*args): 10137 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 10138 args = list(args) 10139 try: 10140 if not args[0].__class__ is map: 10141 args[0] = map(args[0]) 10142 except: 10143 raise 10144 try: 10145 if not args[1].__class__ is id: 10146 args[1] = id(args[1]) 10147 except: 10148 raise 10149 ctx = args[0].ctx 10150 res = isl.isl_map_set_range_tuple_id(isl.isl_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 10151 obj = map(ctx=ctx, ptr=res) 10152 return obj 10153 raise Error 10154 def space(arg0): 10155 try: 10156 if not arg0.__class__ is map: 10157 arg0 = map(arg0) 10158 except: 10159 raise 10160 ctx = arg0.ctx 10161 res = isl.isl_map_get_space(arg0.ptr) 10162 obj = space(ctx=ctx, ptr=res) 10163 return obj 10164 def get_space(arg0): 10165 return arg0.space() 10166 def subtract(arg0, arg1): 10167 try: 10168 if not arg0.__class__ is map: 10169 arg0 = map(arg0) 10170 except: 10171 raise 10172 try: 10173 if not arg1.__class__ is map: 10174 arg1 = map(arg1) 10175 except: 10176 return union_map(arg0).subtract(arg1) 10177 ctx = arg0.ctx 10178 res = isl.isl_map_subtract(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 10179 obj = map(ctx=ctx, ptr=res) 10180 return obj 10181 def to_list(arg0): 10182 try: 10183 if not arg0.__class__ is map: 10184 arg0 = map(arg0) 10185 except: 10186 raise 10187 ctx = arg0.ctx 10188 res = isl.isl_map_to_list(isl.isl_map_copy(arg0.ptr)) 10189 obj = map_list(ctx=ctx, ptr=res) 10190 return obj 10191 def to_union_map(arg0): 10192 try: 10193 if not arg0.__class__ is map: 10194 arg0 = map(arg0) 10195 except: 10196 raise 10197 ctx = arg0.ctx 10198 res = isl.isl_map_to_union_map(isl.isl_map_copy(arg0.ptr)) 10199 obj = union_map(ctx=ctx, ptr=res) 10200 return obj 10201 def uncurry(arg0): 10202 try: 10203 if not arg0.__class__ is map: 10204 arg0 = map(arg0) 10205 except: 10206 raise 10207 ctx = arg0.ctx 10208 res = isl.isl_map_uncurry(isl.isl_map_copy(arg0.ptr)) 10209 obj = map(ctx=ctx, ptr=res) 10210 return obj 10211 def union(arg0, arg1): 10212 try: 10213 if not arg0.__class__ is map: 10214 arg0 = map(arg0) 10215 except: 10216 raise 10217 try: 10218 if not arg1.__class__ is map: 10219 arg1 = map(arg1) 10220 except: 10221 return union_map(arg0).union(arg1) 10222 ctx = arg0.ctx 10223 res = isl.isl_map_union(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 10224 obj = map(ctx=ctx, ptr=res) 10225 return obj 10226 @staticmethod 10227 def universe(arg0): 10228 try: 10229 if not arg0.__class__ is space: 10230 arg0 = space(arg0) 10231 except: 10232 raise 10233 ctx = arg0.ctx 10234 res = isl.isl_map_universe(isl.isl_space_copy(arg0.ptr)) 10235 obj = map(ctx=ctx, ptr=res) 10236 return obj 10237 def unshifted_simple_hull(arg0): 10238 try: 10239 if not arg0.__class__ is map: 10240 arg0 = map(arg0) 10241 except: 10242 raise 10243 ctx = arg0.ctx 10244 res = isl.isl_map_unshifted_simple_hull(isl.isl_map_copy(arg0.ptr)) 10245 obj = basic_map(ctx=ctx, ptr=res) 10246 return obj 10247 def upper_bound(*args): 10248 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 10249 args = list(args) 10250 try: 10251 if not args[0].__class__ is map: 10252 args[0] = map(args[0]) 10253 except: 10254 raise 10255 ctx = args[0].ctx 10256 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)) 10257 obj = map(ctx=ctx, ptr=res) 10258 return obj 10259 raise Error 10260 def wrap(arg0): 10261 try: 10262 if not arg0.__class__ is map: 10263 arg0 = map(arg0) 10264 except: 10265 raise 10266 ctx = arg0.ctx 10267 res = isl.isl_map_wrap(isl.isl_map_copy(arg0.ptr)) 10268 obj = set(ctx=ctx, ptr=res) 10269 return obj 10270 def zip(arg0): 10271 try: 10272 if not arg0.__class__ is map: 10273 arg0 = map(arg0) 10274 except: 10275 raise 10276 ctx = arg0.ctx 10277 res = isl.isl_map_zip(isl.isl_map_copy(arg0.ptr)) 10278 obj = map(ctx=ctx, ptr=res) 10279 return obj 10280 10281isl.isl_map_from_basic_map.restype = c_void_p 10282isl.isl_map_from_basic_map.argtypes = [c_void_p] 10283isl.isl_map_read_from_str.restype = c_void_p 10284isl.isl_map_read_from_str.argtypes = [Context, c_char_p] 10285isl.isl_map_affine_hull.restype = c_void_p 10286isl.isl_map_affine_hull.argtypes = [c_void_p] 10287isl.isl_map_apply_domain.restype = c_void_p 10288isl.isl_map_apply_domain.argtypes = [c_void_p, c_void_p] 10289isl.isl_map_apply_range.restype = c_void_p 10290isl.isl_map_apply_range.argtypes = [c_void_p, c_void_p] 10291isl.isl_map_as_pw_multi_aff.restype = c_void_p 10292isl.isl_map_as_pw_multi_aff.argtypes = [c_void_p] 10293isl.isl_map_bind_domain.restype = c_void_p 10294isl.isl_map_bind_domain.argtypes = [c_void_p, c_void_p] 10295isl.isl_map_bind_range.restype = c_void_p 10296isl.isl_map_bind_range.argtypes = [c_void_p, c_void_p] 10297isl.isl_map_coalesce.restype = c_void_p 10298isl.isl_map_coalesce.argtypes = [c_void_p] 10299isl.isl_map_complement.restype = c_void_p 10300isl.isl_map_complement.argtypes = [c_void_p] 10301isl.isl_map_curry.restype = c_void_p 10302isl.isl_map_curry.argtypes = [c_void_p] 10303isl.isl_map_deltas.restype = c_void_p 10304isl.isl_map_deltas.argtypes = [c_void_p] 10305isl.isl_map_detect_equalities.restype = c_void_p 10306isl.isl_map_detect_equalities.argtypes = [c_void_p] 10307isl.isl_map_domain.restype = c_void_p 10308isl.isl_map_domain.argtypes = [c_void_p] 10309isl.isl_map_domain_factor_domain.restype = c_void_p 10310isl.isl_map_domain_factor_domain.argtypes = [c_void_p] 10311isl.isl_map_domain_factor_range.restype = c_void_p 10312isl.isl_map_domain_factor_range.argtypes = [c_void_p] 10313isl.isl_map_domain_product.restype = c_void_p 10314isl.isl_map_domain_product.argtypes = [c_void_p, c_void_p] 10315isl.isl_map_domain_reverse.restype = c_void_p 10316isl.isl_map_domain_reverse.argtypes = [c_void_p] 10317isl.isl_map_domain_tuple_dim.argtypes = [c_void_p] 10318isl.isl_map_get_domain_tuple_id.restype = c_void_p 10319isl.isl_map_get_domain_tuple_id.argtypes = [c_void_p] 10320isl.isl_map_drop_unused_params.restype = c_void_p 10321isl.isl_map_drop_unused_params.argtypes = [c_void_p] 10322isl.isl_map_empty.restype = c_void_p 10323isl.isl_map_empty.argtypes = [c_void_p] 10324isl.isl_map_eq_at_multi_pw_aff.restype = c_void_p 10325isl.isl_map_eq_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10326isl.isl_map_factor_domain.restype = c_void_p 10327isl.isl_map_factor_domain.argtypes = [c_void_p] 10328isl.isl_map_factor_range.restype = c_void_p 10329isl.isl_map_factor_range.argtypes = [c_void_p] 10330isl.isl_map_fixed_power_val.restype = c_void_p 10331isl.isl_map_fixed_power_val.argtypes = [c_void_p, c_void_p] 10332isl.isl_map_flatten.restype = c_void_p 10333isl.isl_map_flatten.argtypes = [c_void_p] 10334isl.isl_map_flatten_domain.restype = c_void_p 10335isl.isl_map_flatten_domain.argtypes = [c_void_p] 10336isl.isl_map_flatten_range.restype = c_void_p 10337isl.isl_map_flatten_range.argtypes = [c_void_p] 10338isl.isl_map_foreach_basic_map.argtypes = [c_void_p, c_void_p, c_void_p] 10339isl.isl_map_gist.restype = c_void_p 10340isl.isl_map_gist.argtypes = [c_void_p, c_void_p] 10341isl.isl_map_gist_domain.restype = c_void_p 10342isl.isl_map_gist_domain.argtypes = [c_void_p, c_void_p] 10343isl.isl_map_gist_params.restype = c_void_p 10344isl.isl_map_gist_params.argtypes = [c_void_p, c_void_p] 10345isl.isl_map_has_domain_tuple_id.argtypes = [c_void_p] 10346isl.isl_map_has_range_tuple_id.argtypes = [c_void_p] 10347isl.isl_map_intersect.restype = c_void_p 10348isl.isl_map_intersect.argtypes = [c_void_p, c_void_p] 10349isl.isl_map_intersect_domain.restype = c_void_p 10350isl.isl_map_intersect_domain.argtypes = [c_void_p, c_void_p] 10351isl.isl_map_intersect_domain_factor_domain.restype = c_void_p 10352isl.isl_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 10353isl.isl_map_intersect_domain_factor_range.restype = c_void_p 10354isl.isl_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 10355isl.isl_map_intersect_domain_wrapped_domain.restype = c_void_p 10356isl.isl_map_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 10357isl.isl_map_intersect_params.restype = c_void_p 10358isl.isl_map_intersect_params.argtypes = [c_void_p, c_void_p] 10359isl.isl_map_intersect_range.restype = c_void_p 10360isl.isl_map_intersect_range.argtypes = [c_void_p, c_void_p] 10361isl.isl_map_intersect_range_factor_domain.restype = c_void_p 10362isl.isl_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 10363isl.isl_map_intersect_range_factor_range.restype = c_void_p 10364isl.isl_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 10365isl.isl_map_intersect_range_wrapped_domain.restype = c_void_p 10366isl.isl_map_intersect_range_wrapped_domain.argtypes = [c_void_p, c_void_p] 10367isl.isl_map_is_bijective.argtypes = [c_void_p] 10368isl.isl_map_is_disjoint.argtypes = [c_void_p, c_void_p] 10369isl.isl_map_is_empty.argtypes = [c_void_p] 10370isl.isl_map_is_equal.argtypes = [c_void_p, c_void_p] 10371isl.isl_map_is_injective.argtypes = [c_void_p] 10372isl.isl_map_is_single_valued.argtypes = [c_void_p] 10373isl.isl_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 10374isl.isl_map_is_subset.argtypes = [c_void_p, c_void_p] 10375isl.isl_map_lex_ge_at_multi_pw_aff.restype = c_void_p 10376isl.isl_map_lex_ge_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10377isl.isl_map_lex_gt_at_multi_pw_aff.restype = c_void_p 10378isl.isl_map_lex_gt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10379isl.isl_map_lex_le_at_multi_pw_aff.restype = c_void_p 10380isl.isl_map_lex_le_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10381isl.isl_map_lex_lt_at_multi_pw_aff.restype = c_void_p 10382isl.isl_map_lex_lt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10383isl.isl_map_lexmax.restype = c_void_p 10384isl.isl_map_lexmax.argtypes = [c_void_p] 10385isl.isl_map_lexmax_pw_multi_aff.restype = c_void_p 10386isl.isl_map_lexmax_pw_multi_aff.argtypes = [c_void_p] 10387isl.isl_map_lexmin.restype = c_void_p 10388isl.isl_map_lexmin.argtypes = [c_void_p] 10389isl.isl_map_lexmin_pw_multi_aff.restype = c_void_p 10390isl.isl_map_lexmin_pw_multi_aff.argtypes = [c_void_p] 10391isl.isl_map_lower_bound_multi_pw_aff.restype = c_void_p 10392isl.isl_map_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10393isl.isl_map_max_multi_pw_aff.restype = c_void_p 10394isl.isl_map_max_multi_pw_aff.argtypes = [c_void_p] 10395isl.isl_map_min_multi_pw_aff.restype = c_void_p 10396isl.isl_map_min_multi_pw_aff.argtypes = [c_void_p] 10397isl.isl_map_n_basic_map.argtypes = [c_void_p] 10398isl.isl_map_params.restype = c_void_p 10399isl.isl_map_params.argtypes = [c_void_p] 10400isl.isl_map_polyhedral_hull.restype = c_void_p 10401isl.isl_map_polyhedral_hull.argtypes = [c_void_p] 10402isl.isl_map_preimage_domain_multi_aff.restype = c_void_p 10403isl.isl_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 10404isl.isl_map_preimage_domain_multi_pw_aff.restype = c_void_p 10405isl.isl_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10406isl.isl_map_preimage_domain_pw_multi_aff.restype = c_void_p 10407isl.isl_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10408isl.isl_map_preimage_range_multi_aff.restype = c_void_p 10409isl.isl_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 10410isl.isl_map_preimage_range_pw_multi_aff.restype = c_void_p 10411isl.isl_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10412isl.isl_map_product.restype = c_void_p 10413isl.isl_map_product.argtypes = [c_void_p, c_void_p] 10414isl.isl_map_project_out_all_params.restype = c_void_p 10415isl.isl_map_project_out_all_params.argtypes = [c_void_p] 10416isl.isl_map_project_out_param_id.restype = c_void_p 10417isl.isl_map_project_out_param_id.argtypes = [c_void_p, c_void_p] 10418isl.isl_map_project_out_param_id_list.restype = c_void_p 10419isl.isl_map_project_out_param_id_list.argtypes = [c_void_p, c_void_p] 10420isl.isl_map_range.restype = c_void_p 10421isl.isl_map_range.argtypes = [c_void_p] 10422isl.isl_map_range_factor_domain.restype = c_void_p 10423isl.isl_map_range_factor_domain.argtypes = [c_void_p] 10424isl.isl_map_range_factor_range.restype = c_void_p 10425isl.isl_map_range_factor_range.argtypes = [c_void_p] 10426isl.isl_map_get_range_lattice_tile.restype = c_void_p 10427isl.isl_map_get_range_lattice_tile.argtypes = [c_void_p] 10428isl.isl_map_range_product.restype = c_void_p 10429isl.isl_map_range_product.argtypes = [c_void_p, c_void_p] 10430isl.isl_map_range_reverse.restype = c_void_p 10431isl.isl_map_range_reverse.argtypes = [c_void_p] 10432isl.isl_map_get_range_simple_fixed_box_hull.restype = c_void_p 10433isl.isl_map_get_range_simple_fixed_box_hull.argtypes = [c_void_p] 10434isl.isl_map_range_tuple_dim.argtypes = [c_void_p] 10435isl.isl_map_get_range_tuple_id.restype = c_void_p 10436isl.isl_map_get_range_tuple_id.argtypes = [c_void_p] 10437isl.isl_map_reverse.restype = c_void_p 10438isl.isl_map_reverse.argtypes = [c_void_p] 10439isl.isl_map_sample.restype = c_void_p 10440isl.isl_map_sample.argtypes = [c_void_p] 10441isl.isl_map_set_domain_tuple_id.restype = c_void_p 10442isl.isl_map_set_domain_tuple_id.argtypes = [c_void_p, c_void_p] 10443isl.isl_map_set_range_tuple_id.restype = c_void_p 10444isl.isl_map_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 10445isl.isl_map_get_space.restype = c_void_p 10446isl.isl_map_get_space.argtypes = [c_void_p] 10447isl.isl_map_subtract.restype = c_void_p 10448isl.isl_map_subtract.argtypes = [c_void_p, c_void_p] 10449isl.isl_map_to_list.restype = c_void_p 10450isl.isl_map_to_list.argtypes = [c_void_p] 10451isl.isl_map_to_union_map.restype = c_void_p 10452isl.isl_map_to_union_map.argtypes = [c_void_p] 10453isl.isl_map_uncurry.restype = c_void_p 10454isl.isl_map_uncurry.argtypes = [c_void_p] 10455isl.isl_map_union.restype = c_void_p 10456isl.isl_map_union.argtypes = [c_void_p, c_void_p] 10457isl.isl_map_universe.restype = c_void_p 10458isl.isl_map_universe.argtypes = [c_void_p] 10459isl.isl_map_unshifted_simple_hull.restype = c_void_p 10460isl.isl_map_unshifted_simple_hull.argtypes = [c_void_p] 10461isl.isl_map_upper_bound_multi_pw_aff.restype = c_void_p 10462isl.isl_map_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10463isl.isl_map_wrap.restype = c_void_p 10464isl.isl_map_wrap.argtypes = [c_void_p] 10465isl.isl_map_zip.restype = c_void_p 10466isl.isl_map_zip.argtypes = [c_void_p] 10467isl.isl_map_copy.restype = c_void_p 10468isl.isl_map_copy.argtypes = [c_void_p] 10469isl.isl_map_free.restype = c_void_p 10470isl.isl_map_free.argtypes = [c_void_p] 10471isl.isl_map_to_str.restype = POINTER(c_char) 10472isl.isl_map_to_str.argtypes = [c_void_p] 10473 10474class basic_map(map): 10475 def __init__(self, *args, **keywords): 10476 if "ptr" in keywords: 10477 self.ctx = keywords["ctx"] 10478 self.ptr = keywords["ptr"] 10479 return 10480 if len(args) == 1 and type(args[0]) == str: 10481 self.ctx = Context.getDefaultInstance() 10482 self.ptr = isl.isl_basic_map_read_from_str(self.ctx, args[0].encode('ascii')) 10483 return 10484 raise Error 10485 def __del__(self): 10486 if hasattr(self, 'ptr'): 10487 isl.isl_basic_map_free(self.ptr) 10488 def __str__(arg0): 10489 try: 10490 if not arg0.__class__ is basic_map: 10491 arg0 = basic_map(arg0) 10492 except: 10493 raise 10494 ptr = isl.isl_basic_map_to_str(arg0.ptr) 10495 res = cast(ptr, c_char_p).value.decode('ascii') 10496 libc.free(ptr) 10497 return res 10498 def __repr__(self): 10499 s = str(self) 10500 if '"' in s: 10501 return 'isl.basic_map("""%s""")' % s 10502 else: 10503 return 'isl.basic_map("%s")' % s 10504 def affine_hull(arg0): 10505 try: 10506 if not arg0.__class__ is basic_map: 10507 arg0 = basic_map(arg0) 10508 except: 10509 raise 10510 ctx = arg0.ctx 10511 res = isl.isl_basic_map_affine_hull(isl.isl_basic_map_copy(arg0.ptr)) 10512 obj = basic_map(ctx=ctx, ptr=res) 10513 return obj 10514 def apply_domain(arg0, arg1): 10515 try: 10516 if not arg0.__class__ is basic_map: 10517 arg0 = basic_map(arg0) 10518 except: 10519 raise 10520 try: 10521 if not arg1.__class__ is basic_map: 10522 arg1 = basic_map(arg1) 10523 except: 10524 return map(arg0).apply_domain(arg1) 10525 ctx = arg0.ctx 10526 res = isl.isl_basic_map_apply_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10527 obj = basic_map(ctx=ctx, ptr=res) 10528 return obj 10529 def apply_range(arg0, arg1): 10530 try: 10531 if not arg0.__class__ is basic_map: 10532 arg0 = basic_map(arg0) 10533 except: 10534 raise 10535 try: 10536 if not arg1.__class__ is basic_map: 10537 arg1 = basic_map(arg1) 10538 except: 10539 return map(arg0).apply_range(arg1) 10540 ctx = arg0.ctx 10541 res = isl.isl_basic_map_apply_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10542 obj = basic_map(ctx=ctx, ptr=res) 10543 return obj 10544 def deltas(arg0): 10545 try: 10546 if not arg0.__class__ is basic_map: 10547 arg0 = basic_map(arg0) 10548 except: 10549 raise 10550 ctx = arg0.ctx 10551 res = isl.isl_basic_map_deltas(isl.isl_basic_map_copy(arg0.ptr)) 10552 obj = basic_set(ctx=ctx, ptr=res) 10553 return obj 10554 def detect_equalities(arg0): 10555 try: 10556 if not arg0.__class__ is basic_map: 10557 arg0 = basic_map(arg0) 10558 except: 10559 raise 10560 ctx = arg0.ctx 10561 res = isl.isl_basic_map_detect_equalities(isl.isl_basic_map_copy(arg0.ptr)) 10562 obj = basic_map(ctx=ctx, ptr=res) 10563 return obj 10564 def flatten(arg0): 10565 try: 10566 if not arg0.__class__ is basic_map: 10567 arg0 = basic_map(arg0) 10568 except: 10569 raise 10570 ctx = arg0.ctx 10571 res = isl.isl_basic_map_flatten(isl.isl_basic_map_copy(arg0.ptr)) 10572 obj = basic_map(ctx=ctx, ptr=res) 10573 return obj 10574 def flatten_domain(arg0): 10575 try: 10576 if not arg0.__class__ is basic_map: 10577 arg0 = basic_map(arg0) 10578 except: 10579 raise 10580 ctx = arg0.ctx 10581 res = isl.isl_basic_map_flatten_domain(isl.isl_basic_map_copy(arg0.ptr)) 10582 obj = basic_map(ctx=ctx, ptr=res) 10583 return obj 10584 def flatten_range(arg0): 10585 try: 10586 if not arg0.__class__ is basic_map: 10587 arg0 = basic_map(arg0) 10588 except: 10589 raise 10590 ctx = arg0.ctx 10591 res = isl.isl_basic_map_flatten_range(isl.isl_basic_map_copy(arg0.ptr)) 10592 obj = basic_map(ctx=ctx, ptr=res) 10593 return obj 10594 def gist(arg0, arg1): 10595 try: 10596 if not arg0.__class__ is basic_map: 10597 arg0 = basic_map(arg0) 10598 except: 10599 raise 10600 try: 10601 if not arg1.__class__ is basic_map: 10602 arg1 = basic_map(arg1) 10603 except: 10604 return map(arg0).gist(arg1) 10605 ctx = arg0.ctx 10606 res = isl.isl_basic_map_gist(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10607 obj = basic_map(ctx=ctx, ptr=res) 10608 return obj 10609 def intersect(arg0, arg1): 10610 try: 10611 if not arg0.__class__ is basic_map: 10612 arg0 = basic_map(arg0) 10613 except: 10614 raise 10615 try: 10616 if not arg1.__class__ is basic_map: 10617 arg1 = basic_map(arg1) 10618 except: 10619 return map(arg0).intersect(arg1) 10620 ctx = arg0.ctx 10621 res = isl.isl_basic_map_intersect(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10622 obj = basic_map(ctx=ctx, ptr=res) 10623 return obj 10624 def intersect_domain(arg0, arg1): 10625 try: 10626 if not arg0.__class__ is basic_map: 10627 arg0 = basic_map(arg0) 10628 except: 10629 raise 10630 try: 10631 if not arg1.__class__ is basic_set: 10632 arg1 = basic_set(arg1) 10633 except: 10634 return map(arg0).intersect_domain(arg1) 10635 ctx = arg0.ctx 10636 res = isl.isl_basic_map_intersect_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10637 obj = basic_map(ctx=ctx, ptr=res) 10638 return obj 10639 def intersect_range(arg0, arg1): 10640 try: 10641 if not arg0.__class__ is basic_map: 10642 arg0 = basic_map(arg0) 10643 except: 10644 raise 10645 try: 10646 if not arg1.__class__ is basic_set: 10647 arg1 = basic_set(arg1) 10648 except: 10649 return map(arg0).intersect_range(arg1) 10650 ctx = arg0.ctx 10651 res = isl.isl_basic_map_intersect_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 10652 obj = basic_map(ctx=ctx, ptr=res) 10653 return obj 10654 def is_empty(arg0): 10655 try: 10656 if not arg0.__class__ is basic_map: 10657 arg0 = basic_map(arg0) 10658 except: 10659 raise 10660 ctx = arg0.ctx 10661 res = isl.isl_basic_map_is_empty(arg0.ptr) 10662 if res < 0: 10663 raise Error 10664 return bool(res) 10665 def is_equal(arg0, arg1): 10666 try: 10667 if not arg0.__class__ is basic_map: 10668 arg0 = basic_map(arg0) 10669 except: 10670 raise 10671 try: 10672 if not arg1.__class__ is basic_map: 10673 arg1 = basic_map(arg1) 10674 except: 10675 return map(arg0).is_equal(arg1) 10676 ctx = arg0.ctx 10677 res = isl.isl_basic_map_is_equal(arg0.ptr, arg1.ptr) 10678 if res < 0: 10679 raise Error 10680 return bool(res) 10681 def is_subset(arg0, arg1): 10682 try: 10683 if not arg0.__class__ is basic_map: 10684 arg0 = basic_map(arg0) 10685 except: 10686 raise 10687 try: 10688 if not arg1.__class__ is basic_map: 10689 arg1 = basic_map(arg1) 10690 except: 10691 return map(arg0).is_subset(arg1) 10692 ctx = arg0.ctx 10693 res = isl.isl_basic_map_is_subset(arg0.ptr, arg1.ptr) 10694 if res < 0: 10695 raise Error 10696 return bool(res) 10697 def lexmax(arg0): 10698 try: 10699 if not arg0.__class__ is basic_map: 10700 arg0 = basic_map(arg0) 10701 except: 10702 raise 10703 ctx = arg0.ctx 10704 res = isl.isl_basic_map_lexmax(isl.isl_basic_map_copy(arg0.ptr)) 10705 obj = map(ctx=ctx, ptr=res) 10706 return obj 10707 def lexmin(arg0): 10708 try: 10709 if not arg0.__class__ is basic_map: 10710 arg0 = basic_map(arg0) 10711 except: 10712 raise 10713 ctx = arg0.ctx 10714 res = isl.isl_basic_map_lexmin(isl.isl_basic_map_copy(arg0.ptr)) 10715 obj = map(ctx=ctx, ptr=res) 10716 return obj 10717 def reverse(arg0): 10718 try: 10719 if not arg0.__class__ is basic_map: 10720 arg0 = basic_map(arg0) 10721 except: 10722 raise 10723 ctx = arg0.ctx 10724 res = isl.isl_basic_map_reverse(isl.isl_basic_map_copy(arg0.ptr)) 10725 obj = basic_map(ctx=ctx, ptr=res) 10726 return obj 10727 def sample(arg0): 10728 try: 10729 if not arg0.__class__ is basic_map: 10730 arg0 = basic_map(arg0) 10731 except: 10732 raise 10733 ctx = arg0.ctx 10734 res = isl.isl_basic_map_sample(isl.isl_basic_map_copy(arg0.ptr)) 10735 obj = basic_map(ctx=ctx, ptr=res) 10736 return obj 10737 def union(arg0, arg1): 10738 try: 10739 if not arg0.__class__ is basic_map: 10740 arg0 = basic_map(arg0) 10741 except: 10742 raise 10743 try: 10744 if not arg1.__class__ is basic_map: 10745 arg1 = basic_map(arg1) 10746 except: 10747 return map(arg0).union(arg1) 10748 ctx = arg0.ctx 10749 res = isl.isl_basic_map_union(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 10750 obj = map(ctx=ctx, ptr=res) 10751 return obj 10752 10753isl.isl_basic_map_read_from_str.restype = c_void_p 10754isl.isl_basic_map_read_from_str.argtypes = [Context, c_char_p] 10755isl.isl_basic_map_affine_hull.restype = c_void_p 10756isl.isl_basic_map_affine_hull.argtypes = [c_void_p] 10757isl.isl_basic_map_apply_domain.restype = c_void_p 10758isl.isl_basic_map_apply_domain.argtypes = [c_void_p, c_void_p] 10759isl.isl_basic_map_apply_range.restype = c_void_p 10760isl.isl_basic_map_apply_range.argtypes = [c_void_p, c_void_p] 10761isl.isl_basic_map_deltas.restype = c_void_p 10762isl.isl_basic_map_deltas.argtypes = [c_void_p] 10763isl.isl_basic_map_detect_equalities.restype = c_void_p 10764isl.isl_basic_map_detect_equalities.argtypes = [c_void_p] 10765isl.isl_basic_map_flatten.restype = c_void_p 10766isl.isl_basic_map_flatten.argtypes = [c_void_p] 10767isl.isl_basic_map_flatten_domain.restype = c_void_p 10768isl.isl_basic_map_flatten_domain.argtypes = [c_void_p] 10769isl.isl_basic_map_flatten_range.restype = c_void_p 10770isl.isl_basic_map_flatten_range.argtypes = [c_void_p] 10771isl.isl_basic_map_gist.restype = c_void_p 10772isl.isl_basic_map_gist.argtypes = [c_void_p, c_void_p] 10773isl.isl_basic_map_intersect.restype = c_void_p 10774isl.isl_basic_map_intersect.argtypes = [c_void_p, c_void_p] 10775isl.isl_basic_map_intersect_domain.restype = c_void_p 10776isl.isl_basic_map_intersect_domain.argtypes = [c_void_p, c_void_p] 10777isl.isl_basic_map_intersect_range.restype = c_void_p 10778isl.isl_basic_map_intersect_range.argtypes = [c_void_p, c_void_p] 10779isl.isl_basic_map_is_empty.argtypes = [c_void_p] 10780isl.isl_basic_map_is_equal.argtypes = [c_void_p, c_void_p] 10781isl.isl_basic_map_is_subset.argtypes = [c_void_p, c_void_p] 10782isl.isl_basic_map_lexmax.restype = c_void_p 10783isl.isl_basic_map_lexmax.argtypes = [c_void_p] 10784isl.isl_basic_map_lexmin.restype = c_void_p 10785isl.isl_basic_map_lexmin.argtypes = [c_void_p] 10786isl.isl_basic_map_reverse.restype = c_void_p 10787isl.isl_basic_map_reverse.argtypes = [c_void_p] 10788isl.isl_basic_map_sample.restype = c_void_p 10789isl.isl_basic_map_sample.argtypes = [c_void_p] 10790isl.isl_basic_map_union.restype = c_void_p 10791isl.isl_basic_map_union.argtypes = [c_void_p, c_void_p] 10792isl.isl_basic_map_copy.restype = c_void_p 10793isl.isl_basic_map_copy.argtypes = [c_void_p] 10794isl.isl_basic_map_free.restype = c_void_p 10795isl.isl_basic_map_free.argtypes = [c_void_p] 10796isl.isl_basic_map_to_str.restype = POINTER(c_char) 10797isl.isl_basic_map_to_str.argtypes = [c_void_p] 10798 10799class union_set(object): 10800 def __init__(self, *args, **keywords): 10801 if "ptr" in keywords: 10802 self.ctx = keywords["ctx"] 10803 self.ptr = keywords["ptr"] 10804 return 10805 if len(args) == 1 and args[0].__class__ is basic_set: 10806 self.ctx = Context.getDefaultInstance() 10807 self.ptr = isl.isl_union_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 10808 return 10809 if len(args) == 1 and args[0].__class__ is point: 10810 self.ctx = Context.getDefaultInstance() 10811 self.ptr = isl.isl_union_set_from_point(isl.isl_point_copy(args[0].ptr)) 10812 return 10813 if len(args) == 1 and args[0].__class__ is set: 10814 self.ctx = Context.getDefaultInstance() 10815 self.ptr = isl.isl_union_set_from_set(isl.isl_set_copy(args[0].ptr)) 10816 return 10817 if len(args) == 1 and type(args[0]) == str: 10818 self.ctx = Context.getDefaultInstance() 10819 self.ptr = isl.isl_union_set_read_from_str(self.ctx, args[0].encode('ascii')) 10820 return 10821 raise Error 10822 def __del__(self): 10823 if hasattr(self, 'ptr'): 10824 isl.isl_union_set_free(self.ptr) 10825 def __str__(arg0): 10826 try: 10827 if not arg0.__class__ is union_set: 10828 arg0 = union_set(arg0) 10829 except: 10830 raise 10831 ptr = isl.isl_union_set_to_str(arg0.ptr) 10832 res = cast(ptr, c_char_p).value.decode('ascii') 10833 libc.free(ptr) 10834 return res 10835 def __repr__(self): 10836 s = str(self) 10837 if '"' in s: 10838 return 'isl.union_set("""%s""")' % s 10839 else: 10840 return 'isl.union_set("%s")' % s 10841 def affine_hull(arg0): 10842 try: 10843 if not arg0.__class__ is union_set: 10844 arg0 = union_set(arg0) 10845 except: 10846 raise 10847 ctx = arg0.ctx 10848 res = isl.isl_union_set_affine_hull(isl.isl_union_set_copy(arg0.ptr)) 10849 obj = union_set(ctx=ctx, ptr=res) 10850 return obj 10851 def apply(arg0, arg1): 10852 try: 10853 if not arg0.__class__ is union_set: 10854 arg0 = union_set(arg0) 10855 except: 10856 raise 10857 try: 10858 if not arg1.__class__ is union_map: 10859 arg1 = union_map(arg1) 10860 except: 10861 raise 10862 ctx = arg0.ctx 10863 res = isl.isl_union_set_apply(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 10864 obj = union_set(ctx=ctx, ptr=res) 10865 return obj 10866 def as_set(arg0): 10867 try: 10868 if not arg0.__class__ is union_set: 10869 arg0 = union_set(arg0) 10870 except: 10871 raise 10872 ctx = arg0.ctx 10873 res = isl.isl_union_set_as_set(isl.isl_union_set_copy(arg0.ptr)) 10874 obj = set(ctx=ctx, ptr=res) 10875 return obj 10876 def coalesce(arg0): 10877 try: 10878 if not arg0.__class__ is union_set: 10879 arg0 = union_set(arg0) 10880 except: 10881 raise 10882 ctx = arg0.ctx 10883 res = isl.isl_union_set_coalesce(isl.isl_union_set_copy(arg0.ptr)) 10884 obj = union_set(ctx=ctx, ptr=res) 10885 return obj 10886 def compute_divs(arg0): 10887 try: 10888 if not arg0.__class__ is union_set: 10889 arg0 = union_set(arg0) 10890 except: 10891 raise 10892 ctx = arg0.ctx 10893 res = isl.isl_union_set_compute_divs(isl.isl_union_set_copy(arg0.ptr)) 10894 obj = union_set(ctx=ctx, ptr=res) 10895 return obj 10896 def detect_equalities(arg0): 10897 try: 10898 if not arg0.__class__ is union_set: 10899 arg0 = union_set(arg0) 10900 except: 10901 raise 10902 ctx = arg0.ctx 10903 res = isl.isl_union_set_detect_equalities(isl.isl_union_set_copy(arg0.ptr)) 10904 obj = union_set(ctx=ctx, ptr=res) 10905 return obj 10906 def drop_unused_params(arg0): 10907 try: 10908 if not arg0.__class__ is union_set: 10909 arg0 = union_set(arg0) 10910 except: 10911 raise 10912 ctx = arg0.ctx 10913 res = isl.isl_union_set_drop_unused_params(isl.isl_union_set_copy(arg0.ptr)) 10914 obj = union_set(ctx=ctx, ptr=res) 10915 return obj 10916 @staticmethod 10917 def empty(*args): 10918 if len(args) == 0: 10919 ctx = Context.getDefaultInstance() 10920 res = isl.isl_union_set_empty_ctx(ctx) 10921 obj = union_set(ctx=ctx, ptr=res) 10922 return obj 10923 raise Error 10924 def every_set(arg0, arg1): 10925 try: 10926 if not arg0.__class__ is union_set: 10927 arg0 = union_set(arg0) 10928 except: 10929 raise 10930 exc_info = [None] 10931 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10932 def cb_func(cb_arg0, cb_arg1): 10933 cb_arg0 = set(ctx=arg0.ctx, ptr=isl.isl_set_copy(cb_arg0)) 10934 try: 10935 res = arg1(cb_arg0) 10936 except BaseException as e: 10937 exc_info[0] = e 10938 return -1 10939 return 1 if res else 0 10940 cb1 = fn(cb_func) 10941 ctx = arg0.ctx 10942 res = isl.isl_union_set_every_set(arg0.ptr, cb1, None) 10943 if exc_info[0] is not None: 10944 raise exc_info[0] 10945 if res < 0: 10946 raise Error 10947 return bool(res) 10948 def extract_set(arg0, arg1): 10949 try: 10950 if not arg0.__class__ is union_set: 10951 arg0 = union_set(arg0) 10952 except: 10953 raise 10954 try: 10955 if not arg1.__class__ is space: 10956 arg1 = space(arg1) 10957 except: 10958 raise 10959 ctx = arg0.ctx 10960 res = isl.isl_union_set_extract_set(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 10961 obj = set(ctx=ctx, ptr=res) 10962 return obj 10963 def foreach_point(arg0, arg1): 10964 try: 10965 if not arg0.__class__ is union_set: 10966 arg0 = union_set(arg0) 10967 except: 10968 raise 10969 exc_info = [None] 10970 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10971 def cb_func(cb_arg0, cb_arg1): 10972 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 10973 try: 10974 arg1(cb_arg0) 10975 except BaseException as e: 10976 exc_info[0] = e 10977 return -1 10978 return 0 10979 cb1 = fn(cb_func) 10980 ctx = arg0.ctx 10981 res = isl.isl_union_set_foreach_point(arg0.ptr, cb1, None) 10982 if exc_info[0] is not None: 10983 raise exc_info[0] 10984 if res < 0: 10985 raise Error 10986 def foreach_set(arg0, arg1): 10987 try: 10988 if not arg0.__class__ is union_set: 10989 arg0 = union_set(arg0) 10990 except: 10991 raise 10992 exc_info = [None] 10993 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10994 def cb_func(cb_arg0, cb_arg1): 10995 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 10996 try: 10997 arg1(cb_arg0) 10998 except BaseException as e: 10999 exc_info[0] = e 11000 return -1 11001 return 0 11002 cb1 = fn(cb_func) 11003 ctx = arg0.ctx 11004 res = isl.isl_union_set_foreach_set(arg0.ptr, cb1, None) 11005 if exc_info[0] is not None: 11006 raise exc_info[0] 11007 if res < 0: 11008 raise Error 11009 def gist(arg0, arg1): 11010 try: 11011 if not arg0.__class__ is union_set: 11012 arg0 = union_set(arg0) 11013 except: 11014 raise 11015 try: 11016 if not arg1.__class__ is union_set: 11017 arg1 = union_set(arg1) 11018 except: 11019 raise 11020 ctx = arg0.ctx 11021 res = isl.isl_union_set_gist(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 11022 obj = union_set(ctx=ctx, ptr=res) 11023 return obj 11024 def gist_params(arg0, arg1): 11025 try: 11026 if not arg0.__class__ is union_set: 11027 arg0 = union_set(arg0) 11028 except: 11029 raise 11030 try: 11031 if not arg1.__class__ is set: 11032 arg1 = set(arg1) 11033 except: 11034 raise 11035 ctx = arg0.ctx 11036 res = isl.isl_union_set_gist_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11037 obj = union_set(ctx=ctx, ptr=res) 11038 return obj 11039 def identity(arg0): 11040 try: 11041 if not arg0.__class__ is union_set: 11042 arg0 = union_set(arg0) 11043 except: 11044 raise 11045 ctx = arg0.ctx 11046 res = isl.isl_union_set_identity(isl.isl_union_set_copy(arg0.ptr)) 11047 obj = union_map(ctx=ctx, ptr=res) 11048 return obj 11049 def intersect(arg0, arg1): 11050 try: 11051 if not arg0.__class__ is union_set: 11052 arg0 = union_set(arg0) 11053 except: 11054 raise 11055 try: 11056 if not arg1.__class__ is union_set: 11057 arg1 = union_set(arg1) 11058 except: 11059 raise 11060 ctx = arg0.ctx 11061 res = isl.isl_union_set_intersect(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 11062 obj = union_set(ctx=ctx, ptr=res) 11063 return obj 11064 def intersect_params(arg0, arg1): 11065 try: 11066 if not arg0.__class__ is union_set: 11067 arg0 = union_set(arg0) 11068 except: 11069 raise 11070 try: 11071 if not arg1.__class__ is set: 11072 arg1 = set(arg1) 11073 except: 11074 raise 11075 ctx = arg0.ctx 11076 res = isl.isl_union_set_intersect_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11077 obj = union_set(ctx=ctx, ptr=res) 11078 return obj 11079 def is_disjoint(arg0, arg1): 11080 try: 11081 if not arg0.__class__ is union_set: 11082 arg0 = union_set(arg0) 11083 except: 11084 raise 11085 try: 11086 if not arg1.__class__ is union_set: 11087 arg1 = union_set(arg1) 11088 except: 11089 raise 11090 ctx = arg0.ctx 11091 res = isl.isl_union_set_is_disjoint(arg0.ptr, arg1.ptr) 11092 if res < 0: 11093 raise Error 11094 return bool(res) 11095 def is_empty(arg0): 11096 try: 11097 if not arg0.__class__ is union_set: 11098 arg0 = union_set(arg0) 11099 except: 11100 raise 11101 ctx = arg0.ctx 11102 res = isl.isl_union_set_is_empty(arg0.ptr) 11103 if res < 0: 11104 raise Error 11105 return bool(res) 11106 def is_equal(arg0, arg1): 11107 try: 11108 if not arg0.__class__ is union_set: 11109 arg0 = union_set(arg0) 11110 except: 11111 raise 11112 try: 11113 if not arg1.__class__ is union_set: 11114 arg1 = union_set(arg1) 11115 except: 11116 raise 11117 ctx = arg0.ctx 11118 res = isl.isl_union_set_is_equal(arg0.ptr, arg1.ptr) 11119 if res < 0: 11120 raise Error 11121 return bool(res) 11122 def is_strict_subset(arg0, arg1): 11123 try: 11124 if not arg0.__class__ is union_set: 11125 arg0 = union_set(arg0) 11126 except: 11127 raise 11128 try: 11129 if not arg1.__class__ is union_set: 11130 arg1 = union_set(arg1) 11131 except: 11132 raise 11133 ctx = arg0.ctx 11134 res = isl.isl_union_set_is_strict_subset(arg0.ptr, arg1.ptr) 11135 if res < 0: 11136 raise Error 11137 return bool(res) 11138 def is_subset(arg0, arg1): 11139 try: 11140 if not arg0.__class__ is union_set: 11141 arg0 = union_set(arg0) 11142 except: 11143 raise 11144 try: 11145 if not arg1.__class__ is union_set: 11146 arg1 = union_set(arg1) 11147 except: 11148 raise 11149 ctx = arg0.ctx 11150 res = isl.isl_union_set_is_subset(arg0.ptr, arg1.ptr) 11151 if res < 0: 11152 raise Error 11153 return bool(res) 11154 def isa_set(arg0): 11155 try: 11156 if not arg0.__class__ is union_set: 11157 arg0 = union_set(arg0) 11158 except: 11159 raise 11160 ctx = arg0.ctx 11161 res = isl.isl_union_set_isa_set(arg0.ptr) 11162 if res < 0: 11163 raise Error 11164 return bool(res) 11165 def lexmax(arg0): 11166 try: 11167 if not arg0.__class__ is union_set: 11168 arg0 = union_set(arg0) 11169 except: 11170 raise 11171 ctx = arg0.ctx 11172 res = isl.isl_union_set_lexmax(isl.isl_union_set_copy(arg0.ptr)) 11173 obj = union_set(ctx=ctx, ptr=res) 11174 return obj 11175 def lexmin(arg0): 11176 try: 11177 if not arg0.__class__ is union_set: 11178 arg0 = union_set(arg0) 11179 except: 11180 raise 11181 ctx = arg0.ctx 11182 res = isl.isl_union_set_lexmin(isl.isl_union_set_copy(arg0.ptr)) 11183 obj = union_set(ctx=ctx, ptr=res) 11184 return obj 11185 def params(arg0): 11186 try: 11187 if not arg0.__class__ is union_set: 11188 arg0 = union_set(arg0) 11189 except: 11190 raise 11191 ctx = arg0.ctx 11192 res = isl.isl_union_set_params(isl.isl_union_set_copy(arg0.ptr)) 11193 obj = set(ctx=ctx, ptr=res) 11194 return obj 11195 def polyhedral_hull(arg0): 11196 try: 11197 if not arg0.__class__ is union_set: 11198 arg0 = union_set(arg0) 11199 except: 11200 raise 11201 ctx = arg0.ctx 11202 res = isl.isl_union_set_polyhedral_hull(isl.isl_union_set_copy(arg0.ptr)) 11203 obj = union_set(ctx=ctx, ptr=res) 11204 return obj 11205 def preimage(*args): 11206 if len(args) == 2 and args[1].__class__ is multi_aff: 11207 args = list(args) 11208 try: 11209 if not args[0].__class__ is union_set: 11210 args[0] = union_set(args[0]) 11211 except: 11212 raise 11213 ctx = args[0].ctx 11214 res = isl.isl_union_set_preimage_multi_aff(isl.isl_union_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 11215 obj = union_set(ctx=ctx, ptr=res) 11216 return obj 11217 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 11218 args = list(args) 11219 try: 11220 if not args[0].__class__ is union_set: 11221 args[0] = union_set(args[0]) 11222 except: 11223 raise 11224 ctx = args[0].ctx 11225 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)) 11226 obj = union_set(ctx=ctx, ptr=res) 11227 return obj 11228 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 11229 args = list(args) 11230 try: 11231 if not args[0].__class__ is union_set: 11232 args[0] = union_set(args[0]) 11233 except: 11234 raise 11235 ctx = args[0].ctx 11236 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)) 11237 obj = union_set(ctx=ctx, ptr=res) 11238 return obj 11239 raise Error 11240 def project_out_all_params(arg0): 11241 try: 11242 if not arg0.__class__ is union_set: 11243 arg0 = union_set(arg0) 11244 except: 11245 raise 11246 ctx = arg0.ctx 11247 res = isl.isl_union_set_project_out_all_params(isl.isl_union_set_copy(arg0.ptr)) 11248 obj = union_set(ctx=ctx, ptr=res) 11249 return obj 11250 def sample_point(arg0): 11251 try: 11252 if not arg0.__class__ is union_set: 11253 arg0 = union_set(arg0) 11254 except: 11255 raise 11256 ctx = arg0.ctx 11257 res = isl.isl_union_set_sample_point(isl.isl_union_set_copy(arg0.ptr)) 11258 obj = point(ctx=ctx, ptr=res) 11259 return obj 11260 def set_list(arg0): 11261 try: 11262 if not arg0.__class__ is union_set: 11263 arg0 = union_set(arg0) 11264 except: 11265 raise 11266 ctx = arg0.ctx 11267 res = isl.isl_union_set_get_set_list(arg0.ptr) 11268 obj = set_list(ctx=ctx, ptr=res) 11269 return obj 11270 def get_set_list(arg0): 11271 return arg0.set_list() 11272 def space(arg0): 11273 try: 11274 if not arg0.__class__ is union_set: 11275 arg0 = union_set(arg0) 11276 except: 11277 raise 11278 ctx = arg0.ctx 11279 res = isl.isl_union_set_get_space(arg0.ptr) 11280 obj = space(ctx=ctx, ptr=res) 11281 return obj 11282 def get_space(arg0): 11283 return arg0.space() 11284 def subtract(arg0, arg1): 11285 try: 11286 if not arg0.__class__ is union_set: 11287 arg0 = union_set(arg0) 11288 except: 11289 raise 11290 try: 11291 if not arg1.__class__ is union_set: 11292 arg1 = union_set(arg1) 11293 except: 11294 raise 11295 ctx = arg0.ctx 11296 res = isl.isl_union_set_subtract(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 11297 obj = union_set(ctx=ctx, ptr=res) 11298 return obj 11299 def to_list(arg0): 11300 try: 11301 if not arg0.__class__ is union_set: 11302 arg0 = union_set(arg0) 11303 except: 11304 raise 11305 ctx = arg0.ctx 11306 res = isl.isl_union_set_to_list(isl.isl_union_set_copy(arg0.ptr)) 11307 obj = union_set_list(ctx=ctx, ptr=res) 11308 return obj 11309 def union(arg0, arg1): 11310 try: 11311 if not arg0.__class__ is union_set: 11312 arg0 = union_set(arg0) 11313 except: 11314 raise 11315 try: 11316 if not arg1.__class__ is union_set: 11317 arg1 = union_set(arg1) 11318 except: 11319 raise 11320 ctx = arg0.ctx 11321 res = isl.isl_union_set_union(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 11322 obj = union_set(ctx=ctx, ptr=res) 11323 return obj 11324 def universe(arg0): 11325 try: 11326 if not arg0.__class__ is union_set: 11327 arg0 = union_set(arg0) 11328 except: 11329 raise 11330 ctx = arg0.ctx 11331 res = isl.isl_union_set_universe(isl.isl_union_set_copy(arg0.ptr)) 11332 obj = union_set(ctx=ctx, ptr=res) 11333 return obj 11334 def unwrap(arg0): 11335 try: 11336 if not arg0.__class__ is union_set: 11337 arg0 = union_set(arg0) 11338 except: 11339 raise 11340 ctx = arg0.ctx 11341 res = isl.isl_union_set_unwrap(isl.isl_union_set_copy(arg0.ptr)) 11342 obj = union_map(ctx=ctx, ptr=res) 11343 return obj 11344 11345isl.isl_union_set_from_basic_set.restype = c_void_p 11346isl.isl_union_set_from_basic_set.argtypes = [c_void_p] 11347isl.isl_union_set_from_point.restype = c_void_p 11348isl.isl_union_set_from_point.argtypes = [c_void_p] 11349isl.isl_union_set_from_set.restype = c_void_p 11350isl.isl_union_set_from_set.argtypes = [c_void_p] 11351isl.isl_union_set_read_from_str.restype = c_void_p 11352isl.isl_union_set_read_from_str.argtypes = [Context, c_char_p] 11353isl.isl_union_set_affine_hull.restype = c_void_p 11354isl.isl_union_set_affine_hull.argtypes = [c_void_p] 11355isl.isl_union_set_apply.restype = c_void_p 11356isl.isl_union_set_apply.argtypes = [c_void_p, c_void_p] 11357isl.isl_union_set_as_set.restype = c_void_p 11358isl.isl_union_set_as_set.argtypes = [c_void_p] 11359isl.isl_union_set_coalesce.restype = c_void_p 11360isl.isl_union_set_coalesce.argtypes = [c_void_p] 11361isl.isl_union_set_compute_divs.restype = c_void_p 11362isl.isl_union_set_compute_divs.argtypes = [c_void_p] 11363isl.isl_union_set_detect_equalities.restype = c_void_p 11364isl.isl_union_set_detect_equalities.argtypes = [c_void_p] 11365isl.isl_union_set_drop_unused_params.restype = c_void_p 11366isl.isl_union_set_drop_unused_params.argtypes = [c_void_p] 11367isl.isl_union_set_empty_ctx.restype = c_void_p 11368isl.isl_union_set_empty_ctx.argtypes = [Context] 11369isl.isl_union_set_every_set.argtypes = [c_void_p, c_void_p, c_void_p] 11370isl.isl_union_set_extract_set.restype = c_void_p 11371isl.isl_union_set_extract_set.argtypes = [c_void_p, c_void_p] 11372isl.isl_union_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 11373isl.isl_union_set_foreach_set.argtypes = [c_void_p, c_void_p, c_void_p] 11374isl.isl_union_set_gist.restype = c_void_p 11375isl.isl_union_set_gist.argtypes = [c_void_p, c_void_p] 11376isl.isl_union_set_gist_params.restype = c_void_p 11377isl.isl_union_set_gist_params.argtypes = [c_void_p, c_void_p] 11378isl.isl_union_set_identity.restype = c_void_p 11379isl.isl_union_set_identity.argtypes = [c_void_p] 11380isl.isl_union_set_intersect.restype = c_void_p 11381isl.isl_union_set_intersect.argtypes = [c_void_p, c_void_p] 11382isl.isl_union_set_intersect_params.restype = c_void_p 11383isl.isl_union_set_intersect_params.argtypes = [c_void_p, c_void_p] 11384isl.isl_union_set_is_disjoint.argtypes = [c_void_p, c_void_p] 11385isl.isl_union_set_is_empty.argtypes = [c_void_p] 11386isl.isl_union_set_is_equal.argtypes = [c_void_p, c_void_p] 11387isl.isl_union_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 11388isl.isl_union_set_is_subset.argtypes = [c_void_p, c_void_p] 11389isl.isl_union_set_isa_set.argtypes = [c_void_p] 11390isl.isl_union_set_lexmax.restype = c_void_p 11391isl.isl_union_set_lexmax.argtypes = [c_void_p] 11392isl.isl_union_set_lexmin.restype = c_void_p 11393isl.isl_union_set_lexmin.argtypes = [c_void_p] 11394isl.isl_union_set_params.restype = c_void_p 11395isl.isl_union_set_params.argtypes = [c_void_p] 11396isl.isl_union_set_polyhedral_hull.restype = c_void_p 11397isl.isl_union_set_polyhedral_hull.argtypes = [c_void_p] 11398isl.isl_union_set_preimage_multi_aff.restype = c_void_p 11399isl.isl_union_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 11400isl.isl_union_set_preimage_pw_multi_aff.restype = c_void_p 11401isl.isl_union_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 11402isl.isl_union_set_preimage_union_pw_multi_aff.restype = c_void_p 11403isl.isl_union_set_preimage_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 11404isl.isl_union_set_project_out_all_params.restype = c_void_p 11405isl.isl_union_set_project_out_all_params.argtypes = [c_void_p] 11406isl.isl_union_set_sample_point.restype = c_void_p 11407isl.isl_union_set_sample_point.argtypes = [c_void_p] 11408isl.isl_union_set_get_set_list.restype = c_void_p 11409isl.isl_union_set_get_set_list.argtypes = [c_void_p] 11410isl.isl_union_set_get_space.restype = c_void_p 11411isl.isl_union_set_get_space.argtypes = [c_void_p] 11412isl.isl_union_set_subtract.restype = c_void_p 11413isl.isl_union_set_subtract.argtypes = [c_void_p, c_void_p] 11414isl.isl_union_set_to_list.restype = c_void_p 11415isl.isl_union_set_to_list.argtypes = [c_void_p] 11416isl.isl_union_set_union.restype = c_void_p 11417isl.isl_union_set_union.argtypes = [c_void_p, c_void_p] 11418isl.isl_union_set_universe.restype = c_void_p 11419isl.isl_union_set_universe.argtypes = [c_void_p] 11420isl.isl_union_set_unwrap.restype = c_void_p 11421isl.isl_union_set_unwrap.argtypes = [c_void_p] 11422isl.isl_union_set_copy.restype = c_void_p 11423isl.isl_union_set_copy.argtypes = [c_void_p] 11424isl.isl_union_set_free.restype = c_void_p 11425isl.isl_union_set_free.argtypes = [c_void_p] 11426isl.isl_union_set_to_str.restype = POINTER(c_char) 11427isl.isl_union_set_to_str.argtypes = [c_void_p] 11428 11429class set(union_set): 11430 def __init__(self, *args, **keywords): 11431 if "ptr" in keywords: 11432 self.ctx = keywords["ctx"] 11433 self.ptr = keywords["ptr"] 11434 return 11435 if len(args) == 1 and args[0].__class__ is basic_set: 11436 self.ctx = Context.getDefaultInstance() 11437 self.ptr = isl.isl_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 11438 return 11439 if len(args) == 1 and args[0].__class__ is point: 11440 self.ctx = Context.getDefaultInstance() 11441 self.ptr = isl.isl_set_from_point(isl.isl_point_copy(args[0].ptr)) 11442 return 11443 if len(args) == 1 and type(args[0]) == str: 11444 self.ctx = Context.getDefaultInstance() 11445 self.ptr = isl.isl_set_read_from_str(self.ctx, args[0].encode('ascii')) 11446 return 11447 raise Error 11448 def __del__(self): 11449 if hasattr(self, 'ptr'): 11450 isl.isl_set_free(self.ptr) 11451 def __str__(arg0): 11452 try: 11453 if not arg0.__class__ is set: 11454 arg0 = set(arg0) 11455 except: 11456 raise 11457 ptr = isl.isl_set_to_str(arg0.ptr) 11458 res = cast(ptr, c_char_p).value.decode('ascii') 11459 libc.free(ptr) 11460 return res 11461 def __repr__(self): 11462 s = str(self) 11463 if '"' in s: 11464 return 'isl.set("""%s""")' % s 11465 else: 11466 return 'isl.set("%s")' % s 11467 def affine_hull(arg0): 11468 try: 11469 if not arg0.__class__ is set: 11470 arg0 = set(arg0) 11471 except: 11472 raise 11473 ctx = arg0.ctx 11474 res = isl.isl_set_affine_hull(isl.isl_set_copy(arg0.ptr)) 11475 obj = basic_set(ctx=ctx, ptr=res) 11476 return obj 11477 def apply(arg0, arg1): 11478 try: 11479 if not arg0.__class__ is set: 11480 arg0 = set(arg0) 11481 except: 11482 raise 11483 try: 11484 if not arg1.__class__ is map: 11485 arg1 = map(arg1) 11486 except: 11487 return union_set(arg0).apply(arg1) 11488 ctx = arg0.ctx 11489 res = isl.isl_set_apply(isl.isl_set_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 11490 obj = set(ctx=ctx, ptr=res) 11491 return obj 11492 def as_pw_multi_aff(arg0): 11493 try: 11494 if not arg0.__class__ is set: 11495 arg0 = set(arg0) 11496 except: 11497 raise 11498 ctx = arg0.ctx 11499 res = isl.isl_set_as_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 11500 obj = pw_multi_aff(ctx=ctx, ptr=res) 11501 return obj 11502 def bind(arg0, arg1): 11503 try: 11504 if not arg0.__class__ is set: 11505 arg0 = set(arg0) 11506 except: 11507 raise 11508 try: 11509 if not arg1.__class__ is multi_id: 11510 arg1 = multi_id(arg1) 11511 except: 11512 return union_set(arg0).bind(arg1) 11513 ctx = arg0.ctx 11514 res = isl.isl_set_bind(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 11515 obj = set(ctx=ctx, ptr=res) 11516 return obj 11517 def coalesce(arg0): 11518 try: 11519 if not arg0.__class__ is set: 11520 arg0 = set(arg0) 11521 except: 11522 raise 11523 ctx = arg0.ctx 11524 res = isl.isl_set_coalesce(isl.isl_set_copy(arg0.ptr)) 11525 obj = set(ctx=ctx, ptr=res) 11526 return obj 11527 def complement(arg0): 11528 try: 11529 if not arg0.__class__ is set: 11530 arg0 = set(arg0) 11531 except: 11532 raise 11533 ctx = arg0.ctx 11534 res = isl.isl_set_complement(isl.isl_set_copy(arg0.ptr)) 11535 obj = set(ctx=ctx, ptr=res) 11536 return obj 11537 def detect_equalities(arg0): 11538 try: 11539 if not arg0.__class__ is set: 11540 arg0 = set(arg0) 11541 except: 11542 raise 11543 ctx = arg0.ctx 11544 res = isl.isl_set_detect_equalities(isl.isl_set_copy(arg0.ptr)) 11545 obj = set(ctx=ctx, ptr=res) 11546 return obj 11547 def dim_max_val(arg0, arg1): 11548 try: 11549 if not arg0.__class__ is set: 11550 arg0 = set(arg0) 11551 except: 11552 raise 11553 ctx = arg0.ctx 11554 res = isl.isl_set_dim_max_val(isl.isl_set_copy(arg0.ptr), arg1) 11555 obj = val(ctx=ctx, ptr=res) 11556 return obj 11557 def dim_min_val(arg0, arg1): 11558 try: 11559 if not arg0.__class__ is set: 11560 arg0 = set(arg0) 11561 except: 11562 raise 11563 ctx = arg0.ctx 11564 res = isl.isl_set_dim_min_val(isl.isl_set_copy(arg0.ptr), arg1) 11565 obj = val(ctx=ctx, ptr=res) 11566 return obj 11567 def drop_unused_params(arg0): 11568 try: 11569 if not arg0.__class__ is set: 11570 arg0 = set(arg0) 11571 except: 11572 raise 11573 ctx = arg0.ctx 11574 res = isl.isl_set_drop_unused_params(isl.isl_set_copy(arg0.ptr)) 11575 obj = set(ctx=ctx, ptr=res) 11576 return obj 11577 @staticmethod 11578 def empty(arg0): 11579 try: 11580 if not arg0.__class__ is space: 11581 arg0 = space(arg0) 11582 except: 11583 raise 11584 ctx = arg0.ctx 11585 res = isl.isl_set_empty(isl.isl_space_copy(arg0.ptr)) 11586 obj = set(ctx=ctx, ptr=res) 11587 return obj 11588 def flatten(arg0): 11589 try: 11590 if not arg0.__class__ is set: 11591 arg0 = set(arg0) 11592 except: 11593 raise 11594 ctx = arg0.ctx 11595 res = isl.isl_set_flatten(isl.isl_set_copy(arg0.ptr)) 11596 obj = set(ctx=ctx, ptr=res) 11597 return obj 11598 def foreach_basic_set(arg0, arg1): 11599 try: 11600 if not arg0.__class__ is set: 11601 arg0 = set(arg0) 11602 except: 11603 raise 11604 exc_info = [None] 11605 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11606 def cb_func(cb_arg0, cb_arg1): 11607 cb_arg0 = basic_set(ctx=arg0.ctx, ptr=(cb_arg0)) 11608 try: 11609 arg1(cb_arg0) 11610 except BaseException as e: 11611 exc_info[0] = e 11612 return -1 11613 return 0 11614 cb1 = fn(cb_func) 11615 ctx = arg0.ctx 11616 res = isl.isl_set_foreach_basic_set(arg0.ptr, cb1, None) 11617 if exc_info[0] is not None: 11618 raise exc_info[0] 11619 if res < 0: 11620 raise Error 11621 def foreach_point(arg0, arg1): 11622 try: 11623 if not arg0.__class__ is set: 11624 arg0 = set(arg0) 11625 except: 11626 raise 11627 exc_info = [None] 11628 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11629 def cb_func(cb_arg0, cb_arg1): 11630 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 11631 try: 11632 arg1(cb_arg0) 11633 except BaseException as e: 11634 exc_info[0] = e 11635 return -1 11636 return 0 11637 cb1 = fn(cb_func) 11638 ctx = arg0.ctx 11639 res = isl.isl_set_foreach_point(arg0.ptr, cb1, None) 11640 if exc_info[0] is not None: 11641 raise exc_info[0] 11642 if res < 0: 11643 raise Error 11644 def gist(arg0, arg1): 11645 try: 11646 if not arg0.__class__ is set: 11647 arg0 = set(arg0) 11648 except: 11649 raise 11650 try: 11651 if not arg1.__class__ is set: 11652 arg1 = set(arg1) 11653 except: 11654 return union_set(arg0).gist(arg1) 11655 ctx = arg0.ctx 11656 res = isl.isl_set_gist(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11657 obj = set(ctx=ctx, ptr=res) 11658 return obj 11659 def gist_params(arg0, arg1): 11660 try: 11661 if not arg0.__class__ is set: 11662 arg0 = set(arg0) 11663 except: 11664 raise 11665 try: 11666 if not arg1.__class__ is set: 11667 arg1 = set(arg1) 11668 except: 11669 return union_set(arg0).gist_params(arg1) 11670 ctx = arg0.ctx 11671 res = isl.isl_set_gist_params(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11672 obj = set(ctx=ctx, ptr=res) 11673 return obj 11674 def identity(arg0): 11675 try: 11676 if not arg0.__class__ is set: 11677 arg0 = set(arg0) 11678 except: 11679 raise 11680 ctx = arg0.ctx 11681 res = isl.isl_set_identity(isl.isl_set_copy(arg0.ptr)) 11682 obj = map(ctx=ctx, ptr=res) 11683 return obj 11684 def indicator_function(arg0): 11685 try: 11686 if not arg0.__class__ is set: 11687 arg0 = set(arg0) 11688 except: 11689 raise 11690 ctx = arg0.ctx 11691 res = isl.isl_set_indicator_function(isl.isl_set_copy(arg0.ptr)) 11692 obj = pw_aff(ctx=ctx, ptr=res) 11693 return obj 11694 def insert_domain(arg0, arg1): 11695 try: 11696 if not arg0.__class__ is set: 11697 arg0 = set(arg0) 11698 except: 11699 raise 11700 try: 11701 if not arg1.__class__ is space: 11702 arg1 = space(arg1) 11703 except: 11704 return union_set(arg0).insert_domain(arg1) 11705 ctx = arg0.ctx 11706 res = isl.isl_set_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 11707 obj = map(ctx=ctx, ptr=res) 11708 return obj 11709 def intersect(arg0, arg1): 11710 try: 11711 if not arg0.__class__ is set: 11712 arg0 = set(arg0) 11713 except: 11714 raise 11715 try: 11716 if not arg1.__class__ is set: 11717 arg1 = set(arg1) 11718 except: 11719 return union_set(arg0).intersect(arg1) 11720 ctx = arg0.ctx 11721 res = isl.isl_set_intersect(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11722 obj = set(ctx=ctx, ptr=res) 11723 return obj 11724 def intersect_params(arg0, arg1): 11725 try: 11726 if not arg0.__class__ is set: 11727 arg0 = set(arg0) 11728 except: 11729 raise 11730 try: 11731 if not arg1.__class__ is set: 11732 arg1 = set(arg1) 11733 except: 11734 return union_set(arg0).intersect_params(arg1) 11735 ctx = arg0.ctx 11736 res = isl.isl_set_intersect_params(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 11737 obj = set(ctx=ctx, ptr=res) 11738 return obj 11739 def involves_locals(arg0): 11740 try: 11741 if not arg0.__class__ is set: 11742 arg0 = set(arg0) 11743 except: 11744 raise 11745 ctx = arg0.ctx 11746 res = isl.isl_set_involves_locals(arg0.ptr) 11747 if res < 0: 11748 raise Error 11749 return bool(res) 11750 def is_disjoint(arg0, arg1): 11751 try: 11752 if not arg0.__class__ is set: 11753 arg0 = set(arg0) 11754 except: 11755 raise 11756 try: 11757 if not arg1.__class__ is set: 11758 arg1 = set(arg1) 11759 except: 11760 return union_set(arg0).is_disjoint(arg1) 11761 ctx = arg0.ctx 11762 res = isl.isl_set_is_disjoint(arg0.ptr, arg1.ptr) 11763 if res < 0: 11764 raise Error 11765 return bool(res) 11766 def is_empty(arg0): 11767 try: 11768 if not arg0.__class__ is set: 11769 arg0 = set(arg0) 11770 except: 11771 raise 11772 ctx = arg0.ctx 11773 res = isl.isl_set_is_empty(arg0.ptr) 11774 if res < 0: 11775 raise Error 11776 return bool(res) 11777 def is_equal(arg0, arg1): 11778 try: 11779 if not arg0.__class__ is set: 11780 arg0 = set(arg0) 11781 except: 11782 raise 11783 try: 11784 if not arg1.__class__ is set: 11785 arg1 = set(arg1) 11786 except: 11787 return union_set(arg0).is_equal(arg1) 11788 ctx = arg0.ctx 11789 res = isl.isl_set_is_equal(arg0.ptr, arg1.ptr) 11790 if res < 0: 11791 raise Error 11792 return bool(res) 11793 def is_singleton(arg0): 11794 try: 11795 if not arg0.__class__ is set: 11796 arg0 = set(arg0) 11797 except: 11798 raise 11799 ctx = arg0.ctx 11800 res = isl.isl_set_is_singleton(arg0.ptr) 11801 if res < 0: 11802 raise Error 11803 return bool(res) 11804 def is_strict_subset(arg0, arg1): 11805 try: 11806 if not arg0.__class__ is set: 11807 arg0 = set(arg0) 11808 except: 11809 raise 11810 try: 11811 if not arg1.__class__ is set: 11812 arg1 = set(arg1) 11813 except: 11814 return union_set(arg0).is_strict_subset(arg1) 11815 ctx = arg0.ctx 11816 res = isl.isl_set_is_strict_subset(arg0.ptr, arg1.ptr) 11817 if res < 0: 11818 raise Error 11819 return bool(res) 11820 def is_subset(arg0, arg1): 11821 try: 11822 if not arg0.__class__ is set: 11823 arg0 = set(arg0) 11824 except: 11825 raise 11826 try: 11827 if not arg1.__class__ is set: 11828 arg1 = set(arg1) 11829 except: 11830 return union_set(arg0).is_subset(arg1) 11831 ctx = arg0.ctx 11832 res = isl.isl_set_is_subset(arg0.ptr, arg1.ptr) 11833 if res < 0: 11834 raise Error 11835 return bool(res) 11836 def is_wrapping(arg0): 11837 try: 11838 if not arg0.__class__ is set: 11839 arg0 = set(arg0) 11840 except: 11841 raise 11842 ctx = arg0.ctx 11843 res = isl.isl_set_is_wrapping(arg0.ptr) 11844 if res < 0: 11845 raise Error 11846 return bool(res) 11847 def lattice_tile(arg0): 11848 try: 11849 if not arg0.__class__ is set: 11850 arg0 = set(arg0) 11851 except: 11852 raise 11853 ctx = arg0.ctx 11854 res = isl.isl_set_get_lattice_tile(arg0.ptr) 11855 obj = fixed_box(ctx=ctx, ptr=res) 11856 return obj 11857 def get_lattice_tile(arg0): 11858 return arg0.lattice_tile() 11859 def lexmax(arg0): 11860 try: 11861 if not arg0.__class__ is set: 11862 arg0 = set(arg0) 11863 except: 11864 raise 11865 ctx = arg0.ctx 11866 res = isl.isl_set_lexmax(isl.isl_set_copy(arg0.ptr)) 11867 obj = set(ctx=ctx, ptr=res) 11868 return obj 11869 def lexmax_pw_multi_aff(arg0): 11870 try: 11871 if not arg0.__class__ is set: 11872 arg0 = set(arg0) 11873 except: 11874 raise 11875 ctx = arg0.ctx 11876 res = isl.isl_set_lexmax_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 11877 obj = pw_multi_aff(ctx=ctx, ptr=res) 11878 return obj 11879 def lexmin(arg0): 11880 try: 11881 if not arg0.__class__ is set: 11882 arg0 = set(arg0) 11883 except: 11884 raise 11885 ctx = arg0.ctx 11886 res = isl.isl_set_lexmin(isl.isl_set_copy(arg0.ptr)) 11887 obj = set(ctx=ctx, ptr=res) 11888 return obj 11889 def lexmin_pw_multi_aff(arg0): 11890 try: 11891 if not arg0.__class__ is set: 11892 arg0 = set(arg0) 11893 except: 11894 raise 11895 ctx = arg0.ctx 11896 res = isl.isl_set_lexmin_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 11897 obj = pw_multi_aff(ctx=ctx, ptr=res) 11898 return obj 11899 def lower_bound(*args): 11900 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 11901 args = list(args) 11902 try: 11903 if not args[0].__class__ is set: 11904 args[0] = set(args[0]) 11905 except: 11906 raise 11907 ctx = args[0].ctx 11908 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)) 11909 obj = set(ctx=ctx, ptr=res) 11910 return obj 11911 if len(args) == 2 and args[1].__class__ is multi_val: 11912 args = list(args) 11913 try: 11914 if not args[0].__class__ is set: 11915 args[0] = set(args[0]) 11916 except: 11917 raise 11918 ctx = args[0].ctx 11919 res = isl.isl_set_lower_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 11920 obj = set(ctx=ctx, ptr=res) 11921 return obj 11922 raise Error 11923 def max_multi_pw_aff(arg0): 11924 try: 11925 if not arg0.__class__ is set: 11926 arg0 = set(arg0) 11927 except: 11928 raise 11929 ctx = arg0.ctx 11930 res = isl.isl_set_max_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 11931 obj = multi_pw_aff(ctx=ctx, ptr=res) 11932 return obj 11933 def max_val(arg0, arg1): 11934 try: 11935 if not arg0.__class__ is set: 11936 arg0 = set(arg0) 11937 except: 11938 raise 11939 try: 11940 if not arg1.__class__ is aff: 11941 arg1 = aff(arg1) 11942 except: 11943 return union_set(arg0).max_val(arg1) 11944 ctx = arg0.ctx 11945 res = isl.isl_set_max_val(arg0.ptr, arg1.ptr) 11946 obj = val(ctx=ctx, ptr=res) 11947 return obj 11948 def min_multi_pw_aff(arg0): 11949 try: 11950 if not arg0.__class__ is set: 11951 arg0 = set(arg0) 11952 except: 11953 raise 11954 ctx = arg0.ctx 11955 res = isl.isl_set_min_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 11956 obj = multi_pw_aff(ctx=ctx, ptr=res) 11957 return obj 11958 def min_val(arg0, arg1): 11959 try: 11960 if not arg0.__class__ is set: 11961 arg0 = set(arg0) 11962 except: 11963 raise 11964 try: 11965 if not arg1.__class__ is aff: 11966 arg1 = aff(arg1) 11967 except: 11968 return union_set(arg0).min_val(arg1) 11969 ctx = arg0.ctx 11970 res = isl.isl_set_min_val(arg0.ptr, arg1.ptr) 11971 obj = val(ctx=ctx, ptr=res) 11972 return obj 11973 def n_basic_set(arg0): 11974 try: 11975 if not arg0.__class__ is set: 11976 arg0 = set(arg0) 11977 except: 11978 raise 11979 ctx = arg0.ctx 11980 res = isl.isl_set_n_basic_set(arg0.ptr) 11981 if res < 0: 11982 raise Error 11983 return int(res) 11984 def param_pw_aff_on_domain(*args): 11985 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 11986 args = list(args) 11987 try: 11988 if not args[0].__class__ is set: 11989 args[0] = set(args[0]) 11990 except: 11991 raise 11992 try: 11993 if not args[1].__class__ is id: 11994 args[1] = id(args[1]) 11995 except: 11996 raise 11997 ctx = args[0].ctx 11998 res = isl.isl_set_param_pw_aff_on_domain_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 11999 obj = pw_aff(ctx=ctx, ptr=res) 12000 return obj 12001 raise Error 12002 def params(arg0): 12003 try: 12004 if not arg0.__class__ is set: 12005 arg0 = set(arg0) 12006 except: 12007 raise 12008 ctx = arg0.ctx 12009 res = isl.isl_set_params(isl.isl_set_copy(arg0.ptr)) 12010 obj = set(ctx=ctx, ptr=res) 12011 return obj 12012 def plain_multi_val_if_fixed(arg0): 12013 try: 12014 if not arg0.__class__ is set: 12015 arg0 = set(arg0) 12016 except: 12017 raise 12018 ctx = arg0.ctx 12019 res = isl.isl_set_get_plain_multi_val_if_fixed(arg0.ptr) 12020 obj = multi_val(ctx=ctx, ptr=res) 12021 return obj 12022 def get_plain_multi_val_if_fixed(arg0): 12023 return arg0.plain_multi_val_if_fixed() 12024 def polyhedral_hull(arg0): 12025 try: 12026 if not arg0.__class__ is set: 12027 arg0 = set(arg0) 12028 except: 12029 raise 12030 ctx = arg0.ctx 12031 res = isl.isl_set_polyhedral_hull(isl.isl_set_copy(arg0.ptr)) 12032 obj = basic_set(ctx=ctx, ptr=res) 12033 return obj 12034 def preimage(*args): 12035 if len(args) == 2 and args[1].__class__ is multi_aff: 12036 args = list(args) 12037 try: 12038 if not args[0].__class__ is set: 12039 args[0] = set(args[0]) 12040 except: 12041 raise 12042 ctx = args[0].ctx 12043 res = isl.isl_set_preimage_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 12044 obj = set(ctx=ctx, ptr=res) 12045 return obj 12046 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 12047 args = list(args) 12048 try: 12049 if not args[0].__class__ is set: 12050 args[0] = set(args[0]) 12051 except: 12052 raise 12053 ctx = args[0].ctx 12054 res = isl.isl_set_preimage_multi_pw_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 12055 obj = set(ctx=ctx, ptr=res) 12056 return obj 12057 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 12058 args = list(args) 12059 try: 12060 if not args[0].__class__ is set: 12061 args[0] = set(args[0]) 12062 except: 12063 raise 12064 ctx = args[0].ctx 12065 res = isl.isl_set_preimage_pw_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 12066 obj = set(ctx=ctx, ptr=res) 12067 return obj 12068 raise Error 12069 def product(arg0, arg1): 12070 try: 12071 if not arg0.__class__ is set: 12072 arg0 = set(arg0) 12073 except: 12074 raise 12075 try: 12076 if not arg1.__class__ is set: 12077 arg1 = set(arg1) 12078 except: 12079 return union_set(arg0).product(arg1) 12080 ctx = arg0.ctx 12081 res = isl.isl_set_product(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 12082 obj = set(ctx=ctx, ptr=res) 12083 return obj 12084 def project_out_all_params(arg0): 12085 try: 12086 if not arg0.__class__ is set: 12087 arg0 = set(arg0) 12088 except: 12089 raise 12090 ctx = arg0.ctx 12091 res = isl.isl_set_project_out_all_params(isl.isl_set_copy(arg0.ptr)) 12092 obj = set(ctx=ctx, ptr=res) 12093 return obj 12094 def project_out_param(*args): 12095 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 12096 args = list(args) 12097 try: 12098 if not args[0].__class__ is set: 12099 args[0] = set(args[0]) 12100 except: 12101 raise 12102 try: 12103 if not args[1].__class__ is id: 12104 args[1] = id(args[1]) 12105 except: 12106 raise 12107 ctx = args[0].ctx 12108 res = isl.isl_set_project_out_param_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 12109 obj = set(ctx=ctx, ptr=res) 12110 return obj 12111 if len(args) == 2 and args[1].__class__ is id_list: 12112 args = list(args) 12113 try: 12114 if not args[0].__class__ is set: 12115 args[0] = set(args[0]) 12116 except: 12117 raise 12118 ctx = args[0].ctx 12119 res = isl.isl_set_project_out_param_id_list(isl.isl_set_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 12120 obj = set(ctx=ctx, ptr=res) 12121 return obj 12122 raise Error 12123 def pw_aff_on_domain(*args): 12124 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 12125 args = list(args) 12126 try: 12127 if not args[0].__class__ is set: 12128 args[0] = set(args[0]) 12129 except: 12130 raise 12131 try: 12132 if not args[1].__class__ is val: 12133 args[1] = val(args[1]) 12134 except: 12135 raise 12136 ctx = args[0].ctx 12137 res = isl.isl_set_pw_aff_on_domain_val(isl.isl_set_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 12138 obj = pw_aff(ctx=ctx, ptr=res) 12139 return obj 12140 raise Error 12141 def pw_multi_aff_on_domain(*args): 12142 if len(args) == 2 and args[1].__class__ is multi_val: 12143 args = list(args) 12144 try: 12145 if not args[0].__class__ is set: 12146 args[0] = set(args[0]) 12147 except: 12148 raise 12149 ctx = args[0].ctx 12150 res = isl.isl_set_pw_multi_aff_on_domain_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 12151 obj = pw_multi_aff(ctx=ctx, ptr=res) 12152 return obj 12153 raise Error 12154 def sample(arg0): 12155 try: 12156 if not arg0.__class__ is set: 12157 arg0 = set(arg0) 12158 except: 12159 raise 12160 ctx = arg0.ctx 12161 res = isl.isl_set_sample(isl.isl_set_copy(arg0.ptr)) 12162 obj = basic_set(ctx=ctx, ptr=res) 12163 return obj 12164 def sample_point(arg0): 12165 try: 12166 if not arg0.__class__ is set: 12167 arg0 = set(arg0) 12168 except: 12169 raise 12170 ctx = arg0.ctx 12171 res = isl.isl_set_sample_point(isl.isl_set_copy(arg0.ptr)) 12172 obj = point(ctx=ctx, ptr=res) 12173 return obj 12174 def simple_fixed_box_hull(arg0): 12175 try: 12176 if not arg0.__class__ is set: 12177 arg0 = set(arg0) 12178 except: 12179 raise 12180 ctx = arg0.ctx 12181 res = isl.isl_set_get_simple_fixed_box_hull(arg0.ptr) 12182 obj = fixed_box(ctx=ctx, ptr=res) 12183 return obj 12184 def get_simple_fixed_box_hull(arg0): 12185 return arg0.simple_fixed_box_hull() 12186 def space(arg0): 12187 try: 12188 if not arg0.__class__ is set: 12189 arg0 = set(arg0) 12190 except: 12191 raise 12192 ctx = arg0.ctx 12193 res = isl.isl_set_get_space(arg0.ptr) 12194 obj = space(ctx=ctx, ptr=res) 12195 return obj 12196 def get_space(arg0): 12197 return arg0.space() 12198 def stride(arg0, arg1): 12199 try: 12200 if not arg0.__class__ is set: 12201 arg0 = set(arg0) 12202 except: 12203 raise 12204 ctx = arg0.ctx 12205 res = isl.isl_set_get_stride(arg0.ptr, arg1) 12206 obj = val(ctx=ctx, ptr=res) 12207 return obj 12208 def get_stride(arg0, arg1): 12209 return arg0.stride(arg1) 12210 def subtract(arg0, arg1): 12211 try: 12212 if not arg0.__class__ is set: 12213 arg0 = set(arg0) 12214 except: 12215 raise 12216 try: 12217 if not arg1.__class__ is set: 12218 arg1 = set(arg1) 12219 except: 12220 return union_set(arg0).subtract(arg1) 12221 ctx = arg0.ctx 12222 res = isl.isl_set_subtract(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 12223 obj = set(ctx=ctx, ptr=res) 12224 return obj 12225 def to_list(arg0): 12226 try: 12227 if not arg0.__class__ is set: 12228 arg0 = set(arg0) 12229 except: 12230 raise 12231 ctx = arg0.ctx 12232 res = isl.isl_set_to_list(isl.isl_set_copy(arg0.ptr)) 12233 obj = set_list(ctx=ctx, ptr=res) 12234 return obj 12235 def to_union_set(arg0): 12236 try: 12237 if not arg0.__class__ is set: 12238 arg0 = set(arg0) 12239 except: 12240 raise 12241 ctx = arg0.ctx 12242 res = isl.isl_set_to_union_set(isl.isl_set_copy(arg0.ptr)) 12243 obj = union_set(ctx=ctx, ptr=res) 12244 return obj 12245 def translation(arg0): 12246 try: 12247 if not arg0.__class__ is set: 12248 arg0 = set(arg0) 12249 except: 12250 raise 12251 ctx = arg0.ctx 12252 res = isl.isl_set_translation(isl.isl_set_copy(arg0.ptr)) 12253 obj = map(ctx=ctx, ptr=res) 12254 return obj 12255 def tuple_dim(arg0): 12256 try: 12257 if not arg0.__class__ is set: 12258 arg0 = set(arg0) 12259 except: 12260 raise 12261 ctx = arg0.ctx 12262 res = isl.isl_set_tuple_dim(arg0.ptr) 12263 if res < 0: 12264 raise Error 12265 return int(res) 12266 def unbind_params(arg0, arg1): 12267 try: 12268 if not arg0.__class__ is set: 12269 arg0 = set(arg0) 12270 except: 12271 raise 12272 try: 12273 if not arg1.__class__ is multi_id: 12274 arg1 = multi_id(arg1) 12275 except: 12276 return union_set(arg0).unbind_params(arg1) 12277 ctx = arg0.ctx 12278 res = isl.isl_set_unbind_params(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 12279 obj = set(ctx=ctx, ptr=res) 12280 return obj 12281 def unbind_params_insert_domain(arg0, arg1): 12282 try: 12283 if not arg0.__class__ is set: 12284 arg0 = set(arg0) 12285 except: 12286 raise 12287 try: 12288 if not arg1.__class__ is multi_id: 12289 arg1 = multi_id(arg1) 12290 except: 12291 return union_set(arg0).unbind_params_insert_domain(arg1) 12292 ctx = arg0.ctx 12293 res = isl.isl_set_unbind_params_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 12294 obj = map(ctx=ctx, ptr=res) 12295 return obj 12296 def union(arg0, arg1): 12297 try: 12298 if not arg0.__class__ is set: 12299 arg0 = set(arg0) 12300 except: 12301 raise 12302 try: 12303 if not arg1.__class__ is set: 12304 arg1 = set(arg1) 12305 except: 12306 return union_set(arg0).union(arg1) 12307 ctx = arg0.ctx 12308 res = isl.isl_set_union(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 12309 obj = set(ctx=ctx, ptr=res) 12310 return obj 12311 @staticmethod 12312 def universe(arg0): 12313 try: 12314 if not arg0.__class__ is space: 12315 arg0 = space(arg0) 12316 except: 12317 raise 12318 ctx = arg0.ctx 12319 res = isl.isl_set_universe(isl.isl_space_copy(arg0.ptr)) 12320 obj = set(ctx=ctx, ptr=res) 12321 return obj 12322 def unshifted_simple_hull(arg0): 12323 try: 12324 if not arg0.__class__ is set: 12325 arg0 = set(arg0) 12326 except: 12327 raise 12328 ctx = arg0.ctx 12329 res = isl.isl_set_unshifted_simple_hull(isl.isl_set_copy(arg0.ptr)) 12330 obj = basic_set(ctx=ctx, ptr=res) 12331 return obj 12332 def unwrap(arg0): 12333 try: 12334 if not arg0.__class__ is set: 12335 arg0 = set(arg0) 12336 except: 12337 raise 12338 ctx = arg0.ctx 12339 res = isl.isl_set_unwrap(isl.isl_set_copy(arg0.ptr)) 12340 obj = map(ctx=ctx, ptr=res) 12341 return obj 12342 def upper_bound(*args): 12343 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 12344 args = list(args) 12345 try: 12346 if not args[0].__class__ is set: 12347 args[0] = set(args[0]) 12348 except: 12349 raise 12350 ctx = args[0].ctx 12351 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)) 12352 obj = set(ctx=ctx, ptr=res) 12353 return obj 12354 if len(args) == 2 and args[1].__class__ is multi_val: 12355 args = list(args) 12356 try: 12357 if not args[0].__class__ is set: 12358 args[0] = set(args[0]) 12359 except: 12360 raise 12361 ctx = args[0].ctx 12362 res = isl.isl_set_upper_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 12363 obj = set(ctx=ctx, ptr=res) 12364 return obj 12365 raise Error 12366 def wrapped_reverse(arg0): 12367 try: 12368 if not arg0.__class__ is set: 12369 arg0 = set(arg0) 12370 except: 12371 raise 12372 ctx = arg0.ctx 12373 res = isl.isl_set_wrapped_reverse(isl.isl_set_copy(arg0.ptr)) 12374 obj = set(ctx=ctx, ptr=res) 12375 return obj 12376 12377isl.isl_set_from_basic_set.restype = c_void_p 12378isl.isl_set_from_basic_set.argtypes = [c_void_p] 12379isl.isl_set_from_point.restype = c_void_p 12380isl.isl_set_from_point.argtypes = [c_void_p] 12381isl.isl_set_read_from_str.restype = c_void_p 12382isl.isl_set_read_from_str.argtypes = [Context, c_char_p] 12383isl.isl_set_affine_hull.restype = c_void_p 12384isl.isl_set_affine_hull.argtypes = [c_void_p] 12385isl.isl_set_apply.restype = c_void_p 12386isl.isl_set_apply.argtypes = [c_void_p, c_void_p] 12387isl.isl_set_as_pw_multi_aff.restype = c_void_p 12388isl.isl_set_as_pw_multi_aff.argtypes = [c_void_p] 12389isl.isl_set_bind.restype = c_void_p 12390isl.isl_set_bind.argtypes = [c_void_p, c_void_p] 12391isl.isl_set_coalesce.restype = c_void_p 12392isl.isl_set_coalesce.argtypes = [c_void_p] 12393isl.isl_set_complement.restype = c_void_p 12394isl.isl_set_complement.argtypes = [c_void_p] 12395isl.isl_set_detect_equalities.restype = c_void_p 12396isl.isl_set_detect_equalities.argtypes = [c_void_p] 12397isl.isl_set_dim_max_val.restype = c_void_p 12398isl.isl_set_dim_max_val.argtypes = [c_void_p, c_int] 12399isl.isl_set_dim_min_val.restype = c_void_p 12400isl.isl_set_dim_min_val.argtypes = [c_void_p, c_int] 12401isl.isl_set_drop_unused_params.restype = c_void_p 12402isl.isl_set_drop_unused_params.argtypes = [c_void_p] 12403isl.isl_set_empty.restype = c_void_p 12404isl.isl_set_empty.argtypes = [c_void_p] 12405isl.isl_set_flatten.restype = c_void_p 12406isl.isl_set_flatten.argtypes = [c_void_p] 12407isl.isl_set_foreach_basic_set.argtypes = [c_void_p, c_void_p, c_void_p] 12408isl.isl_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 12409isl.isl_set_gist.restype = c_void_p 12410isl.isl_set_gist.argtypes = [c_void_p, c_void_p] 12411isl.isl_set_gist_params.restype = c_void_p 12412isl.isl_set_gist_params.argtypes = [c_void_p, c_void_p] 12413isl.isl_set_identity.restype = c_void_p 12414isl.isl_set_identity.argtypes = [c_void_p] 12415isl.isl_set_indicator_function.restype = c_void_p 12416isl.isl_set_indicator_function.argtypes = [c_void_p] 12417isl.isl_set_insert_domain.restype = c_void_p 12418isl.isl_set_insert_domain.argtypes = [c_void_p, c_void_p] 12419isl.isl_set_intersect.restype = c_void_p 12420isl.isl_set_intersect.argtypes = [c_void_p, c_void_p] 12421isl.isl_set_intersect_params.restype = c_void_p 12422isl.isl_set_intersect_params.argtypes = [c_void_p, c_void_p] 12423isl.isl_set_involves_locals.argtypes = [c_void_p] 12424isl.isl_set_is_disjoint.argtypes = [c_void_p, c_void_p] 12425isl.isl_set_is_empty.argtypes = [c_void_p] 12426isl.isl_set_is_equal.argtypes = [c_void_p, c_void_p] 12427isl.isl_set_is_singleton.argtypes = [c_void_p] 12428isl.isl_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 12429isl.isl_set_is_subset.argtypes = [c_void_p, c_void_p] 12430isl.isl_set_is_wrapping.argtypes = [c_void_p] 12431isl.isl_set_get_lattice_tile.restype = c_void_p 12432isl.isl_set_get_lattice_tile.argtypes = [c_void_p] 12433isl.isl_set_lexmax.restype = c_void_p 12434isl.isl_set_lexmax.argtypes = [c_void_p] 12435isl.isl_set_lexmax_pw_multi_aff.restype = c_void_p 12436isl.isl_set_lexmax_pw_multi_aff.argtypes = [c_void_p] 12437isl.isl_set_lexmin.restype = c_void_p 12438isl.isl_set_lexmin.argtypes = [c_void_p] 12439isl.isl_set_lexmin_pw_multi_aff.restype = c_void_p 12440isl.isl_set_lexmin_pw_multi_aff.argtypes = [c_void_p] 12441isl.isl_set_lower_bound_multi_pw_aff.restype = c_void_p 12442isl.isl_set_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 12443isl.isl_set_lower_bound_multi_val.restype = c_void_p 12444isl.isl_set_lower_bound_multi_val.argtypes = [c_void_p, c_void_p] 12445isl.isl_set_max_multi_pw_aff.restype = c_void_p 12446isl.isl_set_max_multi_pw_aff.argtypes = [c_void_p] 12447isl.isl_set_max_val.restype = c_void_p 12448isl.isl_set_max_val.argtypes = [c_void_p, c_void_p] 12449isl.isl_set_min_multi_pw_aff.restype = c_void_p 12450isl.isl_set_min_multi_pw_aff.argtypes = [c_void_p] 12451isl.isl_set_min_val.restype = c_void_p 12452isl.isl_set_min_val.argtypes = [c_void_p, c_void_p] 12453isl.isl_set_n_basic_set.argtypes = [c_void_p] 12454isl.isl_set_param_pw_aff_on_domain_id.restype = c_void_p 12455isl.isl_set_param_pw_aff_on_domain_id.argtypes = [c_void_p, c_void_p] 12456isl.isl_set_params.restype = c_void_p 12457isl.isl_set_params.argtypes = [c_void_p] 12458isl.isl_set_get_plain_multi_val_if_fixed.restype = c_void_p 12459isl.isl_set_get_plain_multi_val_if_fixed.argtypes = [c_void_p] 12460isl.isl_set_polyhedral_hull.restype = c_void_p 12461isl.isl_set_polyhedral_hull.argtypes = [c_void_p] 12462isl.isl_set_preimage_multi_aff.restype = c_void_p 12463isl.isl_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 12464isl.isl_set_preimage_multi_pw_aff.restype = c_void_p 12465isl.isl_set_preimage_multi_pw_aff.argtypes = [c_void_p, c_void_p] 12466isl.isl_set_preimage_pw_multi_aff.restype = c_void_p 12467isl.isl_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 12468isl.isl_set_product.restype = c_void_p 12469isl.isl_set_product.argtypes = [c_void_p, c_void_p] 12470isl.isl_set_project_out_all_params.restype = c_void_p 12471isl.isl_set_project_out_all_params.argtypes = [c_void_p] 12472isl.isl_set_project_out_param_id.restype = c_void_p 12473isl.isl_set_project_out_param_id.argtypes = [c_void_p, c_void_p] 12474isl.isl_set_project_out_param_id_list.restype = c_void_p 12475isl.isl_set_project_out_param_id_list.argtypes = [c_void_p, c_void_p] 12476isl.isl_set_pw_aff_on_domain_val.restype = c_void_p 12477isl.isl_set_pw_aff_on_domain_val.argtypes = [c_void_p, c_void_p] 12478isl.isl_set_pw_multi_aff_on_domain_multi_val.restype = c_void_p 12479isl.isl_set_pw_multi_aff_on_domain_multi_val.argtypes = [c_void_p, c_void_p] 12480isl.isl_set_sample.restype = c_void_p 12481isl.isl_set_sample.argtypes = [c_void_p] 12482isl.isl_set_sample_point.restype = c_void_p 12483isl.isl_set_sample_point.argtypes = [c_void_p] 12484isl.isl_set_get_simple_fixed_box_hull.restype = c_void_p 12485isl.isl_set_get_simple_fixed_box_hull.argtypes = [c_void_p] 12486isl.isl_set_get_space.restype = c_void_p 12487isl.isl_set_get_space.argtypes = [c_void_p] 12488isl.isl_set_get_stride.restype = c_void_p 12489isl.isl_set_get_stride.argtypes = [c_void_p, c_int] 12490isl.isl_set_subtract.restype = c_void_p 12491isl.isl_set_subtract.argtypes = [c_void_p, c_void_p] 12492isl.isl_set_to_list.restype = c_void_p 12493isl.isl_set_to_list.argtypes = [c_void_p] 12494isl.isl_set_to_union_set.restype = c_void_p 12495isl.isl_set_to_union_set.argtypes = [c_void_p] 12496isl.isl_set_translation.restype = c_void_p 12497isl.isl_set_translation.argtypes = [c_void_p] 12498isl.isl_set_tuple_dim.argtypes = [c_void_p] 12499isl.isl_set_unbind_params.restype = c_void_p 12500isl.isl_set_unbind_params.argtypes = [c_void_p, c_void_p] 12501isl.isl_set_unbind_params_insert_domain.restype = c_void_p 12502isl.isl_set_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 12503isl.isl_set_union.restype = c_void_p 12504isl.isl_set_union.argtypes = [c_void_p, c_void_p] 12505isl.isl_set_universe.restype = c_void_p 12506isl.isl_set_universe.argtypes = [c_void_p] 12507isl.isl_set_unshifted_simple_hull.restype = c_void_p 12508isl.isl_set_unshifted_simple_hull.argtypes = [c_void_p] 12509isl.isl_set_unwrap.restype = c_void_p 12510isl.isl_set_unwrap.argtypes = [c_void_p] 12511isl.isl_set_upper_bound_multi_pw_aff.restype = c_void_p 12512isl.isl_set_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 12513isl.isl_set_upper_bound_multi_val.restype = c_void_p 12514isl.isl_set_upper_bound_multi_val.argtypes = [c_void_p, c_void_p] 12515isl.isl_set_wrapped_reverse.restype = c_void_p 12516isl.isl_set_wrapped_reverse.argtypes = [c_void_p] 12517isl.isl_set_copy.restype = c_void_p 12518isl.isl_set_copy.argtypes = [c_void_p] 12519isl.isl_set_free.restype = c_void_p 12520isl.isl_set_free.argtypes = [c_void_p] 12521isl.isl_set_to_str.restype = POINTER(c_char) 12522isl.isl_set_to_str.argtypes = [c_void_p] 12523 12524class basic_set(set): 12525 def __init__(self, *args, **keywords): 12526 if "ptr" in keywords: 12527 self.ctx = keywords["ctx"] 12528 self.ptr = keywords["ptr"] 12529 return 12530 if len(args) == 1 and args[0].__class__ is point: 12531 self.ctx = Context.getDefaultInstance() 12532 self.ptr = isl.isl_basic_set_from_point(isl.isl_point_copy(args[0].ptr)) 12533 return 12534 if len(args) == 1 and type(args[0]) == str: 12535 self.ctx = Context.getDefaultInstance() 12536 self.ptr = isl.isl_basic_set_read_from_str(self.ctx, args[0].encode('ascii')) 12537 return 12538 raise Error 12539 def __del__(self): 12540 if hasattr(self, 'ptr'): 12541 isl.isl_basic_set_free(self.ptr) 12542 def __str__(arg0): 12543 try: 12544 if not arg0.__class__ is basic_set: 12545 arg0 = basic_set(arg0) 12546 except: 12547 raise 12548 ptr = isl.isl_basic_set_to_str(arg0.ptr) 12549 res = cast(ptr, c_char_p).value.decode('ascii') 12550 libc.free(ptr) 12551 return res 12552 def __repr__(self): 12553 s = str(self) 12554 if '"' in s: 12555 return 'isl.basic_set("""%s""")' % s 12556 else: 12557 return 'isl.basic_set("%s")' % s 12558 def affine_hull(arg0): 12559 try: 12560 if not arg0.__class__ is basic_set: 12561 arg0 = basic_set(arg0) 12562 except: 12563 raise 12564 ctx = arg0.ctx 12565 res = isl.isl_basic_set_affine_hull(isl.isl_basic_set_copy(arg0.ptr)) 12566 obj = basic_set(ctx=ctx, ptr=res) 12567 return obj 12568 def apply(arg0, arg1): 12569 try: 12570 if not arg0.__class__ is basic_set: 12571 arg0 = basic_set(arg0) 12572 except: 12573 raise 12574 try: 12575 if not arg1.__class__ is basic_map: 12576 arg1 = basic_map(arg1) 12577 except: 12578 return set(arg0).apply(arg1) 12579 ctx = arg0.ctx 12580 res = isl.isl_basic_set_apply(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 12581 obj = basic_set(ctx=ctx, ptr=res) 12582 return obj 12583 def detect_equalities(arg0): 12584 try: 12585 if not arg0.__class__ is basic_set: 12586 arg0 = basic_set(arg0) 12587 except: 12588 raise 12589 ctx = arg0.ctx 12590 res = isl.isl_basic_set_detect_equalities(isl.isl_basic_set_copy(arg0.ptr)) 12591 obj = basic_set(ctx=ctx, ptr=res) 12592 return obj 12593 def dim_max_val(arg0, arg1): 12594 try: 12595 if not arg0.__class__ is basic_set: 12596 arg0 = basic_set(arg0) 12597 except: 12598 raise 12599 ctx = arg0.ctx 12600 res = isl.isl_basic_set_dim_max_val(isl.isl_basic_set_copy(arg0.ptr), arg1) 12601 obj = val(ctx=ctx, ptr=res) 12602 return obj 12603 def flatten(arg0): 12604 try: 12605 if not arg0.__class__ is basic_set: 12606 arg0 = basic_set(arg0) 12607 except: 12608 raise 12609 ctx = arg0.ctx 12610 res = isl.isl_basic_set_flatten(isl.isl_basic_set_copy(arg0.ptr)) 12611 obj = basic_set(ctx=ctx, ptr=res) 12612 return obj 12613 def gist(arg0, arg1): 12614 try: 12615 if not arg0.__class__ is basic_set: 12616 arg0 = basic_set(arg0) 12617 except: 12618 raise 12619 try: 12620 if not arg1.__class__ is basic_set: 12621 arg1 = basic_set(arg1) 12622 except: 12623 return set(arg0).gist(arg1) 12624 ctx = arg0.ctx 12625 res = isl.isl_basic_set_gist(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 12626 obj = basic_set(ctx=ctx, ptr=res) 12627 return obj 12628 def intersect(arg0, arg1): 12629 try: 12630 if not arg0.__class__ is basic_set: 12631 arg0 = basic_set(arg0) 12632 except: 12633 raise 12634 try: 12635 if not arg1.__class__ is basic_set: 12636 arg1 = basic_set(arg1) 12637 except: 12638 return set(arg0).intersect(arg1) 12639 ctx = arg0.ctx 12640 res = isl.isl_basic_set_intersect(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 12641 obj = basic_set(ctx=ctx, ptr=res) 12642 return obj 12643 def intersect_params(arg0, arg1): 12644 try: 12645 if not arg0.__class__ is basic_set: 12646 arg0 = basic_set(arg0) 12647 except: 12648 raise 12649 try: 12650 if not arg1.__class__ is basic_set: 12651 arg1 = basic_set(arg1) 12652 except: 12653 return set(arg0).intersect_params(arg1) 12654 ctx = arg0.ctx 12655 res = isl.isl_basic_set_intersect_params(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 12656 obj = basic_set(ctx=ctx, ptr=res) 12657 return obj 12658 def is_empty(arg0): 12659 try: 12660 if not arg0.__class__ is basic_set: 12661 arg0 = basic_set(arg0) 12662 except: 12663 raise 12664 ctx = arg0.ctx 12665 res = isl.isl_basic_set_is_empty(arg0.ptr) 12666 if res < 0: 12667 raise Error 12668 return bool(res) 12669 def is_equal(arg0, arg1): 12670 try: 12671 if not arg0.__class__ is basic_set: 12672 arg0 = basic_set(arg0) 12673 except: 12674 raise 12675 try: 12676 if not arg1.__class__ is basic_set: 12677 arg1 = basic_set(arg1) 12678 except: 12679 return set(arg0).is_equal(arg1) 12680 ctx = arg0.ctx 12681 res = isl.isl_basic_set_is_equal(arg0.ptr, arg1.ptr) 12682 if res < 0: 12683 raise Error 12684 return bool(res) 12685 def is_subset(arg0, arg1): 12686 try: 12687 if not arg0.__class__ is basic_set: 12688 arg0 = basic_set(arg0) 12689 except: 12690 raise 12691 try: 12692 if not arg1.__class__ is basic_set: 12693 arg1 = basic_set(arg1) 12694 except: 12695 return set(arg0).is_subset(arg1) 12696 ctx = arg0.ctx 12697 res = isl.isl_basic_set_is_subset(arg0.ptr, arg1.ptr) 12698 if res < 0: 12699 raise Error 12700 return bool(res) 12701 def is_wrapping(arg0): 12702 try: 12703 if not arg0.__class__ is basic_set: 12704 arg0 = basic_set(arg0) 12705 except: 12706 raise 12707 ctx = arg0.ctx 12708 res = isl.isl_basic_set_is_wrapping(arg0.ptr) 12709 if res < 0: 12710 raise Error 12711 return bool(res) 12712 def lexmax(arg0): 12713 try: 12714 if not arg0.__class__ is basic_set: 12715 arg0 = basic_set(arg0) 12716 except: 12717 raise 12718 ctx = arg0.ctx 12719 res = isl.isl_basic_set_lexmax(isl.isl_basic_set_copy(arg0.ptr)) 12720 obj = set(ctx=ctx, ptr=res) 12721 return obj 12722 def lexmin(arg0): 12723 try: 12724 if not arg0.__class__ is basic_set: 12725 arg0 = basic_set(arg0) 12726 except: 12727 raise 12728 ctx = arg0.ctx 12729 res = isl.isl_basic_set_lexmin(isl.isl_basic_set_copy(arg0.ptr)) 12730 obj = set(ctx=ctx, ptr=res) 12731 return obj 12732 def params(arg0): 12733 try: 12734 if not arg0.__class__ is basic_set: 12735 arg0 = basic_set(arg0) 12736 except: 12737 raise 12738 ctx = arg0.ctx 12739 res = isl.isl_basic_set_params(isl.isl_basic_set_copy(arg0.ptr)) 12740 obj = basic_set(ctx=ctx, ptr=res) 12741 return obj 12742 def sample(arg0): 12743 try: 12744 if not arg0.__class__ is basic_set: 12745 arg0 = basic_set(arg0) 12746 except: 12747 raise 12748 ctx = arg0.ctx 12749 res = isl.isl_basic_set_sample(isl.isl_basic_set_copy(arg0.ptr)) 12750 obj = basic_set(ctx=ctx, ptr=res) 12751 return obj 12752 def sample_point(arg0): 12753 try: 12754 if not arg0.__class__ is basic_set: 12755 arg0 = basic_set(arg0) 12756 except: 12757 raise 12758 ctx = arg0.ctx 12759 res = isl.isl_basic_set_sample_point(isl.isl_basic_set_copy(arg0.ptr)) 12760 obj = point(ctx=ctx, ptr=res) 12761 return obj 12762 def to_set(arg0): 12763 try: 12764 if not arg0.__class__ is basic_set: 12765 arg0 = basic_set(arg0) 12766 except: 12767 raise 12768 ctx = arg0.ctx 12769 res = isl.isl_basic_set_to_set(isl.isl_basic_set_copy(arg0.ptr)) 12770 obj = set(ctx=ctx, ptr=res) 12771 return obj 12772 def union(arg0, arg1): 12773 try: 12774 if not arg0.__class__ is basic_set: 12775 arg0 = basic_set(arg0) 12776 except: 12777 raise 12778 try: 12779 if not arg1.__class__ is basic_set: 12780 arg1 = basic_set(arg1) 12781 except: 12782 return set(arg0).union(arg1) 12783 ctx = arg0.ctx 12784 res = isl.isl_basic_set_union(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 12785 obj = set(ctx=ctx, ptr=res) 12786 return obj 12787 12788isl.isl_basic_set_from_point.restype = c_void_p 12789isl.isl_basic_set_from_point.argtypes = [c_void_p] 12790isl.isl_basic_set_read_from_str.restype = c_void_p 12791isl.isl_basic_set_read_from_str.argtypes = [Context, c_char_p] 12792isl.isl_basic_set_affine_hull.restype = c_void_p 12793isl.isl_basic_set_affine_hull.argtypes = [c_void_p] 12794isl.isl_basic_set_apply.restype = c_void_p 12795isl.isl_basic_set_apply.argtypes = [c_void_p, c_void_p] 12796isl.isl_basic_set_detect_equalities.restype = c_void_p 12797isl.isl_basic_set_detect_equalities.argtypes = [c_void_p] 12798isl.isl_basic_set_dim_max_val.restype = c_void_p 12799isl.isl_basic_set_dim_max_val.argtypes = [c_void_p, c_int] 12800isl.isl_basic_set_flatten.restype = c_void_p 12801isl.isl_basic_set_flatten.argtypes = [c_void_p] 12802isl.isl_basic_set_gist.restype = c_void_p 12803isl.isl_basic_set_gist.argtypes = [c_void_p, c_void_p] 12804isl.isl_basic_set_intersect.restype = c_void_p 12805isl.isl_basic_set_intersect.argtypes = [c_void_p, c_void_p] 12806isl.isl_basic_set_intersect_params.restype = c_void_p 12807isl.isl_basic_set_intersect_params.argtypes = [c_void_p, c_void_p] 12808isl.isl_basic_set_is_empty.argtypes = [c_void_p] 12809isl.isl_basic_set_is_equal.argtypes = [c_void_p, c_void_p] 12810isl.isl_basic_set_is_subset.argtypes = [c_void_p, c_void_p] 12811isl.isl_basic_set_is_wrapping.argtypes = [c_void_p] 12812isl.isl_basic_set_lexmax.restype = c_void_p 12813isl.isl_basic_set_lexmax.argtypes = [c_void_p] 12814isl.isl_basic_set_lexmin.restype = c_void_p 12815isl.isl_basic_set_lexmin.argtypes = [c_void_p] 12816isl.isl_basic_set_params.restype = c_void_p 12817isl.isl_basic_set_params.argtypes = [c_void_p] 12818isl.isl_basic_set_sample.restype = c_void_p 12819isl.isl_basic_set_sample.argtypes = [c_void_p] 12820isl.isl_basic_set_sample_point.restype = c_void_p 12821isl.isl_basic_set_sample_point.argtypes = [c_void_p] 12822isl.isl_basic_set_to_set.restype = c_void_p 12823isl.isl_basic_set_to_set.argtypes = [c_void_p] 12824isl.isl_basic_set_union.restype = c_void_p 12825isl.isl_basic_set_union.argtypes = [c_void_p, c_void_p] 12826isl.isl_basic_set_copy.restype = c_void_p 12827isl.isl_basic_set_copy.argtypes = [c_void_p] 12828isl.isl_basic_set_free.restype = c_void_p 12829isl.isl_basic_set_free.argtypes = [c_void_p] 12830isl.isl_basic_set_to_str.restype = POINTER(c_char) 12831isl.isl_basic_set_to_str.argtypes = [c_void_p] 12832 12833class fixed_box(object): 12834 def __init__(self, *args, **keywords): 12835 if "ptr" in keywords: 12836 self.ctx = keywords["ctx"] 12837 self.ptr = keywords["ptr"] 12838 return 12839 if len(args) == 1 and type(args[0]) == str: 12840 self.ctx = Context.getDefaultInstance() 12841 self.ptr = isl.isl_fixed_box_read_from_str(self.ctx, args[0].encode('ascii')) 12842 return 12843 raise Error 12844 def __del__(self): 12845 if hasattr(self, 'ptr'): 12846 isl.isl_fixed_box_free(self.ptr) 12847 def __str__(arg0): 12848 try: 12849 if not arg0.__class__ is fixed_box: 12850 arg0 = fixed_box(arg0) 12851 except: 12852 raise 12853 ptr = isl.isl_fixed_box_to_str(arg0.ptr) 12854 res = cast(ptr, c_char_p).value.decode('ascii') 12855 libc.free(ptr) 12856 return res 12857 def __repr__(self): 12858 s = str(self) 12859 if '"' in s: 12860 return 'isl.fixed_box("""%s""")' % s 12861 else: 12862 return 'isl.fixed_box("%s")' % s 12863 def is_valid(arg0): 12864 try: 12865 if not arg0.__class__ is fixed_box: 12866 arg0 = fixed_box(arg0) 12867 except: 12868 raise 12869 ctx = arg0.ctx 12870 res = isl.isl_fixed_box_is_valid(arg0.ptr) 12871 if res < 0: 12872 raise Error 12873 return bool(res) 12874 def offset(arg0): 12875 try: 12876 if not arg0.__class__ is fixed_box: 12877 arg0 = fixed_box(arg0) 12878 except: 12879 raise 12880 ctx = arg0.ctx 12881 res = isl.isl_fixed_box_get_offset(arg0.ptr) 12882 obj = multi_aff(ctx=ctx, ptr=res) 12883 return obj 12884 def get_offset(arg0): 12885 return arg0.offset() 12886 def size(arg0): 12887 try: 12888 if not arg0.__class__ is fixed_box: 12889 arg0 = fixed_box(arg0) 12890 except: 12891 raise 12892 ctx = arg0.ctx 12893 res = isl.isl_fixed_box_get_size(arg0.ptr) 12894 obj = multi_val(ctx=ctx, ptr=res) 12895 return obj 12896 def get_size(arg0): 12897 return arg0.size() 12898 def space(arg0): 12899 try: 12900 if not arg0.__class__ is fixed_box: 12901 arg0 = fixed_box(arg0) 12902 except: 12903 raise 12904 ctx = arg0.ctx 12905 res = isl.isl_fixed_box_get_space(arg0.ptr) 12906 obj = space(ctx=ctx, ptr=res) 12907 return obj 12908 def get_space(arg0): 12909 return arg0.space() 12910 12911isl.isl_fixed_box_read_from_str.restype = c_void_p 12912isl.isl_fixed_box_read_from_str.argtypes = [Context, c_char_p] 12913isl.isl_fixed_box_is_valid.argtypes = [c_void_p] 12914isl.isl_fixed_box_get_offset.restype = c_void_p 12915isl.isl_fixed_box_get_offset.argtypes = [c_void_p] 12916isl.isl_fixed_box_get_size.restype = c_void_p 12917isl.isl_fixed_box_get_size.argtypes = [c_void_p] 12918isl.isl_fixed_box_get_space.restype = c_void_p 12919isl.isl_fixed_box_get_space.argtypes = [c_void_p] 12920isl.isl_fixed_box_copy.restype = c_void_p 12921isl.isl_fixed_box_copy.argtypes = [c_void_p] 12922isl.isl_fixed_box_free.restype = c_void_p 12923isl.isl_fixed_box_free.argtypes = [c_void_p] 12924isl.isl_fixed_box_to_str.restype = POINTER(c_char) 12925isl.isl_fixed_box_to_str.argtypes = [c_void_p] 12926 12927class id(object): 12928 def __init__(self, *args, **keywords): 12929 if "ptr" in keywords: 12930 self.ctx = keywords["ctx"] 12931 self.ptr = keywords["ptr"] 12932 return 12933 if len(args) == 1 and type(args[0]) == str: 12934 self.ctx = Context.getDefaultInstance() 12935 self.ptr = isl.isl_id_read_from_str(self.ctx, args[0].encode('ascii')) 12936 return 12937 if len(args) == 2 and type(args[0]) == str: 12938 self.ctx = Context.getDefaultInstance() 12939 name = args[0].encode('ascii') 12940 self.ptr = isl.isl_id_alloc(self.ctx, name, args[1]) 12941 self.ptr = isl.isl_id_set_free_user(self.ptr, Context.free_user) 12942 if self.ptr is not None: 12943 pythonapi.Py_IncRef(py_object(args[1])) 12944 return 12945 raise Error 12946 def __del__(self): 12947 if hasattr(self, 'ptr'): 12948 isl.isl_id_free(self.ptr) 12949 def __str__(arg0): 12950 try: 12951 if not arg0.__class__ is id: 12952 arg0 = id(arg0) 12953 except: 12954 raise 12955 ptr = isl.isl_id_to_str(arg0.ptr) 12956 res = cast(ptr, c_char_p).value.decode('ascii') 12957 libc.free(ptr) 12958 return res 12959 def __repr__(self): 12960 s = str(self) 12961 if '"' in s: 12962 return 'isl.id("""%s""")' % s 12963 else: 12964 return 'isl.id("%s")' % s 12965 def user(self): 12966 free_user = cast(Context.free_user, c_void_p) 12967 id_free_user = cast(isl.isl_id_get_free_user(self.ptr), c_void_p) 12968 if id_free_user.value != free_user.value: 12969 return None 12970 return isl.isl_id_get_user(self.ptr) 12971 def name(arg0): 12972 try: 12973 if not arg0.__class__ is id: 12974 arg0 = id(arg0) 12975 except: 12976 raise 12977 ctx = arg0.ctx 12978 res = isl.isl_id_get_name(arg0.ptr) 12979 if res == 0: 12980 raise Error 12981 string = cast(res, c_char_p).value.decode('ascii') 12982 return string 12983 def get_name(arg0): 12984 return arg0.name() 12985 def to_list(arg0): 12986 try: 12987 if not arg0.__class__ is id: 12988 arg0 = id(arg0) 12989 except: 12990 raise 12991 ctx = arg0.ctx 12992 res = isl.isl_id_to_list(isl.isl_id_copy(arg0.ptr)) 12993 obj = id_list(ctx=ctx, ptr=res) 12994 return obj 12995 12996isl.isl_id_read_from_str.restype = c_void_p 12997isl.isl_id_read_from_str.argtypes = [Context, c_char_p] 12998isl.isl_id_get_name.restype = POINTER(c_char) 12999isl.isl_id_get_name.argtypes = [c_void_p] 13000isl.isl_id_to_list.restype = c_void_p 13001isl.isl_id_to_list.argtypes = [c_void_p] 13002isl.isl_id_copy.restype = c_void_p 13003isl.isl_id_copy.argtypes = [c_void_p] 13004isl.isl_id_free.restype = c_void_p 13005isl.isl_id_free.argtypes = [c_void_p] 13006isl.isl_id_to_str.restype = POINTER(c_char) 13007isl.isl_id_to_str.argtypes = [c_void_p] 13008 13009class id_list(object): 13010 def __init__(self, *args, **keywords): 13011 if "ptr" in keywords: 13012 self.ctx = keywords["ctx"] 13013 self.ptr = keywords["ptr"] 13014 return 13015 if len(args) == 1 and type(args[0]) == int: 13016 self.ctx = Context.getDefaultInstance() 13017 self.ptr = isl.isl_id_list_alloc(self.ctx, args[0]) 13018 return 13019 if len(args) == 1 and (args[0].__class__ is id or type(args[0]) == str): 13020 args = list(args) 13021 try: 13022 if not args[0].__class__ is id: 13023 args[0] = id(args[0]) 13024 except: 13025 raise 13026 self.ctx = Context.getDefaultInstance() 13027 self.ptr = isl.isl_id_list_from_id(isl.isl_id_copy(args[0].ptr)) 13028 return 13029 if len(args) == 1 and type(args[0]) == str: 13030 self.ctx = Context.getDefaultInstance() 13031 self.ptr = isl.isl_id_list_read_from_str(self.ctx, args[0].encode('ascii')) 13032 return 13033 raise Error 13034 def __del__(self): 13035 if hasattr(self, 'ptr'): 13036 isl.isl_id_list_free(self.ptr) 13037 def __str__(arg0): 13038 try: 13039 if not arg0.__class__ is id_list: 13040 arg0 = id_list(arg0) 13041 except: 13042 raise 13043 ptr = isl.isl_id_list_to_str(arg0.ptr) 13044 res = cast(ptr, c_char_p).value.decode('ascii') 13045 libc.free(ptr) 13046 return res 13047 def __repr__(self): 13048 s = str(self) 13049 if '"' in s: 13050 return 'isl.id_list("""%s""")' % s 13051 else: 13052 return 'isl.id_list("%s")' % s 13053 def add(arg0, arg1): 13054 try: 13055 if not arg0.__class__ is id_list: 13056 arg0 = id_list(arg0) 13057 except: 13058 raise 13059 try: 13060 if not arg1.__class__ is id: 13061 arg1 = id(arg1) 13062 except: 13063 raise 13064 ctx = arg0.ctx 13065 res = isl.isl_id_list_add(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 13066 obj = id_list(ctx=ctx, ptr=res) 13067 return obj 13068 def at(arg0, arg1): 13069 try: 13070 if not arg0.__class__ is id_list: 13071 arg0 = id_list(arg0) 13072 except: 13073 raise 13074 ctx = arg0.ctx 13075 res = isl.isl_id_list_get_at(arg0.ptr, arg1) 13076 obj = id(ctx=ctx, ptr=res) 13077 return obj 13078 def get_at(arg0, arg1): 13079 return arg0.at(arg1) 13080 def clear(arg0): 13081 try: 13082 if not arg0.__class__ is id_list: 13083 arg0 = id_list(arg0) 13084 except: 13085 raise 13086 ctx = arg0.ctx 13087 res = isl.isl_id_list_clear(isl.isl_id_list_copy(arg0.ptr)) 13088 obj = id_list(ctx=ctx, ptr=res) 13089 return obj 13090 def concat(arg0, arg1): 13091 try: 13092 if not arg0.__class__ is id_list: 13093 arg0 = id_list(arg0) 13094 except: 13095 raise 13096 try: 13097 if not arg1.__class__ is id_list: 13098 arg1 = id_list(arg1) 13099 except: 13100 raise 13101 ctx = arg0.ctx 13102 res = isl.isl_id_list_concat(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_list_copy(arg1.ptr)) 13103 obj = id_list(ctx=ctx, ptr=res) 13104 return obj 13105 def drop(arg0, arg1, arg2): 13106 try: 13107 if not arg0.__class__ is id_list: 13108 arg0 = id_list(arg0) 13109 except: 13110 raise 13111 ctx = arg0.ctx 13112 res = isl.isl_id_list_drop(isl.isl_id_list_copy(arg0.ptr), arg1, arg2) 13113 obj = id_list(ctx=ctx, ptr=res) 13114 return obj 13115 def foreach(arg0, arg1): 13116 try: 13117 if not arg0.__class__ is id_list: 13118 arg0 = id_list(arg0) 13119 except: 13120 raise 13121 exc_info = [None] 13122 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13123 def cb_func(cb_arg0, cb_arg1): 13124 cb_arg0 = id(ctx=arg0.ctx, ptr=(cb_arg0)) 13125 try: 13126 arg1(cb_arg0) 13127 except BaseException as e: 13128 exc_info[0] = e 13129 return -1 13130 return 0 13131 cb1 = fn(cb_func) 13132 ctx = arg0.ctx 13133 res = isl.isl_id_list_foreach(arg0.ptr, cb1, None) 13134 if exc_info[0] is not None: 13135 raise exc_info[0] 13136 if res < 0: 13137 raise Error 13138 def foreach_scc(arg0, arg1, arg2): 13139 try: 13140 if not arg0.__class__ is id_list: 13141 arg0 = id_list(arg0) 13142 except: 13143 raise 13144 exc_info = [None] 13145 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 13146 def cb_func(cb_arg0, cb_arg1, cb_arg2): 13147 cb_arg0 = id(ctx=arg0.ctx, ptr=isl.isl_id_copy(cb_arg0)) 13148 cb_arg1 = id(ctx=arg0.ctx, ptr=isl.isl_id_copy(cb_arg1)) 13149 try: 13150 res = arg1(cb_arg0, cb_arg1) 13151 except BaseException as e: 13152 exc_info[0] = e 13153 return -1 13154 return 1 if res else 0 13155 cb1 = fn(cb_func) 13156 exc_info = [None] 13157 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13158 def cb_func(cb_arg0, cb_arg1): 13159 cb_arg0 = id_list(ctx=arg0.ctx, ptr=(cb_arg0)) 13160 try: 13161 arg2(cb_arg0) 13162 except BaseException as e: 13163 exc_info[0] = e 13164 return -1 13165 return 0 13166 cb2 = fn(cb_func) 13167 ctx = arg0.ctx 13168 res = isl.isl_id_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 13169 if exc_info[0] is not None: 13170 raise exc_info[0] 13171 if res < 0: 13172 raise Error 13173 def insert(arg0, arg1, arg2): 13174 try: 13175 if not arg0.__class__ is id_list: 13176 arg0 = id_list(arg0) 13177 except: 13178 raise 13179 try: 13180 if not arg2.__class__ is id: 13181 arg2 = id(arg2) 13182 except: 13183 raise 13184 ctx = arg0.ctx 13185 res = isl.isl_id_list_insert(isl.isl_id_list_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 13186 obj = id_list(ctx=ctx, ptr=res) 13187 return obj 13188 def set_at(arg0, arg1, arg2): 13189 try: 13190 if not arg0.__class__ is id_list: 13191 arg0 = id_list(arg0) 13192 except: 13193 raise 13194 try: 13195 if not arg2.__class__ is id: 13196 arg2 = id(arg2) 13197 except: 13198 raise 13199 ctx = arg0.ctx 13200 res = isl.isl_id_list_set_at(isl.isl_id_list_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 13201 obj = id_list(ctx=ctx, ptr=res) 13202 return obj 13203 def size(arg0): 13204 try: 13205 if not arg0.__class__ is id_list: 13206 arg0 = id_list(arg0) 13207 except: 13208 raise 13209 ctx = arg0.ctx 13210 res = isl.isl_id_list_size(arg0.ptr) 13211 if res < 0: 13212 raise Error 13213 return int(res) 13214 13215isl.isl_id_list_alloc.restype = c_void_p 13216isl.isl_id_list_alloc.argtypes = [Context, c_int] 13217isl.isl_id_list_from_id.restype = c_void_p 13218isl.isl_id_list_from_id.argtypes = [c_void_p] 13219isl.isl_id_list_read_from_str.restype = c_void_p 13220isl.isl_id_list_read_from_str.argtypes = [Context, c_char_p] 13221isl.isl_id_list_add.restype = c_void_p 13222isl.isl_id_list_add.argtypes = [c_void_p, c_void_p] 13223isl.isl_id_list_get_at.restype = c_void_p 13224isl.isl_id_list_get_at.argtypes = [c_void_p, c_int] 13225isl.isl_id_list_clear.restype = c_void_p 13226isl.isl_id_list_clear.argtypes = [c_void_p] 13227isl.isl_id_list_concat.restype = c_void_p 13228isl.isl_id_list_concat.argtypes = [c_void_p, c_void_p] 13229isl.isl_id_list_drop.restype = c_void_p 13230isl.isl_id_list_drop.argtypes = [c_void_p, c_int, c_int] 13231isl.isl_id_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 13232isl.isl_id_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 13233isl.isl_id_list_insert.restype = c_void_p 13234isl.isl_id_list_insert.argtypes = [c_void_p, c_int, c_void_p] 13235isl.isl_id_list_set_at.restype = c_void_p 13236isl.isl_id_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 13237isl.isl_id_list_size.argtypes = [c_void_p] 13238isl.isl_id_list_copy.restype = c_void_p 13239isl.isl_id_list_copy.argtypes = [c_void_p] 13240isl.isl_id_list_free.restype = c_void_p 13241isl.isl_id_list_free.argtypes = [c_void_p] 13242isl.isl_id_list_to_str.restype = POINTER(c_char) 13243isl.isl_id_list_to_str.argtypes = [c_void_p] 13244 13245class id_to_ast_expr(object): 13246 def __init__(self, *args, **keywords): 13247 if "ptr" in keywords: 13248 self.ctx = keywords["ctx"] 13249 self.ptr = keywords["ptr"] 13250 return 13251 if len(args) == 1 and type(args[0]) == int: 13252 self.ctx = Context.getDefaultInstance() 13253 self.ptr = isl.isl_id_to_ast_expr_alloc(self.ctx, args[0]) 13254 return 13255 if len(args) == 1 and type(args[0]) == str: 13256 self.ctx = Context.getDefaultInstance() 13257 self.ptr = isl.isl_id_to_ast_expr_read_from_str(self.ctx, args[0].encode('ascii')) 13258 return 13259 raise Error 13260 def __del__(self): 13261 if hasattr(self, 'ptr'): 13262 isl.isl_id_to_ast_expr_free(self.ptr) 13263 def __str__(arg0): 13264 try: 13265 if not arg0.__class__ is id_to_ast_expr: 13266 arg0 = id_to_ast_expr(arg0) 13267 except: 13268 raise 13269 ptr = isl.isl_id_to_ast_expr_to_str(arg0.ptr) 13270 res = cast(ptr, c_char_p).value.decode('ascii') 13271 libc.free(ptr) 13272 return res 13273 def __repr__(self): 13274 s = str(self) 13275 if '"' in s: 13276 return 'isl.id_to_ast_expr("""%s""")' % s 13277 else: 13278 return 'isl.id_to_ast_expr("%s")' % s 13279 def is_equal(arg0, arg1): 13280 try: 13281 if not arg0.__class__ is id_to_ast_expr: 13282 arg0 = id_to_ast_expr(arg0) 13283 except: 13284 raise 13285 try: 13286 if not arg1.__class__ is id_to_ast_expr: 13287 arg1 = id_to_ast_expr(arg1) 13288 except: 13289 raise 13290 ctx = arg0.ctx 13291 res = isl.isl_id_to_ast_expr_is_equal(arg0.ptr, arg1.ptr) 13292 if res < 0: 13293 raise Error 13294 return bool(res) 13295 def set(arg0, arg1, arg2): 13296 try: 13297 if not arg0.__class__ is id_to_ast_expr: 13298 arg0 = id_to_ast_expr(arg0) 13299 except: 13300 raise 13301 try: 13302 if not arg1.__class__ is id: 13303 arg1 = id(arg1) 13304 except: 13305 raise 13306 try: 13307 if not arg2.__class__ is ast_expr: 13308 arg2 = ast_expr(arg2) 13309 except: 13310 raise 13311 ctx = arg0.ctx 13312 res = isl.isl_id_to_ast_expr_set(isl.isl_id_to_ast_expr_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr), isl.isl_ast_expr_copy(arg2.ptr)) 13313 obj = id_to_ast_expr(ctx=ctx, ptr=res) 13314 return obj 13315 13316isl.isl_id_to_ast_expr_alloc.restype = c_void_p 13317isl.isl_id_to_ast_expr_alloc.argtypes = [Context, c_int] 13318isl.isl_id_to_ast_expr_read_from_str.restype = c_void_p 13319isl.isl_id_to_ast_expr_read_from_str.argtypes = [Context, c_char_p] 13320isl.isl_id_to_ast_expr_is_equal.argtypes = [c_void_p, c_void_p] 13321isl.isl_id_to_ast_expr_set.restype = c_void_p 13322isl.isl_id_to_ast_expr_set.argtypes = [c_void_p, c_void_p, c_void_p] 13323isl.isl_id_to_ast_expr_copy.restype = c_void_p 13324isl.isl_id_to_ast_expr_copy.argtypes = [c_void_p] 13325isl.isl_id_to_ast_expr_free.restype = c_void_p 13326isl.isl_id_to_ast_expr_free.argtypes = [c_void_p] 13327isl.isl_id_to_ast_expr_to_str.restype = POINTER(c_char) 13328isl.isl_id_to_ast_expr_to_str.argtypes = [c_void_p] 13329 13330class id_to_id(object): 13331 def __init__(self, *args, **keywords): 13332 if "ptr" in keywords: 13333 self.ctx = keywords["ctx"] 13334 self.ptr = keywords["ptr"] 13335 return 13336 if len(args) == 1 and type(args[0]) == int: 13337 self.ctx = Context.getDefaultInstance() 13338 self.ptr = isl.isl_id_to_id_alloc(self.ctx, args[0]) 13339 return 13340 if len(args) == 1 and type(args[0]) == str: 13341 self.ctx = Context.getDefaultInstance() 13342 self.ptr = isl.isl_id_to_id_read_from_str(self.ctx, args[0].encode('ascii')) 13343 return 13344 raise Error 13345 def __del__(self): 13346 if hasattr(self, 'ptr'): 13347 isl.isl_id_to_id_free(self.ptr) 13348 def __str__(arg0): 13349 try: 13350 if not arg0.__class__ is id_to_id: 13351 arg0 = id_to_id(arg0) 13352 except: 13353 raise 13354 ptr = isl.isl_id_to_id_to_str(arg0.ptr) 13355 res = cast(ptr, c_char_p).value.decode('ascii') 13356 libc.free(ptr) 13357 return res 13358 def __repr__(self): 13359 s = str(self) 13360 if '"' in s: 13361 return 'isl.id_to_id("""%s""")' % s 13362 else: 13363 return 'isl.id_to_id("%s")' % s 13364 def is_equal(arg0, arg1): 13365 try: 13366 if not arg0.__class__ is id_to_id: 13367 arg0 = id_to_id(arg0) 13368 except: 13369 raise 13370 try: 13371 if not arg1.__class__ is id_to_id: 13372 arg1 = id_to_id(arg1) 13373 except: 13374 raise 13375 ctx = arg0.ctx 13376 res = isl.isl_id_to_id_is_equal(arg0.ptr, arg1.ptr) 13377 if res < 0: 13378 raise Error 13379 return bool(res) 13380 def set(arg0, arg1, arg2): 13381 try: 13382 if not arg0.__class__ is id_to_id: 13383 arg0 = id_to_id(arg0) 13384 except: 13385 raise 13386 try: 13387 if not arg1.__class__ is id: 13388 arg1 = id(arg1) 13389 except: 13390 raise 13391 try: 13392 if not arg2.__class__ is id: 13393 arg2 = id(arg2) 13394 except: 13395 raise 13396 ctx = arg0.ctx 13397 res = isl.isl_id_to_id_set(isl.isl_id_to_id_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr), isl.isl_id_copy(arg2.ptr)) 13398 obj = id_to_id(ctx=ctx, ptr=res) 13399 return obj 13400 13401isl.isl_id_to_id_alloc.restype = c_void_p 13402isl.isl_id_to_id_alloc.argtypes = [Context, c_int] 13403isl.isl_id_to_id_read_from_str.restype = c_void_p 13404isl.isl_id_to_id_read_from_str.argtypes = [Context, c_char_p] 13405isl.isl_id_to_id_is_equal.argtypes = [c_void_p, c_void_p] 13406isl.isl_id_to_id_set.restype = c_void_p 13407isl.isl_id_to_id_set.argtypes = [c_void_p, c_void_p, c_void_p] 13408isl.isl_id_to_id_copy.restype = c_void_p 13409isl.isl_id_to_id_copy.argtypes = [c_void_p] 13410isl.isl_id_to_id_free.restype = c_void_p 13411isl.isl_id_to_id_free.argtypes = [c_void_p] 13412isl.isl_id_to_id_to_str.restype = POINTER(c_char) 13413isl.isl_id_to_id_to_str.argtypes = [c_void_p] 13414 13415class map_list(object): 13416 def __init__(self, *args, **keywords): 13417 if "ptr" in keywords: 13418 self.ctx = keywords["ctx"] 13419 self.ptr = keywords["ptr"] 13420 return 13421 if len(args) == 1 and type(args[0]) == int: 13422 self.ctx = Context.getDefaultInstance() 13423 self.ptr = isl.isl_map_list_alloc(self.ctx, args[0]) 13424 return 13425 if len(args) == 1 and args[0].__class__ is map: 13426 self.ctx = Context.getDefaultInstance() 13427 self.ptr = isl.isl_map_list_from_map(isl.isl_map_copy(args[0].ptr)) 13428 return 13429 if len(args) == 1 and type(args[0]) == str: 13430 self.ctx = Context.getDefaultInstance() 13431 self.ptr = isl.isl_map_list_read_from_str(self.ctx, args[0].encode('ascii')) 13432 return 13433 raise Error 13434 def __del__(self): 13435 if hasattr(self, 'ptr'): 13436 isl.isl_map_list_free(self.ptr) 13437 def __str__(arg0): 13438 try: 13439 if not arg0.__class__ is map_list: 13440 arg0 = map_list(arg0) 13441 except: 13442 raise 13443 ptr = isl.isl_map_list_to_str(arg0.ptr) 13444 res = cast(ptr, c_char_p).value.decode('ascii') 13445 libc.free(ptr) 13446 return res 13447 def __repr__(self): 13448 s = str(self) 13449 if '"' in s: 13450 return 'isl.map_list("""%s""")' % s 13451 else: 13452 return 'isl.map_list("%s")' % s 13453 def add(arg0, arg1): 13454 try: 13455 if not arg0.__class__ is map_list: 13456 arg0 = map_list(arg0) 13457 except: 13458 raise 13459 try: 13460 if not arg1.__class__ is map: 13461 arg1 = map(arg1) 13462 except: 13463 raise 13464 ctx = arg0.ctx 13465 res = isl.isl_map_list_add(isl.isl_map_list_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 13466 obj = map_list(ctx=ctx, ptr=res) 13467 return obj 13468 def at(arg0, arg1): 13469 try: 13470 if not arg0.__class__ is map_list: 13471 arg0 = map_list(arg0) 13472 except: 13473 raise 13474 ctx = arg0.ctx 13475 res = isl.isl_map_list_get_at(arg0.ptr, arg1) 13476 obj = map(ctx=ctx, ptr=res) 13477 return obj 13478 def get_at(arg0, arg1): 13479 return arg0.at(arg1) 13480 def clear(arg0): 13481 try: 13482 if not arg0.__class__ is map_list: 13483 arg0 = map_list(arg0) 13484 except: 13485 raise 13486 ctx = arg0.ctx 13487 res = isl.isl_map_list_clear(isl.isl_map_list_copy(arg0.ptr)) 13488 obj = map_list(ctx=ctx, ptr=res) 13489 return obj 13490 def concat(arg0, arg1): 13491 try: 13492 if not arg0.__class__ is map_list: 13493 arg0 = map_list(arg0) 13494 except: 13495 raise 13496 try: 13497 if not arg1.__class__ is map_list: 13498 arg1 = map_list(arg1) 13499 except: 13500 raise 13501 ctx = arg0.ctx 13502 res = isl.isl_map_list_concat(isl.isl_map_list_copy(arg0.ptr), isl.isl_map_list_copy(arg1.ptr)) 13503 obj = map_list(ctx=ctx, ptr=res) 13504 return obj 13505 def drop(arg0, arg1, arg2): 13506 try: 13507 if not arg0.__class__ is map_list: 13508 arg0 = map_list(arg0) 13509 except: 13510 raise 13511 ctx = arg0.ctx 13512 res = isl.isl_map_list_drop(isl.isl_map_list_copy(arg0.ptr), arg1, arg2) 13513 obj = map_list(ctx=ctx, ptr=res) 13514 return obj 13515 def foreach(arg0, arg1): 13516 try: 13517 if not arg0.__class__ is map_list: 13518 arg0 = map_list(arg0) 13519 except: 13520 raise 13521 exc_info = [None] 13522 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13523 def cb_func(cb_arg0, cb_arg1): 13524 cb_arg0 = map(ctx=arg0.ctx, ptr=(cb_arg0)) 13525 try: 13526 arg1(cb_arg0) 13527 except BaseException as e: 13528 exc_info[0] = e 13529 return -1 13530 return 0 13531 cb1 = fn(cb_func) 13532 ctx = arg0.ctx 13533 res = isl.isl_map_list_foreach(arg0.ptr, cb1, None) 13534 if exc_info[0] is not None: 13535 raise exc_info[0] 13536 if res < 0: 13537 raise Error 13538 def foreach_scc(arg0, arg1, arg2): 13539 try: 13540 if not arg0.__class__ is map_list: 13541 arg0 = map_list(arg0) 13542 except: 13543 raise 13544 exc_info = [None] 13545 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 13546 def cb_func(cb_arg0, cb_arg1, cb_arg2): 13547 cb_arg0 = map(ctx=arg0.ctx, ptr=isl.isl_map_copy(cb_arg0)) 13548 cb_arg1 = map(ctx=arg0.ctx, ptr=isl.isl_map_copy(cb_arg1)) 13549 try: 13550 res = arg1(cb_arg0, cb_arg1) 13551 except BaseException as e: 13552 exc_info[0] = e 13553 return -1 13554 return 1 if res else 0 13555 cb1 = fn(cb_func) 13556 exc_info = [None] 13557 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13558 def cb_func(cb_arg0, cb_arg1): 13559 cb_arg0 = map_list(ctx=arg0.ctx, ptr=(cb_arg0)) 13560 try: 13561 arg2(cb_arg0) 13562 except BaseException as e: 13563 exc_info[0] = e 13564 return -1 13565 return 0 13566 cb2 = fn(cb_func) 13567 ctx = arg0.ctx 13568 res = isl.isl_map_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 13569 if exc_info[0] is not None: 13570 raise exc_info[0] 13571 if res < 0: 13572 raise Error 13573 def insert(arg0, arg1, arg2): 13574 try: 13575 if not arg0.__class__ is map_list: 13576 arg0 = map_list(arg0) 13577 except: 13578 raise 13579 try: 13580 if not arg2.__class__ is map: 13581 arg2 = map(arg2) 13582 except: 13583 raise 13584 ctx = arg0.ctx 13585 res = isl.isl_map_list_insert(isl.isl_map_list_copy(arg0.ptr), arg1, isl.isl_map_copy(arg2.ptr)) 13586 obj = map_list(ctx=ctx, ptr=res) 13587 return obj 13588 def set_at(arg0, arg1, arg2): 13589 try: 13590 if not arg0.__class__ is map_list: 13591 arg0 = map_list(arg0) 13592 except: 13593 raise 13594 try: 13595 if not arg2.__class__ is map: 13596 arg2 = map(arg2) 13597 except: 13598 raise 13599 ctx = arg0.ctx 13600 res = isl.isl_map_list_set_at(isl.isl_map_list_copy(arg0.ptr), arg1, isl.isl_map_copy(arg2.ptr)) 13601 obj = map_list(ctx=ctx, ptr=res) 13602 return obj 13603 def size(arg0): 13604 try: 13605 if not arg0.__class__ is map_list: 13606 arg0 = map_list(arg0) 13607 except: 13608 raise 13609 ctx = arg0.ctx 13610 res = isl.isl_map_list_size(arg0.ptr) 13611 if res < 0: 13612 raise Error 13613 return int(res) 13614 13615isl.isl_map_list_alloc.restype = c_void_p 13616isl.isl_map_list_alloc.argtypes = [Context, c_int] 13617isl.isl_map_list_from_map.restype = c_void_p 13618isl.isl_map_list_from_map.argtypes = [c_void_p] 13619isl.isl_map_list_read_from_str.restype = c_void_p 13620isl.isl_map_list_read_from_str.argtypes = [Context, c_char_p] 13621isl.isl_map_list_add.restype = c_void_p 13622isl.isl_map_list_add.argtypes = [c_void_p, c_void_p] 13623isl.isl_map_list_get_at.restype = c_void_p 13624isl.isl_map_list_get_at.argtypes = [c_void_p, c_int] 13625isl.isl_map_list_clear.restype = c_void_p 13626isl.isl_map_list_clear.argtypes = [c_void_p] 13627isl.isl_map_list_concat.restype = c_void_p 13628isl.isl_map_list_concat.argtypes = [c_void_p, c_void_p] 13629isl.isl_map_list_drop.restype = c_void_p 13630isl.isl_map_list_drop.argtypes = [c_void_p, c_int, c_int] 13631isl.isl_map_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 13632isl.isl_map_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 13633isl.isl_map_list_insert.restype = c_void_p 13634isl.isl_map_list_insert.argtypes = [c_void_p, c_int, c_void_p] 13635isl.isl_map_list_set_at.restype = c_void_p 13636isl.isl_map_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 13637isl.isl_map_list_size.argtypes = [c_void_p] 13638isl.isl_map_list_copy.restype = c_void_p 13639isl.isl_map_list_copy.argtypes = [c_void_p] 13640isl.isl_map_list_free.restype = c_void_p 13641isl.isl_map_list_free.argtypes = [c_void_p] 13642isl.isl_map_list_to_str.restype = POINTER(c_char) 13643isl.isl_map_list_to_str.argtypes = [c_void_p] 13644 13645class multi_id(object): 13646 def __init__(self, *args, **keywords): 13647 if "ptr" in keywords: 13648 self.ctx = keywords["ctx"] 13649 self.ptr = keywords["ptr"] 13650 return 13651 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is id_list: 13652 self.ctx = Context.getDefaultInstance() 13653 self.ptr = isl.isl_multi_id_from_id_list(isl.isl_space_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 13654 return 13655 if len(args) == 1 and type(args[0]) == str: 13656 self.ctx = Context.getDefaultInstance() 13657 self.ptr = isl.isl_multi_id_read_from_str(self.ctx, args[0].encode('ascii')) 13658 return 13659 raise Error 13660 def __del__(self): 13661 if hasattr(self, 'ptr'): 13662 isl.isl_multi_id_free(self.ptr) 13663 def __str__(arg0): 13664 try: 13665 if not arg0.__class__ is multi_id: 13666 arg0 = multi_id(arg0) 13667 except: 13668 raise 13669 ptr = isl.isl_multi_id_to_str(arg0.ptr) 13670 res = cast(ptr, c_char_p).value.decode('ascii') 13671 libc.free(ptr) 13672 return res 13673 def __repr__(self): 13674 s = str(self) 13675 if '"' in s: 13676 return 'isl.multi_id("""%s""")' % s 13677 else: 13678 return 'isl.multi_id("%s")' % s 13679 def at(arg0, arg1): 13680 try: 13681 if not arg0.__class__ is multi_id: 13682 arg0 = multi_id(arg0) 13683 except: 13684 raise 13685 ctx = arg0.ctx 13686 res = isl.isl_multi_id_get_at(arg0.ptr, arg1) 13687 obj = id(ctx=ctx, ptr=res) 13688 return obj 13689 def get_at(arg0, arg1): 13690 return arg0.at(arg1) 13691 def flat_range_product(arg0, arg1): 13692 try: 13693 if not arg0.__class__ is multi_id: 13694 arg0 = multi_id(arg0) 13695 except: 13696 raise 13697 try: 13698 if not arg1.__class__ is multi_id: 13699 arg1 = multi_id(arg1) 13700 except: 13701 raise 13702 ctx = arg0.ctx 13703 res = isl.isl_multi_id_flat_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 13704 obj = multi_id(ctx=ctx, ptr=res) 13705 return obj 13706 def list(arg0): 13707 try: 13708 if not arg0.__class__ is multi_id: 13709 arg0 = multi_id(arg0) 13710 except: 13711 raise 13712 ctx = arg0.ctx 13713 res = isl.isl_multi_id_get_list(arg0.ptr) 13714 obj = id_list(ctx=ctx, ptr=res) 13715 return obj 13716 def get_list(arg0): 13717 return arg0.list() 13718 def plain_is_equal(arg0, arg1): 13719 try: 13720 if not arg0.__class__ is multi_id: 13721 arg0 = multi_id(arg0) 13722 except: 13723 raise 13724 try: 13725 if not arg1.__class__ is multi_id: 13726 arg1 = multi_id(arg1) 13727 except: 13728 raise 13729 ctx = arg0.ctx 13730 res = isl.isl_multi_id_plain_is_equal(arg0.ptr, arg1.ptr) 13731 if res < 0: 13732 raise Error 13733 return bool(res) 13734 def range_product(arg0, arg1): 13735 try: 13736 if not arg0.__class__ is multi_id: 13737 arg0 = multi_id(arg0) 13738 except: 13739 raise 13740 try: 13741 if not arg1.__class__ is multi_id: 13742 arg1 = multi_id(arg1) 13743 except: 13744 raise 13745 ctx = arg0.ctx 13746 res = isl.isl_multi_id_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 13747 obj = multi_id(ctx=ctx, ptr=res) 13748 return obj 13749 def set_at(arg0, arg1, arg2): 13750 try: 13751 if not arg0.__class__ is multi_id: 13752 arg0 = multi_id(arg0) 13753 except: 13754 raise 13755 try: 13756 if not arg2.__class__ is id: 13757 arg2 = id(arg2) 13758 except: 13759 raise 13760 ctx = arg0.ctx 13761 res = isl.isl_multi_id_set_at(isl.isl_multi_id_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 13762 obj = multi_id(ctx=ctx, ptr=res) 13763 return obj 13764 def size(arg0): 13765 try: 13766 if not arg0.__class__ is multi_id: 13767 arg0 = multi_id(arg0) 13768 except: 13769 raise 13770 ctx = arg0.ctx 13771 res = isl.isl_multi_id_size(arg0.ptr) 13772 if res < 0: 13773 raise Error 13774 return int(res) 13775 def space(arg0): 13776 try: 13777 if not arg0.__class__ is multi_id: 13778 arg0 = multi_id(arg0) 13779 except: 13780 raise 13781 ctx = arg0.ctx 13782 res = isl.isl_multi_id_get_space(arg0.ptr) 13783 obj = space(ctx=ctx, ptr=res) 13784 return obj 13785 def get_space(arg0): 13786 return arg0.space() 13787 13788isl.isl_multi_id_from_id_list.restype = c_void_p 13789isl.isl_multi_id_from_id_list.argtypes = [c_void_p, c_void_p] 13790isl.isl_multi_id_read_from_str.restype = c_void_p 13791isl.isl_multi_id_read_from_str.argtypes = [Context, c_char_p] 13792isl.isl_multi_id_get_at.restype = c_void_p 13793isl.isl_multi_id_get_at.argtypes = [c_void_p, c_int] 13794isl.isl_multi_id_flat_range_product.restype = c_void_p 13795isl.isl_multi_id_flat_range_product.argtypes = [c_void_p, c_void_p] 13796isl.isl_multi_id_get_list.restype = c_void_p 13797isl.isl_multi_id_get_list.argtypes = [c_void_p] 13798isl.isl_multi_id_plain_is_equal.argtypes = [c_void_p, c_void_p] 13799isl.isl_multi_id_range_product.restype = c_void_p 13800isl.isl_multi_id_range_product.argtypes = [c_void_p, c_void_p] 13801isl.isl_multi_id_set_at.restype = c_void_p 13802isl.isl_multi_id_set_at.argtypes = [c_void_p, c_int, c_void_p] 13803isl.isl_multi_id_size.argtypes = [c_void_p] 13804isl.isl_multi_id_get_space.restype = c_void_p 13805isl.isl_multi_id_get_space.argtypes = [c_void_p] 13806isl.isl_multi_id_copy.restype = c_void_p 13807isl.isl_multi_id_copy.argtypes = [c_void_p] 13808isl.isl_multi_id_free.restype = c_void_p 13809isl.isl_multi_id_free.argtypes = [c_void_p] 13810isl.isl_multi_id_to_str.restype = POINTER(c_char) 13811isl.isl_multi_id_to_str.argtypes = [c_void_p] 13812 13813class multi_val(object): 13814 def __init__(self, *args, **keywords): 13815 if "ptr" in keywords: 13816 self.ctx = keywords["ctx"] 13817 self.ptr = keywords["ptr"] 13818 return 13819 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is val_list: 13820 self.ctx = Context.getDefaultInstance() 13821 self.ptr = isl.isl_multi_val_from_val_list(isl.isl_space_copy(args[0].ptr), isl.isl_val_list_copy(args[1].ptr)) 13822 return 13823 if len(args) == 1 and type(args[0]) == str: 13824 self.ctx = Context.getDefaultInstance() 13825 self.ptr = isl.isl_multi_val_read_from_str(self.ctx, args[0].encode('ascii')) 13826 return 13827 raise Error 13828 def __del__(self): 13829 if hasattr(self, 'ptr'): 13830 isl.isl_multi_val_free(self.ptr) 13831 def __str__(arg0): 13832 try: 13833 if not arg0.__class__ is multi_val: 13834 arg0 = multi_val(arg0) 13835 except: 13836 raise 13837 ptr = isl.isl_multi_val_to_str(arg0.ptr) 13838 res = cast(ptr, c_char_p).value.decode('ascii') 13839 libc.free(ptr) 13840 return res 13841 def __repr__(self): 13842 s = str(self) 13843 if '"' in s: 13844 return 'isl.multi_val("""%s""")' % s 13845 else: 13846 return 'isl.multi_val("%s")' % s 13847 def add(*args): 13848 if len(args) == 2 and args[1].__class__ is multi_val: 13849 args = list(args) 13850 try: 13851 if not args[0].__class__ is multi_val: 13852 args[0] = multi_val(args[0]) 13853 except: 13854 raise 13855 ctx = args[0].ctx 13856 res = isl.isl_multi_val_add(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 13857 obj = multi_val(ctx=ctx, ptr=res) 13858 return obj 13859 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 13860 args = list(args) 13861 try: 13862 if not args[0].__class__ is multi_val: 13863 args[0] = multi_val(args[0]) 13864 except: 13865 raise 13866 try: 13867 if not args[1].__class__ is val: 13868 args[1] = val(args[1]) 13869 except: 13870 raise 13871 ctx = args[0].ctx 13872 res = isl.isl_multi_val_add_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 13873 obj = multi_val(ctx=ctx, ptr=res) 13874 return obj 13875 raise Error 13876 def at(arg0, arg1): 13877 try: 13878 if not arg0.__class__ is multi_val: 13879 arg0 = multi_val(arg0) 13880 except: 13881 raise 13882 ctx = arg0.ctx 13883 res = isl.isl_multi_val_get_at(arg0.ptr, arg1) 13884 obj = val(ctx=ctx, ptr=res) 13885 return obj 13886 def get_at(arg0, arg1): 13887 return arg0.at(arg1) 13888 def flat_range_product(arg0, arg1): 13889 try: 13890 if not arg0.__class__ is multi_val: 13891 arg0 = multi_val(arg0) 13892 except: 13893 raise 13894 try: 13895 if not arg1.__class__ is multi_val: 13896 arg1 = multi_val(arg1) 13897 except: 13898 raise 13899 ctx = arg0.ctx 13900 res = isl.isl_multi_val_flat_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 13901 obj = multi_val(ctx=ctx, ptr=res) 13902 return obj 13903 def has_range_tuple_id(arg0): 13904 try: 13905 if not arg0.__class__ is multi_val: 13906 arg0 = multi_val(arg0) 13907 except: 13908 raise 13909 ctx = arg0.ctx 13910 res = isl.isl_multi_val_has_range_tuple_id(arg0.ptr) 13911 if res < 0: 13912 raise Error 13913 return bool(res) 13914 def involves_nan(arg0): 13915 try: 13916 if not arg0.__class__ is multi_val: 13917 arg0 = multi_val(arg0) 13918 except: 13919 raise 13920 ctx = arg0.ctx 13921 res = isl.isl_multi_val_involves_nan(arg0.ptr) 13922 if res < 0: 13923 raise Error 13924 return bool(res) 13925 def list(arg0): 13926 try: 13927 if not arg0.__class__ is multi_val: 13928 arg0 = multi_val(arg0) 13929 except: 13930 raise 13931 ctx = arg0.ctx 13932 res = isl.isl_multi_val_get_list(arg0.ptr) 13933 obj = val_list(ctx=ctx, ptr=res) 13934 return obj 13935 def get_list(arg0): 13936 return arg0.list() 13937 def max(arg0, arg1): 13938 try: 13939 if not arg0.__class__ is multi_val: 13940 arg0 = multi_val(arg0) 13941 except: 13942 raise 13943 try: 13944 if not arg1.__class__ is multi_val: 13945 arg1 = multi_val(arg1) 13946 except: 13947 raise 13948 ctx = arg0.ctx 13949 res = isl.isl_multi_val_max(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 13950 obj = multi_val(ctx=ctx, ptr=res) 13951 return obj 13952 def min(arg0, arg1): 13953 try: 13954 if not arg0.__class__ is multi_val: 13955 arg0 = multi_val(arg0) 13956 except: 13957 raise 13958 try: 13959 if not arg1.__class__ is multi_val: 13960 arg1 = multi_val(arg1) 13961 except: 13962 raise 13963 ctx = arg0.ctx 13964 res = isl.isl_multi_val_min(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 13965 obj = multi_val(ctx=ctx, ptr=res) 13966 return obj 13967 def neg(arg0): 13968 try: 13969 if not arg0.__class__ is multi_val: 13970 arg0 = multi_val(arg0) 13971 except: 13972 raise 13973 ctx = arg0.ctx 13974 res = isl.isl_multi_val_neg(isl.isl_multi_val_copy(arg0.ptr)) 13975 obj = multi_val(ctx=ctx, ptr=res) 13976 return obj 13977 def plain_is_equal(arg0, arg1): 13978 try: 13979 if not arg0.__class__ is multi_val: 13980 arg0 = multi_val(arg0) 13981 except: 13982 raise 13983 try: 13984 if not arg1.__class__ is multi_val: 13985 arg1 = multi_val(arg1) 13986 except: 13987 raise 13988 ctx = arg0.ctx 13989 res = isl.isl_multi_val_plain_is_equal(arg0.ptr, arg1.ptr) 13990 if res < 0: 13991 raise Error 13992 return bool(res) 13993 def product(arg0, arg1): 13994 try: 13995 if not arg0.__class__ is multi_val: 13996 arg0 = multi_val(arg0) 13997 except: 13998 raise 13999 try: 14000 if not arg1.__class__ is multi_val: 14001 arg1 = multi_val(arg1) 14002 except: 14003 raise 14004 ctx = arg0.ctx 14005 res = isl.isl_multi_val_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14006 obj = multi_val(ctx=ctx, ptr=res) 14007 return obj 14008 def range_product(arg0, arg1): 14009 try: 14010 if not arg0.__class__ is multi_val: 14011 arg0 = multi_val(arg0) 14012 except: 14013 raise 14014 try: 14015 if not arg1.__class__ is multi_val: 14016 arg1 = multi_val(arg1) 14017 except: 14018 raise 14019 ctx = arg0.ctx 14020 res = isl.isl_multi_val_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14021 obj = multi_val(ctx=ctx, ptr=res) 14022 return obj 14023 def range_tuple_id(arg0): 14024 try: 14025 if not arg0.__class__ is multi_val: 14026 arg0 = multi_val(arg0) 14027 except: 14028 raise 14029 ctx = arg0.ctx 14030 res = isl.isl_multi_val_get_range_tuple_id(arg0.ptr) 14031 obj = id(ctx=ctx, ptr=res) 14032 return obj 14033 def get_range_tuple_id(arg0): 14034 return arg0.range_tuple_id() 14035 def reset_range_tuple_id(arg0): 14036 try: 14037 if not arg0.__class__ is multi_val: 14038 arg0 = multi_val(arg0) 14039 except: 14040 raise 14041 ctx = arg0.ctx 14042 res = isl.isl_multi_val_reset_range_tuple_id(isl.isl_multi_val_copy(arg0.ptr)) 14043 obj = multi_val(ctx=ctx, ptr=res) 14044 return obj 14045 def scale(*args): 14046 if len(args) == 2 and args[1].__class__ is multi_val: 14047 args = list(args) 14048 try: 14049 if not args[0].__class__ is multi_val: 14050 args[0] = multi_val(args[0]) 14051 except: 14052 raise 14053 ctx = args[0].ctx 14054 res = isl.isl_multi_val_scale_multi_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 14055 obj = multi_val(ctx=ctx, ptr=res) 14056 return obj 14057 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 14058 args = list(args) 14059 try: 14060 if not args[0].__class__ is multi_val: 14061 args[0] = multi_val(args[0]) 14062 except: 14063 raise 14064 try: 14065 if not args[1].__class__ is val: 14066 args[1] = val(args[1]) 14067 except: 14068 raise 14069 ctx = args[0].ctx 14070 res = isl.isl_multi_val_scale_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 14071 obj = multi_val(ctx=ctx, ptr=res) 14072 return obj 14073 raise Error 14074 def scale_down(*args): 14075 if len(args) == 2 and args[1].__class__ is multi_val: 14076 args = list(args) 14077 try: 14078 if not args[0].__class__ is multi_val: 14079 args[0] = multi_val(args[0]) 14080 except: 14081 raise 14082 ctx = args[0].ctx 14083 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)) 14084 obj = multi_val(ctx=ctx, ptr=res) 14085 return obj 14086 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 14087 args = list(args) 14088 try: 14089 if not args[0].__class__ is multi_val: 14090 args[0] = multi_val(args[0]) 14091 except: 14092 raise 14093 try: 14094 if not args[1].__class__ is val: 14095 args[1] = val(args[1]) 14096 except: 14097 raise 14098 ctx = args[0].ctx 14099 res = isl.isl_multi_val_scale_down_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 14100 obj = multi_val(ctx=ctx, ptr=res) 14101 return obj 14102 raise Error 14103 def set_at(arg0, arg1, arg2): 14104 try: 14105 if not arg0.__class__ is multi_val: 14106 arg0 = multi_val(arg0) 14107 except: 14108 raise 14109 try: 14110 if not arg2.__class__ is val: 14111 arg2 = val(arg2) 14112 except: 14113 raise 14114 ctx = arg0.ctx 14115 res = isl.isl_multi_val_set_at(isl.isl_multi_val_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 14116 obj = multi_val(ctx=ctx, ptr=res) 14117 return obj 14118 def set_range_tuple(*args): 14119 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 14120 args = list(args) 14121 try: 14122 if not args[0].__class__ is multi_val: 14123 args[0] = multi_val(args[0]) 14124 except: 14125 raise 14126 try: 14127 if not args[1].__class__ is id: 14128 args[1] = id(args[1]) 14129 except: 14130 raise 14131 ctx = args[0].ctx 14132 res = isl.isl_multi_val_set_range_tuple_id(isl.isl_multi_val_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 14133 obj = multi_val(ctx=ctx, ptr=res) 14134 return obj 14135 raise Error 14136 def size(arg0): 14137 try: 14138 if not arg0.__class__ is multi_val: 14139 arg0 = multi_val(arg0) 14140 except: 14141 raise 14142 ctx = arg0.ctx 14143 res = isl.isl_multi_val_size(arg0.ptr) 14144 if res < 0: 14145 raise Error 14146 return int(res) 14147 def space(arg0): 14148 try: 14149 if not arg0.__class__ is multi_val: 14150 arg0 = multi_val(arg0) 14151 except: 14152 raise 14153 ctx = arg0.ctx 14154 res = isl.isl_multi_val_get_space(arg0.ptr) 14155 obj = space(ctx=ctx, ptr=res) 14156 return obj 14157 def get_space(arg0): 14158 return arg0.space() 14159 def sub(arg0, arg1): 14160 try: 14161 if not arg0.__class__ is multi_val: 14162 arg0 = multi_val(arg0) 14163 except: 14164 raise 14165 try: 14166 if not arg1.__class__ is multi_val: 14167 arg1 = multi_val(arg1) 14168 except: 14169 raise 14170 ctx = arg0.ctx 14171 res = isl.isl_multi_val_sub(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14172 obj = multi_val(ctx=ctx, ptr=res) 14173 return obj 14174 @staticmethod 14175 def zero(arg0): 14176 try: 14177 if not arg0.__class__ is space: 14178 arg0 = space(arg0) 14179 except: 14180 raise 14181 ctx = arg0.ctx 14182 res = isl.isl_multi_val_zero(isl.isl_space_copy(arg0.ptr)) 14183 obj = multi_val(ctx=ctx, ptr=res) 14184 return obj 14185 14186isl.isl_multi_val_from_val_list.restype = c_void_p 14187isl.isl_multi_val_from_val_list.argtypes = [c_void_p, c_void_p] 14188isl.isl_multi_val_read_from_str.restype = c_void_p 14189isl.isl_multi_val_read_from_str.argtypes = [Context, c_char_p] 14190isl.isl_multi_val_add.restype = c_void_p 14191isl.isl_multi_val_add.argtypes = [c_void_p, c_void_p] 14192isl.isl_multi_val_add_val.restype = c_void_p 14193isl.isl_multi_val_add_val.argtypes = [c_void_p, c_void_p] 14194isl.isl_multi_val_get_at.restype = c_void_p 14195isl.isl_multi_val_get_at.argtypes = [c_void_p, c_int] 14196isl.isl_multi_val_flat_range_product.restype = c_void_p 14197isl.isl_multi_val_flat_range_product.argtypes = [c_void_p, c_void_p] 14198isl.isl_multi_val_has_range_tuple_id.argtypes = [c_void_p] 14199isl.isl_multi_val_involves_nan.argtypes = [c_void_p] 14200isl.isl_multi_val_get_list.restype = c_void_p 14201isl.isl_multi_val_get_list.argtypes = [c_void_p] 14202isl.isl_multi_val_max.restype = c_void_p 14203isl.isl_multi_val_max.argtypes = [c_void_p, c_void_p] 14204isl.isl_multi_val_min.restype = c_void_p 14205isl.isl_multi_val_min.argtypes = [c_void_p, c_void_p] 14206isl.isl_multi_val_neg.restype = c_void_p 14207isl.isl_multi_val_neg.argtypes = [c_void_p] 14208isl.isl_multi_val_plain_is_equal.argtypes = [c_void_p, c_void_p] 14209isl.isl_multi_val_product.restype = c_void_p 14210isl.isl_multi_val_product.argtypes = [c_void_p, c_void_p] 14211isl.isl_multi_val_range_product.restype = c_void_p 14212isl.isl_multi_val_range_product.argtypes = [c_void_p, c_void_p] 14213isl.isl_multi_val_get_range_tuple_id.restype = c_void_p 14214isl.isl_multi_val_get_range_tuple_id.argtypes = [c_void_p] 14215isl.isl_multi_val_reset_range_tuple_id.restype = c_void_p 14216isl.isl_multi_val_reset_range_tuple_id.argtypes = [c_void_p] 14217isl.isl_multi_val_scale_multi_val.restype = c_void_p 14218isl.isl_multi_val_scale_multi_val.argtypes = [c_void_p, c_void_p] 14219isl.isl_multi_val_scale_val.restype = c_void_p 14220isl.isl_multi_val_scale_val.argtypes = [c_void_p, c_void_p] 14221isl.isl_multi_val_scale_down_multi_val.restype = c_void_p 14222isl.isl_multi_val_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 14223isl.isl_multi_val_scale_down_val.restype = c_void_p 14224isl.isl_multi_val_scale_down_val.argtypes = [c_void_p, c_void_p] 14225isl.isl_multi_val_set_at.restype = c_void_p 14226isl.isl_multi_val_set_at.argtypes = [c_void_p, c_int, c_void_p] 14227isl.isl_multi_val_set_range_tuple_id.restype = c_void_p 14228isl.isl_multi_val_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 14229isl.isl_multi_val_size.argtypes = [c_void_p] 14230isl.isl_multi_val_get_space.restype = c_void_p 14231isl.isl_multi_val_get_space.argtypes = [c_void_p] 14232isl.isl_multi_val_sub.restype = c_void_p 14233isl.isl_multi_val_sub.argtypes = [c_void_p, c_void_p] 14234isl.isl_multi_val_zero.restype = c_void_p 14235isl.isl_multi_val_zero.argtypes = [c_void_p] 14236isl.isl_multi_val_copy.restype = c_void_p 14237isl.isl_multi_val_copy.argtypes = [c_void_p] 14238isl.isl_multi_val_free.restype = c_void_p 14239isl.isl_multi_val_free.argtypes = [c_void_p] 14240isl.isl_multi_val_to_str.restype = POINTER(c_char) 14241isl.isl_multi_val_to_str.argtypes = [c_void_p] 14242 14243class point(basic_set): 14244 def __init__(self, *args, **keywords): 14245 if "ptr" in keywords: 14246 self.ctx = keywords["ctx"] 14247 self.ptr = keywords["ptr"] 14248 return 14249 raise Error 14250 def __del__(self): 14251 if hasattr(self, 'ptr'): 14252 isl.isl_point_free(self.ptr) 14253 def __str__(arg0): 14254 try: 14255 if not arg0.__class__ is point: 14256 arg0 = point(arg0) 14257 except: 14258 raise 14259 ptr = isl.isl_point_to_str(arg0.ptr) 14260 res = cast(ptr, c_char_p).value.decode('ascii') 14261 libc.free(ptr) 14262 return res 14263 def __repr__(self): 14264 s = str(self) 14265 if '"' in s: 14266 return 'isl.point("""%s""")' % s 14267 else: 14268 return 'isl.point("%s")' % s 14269 def multi_val(arg0): 14270 try: 14271 if not arg0.__class__ is point: 14272 arg0 = point(arg0) 14273 except: 14274 raise 14275 ctx = arg0.ctx 14276 res = isl.isl_point_get_multi_val(arg0.ptr) 14277 obj = multi_val(ctx=ctx, ptr=res) 14278 return obj 14279 def get_multi_val(arg0): 14280 return arg0.multi_val() 14281 def to_set(arg0): 14282 try: 14283 if not arg0.__class__ is point: 14284 arg0 = point(arg0) 14285 except: 14286 raise 14287 ctx = arg0.ctx 14288 res = isl.isl_point_to_set(isl.isl_point_copy(arg0.ptr)) 14289 obj = set(ctx=ctx, ptr=res) 14290 return obj 14291 14292isl.isl_point_get_multi_val.restype = c_void_p 14293isl.isl_point_get_multi_val.argtypes = [c_void_p] 14294isl.isl_point_to_set.restype = c_void_p 14295isl.isl_point_to_set.argtypes = [c_void_p] 14296isl.isl_point_copy.restype = c_void_p 14297isl.isl_point_copy.argtypes = [c_void_p] 14298isl.isl_point_free.restype = c_void_p 14299isl.isl_point_free.argtypes = [c_void_p] 14300isl.isl_point_to_str.restype = POINTER(c_char) 14301isl.isl_point_to_str.argtypes = [c_void_p] 14302 14303class pw_aff_list(object): 14304 def __init__(self, *args, **keywords): 14305 if "ptr" in keywords: 14306 self.ctx = keywords["ctx"] 14307 self.ptr = keywords["ptr"] 14308 return 14309 if len(args) == 1 and type(args[0]) == int: 14310 self.ctx = Context.getDefaultInstance() 14311 self.ptr = isl.isl_pw_aff_list_alloc(self.ctx, args[0]) 14312 return 14313 if len(args) == 1 and args[0].__class__ is pw_aff: 14314 self.ctx = Context.getDefaultInstance() 14315 self.ptr = isl.isl_pw_aff_list_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 14316 return 14317 if len(args) == 1 and type(args[0]) == str: 14318 self.ctx = Context.getDefaultInstance() 14319 self.ptr = isl.isl_pw_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 14320 return 14321 raise Error 14322 def __del__(self): 14323 if hasattr(self, 'ptr'): 14324 isl.isl_pw_aff_list_free(self.ptr) 14325 def __str__(arg0): 14326 try: 14327 if not arg0.__class__ is pw_aff_list: 14328 arg0 = pw_aff_list(arg0) 14329 except: 14330 raise 14331 ptr = isl.isl_pw_aff_list_to_str(arg0.ptr) 14332 res = cast(ptr, c_char_p).value.decode('ascii') 14333 libc.free(ptr) 14334 return res 14335 def __repr__(self): 14336 s = str(self) 14337 if '"' in s: 14338 return 'isl.pw_aff_list("""%s""")' % s 14339 else: 14340 return 'isl.pw_aff_list("%s")' % s 14341 def add(arg0, arg1): 14342 try: 14343 if not arg0.__class__ is pw_aff_list: 14344 arg0 = pw_aff_list(arg0) 14345 except: 14346 raise 14347 try: 14348 if not arg1.__class__ is pw_aff: 14349 arg1 = pw_aff(arg1) 14350 except: 14351 raise 14352 ctx = arg0.ctx 14353 res = isl.isl_pw_aff_list_add(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 14354 obj = pw_aff_list(ctx=ctx, ptr=res) 14355 return obj 14356 def at(arg0, arg1): 14357 try: 14358 if not arg0.__class__ is pw_aff_list: 14359 arg0 = pw_aff_list(arg0) 14360 except: 14361 raise 14362 ctx = arg0.ctx 14363 res = isl.isl_pw_aff_list_get_at(arg0.ptr, arg1) 14364 obj = pw_aff(ctx=ctx, ptr=res) 14365 return obj 14366 def get_at(arg0, arg1): 14367 return arg0.at(arg1) 14368 def clear(arg0): 14369 try: 14370 if not arg0.__class__ is pw_aff_list: 14371 arg0 = pw_aff_list(arg0) 14372 except: 14373 raise 14374 ctx = arg0.ctx 14375 res = isl.isl_pw_aff_list_clear(isl.isl_pw_aff_list_copy(arg0.ptr)) 14376 obj = pw_aff_list(ctx=ctx, ptr=res) 14377 return obj 14378 def concat(arg0, arg1): 14379 try: 14380 if not arg0.__class__ is pw_aff_list: 14381 arg0 = pw_aff_list(arg0) 14382 except: 14383 raise 14384 try: 14385 if not arg1.__class__ is pw_aff_list: 14386 arg1 = pw_aff_list(arg1) 14387 except: 14388 raise 14389 ctx = arg0.ctx 14390 res = isl.isl_pw_aff_list_concat(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_list_copy(arg1.ptr)) 14391 obj = pw_aff_list(ctx=ctx, ptr=res) 14392 return obj 14393 def drop(arg0, arg1, arg2): 14394 try: 14395 if not arg0.__class__ is pw_aff_list: 14396 arg0 = pw_aff_list(arg0) 14397 except: 14398 raise 14399 ctx = arg0.ctx 14400 res = isl.isl_pw_aff_list_drop(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, arg2) 14401 obj = pw_aff_list(ctx=ctx, ptr=res) 14402 return obj 14403 def foreach(arg0, arg1): 14404 try: 14405 if not arg0.__class__ is pw_aff_list: 14406 arg0 = pw_aff_list(arg0) 14407 except: 14408 raise 14409 exc_info = [None] 14410 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14411 def cb_func(cb_arg0, cb_arg1): 14412 cb_arg0 = pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 14413 try: 14414 arg1(cb_arg0) 14415 except BaseException as e: 14416 exc_info[0] = e 14417 return -1 14418 return 0 14419 cb1 = fn(cb_func) 14420 ctx = arg0.ctx 14421 res = isl.isl_pw_aff_list_foreach(arg0.ptr, cb1, None) 14422 if exc_info[0] is not None: 14423 raise exc_info[0] 14424 if res < 0: 14425 raise Error 14426 def foreach_scc(arg0, arg1, arg2): 14427 try: 14428 if not arg0.__class__ is pw_aff_list: 14429 arg0 = pw_aff_list(arg0) 14430 except: 14431 raise 14432 exc_info = [None] 14433 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 14434 def cb_func(cb_arg0, cb_arg1, cb_arg2): 14435 cb_arg0 = pw_aff(ctx=arg0.ctx, ptr=isl.isl_pw_aff_copy(cb_arg0)) 14436 cb_arg1 = pw_aff(ctx=arg0.ctx, ptr=isl.isl_pw_aff_copy(cb_arg1)) 14437 try: 14438 res = arg1(cb_arg0, cb_arg1) 14439 except BaseException as e: 14440 exc_info[0] = e 14441 return -1 14442 return 1 if res else 0 14443 cb1 = fn(cb_func) 14444 exc_info = [None] 14445 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14446 def cb_func(cb_arg0, cb_arg1): 14447 cb_arg0 = pw_aff_list(ctx=arg0.ctx, ptr=(cb_arg0)) 14448 try: 14449 arg2(cb_arg0) 14450 except BaseException as e: 14451 exc_info[0] = e 14452 return -1 14453 return 0 14454 cb2 = fn(cb_func) 14455 ctx = arg0.ctx 14456 res = isl.isl_pw_aff_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 14457 if exc_info[0] is not None: 14458 raise exc_info[0] 14459 if res < 0: 14460 raise Error 14461 def insert(arg0, arg1, arg2): 14462 try: 14463 if not arg0.__class__ is pw_aff_list: 14464 arg0 = pw_aff_list(arg0) 14465 except: 14466 raise 14467 try: 14468 if not arg2.__class__ is pw_aff: 14469 arg2 = pw_aff(arg2) 14470 except: 14471 raise 14472 ctx = arg0.ctx 14473 res = isl.isl_pw_aff_list_insert(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 14474 obj = pw_aff_list(ctx=ctx, ptr=res) 14475 return obj 14476 def set_at(arg0, arg1, arg2): 14477 try: 14478 if not arg0.__class__ is pw_aff_list: 14479 arg0 = pw_aff_list(arg0) 14480 except: 14481 raise 14482 try: 14483 if not arg2.__class__ is pw_aff: 14484 arg2 = pw_aff(arg2) 14485 except: 14486 raise 14487 ctx = arg0.ctx 14488 res = isl.isl_pw_aff_list_set_at(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 14489 obj = pw_aff_list(ctx=ctx, ptr=res) 14490 return obj 14491 def size(arg0): 14492 try: 14493 if not arg0.__class__ is pw_aff_list: 14494 arg0 = pw_aff_list(arg0) 14495 except: 14496 raise 14497 ctx = arg0.ctx 14498 res = isl.isl_pw_aff_list_size(arg0.ptr) 14499 if res < 0: 14500 raise Error 14501 return int(res) 14502 14503isl.isl_pw_aff_list_alloc.restype = c_void_p 14504isl.isl_pw_aff_list_alloc.argtypes = [Context, c_int] 14505isl.isl_pw_aff_list_from_pw_aff.restype = c_void_p 14506isl.isl_pw_aff_list_from_pw_aff.argtypes = [c_void_p] 14507isl.isl_pw_aff_list_read_from_str.restype = c_void_p 14508isl.isl_pw_aff_list_read_from_str.argtypes = [Context, c_char_p] 14509isl.isl_pw_aff_list_add.restype = c_void_p 14510isl.isl_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 14511isl.isl_pw_aff_list_get_at.restype = c_void_p 14512isl.isl_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 14513isl.isl_pw_aff_list_clear.restype = c_void_p 14514isl.isl_pw_aff_list_clear.argtypes = [c_void_p] 14515isl.isl_pw_aff_list_concat.restype = c_void_p 14516isl.isl_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 14517isl.isl_pw_aff_list_drop.restype = c_void_p 14518isl.isl_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 14519isl.isl_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 14520isl.isl_pw_aff_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 14521isl.isl_pw_aff_list_insert.restype = c_void_p 14522isl.isl_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 14523isl.isl_pw_aff_list_set_at.restype = c_void_p 14524isl.isl_pw_aff_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 14525isl.isl_pw_aff_list_size.argtypes = [c_void_p] 14526isl.isl_pw_aff_list_copy.restype = c_void_p 14527isl.isl_pw_aff_list_copy.argtypes = [c_void_p] 14528isl.isl_pw_aff_list_free.restype = c_void_p 14529isl.isl_pw_aff_list_free.argtypes = [c_void_p] 14530isl.isl_pw_aff_list_to_str.restype = POINTER(c_char) 14531isl.isl_pw_aff_list_to_str.argtypes = [c_void_p] 14532 14533class pw_multi_aff_list(object): 14534 def __init__(self, *args, **keywords): 14535 if "ptr" in keywords: 14536 self.ctx = keywords["ctx"] 14537 self.ptr = keywords["ptr"] 14538 return 14539 if len(args) == 1 and type(args[0]) == int: 14540 self.ctx = Context.getDefaultInstance() 14541 self.ptr = isl.isl_pw_multi_aff_list_alloc(self.ctx, args[0]) 14542 return 14543 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 14544 self.ctx = Context.getDefaultInstance() 14545 self.ptr = isl.isl_pw_multi_aff_list_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 14546 return 14547 if len(args) == 1 and type(args[0]) == str: 14548 self.ctx = Context.getDefaultInstance() 14549 self.ptr = isl.isl_pw_multi_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 14550 return 14551 raise Error 14552 def __del__(self): 14553 if hasattr(self, 'ptr'): 14554 isl.isl_pw_multi_aff_list_free(self.ptr) 14555 def __str__(arg0): 14556 try: 14557 if not arg0.__class__ is pw_multi_aff_list: 14558 arg0 = pw_multi_aff_list(arg0) 14559 except: 14560 raise 14561 ptr = isl.isl_pw_multi_aff_list_to_str(arg0.ptr) 14562 res = cast(ptr, c_char_p).value.decode('ascii') 14563 libc.free(ptr) 14564 return res 14565 def __repr__(self): 14566 s = str(self) 14567 if '"' in s: 14568 return 'isl.pw_multi_aff_list("""%s""")' % s 14569 else: 14570 return 'isl.pw_multi_aff_list("%s")' % s 14571 def add(arg0, arg1): 14572 try: 14573 if not arg0.__class__ is pw_multi_aff_list: 14574 arg0 = pw_multi_aff_list(arg0) 14575 except: 14576 raise 14577 try: 14578 if not arg1.__class__ is pw_multi_aff: 14579 arg1 = pw_multi_aff(arg1) 14580 except: 14581 raise 14582 ctx = arg0.ctx 14583 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)) 14584 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14585 return obj 14586 def at(arg0, arg1): 14587 try: 14588 if not arg0.__class__ is pw_multi_aff_list: 14589 arg0 = pw_multi_aff_list(arg0) 14590 except: 14591 raise 14592 ctx = arg0.ctx 14593 res = isl.isl_pw_multi_aff_list_get_at(arg0.ptr, arg1) 14594 obj = pw_multi_aff(ctx=ctx, ptr=res) 14595 return obj 14596 def get_at(arg0, arg1): 14597 return arg0.at(arg1) 14598 def clear(arg0): 14599 try: 14600 if not arg0.__class__ is pw_multi_aff_list: 14601 arg0 = pw_multi_aff_list(arg0) 14602 except: 14603 raise 14604 ctx = arg0.ctx 14605 res = isl.isl_pw_multi_aff_list_clear(isl.isl_pw_multi_aff_list_copy(arg0.ptr)) 14606 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14607 return obj 14608 def concat(arg0, arg1): 14609 try: 14610 if not arg0.__class__ is pw_multi_aff_list: 14611 arg0 = pw_multi_aff_list(arg0) 14612 except: 14613 raise 14614 try: 14615 if not arg1.__class__ is pw_multi_aff_list: 14616 arg1 = pw_multi_aff_list(arg1) 14617 except: 14618 raise 14619 ctx = arg0.ctx 14620 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)) 14621 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14622 return obj 14623 def drop(arg0, arg1, arg2): 14624 try: 14625 if not arg0.__class__ is pw_multi_aff_list: 14626 arg0 = pw_multi_aff_list(arg0) 14627 except: 14628 raise 14629 ctx = arg0.ctx 14630 res = isl.isl_pw_multi_aff_list_drop(isl.isl_pw_multi_aff_list_copy(arg0.ptr), arg1, arg2) 14631 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14632 return obj 14633 def foreach(arg0, arg1): 14634 try: 14635 if not arg0.__class__ is pw_multi_aff_list: 14636 arg0 = pw_multi_aff_list(arg0) 14637 except: 14638 raise 14639 exc_info = [None] 14640 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14641 def cb_func(cb_arg0, cb_arg1): 14642 cb_arg0 = pw_multi_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 14643 try: 14644 arg1(cb_arg0) 14645 except BaseException as e: 14646 exc_info[0] = e 14647 return -1 14648 return 0 14649 cb1 = fn(cb_func) 14650 ctx = arg0.ctx 14651 res = isl.isl_pw_multi_aff_list_foreach(arg0.ptr, cb1, None) 14652 if exc_info[0] is not None: 14653 raise exc_info[0] 14654 if res < 0: 14655 raise Error 14656 def foreach_scc(arg0, arg1, arg2): 14657 try: 14658 if not arg0.__class__ is pw_multi_aff_list: 14659 arg0 = pw_multi_aff_list(arg0) 14660 except: 14661 raise 14662 exc_info = [None] 14663 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 14664 def cb_func(cb_arg0, cb_arg1, cb_arg2): 14665 cb_arg0 = pw_multi_aff(ctx=arg0.ctx, ptr=isl.isl_pw_multi_aff_copy(cb_arg0)) 14666 cb_arg1 = pw_multi_aff(ctx=arg0.ctx, ptr=isl.isl_pw_multi_aff_copy(cb_arg1)) 14667 try: 14668 res = arg1(cb_arg0, cb_arg1) 14669 except BaseException as e: 14670 exc_info[0] = e 14671 return -1 14672 return 1 if res else 0 14673 cb1 = fn(cb_func) 14674 exc_info = [None] 14675 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14676 def cb_func(cb_arg0, cb_arg1): 14677 cb_arg0 = pw_multi_aff_list(ctx=arg0.ctx, ptr=(cb_arg0)) 14678 try: 14679 arg2(cb_arg0) 14680 except BaseException as e: 14681 exc_info[0] = e 14682 return -1 14683 return 0 14684 cb2 = fn(cb_func) 14685 ctx = arg0.ctx 14686 res = isl.isl_pw_multi_aff_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 14687 if exc_info[0] is not None: 14688 raise exc_info[0] 14689 if res < 0: 14690 raise Error 14691 def insert(arg0, arg1, arg2): 14692 try: 14693 if not arg0.__class__ is pw_multi_aff_list: 14694 arg0 = pw_multi_aff_list(arg0) 14695 except: 14696 raise 14697 try: 14698 if not arg2.__class__ is pw_multi_aff: 14699 arg2 = pw_multi_aff(arg2) 14700 except: 14701 raise 14702 ctx = arg0.ctx 14703 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)) 14704 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14705 return obj 14706 def set_at(arg0, arg1, arg2): 14707 try: 14708 if not arg0.__class__ is pw_multi_aff_list: 14709 arg0 = pw_multi_aff_list(arg0) 14710 except: 14711 raise 14712 try: 14713 if not arg2.__class__ is pw_multi_aff: 14714 arg2 = pw_multi_aff(arg2) 14715 except: 14716 raise 14717 ctx = arg0.ctx 14718 res = isl.isl_pw_multi_aff_list_set_at(isl.isl_pw_multi_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_multi_aff_copy(arg2.ptr)) 14719 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 14720 return obj 14721 def size(arg0): 14722 try: 14723 if not arg0.__class__ is pw_multi_aff_list: 14724 arg0 = pw_multi_aff_list(arg0) 14725 except: 14726 raise 14727 ctx = arg0.ctx 14728 res = isl.isl_pw_multi_aff_list_size(arg0.ptr) 14729 if res < 0: 14730 raise Error 14731 return int(res) 14732 14733isl.isl_pw_multi_aff_list_alloc.restype = c_void_p 14734isl.isl_pw_multi_aff_list_alloc.argtypes = [Context, c_int] 14735isl.isl_pw_multi_aff_list_from_pw_multi_aff.restype = c_void_p 14736isl.isl_pw_multi_aff_list_from_pw_multi_aff.argtypes = [c_void_p] 14737isl.isl_pw_multi_aff_list_read_from_str.restype = c_void_p 14738isl.isl_pw_multi_aff_list_read_from_str.argtypes = [Context, c_char_p] 14739isl.isl_pw_multi_aff_list_add.restype = c_void_p 14740isl.isl_pw_multi_aff_list_add.argtypes = [c_void_p, c_void_p] 14741isl.isl_pw_multi_aff_list_get_at.restype = c_void_p 14742isl.isl_pw_multi_aff_list_get_at.argtypes = [c_void_p, c_int] 14743isl.isl_pw_multi_aff_list_clear.restype = c_void_p 14744isl.isl_pw_multi_aff_list_clear.argtypes = [c_void_p] 14745isl.isl_pw_multi_aff_list_concat.restype = c_void_p 14746isl.isl_pw_multi_aff_list_concat.argtypes = [c_void_p, c_void_p] 14747isl.isl_pw_multi_aff_list_drop.restype = c_void_p 14748isl.isl_pw_multi_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 14749isl.isl_pw_multi_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 14750isl.isl_pw_multi_aff_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 14751isl.isl_pw_multi_aff_list_insert.restype = c_void_p 14752isl.isl_pw_multi_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 14753isl.isl_pw_multi_aff_list_set_at.restype = c_void_p 14754isl.isl_pw_multi_aff_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 14755isl.isl_pw_multi_aff_list_size.argtypes = [c_void_p] 14756isl.isl_pw_multi_aff_list_copy.restype = c_void_p 14757isl.isl_pw_multi_aff_list_copy.argtypes = [c_void_p] 14758isl.isl_pw_multi_aff_list_free.restype = c_void_p 14759isl.isl_pw_multi_aff_list_free.argtypes = [c_void_p] 14760isl.isl_pw_multi_aff_list_to_str.restype = POINTER(c_char) 14761isl.isl_pw_multi_aff_list_to_str.argtypes = [c_void_p] 14762 14763class schedule(object): 14764 def __init__(self, *args, **keywords): 14765 if "ptr" in keywords: 14766 self.ctx = keywords["ctx"] 14767 self.ptr = keywords["ptr"] 14768 return 14769 if len(args) == 1 and type(args[0]) == str: 14770 self.ctx = Context.getDefaultInstance() 14771 self.ptr = isl.isl_schedule_read_from_str(self.ctx, args[0].encode('ascii')) 14772 return 14773 raise Error 14774 def __del__(self): 14775 if hasattr(self, 'ptr'): 14776 isl.isl_schedule_free(self.ptr) 14777 def __str__(arg0): 14778 try: 14779 if not arg0.__class__ is schedule: 14780 arg0 = schedule(arg0) 14781 except: 14782 raise 14783 ptr = isl.isl_schedule_to_str(arg0.ptr) 14784 res = cast(ptr, c_char_p).value.decode('ascii') 14785 libc.free(ptr) 14786 return res 14787 def __repr__(self): 14788 s = str(self) 14789 if '"' in s: 14790 return 'isl.schedule("""%s""")' % s 14791 else: 14792 return 'isl.schedule("%s")' % s 14793 def domain(arg0): 14794 try: 14795 if not arg0.__class__ is schedule: 14796 arg0 = schedule(arg0) 14797 except: 14798 raise 14799 ctx = arg0.ctx 14800 res = isl.isl_schedule_get_domain(arg0.ptr) 14801 obj = union_set(ctx=ctx, ptr=res) 14802 return obj 14803 def get_domain(arg0): 14804 return arg0.domain() 14805 @staticmethod 14806 def from_domain(arg0): 14807 try: 14808 if not arg0.__class__ is union_set: 14809 arg0 = union_set(arg0) 14810 except: 14811 raise 14812 ctx = arg0.ctx 14813 res = isl.isl_schedule_from_domain(isl.isl_union_set_copy(arg0.ptr)) 14814 obj = schedule(ctx=ctx, ptr=res) 14815 return obj 14816 def map(arg0): 14817 try: 14818 if not arg0.__class__ is schedule: 14819 arg0 = schedule(arg0) 14820 except: 14821 raise 14822 ctx = arg0.ctx 14823 res = isl.isl_schedule_get_map(arg0.ptr) 14824 obj = union_map(ctx=ctx, ptr=res) 14825 return obj 14826 def get_map(arg0): 14827 return arg0.map() 14828 def pullback(*args): 14829 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 14830 args = list(args) 14831 try: 14832 if not args[0].__class__ is schedule: 14833 args[0] = schedule(args[0]) 14834 except: 14835 raise 14836 ctx = args[0].ctx 14837 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)) 14838 obj = schedule(ctx=ctx, ptr=res) 14839 return obj 14840 raise Error 14841 def root(arg0): 14842 try: 14843 if not arg0.__class__ is schedule: 14844 arg0 = schedule(arg0) 14845 except: 14846 raise 14847 ctx = arg0.ctx 14848 res = isl.isl_schedule_get_root(arg0.ptr) 14849 obj = schedule_node(ctx=ctx, ptr=res) 14850 return obj 14851 def get_root(arg0): 14852 return arg0.root() 14853 14854isl.isl_schedule_read_from_str.restype = c_void_p 14855isl.isl_schedule_read_from_str.argtypes = [Context, c_char_p] 14856isl.isl_schedule_get_domain.restype = c_void_p 14857isl.isl_schedule_get_domain.argtypes = [c_void_p] 14858isl.isl_schedule_from_domain.restype = c_void_p 14859isl.isl_schedule_from_domain.argtypes = [c_void_p] 14860isl.isl_schedule_get_map.restype = c_void_p 14861isl.isl_schedule_get_map.argtypes = [c_void_p] 14862isl.isl_schedule_pullback_union_pw_multi_aff.restype = c_void_p 14863isl.isl_schedule_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 14864isl.isl_schedule_get_root.restype = c_void_p 14865isl.isl_schedule_get_root.argtypes = [c_void_p] 14866isl.isl_schedule_copy.restype = c_void_p 14867isl.isl_schedule_copy.argtypes = [c_void_p] 14868isl.isl_schedule_free.restype = c_void_p 14869isl.isl_schedule_free.argtypes = [c_void_p] 14870isl.isl_schedule_to_str.restype = POINTER(c_char) 14871isl.isl_schedule_to_str.argtypes = [c_void_p] 14872 14873class schedule_constraints(object): 14874 def __init__(self, *args, **keywords): 14875 if "ptr" in keywords: 14876 self.ctx = keywords["ctx"] 14877 self.ptr = keywords["ptr"] 14878 return 14879 if len(args) == 1 and type(args[0]) == str: 14880 self.ctx = Context.getDefaultInstance() 14881 self.ptr = isl.isl_schedule_constraints_read_from_str(self.ctx, args[0].encode('ascii')) 14882 return 14883 raise Error 14884 def __del__(self): 14885 if hasattr(self, 'ptr'): 14886 isl.isl_schedule_constraints_free(self.ptr) 14887 def __str__(arg0): 14888 try: 14889 if not arg0.__class__ is schedule_constraints: 14890 arg0 = schedule_constraints(arg0) 14891 except: 14892 raise 14893 ptr = isl.isl_schedule_constraints_to_str(arg0.ptr) 14894 res = cast(ptr, c_char_p).value.decode('ascii') 14895 libc.free(ptr) 14896 return res 14897 def __repr__(self): 14898 s = str(self) 14899 if '"' in s: 14900 return 'isl.schedule_constraints("""%s""")' % s 14901 else: 14902 return 'isl.schedule_constraints("%s")' % s 14903 def coincidence(arg0): 14904 try: 14905 if not arg0.__class__ is schedule_constraints: 14906 arg0 = schedule_constraints(arg0) 14907 except: 14908 raise 14909 ctx = arg0.ctx 14910 res = isl.isl_schedule_constraints_get_coincidence(arg0.ptr) 14911 obj = union_map(ctx=ctx, ptr=res) 14912 return obj 14913 def get_coincidence(arg0): 14914 return arg0.coincidence() 14915 def compute_schedule(arg0): 14916 try: 14917 if not arg0.__class__ is schedule_constraints: 14918 arg0 = schedule_constraints(arg0) 14919 except: 14920 raise 14921 ctx = arg0.ctx 14922 res = isl.isl_schedule_constraints_compute_schedule(isl.isl_schedule_constraints_copy(arg0.ptr)) 14923 obj = schedule(ctx=ctx, ptr=res) 14924 return obj 14925 def conditional_validity(arg0): 14926 try: 14927 if not arg0.__class__ is schedule_constraints: 14928 arg0 = schedule_constraints(arg0) 14929 except: 14930 raise 14931 ctx = arg0.ctx 14932 res = isl.isl_schedule_constraints_get_conditional_validity(arg0.ptr) 14933 obj = union_map(ctx=ctx, ptr=res) 14934 return obj 14935 def get_conditional_validity(arg0): 14936 return arg0.conditional_validity() 14937 def conditional_validity_condition(arg0): 14938 try: 14939 if not arg0.__class__ is schedule_constraints: 14940 arg0 = schedule_constraints(arg0) 14941 except: 14942 raise 14943 ctx = arg0.ctx 14944 res = isl.isl_schedule_constraints_get_conditional_validity_condition(arg0.ptr) 14945 obj = union_map(ctx=ctx, ptr=res) 14946 return obj 14947 def get_conditional_validity_condition(arg0): 14948 return arg0.conditional_validity_condition() 14949 def context(arg0): 14950 try: 14951 if not arg0.__class__ is schedule_constraints: 14952 arg0 = schedule_constraints(arg0) 14953 except: 14954 raise 14955 ctx = arg0.ctx 14956 res = isl.isl_schedule_constraints_get_context(arg0.ptr) 14957 obj = set(ctx=ctx, ptr=res) 14958 return obj 14959 def get_context(arg0): 14960 return arg0.context() 14961 def domain(arg0): 14962 try: 14963 if not arg0.__class__ is schedule_constraints: 14964 arg0 = schedule_constraints(arg0) 14965 except: 14966 raise 14967 ctx = arg0.ctx 14968 res = isl.isl_schedule_constraints_get_domain(arg0.ptr) 14969 obj = union_set(ctx=ctx, ptr=res) 14970 return obj 14971 def get_domain(arg0): 14972 return arg0.domain() 14973 @staticmethod 14974 def on_domain(arg0): 14975 try: 14976 if not arg0.__class__ is union_set: 14977 arg0 = union_set(arg0) 14978 except: 14979 raise 14980 ctx = arg0.ctx 14981 res = isl.isl_schedule_constraints_on_domain(isl.isl_union_set_copy(arg0.ptr)) 14982 obj = schedule_constraints(ctx=ctx, ptr=res) 14983 return obj 14984 def proximity(arg0): 14985 try: 14986 if not arg0.__class__ is schedule_constraints: 14987 arg0 = schedule_constraints(arg0) 14988 except: 14989 raise 14990 ctx = arg0.ctx 14991 res = isl.isl_schedule_constraints_get_proximity(arg0.ptr) 14992 obj = union_map(ctx=ctx, ptr=res) 14993 return obj 14994 def get_proximity(arg0): 14995 return arg0.proximity() 14996 def set_coincidence(arg0, arg1): 14997 try: 14998 if not arg0.__class__ is schedule_constraints: 14999 arg0 = schedule_constraints(arg0) 15000 except: 15001 raise 15002 try: 15003 if not arg1.__class__ is union_map: 15004 arg1 = union_map(arg1) 15005 except: 15006 raise 15007 ctx = arg0.ctx 15008 res = isl.isl_schedule_constraints_set_coincidence(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15009 obj = schedule_constraints(ctx=ctx, ptr=res) 15010 return obj 15011 def set_conditional_validity(arg0, arg1, arg2): 15012 try: 15013 if not arg0.__class__ is schedule_constraints: 15014 arg0 = schedule_constraints(arg0) 15015 except: 15016 raise 15017 try: 15018 if not arg1.__class__ is union_map: 15019 arg1 = union_map(arg1) 15020 except: 15021 raise 15022 try: 15023 if not arg2.__class__ is union_map: 15024 arg2 = union_map(arg2) 15025 except: 15026 raise 15027 ctx = arg0.ctx 15028 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)) 15029 obj = schedule_constraints(ctx=ctx, ptr=res) 15030 return obj 15031 def set_context(arg0, arg1): 15032 try: 15033 if not arg0.__class__ is schedule_constraints: 15034 arg0 = schedule_constraints(arg0) 15035 except: 15036 raise 15037 try: 15038 if not arg1.__class__ is set: 15039 arg1 = set(arg1) 15040 except: 15041 raise 15042 ctx = arg0.ctx 15043 res = isl.isl_schedule_constraints_set_context(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 15044 obj = schedule_constraints(ctx=ctx, ptr=res) 15045 return obj 15046 def set_proximity(arg0, arg1): 15047 try: 15048 if not arg0.__class__ is schedule_constraints: 15049 arg0 = schedule_constraints(arg0) 15050 except: 15051 raise 15052 try: 15053 if not arg1.__class__ is union_map: 15054 arg1 = union_map(arg1) 15055 except: 15056 raise 15057 ctx = arg0.ctx 15058 res = isl.isl_schedule_constraints_set_proximity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15059 obj = schedule_constraints(ctx=ctx, ptr=res) 15060 return obj 15061 def set_validity(arg0, arg1): 15062 try: 15063 if not arg0.__class__ is schedule_constraints: 15064 arg0 = schedule_constraints(arg0) 15065 except: 15066 raise 15067 try: 15068 if not arg1.__class__ is union_map: 15069 arg1 = union_map(arg1) 15070 except: 15071 raise 15072 ctx = arg0.ctx 15073 res = isl.isl_schedule_constraints_set_validity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15074 obj = schedule_constraints(ctx=ctx, ptr=res) 15075 return obj 15076 def validity(arg0): 15077 try: 15078 if not arg0.__class__ is schedule_constraints: 15079 arg0 = schedule_constraints(arg0) 15080 except: 15081 raise 15082 ctx = arg0.ctx 15083 res = isl.isl_schedule_constraints_get_validity(arg0.ptr) 15084 obj = union_map(ctx=ctx, ptr=res) 15085 return obj 15086 def get_validity(arg0): 15087 return arg0.validity() 15088 15089isl.isl_schedule_constraints_read_from_str.restype = c_void_p 15090isl.isl_schedule_constraints_read_from_str.argtypes = [Context, c_char_p] 15091isl.isl_schedule_constraints_get_coincidence.restype = c_void_p 15092isl.isl_schedule_constraints_get_coincidence.argtypes = [c_void_p] 15093isl.isl_schedule_constraints_compute_schedule.restype = c_void_p 15094isl.isl_schedule_constraints_compute_schedule.argtypes = [c_void_p] 15095isl.isl_schedule_constraints_get_conditional_validity.restype = c_void_p 15096isl.isl_schedule_constraints_get_conditional_validity.argtypes = [c_void_p] 15097isl.isl_schedule_constraints_get_conditional_validity_condition.restype = c_void_p 15098isl.isl_schedule_constraints_get_conditional_validity_condition.argtypes = [c_void_p] 15099isl.isl_schedule_constraints_get_context.restype = c_void_p 15100isl.isl_schedule_constraints_get_context.argtypes = [c_void_p] 15101isl.isl_schedule_constraints_get_domain.restype = c_void_p 15102isl.isl_schedule_constraints_get_domain.argtypes = [c_void_p] 15103isl.isl_schedule_constraints_on_domain.restype = c_void_p 15104isl.isl_schedule_constraints_on_domain.argtypes = [c_void_p] 15105isl.isl_schedule_constraints_get_proximity.restype = c_void_p 15106isl.isl_schedule_constraints_get_proximity.argtypes = [c_void_p] 15107isl.isl_schedule_constraints_set_coincidence.restype = c_void_p 15108isl.isl_schedule_constraints_set_coincidence.argtypes = [c_void_p, c_void_p] 15109isl.isl_schedule_constraints_set_conditional_validity.restype = c_void_p 15110isl.isl_schedule_constraints_set_conditional_validity.argtypes = [c_void_p, c_void_p, c_void_p] 15111isl.isl_schedule_constraints_set_context.restype = c_void_p 15112isl.isl_schedule_constraints_set_context.argtypes = [c_void_p, c_void_p] 15113isl.isl_schedule_constraints_set_proximity.restype = c_void_p 15114isl.isl_schedule_constraints_set_proximity.argtypes = [c_void_p, c_void_p] 15115isl.isl_schedule_constraints_set_validity.restype = c_void_p 15116isl.isl_schedule_constraints_set_validity.argtypes = [c_void_p, c_void_p] 15117isl.isl_schedule_constraints_get_validity.restype = c_void_p 15118isl.isl_schedule_constraints_get_validity.argtypes = [c_void_p] 15119isl.isl_schedule_constraints_copy.restype = c_void_p 15120isl.isl_schedule_constraints_copy.argtypes = [c_void_p] 15121isl.isl_schedule_constraints_free.restype = c_void_p 15122isl.isl_schedule_constraints_free.argtypes = [c_void_p] 15123isl.isl_schedule_constraints_to_str.restype = POINTER(c_char) 15124isl.isl_schedule_constraints_to_str.argtypes = [c_void_p] 15125 15126class schedule_node(object): 15127 def __init__(self, *args, **keywords): 15128 if "ptr" in keywords: 15129 self.ctx = keywords["ctx"] 15130 self.ptr = keywords["ptr"] 15131 return 15132 if len(args) == 1 and isinstance(args[0], schedule_node_band): 15133 self.ctx = args[0].ctx 15134 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15135 return 15136 if len(args) == 1 and isinstance(args[0], schedule_node_context): 15137 self.ctx = args[0].ctx 15138 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15139 return 15140 if len(args) == 1 and isinstance(args[0], schedule_node_domain): 15141 self.ctx = args[0].ctx 15142 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15143 return 15144 if len(args) == 1 and isinstance(args[0], schedule_node_expansion): 15145 self.ctx = args[0].ctx 15146 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15147 return 15148 if len(args) == 1 and isinstance(args[0], schedule_node_extension): 15149 self.ctx = args[0].ctx 15150 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15151 return 15152 if len(args) == 1 and isinstance(args[0], schedule_node_filter): 15153 self.ctx = args[0].ctx 15154 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15155 return 15156 if len(args) == 1 and isinstance(args[0], schedule_node_leaf): 15157 self.ctx = args[0].ctx 15158 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15159 return 15160 if len(args) == 1 and isinstance(args[0], schedule_node_guard): 15161 self.ctx = args[0].ctx 15162 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15163 return 15164 if len(args) == 1 and isinstance(args[0], schedule_node_mark): 15165 self.ctx = args[0].ctx 15166 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15167 return 15168 if len(args) == 1 and isinstance(args[0], schedule_node_sequence): 15169 self.ctx = args[0].ctx 15170 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15171 return 15172 if len(args) == 1 and isinstance(args[0], schedule_node_set): 15173 self.ctx = args[0].ctx 15174 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 15175 return 15176 raise Error 15177 def __del__(self): 15178 if hasattr(self, 'ptr'): 15179 isl.isl_schedule_node_free(self.ptr) 15180 def __new__(cls, *args, **keywords): 15181 if "ptr" in keywords: 15182 type = isl.isl_schedule_node_get_type(keywords["ptr"]) 15183 if type == 0: 15184 return schedule_node_band(**keywords) 15185 if type == 1: 15186 return schedule_node_context(**keywords) 15187 if type == 2: 15188 return schedule_node_domain(**keywords) 15189 if type == 3: 15190 return schedule_node_expansion(**keywords) 15191 if type == 4: 15192 return schedule_node_extension(**keywords) 15193 if type == 5: 15194 return schedule_node_filter(**keywords) 15195 if type == 6: 15196 return schedule_node_leaf(**keywords) 15197 if type == 7: 15198 return schedule_node_guard(**keywords) 15199 if type == 8: 15200 return schedule_node_mark(**keywords) 15201 if type == 9: 15202 return schedule_node_sequence(**keywords) 15203 if type == 10: 15204 return schedule_node_set(**keywords) 15205 raise Error 15206 return super(schedule_node, cls).__new__(cls) 15207 def __str__(arg0): 15208 try: 15209 if not arg0.__class__ is schedule_node: 15210 arg0 = schedule_node(arg0) 15211 except: 15212 raise 15213 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 15214 res = cast(ptr, c_char_p).value.decode('ascii') 15215 libc.free(ptr) 15216 return res 15217 def __repr__(self): 15218 s = str(self) 15219 if '"' in s: 15220 return 'isl.schedule_node("""%s""")' % s 15221 else: 15222 return 'isl.schedule_node("%s")' % s 15223 def ancestor(arg0, arg1): 15224 try: 15225 if not arg0.__class__ is schedule_node: 15226 arg0 = schedule_node(arg0) 15227 except: 15228 raise 15229 ctx = arg0.ctx 15230 res = isl.isl_schedule_node_ancestor(isl.isl_schedule_node_copy(arg0.ptr), arg1) 15231 obj = schedule_node(ctx=ctx, ptr=res) 15232 return obj 15233 def ancestor_child_position(arg0, arg1): 15234 try: 15235 if not arg0.__class__ is schedule_node: 15236 arg0 = schedule_node(arg0) 15237 except: 15238 raise 15239 try: 15240 if not arg1.__class__ is schedule_node: 15241 arg1 = schedule_node(arg1) 15242 except: 15243 raise 15244 ctx = arg0.ctx 15245 res = isl.isl_schedule_node_get_ancestor_child_position(arg0.ptr, arg1.ptr) 15246 if res < 0: 15247 raise Error 15248 return int(res) 15249 def get_ancestor_child_position(arg0, arg1): 15250 return arg0.ancestor_child_position(arg1) 15251 def child(arg0, arg1): 15252 try: 15253 if not arg0.__class__ is schedule_node: 15254 arg0 = schedule_node(arg0) 15255 except: 15256 raise 15257 ctx = arg0.ctx 15258 res = isl.isl_schedule_node_child(isl.isl_schedule_node_copy(arg0.ptr), arg1) 15259 obj = schedule_node(ctx=ctx, ptr=res) 15260 return obj 15261 def child_position(arg0): 15262 try: 15263 if not arg0.__class__ is schedule_node: 15264 arg0 = schedule_node(arg0) 15265 except: 15266 raise 15267 ctx = arg0.ctx 15268 res = isl.isl_schedule_node_get_child_position(arg0.ptr) 15269 if res < 0: 15270 raise Error 15271 return int(res) 15272 def get_child_position(arg0): 15273 return arg0.child_position() 15274 def every_descendant(arg0, arg1): 15275 try: 15276 if not arg0.__class__ is schedule_node: 15277 arg0 = schedule_node(arg0) 15278 except: 15279 raise 15280 exc_info = [None] 15281 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15282 def cb_func(cb_arg0, cb_arg1): 15283 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 15284 try: 15285 res = arg1(cb_arg0) 15286 except BaseException as e: 15287 exc_info[0] = e 15288 return -1 15289 return 1 if res else 0 15290 cb1 = fn(cb_func) 15291 ctx = arg0.ctx 15292 res = isl.isl_schedule_node_every_descendant(arg0.ptr, cb1, None) 15293 if exc_info[0] is not None: 15294 raise exc_info[0] 15295 if res < 0: 15296 raise Error 15297 return bool(res) 15298 def first_child(arg0): 15299 try: 15300 if not arg0.__class__ is schedule_node: 15301 arg0 = schedule_node(arg0) 15302 except: 15303 raise 15304 ctx = arg0.ctx 15305 res = isl.isl_schedule_node_first_child(isl.isl_schedule_node_copy(arg0.ptr)) 15306 obj = schedule_node(ctx=ctx, ptr=res) 15307 return obj 15308 def foreach_ancestor_top_down(arg0, arg1): 15309 try: 15310 if not arg0.__class__ is schedule_node: 15311 arg0 = schedule_node(arg0) 15312 except: 15313 raise 15314 exc_info = [None] 15315 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15316 def cb_func(cb_arg0, cb_arg1): 15317 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 15318 try: 15319 arg1(cb_arg0) 15320 except BaseException as e: 15321 exc_info[0] = e 15322 return -1 15323 return 0 15324 cb1 = fn(cb_func) 15325 ctx = arg0.ctx 15326 res = isl.isl_schedule_node_foreach_ancestor_top_down(arg0.ptr, cb1, None) 15327 if exc_info[0] is not None: 15328 raise exc_info[0] 15329 if res < 0: 15330 raise Error 15331 def foreach_descendant_top_down(arg0, arg1): 15332 try: 15333 if not arg0.__class__ is schedule_node: 15334 arg0 = schedule_node(arg0) 15335 except: 15336 raise 15337 exc_info = [None] 15338 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15339 def cb_func(cb_arg0, cb_arg1): 15340 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 15341 try: 15342 res = arg1(cb_arg0) 15343 except BaseException as e: 15344 exc_info[0] = e 15345 return -1 15346 return 1 if res else 0 15347 cb1 = fn(cb_func) 15348 ctx = arg0.ctx 15349 res = isl.isl_schedule_node_foreach_descendant_top_down(arg0.ptr, cb1, None) 15350 if exc_info[0] is not None: 15351 raise exc_info[0] 15352 if res < 0: 15353 raise Error 15354 @staticmethod 15355 def from_domain(arg0): 15356 try: 15357 if not arg0.__class__ is union_set: 15358 arg0 = union_set(arg0) 15359 except: 15360 raise 15361 ctx = arg0.ctx 15362 res = isl.isl_schedule_node_from_domain(isl.isl_union_set_copy(arg0.ptr)) 15363 obj = schedule_node(ctx=ctx, ptr=res) 15364 return obj 15365 @staticmethod 15366 def from_extension(arg0): 15367 try: 15368 if not arg0.__class__ is union_map: 15369 arg0 = union_map(arg0) 15370 except: 15371 raise 15372 ctx = arg0.ctx 15373 res = isl.isl_schedule_node_from_extension(isl.isl_union_map_copy(arg0.ptr)) 15374 obj = schedule_node(ctx=ctx, ptr=res) 15375 return obj 15376 def graft_after(arg0, arg1): 15377 try: 15378 if not arg0.__class__ is schedule_node: 15379 arg0 = schedule_node(arg0) 15380 except: 15381 raise 15382 try: 15383 if not arg1.__class__ is schedule_node: 15384 arg1 = schedule_node(arg1) 15385 except: 15386 raise 15387 ctx = arg0.ctx 15388 res = isl.isl_schedule_node_graft_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 15389 obj = schedule_node(ctx=ctx, ptr=res) 15390 return obj 15391 def graft_before(arg0, arg1): 15392 try: 15393 if not arg0.__class__ is schedule_node: 15394 arg0 = schedule_node(arg0) 15395 except: 15396 raise 15397 try: 15398 if not arg1.__class__ is schedule_node: 15399 arg1 = schedule_node(arg1) 15400 except: 15401 raise 15402 ctx = arg0.ctx 15403 res = isl.isl_schedule_node_graft_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 15404 obj = schedule_node(ctx=ctx, ptr=res) 15405 return obj 15406 def has_children(arg0): 15407 try: 15408 if not arg0.__class__ is schedule_node: 15409 arg0 = schedule_node(arg0) 15410 except: 15411 raise 15412 ctx = arg0.ctx 15413 res = isl.isl_schedule_node_has_children(arg0.ptr) 15414 if res < 0: 15415 raise Error 15416 return bool(res) 15417 def has_next_sibling(arg0): 15418 try: 15419 if not arg0.__class__ is schedule_node: 15420 arg0 = schedule_node(arg0) 15421 except: 15422 raise 15423 ctx = arg0.ctx 15424 res = isl.isl_schedule_node_has_next_sibling(arg0.ptr) 15425 if res < 0: 15426 raise Error 15427 return bool(res) 15428 def has_parent(arg0): 15429 try: 15430 if not arg0.__class__ is schedule_node: 15431 arg0 = schedule_node(arg0) 15432 except: 15433 raise 15434 ctx = arg0.ctx 15435 res = isl.isl_schedule_node_has_parent(arg0.ptr) 15436 if res < 0: 15437 raise Error 15438 return bool(res) 15439 def has_previous_sibling(arg0): 15440 try: 15441 if not arg0.__class__ is schedule_node: 15442 arg0 = schedule_node(arg0) 15443 except: 15444 raise 15445 ctx = arg0.ctx 15446 res = isl.isl_schedule_node_has_previous_sibling(arg0.ptr) 15447 if res < 0: 15448 raise Error 15449 return bool(res) 15450 def insert_context(arg0, arg1): 15451 try: 15452 if not arg0.__class__ is schedule_node: 15453 arg0 = schedule_node(arg0) 15454 except: 15455 raise 15456 try: 15457 if not arg1.__class__ is set: 15458 arg1 = set(arg1) 15459 except: 15460 raise 15461 ctx = arg0.ctx 15462 res = isl.isl_schedule_node_insert_context(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 15463 obj = schedule_node(ctx=ctx, ptr=res) 15464 return obj 15465 def insert_filter(arg0, arg1): 15466 try: 15467 if not arg0.__class__ is schedule_node: 15468 arg0 = schedule_node(arg0) 15469 except: 15470 raise 15471 try: 15472 if not arg1.__class__ is union_set: 15473 arg1 = union_set(arg1) 15474 except: 15475 raise 15476 ctx = arg0.ctx 15477 res = isl.isl_schedule_node_insert_filter(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 15478 obj = schedule_node(ctx=ctx, ptr=res) 15479 return obj 15480 def insert_guard(arg0, arg1): 15481 try: 15482 if not arg0.__class__ is schedule_node: 15483 arg0 = schedule_node(arg0) 15484 except: 15485 raise 15486 try: 15487 if not arg1.__class__ is set: 15488 arg1 = set(arg1) 15489 except: 15490 raise 15491 ctx = arg0.ctx 15492 res = isl.isl_schedule_node_insert_guard(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 15493 obj = schedule_node(ctx=ctx, ptr=res) 15494 return obj 15495 def insert_mark(arg0, arg1): 15496 try: 15497 if not arg0.__class__ is schedule_node: 15498 arg0 = schedule_node(arg0) 15499 except: 15500 raise 15501 try: 15502 if not arg1.__class__ is id: 15503 arg1 = id(arg1) 15504 except: 15505 raise 15506 ctx = arg0.ctx 15507 res = isl.isl_schedule_node_insert_mark(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 15508 obj = schedule_node(ctx=ctx, ptr=res) 15509 return obj 15510 def insert_partial_schedule(arg0, arg1): 15511 try: 15512 if not arg0.__class__ is schedule_node: 15513 arg0 = schedule_node(arg0) 15514 except: 15515 raise 15516 try: 15517 if not arg1.__class__ is multi_union_pw_aff: 15518 arg1 = multi_union_pw_aff(arg1) 15519 except: 15520 raise 15521 ctx = arg0.ctx 15522 res = isl.isl_schedule_node_insert_partial_schedule(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 15523 obj = schedule_node(ctx=ctx, ptr=res) 15524 return obj 15525 def insert_sequence(arg0, arg1): 15526 try: 15527 if not arg0.__class__ is schedule_node: 15528 arg0 = schedule_node(arg0) 15529 except: 15530 raise 15531 try: 15532 if not arg1.__class__ is union_set_list: 15533 arg1 = union_set_list(arg1) 15534 except: 15535 raise 15536 ctx = arg0.ctx 15537 res = isl.isl_schedule_node_insert_sequence(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 15538 obj = schedule_node(ctx=ctx, ptr=res) 15539 return obj 15540 def insert_set(arg0, arg1): 15541 try: 15542 if not arg0.__class__ is schedule_node: 15543 arg0 = schedule_node(arg0) 15544 except: 15545 raise 15546 try: 15547 if not arg1.__class__ is union_set_list: 15548 arg1 = union_set_list(arg1) 15549 except: 15550 raise 15551 ctx = arg0.ctx 15552 res = isl.isl_schedule_node_insert_set(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 15553 obj = schedule_node(ctx=ctx, ptr=res) 15554 return obj 15555 def is_equal(arg0, arg1): 15556 try: 15557 if not arg0.__class__ is schedule_node: 15558 arg0 = schedule_node(arg0) 15559 except: 15560 raise 15561 try: 15562 if not arg1.__class__ is schedule_node: 15563 arg1 = schedule_node(arg1) 15564 except: 15565 raise 15566 ctx = arg0.ctx 15567 res = isl.isl_schedule_node_is_equal(arg0.ptr, arg1.ptr) 15568 if res < 0: 15569 raise Error 15570 return bool(res) 15571 def is_subtree_anchored(arg0): 15572 try: 15573 if not arg0.__class__ is schedule_node: 15574 arg0 = schedule_node(arg0) 15575 except: 15576 raise 15577 ctx = arg0.ctx 15578 res = isl.isl_schedule_node_is_subtree_anchored(arg0.ptr) 15579 if res < 0: 15580 raise Error 15581 return bool(res) 15582 def map_descendant_bottom_up(arg0, arg1): 15583 try: 15584 if not arg0.__class__ is schedule_node: 15585 arg0 = schedule_node(arg0) 15586 except: 15587 raise 15588 exc_info = [None] 15589 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p) 15590 def cb_func(cb_arg0, cb_arg1): 15591 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=(cb_arg0)) 15592 try: 15593 res = arg1(cb_arg0) 15594 except BaseException as e: 15595 exc_info[0] = e 15596 return None 15597 return isl.isl_schedule_node_copy(res.ptr) 15598 cb1 = fn(cb_func) 15599 ctx = arg0.ctx 15600 res = isl.isl_schedule_node_map_descendant_bottom_up(isl.isl_schedule_node_copy(arg0.ptr), cb1, None) 15601 if exc_info[0] is not None: 15602 raise exc_info[0] 15603 obj = schedule_node(ctx=ctx, ptr=res) 15604 return obj 15605 def n_children(arg0): 15606 try: 15607 if not arg0.__class__ is schedule_node: 15608 arg0 = schedule_node(arg0) 15609 except: 15610 raise 15611 ctx = arg0.ctx 15612 res = isl.isl_schedule_node_n_children(arg0.ptr) 15613 if res < 0: 15614 raise Error 15615 return int(res) 15616 def next_sibling(arg0): 15617 try: 15618 if not arg0.__class__ is schedule_node: 15619 arg0 = schedule_node(arg0) 15620 except: 15621 raise 15622 ctx = arg0.ctx 15623 res = isl.isl_schedule_node_next_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 15624 obj = schedule_node(ctx=ctx, ptr=res) 15625 return obj 15626 def order_after(arg0, arg1): 15627 try: 15628 if not arg0.__class__ is schedule_node: 15629 arg0 = schedule_node(arg0) 15630 except: 15631 raise 15632 try: 15633 if not arg1.__class__ is union_set: 15634 arg1 = union_set(arg1) 15635 except: 15636 raise 15637 ctx = arg0.ctx 15638 res = isl.isl_schedule_node_order_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 15639 obj = schedule_node(ctx=ctx, ptr=res) 15640 return obj 15641 def order_before(arg0, arg1): 15642 try: 15643 if not arg0.__class__ is schedule_node: 15644 arg0 = schedule_node(arg0) 15645 except: 15646 raise 15647 try: 15648 if not arg1.__class__ is union_set: 15649 arg1 = union_set(arg1) 15650 except: 15651 raise 15652 ctx = arg0.ctx 15653 res = isl.isl_schedule_node_order_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 15654 obj = schedule_node(ctx=ctx, ptr=res) 15655 return obj 15656 def parent(arg0): 15657 try: 15658 if not arg0.__class__ is schedule_node: 15659 arg0 = schedule_node(arg0) 15660 except: 15661 raise 15662 ctx = arg0.ctx 15663 res = isl.isl_schedule_node_parent(isl.isl_schedule_node_copy(arg0.ptr)) 15664 obj = schedule_node(ctx=ctx, ptr=res) 15665 return obj 15666 def prefix_schedule_multi_union_pw_aff(arg0): 15667 try: 15668 if not arg0.__class__ is schedule_node: 15669 arg0 = schedule_node(arg0) 15670 except: 15671 raise 15672 ctx = arg0.ctx 15673 res = isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(arg0.ptr) 15674 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 15675 return obj 15676 def get_prefix_schedule_multi_union_pw_aff(arg0): 15677 return arg0.prefix_schedule_multi_union_pw_aff() 15678 def prefix_schedule_union_map(arg0): 15679 try: 15680 if not arg0.__class__ is schedule_node: 15681 arg0 = schedule_node(arg0) 15682 except: 15683 raise 15684 ctx = arg0.ctx 15685 res = isl.isl_schedule_node_get_prefix_schedule_union_map(arg0.ptr) 15686 obj = union_map(ctx=ctx, ptr=res) 15687 return obj 15688 def get_prefix_schedule_union_map(arg0): 15689 return arg0.prefix_schedule_union_map() 15690 def prefix_schedule_union_pw_multi_aff(arg0): 15691 try: 15692 if not arg0.__class__ is schedule_node: 15693 arg0 = schedule_node(arg0) 15694 except: 15695 raise 15696 ctx = arg0.ctx 15697 res = isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(arg0.ptr) 15698 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 15699 return obj 15700 def get_prefix_schedule_union_pw_multi_aff(arg0): 15701 return arg0.prefix_schedule_union_pw_multi_aff() 15702 def previous_sibling(arg0): 15703 try: 15704 if not arg0.__class__ is schedule_node: 15705 arg0 = schedule_node(arg0) 15706 except: 15707 raise 15708 ctx = arg0.ctx 15709 res = isl.isl_schedule_node_previous_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 15710 obj = schedule_node(ctx=ctx, ptr=res) 15711 return obj 15712 def root(arg0): 15713 try: 15714 if not arg0.__class__ is schedule_node: 15715 arg0 = schedule_node(arg0) 15716 except: 15717 raise 15718 ctx = arg0.ctx 15719 res = isl.isl_schedule_node_root(isl.isl_schedule_node_copy(arg0.ptr)) 15720 obj = schedule_node(ctx=ctx, ptr=res) 15721 return obj 15722 def schedule(arg0): 15723 try: 15724 if not arg0.__class__ is schedule_node: 15725 arg0 = schedule_node(arg0) 15726 except: 15727 raise 15728 ctx = arg0.ctx 15729 res = isl.isl_schedule_node_get_schedule(arg0.ptr) 15730 obj = schedule(ctx=ctx, ptr=res) 15731 return obj 15732 def get_schedule(arg0): 15733 return arg0.schedule() 15734 def shared_ancestor(arg0, arg1): 15735 try: 15736 if not arg0.__class__ is schedule_node: 15737 arg0 = schedule_node(arg0) 15738 except: 15739 raise 15740 try: 15741 if not arg1.__class__ is schedule_node: 15742 arg1 = schedule_node(arg1) 15743 except: 15744 raise 15745 ctx = arg0.ctx 15746 res = isl.isl_schedule_node_get_shared_ancestor(arg0.ptr, arg1.ptr) 15747 obj = schedule_node(ctx=ctx, ptr=res) 15748 return obj 15749 def get_shared_ancestor(arg0, arg1): 15750 return arg0.shared_ancestor(arg1) 15751 def tree_depth(arg0): 15752 try: 15753 if not arg0.__class__ is schedule_node: 15754 arg0 = schedule_node(arg0) 15755 except: 15756 raise 15757 ctx = arg0.ctx 15758 res = isl.isl_schedule_node_get_tree_depth(arg0.ptr) 15759 if res < 0: 15760 raise Error 15761 return int(res) 15762 def get_tree_depth(arg0): 15763 return arg0.tree_depth() 15764 15765isl.isl_schedule_node_ancestor.restype = c_void_p 15766isl.isl_schedule_node_ancestor.argtypes = [c_void_p, c_int] 15767isl.isl_schedule_node_get_ancestor_child_position.argtypes = [c_void_p, c_void_p] 15768isl.isl_schedule_node_child.restype = c_void_p 15769isl.isl_schedule_node_child.argtypes = [c_void_p, c_int] 15770isl.isl_schedule_node_get_child_position.argtypes = [c_void_p] 15771isl.isl_schedule_node_every_descendant.argtypes = [c_void_p, c_void_p, c_void_p] 15772isl.isl_schedule_node_first_child.restype = c_void_p 15773isl.isl_schedule_node_first_child.argtypes = [c_void_p] 15774isl.isl_schedule_node_foreach_ancestor_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 15775isl.isl_schedule_node_foreach_descendant_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 15776isl.isl_schedule_node_from_domain.restype = c_void_p 15777isl.isl_schedule_node_from_domain.argtypes = [c_void_p] 15778isl.isl_schedule_node_from_extension.restype = c_void_p 15779isl.isl_schedule_node_from_extension.argtypes = [c_void_p] 15780isl.isl_schedule_node_graft_after.restype = c_void_p 15781isl.isl_schedule_node_graft_after.argtypes = [c_void_p, c_void_p] 15782isl.isl_schedule_node_graft_before.restype = c_void_p 15783isl.isl_schedule_node_graft_before.argtypes = [c_void_p, c_void_p] 15784isl.isl_schedule_node_has_children.argtypes = [c_void_p] 15785isl.isl_schedule_node_has_next_sibling.argtypes = [c_void_p] 15786isl.isl_schedule_node_has_parent.argtypes = [c_void_p] 15787isl.isl_schedule_node_has_previous_sibling.argtypes = [c_void_p] 15788isl.isl_schedule_node_insert_context.restype = c_void_p 15789isl.isl_schedule_node_insert_context.argtypes = [c_void_p, c_void_p] 15790isl.isl_schedule_node_insert_filter.restype = c_void_p 15791isl.isl_schedule_node_insert_filter.argtypes = [c_void_p, c_void_p] 15792isl.isl_schedule_node_insert_guard.restype = c_void_p 15793isl.isl_schedule_node_insert_guard.argtypes = [c_void_p, c_void_p] 15794isl.isl_schedule_node_insert_mark.restype = c_void_p 15795isl.isl_schedule_node_insert_mark.argtypes = [c_void_p, c_void_p] 15796isl.isl_schedule_node_insert_partial_schedule.restype = c_void_p 15797isl.isl_schedule_node_insert_partial_schedule.argtypes = [c_void_p, c_void_p] 15798isl.isl_schedule_node_insert_sequence.restype = c_void_p 15799isl.isl_schedule_node_insert_sequence.argtypes = [c_void_p, c_void_p] 15800isl.isl_schedule_node_insert_set.restype = c_void_p 15801isl.isl_schedule_node_insert_set.argtypes = [c_void_p, c_void_p] 15802isl.isl_schedule_node_is_equal.argtypes = [c_void_p, c_void_p] 15803isl.isl_schedule_node_is_subtree_anchored.argtypes = [c_void_p] 15804isl.isl_schedule_node_map_descendant_bottom_up.restype = c_void_p 15805isl.isl_schedule_node_map_descendant_bottom_up.argtypes = [c_void_p, c_void_p, c_void_p] 15806isl.isl_schedule_node_n_children.argtypes = [c_void_p] 15807isl.isl_schedule_node_next_sibling.restype = c_void_p 15808isl.isl_schedule_node_next_sibling.argtypes = [c_void_p] 15809isl.isl_schedule_node_order_after.restype = c_void_p 15810isl.isl_schedule_node_order_after.argtypes = [c_void_p, c_void_p] 15811isl.isl_schedule_node_order_before.restype = c_void_p 15812isl.isl_schedule_node_order_before.argtypes = [c_void_p, c_void_p] 15813isl.isl_schedule_node_parent.restype = c_void_p 15814isl.isl_schedule_node_parent.argtypes = [c_void_p] 15815isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.restype = c_void_p 15816isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.argtypes = [c_void_p] 15817isl.isl_schedule_node_get_prefix_schedule_union_map.restype = c_void_p 15818isl.isl_schedule_node_get_prefix_schedule_union_map.argtypes = [c_void_p] 15819isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.restype = c_void_p 15820isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.argtypes = [c_void_p] 15821isl.isl_schedule_node_previous_sibling.restype = c_void_p 15822isl.isl_schedule_node_previous_sibling.argtypes = [c_void_p] 15823isl.isl_schedule_node_root.restype = c_void_p 15824isl.isl_schedule_node_root.argtypes = [c_void_p] 15825isl.isl_schedule_node_get_schedule.restype = c_void_p 15826isl.isl_schedule_node_get_schedule.argtypes = [c_void_p] 15827isl.isl_schedule_node_get_shared_ancestor.restype = c_void_p 15828isl.isl_schedule_node_get_shared_ancestor.argtypes = [c_void_p, c_void_p] 15829isl.isl_schedule_node_get_tree_depth.argtypes = [c_void_p] 15830isl.isl_schedule_node_copy.restype = c_void_p 15831isl.isl_schedule_node_copy.argtypes = [c_void_p] 15832isl.isl_schedule_node_free.restype = c_void_p 15833isl.isl_schedule_node_free.argtypes = [c_void_p] 15834isl.isl_schedule_node_to_str.restype = POINTER(c_char) 15835isl.isl_schedule_node_to_str.argtypes = [c_void_p] 15836isl.isl_schedule_node_get_type.argtypes = [c_void_p] 15837 15838class schedule_node_band(schedule_node): 15839 def __init__(self, *args, **keywords): 15840 if "ptr" in keywords: 15841 self.ctx = keywords["ctx"] 15842 self.ptr = keywords["ptr"] 15843 return 15844 raise Error 15845 def __del__(self): 15846 if hasattr(self, 'ptr'): 15847 isl.isl_schedule_node_free(self.ptr) 15848 def __new__(cls, *args, **keywords): 15849 return super(schedule_node_band, cls).__new__(cls) 15850 def __str__(arg0): 15851 try: 15852 if not arg0.__class__ is schedule_node_band: 15853 arg0 = schedule_node_band(arg0) 15854 except: 15855 raise 15856 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 15857 res = cast(ptr, c_char_p).value.decode('ascii') 15858 libc.free(ptr) 15859 return res 15860 def __repr__(self): 15861 s = str(self) 15862 if '"' in s: 15863 return 'isl.schedule_node_band("""%s""")' % s 15864 else: 15865 return 'isl.schedule_node_band("%s")' % s 15866 def ast_build_options(arg0): 15867 try: 15868 if not arg0.__class__ is schedule_node: 15869 arg0 = schedule_node(arg0) 15870 except: 15871 raise 15872 ctx = arg0.ctx 15873 res = isl.isl_schedule_node_band_get_ast_build_options(arg0.ptr) 15874 obj = union_set(ctx=ctx, ptr=res) 15875 return obj 15876 def get_ast_build_options(arg0): 15877 return arg0.ast_build_options() 15878 def ast_isolate_option(arg0): 15879 try: 15880 if not arg0.__class__ is schedule_node: 15881 arg0 = schedule_node(arg0) 15882 except: 15883 raise 15884 ctx = arg0.ctx 15885 res = isl.isl_schedule_node_band_get_ast_isolate_option(arg0.ptr) 15886 obj = set(ctx=ctx, ptr=res) 15887 return obj 15888 def get_ast_isolate_option(arg0): 15889 return arg0.ast_isolate_option() 15890 def member_get_coincident(arg0, arg1): 15891 try: 15892 if not arg0.__class__ is schedule_node: 15893 arg0 = schedule_node(arg0) 15894 except: 15895 raise 15896 ctx = arg0.ctx 15897 res = isl.isl_schedule_node_band_member_get_coincident(arg0.ptr, arg1) 15898 if res < 0: 15899 raise Error 15900 return bool(res) 15901 def member_set_coincident(arg0, arg1, arg2): 15902 try: 15903 if not arg0.__class__ is schedule_node: 15904 arg0 = schedule_node(arg0) 15905 except: 15906 raise 15907 ctx = arg0.ctx 15908 res = isl.isl_schedule_node_band_member_set_coincident(isl.isl_schedule_node_copy(arg0.ptr), arg1, arg2) 15909 obj = schedule_node(ctx=ctx, ptr=res) 15910 return obj 15911 def mod(arg0, arg1): 15912 try: 15913 if not arg0.__class__ is schedule_node: 15914 arg0 = schedule_node(arg0) 15915 except: 15916 raise 15917 try: 15918 if not arg1.__class__ is multi_val: 15919 arg1 = multi_val(arg1) 15920 except: 15921 raise 15922 ctx = arg0.ctx 15923 res = isl.isl_schedule_node_band_mod(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 15924 obj = schedule_node(ctx=ctx, ptr=res) 15925 return obj 15926 def n_member(arg0): 15927 try: 15928 if not arg0.__class__ is schedule_node: 15929 arg0 = schedule_node(arg0) 15930 except: 15931 raise 15932 ctx = arg0.ctx 15933 res = isl.isl_schedule_node_band_n_member(arg0.ptr) 15934 if res < 0: 15935 raise Error 15936 return int(res) 15937 def partial_schedule(arg0): 15938 try: 15939 if not arg0.__class__ is schedule_node: 15940 arg0 = schedule_node(arg0) 15941 except: 15942 raise 15943 ctx = arg0.ctx 15944 res = isl.isl_schedule_node_band_get_partial_schedule(arg0.ptr) 15945 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 15946 return obj 15947 def get_partial_schedule(arg0): 15948 return arg0.partial_schedule() 15949 def permutable(arg0): 15950 try: 15951 if not arg0.__class__ is schedule_node: 15952 arg0 = schedule_node(arg0) 15953 except: 15954 raise 15955 ctx = arg0.ctx 15956 res = isl.isl_schedule_node_band_get_permutable(arg0.ptr) 15957 if res < 0: 15958 raise Error 15959 return bool(res) 15960 def get_permutable(arg0): 15961 return arg0.permutable() 15962 def scale(arg0, arg1): 15963 try: 15964 if not arg0.__class__ is schedule_node: 15965 arg0 = schedule_node(arg0) 15966 except: 15967 raise 15968 try: 15969 if not arg1.__class__ is multi_val: 15970 arg1 = multi_val(arg1) 15971 except: 15972 raise 15973 ctx = arg0.ctx 15974 res = isl.isl_schedule_node_band_scale(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 15975 obj = schedule_node(ctx=ctx, ptr=res) 15976 return obj 15977 def scale_down(arg0, arg1): 15978 try: 15979 if not arg0.__class__ is schedule_node: 15980 arg0 = schedule_node(arg0) 15981 except: 15982 raise 15983 try: 15984 if not arg1.__class__ is multi_val: 15985 arg1 = multi_val(arg1) 15986 except: 15987 raise 15988 ctx = arg0.ctx 15989 res = isl.isl_schedule_node_band_scale_down(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 15990 obj = schedule_node(ctx=ctx, ptr=res) 15991 return obj 15992 def set_ast_build_options(arg0, arg1): 15993 try: 15994 if not arg0.__class__ is schedule_node: 15995 arg0 = schedule_node(arg0) 15996 except: 15997 raise 15998 try: 15999 if not arg1.__class__ is union_set: 16000 arg1 = union_set(arg1) 16001 except: 16002 raise 16003 ctx = arg0.ctx 16004 res = isl.isl_schedule_node_band_set_ast_build_options(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 16005 obj = schedule_node(ctx=ctx, ptr=res) 16006 return obj 16007 def set_permutable(arg0, arg1): 16008 try: 16009 if not arg0.__class__ is schedule_node: 16010 arg0 = schedule_node(arg0) 16011 except: 16012 raise 16013 ctx = arg0.ctx 16014 res = isl.isl_schedule_node_band_set_permutable(isl.isl_schedule_node_copy(arg0.ptr), arg1) 16015 obj = schedule_node(ctx=ctx, ptr=res) 16016 return obj 16017 def shift(arg0, arg1): 16018 try: 16019 if not arg0.__class__ is schedule_node: 16020 arg0 = schedule_node(arg0) 16021 except: 16022 raise 16023 try: 16024 if not arg1.__class__ is multi_union_pw_aff: 16025 arg1 = multi_union_pw_aff(arg1) 16026 except: 16027 raise 16028 ctx = arg0.ctx 16029 res = isl.isl_schedule_node_band_shift(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 16030 obj = schedule_node(ctx=ctx, ptr=res) 16031 return obj 16032 def split(arg0, arg1): 16033 try: 16034 if not arg0.__class__ is schedule_node: 16035 arg0 = schedule_node(arg0) 16036 except: 16037 raise 16038 ctx = arg0.ctx 16039 res = isl.isl_schedule_node_band_split(isl.isl_schedule_node_copy(arg0.ptr), arg1) 16040 obj = schedule_node(ctx=ctx, ptr=res) 16041 return obj 16042 def tile(arg0, arg1): 16043 try: 16044 if not arg0.__class__ is schedule_node: 16045 arg0 = schedule_node(arg0) 16046 except: 16047 raise 16048 try: 16049 if not arg1.__class__ is multi_val: 16050 arg1 = multi_val(arg1) 16051 except: 16052 raise 16053 ctx = arg0.ctx 16054 res = isl.isl_schedule_node_band_tile(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 16055 obj = schedule_node(ctx=ctx, ptr=res) 16056 return obj 16057 def member_set_ast_loop_default(arg0, arg1): 16058 try: 16059 if not arg0.__class__ is schedule_node: 16060 arg0 = schedule_node(arg0) 16061 except: 16062 raise 16063 ctx = arg0.ctx 16064 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 0) 16065 obj = schedule_node(ctx=ctx, ptr=res) 16066 return obj 16067 def member_set_ast_loop_atomic(arg0, arg1): 16068 try: 16069 if not arg0.__class__ is schedule_node: 16070 arg0 = schedule_node(arg0) 16071 except: 16072 raise 16073 ctx = arg0.ctx 16074 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 1) 16075 obj = schedule_node(ctx=ctx, ptr=res) 16076 return obj 16077 def member_set_ast_loop_unroll(arg0, arg1): 16078 try: 16079 if not arg0.__class__ is schedule_node: 16080 arg0 = schedule_node(arg0) 16081 except: 16082 raise 16083 ctx = arg0.ctx 16084 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 2) 16085 obj = schedule_node(ctx=ctx, ptr=res) 16086 return obj 16087 def member_set_ast_loop_separate(arg0, arg1): 16088 try: 16089 if not arg0.__class__ is schedule_node: 16090 arg0 = schedule_node(arg0) 16091 except: 16092 raise 16093 ctx = arg0.ctx 16094 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 3) 16095 obj = schedule_node(ctx=ctx, ptr=res) 16096 return obj 16097 16098isl.isl_schedule_node_band_get_ast_build_options.restype = c_void_p 16099isl.isl_schedule_node_band_get_ast_build_options.argtypes = [c_void_p] 16100isl.isl_schedule_node_band_get_ast_isolate_option.restype = c_void_p 16101isl.isl_schedule_node_band_get_ast_isolate_option.argtypes = [c_void_p] 16102isl.isl_schedule_node_band_member_get_coincident.argtypes = [c_void_p, c_int] 16103isl.isl_schedule_node_band_member_set_coincident.restype = c_void_p 16104isl.isl_schedule_node_band_member_set_coincident.argtypes = [c_void_p, c_int, c_int] 16105isl.isl_schedule_node_band_mod.restype = c_void_p 16106isl.isl_schedule_node_band_mod.argtypes = [c_void_p, c_void_p] 16107isl.isl_schedule_node_band_n_member.argtypes = [c_void_p] 16108isl.isl_schedule_node_band_get_partial_schedule.restype = c_void_p 16109isl.isl_schedule_node_band_get_partial_schedule.argtypes = [c_void_p] 16110isl.isl_schedule_node_band_get_permutable.argtypes = [c_void_p] 16111isl.isl_schedule_node_band_scale.restype = c_void_p 16112isl.isl_schedule_node_band_scale.argtypes = [c_void_p, c_void_p] 16113isl.isl_schedule_node_band_scale_down.restype = c_void_p 16114isl.isl_schedule_node_band_scale_down.argtypes = [c_void_p, c_void_p] 16115isl.isl_schedule_node_band_set_ast_build_options.restype = c_void_p 16116isl.isl_schedule_node_band_set_ast_build_options.argtypes = [c_void_p, c_void_p] 16117isl.isl_schedule_node_band_set_permutable.restype = c_void_p 16118isl.isl_schedule_node_band_set_permutable.argtypes = [c_void_p, c_int] 16119isl.isl_schedule_node_band_shift.restype = c_void_p 16120isl.isl_schedule_node_band_shift.argtypes = [c_void_p, c_void_p] 16121isl.isl_schedule_node_band_split.restype = c_void_p 16122isl.isl_schedule_node_band_split.argtypes = [c_void_p, c_int] 16123isl.isl_schedule_node_band_tile.restype = c_void_p 16124isl.isl_schedule_node_band_tile.argtypes = [c_void_p, c_void_p] 16125isl.isl_schedule_node_band_member_set_ast_loop_type.restype = c_void_p 16126isl.isl_schedule_node_band_member_set_ast_loop_type.argtypes = [c_void_p, c_int, c_int] 16127isl.isl_schedule_node_copy.restype = c_void_p 16128isl.isl_schedule_node_copy.argtypes = [c_void_p] 16129isl.isl_schedule_node_free.restype = c_void_p 16130isl.isl_schedule_node_free.argtypes = [c_void_p] 16131isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16132isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16133 16134class schedule_node_context(schedule_node): 16135 def __init__(self, *args, **keywords): 16136 if "ptr" in keywords: 16137 self.ctx = keywords["ctx"] 16138 self.ptr = keywords["ptr"] 16139 return 16140 raise Error 16141 def __del__(self): 16142 if hasattr(self, 'ptr'): 16143 isl.isl_schedule_node_free(self.ptr) 16144 def __new__(cls, *args, **keywords): 16145 return super(schedule_node_context, cls).__new__(cls) 16146 def __str__(arg0): 16147 try: 16148 if not arg0.__class__ is schedule_node_context: 16149 arg0 = schedule_node_context(arg0) 16150 except: 16151 raise 16152 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16153 res = cast(ptr, c_char_p).value.decode('ascii') 16154 libc.free(ptr) 16155 return res 16156 def __repr__(self): 16157 s = str(self) 16158 if '"' in s: 16159 return 'isl.schedule_node_context("""%s""")' % s 16160 else: 16161 return 'isl.schedule_node_context("%s")' % s 16162 def context(arg0): 16163 try: 16164 if not arg0.__class__ is schedule_node: 16165 arg0 = schedule_node(arg0) 16166 except: 16167 raise 16168 ctx = arg0.ctx 16169 res = isl.isl_schedule_node_context_get_context(arg0.ptr) 16170 obj = set(ctx=ctx, ptr=res) 16171 return obj 16172 def get_context(arg0): 16173 return arg0.context() 16174 16175isl.isl_schedule_node_context_get_context.restype = c_void_p 16176isl.isl_schedule_node_context_get_context.argtypes = [c_void_p] 16177isl.isl_schedule_node_copy.restype = c_void_p 16178isl.isl_schedule_node_copy.argtypes = [c_void_p] 16179isl.isl_schedule_node_free.restype = c_void_p 16180isl.isl_schedule_node_free.argtypes = [c_void_p] 16181isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16182isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16183 16184class schedule_node_domain(schedule_node): 16185 def __init__(self, *args, **keywords): 16186 if "ptr" in keywords: 16187 self.ctx = keywords["ctx"] 16188 self.ptr = keywords["ptr"] 16189 return 16190 raise Error 16191 def __del__(self): 16192 if hasattr(self, 'ptr'): 16193 isl.isl_schedule_node_free(self.ptr) 16194 def __new__(cls, *args, **keywords): 16195 return super(schedule_node_domain, cls).__new__(cls) 16196 def __str__(arg0): 16197 try: 16198 if not arg0.__class__ is schedule_node_domain: 16199 arg0 = schedule_node_domain(arg0) 16200 except: 16201 raise 16202 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16203 res = cast(ptr, c_char_p).value.decode('ascii') 16204 libc.free(ptr) 16205 return res 16206 def __repr__(self): 16207 s = str(self) 16208 if '"' in s: 16209 return 'isl.schedule_node_domain("""%s""")' % s 16210 else: 16211 return 'isl.schedule_node_domain("%s")' % s 16212 def domain(arg0): 16213 try: 16214 if not arg0.__class__ is schedule_node: 16215 arg0 = schedule_node(arg0) 16216 except: 16217 raise 16218 ctx = arg0.ctx 16219 res = isl.isl_schedule_node_domain_get_domain(arg0.ptr) 16220 obj = union_set(ctx=ctx, ptr=res) 16221 return obj 16222 def get_domain(arg0): 16223 return arg0.domain() 16224 16225isl.isl_schedule_node_domain_get_domain.restype = c_void_p 16226isl.isl_schedule_node_domain_get_domain.argtypes = [c_void_p] 16227isl.isl_schedule_node_copy.restype = c_void_p 16228isl.isl_schedule_node_copy.argtypes = [c_void_p] 16229isl.isl_schedule_node_free.restype = c_void_p 16230isl.isl_schedule_node_free.argtypes = [c_void_p] 16231isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16232isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16233 16234class schedule_node_expansion(schedule_node): 16235 def __init__(self, *args, **keywords): 16236 if "ptr" in keywords: 16237 self.ctx = keywords["ctx"] 16238 self.ptr = keywords["ptr"] 16239 return 16240 raise Error 16241 def __del__(self): 16242 if hasattr(self, 'ptr'): 16243 isl.isl_schedule_node_free(self.ptr) 16244 def __new__(cls, *args, **keywords): 16245 return super(schedule_node_expansion, cls).__new__(cls) 16246 def __str__(arg0): 16247 try: 16248 if not arg0.__class__ is schedule_node_expansion: 16249 arg0 = schedule_node_expansion(arg0) 16250 except: 16251 raise 16252 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16253 res = cast(ptr, c_char_p).value.decode('ascii') 16254 libc.free(ptr) 16255 return res 16256 def __repr__(self): 16257 s = str(self) 16258 if '"' in s: 16259 return 'isl.schedule_node_expansion("""%s""")' % s 16260 else: 16261 return 'isl.schedule_node_expansion("%s")' % s 16262 def contraction(arg0): 16263 try: 16264 if not arg0.__class__ is schedule_node: 16265 arg0 = schedule_node(arg0) 16266 except: 16267 raise 16268 ctx = arg0.ctx 16269 res = isl.isl_schedule_node_expansion_get_contraction(arg0.ptr) 16270 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 16271 return obj 16272 def get_contraction(arg0): 16273 return arg0.contraction() 16274 def expansion(arg0): 16275 try: 16276 if not arg0.__class__ is schedule_node: 16277 arg0 = schedule_node(arg0) 16278 except: 16279 raise 16280 ctx = arg0.ctx 16281 res = isl.isl_schedule_node_expansion_get_expansion(arg0.ptr) 16282 obj = union_map(ctx=ctx, ptr=res) 16283 return obj 16284 def get_expansion(arg0): 16285 return arg0.expansion() 16286 16287isl.isl_schedule_node_expansion_get_contraction.restype = c_void_p 16288isl.isl_schedule_node_expansion_get_contraction.argtypes = [c_void_p] 16289isl.isl_schedule_node_expansion_get_expansion.restype = c_void_p 16290isl.isl_schedule_node_expansion_get_expansion.argtypes = [c_void_p] 16291isl.isl_schedule_node_copy.restype = c_void_p 16292isl.isl_schedule_node_copy.argtypes = [c_void_p] 16293isl.isl_schedule_node_free.restype = c_void_p 16294isl.isl_schedule_node_free.argtypes = [c_void_p] 16295isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16296isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16297 16298class schedule_node_extension(schedule_node): 16299 def __init__(self, *args, **keywords): 16300 if "ptr" in keywords: 16301 self.ctx = keywords["ctx"] 16302 self.ptr = keywords["ptr"] 16303 return 16304 raise Error 16305 def __del__(self): 16306 if hasattr(self, 'ptr'): 16307 isl.isl_schedule_node_free(self.ptr) 16308 def __new__(cls, *args, **keywords): 16309 return super(schedule_node_extension, cls).__new__(cls) 16310 def __str__(arg0): 16311 try: 16312 if not arg0.__class__ is schedule_node_extension: 16313 arg0 = schedule_node_extension(arg0) 16314 except: 16315 raise 16316 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16317 res = cast(ptr, c_char_p).value.decode('ascii') 16318 libc.free(ptr) 16319 return res 16320 def __repr__(self): 16321 s = str(self) 16322 if '"' in s: 16323 return 'isl.schedule_node_extension("""%s""")' % s 16324 else: 16325 return 'isl.schedule_node_extension("%s")' % s 16326 def extension(arg0): 16327 try: 16328 if not arg0.__class__ is schedule_node: 16329 arg0 = schedule_node(arg0) 16330 except: 16331 raise 16332 ctx = arg0.ctx 16333 res = isl.isl_schedule_node_extension_get_extension(arg0.ptr) 16334 obj = union_map(ctx=ctx, ptr=res) 16335 return obj 16336 def get_extension(arg0): 16337 return arg0.extension() 16338 16339isl.isl_schedule_node_extension_get_extension.restype = c_void_p 16340isl.isl_schedule_node_extension_get_extension.argtypes = [c_void_p] 16341isl.isl_schedule_node_copy.restype = c_void_p 16342isl.isl_schedule_node_copy.argtypes = [c_void_p] 16343isl.isl_schedule_node_free.restype = c_void_p 16344isl.isl_schedule_node_free.argtypes = [c_void_p] 16345isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16346isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16347 16348class schedule_node_filter(schedule_node): 16349 def __init__(self, *args, **keywords): 16350 if "ptr" in keywords: 16351 self.ctx = keywords["ctx"] 16352 self.ptr = keywords["ptr"] 16353 return 16354 raise Error 16355 def __del__(self): 16356 if hasattr(self, 'ptr'): 16357 isl.isl_schedule_node_free(self.ptr) 16358 def __new__(cls, *args, **keywords): 16359 return super(schedule_node_filter, cls).__new__(cls) 16360 def __str__(arg0): 16361 try: 16362 if not arg0.__class__ is schedule_node_filter: 16363 arg0 = schedule_node_filter(arg0) 16364 except: 16365 raise 16366 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16367 res = cast(ptr, c_char_p).value.decode('ascii') 16368 libc.free(ptr) 16369 return res 16370 def __repr__(self): 16371 s = str(self) 16372 if '"' in s: 16373 return 'isl.schedule_node_filter("""%s""")' % s 16374 else: 16375 return 'isl.schedule_node_filter("%s")' % s 16376 def filter(arg0): 16377 try: 16378 if not arg0.__class__ is schedule_node: 16379 arg0 = schedule_node(arg0) 16380 except: 16381 raise 16382 ctx = arg0.ctx 16383 res = isl.isl_schedule_node_filter_get_filter(arg0.ptr) 16384 obj = union_set(ctx=ctx, ptr=res) 16385 return obj 16386 def get_filter(arg0): 16387 return arg0.filter() 16388 16389isl.isl_schedule_node_filter_get_filter.restype = c_void_p 16390isl.isl_schedule_node_filter_get_filter.argtypes = [c_void_p] 16391isl.isl_schedule_node_copy.restype = c_void_p 16392isl.isl_schedule_node_copy.argtypes = [c_void_p] 16393isl.isl_schedule_node_free.restype = c_void_p 16394isl.isl_schedule_node_free.argtypes = [c_void_p] 16395isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16396isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16397 16398class schedule_node_guard(schedule_node): 16399 def __init__(self, *args, **keywords): 16400 if "ptr" in keywords: 16401 self.ctx = keywords["ctx"] 16402 self.ptr = keywords["ptr"] 16403 return 16404 raise Error 16405 def __del__(self): 16406 if hasattr(self, 'ptr'): 16407 isl.isl_schedule_node_free(self.ptr) 16408 def __new__(cls, *args, **keywords): 16409 return super(schedule_node_guard, cls).__new__(cls) 16410 def __str__(arg0): 16411 try: 16412 if not arg0.__class__ is schedule_node_guard: 16413 arg0 = schedule_node_guard(arg0) 16414 except: 16415 raise 16416 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16417 res = cast(ptr, c_char_p).value.decode('ascii') 16418 libc.free(ptr) 16419 return res 16420 def __repr__(self): 16421 s = str(self) 16422 if '"' in s: 16423 return 'isl.schedule_node_guard("""%s""")' % s 16424 else: 16425 return 'isl.schedule_node_guard("%s")' % s 16426 def guard(arg0): 16427 try: 16428 if not arg0.__class__ is schedule_node: 16429 arg0 = schedule_node(arg0) 16430 except: 16431 raise 16432 ctx = arg0.ctx 16433 res = isl.isl_schedule_node_guard_get_guard(arg0.ptr) 16434 obj = set(ctx=ctx, ptr=res) 16435 return obj 16436 def get_guard(arg0): 16437 return arg0.guard() 16438 16439isl.isl_schedule_node_guard_get_guard.restype = c_void_p 16440isl.isl_schedule_node_guard_get_guard.argtypes = [c_void_p] 16441isl.isl_schedule_node_copy.restype = c_void_p 16442isl.isl_schedule_node_copy.argtypes = [c_void_p] 16443isl.isl_schedule_node_free.restype = c_void_p 16444isl.isl_schedule_node_free.argtypes = [c_void_p] 16445isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16446isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16447 16448class schedule_node_leaf(schedule_node): 16449 def __init__(self, *args, **keywords): 16450 if "ptr" in keywords: 16451 self.ctx = keywords["ctx"] 16452 self.ptr = keywords["ptr"] 16453 return 16454 raise Error 16455 def __del__(self): 16456 if hasattr(self, 'ptr'): 16457 isl.isl_schedule_node_free(self.ptr) 16458 def __new__(cls, *args, **keywords): 16459 return super(schedule_node_leaf, cls).__new__(cls) 16460 def __str__(arg0): 16461 try: 16462 if not arg0.__class__ is schedule_node_leaf: 16463 arg0 = schedule_node_leaf(arg0) 16464 except: 16465 raise 16466 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16467 res = cast(ptr, c_char_p).value.decode('ascii') 16468 libc.free(ptr) 16469 return res 16470 def __repr__(self): 16471 s = str(self) 16472 if '"' in s: 16473 return 'isl.schedule_node_leaf("""%s""")' % s 16474 else: 16475 return 'isl.schedule_node_leaf("%s")' % s 16476 16477isl.isl_schedule_node_copy.restype = c_void_p 16478isl.isl_schedule_node_copy.argtypes = [c_void_p] 16479isl.isl_schedule_node_free.restype = c_void_p 16480isl.isl_schedule_node_free.argtypes = [c_void_p] 16481isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16482isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16483 16484class schedule_node_mark(schedule_node): 16485 def __init__(self, *args, **keywords): 16486 if "ptr" in keywords: 16487 self.ctx = keywords["ctx"] 16488 self.ptr = keywords["ptr"] 16489 return 16490 raise Error 16491 def __del__(self): 16492 if hasattr(self, 'ptr'): 16493 isl.isl_schedule_node_free(self.ptr) 16494 def __new__(cls, *args, **keywords): 16495 return super(schedule_node_mark, cls).__new__(cls) 16496 def __str__(arg0): 16497 try: 16498 if not arg0.__class__ is schedule_node_mark: 16499 arg0 = schedule_node_mark(arg0) 16500 except: 16501 raise 16502 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16503 res = cast(ptr, c_char_p).value.decode('ascii') 16504 libc.free(ptr) 16505 return res 16506 def __repr__(self): 16507 s = str(self) 16508 if '"' in s: 16509 return 'isl.schedule_node_mark("""%s""")' % s 16510 else: 16511 return 'isl.schedule_node_mark("%s")' % s 16512 16513isl.isl_schedule_node_copy.restype = c_void_p 16514isl.isl_schedule_node_copy.argtypes = [c_void_p] 16515isl.isl_schedule_node_free.restype = c_void_p 16516isl.isl_schedule_node_free.argtypes = [c_void_p] 16517isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16518isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16519 16520class schedule_node_sequence(schedule_node): 16521 def __init__(self, *args, **keywords): 16522 if "ptr" in keywords: 16523 self.ctx = keywords["ctx"] 16524 self.ptr = keywords["ptr"] 16525 return 16526 raise Error 16527 def __del__(self): 16528 if hasattr(self, 'ptr'): 16529 isl.isl_schedule_node_free(self.ptr) 16530 def __new__(cls, *args, **keywords): 16531 return super(schedule_node_sequence, cls).__new__(cls) 16532 def __str__(arg0): 16533 try: 16534 if not arg0.__class__ is schedule_node_sequence: 16535 arg0 = schedule_node_sequence(arg0) 16536 except: 16537 raise 16538 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16539 res = cast(ptr, c_char_p).value.decode('ascii') 16540 libc.free(ptr) 16541 return res 16542 def __repr__(self): 16543 s = str(self) 16544 if '"' in s: 16545 return 'isl.schedule_node_sequence("""%s""")' % s 16546 else: 16547 return 'isl.schedule_node_sequence("%s")' % s 16548 16549isl.isl_schedule_node_copy.restype = c_void_p 16550isl.isl_schedule_node_copy.argtypes = [c_void_p] 16551isl.isl_schedule_node_free.restype = c_void_p 16552isl.isl_schedule_node_free.argtypes = [c_void_p] 16553isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16554isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16555 16556class schedule_node_set(schedule_node): 16557 def __init__(self, *args, **keywords): 16558 if "ptr" in keywords: 16559 self.ctx = keywords["ctx"] 16560 self.ptr = keywords["ptr"] 16561 return 16562 raise Error 16563 def __del__(self): 16564 if hasattr(self, 'ptr'): 16565 isl.isl_schedule_node_free(self.ptr) 16566 def __new__(cls, *args, **keywords): 16567 return super(schedule_node_set, cls).__new__(cls) 16568 def __str__(arg0): 16569 try: 16570 if not arg0.__class__ is schedule_node_set: 16571 arg0 = schedule_node_set(arg0) 16572 except: 16573 raise 16574 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 16575 res = cast(ptr, c_char_p).value.decode('ascii') 16576 libc.free(ptr) 16577 return res 16578 def __repr__(self): 16579 s = str(self) 16580 if '"' in s: 16581 return 'isl.schedule_node_set("""%s""")' % s 16582 else: 16583 return 'isl.schedule_node_set("%s")' % s 16584 16585isl.isl_schedule_node_copy.restype = c_void_p 16586isl.isl_schedule_node_copy.argtypes = [c_void_p] 16587isl.isl_schedule_node_free.restype = c_void_p 16588isl.isl_schedule_node_free.argtypes = [c_void_p] 16589isl.isl_schedule_node_to_str.restype = POINTER(c_char) 16590isl.isl_schedule_node_to_str.argtypes = [c_void_p] 16591 16592class set_list(object): 16593 def __init__(self, *args, **keywords): 16594 if "ptr" in keywords: 16595 self.ctx = keywords["ctx"] 16596 self.ptr = keywords["ptr"] 16597 return 16598 if len(args) == 1 and type(args[0]) == int: 16599 self.ctx = Context.getDefaultInstance() 16600 self.ptr = isl.isl_set_list_alloc(self.ctx, args[0]) 16601 return 16602 if len(args) == 1 and args[0].__class__ is set: 16603 self.ctx = Context.getDefaultInstance() 16604 self.ptr = isl.isl_set_list_from_set(isl.isl_set_copy(args[0].ptr)) 16605 return 16606 if len(args) == 1 and type(args[0]) == str: 16607 self.ctx = Context.getDefaultInstance() 16608 self.ptr = isl.isl_set_list_read_from_str(self.ctx, args[0].encode('ascii')) 16609 return 16610 raise Error 16611 def __del__(self): 16612 if hasattr(self, 'ptr'): 16613 isl.isl_set_list_free(self.ptr) 16614 def __str__(arg0): 16615 try: 16616 if not arg0.__class__ is set_list: 16617 arg0 = set_list(arg0) 16618 except: 16619 raise 16620 ptr = isl.isl_set_list_to_str(arg0.ptr) 16621 res = cast(ptr, c_char_p).value.decode('ascii') 16622 libc.free(ptr) 16623 return res 16624 def __repr__(self): 16625 s = str(self) 16626 if '"' in s: 16627 return 'isl.set_list("""%s""")' % s 16628 else: 16629 return 'isl.set_list("%s")' % s 16630 def add(arg0, arg1): 16631 try: 16632 if not arg0.__class__ is set_list: 16633 arg0 = set_list(arg0) 16634 except: 16635 raise 16636 try: 16637 if not arg1.__class__ is set: 16638 arg1 = set(arg1) 16639 except: 16640 raise 16641 ctx = arg0.ctx 16642 res = isl.isl_set_list_add(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 16643 obj = set_list(ctx=ctx, ptr=res) 16644 return obj 16645 def at(arg0, arg1): 16646 try: 16647 if not arg0.__class__ is set_list: 16648 arg0 = set_list(arg0) 16649 except: 16650 raise 16651 ctx = arg0.ctx 16652 res = isl.isl_set_list_get_at(arg0.ptr, arg1) 16653 obj = set(ctx=ctx, ptr=res) 16654 return obj 16655 def get_at(arg0, arg1): 16656 return arg0.at(arg1) 16657 def clear(arg0): 16658 try: 16659 if not arg0.__class__ is set_list: 16660 arg0 = set_list(arg0) 16661 except: 16662 raise 16663 ctx = arg0.ctx 16664 res = isl.isl_set_list_clear(isl.isl_set_list_copy(arg0.ptr)) 16665 obj = set_list(ctx=ctx, ptr=res) 16666 return obj 16667 def concat(arg0, arg1): 16668 try: 16669 if not arg0.__class__ is set_list: 16670 arg0 = set_list(arg0) 16671 except: 16672 raise 16673 try: 16674 if not arg1.__class__ is set_list: 16675 arg1 = set_list(arg1) 16676 except: 16677 raise 16678 ctx = arg0.ctx 16679 res = isl.isl_set_list_concat(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_list_copy(arg1.ptr)) 16680 obj = set_list(ctx=ctx, ptr=res) 16681 return obj 16682 def drop(arg0, arg1, arg2): 16683 try: 16684 if not arg0.__class__ is set_list: 16685 arg0 = set_list(arg0) 16686 except: 16687 raise 16688 ctx = arg0.ctx 16689 res = isl.isl_set_list_drop(isl.isl_set_list_copy(arg0.ptr), arg1, arg2) 16690 obj = set_list(ctx=ctx, ptr=res) 16691 return obj 16692 def foreach(arg0, arg1): 16693 try: 16694 if not arg0.__class__ is set_list: 16695 arg0 = set_list(arg0) 16696 except: 16697 raise 16698 exc_info = [None] 16699 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 16700 def cb_func(cb_arg0, cb_arg1): 16701 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 16702 try: 16703 arg1(cb_arg0) 16704 except BaseException as e: 16705 exc_info[0] = e 16706 return -1 16707 return 0 16708 cb1 = fn(cb_func) 16709 ctx = arg0.ctx 16710 res = isl.isl_set_list_foreach(arg0.ptr, cb1, None) 16711 if exc_info[0] is not None: 16712 raise exc_info[0] 16713 if res < 0: 16714 raise Error 16715 def foreach_scc(arg0, arg1, arg2): 16716 try: 16717 if not arg0.__class__ is set_list: 16718 arg0 = set_list(arg0) 16719 except: 16720 raise 16721 exc_info = [None] 16722 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 16723 def cb_func(cb_arg0, cb_arg1, cb_arg2): 16724 cb_arg0 = set(ctx=arg0.ctx, ptr=isl.isl_set_copy(cb_arg0)) 16725 cb_arg1 = set(ctx=arg0.ctx, ptr=isl.isl_set_copy(cb_arg1)) 16726 try: 16727 res = arg1(cb_arg0, cb_arg1) 16728 except BaseException as e: 16729 exc_info[0] = e 16730 return -1 16731 return 1 if res else 0 16732 cb1 = fn(cb_func) 16733 exc_info = [None] 16734 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 16735 def cb_func(cb_arg0, cb_arg1): 16736 cb_arg0 = set_list(ctx=arg0.ctx, ptr=(cb_arg0)) 16737 try: 16738 arg2(cb_arg0) 16739 except BaseException as e: 16740 exc_info[0] = e 16741 return -1 16742 return 0 16743 cb2 = fn(cb_func) 16744 ctx = arg0.ctx 16745 res = isl.isl_set_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 16746 if exc_info[0] is not None: 16747 raise exc_info[0] 16748 if res < 0: 16749 raise Error 16750 def insert(arg0, arg1, arg2): 16751 try: 16752 if not arg0.__class__ is set_list: 16753 arg0 = set_list(arg0) 16754 except: 16755 raise 16756 try: 16757 if not arg2.__class__ is set: 16758 arg2 = set(arg2) 16759 except: 16760 raise 16761 ctx = arg0.ctx 16762 res = isl.isl_set_list_insert(isl.isl_set_list_copy(arg0.ptr), arg1, isl.isl_set_copy(arg2.ptr)) 16763 obj = set_list(ctx=ctx, ptr=res) 16764 return obj 16765 def set_at(arg0, arg1, arg2): 16766 try: 16767 if not arg0.__class__ is set_list: 16768 arg0 = set_list(arg0) 16769 except: 16770 raise 16771 try: 16772 if not arg2.__class__ is set: 16773 arg2 = set(arg2) 16774 except: 16775 raise 16776 ctx = arg0.ctx 16777 res = isl.isl_set_list_set_at(isl.isl_set_list_copy(arg0.ptr), arg1, isl.isl_set_copy(arg2.ptr)) 16778 obj = set_list(ctx=ctx, ptr=res) 16779 return obj 16780 def size(arg0): 16781 try: 16782 if not arg0.__class__ is set_list: 16783 arg0 = set_list(arg0) 16784 except: 16785 raise 16786 ctx = arg0.ctx 16787 res = isl.isl_set_list_size(arg0.ptr) 16788 if res < 0: 16789 raise Error 16790 return int(res) 16791 16792isl.isl_set_list_alloc.restype = c_void_p 16793isl.isl_set_list_alloc.argtypes = [Context, c_int] 16794isl.isl_set_list_from_set.restype = c_void_p 16795isl.isl_set_list_from_set.argtypes = [c_void_p] 16796isl.isl_set_list_read_from_str.restype = c_void_p 16797isl.isl_set_list_read_from_str.argtypes = [Context, c_char_p] 16798isl.isl_set_list_add.restype = c_void_p 16799isl.isl_set_list_add.argtypes = [c_void_p, c_void_p] 16800isl.isl_set_list_get_at.restype = c_void_p 16801isl.isl_set_list_get_at.argtypes = [c_void_p, c_int] 16802isl.isl_set_list_clear.restype = c_void_p 16803isl.isl_set_list_clear.argtypes = [c_void_p] 16804isl.isl_set_list_concat.restype = c_void_p 16805isl.isl_set_list_concat.argtypes = [c_void_p, c_void_p] 16806isl.isl_set_list_drop.restype = c_void_p 16807isl.isl_set_list_drop.argtypes = [c_void_p, c_int, c_int] 16808isl.isl_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 16809isl.isl_set_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 16810isl.isl_set_list_insert.restype = c_void_p 16811isl.isl_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] 16812isl.isl_set_list_set_at.restype = c_void_p 16813isl.isl_set_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 16814isl.isl_set_list_size.argtypes = [c_void_p] 16815isl.isl_set_list_copy.restype = c_void_p 16816isl.isl_set_list_copy.argtypes = [c_void_p] 16817isl.isl_set_list_free.restype = c_void_p 16818isl.isl_set_list_free.argtypes = [c_void_p] 16819isl.isl_set_list_to_str.restype = POINTER(c_char) 16820isl.isl_set_list_to_str.argtypes = [c_void_p] 16821 16822class space(object): 16823 def __init__(self, *args, **keywords): 16824 if "ptr" in keywords: 16825 self.ctx = keywords["ctx"] 16826 self.ptr = keywords["ptr"] 16827 return 16828 if len(args) == 1 and type(args[0]) == str: 16829 self.ctx = Context.getDefaultInstance() 16830 self.ptr = isl.isl_space_read_from_str(self.ctx, args[0].encode('ascii')) 16831 return 16832 raise Error 16833 def __del__(self): 16834 if hasattr(self, 'ptr'): 16835 isl.isl_space_free(self.ptr) 16836 def __str__(arg0): 16837 try: 16838 if not arg0.__class__ is space: 16839 arg0 = space(arg0) 16840 except: 16841 raise 16842 ptr = isl.isl_space_to_str(arg0.ptr) 16843 res = cast(ptr, c_char_p).value.decode('ascii') 16844 libc.free(ptr) 16845 return res 16846 def __repr__(self): 16847 s = str(self) 16848 if '"' in s: 16849 return 'isl.space("""%s""")' % s 16850 else: 16851 return 'isl.space("%s")' % s 16852 def add_named_tuple(*args): 16853 if len(args) == 3 and (args[1].__class__ is id or type(args[1]) == str) and type(args[2]) == int: 16854 args = list(args) 16855 try: 16856 if not args[0].__class__ is space: 16857 args[0] = space(args[0]) 16858 except: 16859 raise 16860 try: 16861 if not args[1].__class__ is id: 16862 args[1] = id(args[1]) 16863 except: 16864 raise 16865 ctx = args[0].ctx 16866 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]) 16867 obj = space(ctx=ctx, ptr=res) 16868 return obj 16869 raise Error 16870 def add_param(*args): 16871 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 16872 args = list(args) 16873 try: 16874 if not args[0].__class__ is space: 16875 args[0] = space(args[0]) 16876 except: 16877 raise 16878 try: 16879 if not args[1].__class__ is id: 16880 args[1] = id(args[1]) 16881 except: 16882 raise 16883 ctx = args[0].ctx 16884 res = isl.isl_space_add_param_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 16885 obj = space(ctx=ctx, ptr=res) 16886 return obj 16887 raise Error 16888 def add_unnamed_tuple(*args): 16889 if len(args) == 2 and type(args[1]) == int: 16890 args = list(args) 16891 try: 16892 if not args[0].__class__ is space: 16893 args[0] = space(args[0]) 16894 except: 16895 raise 16896 ctx = args[0].ctx 16897 res = isl.isl_space_add_unnamed_tuple_ui(isl.isl_space_copy(args[0].ptr), args[1]) 16898 obj = space(ctx=ctx, ptr=res) 16899 return obj 16900 raise Error 16901 def curry(arg0): 16902 try: 16903 if not arg0.__class__ is space: 16904 arg0 = space(arg0) 16905 except: 16906 raise 16907 ctx = arg0.ctx 16908 res = isl.isl_space_curry(isl.isl_space_copy(arg0.ptr)) 16909 obj = space(ctx=ctx, ptr=res) 16910 return obj 16911 def domain(arg0): 16912 try: 16913 if not arg0.__class__ is space: 16914 arg0 = space(arg0) 16915 except: 16916 raise 16917 ctx = arg0.ctx 16918 res = isl.isl_space_domain(isl.isl_space_copy(arg0.ptr)) 16919 obj = space(ctx=ctx, ptr=res) 16920 return obj 16921 def domain_map_multi_aff(arg0): 16922 try: 16923 if not arg0.__class__ is space: 16924 arg0 = space(arg0) 16925 except: 16926 raise 16927 ctx = arg0.ctx 16928 res = isl.isl_space_domain_map_multi_aff(isl.isl_space_copy(arg0.ptr)) 16929 obj = multi_aff(ctx=ctx, ptr=res) 16930 return obj 16931 def domain_map_pw_multi_aff(arg0): 16932 try: 16933 if not arg0.__class__ is space: 16934 arg0 = space(arg0) 16935 except: 16936 raise 16937 ctx = arg0.ctx 16938 res = isl.isl_space_domain_map_pw_multi_aff(isl.isl_space_copy(arg0.ptr)) 16939 obj = pw_multi_aff(ctx=ctx, ptr=res) 16940 return obj 16941 def domain_reverse(arg0): 16942 try: 16943 if not arg0.__class__ is space: 16944 arg0 = space(arg0) 16945 except: 16946 raise 16947 ctx = arg0.ctx 16948 res = isl.isl_space_domain_reverse(isl.isl_space_copy(arg0.ptr)) 16949 obj = space(ctx=ctx, ptr=res) 16950 return obj 16951 def domain_tuple_id(arg0): 16952 try: 16953 if not arg0.__class__ is space: 16954 arg0 = space(arg0) 16955 except: 16956 raise 16957 ctx = arg0.ctx 16958 res = isl.isl_space_get_domain_tuple_id(arg0.ptr) 16959 obj = id(ctx=ctx, ptr=res) 16960 return obj 16961 def get_domain_tuple_id(arg0): 16962 return arg0.domain_tuple_id() 16963 def drop_all_params(arg0): 16964 try: 16965 if not arg0.__class__ is space: 16966 arg0 = space(arg0) 16967 except: 16968 raise 16969 ctx = arg0.ctx 16970 res = isl.isl_space_drop_all_params(isl.isl_space_copy(arg0.ptr)) 16971 obj = space(ctx=ctx, ptr=res) 16972 return obj 16973 def flatten_domain(arg0): 16974 try: 16975 if not arg0.__class__ is space: 16976 arg0 = space(arg0) 16977 except: 16978 raise 16979 ctx = arg0.ctx 16980 res = isl.isl_space_flatten_domain(isl.isl_space_copy(arg0.ptr)) 16981 obj = space(ctx=ctx, ptr=res) 16982 return obj 16983 def flatten_range(arg0): 16984 try: 16985 if not arg0.__class__ is space: 16986 arg0 = space(arg0) 16987 except: 16988 raise 16989 ctx = arg0.ctx 16990 res = isl.isl_space_flatten_range(isl.isl_space_copy(arg0.ptr)) 16991 obj = space(ctx=ctx, ptr=res) 16992 return obj 16993 def has_domain_tuple_id(arg0): 16994 try: 16995 if not arg0.__class__ is space: 16996 arg0 = space(arg0) 16997 except: 16998 raise 16999 ctx = arg0.ctx 17000 res = isl.isl_space_has_domain_tuple_id(arg0.ptr) 17001 if res < 0: 17002 raise Error 17003 return bool(res) 17004 def has_range_tuple_id(arg0): 17005 try: 17006 if not arg0.__class__ is space: 17007 arg0 = space(arg0) 17008 except: 17009 raise 17010 ctx = arg0.ctx 17011 res = isl.isl_space_has_range_tuple_id(arg0.ptr) 17012 if res < 0: 17013 raise Error 17014 return bool(res) 17015 def identity_multi_aff_on_domain(arg0): 17016 try: 17017 if not arg0.__class__ is space: 17018 arg0 = space(arg0) 17019 except: 17020 raise 17021 ctx = arg0.ctx 17022 res = isl.isl_space_identity_multi_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 17023 obj = multi_aff(ctx=ctx, ptr=res) 17024 return obj 17025 def identity_multi_pw_aff_on_domain(arg0): 17026 try: 17027 if not arg0.__class__ is space: 17028 arg0 = space(arg0) 17029 except: 17030 raise 17031 ctx = arg0.ctx 17032 res = isl.isl_space_identity_multi_pw_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 17033 obj = multi_pw_aff(ctx=ctx, ptr=res) 17034 return obj 17035 def identity_pw_multi_aff_on_domain(arg0): 17036 try: 17037 if not arg0.__class__ is space: 17038 arg0 = space(arg0) 17039 except: 17040 raise 17041 ctx = arg0.ctx 17042 res = isl.isl_space_identity_pw_multi_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 17043 obj = pw_multi_aff(ctx=ctx, ptr=res) 17044 return obj 17045 def is_equal(arg0, arg1): 17046 try: 17047 if not arg0.__class__ is space: 17048 arg0 = space(arg0) 17049 except: 17050 raise 17051 try: 17052 if not arg1.__class__ is space: 17053 arg1 = space(arg1) 17054 except: 17055 raise 17056 ctx = arg0.ctx 17057 res = isl.isl_space_is_equal(arg0.ptr, arg1.ptr) 17058 if res < 0: 17059 raise Error 17060 return bool(res) 17061 def is_wrapping(arg0): 17062 try: 17063 if not arg0.__class__ is space: 17064 arg0 = space(arg0) 17065 except: 17066 raise 17067 ctx = arg0.ctx 17068 res = isl.isl_space_is_wrapping(arg0.ptr) 17069 if res < 0: 17070 raise Error 17071 return bool(res) 17072 def map_from_set(arg0): 17073 try: 17074 if not arg0.__class__ is space: 17075 arg0 = space(arg0) 17076 except: 17077 raise 17078 ctx = arg0.ctx 17079 res = isl.isl_space_map_from_set(isl.isl_space_copy(arg0.ptr)) 17080 obj = space(ctx=ctx, ptr=res) 17081 return obj 17082 def multi_aff(arg0, arg1): 17083 try: 17084 if not arg0.__class__ is space: 17085 arg0 = space(arg0) 17086 except: 17087 raise 17088 try: 17089 if not arg1.__class__ is aff_list: 17090 arg1 = aff_list(arg1) 17091 except: 17092 raise 17093 ctx = arg0.ctx 17094 res = isl.isl_space_multi_aff(isl.isl_space_copy(arg0.ptr), isl.isl_aff_list_copy(arg1.ptr)) 17095 obj = multi_aff(ctx=ctx, ptr=res) 17096 return obj 17097 def multi_aff_on_domain(*args): 17098 if len(args) == 2 and args[1].__class__ is multi_val: 17099 args = list(args) 17100 try: 17101 if not args[0].__class__ is space: 17102 args[0] = space(args[0]) 17103 except: 17104 raise 17105 ctx = args[0].ctx 17106 res = isl.isl_space_multi_aff_on_domain_multi_val(isl.isl_space_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 17107 obj = multi_aff(ctx=ctx, ptr=res) 17108 return obj 17109 raise Error 17110 def multi_id(arg0, arg1): 17111 try: 17112 if not arg0.__class__ is space: 17113 arg0 = space(arg0) 17114 except: 17115 raise 17116 try: 17117 if not arg1.__class__ is id_list: 17118 arg1 = id_list(arg1) 17119 except: 17120 raise 17121 ctx = arg0.ctx 17122 res = isl.isl_space_multi_id(isl.isl_space_copy(arg0.ptr), isl.isl_id_list_copy(arg1.ptr)) 17123 obj = multi_id(ctx=ctx, ptr=res) 17124 return obj 17125 def multi_pw_aff(arg0, arg1): 17126 try: 17127 if not arg0.__class__ is space: 17128 arg0 = space(arg0) 17129 except: 17130 raise 17131 try: 17132 if not arg1.__class__ is pw_aff_list: 17133 arg1 = pw_aff_list(arg1) 17134 except: 17135 raise 17136 ctx = arg0.ctx 17137 res = isl.isl_space_multi_pw_aff(isl.isl_space_copy(arg0.ptr), isl.isl_pw_aff_list_copy(arg1.ptr)) 17138 obj = multi_pw_aff(ctx=ctx, ptr=res) 17139 return obj 17140 def multi_union_pw_aff(arg0, arg1): 17141 try: 17142 if not arg0.__class__ is space: 17143 arg0 = space(arg0) 17144 except: 17145 raise 17146 try: 17147 if not arg1.__class__ is union_pw_aff_list: 17148 arg1 = union_pw_aff_list(arg1) 17149 except: 17150 raise 17151 ctx = arg0.ctx 17152 res = isl.isl_space_multi_union_pw_aff(isl.isl_space_copy(arg0.ptr), isl.isl_union_pw_aff_list_copy(arg1.ptr)) 17153 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 17154 return obj 17155 def multi_val(arg0, arg1): 17156 try: 17157 if not arg0.__class__ is space: 17158 arg0 = space(arg0) 17159 except: 17160 raise 17161 try: 17162 if not arg1.__class__ is val_list: 17163 arg1 = val_list(arg1) 17164 except: 17165 raise 17166 ctx = arg0.ctx 17167 res = isl.isl_space_multi_val(isl.isl_space_copy(arg0.ptr), isl.isl_val_list_copy(arg1.ptr)) 17168 obj = multi_val(ctx=ctx, ptr=res) 17169 return obj 17170 def param_aff_on_domain(*args): 17171 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 17172 args = list(args) 17173 try: 17174 if not args[0].__class__ is space: 17175 args[0] = space(args[0]) 17176 except: 17177 raise 17178 try: 17179 if not args[1].__class__ is id: 17180 args[1] = id(args[1]) 17181 except: 17182 raise 17183 ctx = args[0].ctx 17184 res = isl.isl_space_param_aff_on_domain_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 17185 obj = aff(ctx=ctx, ptr=res) 17186 return obj 17187 raise Error 17188 def params(arg0): 17189 try: 17190 if not arg0.__class__ is space: 17191 arg0 = space(arg0) 17192 except: 17193 raise 17194 ctx = arg0.ctx 17195 res = isl.isl_space_params(isl.isl_space_copy(arg0.ptr)) 17196 obj = space(ctx=ctx, ptr=res) 17197 return obj 17198 def product(arg0, arg1): 17199 try: 17200 if not arg0.__class__ is space: 17201 arg0 = space(arg0) 17202 except: 17203 raise 17204 try: 17205 if not arg1.__class__ is space: 17206 arg1 = space(arg1) 17207 except: 17208 raise 17209 ctx = arg0.ctx 17210 res = isl.isl_space_product(isl.isl_space_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 17211 obj = space(ctx=ctx, ptr=res) 17212 return obj 17213 def range(arg0): 17214 try: 17215 if not arg0.__class__ is space: 17216 arg0 = space(arg0) 17217 except: 17218 raise 17219 ctx = arg0.ctx 17220 res = isl.isl_space_range(isl.isl_space_copy(arg0.ptr)) 17221 obj = space(ctx=ctx, ptr=res) 17222 return obj 17223 def range_map_multi_aff(arg0): 17224 try: 17225 if not arg0.__class__ is space: 17226 arg0 = space(arg0) 17227 except: 17228 raise 17229 ctx = arg0.ctx 17230 res = isl.isl_space_range_map_multi_aff(isl.isl_space_copy(arg0.ptr)) 17231 obj = multi_aff(ctx=ctx, ptr=res) 17232 return obj 17233 def range_map_pw_multi_aff(arg0): 17234 try: 17235 if not arg0.__class__ is space: 17236 arg0 = space(arg0) 17237 except: 17238 raise 17239 ctx = arg0.ctx 17240 res = isl.isl_space_range_map_pw_multi_aff(isl.isl_space_copy(arg0.ptr)) 17241 obj = pw_multi_aff(ctx=ctx, ptr=res) 17242 return obj 17243 def range_reverse(arg0): 17244 try: 17245 if not arg0.__class__ is space: 17246 arg0 = space(arg0) 17247 except: 17248 raise 17249 ctx = arg0.ctx 17250 res = isl.isl_space_range_reverse(isl.isl_space_copy(arg0.ptr)) 17251 obj = space(ctx=ctx, ptr=res) 17252 return obj 17253 def range_tuple_id(arg0): 17254 try: 17255 if not arg0.__class__ is space: 17256 arg0 = space(arg0) 17257 except: 17258 raise 17259 ctx = arg0.ctx 17260 res = isl.isl_space_get_range_tuple_id(arg0.ptr) 17261 obj = id(ctx=ctx, ptr=res) 17262 return obj 17263 def get_range_tuple_id(arg0): 17264 return arg0.range_tuple_id() 17265 def reverse(arg0): 17266 try: 17267 if not arg0.__class__ is space: 17268 arg0 = space(arg0) 17269 except: 17270 raise 17271 ctx = arg0.ctx 17272 res = isl.isl_space_reverse(isl.isl_space_copy(arg0.ptr)) 17273 obj = space(ctx=ctx, ptr=res) 17274 return obj 17275 def set_domain_tuple(*args): 17276 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 17277 args = list(args) 17278 try: 17279 if not args[0].__class__ is space: 17280 args[0] = space(args[0]) 17281 except: 17282 raise 17283 try: 17284 if not args[1].__class__ is id: 17285 args[1] = id(args[1]) 17286 except: 17287 raise 17288 ctx = args[0].ctx 17289 res = isl.isl_space_set_domain_tuple_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 17290 obj = space(ctx=ctx, ptr=res) 17291 return obj 17292 raise Error 17293 def set_range_tuple(*args): 17294 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 17295 args = list(args) 17296 try: 17297 if not args[0].__class__ is space: 17298 args[0] = space(args[0]) 17299 except: 17300 raise 17301 try: 17302 if not args[1].__class__ is id: 17303 args[1] = id(args[1]) 17304 except: 17305 raise 17306 ctx = args[0].ctx 17307 res = isl.isl_space_set_range_tuple_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 17308 obj = space(ctx=ctx, ptr=res) 17309 return obj 17310 raise Error 17311 def uncurry(arg0): 17312 try: 17313 if not arg0.__class__ is space: 17314 arg0 = space(arg0) 17315 except: 17316 raise 17317 ctx = arg0.ctx 17318 res = isl.isl_space_uncurry(isl.isl_space_copy(arg0.ptr)) 17319 obj = space(ctx=ctx, ptr=res) 17320 return obj 17321 @staticmethod 17322 def unit(): 17323 ctx = Context.getDefaultInstance() 17324 res = isl.isl_space_unit(ctx) 17325 obj = space(ctx=ctx, ptr=res) 17326 return obj 17327 def universe_map(arg0): 17328 try: 17329 if not arg0.__class__ is space: 17330 arg0 = space(arg0) 17331 except: 17332 raise 17333 ctx = arg0.ctx 17334 res = isl.isl_space_universe_map(isl.isl_space_copy(arg0.ptr)) 17335 obj = map(ctx=ctx, ptr=res) 17336 return obj 17337 def universe_set(arg0): 17338 try: 17339 if not arg0.__class__ is space: 17340 arg0 = space(arg0) 17341 except: 17342 raise 17343 ctx = arg0.ctx 17344 res = isl.isl_space_universe_set(isl.isl_space_copy(arg0.ptr)) 17345 obj = set(ctx=ctx, ptr=res) 17346 return obj 17347 def unwrap(arg0): 17348 try: 17349 if not arg0.__class__ is space: 17350 arg0 = space(arg0) 17351 except: 17352 raise 17353 ctx = arg0.ctx 17354 res = isl.isl_space_unwrap(isl.isl_space_copy(arg0.ptr)) 17355 obj = space(ctx=ctx, ptr=res) 17356 return obj 17357 def wrap(arg0): 17358 try: 17359 if not arg0.__class__ is space: 17360 arg0 = space(arg0) 17361 except: 17362 raise 17363 ctx = arg0.ctx 17364 res = isl.isl_space_wrap(isl.isl_space_copy(arg0.ptr)) 17365 obj = space(ctx=ctx, ptr=res) 17366 return obj 17367 def wrapped_reverse(arg0): 17368 try: 17369 if not arg0.__class__ is space: 17370 arg0 = space(arg0) 17371 except: 17372 raise 17373 ctx = arg0.ctx 17374 res = isl.isl_space_wrapped_reverse(isl.isl_space_copy(arg0.ptr)) 17375 obj = space(ctx=ctx, ptr=res) 17376 return obj 17377 def zero_aff_on_domain(arg0): 17378 try: 17379 if not arg0.__class__ is space: 17380 arg0 = space(arg0) 17381 except: 17382 raise 17383 ctx = arg0.ctx 17384 res = isl.isl_space_zero_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 17385 obj = aff(ctx=ctx, ptr=res) 17386 return obj 17387 def zero_multi_aff(arg0): 17388 try: 17389 if not arg0.__class__ is space: 17390 arg0 = space(arg0) 17391 except: 17392 raise 17393 ctx = arg0.ctx 17394 res = isl.isl_space_zero_multi_aff(isl.isl_space_copy(arg0.ptr)) 17395 obj = multi_aff(ctx=ctx, ptr=res) 17396 return obj 17397 def zero_multi_pw_aff(arg0): 17398 try: 17399 if not arg0.__class__ is space: 17400 arg0 = space(arg0) 17401 except: 17402 raise 17403 ctx = arg0.ctx 17404 res = isl.isl_space_zero_multi_pw_aff(isl.isl_space_copy(arg0.ptr)) 17405 obj = multi_pw_aff(ctx=ctx, ptr=res) 17406 return obj 17407 def zero_multi_union_pw_aff(arg0): 17408 try: 17409 if not arg0.__class__ is space: 17410 arg0 = space(arg0) 17411 except: 17412 raise 17413 ctx = arg0.ctx 17414 res = isl.isl_space_zero_multi_union_pw_aff(isl.isl_space_copy(arg0.ptr)) 17415 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 17416 return obj 17417 def zero_multi_val(arg0): 17418 try: 17419 if not arg0.__class__ is space: 17420 arg0 = space(arg0) 17421 except: 17422 raise 17423 ctx = arg0.ctx 17424 res = isl.isl_space_zero_multi_val(isl.isl_space_copy(arg0.ptr)) 17425 obj = multi_val(ctx=ctx, ptr=res) 17426 return obj 17427 17428isl.isl_space_read_from_str.restype = c_void_p 17429isl.isl_space_read_from_str.argtypes = [Context, c_char_p] 17430isl.isl_space_add_named_tuple_id_ui.restype = c_void_p 17431isl.isl_space_add_named_tuple_id_ui.argtypes = [c_void_p, c_void_p, c_int] 17432isl.isl_space_add_param_id.restype = c_void_p 17433isl.isl_space_add_param_id.argtypes = [c_void_p, c_void_p] 17434isl.isl_space_add_unnamed_tuple_ui.restype = c_void_p 17435isl.isl_space_add_unnamed_tuple_ui.argtypes = [c_void_p, c_int] 17436isl.isl_space_curry.restype = c_void_p 17437isl.isl_space_curry.argtypes = [c_void_p] 17438isl.isl_space_domain.restype = c_void_p 17439isl.isl_space_domain.argtypes = [c_void_p] 17440isl.isl_space_domain_map_multi_aff.restype = c_void_p 17441isl.isl_space_domain_map_multi_aff.argtypes = [c_void_p] 17442isl.isl_space_domain_map_pw_multi_aff.restype = c_void_p 17443isl.isl_space_domain_map_pw_multi_aff.argtypes = [c_void_p] 17444isl.isl_space_domain_reverse.restype = c_void_p 17445isl.isl_space_domain_reverse.argtypes = [c_void_p] 17446isl.isl_space_get_domain_tuple_id.restype = c_void_p 17447isl.isl_space_get_domain_tuple_id.argtypes = [c_void_p] 17448isl.isl_space_drop_all_params.restype = c_void_p 17449isl.isl_space_drop_all_params.argtypes = [c_void_p] 17450isl.isl_space_flatten_domain.restype = c_void_p 17451isl.isl_space_flatten_domain.argtypes = [c_void_p] 17452isl.isl_space_flatten_range.restype = c_void_p 17453isl.isl_space_flatten_range.argtypes = [c_void_p] 17454isl.isl_space_has_domain_tuple_id.argtypes = [c_void_p] 17455isl.isl_space_has_range_tuple_id.argtypes = [c_void_p] 17456isl.isl_space_identity_multi_aff_on_domain.restype = c_void_p 17457isl.isl_space_identity_multi_aff_on_domain.argtypes = [c_void_p] 17458isl.isl_space_identity_multi_pw_aff_on_domain.restype = c_void_p 17459isl.isl_space_identity_multi_pw_aff_on_domain.argtypes = [c_void_p] 17460isl.isl_space_identity_pw_multi_aff_on_domain.restype = c_void_p 17461isl.isl_space_identity_pw_multi_aff_on_domain.argtypes = [c_void_p] 17462isl.isl_space_is_equal.argtypes = [c_void_p, c_void_p] 17463isl.isl_space_is_wrapping.argtypes = [c_void_p] 17464isl.isl_space_map_from_set.restype = c_void_p 17465isl.isl_space_map_from_set.argtypes = [c_void_p] 17466isl.isl_space_multi_aff.restype = c_void_p 17467isl.isl_space_multi_aff.argtypes = [c_void_p, c_void_p] 17468isl.isl_space_multi_aff_on_domain_multi_val.restype = c_void_p 17469isl.isl_space_multi_aff_on_domain_multi_val.argtypes = [c_void_p, c_void_p] 17470isl.isl_space_multi_id.restype = c_void_p 17471isl.isl_space_multi_id.argtypes = [c_void_p, c_void_p] 17472isl.isl_space_multi_pw_aff.restype = c_void_p 17473isl.isl_space_multi_pw_aff.argtypes = [c_void_p, c_void_p] 17474isl.isl_space_multi_union_pw_aff.restype = c_void_p 17475isl.isl_space_multi_union_pw_aff.argtypes = [c_void_p, c_void_p] 17476isl.isl_space_multi_val.restype = c_void_p 17477isl.isl_space_multi_val.argtypes = [c_void_p, c_void_p] 17478isl.isl_space_param_aff_on_domain_id.restype = c_void_p 17479isl.isl_space_param_aff_on_domain_id.argtypes = [c_void_p, c_void_p] 17480isl.isl_space_params.restype = c_void_p 17481isl.isl_space_params.argtypes = [c_void_p] 17482isl.isl_space_product.restype = c_void_p 17483isl.isl_space_product.argtypes = [c_void_p, c_void_p] 17484isl.isl_space_range.restype = c_void_p 17485isl.isl_space_range.argtypes = [c_void_p] 17486isl.isl_space_range_map_multi_aff.restype = c_void_p 17487isl.isl_space_range_map_multi_aff.argtypes = [c_void_p] 17488isl.isl_space_range_map_pw_multi_aff.restype = c_void_p 17489isl.isl_space_range_map_pw_multi_aff.argtypes = [c_void_p] 17490isl.isl_space_range_reverse.restype = c_void_p 17491isl.isl_space_range_reverse.argtypes = [c_void_p] 17492isl.isl_space_get_range_tuple_id.restype = c_void_p 17493isl.isl_space_get_range_tuple_id.argtypes = [c_void_p] 17494isl.isl_space_reverse.restype = c_void_p 17495isl.isl_space_reverse.argtypes = [c_void_p] 17496isl.isl_space_set_domain_tuple_id.restype = c_void_p 17497isl.isl_space_set_domain_tuple_id.argtypes = [c_void_p, c_void_p] 17498isl.isl_space_set_range_tuple_id.restype = c_void_p 17499isl.isl_space_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 17500isl.isl_space_uncurry.restype = c_void_p 17501isl.isl_space_uncurry.argtypes = [c_void_p] 17502isl.isl_space_unit.restype = c_void_p 17503isl.isl_space_unit.argtypes = [Context] 17504isl.isl_space_universe_map.restype = c_void_p 17505isl.isl_space_universe_map.argtypes = [c_void_p] 17506isl.isl_space_universe_set.restype = c_void_p 17507isl.isl_space_universe_set.argtypes = [c_void_p] 17508isl.isl_space_unwrap.restype = c_void_p 17509isl.isl_space_unwrap.argtypes = [c_void_p] 17510isl.isl_space_wrap.restype = c_void_p 17511isl.isl_space_wrap.argtypes = [c_void_p] 17512isl.isl_space_wrapped_reverse.restype = c_void_p 17513isl.isl_space_wrapped_reverse.argtypes = [c_void_p] 17514isl.isl_space_zero_aff_on_domain.restype = c_void_p 17515isl.isl_space_zero_aff_on_domain.argtypes = [c_void_p] 17516isl.isl_space_zero_multi_aff.restype = c_void_p 17517isl.isl_space_zero_multi_aff.argtypes = [c_void_p] 17518isl.isl_space_zero_multi_pw_aff.restype = c_void_p 17519isl.isl_space_zero_multi_pw_aff.argtypes = [c_void_p] 17520isl.isl_space_zero_multi_union_pw_aff.restype = c_void_p 17521isl.isl_space_zero_multi_union_pw_aff.argtypes = [c_void_p] 17522isl.isl_space_zero_multi_val.restype = c_void_p 17523isl.isl_space_zero_multi_val.argtypes = [c_void_p] 17524isl.isl_space_copy.restype = c_void_p 17525isl.isl_space_copy.argtypes = [c_void_p] 17526isl.isl_space_free.restype = c_void_p 17527isl.isl_space_free.argtypes = [c_void_p] 17528isl.isl_space_to_str.restype = POINTER(c_char) 17529isl.isl_space_to_str.argtypes = [c_void_p] 17530 17531class union_access_info(object): 17532 def __init__(self, *args, **keywords): 17533 if "ptr" in keywords: 17534 self.ctx = keywords["ctx"] 17535 self.ptr = keywords["ptr"] 17536 return 17537 if len(args) == 1 and args[0].__class__ is union_map: 17538 self.ctx = Context.getDefaultInstance() 17539 self.ptr = isl.isl_union_access_info_from_sink(isl.isl_union_map_copy(args[0].ptr)) 17540 return 17541 raise Error 17542 def __del__(self): 17543 if hasattr(self, 'ptr'): 17544 isl.isl_union_access_info_free(self.ptr) 17545 def __str__(arg0): 17546 try: 17547 if not arg0.__class__ is union_access_info: 17548 arg0 = union_access_info(arg0) 17549 except: 17550 raise 17551 ptr = isl.isl_union_access_info_to_str(arg0.ptr) 17552 res = cast(ptr, c_char_p).value.decode('ascii') 17553 libc.free(ptr) 17554 return res 17555 def __repr__(self): 17556 s = str(self) 17557 if '"' in s: 17558 return 'isl.union_access_info("""%s""")' % s 17559 else: 17560 return 'isl.union_access_info("%s")' % s 17561 def compute_flow(arg0): 17562 try: 17563 if not arg0.__class__ is union_access_info: 17564 arg0 = union_access_info(arg0) 17565 except: 17566 raise 17567 ctx = arg0.ctx 17568 res = isl.isl_union_access_info_compute_flow(isl.isl_union_access_info_copy(arg0.ptr)) 17569 obj = union_flow(ctx=ctx, ptr=res) 17570 return obj 17571 def set_kill(arg0, arg1): 17572 try: 17573 if not arg0.__class__ is union_access_info: 17574 arg0 = union_access_info(arg0) 17575 except: 17576 raise 17577 try: 17578 if not arg1.__class__ is union_map: 17579 arg1 = union_map(arg1) 17580 except: 17581 raise 17582 ctx = arg0.ctx 17583 res = isl.isl_union_access_info_set_kill(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 17584 obj = union_access_info(ctx=ctx, ptr=res) 17585 return obj 17586 def set_may_source(arg0, arg1): 17587 try: 17588 if not arg0.__class__ is union_access_info: 17589 arg0 = union_access_info(arg0) 17590 except: 17591 raise 17592 try: 17593 if not arg1.__class__ is union_map: 17594 arg1 = union_map(arg1) 17595 except: 17596 raise 17597 ctx = arg0.ctx 17598 res = isl.isl_union_access_info_set_may_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 17599 obj = union_access_info(ctx=ctx, ptr=res) 17600 return obj 17601 def set_must_source(arg0, arg1): 17602 try: 17603 if not arg0.__class__ is union_access_info: 17604 arg0 = union_access_info(arg0) 17605 except: 17606 raise 17607 try: 17608 if not arg1.__class__ is union_map: 17609 arg1 = union_map(arg1) 17610 except: 17611 raise 17612 ctx = arg0.ctx 17613 res = isl.isl_union_access_info_set_must_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 17614 obj = union_access_info(ctx=ctx, ptr=res) 17615 return obj 17616 def set_schedule(arg0, arg1): 17617 try: 17618 if not arg0.__class__ is union_access_info: 17619 arg0 = union_access_info(arg0) 17620 except: 17621 raise 17622 try: 17623 if not arg1.__class__ is schedule: 17624 arg1 = schedule(arg1) 17625 except: 17626 raise 17627 ctx = arg0.ctx 17628 res = isl.isl_union_access_info_set_schedule(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_schedule_copy(arg1.ptr)) 17629 obj = union_access_info(ctx=ctx, ptr=res) 17630 return obj 17631 def set_schedule_map(arg0, arg1): 17632 try: 17633 if not arg0.__class__ is union_access_info: 17634 arg0 = union_access_info(arg0) 17635 except: 17636 raise 17637 try: 17638 if not arg1.__class__ is union_map: 17639 arg1 = union_map(arg1) 17640 except: 17641 raise 17642 ctx = arg0.ctx 17643 res = isl.isl_union_access_info_set_schedule_map(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 17644 obj = union_access_info(ctx=ctx, ptr=res) 17645 return obj 17646 17647isl.isl_union_access_info_from_sink.restype = c_void_p 17648isl.isl_union_access_info_from_sink.argtypes = [c_void_p] 17649isl.isl_union_access_info_compute_flow.restype = c_void_p 17650isl.isl_union_access_info_compute_flow.argtypes = [c_void_p] 17651isl.isl_union_access_info_set_kill.restype = c_void_p 17652isl.isl_union_access_info_set_kill.argtypes = [c_void_p, c_void_p] 17653isl.isl_union_access_info_set_may_source.restype = c_void_p 17654isl.isl_union_access_info_set_may_source.argtypes = [c_void_p, c_void_p] 17655isl.isl_union_access_info_set_must_source.restype = c_void_p 17656isl.isl_union_access_info_set_must_source.argtypes = [c_void_p, c_void_p] 17657isl.isl_union_access_info_set_schedule.restype = c_void_p 17658isl.isl_union_access_info_set_schedule.argtypes = [c_void_p, c_void_p] 17659isl.isl_union_access_info_set_schedule_map.restype = c_void_p 17660isl.isl_union_access_info_set_schedule_map.argtypes = [c_void_p, c_void_p] 17661isl.isl_union_access_info_copy.restype = c_void_p 17662isl.isl_union_access_info_copy.argtypes = [c_void_p] 17663isl.isl_union_access_info_free.restype = c_void_p 17664isl.isl_union_access_info_free.argtypes = [c_void_p] 17665isl.isl_union_access_info_to_str.restype = POINTER(c_char) 17666isl.isl_union_access_info_to_str.argtypes = [c_void_p] 17667 17668class union_flow(object): 17669 def __init__(self, *args, **keywords): 17670 if "ptr" in keywords: 17671 self.ctx = keywords["ctx"] 17672 self.ptr = keywords["ptr"] 17673 return 17674 raise Error 17675 def __del__(self): 17676 if hasattr(self, 'ptr'): 17677 isl.isl_union_flow_free(self.ptr) 17678 def __str__(arg0): 17679 try: 17680 if not arg0.__class__ is union_flow: 17681 arg0 = union_flow(arg0) 17682 except: 17683 raise 17684 ptr = isl.isl_union_flow_to_str(arg0.ptr) 17685 res = cast(ptr, c_char_p).value.decode('ascii') 17686 libc.free(ptr) 17687 return res 17688 def __repr__(self): 17689 s = str(self) 17690 if '"' in s: 17691 return 'isl.union_flow("""%s""")' % s 17692 else: 17693 return 'isl.union_flow("%s")' % s 17694 def full_may_dependence(arg0): 17695 try: 17696 if not arg0.__class__ is union_flow: 17697 arg0 = union_flow(arg0) 17698 except: 17699 raise 17700 ctx = arg0.ctx 17701 res = isl.isl_union_flow_get_full_may_dependence(arg0.ptr) 17702 obj = union_map(ctx=ctx, ptr=res) 17703 return obj 17704 def get_full_may_dependence(arg0): 17705 return arg0.full_may_dependence() 17706 def full_must_dependence(arg0): 17707 try: 17708 if not arg0.__class__ is union_flow: 17709 arg0 = union_flow(arg0) 17710 except: 17711 raise 17712 ctx = arg0.ctx 17713 res = isl.isl_union_flow_get_full_must_dependence(arg0.ptr) 17714 obj = union_map(ctx=ctx, ptr=res) 17715 return obj 17716 def get_full_must_dependence(arg0): 17717 return arg0.full_must_dependence() 17718 def may_dependence(arg0): 17719 try: 17720 if not arg0.__class__ is union_flow: 17721 arg0 = union_flow(arg0) 17722 except: 17723 raise 17724 ctx = arg0.ctx 17725 res = isl.isl_union_flow_get_may_dependence(arg0.ptr) 17726 obj = union_map(ctx=ctx, ptr=res) 17727 return obj 17728 def get_may_dependence(arg0): 17729 return arg0.may_dependence() 17730 def may_no_source(arg0): 17731 try: 17732 if not arg0.__class__ is union_flow: 17733 arg0 = union_flow(arg0) 17734 except: 17735 raise 17736 ctx = arg0.ctx 17737 res = isl.isl_union_flow_get_may_no_source(arg0.ptr) 17738 obj = union_map(ctx=ctx, ptr=res) 17739 return obj 17740 def get_may_no_source(arg0): 17741 return arg0.may_no_source() 17742 def must_dependence(arg0): 17743 try: 17744 if not arg0.__class__ is union_flow: 17745 arg0 = union_flow(arg0) 17746 except: 17747 raise 17748 ctx = arg0.ctx 17749 res = isl.isl_union_flow_get_must_dependence(arg0.ptr) 17750 obj = union_map(ctx=ctx, ptr=res) 17751 return obj 17752 def get_must_dependence(arg0): 17753 return arg0.must_dependence() 17754 def must_no_source(arg0): 17755 try: 17756 if not arg0.__class__ is union_flow: 17757 arg0 = union_flow(arg0) 17758 except: 17759 raise 17760 ctx = arg0.ctx 17761 res = isl.isl_union_flow_get_must_no_source(arg0.ptr) 17762 obj = union_map(ctx=ctx, ptr=res) 17763 return obj 17764 def get_must_no_source(arg0): 17765 return arg0.must_no_source() 17766 17767isl.isl_union_flow_get_full_may_dependence.restype = c_void_p 17768isl.isl_union_flow_get_full_may_dependence.argtypes = [c_void_p] 17769isl.isl_union_flow_get_full_must_dependence.restype = c_void_p 17770isl.isl_union_flow_get_full_must_dependence.argtypes = [c_void_p] 17771isl.isl_union_flow_get_may_dependence.restype = c_void_p 17772isl.isl_union_flow_get_may_dependence.argtypes = [c_void_p] 17773isl.isl_union_flow_get_may_no_source.restype = c_void_p 17774isl.isl_union_flow_get_may_no_source.argtypes = [c_void_p] 17775isl.isl_union_flow_get_must_dependence.restype = c_void_p 17776isl.isl_union_flow_get_must_dependence.argtypes = [c_void_p] 17777isl.isl_union_flow_get_must_no_source.restype = c_void_p 17778isl.isl_union_flow_get_must_no_source.argtypes = [c_void_p] 17779isl.isl_union_flow_copy.restype = c_void_p 17780isl.isl_union_flow_copy.argtypes = [c_void_p] 17781isl.isl_union_flow_free.restype = c_void_p 17782isl.isl_union_flow_free.argtypes = [c_void_p] 17783isl.isl_union_flow_to_str.restype = POINTER(c_char) 17784isl.isl_union_flow_to_str.argtypes = [c_void_p] 17785 17786class union_pw_aff_list(object): 17787 def __init__(self, *args, **keywords): 17788 if "ptr" in keywords: 17789 self.ctx = keywords["ctx"] 17790 self.ptr = keywords["ptr"] 17791 return 17792 if len(args) == 1 and type(args[0]) == int: 17793 self.ctx = Context.getDefaultInstance() 17794 self.ptr = isl.isl_union_pw_aff_list_alloc(self.ctx, args[0]) 17795 return 17796 if len(args) == 1 and args[0].__class__ is union_pw_aff: 17797 self.ctx = Context.getDefaultInstance() 17798 self.ptr = isl.isl_union_pw_aff_list_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 17799 return 17800 if len(args) == 1 and type(args[0]) == str: 17801 self.ctx = Context.getDefaultInstance() 17802 self.ptr = isl.isl_union_pw_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 17803 return 17804 raise Error 17805 def __del__(self): 17806 if hasattr(self, 'ptr'): 17807 isl.isl_union_pw_aff_list_free(self.ptr) 17808 def __str__(arg0): 17809 try: 17810 if not arg0.__class__ is union_pw_aff_list: 17811 arg0 = union_pw_aff_list(arg0) 17812 except: 17813 raise 17814 ptr = isl.isl_union_pw_aff_list_to_str(arg0.ptr) 17815 res = cast(ptr, c_char_p).value.decode('ascii') 17816 libc.free(ptr) 17817 return res 17818 def __repr__(self): 17819 s = str(self) 17820 if '"' in s: 17821 return 'isl.union_pw_aff_list("""%s""")' % s 17822 else: 17823 return 'isl.union_pw_aff_list("%s")' % s 17824 def add(arg0, arg1): 17825 try: 17826 if not arg0.__class__ is union_pw_aff_list: 17827 arg0 = union_pw_aff_list(arg0) 17828 except: 17829 raise 17830 try: 17831 if not arg1.__class__ is union_pw_aff: 17832 arg1 = union_pw_aff(arg1) 17833 except: 17834 raise 17835 ctx = arg0.ctx 17836 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)) 17837 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17838 return obj 17839 def at(arg0, arg1): 17840 try: 17841 if not arg0.__class__ is union_pw_aff_list: 17842 arg0 = union_pw_aff_list(arg0) 17843 except: 17844 raise 17845 ctx = arg0.ctx 17846 res = isl.isl_union_pw_aff_list_get_at(arg0.ptr, arg1) 17847 obj = union_pw_aff(ctx=ctx, ptr=res) 17848 return obj 17849 def get_at(arg0, arg1): 17850 return arg0.at(arg1) 17851 def clear(arg0): 17852 try: 17853 if not arg0.__class__ is union_pw_aff_list: 17854 arg0 = union_pw_aff_list(arg0) 17855 except: 17856 raise 17857 ctx = arg0.ctx 17858 res = isl.isl_union_pw_aff_list_clear(isl.isl_union_pw_aff_list_copy(arg0.ptr)) 17859 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17860 return obj 17861 def concat(arg0, arg1): 17862 try: 17863 if not arg0.__class__ is union_pw_aff_list: 17864 arg0 = union_pw_aff_list(arg0) 17865 except: 17866 raise 17867 try: 17868 if not arg1.__class__ is union_pw_aff_list: 17869 arg1 = union_pw_aff_list(arg1) 17870 except: 17871 raise 17872 ctx = arg0.ctx 17873 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)) 17874 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17875 return obj 17876 def drop(arg0, arg1, arg2): 17877 try: 17878 if not arg0.__class__ is union_pw_aff_list: 17879 arg0 = union_pw_aff_list(arg0) 17880 except: 17881 raise 17882 ctx = arg0.ctx 17883 res = isl.isl_union_pw_aff_list_drop(isl.isl_union_pw_aff_list_copy(arg0.ptr), arg1, arg2) 17884 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17885 return obj 17886 def foreach(arg0, arg1): 17887 try: 17888 if not arg0.__class__ is union_pw_aff_list: 17889 arg0 = union_pw_aff_list(arg0) 17890 except: 17891 raise 17892 exc_info = [None] 17893 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 17894 def cb_func(cb_arg0, cb_arg1): 17895 cb_arg0 = union_pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 17896 try: 17897 arg1(cb_arg0) 17898 except BaseException as e: 17899 exc_info[0] = e 17900 return -1 17901 return 0 17902 cb1 = fn(cb_func) 17903 ctx = arg0.ctx 17904 res = isl.isl_union_pw_aff_list_foreach(arg0.ptr, cb1, None) 17905 if exc_info[0] is not None: 17906 raise exc_info[0] 17907 if res < 0: 17908 raise Error 17909 def foreach_scc(arg0, arg1, arg2): 17910 try: 17911 if not arg0.__class__ is union_pw_aff_list: 17912 arg0 = union_pw_aff_list(arg0) 17913 except: 17914 raise 17915 exc_info = [None] 17916 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 17917 def cb_func(cb_arg0, cb_arg1, cb_arg2): 17918 cb_arg0 = union_pw_aff(ctx=arg0.ctx, ptr=isl.isl_union_pw_aff_copy(cb_arg0)) 17919 cb_arg1 = union_pw_aff(ctx=arg0.ctx, ptr=isl.isl_union_pw_aff_copy(cb_arg1)) 17920 try: 17921 res = arg1(cb_arg0, cb_arg1) 17922 except BaseException as e: 17923 exc_info[0] = e 17924 return -1 17925 return 1 if res else 0 17926 cb1 = fn(cb_func) 17927 exc_info = [None] 17928 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 17929 def cb_func(cb_arg0, cb_arg1): 17930 cb_arg0 = union_pw_aff_list(ctx=arg0.ctx, ptr=(cb_arg0)) 17931 try: 17932 arg2(cb_arg0) 17933 except BaseException as e: 17934 exc_info[0] = e 17935 return -1 17936 return 0 17937 cb2 = fn(cb_func) 17938 ctx = arg0.ctx 17939 res = isl.isl_union_pw_aff_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 17940 if exc_info[0] is not None: 17941 raise exc_info[0] 17942 if res < 0: 17943 raise Error 17944 def insert(arg0, arg1, arg2): 17945 try: 17946 if not arg0.__class__ is union_pw_aff_list: 17947 arg0 = union_pw_aff_list(arg0) 17948 except: 17949 raise 17950 try: 17951 if not arg2.__class__ is union_pw_aff: 17952 arg2 = union_pw_aff(arg2) 17953 except: 17954 raise 17955 ctx = arg0.ctx 17956 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)) 17957 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17958 return obj 17959 def set_at(arg0, arg1, arg2): 17960 try: 17961 if not arg0.__class__ is union_pw_aff_list: 17962 arg0 = union_pw_aff_list(arg0) 17963 except: 17964 raise 17965 try: 17966 if not arg2.__class__ is union_pw_aff: 17967 arg2 = union_pw_aff(arg2) 17968 except: 17969 raise 17970 ctx = arg0.ctx 17971 res = isl.isl_union_pw_aff_list_set_at(isl.isl_union_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_union_pw_aff_copy(arg2.ptr)) 17972 obj = union_pw_aff_list(ctx=ctx, ptr=res) 17973 return obj 17974 def size(arg0): 17975 try: 17976 if not arg0.__class__ is union_pw_aff_list: 17977 arg0 = union_pw_aff_list(arg0) 17978 except: 17979 raise 17980 ctx = arg0.ctx 17981 res = isl.isl_union_pw_aff_list_size(arg0.ptr) 17982 if res < 0: 17983 raise Error 17984 return int(res) 17985 17986isl.isl_union_pw_aff_list_alloc.restype = c_void_p 17987isl.isl_union_pw_aff_list_alloc.argtypes = [Context, c_int] 17988isl.isl_union_pw_aff_list_from_union_pw_aff.restype = c_void_p 17989isl.isl_union_pw_aff_list_from_union_pw_aff.argtypes = [c_void_p] 17990isl.isl_union_pw_aff_list_read_from_str.restype = c_void_p 17991isl.isl_union_pw_aff_list_read_from_str.argtypes = [Context, c_char_p] 17992isl.isl_union_pw_aff_list_add.restype = c_void_p 17993isl.isl_union_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 17994isl.isl_union_pw_aff_list_get_at.restype = c_void_p 17995isl.isl_union_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 17996isl.isl_union_pw_aff_list_clear.restype = c_void_p 17997isl.isl_union_pw_aff_list_clear.argtypes = [c_void_p] 17998isl.isl_union_pw_aff_list_concat.restype = c_void_p 17999isl.isl_union_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 18000isl.isl_union_pw_aff_list_drop.restype = c_void_p 18001isl.isl_union_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 18002isl.isl_union_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 18003isl.isl_union_pw_aff_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 18004isl.isl_union_pw_aff_list_insert.restype = c_void_p 18005isl.isl_union_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 18006isl.isl_union_pw_aff_list_set_at.restype = c_void_p 18007isl.isl_union_pw_aff_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 18008isl.isl_union_pw_aff_list_size.argtypes = [c_void_p] 18009isl.isl_union_pw_aff_list_copy.restype = c_void_p 18010isl.isl_union_pw_aff_list_copy.argtypes = [c_void_p] 18011isl.isl_union_pw_aff_list_free.restype = c_void_p 18012isl.isl_union_pw_aff_list_free.argtypes = [c_void_p] 18013isl.isl_union_pw_aff_list_to_str.restype = POINTER(c_char) 18014isl.isl_union_pw_aff_list_to_str.argtypes = [c_void_p] 18015 18016class union_set_list(object): 18017 def __init__(self, *args, **keywords): 18018 if "ptr" in keywords: 18019 self.ctx = keywords["ctx"] 18020 self.ptr = keywords["ptr"] 18021 return 18022 if len(args) == 1 and type(args[0]) == int: 18023 self.ctx = Context.getDefaultInstance() 18024 self.ptr = isl.isl_union_set_list_alloc(self.ctx, args[0]) 18025 return 18026 if len(args) == 1 and args[0].__class__ is union_set: 18027 self.ctx = Context.getDefaultInstance() 18028 self.ptr = isl.isl_union_set_list_from_union_set(isl.isl_union_set_copy(args[0].ptr)) 18029 return 18030 if len(args) == 1 and type(args[0]) == str: 18031 self.ctx = Context.getDefaultInstance() 18032 self.ptr = isl.isl_union_set_list_read_from_str(self.ctx, args[0].encode('ascii')) 18033 return 18034 raise Error 18035 def __del__(self): 18036 if hasattr(self, 'ptr'): 18037 isl.isl_union_set_list_free(self.ptr) 18038 def __str__(arg0): 18039 try: 18040 if not arg0.__class__ is union_set_list: 18041 arg0 = union_set_list(arg0) 18042 except: 18043 raise 18044 ptr = isl.isl_union_set_list_to_str(arg0.ptr) 18045 res = cast(ptr, c_char_p).value.decode('ascii') 18046 libc.free(ptr) 18047 return res 18048 def __repr__(self): 18049 s = str(self) 18050 if '"' in s: 18051 return 'isl.union_set_list("""%s""")' % s 18052 else: 18053 return 'isl.union_set_list("%s")' % s 18054 def add(arg0, arg1): 18055 try: 18056 if not arg0.__class__ is union_set_list: 18057 arg0 = union_set_list(arg0) 18058 except: 18059 raise 18060 try: 18061 if not arg1.__class__ is union_set: 18062 arg1 = union_set(arg1) 18063 except: 18064 raise 18065 ctx = arg0.ctx 18066 res = isl.isl_union_set_list_add(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 18067 obj = union_set_list(ctx=ctx, ptr=res) 18068 return obj 18069 def at(arg0, arg1): 18070 try: 18071 if not arg0.__class__ is union_set_list: 18072 arg0 = union_set_list(arg0) 18073 except: 18074 raise 18075 ctx = arg0.ctx 18076 res = isl.isl_union_set_list_get_at(arg0.ptr, arg1) 18077 obj = union_set(ctx=ctx, ptr=res) 18078 return obj 18079 def get_at(arg0, arg1): 18080 return arg0.at(arg1) 18081 def clear(arg0): 18082 try: 18083 if not arg0.__class__ is union_set_list: 18084 arg0 = union_set_list(arg0) 18085 except: 18086 raise 18087 ctx = arg0.ctx 18088 res = isl.isl_union_set_list_clear(isl.isl_union_set_list_copy(arg0.ptr)) 18089 obj = union_set_list(ctx=ctx, ptr=res) 18090 return obj 18091 def concat(arg0, arg1): 18092 try: 18093 if not arg0.__class__ is union_set_list: 18094 arg0 = union_set_list(arg0) 18095 except: 18096 raise 18097 try: 18098 if not arg1.__class__ is union_set_list: 18099 arg1 = union_set_list(arg1) 18100 except: 18101 raise 18102 ctx = arg0.ctx 18103 res = isl.isl_union_set_list_concat(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 18104 obj = union_set_list(ctx=ctx, ptr=res) 18105 return obj 18106 def drop(arg0, arg1, arg2): 18107 try: 18108 if not arg0.__class__ is union_set_list: 18109 arg0 = union_set_list(arg0) 18110 except: 18111 raise 18112 ctx = arg0.ctx 18113 res = isl.isl_union_set_list_drop(isl.isl_union_set_list_copy(arg0.ptr), arg1, arg2) 18114 obj = union_set_list(ctx=ctx, ptr=res) 18115 return obj 18116 def foreach(arg0, arg1): 18117 try: 18118 if not arg0.__class__ is union_set_list: 18119 arg0 = union_set_list(arg0) 18120 except: 18121 raise 18122 exc_info = [None] 18123 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 18124 def cb_func(cb_arg0, cb_arg1): 18125 cb_arg0 = union_set(ctx=arg0.ctx, ptr=(cb_arg0)) 18126 try: 18127 arg1(cb_arg0) 18128 except BaseException as e: 18129 exc_info[0] = e 18130 return -1 18131 return 0 18132 cb1 = fn(cb_func) 18133 ctx = arg0.ctx 18134 res = isl.isl_union_set_list_foreach(arg0.ptr, cb1, None) 18135 if exc_info[0] is not None: 18136 raise exc_info[0] 18137 if res < 0: 18138 raise Error 18139 def foreach_scc(arg0, arg1, arg2): 18140 try: 18141 if not arg0.__class__ is union_set_list: 18142 arg0 = union_set_list(arg0) 18143 except: 18144 raise 18145 exc_info = [None] 18146 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 18147 def cb_func(cb_arg0, cb_arg1, cb_arg2): 18148 cb_arg0 = union_set(ctx=arg0.ctx, ptr=isl.isl_union_set_copy(cb_arg0)) 18149 cb_arg1 = union_set(ctx=arg0.ctx, ptr=isl.isl_union_set_copy(cb_arg1)) 18150 try: 18151 res = arg1(cb_arg0, cb_arg1) 18152 except BaseException as e: 18153 exc_info[0] = e 18154 return -1 18155 return 1 if res else 0 18156 cb1 = fn(cb_func) 18157 exc_info = [None] 18158 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 18159 def cb_func(cb_arg0, cb_arg1): 18160 cb_arg0 = union_set_list(ctx=arg0.ctx, ptr=(cb_arg0)) 18161 try: 18162 arg2(cb_arg0) 18163 except BaseException as e: 18164 exc_info[0] = e 18165 return -1 18166 return 0 18167 cb2 = fn(cb_func) 18168 ctx = arg0.ctx 18169 res = isl.isl_union_set_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 18170 if exc_info[0] is not None: 18171 raise exc_info[0] 18172 if res < 0: 18173 raise Error 18174 def insert(arg0, arg1, arg2): 18175 try: 18176 if not arg0.__class__ is union_set_list: 18177 arg0 = union_set_list(arg0) 18178 except: 18179 raise 18180 try: 18181 if not arg2.__class__ is union_set: 18182 arg2 = union_set(arg2) 18183 except: 18184 raise 18185 ctx = arg0.ctx 18186 res = isl.isl_union_set_list_insert(isl.isl_union_set_list_copy(arg0.ptr), arg1, isl.isl_union_set_copy(arg2.ptr)) 18187 obj = union_set_list(ctx=ctx, ptr=res) 18188 return obj 18189 def set_at(arg0, arg1, arg2): 18190 try: 18191 if not arg0.__class__ is union_set_list: 18192 arg0 = union_set_list(arg0) 18193 except: 18194 raise 18195 try: 18196 if not arg2.__class__ is union_set: 18197 arg2 = union_set(arg2) 18198 except: 18199 raise 18200 ctx = arg0.ctx 18201 res = isl.isl_union_set_list_set_at(isl.isl_union_set_list_copy(arg0.ptr), arg1, isl.isl_union_set_copy(arg2.ptr)) 18202 obj = union_set_list(ctx=ctx, ptr=res) 18203 return obj 18204 def size(arg0): 18205 try: 18206 if not arg0.__class__ is union_set_list: 18207 arg0 = union_set_list(arg0) 18208 except: 18209 raise 18210 ctx = arg0.ctx 18211 res = isl.isl_union_set_list_size(arg0.ptr) 18212 if res < 0: 18213 raise Error 18214 return int(res) 18215 18216isl.isl_union_set_list_alloc.restype = c_void_p 18217isl.isl_union_set_list_alloc.argtypes = [Context, c_int] 18218isl.isl_union_set_list_from_union_set.restype = c_void_p 18219isl.isl_union_set_list_from_union_set.argtypes = [c_void_p] 18220isl.isl_union_set_list_read_from_str.restype = c_void_p 18221isl.isl_union_set_list_read_from_str.argtypes = [Context, c_char_p] 18222isl.isl_union_set_list_add.restype = c_void_p 18223isl.isl_union_set_list_add.argtypes = [c_void_p, c_void_p] 18224isl.isl_union_set_list_get_at.restype = c_void_p 18225isl.isl_union_set_list_get_at.argtypes = [c_void_p, c_int] 18226isl.isl_union_set_list_clear.restype = c_void_p 18227isl.isl_union_set_list_clear.argtypes = [c_void_p] 18228isl.isl_union_set_list_concat.restype = c_void_p 18229isl.isl_union_set_list_concat.argtypes = [c_void_p, c_void_p] 18230isl.isl_union_set_list_drop.restype = c_void_p 18231isl.isl_union_set_list_drop.argtypes = [c_void_p, c_int, c_int] 18232isl.isl_union_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 18233isl.isl_union_set_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 18234isl.isl_union_set_list_insert.restype = c_void_p 18235isl.isl_union_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] 18236isl.isl_union_set_list_set_at.restype = c_void_p 18237isl.isl_union_set_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 18238isl.isl_union_set_list_size.argtypes = [c_void_p] 18239isl.isl_union_set_list_copy.restype = c_void_p 18240isl.isl_union_set_list_copy.argtypes = [c_void_p] 18241isl.isl_union_set_list_free.restype = c_void_p 18242isl.isl_union_set_list_free.argtypes = [c_void_p] 18243isl.isl_union_set_list_to_str.restype = POINTER(c_char) 18244isl.isl_union_set_list_to_str.argtypes = [c_void_p] 18245 18246class val(object): 18247 def __init__(self, *args, **keywords): 18248 if "ptr" in keywords: 18249 self.ctx = keywords["ctx"] 18250 self.ptr = keywords["ptr"] 18251 return 18252 if len(args) == 1 and type(args[0]) == int: 18253 self.ctx = Context.getDefaultInstance() 18254 self.ptr = isl.isl_val_int_from_si(self.ctx, args[0]) 18255 return 18256 if len(args) == 1 and type(args[0]) == str: 18257 self.ctx = Context.getDefaultInstance() 18258 self.ptr = isl.isl_val_read_from_str(self.ctx, args[0].encode('ascii')) 18259 return 18260 raise Error 18261 def __del__(self): 18262 if hasattr(self, 'ptr'): 18263 isl.isl_val_free(self.ptr) 18264 def __str__(arg0): 18265 try: 18266 if not arg0.__class__ is val: 18267 arg0 = val(arg0) 18268 except: 18269 raise 18270 ptr = isl.isl_val_to_str(arg0.ptr) 18271 res = cast(ptr, c_char_p).value.decode('ascii') 18272 libc.free(ptr) 18273 return res 18274 def __repr__(self): 18275 s = str(self) 18276 if '"' in s: 18277 return 'isl.val("""%s""")' % s 18278 else: 18279 return 'isl.val("%s")' % s 18280 def abs(arg0): 18281 try: 18282 if not arg0.__class__ is val: 18283 arg0 = val(arg0) 18284 except: 18285 raise 18286 ctx = arg0.ctx 18287 res = isl.isl_val_abs(isl.isl_val_copy(arg0.ptr)) 18288 obj = val(ctx=ctx, ptr=res) 18289 return obj 18290 def abs_eq(arg0, arg1): 18291 try: 18292 if not arg0.__class__ is val: 18293 arg0 = val(arg0) 18294 except: 18295 raise 18296 try: 18297 if not arg1.__class__ is val: 18298 arg1 = val(arg1) 18299 except: 18300 raise 18301 ctx = arg0.ctx 18302 res = isl.isl_val_abs_eq(arg0.ptr, arg1.ptr) 18303 if res < 0: 18304 raise Error 18305 return bool(res) 18306 def add(arg0, arg1): 18307 try: 18308 if not arg0.__class__ is val: 18309 arg0 = val(arg0) 18310 except: 18311 raise 18312 try: 18313 if not arg1.__class__ is val: 18314 arg1 = val(arg1) 18315 except: 18316 raise 18317 ctx = arg0.ctx 18318 res = isl.isl_val_add(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18319 obj = val(ctx=ctx, ptr=res) 18320 return obj 18321 def ceil(arg0): 18322 try: 18323 if not arg0.__class__ is val: 18324 arg0 = val(arg0) 18325 except: 18326 raise 18327 ctx = arg0.ctx 18328 res = isl.isl_val_ceil(isl.isl_val_copy(arg0.ptr)) 18329 obj = val(ctx=ctx, ptr=res) 18330 return obj 18331 def cmp_si(arg0, arg1): 18332 try: 18333 if not arg0.__class__ is val: 18334 arg0 = val(arg0) 18335 except: 18336 raise 18337 ctx = arg0.ctx 18338 res = isl.isl_val_cmp_si(arg0.ptr, arg1) 18339 return res 18340 def den_si(arg0): 18341 try: 18342 if not arg0.__class__ is val: 18343 arg0 = val(arg0) 18344 except: 18345 raise 18346 ctx = arg0.ctx 18347 res = isl.isl_val_get_den_si(arg0.ptr) 18348 return res 18349 def get_den_si(arg0): 18350 return arg0.den_si() 18351 def div(arg0, arg1): 18352 try: 18353 if not arg0.__class__ is val: 18354 arg0 = val(arg0) 18355 except: 18356 raise 18357 try: 18358 if not arg1.__class__ is val: 18359 arg1 = val(arg1) 18360 except: 18361 raise 18362 ctx = arg0.ctx 18363 res = isl.isl_val_div(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18364 obj = val(ctx=ctx, ptr=res) 18365 return obj 18366 def eq(arg0, arg1): 18367 try: 18368 if not arg0.__class__ is val: 18369 arg0 = val(arg0) 18370 except: 18371 raise 18372 try: 18373 if not arg1.__class__ is val: 18374 arg1 = val(arg1) 18375 except: 18376 raise 18377 ctx = arg0.ctx 18378 res = isl.isl_val_eq(arg0.ptr, arg1.ptr) 18379 if res < 0: 18380 raise Error 18381 return bool(res) 18382 def floor(arg0): 18383 try: 18384 if not arg0.__class__ is val: 18385 arg0 = val(arg0) 18386 except: 18387 raise 18388 ctx = arg0.ctx 18389 res = isl.isl_val_floor(isl.isl_val_copy(arg0.ptr)) 18390 obj = val(ctx=ctx, ptr=res) 18391 return obj 18392 def gcd(arg0, arg1): 18393 try: 18394 if not arg0.__class__ is val: 18395 arg0 = val(arg0) 18396 except: 18397 raise 18398 try: 18399 if not arg1.__class__ is val: 18400 arg1 = val(arg1) 18401 except: 18402 raise 18403 ctx = arg0.ctx 18404 res = isl.isl_val_gcd(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18405 obj = val(ctx=ctx, ptr=res) 18406 return obj 18407 def ge(arg0, arg1): 18408 try: 18409 if not arg0.__class__ is val: 18410 arg0 = val(arg0) 18411 except: 18412 raise 18413 try: 18414 if not arg1.__class__ is val: 18415 arg1 = val(arg1) 18416 except: 18417 raise 18418 ctx = arg0.ctx 18419 res = isl.isl_val_ge(arg0.ptr, arg1.ptr) 18420 if res < 0: 18421 raise Error 18422 return bool(res) 18423 def gt(arg0, arg1): 18424 try: 18425 if not arg0.__class__ is val: 18426 arg0 = val(arg0) 18427 except: 18428 raise 18429 try: 18430 if not arg1.__class__ is val: 18431 arg1 = val(arg1) 18432 except: 18433 raise 18434 ctx = arg0.ctx 18435 res = isl.isl_val_gt(arg0.ptr, arg1.ptr) 18436 if res < 0: 18437 raise Error 18438 return bool(res) 18439 @staticmethod 18440 def infty(): 18441 ctx = Context.getDefaultInstance() 18442 res = isl.isl_val_infty(ctx) 18443 obj = val(ctx=ctx, ptr=res) 18444 return obj 18445 def inv(arg0): 18446 try: 18447 if not arg0.__class__ is val: 18448 arg0 = val(arg0) 18449 except: 18450 raise 18451 ctx = arg0.ctx 18452 res = isl.isl_val_inv(isl.isl_val_copy(arg0.ptr)) 18453 obj = val(ctx=ctx, ptr=res) 18454 return obj 18455 def is_divisible_by(arg0, arg1): 18456 try: 18457 if not arg0.__class__ is val: 18458 arg0 = val(arg0) 18459 except: 18460 raise 18461 try: 18462 if not arg1.__class__ is val: 18463 arg1 = val(arg1) 18464 except: 18465 raise 18466 ctx = arg0.ctx 18467 res = isl.isl_val_is_divisible_by(arg0.ptr, arg1.ptr) 18468 if res < 0: 18469 raise Error 18470 return bool(res) 18471 def is_infty(arg0): 18472 try: 18473 if not arg0.__class__ is val: 18474 arg0 = val(arg0) 18475 except: 18476 raise 18477 ctx = arg0.ctx 18478 res = isl.isl_val_is_infty(arg0.ptr) 18479 if res < 0: 18480 raise Error 18481 return bool(res) 18482 def is_int(arg0): 18483 try: 18484 if not arg0.__class__ is val: 18485 arg0 = val(arg0) 18486 except: 18487 raise 18488 ctx = arg0.ctx 18489 res = isl.isl_val_is_int(arg0.ptr) 18490 if res < 0: 18491 raise Error 18492 return bool(res) 18493 def is_nan(arg0): 18494 try: 18495 if not arg0.__class__ is val: 18496 arg0 = val(arg0) 18497 except: 18498 raise 18499 ctx = arg0.ctx 18500 res = isl.isl_val_is_nan(arg0.ptr) 18501 if res < 0: 18502 raise Error 18503 return bool(res) 18504 def is_neg(arg0): 18505 try: 18506 if not arg0.__class__ is val: 18507 arg0 = val(arg0) 18508 except: 18509 raise 18510 ctx = arg0.ctx 18511 res = isl.isl_val_is_neg(arg0.ptr) 18512 if res < 0: 18513 raise Error 18514 return bool(res) 18515 def is_neginfty(arg0): 18516 try: 18517 if not arg0.__class__ is val: 18518 arg0 = val(arg0) 18519 except: 18520 raise 18521 ctx = arg0.ctx 18522 res = isl.isl_val_is_neginfty(arg0.ptr) 18523 if res < 0: 18524 raise Error 18525 return bool(res) 18526 def is_negone(arg0): 18527 try: 18528 if not arg0.__class__ is val: 18529 arg0 = val(arg0) 18530 except: 18531 raise 18532 ctx = arg0.ctx 18533 res = isl.isl_val_is_negone(arg0.ptr) 18534 if res < 0: 18535 raise Error 18536 return bool(res) 18537 def is_nonneg(arg0): 18538 try: 18539 if not arg0.__class__ is val: 18540 arg0 = val(arg0) 18541 except: 18542 raise 18543 ctx = arg0.ctx 18544 res = isl.isl_val_is_nonneg(arg0.ptr) 18545 if res < 0: 18546 raise Error 18547 return bool(res) 18548 def is_nonpos(arg0): 18549 try: 18550 if not arg0.__class__ is val: 18551 arg0 = val(arg0) 18552 except: 18553 raise 18554 ctx = arg0.ctx 18555 res = isl.isl_val_is_nonpos(arg0.ptr) 18556 if res < 0: 18557 raise Error 18558 return bool(res) 18559 def is_one(arg0): 18560 try: 18561 if not arg0.__class__ is val: 18562 arg0 = val(arg0) 18563 except: 18564 raise 18565 ctx = arg0.ctx 18566 res = isl.isl_val_is_one(arg0.ptr) 18567 if res < 0: 18568 raise Error 18569 return bool(res) 18570 def is_pos(arg0): 18571 try: 18572 if not arg0.__class__ is val: 18573 arg0 = val(arg0) 18574 except: 18575 raise 18576 ctx = arg0.ctx 18577 res = isl.isl_val_is_pos(arg0.ptr) 18578 if res < 0: 18579 raise Error 18580 return bool(res) 18581 def is_rat(arg0): 18582 try: 18583 if not arg0.__class__ is val: 18584 arg0 = val(arg0) 18585 except: 18586 raise 18587 ctx = arg0.ctx 18588 res = isl.isl_val_is_rat(arg0.ptr) 18589 if res < 0: 18590 raise Error 18591 return bool(res) 18592 def is_zero(arg0): 18593 try: 18594 if not arg0.__class__ is val: 18595 arg0 = val(arg0) 18596 except: 18597 raise 18598 ctx = arg0.ctx 18599 res = isl.isl_val_is_zero(arg0.ptr) 18600 if res < 0: 18601 raise Error 18602 return bool(res) 18603 def le(arg0, arg1): 18604 try: 18605 if not arg0.__class__ is val: 18606 arg0 = val(arg0) 18607 except: 18608 raise 18609 try: 18610 if not arg1.__class__ is val: 18611 arg1 = val(arg1) 18612 except: 18613 raise 18614 ctx = arg0.ctx 18615 res = isl.isl_val_le(arg0.ptr, arg1.ptr) 18616 if res < 0: 18617 raise Error 18618 return bool(res) 18619 def lt(arg0, arg1): 18620 try: 18621 if not arg0.__class__ is val: 18622 arg0 = val(arg0) 18623 except: 18624 raise 18625 try: 18626 if not arg1.__class__ is val: 18627 arg1 = val(arg1) 18628 except: 18629 raise 18630 ctx = arg0.ctx 18631 res = isl.isl_val_lt(arg0.ptr, arg1.ptr) 18632 if res < 0: 18633 raise Error 18634 return bool(res) 18635 def max(arg0, arg1): 18636 try: 18637 if not arg0.__class__ is val: 18638 arg0 = val(arg0) 18639 except: 18640 raise 18641 try: 18642 if not arg1.__class__ is val: 18643 arg1 = val(arg1) 18644 except: 18645 raise 18646 ctx = arg0.ctx 18647 res = isl.isl_val_max(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18648 obj = val(ctx=ctx, ptr=res) 18649 return obj 18650 def min(arg0, arg1): 18651 try: 18652 if not arg0.__class__ is val: 18653 arg0 = val(arg0) 18654 except: 18655 raise 18656 try: 18657 if not arg1.__class__ is val: 18658 arg1 = val(arg1) 18659 except: 18660 raise 18661 ctx = arg0.ctx 18662 res = isl.isl_val_min(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18663 obj = val(ctx=ctx, ptr=res) 18664 return obj 18665 def mod(arg0, arg1): 18666 try: 18667 if not arg0.__class__ is val: 18668 arg0 = val(arg0) 18669 except: 18670 raise 18671 try: 18672 if not arg1.__class__ is val: 18673 arg1 = val(arg1) 18674 except: 18675 raise 18676 ctx = arg0.ctx 18677 res = isl.isl_val_mod(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18678 obj = val(ctx=ctx, ptr=res) 18679 return obj 18680 def mul(arg0, arg1): 18681 try: 18682 if not arg0.__class__ is val: 18683 arg0 = val(arg0) 18684 except: 18685 raise 18686 try: 18687 if not arg1.__class__ is val: 18688 arg1 = val(arg1) 18689 except: 18690 raise 18691 ctx = arg0.ctx 18692 res = isl.isl_val_mul(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18693 obj = val(ctx=ctx, ptr=res) 18694 return obj 18695 @staticmethod 18696 def nan(): 18697 ctx = Context.getDefaultInstance() 18698 res = isl.isl_val_nan(ctx) 18699 obj = val(ctx=ctx, ptr=res) 18700 return obj 18701 def ne(arg0, arg1): 18702 try: 18703 if not arg0.__class__ is val: 18704 arg0 = val(arg0) 18705 except: 18706 raise 18707 try: 18708 if not arg1.__class__ is val: 18709 arg1 = val(arg1) 18710 except: 18711 raise 18712 ctx = arg0.ctx 18713 res = isl.isl_val_ne(arg0.ptr, arg1.ptr) 18714 if res < 0: 18715 raise Error 18716 return bool(res) 18717 def neg(arg0): 18718 try: 18719 if not arg0.__class__ is val: 18720 arg0 = val(arg0) 18721 except: 18722 raise 18723 ctx = arg0.ctx 18724 res = isl.isl_val_neg(isl.isl_val_copy(arg0.ptr)) 18725 obj = val(ctx=ctx, ptr=res) 18726 return obj 18727 @staticmethod 18728 def neginfty(): 18729 ctx = Context.getDefaultInstance() 18730 res = isl.isl_val_neginfty(ctx) 18731 obj = val(ctx=ctx, ptr=res) 18732 return obj 18733 @staticmethod 18734 def negone(): 18735 ctx = Context.getDefaultInstance() 18736 res = isl.isl_val_negone(ctx) 18737 obj = val(ctx=ctx, ptr=res) 18738 return obj 18739 def num_si(arg0): 18740 try: 18741 if not arg0.__class__ is val: 18742 arg0 = val(arg0) 18743 except: 18744 raise 18745 ctx = arg0.ctx 18746 res = isl.isl_val_get_num_si(arg0.ptr) 18747 return res 18748 def get_num_si(arg0): 18749 return arg0.num_si() 18750 @staticmethod 18751 def one(): 18752 ctx = Context.getDefaultInstance() 18753 res = isl.isl_val_one(ctx) 18754 obj = val(ctx=ctx, ptr=res) 18755 return obj 18756 def pow2(arg0): 18757 try: 18758 if not arg0.__class__ is val: 18759 arg0 = val(arg0) 18760 except: 18761 raise 18762 ctx = arg0.ctx 18763 res = isl.isl_val_pow2(isl.isl_val_copy(arg0.ptr)) 18764 obj = val(ctx=ctx, ptr=res) 18765 return obj 18766 def sgn(arg0): 18767 try: 18768 if not arg0.__class__ is val: 18769 arg0 = val(arg0) 18770 except: 18771 raise 18772 ctx = arg0.ctx 18773 res = isl.isl_val_sgn(arg0.ptr) 18774 return res 18775 def sub(arg0, arg1): 18776 try: 18777 if not arg0.__class__ is val: 18778 arg0 = val(arg0) 18779 except: 18780 raise 18781 try: 18782 if not arg1.__class__ is val: 18783 arg1 = val(arg1) 18784 except: 18785 raise 18786 ctx = arg0.ctx 18787 res = isl.isl_val_sub(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18788 obj = val(ctx=ctx, ptr=res) 18789 return obj 18790 def to_list(arg0): 18791 try: 18792 if not arg0.__class__ is val: 18793 arg0 = val(arg0) 18794 except: 18795 raise 18796 ctx = arg0.ctx 18797 res = isl.isl_val_to_list(isl.isl_val_copy(arg0.ptr)) 18798 obj = val_list(ctx=ctx, ptr=res) 18799 return obj 18800 def trunc(arg0): 18801 try: 18802 if not arg0.__class__ is val: 18803 arg0 = val(arg0) 18804 except: 18805 raise 18806 ctx = arg0.ctx 18807 res = isl.isl_val_trunc(isl.isl_val_copy(arg0.ptr)) 18808 obj = val(ctx=ctx, ptr=res) 18809 return obj 18810 @staticmethod 18811 def zero(): 18812 ctx = Context.getDefaultInstance() 18813 res = isl.isl_val_zero(ctx) 18814 obj = val(ctx=ctx, ptr=res) 18815 return obj 18816 18817isl.isl_val_int_from_si.restype = c_void_p 18818isl.isl_val_int_from_si.argtypes = [Context, c_long] 18819isl.isl_val_read_from_str.restype = c_void_p 18820isl.isl_val_read_from_str.argtypes = [Context, c_char_p] 18821isl.isl_val_abs.restype = c_void_p 18822isl.isl_val_abs.argtypes = [c_void_p] 18823isl.isl_val_abs_eq.argtypes = [c_void_p, c_void_p] 18824isl.isl_val_add.restype = c_void_p 18825isl.isl_val_add.argtypes = [c_void_p, c_void_p] 18826isl.isl_val_ceil.restype = c_void_p 18827isl.isl_val_ceil.argtypes = [c_void_p] 18828isl.isl_val_cmp_si.argtypes = [c_void_p, c_long] 18829isl.isl_val_get_den_si.argtypes = [c_void_p] 18830isl.isl_val_div.restype = c_void_p 18831isl.isl_val_div.argtypes = [c_void_p, c_void_p] 18832isl.isl_val_eq.argtypes = [c_void_p, c_void_p] 18833isl.isl_val_floor.restype = c_void_p 18834isl.isl_val_floor.argtypes = [c_void_p] 18835isl.isl_val_gcd.restype = c_void_p 18836isl.isl_val_gcd.argtypes = [c_void_p, c_void_p] 18837isl.isl_val_ge.argtypes = [c_void_p, c_void_p] 18838isl.isl_val_gt.argtypes = [c_void_p, c_void_p] 18839isl.isl_val_infty.restype = c_void_p 18840isl.isl_val_infty.argtypes = [Context] 18841isl.isl_val_inv.restype = c_void_p 18842isl.isl_val_inv.argtypes = [c_void_p] 18843isl.isl_val_is_divisible_by.argtypes = [c_void_p, c_void_p] 18844isl.isl_val_is_infty.argtypes = [c_void_p] 18845isl.isl_val_is_int.argtypes = [c_void_p] 18846isl.isl_val_is_nan.argtypes = [c_void_p] 18847isl.isl_val_is_neg.argtypes = [c_void_p] 18848isl.isl_val_is_neginfty.argtypes = [c_void_p] 18849isl.isl_val_is_negone.argtypes = [c_void_p] 18850isl.isl_val_is_nonneg.argtypes = [c_void_p] 18851isl.isl_val_is_nonpos.argtypes = [c_void_p] 18852isl.isl_val_is_one.argtypes = [c_void_p] 18853isl.isl_val_is_pos.argtypes = [c_void_p] 18854isl.isl_val_is_rat.argtypes = [c_void_p] 18855isl.isl_val_is_zero.argtypes = [c_void_p] 18856isl.isl_val_le.argtypes = [c_void_p, c_void_p] 18857isl.isl_val_lt.argtypes = [c_void_p, c_void_p] 18858isl.isl_val_max.restype = c_void_p 18859isl.isl_val_max.argtypes = [c_void_p, c_void_p] 18860isl.isl_val_min.restype = c_void_p 18861isl.isl_val_min.argtypes = [c_void_p, c_void_p] 18862isl.isl_val_mod.restype = c_void_p 18863isl.isl_val_mod.argtypes = [c_void_p, c_void_p] 18864isl.isl_val_mul.restype = c_void_p 18865isl.isl_val_mul.argtypes = [c_void_p, c_void_p] 18866isl.isl_val_nan.restype = c_void_p 18867isl.isl_val_nan.argtypes = [Context] 18868isl.isl_val_ne.argtypes = [c_void_p, c_void_p] 18869isl.isl_val_neg.restype = c_void_p 18870isl.isl_val_neg.argtypes = [c_void_p] 18871isl.isl_val_neginfty.restype = c_void_p 18872isl.isl_val_neginfty.argtypes = [Context] 18873isl.isl_val_negone.restype = c_void_p 18874isl.isl_val_negone.argtypes = [Context] 18875isl.isl_val_get_num_si.argtypes = [c_void_p] 18876isl.isl_val_one.restype = c_void_p 18877isl.isl_val_one.argtypes = [Context] 18878isl.isl_val_pow2.restype = c_void_p 18879isl.isl_val_pow2.argtypes = [c_void_p] 18880isl.isl_val_sgn.argtypes = [c_void_p] 18881isl.isl_val_sub.restype = c_void_p 18882isl.isl_val_sub.argtypes = [c_void_p, c_void_p] 18883isl.isl_val_to_list.restype = c_void_p 18884isl.isl_val_to_list.argtypes = [c_void_p] 18885isl.isl_val_trunc.restype = c_void_p 18886isl.isl_val_trunc.argtypes = [c_void_p] 18887isl.isl_val_zero.restype = c_void_p 18888isl.isl_val_zero.argtypes = [Context] 18889isl.isl_val_copy.restype = c_void_p 18890isl.isl_val_copy.argtypes = [c_void_p] 18891isl.isl_val_free.restype = c_void_p 18892isl.isl_val_free.argtypes = [c_void_p] 18893isl.isl_val_to_str.restype = POINTER(c_char) 18894isl.isl_val_to_str.argtypes = [c_void_p] 18895 18896class val_list(object): 18897 def __init__(self, *args, **keywords): 18898 if "ptr" in keywords: 18899 self.ctx = keywords["ctx"] 18900 self.ptr = keywords["ptr"] 18901 return 18902 if len(args) == 1 and type(args[0]) == int: 18903 self.ctx = Context.getDefaultInstance() 18904 self.ptr = isl.isl_val_list_alloc(self.ctx, args[0]) 18905 return 18906 if len(args) == 1 and (args[0].__class__ is val or type(args[0]) == int): 18907 args = list(args) 18908 try: 18909 if not args[0].__class__ is val: 18910 args[0] = val(args[0]) 18911 except: 18912 raise 18913 self.ctx = Context.getDefaultInstance() 18914 self.ptr = isl.isl_val_list_from_val(isl.isl_val_copy(args[0].ptr)) 18915 return 18916 if len(args) == 1 and type(args[0]) == str: 18917 self.ctx = Context.getDefaultInstance() 18918 self.ptr = isl.isl_val_list_read_from_str(self.ctx, args[0].encode('ascii')) 18919 return 18920 raise Error 18921 def __del__(self): 18922 if hasattr(self, 'ptr'): 18923 isl.isl_val_list_free(self.ptr) 18924 def __str__(arg0): 18925 try: 18926 if not arg0.__class__ is val_list: 18927 arg0 = val_list(arg0) 18928 except: 18929 raise 18930 ptr = isl.isl_val_list_to_str(arg0.ptr) 18931 res = cast(ptr, c_char_p).value.decode('ascii') 18932 libc.free(ptr) 18933 return res 18934 def __repr__(self): 18935 s = str(self) 18936 if '"' in s: 18937 return 'isl.val_list("""%s""")' % s 18938 else: 18939 return 'isl.val_list("%s")' % s 18940 def add(arg0, arg1): 18941 try: 18942 if not arg0.__class__ is val_list: 18943 arg0 = val_list(arg0) 18944 except: 18945 raise 18946 try: 18947 if not arg1.__class__ is val: 18948 arg1 = val(arg1) 18949 except: 18950 raise 18951 ctx = arg0.ctx 18952 res = isl.isl_val_list_add(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 18953 obj = val_list(ctx=ctx, ptr=res) 18954 return obj 18955 def at(arg0, arg1): 18956 try: 18957 if not arg0.__class__ is val_list: 18958 arg0 = val_list(arg0) 18959 except: 18960 raise 18961 ctx = arg0.ctx 18962 res = isl.isl_val_list_get_at(arg0.ptr, arg1) 18963 obj = val(ctx=ctx, ptr=res) 18964 return obj 18965 def get_at(arg0, arg1): 18966 return arg0.at(arg1) 18967 def clear(arg0): 18968 try: 18969 if not arg0.__class__ is val_list: 18970 arg0 = val_list(arg0) 18971 except: 18972 raise 18973 ctx = arg0.ctx 18974 res = isl.isl_val_list_clear(isl.isl_val_list_copy(arg0.ptr)) 18975 obj = val_list(ctx=ctx, ptr=res) 18976 return obj 18977 def concat(arg0, arg1): 18978 try: 18979 if not arg0.__class__ is val_list: 18980 arg0 = val_list(arg0) 18981 except: 18982 raise 18983 try: 18984 if not arg1.__class__ is val_list: 18985 arg1 = val_list(arg1) 18986 except: 18987 raise 18988 ctx = arg0.ctx 18989 res = isl.isl_val_list_concat(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_list_copy(arg1.ptr)) 18990 obj = val_list(ctx=ctx, ptr=res) 18991 return obj 18992 def drop(arg0, arg1, arg2): 18993 try: 18994 if not arg0.__class__ is val_list: 18995 arg0 = val_list(arg0) 18996 except: 18997 raise 18998 ctx = arg0.ctx 18999 res = isl.isl_val_list_drop(isl.isl_val_list_copy(arg0.ptr), arg1, arg2) 19000 obj = val_list(ctx=ctx, ptr=res) 19001 return obj 19002 def foreach(arg0, arg1): 19003 try: 19004 if not arg0.__class__ is val_list: 19005 arg0 = val_list(arg0) 19006 except: 19007 raise 19008 exc_info = [None] 19009 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 19010 def cb_func(cb_arg0, cb_arg1): 19011 cb_arg0 = val(ctx=arg0.ctx, ptr=(cb_arg0)) 19012 try: 19013 arg1(cb_arg0) 19014 except BaseException as e: 19015 exc_info[0] = e 19016 return -1 19017 return 0 19018 cb1 = fn(cb_func) 19019 ctx = arg0.ctx 19020 res = isl.isl_val_list_foreach(arg0.ptr, cb1, None) 19021 if exc_info[0] is not None: 19022 raise exc_info[0] 19023 if res < 0: 19024 raise Error 19025 def foreach_scc(arg0, arg1, arg2): 19026 try: 19027 if not arg0.__class__ is val_list: 19028 arg0 = val_list(arg0) 19029 except: 19030 raise 19031 exc_info = [None] 19032 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 19033 def cb_func(cb_arg0, cb_arg1, cb_arg2): 19034 cb_arg0 = val(ctx=arg0.ctx, ptr=isl.isl_val_copy(cb_arg0)) 19035 cb_arg1 = val(ctx=arg0.ctx, ptr=isl.isl_val_copy(cb_arg1)) 19036 try: 19037 res = arg1(cb_arg0, cb_arg1) 19038 except BaseException as e: 19039 exc_info[0] = e 19040 return -1 19041 return 1 if res else 0 19042 cb1 = fn(cb_func) 19043 exc_info = [None] 19044 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 19045 def cb_func(cb_arg0, cb_arg1): 19046 cb_arg0 = val_list(ctx=arg0.ctx, ptr=(cb_arg0)) 19047 try: 19048 arg2(cb_arg0) 19049 except BaseException as e: 19050 exc_info[0] = e 19051 return -1 19052 return 0 19053 cb2 = fn(cb_func) 19054 ctx = arg0.ctx 19055 res = isl.isl_val_list_foreach_scc(arg0.ptr, cb1, None, cb2, None) 19056 if exc_info[0] is not None: 19057 raise exc_info[0] 19058 if res < 0: 19059 raise Error 19060 def insert(arg0, arg1, arg2): 19061 try: 19062 if not arg0.__class__ is val_list: 19063 arg0 = val_list(arg0) 19064 except: 19065 raise 19066 try: 19067 if not arg2.__class__ is val: 19068 arg2 = val(arg2) 19069 except: 19070 raise 19071 ctx = arg0.ctx 19072 res = isl.isl_val_list_insert(isl.isl_val_list_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 19073 obj = val_list(ctx=ctx, ptr=res) 19074 return obj 19075 def set_at(arg0, arg1, arg2): 19076 try: 19077 if not arg0.__class__ is val_list: 19078 arg0 = val_list(arg0) 19079 except: 19080 raise 19081 try: 19082 if not arg2.__class__ is val: 19083 arg2 = val(arg2) 19084 except: 19085 raise 19086 ctx = arg0.ctx 19087 res = isl.isl_val_list_set_at(isl.isl_val_list_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 19088 obj = val_list(ctx=ctx, ptr=res) 19089 return obj 19090 def size(arg0): 19091 try: 19092 if not arg0.__class__ is val_list: 19093 arg0 = val_list(arg0) 19094 except: 19095 raise 19096 ctx = arg0.ctx 19097 res = isl.isl_val_list_size(arg0.ptr) 19098 if res < 0: 19099 raise Error 19100 return int(res) 19101 19102isl.isl_val_list_alloc.restype = c_void_p 19103isl.isl_val_list_alloc.argtypes = [Context, c_int] 19104isl.isl_val_list_from_val.restype = c_void_p 19105isl.isl_val_list_from_val.argtypes = [c_void_p] 19106isl.isl_val_list_read_from_str.restype = c_void_p 19107isl.isl_val_list_read_from_str.argtypes = [Context, c_char_p] 19108isl.isl_val_list_add.restype = c_void_p 19109isl.isl_val_list_add.argtypes = [c_void_p, c_void_p] 19110isl.isl_val_list_get_at.restype = c_void_p 19111isl.isl_val_list_get_at.argtypes = [c_void_p, c_int] 19112isl.isl_val_list_clear.restype = c_void_p 19113isl.isl_val_list_clear.argtypes = [c_void_p] 19114isl.isl_val_list_concat.restype = c_void_p 19115isl.isl_val_list_concat.argtypes = [c_void_p, c_void_p] 19116isl.isl_val_list_drop.restype = c_void_p 19117isl.isl_val_list_drop.argtypes = [c_void_p, c_int, c_int] 19118isl.isl_val_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 19119isl.isl_val_list_foreach_scc.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p] 19120isl.isl_val_list_insert.restype = c_void_p 19121isl.isl_val_list_insert.argtypes = [c_void_p, c_int, c_void_p] 19122isl.isl_val_list_set_at.restype = c_void_p 19123isl.isl_val_list_set_at.argtypes = [c_void_p, c_int, c_void_p] 19124isl.isl_val_list_size.argtypes = [c_void_p] 19125isl.isl_val_list_copy.restype = c_void_p 19126isl.isl_val_list_copy.argtypes = [c_void_p] 19127isl.isl_val_list_free.restype = c_void_p 19128isl.isl_val_list_free.argtypes = [c_void_p] 19129isl.isl_val_list_to_str.restype = POINTER(c_char) 19130isl.isl_val_list_to_str.argtypes = [c_void_p] 19131