1isl_dlname='libisl.so.23' 2import os 3from ctypes import * 4from ctypes.util import find_library 5 6isl_dyld_library_path = os.environ.get('ISL_DYLD_LIBRARY_PATH') 7if isl_dyld_library_path != None: 8 os.environ['DYLD_LIBRARY_PATH'] = isl_dyld_library_path 9try: 10 isl = cdll.LoadLibrary(isl_dlname) 11except: 12 isl = cdll.LoadLibrary(find_library("isl")) 13libc = cdll.LoadLibrary(find_library("c")) 14 15class Error(Exception): 16 pass 17 18class Context: 19 defaultInstance = None 20 21 def __init__(self): 22 ptr = isl.isl_ctx_alloc() 23 self.ptr = ptr 24 25 def __del__(self): 26 isl.isl_ctx_free(self) 27 28 def from_param(self): 29 return c_void_p(self.ptr) 30 31 @staticmethod 32 def getDefaultInstance(): 33 if Context.defaultInstance == None: 34 Context.defaultInstance = Context() 35 return Context.defaultInstance 36 37isl.isl_ctx_alloc.restype = c_void_p 38isl.isl_ctx_free.argtypes = [Context] 39 40class union_pw_multi_aff(object): 41 def __init__(self, *args, **keywords): 42 if "ptr" in keywords: 43 self.ctx = keywords["ctx"] 44 self.ptr = keywords["ptr"] 45 return 46 if len(args) == 1 and args[0].__class__ is multi_aff: 47 self.ctx = Context.getDefaultInstance() 48 self.ptr = isl.isl_union_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 49 return 50 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 51 self.ctx = Context.getDefaultInstance() 52 self.ptr = isl.isl_union_pw_multi_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 53 return 54 if len(args) == 1 and args[0].__class__ is union_pw_aff: 55 self.ctx = Context.getDefaultInstance() 56 self.ptr = isl.isl_union_pw_multi_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 57 return 58 if len(args) == 1 and type(args[0]) == str: 59 self.ctx = Context.getDefaultInstance() 60 self.ptr = isl.isl_union_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 61 return 62 raise Error 63 def __del__(self): 64 if hasattr(self, 'ptr'): 65 isl.isl_union_pw_multi_aff_free(self.ptr) 66 def __str__(arg0): 67 try: 68 if not arg0.__class__ is union_pw_multi_aff: 69 arg0 = union_pw_multi_aff(arg0) 70 except: 71 raise 72 ptr = isl.isl_union_pw_multi_aff_to_str(arg0.ptr) 73 res = cast(ptr, c_char_p).value.decode('ascii') 74 libc.free(ptr) 75 return res 76 def __repr__(self): 77 s = str(self) 78 if '"' in s: 79 return 'isl.union_pw_multi_aff("""%s""")' % s 80 else: 81 return 'isl.union_pw_multi_aff("%s")' % s 82 def add(arg0, arg1): 83 try: 84 if not arg0.__class__ is union_pw_multi_aff: 85 arg0 = union_pw_multi_aff(arg0) 86 except: 87 raise 88 try: 89 if not arg1.__class__ is union_pw_multi_aff: 90 arg1 = union_pw_multi_aff(arg1) 91 except: 92 raise 93 ctx = arg0.ctx 94 res = isl.isl_union_pw_multi_aff_add(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_pw_multi_aff_copy(arg1.ptr)) 95 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 96 return obj 97 def apply(*args): 98 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 99 ctx = args[0].ctx 100 res = isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr), isl.isl_union_pw_multi_aff_copy(args[1].ptr)) 101 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 102 return obj 103 raise Error 104 def as_multi_union_pw_aff(arg0): 105 try: 106 if not arg0.__class__ is union_pw_multi_aff: 107 arg0 = union_pw_multi_aff(arg0) 108 except: 109 raise 110 ctx = arg0.ctx 111 res = isl.isl_union_pw_multi_aff_as_multi_union_pw_aff(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 112 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 113 return obj 114 def as_pw_multi_aff(arg0): 115 try: 116 if not arg0.__class__ is union_pw_multi_aff: 117 arg0 = union_pw_multi_aff(arg0) 118 except: 119 raise 120 ctx = arg0.ctx 121 res = isl.isl_union_pw_multi_aff_as_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 122 obj = pw_multi_aff(ctx=ctx, ptr=res) 123 return obj 124 def as_union_map(arg0): 125 try: 126 if not arg0.__class__ is union_pw_multi_aff: 127 arg0 = union_pw_multi_aff(arg0) 128 except: 129 raise 130 ctx = arg0.ctx 131 res = isl.isl_union_pw_multi_aff_as_union_map(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 132 obj = union_map(ctx=ctx, ptr=res) 133 return obj 134 def coalesce(arg0): 135 try: 136 if not arg0.__class__ is union_pw_multi_aff: 137 arg0 = union_pw_multi_aff(arg0) 138 except: 139 raise 140 ctx = arg0.ctx 141 res = isl.isl_union_pw_multi_aff_coalesce(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 142 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 143 return obj 144 def domain(arg0): 145 try: 146 if not arg0.__class__ is union_pw_multi_aff: 147 arg0 = union_pw_multi_aff(arg0) 148 except: 149 raise 150 ctx = arg0.ctx 151 res = isl.isl_union_pw_multi_aff_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 152 obj = union_set(ctx=ctx, ptr=res) 153 return obj 154 @staticmethod 155 def empty(*args): 156 if len(args) == 0: 157 ctx = Context.getDefaultInstance() 158 res = isl.isl_union_pw_multi_aff_empty_ctx(ctx) 159 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 160 return obj 161 raise Error 162 def extract_pw_multi_aff(arg0, arg1): 163 try: 164 if not arg0.__class__ is union_pw_multi_aff: 165 arg0 = union_pw_multi_aff(arg0) 166 except: 167 raise 168 try: 169 if not arg1.__class__ is space: 170 arg1 = space(arg1) 171 except: 172 raise 173 ctx = arg0.ctx 174 res = isl.isl_union_pw_multi_aff_extract_pw_multi_aff(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 175 obj = pw_multi_aff(ctx=ctx, ptr=res) 176 return obj 177 def flat_range_product(arg0, arg1): 178 try: 179 if not arg0.__class__ is union_pw_multi_aff: 180 arg0 = union_pw_multi_aff(arg0) 181 except: 182 raise 183 try: 184 if not arg1.__class__ is union_pw_multi_aff: 185 arg1 = union_pw_multi_aff(arg1) 186 except: 187 raise 188 ctx = arg0.ctx 189 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)) 190 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 191 return obj 192 def gist(arg0, arg1): 193 try: 194 if not arg0.__class__ is union_pw_multi_aff: 195 arg0 = union_pw_multi_aff(arg0) 196 except: 197 raise 198 try: 199 if not arg1.__class__ is union_set: 200 arg1 = union_set(arg1) 201 except: 202 raise 203 ctx = arg0.ctx 204 res = isl.isl_union_pw_multi_aff_gist(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 205 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 206 return obj 207 def intersect_domain(*args): 208 if len(args) == 2 and args[1].__class__ is space: 209 ctx = args[0].ctx 210 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)) 211 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 212 return obj 213 if len(args) == 2 and args[1].__class__ is union_set: 214 ctx = args[0].ctx 215 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)) 216 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 217 return obj 218 raise Error 219 def intersect_domain_wrapped_domain(arg0, arg1): 220 try: 221 if not arg0.__class__ is union_pw_multi_aff: 222 arg0 = union_pw_multi_aff(arg0) 223 except: 224 raise 225 try: 226 if not arg1.__class__ is union_set: 227 arg1 = union_set(arg1) 228 except: 229 raise 230 ctx = arg0.ctx 231 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)) 232 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 233 return obj 234 def intersect_domain_wrapped_range(arg0, arg1): 235 try: 236 if not arg0.__class__ is union_pw_multi_aff: 237 arg0 = union_pw_multi_aff(arg0) 238 except: 239 raise 240 try: 241 if not arg1.__class__ is union_set: 242 arg1 = union_set(arg1) 243 except: 244 raise 245 ctx = arg0.ctx 246 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)) 247 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 248 return obj 249 def intersect_params(arg0, arg1): 250 try: 251 if not arg0.__class__ is union_pw_multi_aff: 252 arg0 = union_pw_multi_aff(arg0) 253 except: 254 raise 255 try: 256 if not arg1.__class__ is set: 257 arg1 = set(arg1) 258 except: 259 raise 260 ctx = arg0.ctx 261 res = isl.isl_union_pw_multi_aff_intersect_params(isl.isl_union_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 262 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 263 return obj 264 def involves_locals(arg0): 265 try: 266 if not arg0.__class__ is union_pw_multi_aff: 267 arg0 = union_pw_multi_aff(arg0) 268 except: 269 raise 270 ctx = arg0.ctx 271 res = isl.isl_union_pw_multi_aff_involves_locals(arg0.ptr) 272 if res < 0: 273 raise 274 return bool(res) 275 def isa_pw_multi_aff(arg0): 276 try: 277 if not arg0.__class__ is union_pw_multi_aff: 278 arg0 = union_pw_multi_aff(arg0) 279 except: 280 raise 281 ctx = arg0.ctx 282 res = isl.isl_union_pw_multi_aff_isa_pw_multi_aff(arg0.ptr) 283 if res < 0: 284 raise 285 return bool(res) 286 def plain_is_empty(arg0): 287 try: 288 if not arg0.__class__ is union_pw_multi_aff: 289 arg0 = union_pw_multi_aff(arg0) 290 except: 291 raise 292 ctx = arg0.ctx 293 res = isl.isl_union_pw_multi_aff_plain_is_empty(arg0.ptr) 294 if res < 0: 295 raise 296 return bool(res) 297 def preimage_domain_wrapped_domain(*args): 298 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 299 ctx = args[0].ctx 300 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)) 301 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 302 return obj 303 raise Error 304 def pullback(*args): 305 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 306 ctx = args[0].ctx 307 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)) 308 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 309 return obj 310 raise Error 311 def pw_multi_aff_list(arg0): 312 try: 313 if not arg0.__class__ is union_pw_multi_aff: 314 arg0 = union_pw_multi_aff(arg0) 315 except: 316 raise 317 ctx = arg0.ctx 318 res = isl.isl_union_pw_multi_aff_get_pw_multi_aff_list(arg0.ptr) 319 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 320 return obj 321 def get_pw_multi_aff_list(arg0): 322 return arg0.pw_multi_aff_list() 323 def range_factor_domain(arg0): 324 try: 325 if not arg0.__class__ is union_pw_multi_aff: 326 arg0 = union_pw_multi_aff(arg0) 327 except: 328 raise 329 ctx = arg0.ctx 330 res = isl.isl_union_pw_multi_aff_range_factor_domain(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 331 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 332 return obj 333 def range_factor_range(arg0): 334 try: 335 if not arg0.__class__ is union_pw_multi_aff: 336 arg0 = union_pw_multi_aff(arg0) 337 except: 338 raise 339 ctx = arg0.ctx 340 res = isl.isl_union_pw_multi_aff_range_factor_range(isl.isl_union_pw_multi_aff_copy(arg0.ptr)) 341 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 342 return obj 343 def range_product(arg0, arg1): 344 try: 345 if not arg0.__class__ is union_pw_multi_aff: 346 arg0 = union_pw_multi_aff(arg0) 347 except: 348 raise 349 try: 350 if not arg1.__class__ is union_pw_multi_aff: 351 arg1 = union_pw_multi_aff(arg1) 352 except: 353 raise 354 ctx = arg0.ctx 355 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)) 356 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 357 return obj 358 def space(arg0): 359 try: 360 if not arg0.__class__ is union_pw_multi_aff: 361 arg0 = union_pw_multi_aff(arg0) 362 except: 363 raise 364 ctx = arg0.ctx 365 res = isl.isl_union_pw_multi_aff_get_space(arg0.ptr) 366 obj = space(ctx=ctx, ptr=res) 367 return obj 368 def get_space(arg0): 369 return arg0.space() 370 def sub(arg0, arg1): 371 try: 372 if not arg0.__class__ is union_pw_multi_aff: 373 arg0 = union_pw_multi_aff(arg0) 374 except: 375 raise 376 try: 377 if not arg1.__class__ is union_pw_multi_aff: 378 arg1 = union_pw_multi_aff(arg1) 379 except: 380 raise 381 ctx = arg0.ctx 382 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)) 383 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 384 return obj 385 def subtract_domain(*args): 386 if len(args) == 2 and args[1].__class__ is space: 387 ctx = args[0].ctx 388 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)) 389 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 390 return obj 391 if len(args) == 2 and args[1].__class__ is union_set: 392 ctx = args[0].ctx 393 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)) 394 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 395 return obj 396 raise Error 397 def union_add(arg0, arg1): 398 try: 399 if not arg0.__class__ is union_pw_multi_aff: 400 arg0 = union_pw_multi_aff(arg0) 401 except: 402 raise 403 try: 404 if not arg1.__class__ is union_pw_multi_aff: 405 arg1 = union_pw_multi_aff(arg1) 406 except: 407 raise 408 ctx = arg0.ctx 409 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)) 410 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 411 return obj 412 413isl.isl_union_pw_multi_aff_from_multi_aff.restype = c_void_p 414isl.isl_union_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 415isl.isl_union_pw_multi_aff_from_pw_multi_aff.restype = c_void_p 416isl.isl_union_pw_multi_aff_from_pw_multi_aff.argtypes = [c_void_p] 417isl.isl_union_pw_multi_aff_from_union_pw_aff.restype = c_void_p 418isl.isl_union_pw_multi_aff_from_union_pw_aff.argtypes = [c_void_p] 419isl.isl_union_pw_multi_aff_read_from_str.restype = c_void_p 420isl.isl_union_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 421isl.isl_union_pw_multi_aff_add.restype = c_void_p 422isl.isl_union_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 423isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.restype = c_void_p 424isl.isl_union_pw_multi_aff_apply_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 425isl.isl_union_pw_multi_aff_as_multi_union_pw_aff.restype = c_void_p 426isl.isl_union_pw_multi_aff_as_multi_union_pw_aff.argtypes = [c_void_p] 427isl.isl_union_pw_multi_aff_as_pw_multi_aff.restype = c_void_p 428isl.isl_union_pw_multi_aff_as_pw_multi_aff.argtypes = [c_void_p] 429isl.isl_union_pw_multi_aff_as_union_map.restype = c_void_p 430isl.isl_union_pw_multi_aff_as_union_map.argtypes = [c_void_p] 431isl.isl_union_pw_multi_aff_coalesce.restype = c_void_p 432isl.isl_union_pw_multi_aff_coalesce.argtypes = [c_void_p] 433isl.isl_union_pw_multi_aff_domain.restype = c_void_p 434isl.isl_union_pw_multi_aff_domain.argtypes = [c_void_p] 435isl.isl_union_pw_multi_aff_empty_ctx.restype = c_void_p 436isl.isl_union_pw_multi_aff_empty_ctx.argtypes = [Context] 437isl.isl_union_pw_multi_aff_extract_pw_multi_aff.restype = c_void_p 438isl.isl_union_pw_multi_aff_extract_pw_multi_aff.argtypes = [c_void_p, c_void_p] 439isl.isl_union_pw_multi_aff_flat_range_product.restype = c_void_p 440isl.isl_union_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 441isl.isl_union_pw_multi_aff_gist.restype = c_void_p 442isl.isl_union_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 443isl.isl_union_pw_multi_aff_intersect_domain_space.restype = c_void_p 444isl.isl_union_pw_multi_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 445isl.isl_union_pw_multi_aff_intersect_domain_union_set.restype = c_void_p 446isl.isl_union_pw_multi_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 447isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.restype = c_void_p 448isl.isl_union_pw_multi_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 449isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.restype = c_void_p 450isl.isl_union_pw_multi_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 451isl.isl_union_pw_multi_aff_intersect_params.restype = c_void_p 452isl.isl_union_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 453isl.isl_union_pw_multi_aff_involves_locals.argtypes = [c_void_p] 454isl.isl_union_pw_multi_aff_isa_pw_multi_aff.argtypes = [c_void_p] 455isl.isl_union_pw_multi_aff_plain_is_empty.argtypes = [c_void_p] 456isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.restype = c_void_p 457isl.isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 458isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.restype = c_void_p 459isl.isl_union_pw_multi_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 460isl.isl_union_pw_multi_aff_get_pw_multi_aff_list.restype = c_void_p 461isl.isl_union_pw_multi_aff_get_pw_multi_aff_list.argtypes = [c_void_p] 462isl.isl_union_pw_multi_aff_range_factor_domain.restype = c_void_p 463isl.isl_union_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 464isl.isl_union_pw_multi_aff_range_factor_range.restype = c_void_p 465isl.isl_union_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 466isl.isl_union_pw_multi_aff_range_product.restype = c_void_p 467isl.isl_union_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 468isl.isl_union_pw_multi_aff_get_space.restype = c_void_p 469isl.isl_union_pw_multi_aff_get_space.argtypes = [c_void_p] 470isl.isl_union_pw_multi_aff_sub.restype = c_void_p 471isl.isl_union_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 472isl.isl_union_pw_multi_aff_subtract_domain_space.restype = c_void_p 473isl.isl_union_pw_multi_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 474isl.isl_union_pw_multi_aff_subtract_domain_union_set.restype = c_void_p 475isl.isl_union_pw_multi_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 476isl.isl_union_pw_multi_aff_union_add.restype = c_void_p 477isl.isl_union_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 478isl.isl_union_pw_multi_aff_copy.restype = c_void_p 479isl.isl_union_pw_multi_aff_copy.argtypes = [c_void_p] 480isl.isl_union_pw_multi_aff_free.restype = c_void_p 481isl.isl_union_pw_multi_aff_free.argtypes = [c_void_p] 482isl.isl_union_pw_multi_aff_to_str.restype = POINTER(c_char) 483isl.isl_union_pw_multi_aff_to_str.argtypes = [c_void_p] 484 485class multi_union_pw_aff(object): 486 def __init__(self, *args, **keywords): 487 if "ptr" in keywords: 488 self.ctx = keywords["ctx"] 489 self.ptr = keywords["ptr"] 490 return 491 if len(args) == 1 and args[0].__class__ is multi_pw_aff: 492 self.ctx = Context.getDefaultInstance() 493 self.ptr = isl.isl_multi_union_pw_aff_from_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 494 return 495 if len(args) == 1 and args[0].__class__ is union_pw_aff: 496 self.ctx = Context.getDefaultInstance() 497 self.ptr = isl.isl_multi_union_pw_aff_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 498 return 499 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is union_pw_aff_list: 500 self.ctx = Context.getDefaultInstance() 501 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)) 502 return 503 if len(args) == 1 and type(args[0]) == str: 504 self.ctx = Context.getDefaultInstance() 505 self.ptr = isl.isl_multi_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 506 return 507 raise Error 508 def __del__(self): 509 if hasattr(self, 'ptr'): 510 isl.isl_multi_union_pw_aff_free(self.ptr) 511 def __str__(arg0): 512 try: 513 if not arg0.__class__ is multi_union_pw_aff: 514 arg0 = multi_union_pw_aff(arg0) 515 except: 516 raise 517 ptr = isl.isl_multi_union_pw_aff_to_str(arg0.ptr) 518 res = cast(ptr, c_char_p).value.decode('ascii') 519 libc.free(ptr) 520 return res 521 def __repr__(self): 522 s = str(self) 523 if '"' in s: 524 return 'isl.multi_union_pw_aff("""%s""")' % s 525 else: 526 return 'isl.multi_union_pw_aff("%s")' % s 527 def add(arg0, arg1): 528 try: 529 if not arg0.__class__ is multi_union_pw_aff: 530 arg0 = multi_union_pw_aff(arg0) 531 except: 532 raise 533 try: 534 if not arg1.__class__ is multi_union_pw_aff: 535 arg1 = multi_union_pw_aff(arg1) 536 except: 537 raise 538 ctx = arg0.ctx 539 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)) 540 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 541 return obj 542 def at(arg0, arg1): 543 try: 544 if not arg0.__class__ is multi_union_pw_aff: 545 arg0 = multi_union_pw_aff(arg0) 546 except: 547 raise 548 ctx = arg0.ctx 549 res = isl.isl_multi_union_pw_aff_get_at(arg0.ptr, arg1) 550 obj = union_pw_aff(ctx=ctx, ptr=res) 551 return obj 552 def get_at(arg0, arg1): 553 return arg0.at(arg1) 554 def bind(arg0, arg1): 555 try: 556 if not arg0.__class__ is multi_union_pw_aff: 557 arg0 = multi_union_pw_aff(arg0) 558 except: 559 raise 560 try: 561 if not arg1.__class__ is multi_id: 562 arg1 = multi_id(arg1) 563 except: 564 raise 565 ctx = arg0.ctx 566 res = isl.isl_multi_union_pw_aff_bind(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 567 obj = union_set(ctx=ctx, ptr=res) 568 return obj 569 def coalesce(arg0): 570 try: 571 if not arg0.__class__ is multi_union_pw_aff: 572 arg0 = multi_union_pw_aff(arg0) 573 except: 574 raise 575 ctx = arg0.ctx 576 res = isl.isl_multi_union_pw_aff_coalesce(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 577 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 578 return obj 579 def domain(arg0): 580 try: 581 if not arg0.__class__ is multi_union_pw_aff: 582 arg0 = multi_union_pw_aff(arg0) 583 except: 584 raise 585 ctx = arg0.ctx 586 res = isl.isl_multi_union_pw_aff_domain(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 587 obj = union_set(ctx=ctx, ptr=res) 588 return obj 589 def flat_range_product(arg0, arg1): 590 try: 591 if not arg0.__class__ is multi_union_pw_aff: 592 arg0 = multi_union_pw_aff(arg0) 593 except: 594 raise 595 try: 596 if not arg1.__class__ is multi_union_pw_aff: 597 arg1 = multi_union_pw_aff(arg1) 598 except: 599 raise 600 ctx = arg0.ctx 601 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)) 602 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 603 return obj 604 def gist(arg0, arg1): 605 try: 606 if not arg0.__class__ is multi_union_pw_aff: 607 arg0 = multi_union_pw_aff(arg0) 608 except: 609 raise 610 try: 611 if not arg1.__class__ is union_set: 612 arg1 = union_set(arg1) 613 except: 614 raise 615 ctx = arg0.ctx 616 res = isl.isl_multi_union_pw_aff_gist(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 617 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 618 return obj 619 def has_range_tuple_id(arg0): 620 try: 621 if not arg0.__class__ is multi_union_pw_aff: 622 arg0 = multi_union_pw_aff(arg0) 623 except: 624 raise 625 ctx = arg0.ctx 626 res = isl.isl_multi_union_pw_aff_has_range_tuple_id(arg0.ptr) 627 if res < 0: 628 raise 629 return bool(res) 630 def intersect_domain(arg0, arg1): 631 try: 632 if not arg0.__class__ is multi_union_pw_aff: 633 arg0 = multi_union_pw_aff(arg0) 634 except: 635 raise 636 try: 637 if not arg1.__class__ is union_set: 638 arg1 = union_set(arg1) 639 except: 640 raise 641 ctx = arg0.ctx 642 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)) 643 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 644 return obj 645 def intersect_params(arg0, arg1): 646 try: 647 if not arg0.__class__ is multi_union_pw_aff: 648 arg0 = multi_union_pw_aff(arg0) 649 except: 650 raise 651 try: 652 if not arg1.__class__ is set: 653 arg1 = set(arg1) 654 except: 655 raise 656 ctx = arg0.ctx 657 res = isl.isl_multi_union_pw_aff_intersect_params(isl.isl_multi_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 658 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 659 return obj 660 def involves_nan(arg0): 661 try: 662 if not arg0.__class__ is multi_union_pw_aff: 663 arg0 = multi_union_pw_aff(arg0) 664 except: 665 raise 666 ctx = arg0.ctx 667 res = isl.isl_multi_union_pw_aff_involves_nan(arg0.ptr) 668 if res < 0: 669 raise 670 return bool(res) 671 def list(arg0): 672 try: 673 if not arg0.__class__ is multi_union_pw_aff: 674 arg0 = multi_union_pw_aff(arg0) 675 except: 676 raise 677 ctx = arg0.ctx 678 res = isl.isl_multi_union_pw_aff_get_list(arg0.ptr) 679 obj = union_pw_aff_list(ctx=ctx, ptr=res) 680 return obj 681 def get_list(arg0): 682 return arg0.list() 683 def neg(arg0): 684 try: 685 if not arg0.__class__ is multi_union_pw_aff: 686 arg0 = multi_union_pw_aff(arg0) 687 except: 688 raise 689 ctx = arg0.ctx 690 res = isl.isl_multi_union_pw_aff_neg(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 691 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 692 return obj 693 def plain_is_equal(arg0, arg1): 694 try: 695 if not arg0.__class__ is multi_union_pw_aff: 696 arg0 = multi_union_pw_aff(arg0) 697 except: 698 raise 699 try: 700 if not arg1.__class__ is multi_union_pw_aff: 701 arg1 = multi_union_pw_aff(arg1) 702 except: 703 raise 704 ctx = arg0.ctx 705 res = isl.isl_multi_union_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 706 if res < 0: 707 raise 708 return bool(res) 709 def pullback(*args): 710 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 711 ctx = args[0].ctx 712 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)) 713 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 714 return obj 715 raise Error 716 def range_product(arg0, arg1): 717 try: 718 if not arg0.__class__ is multi_union_pw_aff: 719 arg0 = multi_union_pw_aff(arg0) 720 except: 721 raise 722 try: 723 if not arg1.__class__ is multi_union_pw_aff: 724 arg1 = multi_union_pw_aff(arg1) 725 except: 726 raise 727 ctx = arg0.ctx 728 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)) 729 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 730 return obj 731 def range_tuple_id(arg0): 732 try: 733 if not arg0.__class__ is multi_union_pw_aff: 734 arg0 = multi_union_pw_aff(arg0) 735 except: 736 raise 737 ctx = arg0.ctx 738 res = isl.isl_multi_union_pw_aff_get_range_tuple_id(arg0.ptr) 739 obj = id(ctx=ctx, ptr=res) 740 return obj 741 def get_range_tuple_id(arg0): 742 return arg0.range_tuple_id() 743 def reset_range_tuple_id(arg0): 744 try: 745 if not arg0.__class__ is multi_union_pw_aff: 746 arg0 = multi_union_pw_aff(arg0) 747 except: 748 raise 749 ctx = arg0.ctx 750 res = isl.isl_multi_union_pw_aff_reset_range_tuple_id(isl.isl_multi_union_pw_aff_copy(arg0.ptr)) 751 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 752 return obj 753 def scale(*args): 754 if len(args) == 2 and args[1].__class__ is multi_val: 755 ctx = args[0].ctx 756 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)) 757 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 758 return obj 759 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 760 args = list(args) 761 try: 762 if not args[1].__class__ is val: 763 args[1] = val(args[1]) 764 except: 765 raise 766 ctx = args[0].ctx 767 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)) 768 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 769 return obj 770 raise Error 771 def scale_down(*args): 772 if len(args) == 2 and args[1].__class__ is multi_val: 773 ctx = args[0].ctx 774 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)) 775 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 776 return obj 777 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 778 args = list(args) 779 try: 780 if not args[1].__class__ is val: 781 args[1] = val(args[1]) 782 except: 783 raise 784 ctx = args[0].ctx 785 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)) 786 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 787 return obj 788 raise Error 789 def set_at(arg0, arg1, arg2): 790 try: 791 if not arg0.__class__ is multi_union_pw_aff: 792 arg0 = multi_union_pw_aff(arg0) 793 except: 794 raise 795 try: 796 if not arg2.__class__ is union_pw_aff: 797 arg2 = union_pw_aff(arg2) 798 except: 799 raise 800 ctx = arg0.ctx 801 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)) 802 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 803 return obj 804 def set_range_tuple(*args): 805 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 806 args = list(args) 807 try: 808 if not args[1].__class__ is id: 809 args[1] = id(args[1]) 810 except: 811 raise 812 ctx = args[0].ctx 813 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)) 814 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 815 return obj 816 raise Error 817 def size(arg0): 818 try: 819 if not arg0.__class__ is multi_union_pw_aff: 820 arg0 = multi_union_pw_aff(arg0) 821 except: 822 raise 823 ctx = arg0.ctx 824 res = isl.isl_multi_union_pw_aff_size(arg0.ptr) 825 if res < 0: 826 raise 827 return int(res) 828 def space(arg0): 829 try: 830 if not arg0.__class__ is multi_union_pw_aff: 831 arg0 = multi_union_pw_aff(arg0) 832 except: 833 raise 834 ctx = arg0.ctx 835 res = isl.isl_multi_union_pw_aff_get_space(arg0.ptr) 836 obj = space(ctx=ctx, ptr=res) 837 return obj 838 def get_space(arg0): 839 return arg0.space() 840 def sub(arg0, arg1): 841 try: 842 if not arg0.__class__ is multi_union_pw_aff: 843 arg0 = multi_union_pw_aff(arg0) 844 except: 845 raise 846 try: 847 if not arg1.__class__ is multi_union_pw_aff: 848 arg1 = multi_union_pw_aff(arg1) 849 except: 850 raise 851 ctx = arg0.ctx 852 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)) 853 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 854 return obj 855 def union_add(arg0, arg1): 856 try: 857 if not arg0.__class__ is multi_union_pw_aff: 858 arg0 = multi_union_pw_aff(arg0) 859 except: 860 raise 861 try: 862 if not arg1.__class__ is multi_union_pw_aff: 863 arg1 = multi_union_pw_aff(arg1) 864 except: 865 raise 866 ctx = arg0.ctx 867 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)) 868 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 869 return obj 870 @staticmethod 871 def zero(arg0): 872 try: 873 if not arg0.__class__ is space: 874 arg0 = space(arg0) 875 except: 876 raise 877 ctx = arg0.ctx 878 res = isl.isl_multi_union_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 879 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 880 return obj 881 882isl.isl_multi_union_pw_aff_from_multi_pw_aff.restype = c_void_p 883isl.isl_multi_union_pw_aff_from_multi_pw_aff.argtypes = [c_void_p] 884isl.isl_multi_union_pw_aff_from_union_pw_aff.restype = c_void_p 885isl.isl_multi_union_pw_aff_from_union_pw_aff.argtypes = [c_void_p] 886isl.isl_multi_union_pw_aff_from_union_pw_aff_list.restype = c_void_p 887isl.isl_multi_union_pw_aff_from_union_pw_aff_list.argtypes = [c_void_p, c_void_p] 888isl.isl_multi_union_pw_aff_read_from_str.restype = c_void_p 889isl.isl_multi_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 890isl.isl_multi_union_pw_aff_add.restype = c_void_p 891isl.isl_multi_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 892isl.isl_multi_union_pw_aff_get_at.restype = c_void_p 893isl.isl_multi_union_pw_aff_get_at.argtypes = [c_void_p, c_int] 894isl.isl_multi_union_pw_aff_bind.restype = c_void_p 895isl.isl_multi_union_pw_aff_bind.argtypes = [c_void_p, c_void_p] 896isl.isl_multi_union_pw_aff_coalesce.restype = c_void_p 897isl.isl_multi_union_pw_aff_coalesce.argtypes = [c_void_p] 898isl.isl_multi_union_pw_aff_domain.restype = c_void_p 899isl.isl_multi_union_pw_aff_domain.argtypes = [c_void_p] 900isl.isl_multi_union_pw_aff_flat_range_product.restype = c_void_p 901isl.isl_multi_union_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 902isl.isl_multi_union_pw_aff_gist.restype = c_void_p 903isl.isl_multi_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 904isl.isl_multi_union_pw_aff_has_range_tuple_id.argtypes = [c_void_p] 905isl.isl_multi_union_pw_aff_intersect_domain.restype = c_void_p 906isl.isl_multi_union_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 907isl.isl_multi_union_pw_aff_intersect_params.restype = c_void_p 908isl.isl_multi_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 909isl.isl_multi_union_pw_aff_involves_nan.argtypes = [c_void_p] 910isl.isl_multi_union_pw_aff_get_list.restype = c_void_p 911isl.isl_multi_union_pw_aff_get_list.argtypes = [c_void_p] 912isl.isl_multi_union_pw_aff_neg.restype = c_void_p 913isl.isl_multi_union_pw_aff_neg.argtypes = [c_void_p] 914isl.isl_multi_union_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 915isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 916isl.isl_multi_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 917isl.isl_multi_union_pw_aff_range_product.restype = c_void_p 918isl.isl_multi_union_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 919isl.isl_multi_union_pw_aff_get_range_tuple_id.restype = c_void_p 920isl.isl_multi_union_pw_aff_get_range_tuple_id.argtypes = [c_void_p] 921isl.isl_multi_union_pw_aff_reset_range_tuple_id.restype = c_void_p 922isl.isl_multi_union_pw_aff_reset_range_tuple_id.argtypes = [c_void_p] 923isl.isl_multi_union_pw_aff_scale_multi_val.restype = c_void_p 924isl.isl_multi_union_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 925isl.isl_multi_union_pw_aff_scale_val.restype = c_void_p 926isl.isl_multi_union_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 927isl.isl_multi_union_pw_aff_scale_down_multi_val.restype = c_void_p 928isl.isl_multi_union_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 929isl.isl_multi_union_pw_aff_scale_down_val.restype = c_void_p 930isl.isl_multi_union_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 931isl.isl_multi_union_pw_aff_set_at.restype = c_void_p 932isl.isl_multi_union_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 933isl.isl_multi_union_pw_aff_set_range_tuple_id.restype = c_void_p 934isl.isl_multi_union_pw_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 935isl.isl_multi_union_pw_aff_size.argtypes = [c_void_p] 936isl.isl_multi_union_pw_aff_get_space.restype = c_void_p 937isl.isl_multi_union_pw_aff_get_space.argtypes = [c_void_p] 938isl.isl_multi_union_pw_aff_sub.restype = c_void_p 939isl.isl_multi_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 940isl.isl_multi_union_pw_aff_union_add.restype = c_void_p 941isl.isl_multi_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 942isl.isl_multi_union_pw_aff_zero.restype = c_void_p 943isl.isl_multi_union_pw_aff_zero.argtypes = [c_void_p] 944isl.isl_multi_union_pw_aff_copy.restype = c_void_p 945isl.isl_multi_union_pw_aff_copy.argtypes = [c_void_p] 946isl.isl_multi_union_pw_aff_free.restype = c_void_p 947isl.isl_multi_union_pw_aff_free.argtypes = [c_void_p] 948isl.isl_multi_union_pw_aff_to_str.restype = POINTER(c_char) 949isl.isl_multi_union_pw_aff_to_str.argtypes = [c_void_p] 950 951class union_pw_aff(union_pw_multi_aff, multi_union_pw_aff): 952 def __init__(self, *args, **keywords): 953 if "ptr" in keywords: 954 self.ctx = keywords["ctx"] 955 self.ptr = keywords["ptr"] 956 return 957 if len(args) == 1 and args[0].__class__ is aff: 958 self.ctx = Context.getDefaultInstance() 959 self.ptr = isl.isl_union_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 960 return 961 if len(args) == 1 and args[0].__class__ is pw_aff: 962 self.ctx = Context.getDefaultInstance() 963 self.ptr = isl.isl_union_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 964 return 965 if len(args) == 1 and type(args[0]) == str: 966 self.ctx = Context.getDefaultInstance() 967 self.ptr = isl.isl_union_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 968 return 969 raise Error 970 def __del__(self): 971 if hasattr(self, 'ptr'): 972 isl.isl_union_pw_aff_free(self.ptr) 973 def __str__(arg0): 974 try: 975 if not arg0.__class__ is union_pw_aff: 976 arg0 = union_pw_aff(arg0) 977 except: 978 raise 979 ptr = isl.isl_union_pw_aff_to_str(arg0.ptr) 980 res = cast(ptr, c_char_p).value.decode('ascii') 981 libc.free(ptr) 982 return res 983 def __repr__(self): 984 s = str(self) 985 if '"' in s: 986 return 'isl.union_pw_aff("""%s""")' % s 987 else: 988 return 'isl.union_pw_aff("%s")' % s 989 def add(arg0, arg1): 990 try: 991 if not arg0.__class__ is union_pw_aff: 992 arg0 = union_pw_aff(arg0) 993 except: 994 raise 995 try: 996 if not arg1.__class__ is union_pw_aff: 997 arg1 = union_pw_aff(arg1) 998 except: 999 return union_pw_multi_aff(arg0).add(arg1) 1000 ctx = arg0.ctx 1001 res = isl.isl_union_pw_aff_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1002 obj = union_pw_aff(ctx=ctx, ptr=res) 1003 return obj 1004 def bind(*args): 1005 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 1006 args = list(args) 1007 try: 1008 if not args[1].__class__ is id: 1009 args[1] = id(args[1]) 1010 except: 1011 raise 1012 ctx = args[0].ctx 1013 res = isl.isl_union_pw_aff_bind_id(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 1014 obj = union_set(ctx=ctx, ptr=res) 1015 return obj 1016 raise Error 1017 def coalesce(arg0): 1018 try: 1019 if not arg0.__class__ is union_pw_aff: 1020 arg0 = union_pw_aff(arg0) 1021 except: 1022 raise 1023 ctx = arg0.ctx 1024 res = isl.isl_union_pw_aff_coalesce(isl.isl_union_pw_aff_copy(arg0.ptr)) 1025 obj = union_pw_aff(ctx=ctx, ptr=res) 1026 return obj 1027 def domain(arg0): 1028 try: 1029 if not arg0.__class__ is union_pw_aff: 1030 arg0 = union_pw_aff(arg0) 1031 except: 1032 raise 1033 ctx = arg0.ctx 1034 res = isl.isl_union_pw_aff_domain(isl.isl_union_pw_aff_copy(arg0.ptr)) 1035 obj = union_set(ctx=ctx, ptr=res) 1036 return obj 1037 def gist(arg0, arg1): 1038 try: 1039 if not arg0.__class__ is union_pw_aff: 1040 arg0 = union_pw_aff(arg0) 1041 except: 1042 raise 1043 try: 1044 if not arg1.__class__ is union_set: 1045 arg1 = union_set(arg1) 1046 except: 1047 return union_pw_multi_aff(arg0).gist(arg1) 1048 ctx = arg0.ctx 1049 res = isl.isl_union_pw_aff_gist(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 1050 obj = union_pw_aff(ctx=ctx, ptr=res) 1051 return obj 1052 def intersect_domain(*args): 1053 if len(args) == 2 and args[1].__class__ is space: 1054 ctx = args[0].ctx 1055 res = isl.isl_union_pw_aff_intersect_domain_space(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 1056 obj = union_pw_aff(ctx=ctx, ptr=res) 1057 return obj 1058 if len(args) == 2 and args[1].__class__ is union_set: 1059 ctx = args[0].ctx 1060 res = isl.isl_union_pw_aff_intersect_domain_union_set(isl.isl_union_pw_aff_copy(args[0].ptr), isl.isl_union_set_copy(args[1].ptr)) 1061 obj = union_pw_aff(ctx=ctx, ptr=res) 1062 return obj 1063 raise Error 1064 def intersect_domain_wrapped_domain(arg0, arg1): 1065 try: 1066 if not arg0.__class__ is union_pw_aff: 1067 arg0 = union_pw_aff(arg0) 1068 except: 1069 raise 1070 try: 1071 if not arg1.__class__ is union_set: 1072 arg1 = union_set(arg1) 1073 except: 1074 return union_pw_multi_aff(arg0).intersect_domain_wrapped_domain(arg1) 1075 ctx = arg0.ctx 1076 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)) 1077 obj = union_pw_aff(ctx=ctx, ptr=res) 1078 return obj 1079 def intersect_domain_wrapped_range(arg0, arg1): 1080 try: 1081 if not arg0.__class__ is union_pw_aff: 1082 arg0 = union_pw_aff(arg0) 1083 except: 1084 raise 1085 try: 1086 if not arg1.__class__ is union_set: 1087 arg1 = union_set(arg1) 1088 except: 1089 return union_pw_multi_aff(arg0).intersect_domain_wrapped_range(arg1) 1090 ctx = arg0.ctx 1091 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)) 1092 obj = union_pw_aff(ctx=ctx, ptr=res) 1093 return obj 1094 def intersect_params(arg0, arg1): 1095 try: 1096 if not arg0.__class__ is union_pw_aff: 1097 arg0 = union_pw_aff(arg0) 1098 except: 1099 raise 1100 try: 1101 if not arg1.__class__ is set: 1102 arg1 = set(arg1) 1103 except: 1104 return union_pw_multi_aff(arg0).intersect_params(arg1) 1105 ctx = arg0.ctx 1106 res = isl.isl_union_pw_aff_intersect_params(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1107 obj = union_pw_aff(ctx=ctx, ptr=res) 1108 return obj 1109 def pullback(*args): 1110 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 1111 ctx = args[0].ctx 1112 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)) 1113 obj = union_pw_aff(ctx=ctx, ptr=res) 1114 return obj 1115 raise Error 1116 def space(arg0): 1117 try: 1118 if not arg0.__class__ is union_pw_aff: 1119 arg0 = union_pw_aff(arg0) 1120 except: 1121 raise 1122 ctx = arg0.ctx 1123 res = isl.isl_union_pw_aff_get_space(arg0.ptr) 1124 obj = space(ctx=ctx, ptr=res) 1125 return obj 1126 def get_space(arg0): 1127 return arg0.space() 1128 def sub(arg0, arg1): 1129 try: 1130 if not arg0.__class__ is union_pw_aff: 1131 arg0 = union_pw_aff(arg0) 1132 except: 1133 raise 1134 try: 1135 if not arg1.__class__ is union_pw_aff: 1136 arg1 = union_pw_aff(arg1) 1137 except: 1138 return union_pw_multi_aff(arg0).sub(arg1) 1139 ctx = arg0.ctx 1140 res = isl.isl_union_pw_aff_sub(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1141 obj = union_pw_aff(ctx=ctx, ptr=res) 1142 return obj 1143 def subtract_domain(*args): 1144 if len(args) == 2 and args[1].__class__ is space: 1145 ctx = args[0].ctx 1146 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)) 1147 obj = union_pw_aff(ctx=ctx, ptr=res) 1148 return obj 1149 if len(args) == 2 and args[1].__class__ is union_set: 1150 ctx = args[0].ctx 1151 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)) 1152 obj = union_pw_aff(ctx=ctx, ptr=res) 1153 return obj 1154 raise Error 1155 def to_list(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_to_list(isl.isl_union_pw_aff_copy(arg0.ptr)) 1163 obj = union_pw_aff_list(ctx=ctx, ptr=res) 1164 return obj 1165 def union_add(arg0, arg1): 1166 try: 1167 if not arg0.__class__ is union_pw_aff: 1168 arg0 = union_pw_aff(arg0) 1169 except: 1170 raise 1171 try: 1172 if not arg1.__class__ is union_pw_aff: 1173 arg1 = union_pw_aff(arg1) 1174 except: 1175 return union_pw_multi_aff(arg0).union_add(arg1) 1176 ctx = arg0.ctx 1177 res = isl.isl_union_pw_aff_union_add(isl.isl_union_pw_aff_copy(arg0.ptr), isl.isl_union_pw_aff_copy(arg1.ptr)) 1178 obj = union_pw_aff(ctx=ctx, ptr=res) 1179 return obj 1180 1181isl.isl_union_pw_aff_from_aff.restype = c_void_p 1182isl.isl_union_pw_aff_from_aff.argtypes = [c_void_p] 1183isl.isl_union_pw_aff_from_pw_aff.restype = c_void_p 1184isl.isl_union_pw_aff_from_pw_aff.argtypes = [c_void_p] 1185isl.isl_union_pw_aff_read_from_str.restype = c_void_p 1186isl.isl_union_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1187isl.isl_union_pw_aff_add.restype = c_void_p 1188isl.isl_union_pw_aff_add.argtypes = [c_void_p, c_void_p] 1189isl.isl_union_pw_aff_bind_id.restype = c_void_p 1190isl.isl_union_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 1191isl.isl_union_pw_aff_coalesce.restype = c_void_p 1192isl.isl_union_pw_aff_coalesce.argtypes = [c_void_p] 1193isl.isl_union_pw_aff_domain.restype = c_void_p 1194isl.isl_union_pw_aff_domain.argtypes = [c_void_p] 1195isl.isl_union_pw_aff_gist.restype = c_void_p 1196isl.isl_union_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1197isl.isl_union_pw_aff_intersect_domain_space.restype = c_void_p 1198isl.isl_union_pw_aff_intersect_domain_space.argtypes = [c_void_p, c_void_p] 1199isl.isl_union_pw_aff_intersect_domain_union_set.restype = c_void_p 1200isl.isl_union_pw_aff_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 1201isl.isl_union_pw_aff_intersect_domain_wrapped_domain.restype = c_void_p 1202isl.isl_union_pw_aff_intersect_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 1203isl.isl_union_pw_aff_intersect_domain_wrapped_range.restype = c_void_p 1204isl.isl_union_pw_aff_intersect_domain_wrapped_range.argtypes = [c_void_p, c_void_p] 1205isl.isl_union_pw_aff_intersect_params.restype = c_void_p 1206isl.isl_union_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1207isl.isl_union_pw_aff_pullback_union_pw_multi_aff.restype = c_void_p 1208isl.isl_union_pw_aff_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1209isl.isl_union_pw_aff_get_space.restype = c_void_p 1210isl.isl_union_pw_aff_get_space.argtypes = [c_void_p] 1211isl.isl_union_pw_aff_sub.restype = c_void_p 1212isl.isl_union_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1213isl.isl_union_pw_aff_subtract_domain_space.restype = c_void_p 1214isl.isl_union_pw_aff_subtract_domain_space.argtypes = [c_void_p, c_void_p] 1215isl.isl_union_pw_aff_subtract_domain_union_set.restype = c_void_p 1216isl.isl_union_pw_aff_subtract_domain_union_set.argtypes = [c_void_p, c_void_p] 1217isl.isl_union_pw_aff_to_list.restype = c_void_p 1218isl.isl_union_pw_aff_to_list.argtypes = [c_void_p] 1219isl.isl_union_pw_aff_union_add.restype = c_void_p 1220isl.isl_union_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1221isl.isl_union_pw_aff_copy.restype = c_void_p 1222isl.isl_union_pw_aff_copy.argtypes = [c_void_p] 1223isl.isl_union_pw_aff_free.restype = c_void_p 1224isl.isl_union_pw_aff_free.argtypes = [c_void_p] 1225isl.isl_union_pw_aff_to_str.restype = POINTER(c_char) 1226isl.isl_union_pw_aff_to_str.argtypes = [c_void_p] 1227 1228class multi_pw_aff(multi_union_pw_aff): 1229 def __init__(self, *args, **keywords): 1230 if "ptr" in keywords: 1231 self.ctx = keywords["ctx"] 1232 self.ptr = keywords["ptr"] 1233 return 1234 if len(args) == 1 and args[0].__class__ is aff: 1235 self.ctx = Context.getDefaultInstance() 1236 self.ptr = isl.isl_multi_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 1237 return 1238 if len(args) == 1 and args[0].__class__ is multi_aff: 1239 self.ctx = Context.getDefaultInstance() 1240 self.ptr = isl.isl_multi_pw_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 1241 return 1242 if len(args) == 1 and args[0].__class__ is pw_aff: 1243 self.ctx = Context.getDefaultInstance() 1244 self.ptr = isl.isl_multi_pw_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1245 return 1246 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is pw_aff_list: 1247 self.ctx = Context.getDefaultInstance() 1248 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)) 1249 return 1250 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 1251 self.ctx = Context.getDefaultInstance() 1252 self.ptr = isl.isl_multi_pw_aff_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 1253 return 1254 if len(args) == 1 and type(args[0]) == str: 1255 self.ctx = Context.getDefaultInstance() 1256 self.ptr = isl.isl_multi_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1257 return 1258 raise Error 1259 def __del__(self): 1260 if hasattr(self, 'ptr'): 1261 isl.isl_multi_pw_aff_free(self.ptr) 1262 def __str__(arg0): 1263 try: 1264 if not arg0.__class__ is multi_pw_aff: 1265 arg0 = multi_pw_aff(arg0) 1266 except: 1267 raise 1268 ptr = isl.isl_multi_pw_aff_to_str(arg0.ptr) 1269 res = cast(ptr, c_char_p).value.decode('ascii') 1270 libc.free(ptr) 1271 return res 1272 def __repr__(self): 1273 s = str(self) 1274 if '"' in s: 1275 return 'isl.multi_pw_aff("""%s""")' % s 1276 else: 1277 return 'isl.multi_pw_aff("%s")' % s 1278 def add(arg0, arg1): 1279 try: 1280 if not arg0.__class__ is multi_pw_aff: 1281 arg0 = multi_pw_aff(arg0) 1282 except: 1283 raise 1284 try: 1285 if not arg1.__class__ is multi_pw_aff: 1286 arg1 = multi_pw_aff(arg1) 1287 except: 1288 return multi_union_pw_aff(arg0).add(arg1) 1289 ctx = arg0.ctx 1290 res = isl.isl_multi_pw_aff_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1291 obj = multi_pw_aff(ctx=ctx, ptr=res) 1292 return obj 1293 def add_constant(*args): 1294 if len(args) == 2 and args[1].__class__ is multi_val: 1295 ctx = args[0].ctx 1296 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)) 1297 obj = multi_pw_aff(ctx=ctx, ptr=res) 1298 return obj 1299 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1300 args = list(args) 1301 try: 1302 if not args[1].__class__ is val: 1303 args[1] = val(args[1]) 1304 except: 1305 raise 1306 ctx = args[0].ctx 1307 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)) 1308 obj = multi_pw_aff(ctx=ctx, ptr=res) 1309 return obj 1310 raise Error 1311 def as_map(arg0): 1312 try: 1313 if not arg0.__class__ is multi_pw_aff: 1314 arg0 = multi_pw_aff(arg0) 1315 except: 1316 raise 1317 ctx = arg0.ctx 1318 res = isl.isl_multi_pw_aff_as_map(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1319 obj = map(ctx=ctx, ptr=res) 1320 return obj 1321 def as_multi_aff(arg0): 1322 try: 1323 if not arg0.__class__ is multi_pw_aff: 1324 arg0 = multi_pw_aff(arg0) 1325 except: 1326 raise 1327 ctx = arg0.ctx 1328 res = isl.isl_multi_pw_aff_as_multi_aff(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1329 obj = multi_aff(ctx=ctx, ptr=res) 1330 return obj 1331 def as_set(arg0): 1332 try: 1333 if not arg0.__class__ is multi_pw_aff: 1334 arg0 = multi_pw_aff(arg0) 1335 except: 1336 raise 1337 ctx = arg0.ctx 1338 res = isl.isl_multi_pw_aff_as_set(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1339 obj = set(ctx=ctx, ptr=res) 1340 return obj 1341 def at(arg0, arg1): 1342 try: 1343 if not arg0.__class__ is multi_pw_aff: 1344 arg0 = multi_pw_aff(arg0) 1345 except: 1346 raise 1347 ctx = arg0.ctx 1348 res = isl.isl_multi_pw_aff_get_at(arg0.ptr, arg1) 1349 obj = pw_aff(ctx=ctx, ptr=res) 1350 return obj 1351 def get_at(arg0, arg1): 1352 return arg0.at(arg1) 1353 def bind(arg0, arg1): 1354 try: 1355 if not arg0.__class__ is multi_pw_aff: 1356 arg0 = multi_pw_aff(arg0) 1357 except: 1358 raise 1359 try: 1360 if not arg1.__class__ is multi_id: 1361 arg1 = multi_id(arg1) 1362 except: 1363 return multi_union_pw_aff(arg0).bind(arg1) 1364 ctx = arg0.ctx 1365 res = isl.isl_multi_pw_aff_bind(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1366 obj = set(ctx=ctx, ptr=res) 1367 return obj 1368 def bind_domain(arg0, arg1): 1369 try: 1370 if not arg0.__class__ is multi_pw_aff: 1371 arg0 = multi_pw_aff(arg0) 1372 except: 1373 raise 1374 try: 1375 if not arg1.__class__ is multi_id: 1376 arg1 = multi_id(arg1) 1377 except: 1378 return multi_union_pw_aff(arg0).bind_domain(arg1) 1379 ctx = arg0.ctx 1380 res = isl.isl_multi_pw_aff_bind_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 1381 obj = multi_pw_aff(ctx=ctx, ptr=res) 1382 return obj 1383 def bind_domain_wrapped_domain(arg0, arg1): 1384 try: 1385 if not arg0.__class__ is multi_pw_aff: 1386 arg0 = multi_pw_aff(arg0) 1387 except: 1388 raise 1389 try: 1390 if not arg1.__class__ is multi_id: 1391 arg1 = multi_id(arg1) 1392 except: 1393 return multi_union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 1394 ctx = arg0.ctx 1395 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)) 1396 obj = multi_pw_aff(ctx=ctx, ptr=res) 1397 return obj 1398 def coalesce(arg0): 1399 try: 1400 if not arg0.__class__ is multi_pw_aff: 1401 arg0 = multi_pw_aff(arg0) 1402 except: 1403 raise 1404 ctx = arg0.ctx 1405 res = isl.isl_multi_pw_aff_coalesce(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1406 obj = multi_pw_aff(ctx=ctx, ptr=res) 1407 return obj 1408 def domain(arg0): 1409 try: 1410 if not arg0.__class__ is multi_pw_aff: 1411 arg0 = multi_pw_aff(arg0) 1412 except: 1413 raise 1414 ctx = arg0.ctx 1415 res = isl.isl_multi_pw_aff_domain(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1416 obj = set(ctx=ctx, ptr=res) 1417 return obj 1418 def flat_range_product(arg0, arg1): 1419 try: 1420 if not arg0.__class__ is multi_pw_aff: 1421 arg0 = multi_pw_aff(arg0) 1422 except: 1423 raise 1424 try: 1425 if not arg1.__class__ is multi_pw_aff: 1426 arg1 = multi_pw_aff(arg1) 1427 except: 1428 return multi_union_pw_aff(arg0).flat_range_product(arg1) 1429 ctx = arg0.ctx 1430 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)) 1431 obj = multi_pw_aff(ctx=ctx, ptr=res) 1432 return obj 1433 def gist(arg0, arg1): 1434 try: 1435 if not arg0.__class__ is multi_pw_aff: 1436 arg0 = multi_pw_aff(arg0) 1437 except: 1438 raise 1439 try: 1440 if not arg1.__class__ is set: 1441 arg1 = set(arg1) 1442 except: 1443 return multi_union_pw_aff(arg0).gist(arg1) 1444 ctx = arg0.ctx 1445 res = isl.isl_multi_pw_aff_gist(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1446 obj = multi_pw_aff(ctx=ctx, ptr=res) 1447 return obj 1448 def has_range_tuple_id(arg0): 1449 try: 1450 if not arg0.__class__ is multi_pw_aff: 1451 arg0 = multi_pw_aff(arg0) 1452 except: 1453 raise 1454 ctx = arg0.ctx 1455 res = isl.isl_multi_pw_aff_has_range_tuple_id(arg0.ptr) 1456 if res < 0: 1457 raise 1458 return bool(res) 1459 def identity(*args): 1460 if len(args) == 1: 1461 ctx = args[0].ctx 1462 res = isl.isl_multi_pw_aff_identity_multi_pw_aff(isl.isl_multi_pw_aff_copy(args[0].ptr)) 1463 obj = multi_pw_aff(ctx=ctx, ptr=res) 1464 return obj 1465 raise Error 1466 @staticmethod 1467 def identity_on_domain(*args): 1468 if len(args) == 1 and args[0].__class__ is space: 1469 ctx = args[0].ctx 1470 res = isl.isl_multi_pw_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 1471 obj = multi_pw_aff(ctx=ctx, ptr=res) 1472 return obj 1473 raise Error 1474 def insert_domain(arg0, arg1): 1475 try: 1476 if not arg0.__class__ is multi_pw_aff: 1477 arg0 = multi_pw_aff(arg0) 1478 except: 1479 raise 1480 try: 1481 if not arg1.__class__ is space: 1482 arg1 = space(arg1) 1483 except: 1484 return multi_union_pw_aff(arg0).insert_domain(arg1) 1485 ctx = arg0.ctx 1486 res = isl.isl_multi_pw_aff_insert_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 1487 obj = multi_pw_aff(ctx=ctx, ptr=res) 1488 return obj 1489 def intersect_domain(arg0, arg1): 1490 try: 1491 if not arg0.__class__ is multi_pw_aff: 1492 arg0 = multi_pw_aff(arg0) 1493 except: 1494 raise 1495 try: 1496 if not arg1.__class__ is set: 1497 arg1 = set(arg1) 1498 except: 1499 return multi_union_pw_aff(arg0).intersect_domain(arg1) 1500 ctx = arg0.ctx 1501 res = isl.isl_multi_pw_aff_intersect_domain(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1502 obj = multi_pw_aff(ctx=ctx, ptr=res) 1503 return obj 1504 def intersect_params(arg0, arg1): 1505 try: 1506 if not arg0.__class__ is multi_pw_aff: 1507 arg0 = multi_pw_aff(arg0) 1508 except: 1509 raise 1510 try: 1511 if not arg1.__class__ is set: 1512 arg1 = set(arg1) 1513 except: 1514 return multi_union_pw_aff(arg0).intersect_params(arg1) 1515 ctx = arg0.ctx 1516 res = isl.isl_multi_pw_aff_intersect_params(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 1517 obj = multi_pw_aff(ctx=ctx, ptr=res) 1518 return obj 1519 def involves_nan(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_involves_nan(arg0.ptr) 1527 if res < 0: 1528 raise 1529 return bool(res) 1530 def involves_param(*args): 1531 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 1532 args = list(args) 1533 try: 1534 if not args[1].__class__ is id: 1535 args[1] = id(args[1]) 1536 except: 1537 raise 1538 ctx = args[0].ctx 1539 res = isl.isl_multi_pw_aff_involves_param_id(args[0].ptr, args[1].ptr) 1540 if res < 0: 1541 raise 1542 return bool(res) 1543 if len(args) == 2 and args[1].__class__ is id_list: 1544 ctx = args[0].ctx 1545 res = isl.isl_multi_pw_aff_involves_param_id_list(args[0].ptr, args[1].ptr) 1546 if res < 0: 1547 raise 1548 return bool(res) 1549 raise Error 1550 def isa_multi_aff(arg0): 1551 try: 1552 if not arg0.__class__ is multi_pw_aff: 1553 arg0 = multi_pw_aff(arg0) 1554 except: 1555 raise 1556 ctx = arg0.ctx 1557 res = isl.isl_multi_pw_aff_isa_multi_aff(arg0.ptr) 1558 if res < 0: 1559 raise 1560 return bool(res) 1561 def list(arg0): 1562 try: 1563 if not arg0.__class__ is multi_pw_aff: 1564 arg0 = multi_pw_aff(arg0) 1565 except: 1566 raise 1567 ctx = arg0.ctx 1568 res = isl.isl_multi_pw_aff_get_list(arg0.ptr) 1569 obj = pw_aff_list(ctx=ctx, ptr=res) 1570 return obj 1571 def get_list(arg0): 1572 return arg0.list() 1573 def max(arg0, arg1): 1574 try: 1575 if not arg0.__class__ is multi_pw_aff: 1576 arg0 = multi_pw_aff(arg0) 1577 except: 1578 raise 1579 try: 1580 if not arg1.__class__ is multi_pw_aff: 1581 arg1 = multi_pw_aff(arg1) 1582 except: 1583 return multi_union_pw_aff(arg0).max(arg1) 1584 ctx = arg0.ctx 1585 res = isl.isl_multi_pw_aff_max(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1586 obj = multi_pw_aff(ctx=ctx, ptr=res) 1587 return obj 1588 def max_multi_val(arg0): 1589 try: 1590 if not arg0.__class__ is multi_pw_aff: 1591 arg0 = multi_pw_aff(arg0) 1592 except: 1593 raise 1594 ctx = arg0.ctx 1595 res = isl.isl_multi_pw_aff_max_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1596 obj = multi_val(ctx=ctx, ptr=res) 1597 return obj 1598 def min(arg0, arg1): 1599 try: 1600 if not arg0.__class__ is multi_pw_aff: 1601 arg0 = multi_pw_aff(arg0) 1602 except: 1603 raise 1604 try: 1605 if not arg1.__class__ is multi_pw_aff: 1606 arg1 = multi_pw_aff(arg1) 1607 except: 1608 return multi_union_pw_aff(arg0).min(arg1) 1609 ctx = arg0.ctx 1610 res = isl.isl_multi_pw_aff_min(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1611 obj = multi_pw_aff(ctx=ctx, ptr=res) 1612 return obj 1613 def min_multi_val(arg0): 1614 try: 1615 if not arg0.__class__ is multi_pw_aff: 1616 arg0 = multi_pw_aff(arg0) 1617 except: 1618 raise 1619 ctx = arg0.ctx 1620 res = isl.isl_multi_pw_aff_min_multi_val(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1621 obj = multi_val(ctx=ctx, ptr=res) 1622 return obj 1623 def neg(arg0): 1624 try: 1625 if not arg0.__class__ is multi_pw_aff: 1626 arg0 = multi_pw_aff(arg0) 1627 except: 1628 raise 1629 ctx = arg0.ctx 1630 res = isl.isl_multi_pw_aff_neg(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1631 obj = multi_pw_aff(ctx=ctx, ptr=res) 1632 return obj 1633 def plain_is_equal(arg0, arg1): 1634 try: 1635 if not arg0.__class__ is multi_pw_aff: 1636 arg0 = multi_pw_aff(arg0) 1637 except: 1638 raise 1639 try: 1640 if not arg1.__class__ is multi_pw_aff: 1641 arg1 = multi_pw_aff(arg1) 1642 except: 1643 return multi_union_pw_aff(arg0).plain_is_equal(arg1) 1644 ctx = arg0.ctx 1645 res = isl.isl_multi_pw_aff_plain_is_equal(arg0.ptr, arg1.ptr) 1646 if res < 0: 1647 raise 1648 return bool(res) 1649 def product(arg0, arg1): 1650 try: 1651 if not arg0.__class__ is multi_pw_aff: 1652 arg0 = multi_pw_aff(arg0) 1653 except: 1654 raise 1655 try: 1656 if not arg1.__class__ is multi_pw_aff: 1657 arg1 = multi_pw_aff(arg1) 1658 except: 1659 return multi_union_pw_aff(arg0).product(arg1) 1660 ctx = arg0.ctx 1661 res = isl.isl_multi_pw_aff_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1662 obj = multi_pw_aff(ctx=ctx, ptr=res) 1663 return obj 1664 def pullback(*args): 1665 if len(args) == 2 and args[1].__class__ is multi_aff: 1666 ctx = args[0].ctx 1667 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)) 1668 obj = multi_pw_aff(ctx=ctx, ptr=res) 1669 return obj 1670 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 1671 ctx = args[0].ctx 1672 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)) 1673 obj = multi_pw_aff(ctx=ctx, ptr=res) 1674 return obj 1675 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 1676 ctx = args[0].ctx 1677 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)) 1678 obj = multi_pw_aff(ctx=ctx, ptr=res) 1679 return obj 1680 raise Error 1681 def range_product(arg0, arg1): 1682 try: 1683 if not arg0.__class__ is multi_pw_aff: 1684 arg0 = multi_pw_aff(arg0) 1685 except: 1686 raise 1687 try: 1688 if not arg1.__class__ is multi_pw_aff: 1689 arg1 = multi_pw_aff(arg1) 1690 except: 1691 return multi_union_pw_aff(arg0).range_product(arg1) 1692 ctx = arg0.ctx 1693 res = isl.isl_multi_pw_aff_range_product(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1694 obj = multi_pw_aff(ctx=ctx, ptr=res) 1695 return obj 1696 def range_tuple_id(arg0): 1697 try: 1698 if not arg0.__class__ is multi_pw_aff: 1699 arg0 = multi_pw_aff(arg0) 1700 except: 1701 raise 1702 ctx = arg0.ctx 1703 res = isl.isl_multi_pw_aff_get_range_tuple_id(arg0.ptr) 1704 obj = id(ctx=ctx, ptr=res) 1705 return obj 1706 def get_range_tuple_id(arg0): 1707 return arg0.range_tuple_id() 1708 def reset_range_tuple_id(arg0): 1709 try: 1710 if not arg0.__class__ is multi_pw_aff: 1711 arg0 = multi_pw_aff(arg0) 1712 except: 1713 raise 1714 ctx = arg0.ctx 1715 res = isl.isl_multi_pw_aff_reset_range_tuple_id(isl.isl_multi_pw_aff_copy(arg0.ptr)) 1716 obj = multi_pw_aff(ctx=ctx, ptr=res) 1717 return obj 1718 def scale(*args): 1719 if len(args) == 2 and args[1].__class__ is multi_val: 1720 ctx = args[0].ctx 1721 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)) 1722 obj = multi_pw_aff(ctx=ctx, ptr=res) 1723 return obj 1724 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1725 args = list(args) 1726 try: 1727 if not args[1].__class__ is val: 1728 args[1] = val(args[1]) 1729 except: 1730 raise 1731 ctx = args[0].ctx 1732 res = isl.isl_multi_pw_aff_scale_val(isl.isl_multi_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 1733 obj = multi_pw_aff(ctx=ctx, ptr=res) 1734 return obj 1735 raise Error 1736 def scale_down(*args): 1737 if len(args) == 2 and args[1].__class__ is multi_val: 1738 ctx = args[0].ctx 1739 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)) 1740 obj = multi_pw_aff(ctx=ctx, ptr=res) 1741 return obj 1742 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 1743 args = list(args) 1744 try: 1745 if not args[1].__class__ is val: 1746 args[1] = val(args[1]) 1747 except: 1748 raise 1749 ctx = args[0].ctx 1750 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)) 1751 obj = multi_pw_aff(ctx=ctx, ptr=res) 1752 return obj 1753 raise Error 1754 def set_at(arg0, arg1, arg2): 1755 try: 1756 if not arg0.__class__ is multi_pw_aff: 1757 arg0 = multi_pw_aff(arg0) 1758 except: 1759 raise 1760 try: 1761 if not arg2.__class__ is pw_aff: 1762 arg2 = pw_aff(arg2) 1763 except: 1764 return multi_union_pw_aff(arg0).set_at(arg1, arg2) 1765 ctx = arg0.ctx 1766 res = isl.isl_multi_pw_aff_set_at(isl.isl_multi_pw_aff_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 1767 obj = multi_pw_aff(ctx=ctx, ptr=res) 1768 return obj 1769 def set_range_tuple(*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[1].__class__ is id: 1774 args[1] = id(args[1]) 1775 except: 1776 raise 1777 ctx = args[0].ctx 1778 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)) 1779 obj = multi_pw_aff(ctx=ctx, ptr=res) 1780 return obj 1781 raise Error 1782 def size(arg0): 1783 try: 1784 if not arg0.__class__ is multi_pw_aff: 1785 arg0 = multi_pw_aff(arg0) 1786 except: 1787 raise 1788 ctx = arg0.ctx 1789 res = isl.isl_multi_pw_aff_size(arg0.ptr) 1790 if res < 0: 1791 raise 1792 return int(res) 1793 def space(arg0): 1794 try: 1795 if not arg0.__class__ is multi_pw_aff: 1796 arg0 = multi_pw_aff(arg0) 1797 except: 1798 raise 1799 ctx = arg0.ctx 1800 res = isl.isl_multi_pw_aff_get_space(arg0.ptr) 1801 obj = space(ctx=ctx, ptr=res) 1802 return obj 1803 def get_space(arg0): 1804 return arg0.space() 1805 def sub(arg0, arg1): 1806 try: 1807 if not arg0.__class__ is multi_pw_aff: 1808 arg0 = multi_pw_aff(arg0) 1809 except: 1810 raise 1811 try: 1812 if not arg1.__class__ is multi_pw_aff: 1813 arg1 = multi_pw_aff(arg1) 1814 except: 1815 return multi_union_pw_aff(arg0).sub(arg1) 1816 ctx = arg0.ctx 1817 res = isl.isl_multi_pw_aff_sub(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1818 obj = multi_pw_aff(ctx=ctx, ptr=res) 1819 return obj 1820 def unbind_params_insert_domain(arg0, arg1): 1821 try: 1822 if not arg0.__class__ is multi_pw_aff: 1823 arg0 = multi_pw_aff(arg0) 1824 except: 1825 raise 1826 try: 1827 if not arg1.__class__ is multi_id: 1828 arg1 = multi_id(arg1) 1829 except: 1830 return multi_union_pw_aff(arg0).unbind_params_insert_domain(arg1) 1831 ctx = arg0.ctx 1832 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)) 1833 obj = multi_pw_aff(ctx=ctx, ptr=res) 1834 return obj 1835 def union_add(arg0, arg1): 1836 try: 1837 if not arg0.__class__ is multi_pw_aff: 1838 arg0 = multi_pw_aff(arg0) 1839 except: 1840 raise 1841 try: 1842 if not arg1.__class__ is multi_pw_aff: 1843 arg1 = multi_pw_aff(arg1) 1844 except: 1845 return multi_union_pw_aff(arg0).union_add(arg1) 1846 ctx = arg0.ctx 1847 res = isl.isl_multi_pw_aff_union_add(isl.isl_multi_pw_aff_copy(arg0.ptr), isl.isl_multi_pw_aff_copy(arg1.ptr)) 1848 obj = multi_pw_aff(ctx=ctx, ptr=res) 1849 return obj 1850 @staticmethod 1851 def zero(arg0): 1852 try: 1853 if not arg0.__class__ is space: 1854 arg0 = space(arg0) 1855 except: 1856 raise 1857 ctx = arg0.ctx 1858 res = isl.isl_multi_pw_aff_zero(isl.isl_space_copy(arg0.ptr)) 1859 obj = multi_pw_aff(ctx=ctx, ptr=res) 1860 return obj 1861 1862isl.isl_multi_pw_aff_from_aff.restype = c_void_p 1863isl.isl_multi_pw_aff_from_aff.argtypes = [c_void_p] 1864isl.isl_multi_pw_aff_from_multi_aff.restype = c_void_p 1865isl.isl_multi_pw_aff_from_multi_aff.argtypes = [c_void_p] 1866isl.isl_multi_pw_aff_from_pw_aff.restype = c_void_p 1867isl.isl_multi_pw_aff_from_pw_aff.argtypes = [c_void_p] 1868isl.isl_multi_pw_aff_from_pw_aff_list.restype = c_void_p 1869isl.isl_multi_pw_aff_from_pw_aff_list.argtypes = [c_void_p, c_void_p] 1870isl.isl_multi_pw_aff_from_pw_multi_aff.restype = c_void_p 1871isl.isl_multi_pw_aff_from_pw_multi_aff.argtypes = [c_void_p] 1872isl.isl_multi_pw_aff_read_from_str.restype = c_void_p 1873isl.isl_multi_pw_aff_read_from_str.argtypes = [Context, c_char_p] 1874isl.isl_multi_pw_aff_add.restype = c_void_p 1875isl.isl_multi_pw_aff_add.argtypes = [c_void_p, c_void_p] 1876isl.isl_multi_pw_aff_add_constant_multi_val.restype = c_void_p 1877isl.isl_multi_pw_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 1878isl.isl_multi_pw_aff_add_constant_val.restype = c_void_p 1879isl.isl_multi_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 1880isl.isl_multi_pw_aff_as_map.restype = c_void_p 1881isl.isl_multi_pw_aff_as_map.argtypes = [c_void_p] 1882isl.isl_multi_pw_aff_as_multi_aff.restype = c_void_p 1883isl.isl_multi_pw_aff_as_multi_aff.argtypes = [c_void_p] 1884isl.isl_multi_pw_aff_as_set.restype = c_void_p 1885isl.isl_multi_pw_aff_as_set.argtypes = [c_void_p] 1886isl.isl_multi_pw_aff_get_at.restype = c_void_p 1887isl.isl_multi_pw_aff_get_at.argtypes = [c_void_p, c_int] 1888isl.isl_multi_pw_aff_bind.restype = c_void_p 1889isl.isl_multi_pw_aff_bind.argtypes = [c_void_p, c_void_p] 1890isl.isl_multi_pw_aff_bind_domain.restype = c_void_p 1891isl.isl_multi_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 1892isl.isl_multi_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 1893isl.isl_multi_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 1894isl.isl_multi_pw_aff_coalesce.restype = c_void_p 1895isl.isl_multi_pw_aff_coalesce.argtypes = [c_void_p] 1896isl.isl_multi_pw_aff_domain.restype = c_void_p 1897isl.isl_multi_pw_aff_domain.argtypes = [c_void_p] 1898isl.isl_multi_pw_aff_flat_range_product.restype = c_void_p 1899isl.isl_multi_pw_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 1900isl.isl_multi_pw_aff_gist.restype = c_void_p 1901isl.isl_multi_pw_aff_gist.argtypes = [c_void_p, c_void_p] 1902isl.isl_multi_pw_aff_has_range_tuple_id.argtypes = [c_void_p] 1903isl.isl_multi_pw_aff_identity_multi_pw_aff.restype = c_void_p 1904isl.isl_multi_pw_aff_identity_multi_pw_aff.argtypes = [c_void_p] 1905isl.isl_multi_pw_aff_identity_on_domain_space.restype = c_void_p 1906isl.isl_multi_pw_aff_identity_on_domain_space.argtypes = [c_void_p] 1907isl.isl_multi_pw_aff_insert_domain.restype = c_void_p 1908isl.isl_multi_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 1909isl.isl_multi_pw_aff_intersect_domain.restype = c_void_p 1910isl.isl_multi_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 1911isl.isl_multi_pw_aff_intersect_params.restype = c_void_p 1912isl.isl_multi_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 1913isl.isl_multi_pw_aff_involves_nan.argtypes = [c_void_p] 1914isl.isl_multi_pw_aff_involves_param_id.argtypes = [c_void_p, c_void_p] 1915isl.isl_multi_pw_aff_involves_param_id_list.argtypes = [c_void_p, c_void_p] 1916isl.isl_multi_pw_aff_isa_multi_aff.argtypes = [c_void_p] 1917isl.isl_multi_pw_aff_get_list.restype = c_void_p 1918isl.isl_multi_pw_aff_get_list.argtypes = [c_void_p] 1919isl.isl_multi_pw_aff_max.restype = c_void_p 1920isl.isl_multi_pw_aff_max.argtypes = [c_void_p, c_void_p] 1921isl.isl_multi_pw_aff_max_multi_val.restype = c_void_p 1922isl.isl_multi_pw_aff_max_multi_val.argtypes = [c_void_p] 1923isl.isl_multi_pw_aff_min.restype = c_void_p 1924isl.isl_multi_pw_aff_min.argtypes = [c_void_p, c_void_p] 1925isl.isl_multi_pw_aff_min_multi_val.restype = c_void_p 1926isl.isl_multi_pw_aff_min_multi_val.argtypes = [c_void_p] 1927isl.isl_multi_pw_aff_neg.restype = c_void_p 1928isl.isl_multi_pw_aff_neg.argtypes = [c_void_p] 1929isl.isl_multi_pw_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 1930isl.isl_multi_pw_aff_product.restype = c_void_p 1931isl.isl_multi_pw_aff_product.argtypes = [c_void_p, c_void_p] 1932isl.isl_multi_pw_aff_pullback_multi_aff.restype = c_void_p 1933isl.isl_multi_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 1934isl.isl_multi_pw_aff_pullback_multi_pw_aff.restype = c_void_p 1935isl.isl_multi_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 1936isl.isl_multi_pw_aff_pullback_pw_multi_aff.restype = c_void_p 1937isl.isl_multi_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 1938isl.isl_multi_pw_aff_range_product.restype = c_void_p 1939isl.isl_multi_pw_aff_range_product.argtypes = [c_void_p, c_void_p] 1940isl.isl_multi_pw_aff_get_range_tuple_id.restype = c_void_p 1941isl.isl_multi_pw_aff_get_range_tuple_id.argtypes = [c_void_p] 1942isl.isl_multi_pw_aff_reset_range_tuple_id.restype = c_void_p 1943isl.isl_multi_pw_aff_reset_range_tuple_id.argtypes = [c_void_p] 1944isl.isl_multi_pw_aff_scale_multi_val.restype = c_void_p 1945isl.isl_multi_pw_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 1946isl.isl_multi_pw_aff_scale_val.restype = c_void_p 1947isl.isl_multi_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 1948isl.isl_multi_pw_aff_scale_down_multi_val.restype = c_void_p 1949isl.isl_multi_pw_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 1950isl.isl_multi_pw_aff_scale_down_val.restype = c_void_p 1951isl.isl_multi_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 1952isl.isl_multi_pw_aff_set_at.restype = c_void_p 1953isl.isl_multi_pw_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 1954isl.isl_multi_pw_aff_set_range_tuple_id.restype = c_void_p 1955isl.isl_multi_pw_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 1956isl.isl_multi_pw_aff_size.argtypes = [c_void_p] 1957isl.isl_multi_pw_aff_get_space.restype = c_void_p 1958isl.isl_multi_pw_aff_get_space.argtypes = [c_void_p] 1959isl.isl_multi_pw_aff_sub.restype = c_void_p 1960isl.isl_multi_pw_aff_sub.argtypes = [c_void_p, c_void_p] 1961isl.isl_multi_pw_aff_unbind_params_insert_domain.restype = c_void_p 1962isl.isl_multi_pw_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 1963isl.isl_multi_pw_aff_union_add.restype = c_void_p 1964isl.isl_multi_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 1965isl.isl_multi_pw_aff_zero.restype = c_void_p 1966isl.isl_multi_pw_aff_zero.argtypes = [c_void_p] 1967isl.isl_multi_pw_aff_copy.restype = c_void_p 1968isl.isl_multi_pw_aff_copy.argtypes = [c_void_p] 1969isl.isl_multi_pw_aff_free.restype = c_void_p 1970isl.isl_multi_pw_aff_free.argtypes = [c_void_p] 1971isl.isl_multi_pw_aff_to_str.restype = POINTER(c_char) 1972isl.isl_multi_pw_aff_to_str.argtypes = [c_void_p] 1973 1974class pw_multi_aff(union_pw_multi_aff, multi_pw_aff): 1975 def __init__(self, *args, **keywords): 1976 if "ptr" in keywords: 1977 self.ctx = keywords["ctx"] 1978 self.ptr = keywords["ptr"] 1979 return 1980 if len(args) == 1 and args[0].__class__ is multi_aff: 1981 self.ctx = Context.getDefaultInstance() 1982 self.ptr = isl.isl_pw_multi_aff_from_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 1983 return 1984 if len(args) == 1 and args[0].__class__ is pw_aff: 1985 self.ctx = Context.getDefaultInstance() 1986 self.ptr = isl.isl_pw_multi_aff_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 1987 return 1988 if len(args) == 1 and type(args[0]) == str: 1989 self.ctx = Context.getDefaultInstance() 1990 self.ptr = isl.isl_pw_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 1991 return 1992 raise Error 1993 def __del__(self): 1994 if hasattr(self, 'ptr'): 1995 isl.isl_pw_multi_aff_free(self.ptr) 1996 def __str__(arg0): 1997 try: 1998 if not arg0.__class__ is pw_multi_aff: 1999 arg0 = pw_multi_aff(arg0) 2000 except: 2001 raise 2002 ptr = isl.isl_pw_multi_aff_to_str(arg0.ptr) 2003 res = cast(ptr, c_char_p).value.decode('ascii') 2004 libc.free(ptr) 2005 return res 2006 def __repr__(self): 2007 s = str(self) 2008 if '"' in s: 2009 return 'isl.pw_multi_aff("""%s""")' % s 2010 else: 2011 return 'isl.pw_multi_aff("%s")' % s 2012 def add(arg0, arg1): 2013 try: 2014 if not arg0.__class__ is pw_multi_aff: 2015 arg0 = pw_multi_aff(arg0) 2016 except: 2017 raise 2018 try: 2019 if not arg1.__class__ is pw_multi_aff: 2020 arg1 = pw_multi_aff(arg1) 2021 except: 2022 return union_pw_multi_aff(arg0).add(arg1) 2023 ctx = arg0.ctx 2024 res = isl.isl_pw_multi_aff_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2025 obj = pw_multi_aff(ctx=ctx, ptr=res) 2026 return obj 2027 def add_constant(*args): 2028 if len(args) == 2 and args[1].__class__ is multi_val: 2029 ctx = args[0].ctx 2030 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)) 2031 obj = pw_multi_aff(ctx=ctx, ptr=res) 2032 return obj 2033 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2034 args = list(args) 2035 try: 2036 if not args[1].__class__ is val: 2037 args[1] = val(args[1]) 2038 except: 2039 raise 2040 ctx = args[0].ctx 2041 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)) 2042 obj = pw_multi_aff(ctx=ctx, ptr=res) 2043 return obj 2044 raise Error 2045 def as_map(arg0): 2046 try: 2047 if not arg0.__class__ is pw_multi_aff: 2048 arg0 = pw_multi_aff(arg0) 2049 except: 2050 raise 2051 ctx = arg0.ctx 2052 res = isl.isl_pw_multi_aff_as_map(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2053 obj = map(ctx=ctx, ptr=res) 2054 return obj 2055 def as_multi_aff(arg0): 2056 try: 2057 if not arg0.__class__ is pw_multi_aff: 2058 arg0 = pw_multi_aff(arg0) 2059 except: 2060 raise 2061 ctx = arg0.ctx 2062 res = isl.isl_pw_multi_aff_as_multi_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2063 obj = multi_aff(ctx=ctx, ptr=res) 2064 return obj 2065 def as_set(arg0): 2066 try: 2067 if not arg0.__class__ is pw_multi_aff: 2068 arg0 = pw_multi_aff(arg0) 2069 except: 2070 raise 2071 ctx = arg0.ctx 2072 res = isl.isl_pw_multi_aff_as_set(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2073 obj = set(ctx=ctx, ptr=res) 2074 return obj 2075 def at(arg0, arg1): 2076 try: 2077 if not arg0.__class__ is pw_multi_aff: 2078 arg0 = pw_multi_aff(arg0) 2079 except: 2080 raise 2081 ctx = arg0.ctx 2082 res = isl.isl_pw_multi_aff_get_at(arg0.ptr, arg1) 2083 obj = pw_aff(ctx=ctx, ptr=res) 2084 return obj 2085 def get_at(arg0, arg1): 2086 return arg0.at(arg1) 2087 def bind_domain(arg0, arg1): 2088 try: 2089 if not arg0.__class__ is pw_multi_aff: 2090 arg0 = pw_multi_aff(arg0) 2091 except: 2092 raise 2093 try: 2094 if not arg1.__class__ is multi_id: 2095 arg1 = multi_id(arg1) 2096 except: 2097 return union_pw_multi_aff(arg0).bind_domain(arg1) 2098 ctx = arg0.ctx 2099 res = isl.isl_pw_multi_aff_bind_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2100 obj = pw_multi_aff(ctx=ctx, ptr=res) 2101 return obj 2102 def bind_domain_wrapped_domain(arg0, arg1): 2103 try: 2104 if not arg0.__class__ is pw_multi_aff: 2105 arg0 = pw_multi_aff(arg0) 2106 except: 2107 raise 2108 try: 2109 if not arg1.__class__ is multi_id: 2110 arg1 = multi_id(arg1) 2111 except: 2112 return union_pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 2113 ctx = arg0.ctx 2114 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)) 2115 obj = pw_multi_aff(ctx=ctx, ptr=res) 2116 return obj 2117 def coalesce(arg0): 2118 try: 2119 if not arg0.__class__ is pw_multi_aff: 2120 arg0 = pw_multi_aff(arg0) 2121 except: 2122 raise 2123 ctx = arg0.ctx 2124 res = isl.isl_pw_multi_aff_coalesce(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2125 obj = pw_multi_aff(ctx=ctx, ptr=res) 2126 return obj 2127 def domain(arg0): 2128 try: 2129 if not arg0.__class__ is pw_multi_aff: 2130 arg0 = pw_multi_aff(arg0) 2131 except: 2132 raise 2133 ctx = arg0.ctx 2134 res = isl.isl_pw_multi_aff_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2135 obj = set(ctx=ctx, ptr=res) 2136 return obj 2137 @staticmethod 2138 def domain_map(arg0): 2139 try: 2140 if not arg0.__class__ is space: 2141 arg0 = space(arg0) 2142 except: 2143 raise 2144 ctx = arg0.ctx 2145 res = isl.isl_pw_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 2146 obj = pw_multi_aff(ctx=ctx, ptr=res) 2147 return obj 2148 def flat_range_product(arg0, arg1): 2149 try: 2150 if not arg0.__class__ is pw_multi_aff: 2151 arg0 = pw_multi_aff(arg0) 2152 except: 2153 raise 2154 try: 2155 if not arg1.__class__ is pw_multi_aff: 2156 arg1 = pw_multi_aff(arg1) 2157 except: 2158 return union_pw_multi_aff(arg0).flat_range_product(arg1) 2159 ctx = arg0.ctx 2160 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)) 2161 obj = pw_multi_aff(ctx=ctx, ptr=res) 2162 return obj 2163 def foreach_piece(arg0, arg1): 2164 try: 2165 if not arg0.__class__ is pw_multi_aff: 2166 arg0 = pw_multi_aff(arg0) 2167 except: 2168 raise 2169 exc_info = [None] 2170 fn = CFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p) 2171 def cb_func(cb_arg0, cb_arg1, cb_arg2): 2172 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 2173 cb_arg1 = multi_aff(ctx=arg0.ctx, ptr=(cb_arg1)) 2174 try: 2175 arg1(cb_arg0, cb_arg1) 2176 except BaseException as e: 2177 exc_info[0] = e 2178 return -1 2179 return 0 2180 cb = fn(cb_func) 2181 ctx = arg0.ctx 2182 res = isl.isl_pw_multi_aff_foreach_piece(arg0.ptr, cb, None) 2183 if exc_info[0] is not None: 2184 raise exc_info[0] 2185 if res < 0: 2186 raise 2187 def gist(arg0, arg1): 2188 try: 2189 if not arg0.__class__ is pw_multi_aff: 2190 arg0 = pw_multi_aff(arg0) 2191 except: 2192 raise 2193 try: 2194 if not arg1.__class__ is set: 2195 arg1 = set(arg1) 2196 except: 2197 return union_pw_multi_aff(arg0).gist(arg1) 2198 ctx = arg0.ctx 2199 res = isl.isl_pw_multi_aff_gist(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2200 obj = pw_multi_aff(ctx=ctx, ptr=res) 2201 return obj 2202 def has_range_tuple_id(arg0): 2203 try: 2204 if not arg0.__class__ is pw_multi_aff: 2205 arg0 = pw_multi_aff(arg0) 2206 except: 2207 raise 2208 ctx = arg0.ctx 2209 res = isl.isl_pw_multi_aff_has_range_tuple_id(arg0.ptr) 2210 if res < 0: 2211 raise 2212 return bool(res) 2213 @staticmethod 2214 def identity_on_domain(*args): 2215 if len(args) == 1 and args[0].__class__ is space: 2216 ctx = args[0].ctx 2217 res = isl.isl_pw_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 2218 obj = pw_multi_aff(ctx=ctx, ptr=res) 2219 return obj 2220 raise Error 2221 def insert_domain(arg0, arg1): 2222 try: 2223 if not arg0.__class__ is pw_multi_aff: 2224 arg0 = pw_multi_aff(arg0) 2225 except: 2226 raise 2227 try: 2228 if not arg1.__class__ is space: 2229 arg1 = space(arg1) 2230 except: 2231 return union_pw_multi_aff(arg0).insert_domain(arg1) 2232 ctx = arg0.ctx 2233 res = isl.isl_pw_multi_aff_insert_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 2234 obj = pw_multi_aff(ctx=ctx, ptr=res) 2235 return obj 2236 def intersect_domain(arg0, arg1): 2237 try: 2238 if not arg0.__class__ is pw_multi_aff: 2239 arg0 = pw_multi_aff(arg0) 2240 except: 2241 raise 2242 try: 2243 if not arg1.__class__ is set: 2244 arg1 = set(arg1) 2245 except: 2246 return union_pw_multi_aff(arg0).intersect_domain(arg1) 2247 ctx = arg0.ctx 2248 res = isl.isl_pw_multi_aff_intersect_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2249 obj = pw_multi_aff(ctx=ctx, ptr=res) 2250 return obj 2251 def intersect_params(arg0, arg1): 2252 try: 2253 if not arg0.__class__ is pw_multi_aff: 2254 arg0 = pw_multi_aff(arg0) 2255 except: 2256 raise 2257 try: 2258 if not arg1.__class__ is set: 2259 arg1 = set(arg1) 2260 except: 2261 return union_pw_multi_aff(arg0).intersect_params(arg1) 2262 ctx = arg0.ctx 2263 res = isl.isl_pw_multi_aff_intersect_params(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2264 obj = pw_multi_aff(ctx=ctx, ptr=res) 2265 return obj 2266 def involves_locals(arg0): 2267 try: 2268 if not arg0.__class__ is pw_multi_aff: 2269 arg0 = pw_multi_aff(arg0) 2270 except: 2271 raise 2272 ctx = arg0.ctx 2273 res = isl.isl_pw_multi_aff_involves_locals(arg0.ptr) 2274 if res < 0: 2275 raise 2276 return bool(res) 2277 def isa_multi_aff(arg0): 2278 try: 2279 if not arg0.__class__ is pw_multi_aff: 2280 arg0 = pw_multi_aff(arg0) 2281 except: 2282 raise 2283 ctx = arg0.ctx 2284 res = isl.isl_pw_multi_aff_isa_multi_aff(arg0.ptr) 2285 if res < 0: 2286 raise 2287 return bool(res) 2288 def max_multi_val(arg0): 2289 try: 2290 if not arg0.__class__ is pw_multi_aff: 2291 arg0 = pw_multi_aff(arg0) 2292 except: 2293 raise 2294 ctx = arg0.ctx 2295 res = isl.isl_pw_multi_aff_max_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2296 obj = multi_val(ctx=ctx, ptr=res) 2297 return obj 2298 def min_multi_val(arg0): 2299 try: 2300 if not arg0.__class__ is pw_multi_aff: 2301 arg0 = pw_multi_aff(arg0) 2302 except: 2303 raise 2304 ctx = arg0.ctx 2305 res = isl.isl_pw_multi_aff_min_multi_val(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2306 obj = multi_val(ctx=ctx, ptr=res) 2307 return obj 2308 @staticmethod 2309 def multi_val_on_domain(arg0, arg1): 2310 try: 2311 if not arg0.__class__ is set: 2312 arg0 = set(arg0) 2313 except: 2314 raise 2315 try: 2316 if not arg1.__class__ is multi_val: 2317 arg1 = multi_val(arg1) 2318 except: 2319 return union_pw_multi_aff(arg0).multi_val_on_domain(arg1) 2320 ctx = arg0.ctx 2321 res = isl.isl_pw_multi_aff_multi_val_on_domain(isl.isl_set_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 2322 obj = pw_multi_aff(ctx=ctx, ptr=res) 2323 return obj 2324 def n_piece(arg0): 2325 try: 2326 if not arg0.__class__ is pw_multi_aff: 2327 arg0 = pw_multi_aff(arg0) 2328 except: 2329 raise 2330 ctx = arg0.ctx 2331 res = isl.isl_pw_multi_aff_n_piece(arg0.ptr) 2332 if res < 0: 2333 raise 2334 return int(res) 2335 def preimage_domain_wrapped_domain(*args): 2336 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2337 ctx = args[0].ctx 2338 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)) 2339 obj = pw_multi_aff(ctx=ctx, ptr=res) 2340 return obj 2341 raise Error 2342 def product(arg0, arg1): 2343 try: 2344 if not arg0.__class__ is pw_multi_aff: 2345 arg0 = pw_multi_aff(arg0) 2346 except: 2347 raise 2348 try: 2349 if not arg1.__class__ is pw_multi_aff: 2350 arg1 = pw_multi_aff(arg1) 2351 except: 2352 return union_pw_multi_aff(arg0).product(arg1) 2353 ctx = arg0.ctx 2354 res = isl.isl_pw_multi_aff_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2355 obj = pw_multi_aff(ctx=ctx, ptr=res) 2356 return obj 2357 def pullback(*args): 2358 if len(args) == 2 and args[1].__class__ is multi_aff: 2359 ctx = args[0].ctx 2360 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)) 2361 obj = pw_multi_aff(ctx=ctx, ptr=res) 2362 return obj 2363 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 2364 ctx = args[0].ctx 2365 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)) 2366 obj = pw_multi_aff(ctx=ctx, ptr=res) 2367 return obj 2368 raise Error 2369 def range_factor_domain(arg0): 2370 try: 2371 if not arg0.__class__ is pw_multi_aff: 2372 arg0 = pw_multi_aff(arg0) 2373 except: 2374 raise 2375 ctx = arg0.ctx 2376 res = isl.isl_pw_multi_aff_range_factor_domain(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2377 obj = pw_multi_aff(ctx=ctx, ptr=res) 2378 return obj 2379 def range_factor_range(arg0): 2380 try: 2381 if not arg0.__class__ is pw_multi_aff: 2382 arg0 = pw_multi_aff(arg0) 2383 except: 2384 raise 2385 ctx = arg0.ctx 2386 res = isl.isl_pw_multi_aff_range_factor_range(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2387 obj = pw_multi_aff(ctx=ctx, ptr=res) 2388 return obj 2389 @staticmethod 2390 def range_map(arg0): 2391 try: 2392 if not arg0.__class__ is space: 2393 arg0 = space(arg0) 2394 except: 2395 raise 2396 ctx = arg0.ctx 2397 res = isl.isl_pw_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 2398 obj = pw_multi_aff(ctx=ctx, ptr=res) 2399 return obj 2400 def range_product(arg0, arg1): 2401 try: 2402 if not arg0.__class__ is pw_multi_aff: 2403 arg0 = pw_multi_aff(arg0) 2404 except: 2405 raise 2406 try: 2407 if not arg1.__class__ is pw_multi_aff: 2408 arg1 = pw_multi_aff(arg1) 2409 except: 2410 return union_pw_multi_aff(arg0).range_product(arg1) 2411 ctx = arg0.ctx 2412 res = isl.isl_pw_multi_aff_range_product(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2413 obj = pw_multi_aff(ctx=ctx, ptr=res) 2414 return obj 2415 def range_tuple_id(arg0): 2416 try: 2417 if not arg0.__class__ is pw_multi_aff: 2418 arg0 = pw_multi_aff(arg0) 2419 except: 2420 raise 2421 ctx = arg0.ctx 2422 res = isl.isl_pw_multi_aff_get_range_tuple_id(arg0.ptr) 2423 obj = id(ctx=ctx, ptr=res) 2424 return obj 2425 def get_range_tuple_id(arg0): 2426 return arg0.range_tuple_id() 2427 def scale(*args): 2428 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2429 args = list(args) 2430 try: 2431 if not args[1].__class__ is val: 2432 args[1] = val(args[1]) 2433 except: 2434 raise 2435 ctx = args[0].ctx 2436 res = isl.isl_pw_multi_aff_scale_val(isl.isl_pw_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2437 obj = pw_multi_aff(ctx=ctx, ptr=res) 2438 return obj 2439 raise Error 2440 def scale_down(*args): 2441 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2442 args = list(args) 2443 try: 2444 if not args[1].__class__ is val: 2445 args[1] = val(args[1]) 2446 except: 2447 raise 2448 ctx = args[0].ctx 2449 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)) 2450 obj = pw_multi_aff(ctx=ctx, ptr=res) 2451 return obj 2452 raise Error 2453 def set_range_tuple(*args): 2454 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 2455 args = list(args) 2456 try: 2457 if not args[1].__class__ is id: 2458 args[1] = id(args[1]) 2459 except: 2460 raise 2461 ctx = args[0].ctx 2462 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)) 2463 obj = pw_multi_aff(ctx=ctx, ptr=res) 2464 return obj 2465 raise Error 2466 def space(arg0): 2467 try: 2468 if not arg0.__class__ is pw_multi_aff: 2469 arg0 = pw_multi_aff(arg0) 2470 except: 2471 raise 2472 ctx = arg0.ctx 2473 res = isl.isl_pw_multi_aff_get_space(arg0.ptr) 2474 obj = space(ctx=ctx, ptr=res) 2475 return obj 2476 def get_space(arg0): 2477 return arg0.space() 2478 def sub(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).sub(arg1) 2489 ctx = arg0.ctx 2490 res = isl.isl_pw_multi_aff_sub(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 subtract_domain(arg0, arg1): 2494 try: 2495 if not arg0.__class__ is pw_multi_aff: 2496 arg0 = pw_multi_aff(arg0) 2497 except: 2498 raise 2499 try: 2500 if not arg1.__class__ is set: 2501 arg1 = set(arg1) 2502 except: 2503 return union_pw_multi_aff(arg0).subtract_domain(arg1) 2504 ctx = arg0.ctx 2505 res = isl.isl_pw_multi_aff_subtract_domain(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2506 obj = pw_multi_aff(ctx=ctx, ptr=res) 2507 return obj 2508 def to_list(arg0): 2509 try: 2510 if not arg0.__class__ is pw_multi_aff: 2511 arg0 = pw_multi_aff(arg0) 2512 except: 2513 raise 2514 ctx = arg0.ctx 2515 res = isl.isl_pw_multi_aff_to_list(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2516 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 2517 return obj 2518 def to_multi_pw_aff(arg0): 2519 try: 2520 if not arg0.__class__ is pw_multi_aff: 2521 arg0 = pw_multi_aff(arg0) 2522 except: 2523 raise 2524 ctx = arg0.ctx 2525 res = isl.isl_pw_multi_aff_to_multi_pw_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2526 obj = multi_pw_aff(ctx=ctx, ptr=res) 2527 return obj 2528 def to_union_pw_multi_aff(arg0): 2529 try: 2530 if not arg0.__class__ is pw_multi_aff: 2531 arg0 = pw_multi_aff(arg0) 2532 except: 2533 raise 2534 ctx = arg0.ctx 2535 res = isl.isl_pw_multi_aff_to_union_pw_multi_aff(isl.isl_pw_multi_aff_copy(arg0.ptr)) 2536 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 2537 return obj 2538 def union_add(arg0, arg1): 2539 try: 2540 if not arg0.__class__ is pw_multi_aff: 2541 arg0 = pw_multi_aff(arg0) 2542 except: 2543 raise 2544 try: 2545 if not arg1.__class__ is pw_multi_aff: 2546 arg1 = pw_multi_aff(arg1) 2547 except: 2548 return union_pw_multi_aff(arg0).union_add(arg1) 2549 ctx = arg0.ctx 2550 res = isl.isl_pw_multi_aff_union_add(isl.isl_pw_multi_aff_copy(arg0.ptr), isl.isl_pw_multi_aff_copy(arg1.ptr)) 2551 obj = pw_multi_aff(ctx=ctx, ptr=res) 2552 return obj 2553 @staticmethod 2554 def zero(arg0): 2555 try: 2556 if not arg0.__class__ is space: 2557 arg0 = space(arg0) 2558 except: 2559 raise 2560 ctx = arg0.ctx 2561 res = isl.isl_pw_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 2562 obj = pw_multi_aff(ctx=ctx, ptr=res) 2563 return obj 2564 2565isl.isl_pw_multi_aff_from_multi_aff.restype = c_void_p 2566isl.isl_pw_multi_aff_from_multi_aff.argtypes = [c_void_p] 2567isl.isl_pw_multi_aff_from_pw_aff.restype = c_void_p 2568isl.isl_pw_multi_aff_from_pw_aff.argtypes = [c_void_p] 2569isl.isl_pw_multi_aff_read_from_str.restype = c_void_p 2570isl.isl_pw_multi_aff_read_from_str.argtypes = [Context, c_char_p] 2571isl.isl_pw_multi_aff_add.restype = c_void_p 2572isl.isl_pw_multi_aff_add.argtypes = [c_void_p, c_void_p] 2573isl.isl_pw_multi_aff_add_constant_multi_val.restype = c_void_p 2574isl.isl_pw_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 2575isl.isl_pw_multi_aff_add_constant_val.restype = c_void_p 2576isl.isl_pw_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 2577isl.isl_pw_multi_aff_as_map.restype = c_void_p 2578isl.isl_pw_multi_aff_as_map.argtypes = [c_void_p] 2579isl.isl_pw_multi_aff_as_multi_aff.restype = c_void_p 2580isl.isl_pw_multi_aff_as_multi_aff.argtypes = [c_void_p] 2581isl.isl_pw_multi_aff_as_set.restype = c_void_p 2582isl.isl_pw_multi_aff_as_set.argtypes = [c_void_p] 2583isl.isl_pw_multi_aff_get_at.restype = c_void_p 2584isl.isl_pw_multi_aff_get_at.argtypes = [c_void_p, c_int] 2585isl.isl_pw_multi_aff_bind_domain.restype = c_void_p 2586isl.isl_pw_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 2587isl.isl_pw_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 2588isl.isl_pw_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 2589isl.isl_pw_multi_aff_coalesce.restype = c_void_p 2590isl.isl_pw_multi_aff_coalesce.argtypes = [c_void_p] 2591isl.isl_pw_multi_aff_domain.restype = c_void_p 2592isl.isl_pw_multi_aff_domain.argtypes = [c_void_p] 2593isl.isl_pw_multi_aff_domain_map.restype = c_void_p 2594isl.isl_pw_multi_aff_domain_map.argtypes = [c_void_p] 2595isl.isl_pw_multi_aff_flat_range_product.restype = c_void_p 2596isl.isl_pw_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 2597isl.isl_pw_multi_aff_foreach_piece.argtypes = [c_void_p, c_void_p, c_void_p] 2598isl.isl_pw_multi_aff_gist.restype = c_void_p 2599isl.isl_pw_multi_aff_gist.argtypes = [c_void_p, c_void_p] 2600isl.isl_pw_multi_aff_has_range_tuple_id.argtypes = [c_void_p] 2601isl.isl_pw_multi_aff_identity_on_domain_space.restype = c_void_p 2602isl.isl_pw_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 2603isl.isl_pw_multi_aff_insert_domain.restype = c_void_p 2604isl.isl_pw_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 2605isl.isl_pw_multi_aff_intersect_domain.restype = c_void_p 2606isl.isl_pw_multi_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 2607isl.isl_pw_multi_aff_intersect_params.restype = c_void_p 2608isl.isl_pw_multi_aff_intersect_params.argtypes = [c_void_p, c_void_p] 2609isl.isl_pw_multi_aff_involves_locals.argtypes = [c_void_p] 2610isl.isl_pw_multi_aff_isa_multi_aff.argtypes = [c_void_p] 2611isl.isl_pw_multi_aff_max_multi_val.restype = c_void_p 2612isl.isl_pw_multi_aff_max_multi_val.argtypes = [c_void_p] 2613isl.isl_pw_multi_aff_min_multi_val.restype = c_void_p 2614isl.isl_pw_multi_aff_min_multi_val.argtypes = [c_void_p] 2615isl.isl_pw_multi_aff_multi_val_on_domain.restype = c_void_p 2616isl.isl_pw_multi_aff_multi_val_on_domain.argtypes = [c_void_p, c_void_p] 2617isl.isl_pw_multi_aff_n_piece.argtypes = [c_void_p] 2618isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.restype = c_void_p 2619isl.isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2620isl.isl_pw_multi_aff_product.restype = c_void_p 2621isl.isl_pw_multi_aff_product.argtypes = [c_void_p, c_void_p] 2622isl.isl_pw_multi_aff_pullback_multi_aff.restype = c_void_p 2623isl.isl_pw_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 2624isl.isl_pw_multi_aff_pullback_pw_multi_aff.restype = c_void_p 2625isl.isl_pw_multi_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 2626isl.isl_pw_multi_aff_range_factor_domain.restype = c_void_p 2627isl.isl_pw_multi_aff_range_factor_domain.argtypes = [c_void_p] 2628isl.isl_pw_multi_aff_range_factor_range.restype = c_void_p 2629isl.isl_pw_multi_aff_range_factor_range.argtypes = [c_void_p] 2630isl.isl_pw_multi_aff_range_map.restype = c_void_p 2631isl.isl_pw_multi_aff_range_map.argtypes = [c_void_p] 2632isl.isl_pw_multi_aff_range_product.restype = c_void_p 2633isl.isl_pw_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 2634isl.isl_pw_multi_aff_get_range_tuple_id.restype = c_void_p 2635isl.isl_pw_multi_aff_get_range_tuple_id.argtypes = [c_void_p] 2636isl.isl_pw_multi_aff_scale_val.restype = c_void_p 2637isl.isl_pw_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 2638isl.isl_pw_multi_aff_scale_down_val.restype = c_void_p 2639isl.isl_pw_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 2640isl.isl_pw_multi_aff_set_range_tuple_id.restype = c_void_p 2641isl.isl_pw_multi_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 2642isl.isl_pw_multi_aff_get_space.restype = c_void_p 2643isl.isl_pw_multi_aff_get_space.argtypes = [c_void_p] 2644isl.isl_pw_multi_aff_sub.restype = c_void_p 2645isl.isl_pw_multi_aff_sub.argtypes = [c_void_p, c_void_p] 2646isl.isl_pw_multi_aff_subtract_domain.restype = c_void_p 2647isl.isl_pw_multi_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 2648isl.isl_pw_multi_aff_to_list.restype = c_void_p 2649isl.isl_pw_multi_aff_to_list.argtypes = [c_void_p] 2650isl.isl_pw_multi_aff_to_multi_pw_aff.restype = c_void_p 2651isl.isl_pw_multi_aff_to_multi_pw_aff.argtypes = [c_void_p] 2652isl.isl_pw_multi_aff_to_union_pw_multi_aff.restype = c_void_p 2653isl.isl_pw_multi_aff_to_union_pw_multi_aff.argtypes = [c_void_p] 2654isl.isl_pw_multi_aff_union_add.restype = c_void_p 2655isl.isl_pw_multi_aff_union_add.argtypes = [c_void_p, c_void_p] 2656isl.isl_pw_multi_aff_zero.restype = c_void_p 2657isl.isl_pw_multi_aff_zero.argtypes = [c_void_p] 2658isl.isl_pw_multi_aff_copy.restype = c_void_p 2659isl.isl_pw_multi_aff_copy.argtypes = [c_void_p] 2660isl.isl_pw_multi_aff_free.restype = c_void_p 2661isl.isl_pw_multi_aff_free.argtypes = [c_void_p] 2662isl.isl_pw_multi_aff_to_str.restype = POINTER(c_char) 2663isl.isl_pw_multi_aff_to_str.argtypes = [c_void_p] 2664 2665class pw_aff(union_pw_aff, pw_multi_aff, multi_pw_aff): 2666 def __init__(self, *args, **keywords): 2667 if "ptr" in keywords: 2668 self.ctx = keywords["ctx"] 2669 self.ptr = keywords["ptr"] 2670 return 2671 if len(args) == 1 and args[0].__class__ is aff: 2672 self.ctx = Context.getDefaultInstance() 2673 self.ptr = isl.isl_pw_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 2674 return 2675 if len(args) == 1 and type(args[0]) == str: 2676 self.ctx = Context.getDefaultInstance() 2677 self.ptr = isl.isl_pw_aff_read_from_str(self.ctx, args[0].encode('ascii')) 2678 return 2679 raise Error 2680 def __del__(self): 2681 if hasattr(self, 'ptr'): 2682 isl.isl_pw_aff_free(self.ptr) 2683 def __str__(arg0): 2684 try: 2685 if not arg0.__class__ is pw_aff: 2686 arg0 = pw_aff(arg0) 2687 except: 2688 raise 2689 ptr = isl.isl_pw_aff_to_str(arg0.ptr) 2690 res = cast(ptr, c_char_p).value.decode('ascii') 2691 libc.free(ptr) 2692 return res 2693 def __repr__(self): 2694 s = str(self) 2695 if '"' in s: 2696 return 'isl.pw_aff("""%s""")' % s 2697 else: 2698 return 'isl.pw_aff("%s")' % s 2699 def add(arg0, arg1): 2700 try: 2701 if not arg0.__class__ is pw_aff: 2702 arg0 = pw_aff(arg0) 2703 except: 2704 raise 2705 try: 2706 if not arg1.__class__ is pw_aff: 2707 arg1 = pw_aff(arg1) 2708 except: 2709 return union_pw_aff(arg0).add(arg1) 2710 ctx = arg0.ctx 2711 res = isl.isl_pw_aff_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2712 obj = pw_aff(ctx=ctx, ptr=res) 2713 return obj 2714 def add_constant(*args): 2715 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 2716 args = list(args) 2717 try: 2718 if not args[1].__class__ is val: 2719 args[1] = val(args[1]) 2720 except: 2721 raise 2722 ctx = args[0].ctx 2723 res = isl.isl_pw_aff_add_constant_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 2724 obj = pw_aff(ctx=ctx, ptr=res) 2725 return obj 2726 raise Error 2727 def as_aff(arg0): 2728 try: 2729 if not arg0.__class__ is pw_aff: 2730 arg0 = pw_aff(arg0) 2731 except: 2732 raise 2733 ctx = arg0.ctx 2734 res = isl.isl_pw_aff_as_aff(isl.isl_pw_aff_copy(arg0.ptr)) 2735 obj = aff(ctx=ctx, ptr=res) 2736 return obj 2737 def as_map(arg0): 2738 try: 2739 if not arg0.__class__ is pw_aff: 2740 arg0 = pw_aff(arg0) 2741 except: 2742 raise 2743 ctx = arg0.ctx 2744 res = isl.isl_pw_aff_as_map(isl.isl_pw_aff_copy(arg0.ptr)) 2745 obj = map(ctx=ctx, ptr=res) 2746 return obj 2747 def bind(*args): 2748 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 2749 args = list(args) 2750 try: 2751 if not args[1].__class__ is id: 2752 args[1] = id(args[1]) 2753 except: 2754 raise 2755 ctx = args[0].ctx 2756 res = isl.isl_pw_aff_bind_id(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 2757 obj = set(ctx=ctx, ptr=res) 2758 return obj 2759 raise Error 2760 def bind_domain(arg0, arg1): 2761 try: 2762 if not arg0.__class__ is pw_aff: 2763 arg0 = pw_aff(arg0) 2764 except: 2765 raise 2766 try: 2767 if not arg1.__class__ is multi_id: 2768 arg1 = multi_id(arg1) 2769 except: 2770 return union_pw_aff(arg0).bind_domain(arg1) 2771 ctx = arg0.ctx 2772 res = isl.isl_pw_aff_bind_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2773 obj = pw_aff(ctx=ctx, ptr=res) 2774 return obj 2775 def bind_domain_wrapped_domain(arg0, arg1): 2776 try: 2777 if not arg0.__class__ is pw_aff: 2778 arg0 = pw_aff(arg0) 2779 except: 2780 raise 2781 try: 2782 if not arg1.__class__ is multi_id: 2783 arg1 = multi_id(arg1) 2784 except: 2785 return union_pw_aff(arg0).bind_domain_wrapped_domain(arg1) 2786 ctx = arg0.ctx 2787 res = isl.isl_pw_aff_bind_domain_wrapped_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 2788 obj = pw_aff(ctx=ctx, ptr=res) 2789 return obj 2790 def ceil(arg0): 2791 try: 2792 if not arg0.__class__ is pw_aff: 2793 arg0 = pw_aff(arg0) 2794 except: 2795 raise 2796 ctx = arg0.ctx 2797 res = isl.isl_pw_aff_ceil(isl.isl_pw_aff_copy(arg0.ptr)) 2798 obj = pw_aff(ctx=ctx, ptr=res) 2799 return obj 2800 def coalesce(arg0): 2801 try: 2802 if not arg0.__class__ is pw_aff: 2803 arg0 = pw_aff(arg0) 2804 except: 2805 raise 2806 ctx = arg0.ctx 2807 res = isl.isl_pw_aff_coalesce(isl.isl_pw_aff_copy(arg0.ptr)) 2808 obj = pw_aff(ctx=ctx, ptr=res) 2809 return obj 2810 def cond(arg0, arg1, arg2): 2811 try: 2812 if not arg0.__class__ is pw_aff: 2813 arg0 = pw_aff(arg0) 2814 except: 2815 raise 2816 try: 2817 if not arg1.__class__ is pw_aff: 2818 arg1 = pw_aff(arg1) 2819 except: 2820 return union_pw_aff(arg0).cond(arg1, arg2) 2821 try: 2822 if not arg2.__class__ is pw_aff: 2823 arg2 = pw_aff(arg2) 2824 except: 2825 return union_pw_aff(arg0).cond(arg1, arg2) 2826 ctx = arg0.ctx 2827 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)) 2828 obj = pw_aff(ctx=ctx, ptr=res) 2829 return obj 2830 def div(arg0, arg1): 2831 try: 2832 if not arg0.__class__ is pw_aff: 2833 arg0 = pw_aff(arg0) 2834 except: 2835 raise 2836 try: 2837 if not arg1.__class__ is pw_aff: 2838 arg1 = pw_aff(arg1) 2839 except: 2840 return union_pw_aff(arg0).div(arg1) 2841 ctx = arg0.ctx 2842 res = isl.isl_pw_aff_div(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2843 obj = pw_aff(ctx=ctx, ptr=res) 2844 return obj 2845 def domain(arg0): 2846 try: 2847 if not arg0.__class__ is pw_aff: 2848 arg0 = pw_aff(arg0) 2849 except: 2850 raise 2851 ctx = arg0.ctx 2852 res = isl.isl_pw_aff_domain(isl.isl_pw_aff_copy(arg0.ptr)) 2853 obj = set(ctx=ctx, ptr=res) 2854 return obj 2855 def eq_set(arg0, arg1): 2856 try: 2857 if not arg0.__class__ is pw_aff: 2858 arg0 = pw_aff(arg0) 2859 except: 2860 raise 2861 try: 2862 if not arg1.__class__ is pw_aff: 2863 arg1 = pw_aff(arg1) 2864 except: 2865 return union_pw_aff(arg0).eq_set(arg1) 2866 ctx = arg0.ctx 2867 res = isl.isl_pw_aff_eq_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2868 obj = set(ctx=ctx, ptr=res) 2869 return obj 2870 def eval(arg0, arg1): 2871 try: 2872 if not arg0.__class__ is pw_aff: 2873 arg0 = pw_aff(arg0) 2874 except: 2875 raise 2876 try: 2877 if not arg1.__class__ is point: 2878 arg1 = point(arg1) 2879 except: 2880 return union_pw_aff(arg0).eval(arg1) 2881 ctx = arg0.ctx 2882 res = isl.isl_pw_aff_eval(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 2883 obj = val(ctx=ctx, ptr=res) 2884 return obj 2885 def floor(arg0): 2886 try: 2887 if not arg0.__class__ is pw_aff: 2888 arg0 = pw_aff(arg0) 2889 except: 2890 raise 2891 ctx = arg0.ctx 2892 res = isl.isl_pw_aff_floor(isl.isl_pw_aff_copy(arg0.ptr)) 2893 obj = pw_aff(ctx=ctx, ptr=res) 2894 return obj 2895 def ge_set(arg0, arg1): 2896 try: 2897 if not arg0.__class__ is pw_aff: 2898 arg0 = pw_aff(arg0) 2899 except: 2900 raise 2901 try: 2902 if not arg1.__class__ is pw_aff: 2903 arg1 = pw_aff(arg1) 2904 except: 2905 return union_pw_aff(arg0).ge_set(arg1) 2906 ctx = arg0.ctx 2907 res = isl.isl_pw_aff_ge_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2908 obj = set(ctx=ctx, ptr=res) 2909 return obj 2910 def gist(arg0, arg1): 2911 try: 2912 if not arg0.__class__ is pw_aff: 2913 arg0 = pw_aff(arg0) 2914 except: 2915 raise 2916 try: 2917 if not arg1.__class__ is set: 2918 arg1 = set(arg1) 2919 except: 2920 return union_pw_aff(arg0).gist(arg1) 2921 ctx = arg0.ctx 2922 res = isl.isl_pw_aff_gist(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2923 obj = pw_aff(ctx=ctx, ptr=res) 2924 return obj 2925 def gt_set(arg0, arg1): 2926 try: 2927 if not arg0.__class__ is pw_aff: 2928 arg0 = pw_aff(arg0) 2929 except: 2930 raise 2931 try: 2932 if not arg1.__class__ is pw_aff: 2933 arg1 = pw_aff(arg1) 2934 except: 2935 return union_pw_aff(arg0).gt_set(arg1) 2936 ctx = arg0.ctx 2937 res = isl.isl_pw_aff_gt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 2938 obj = set(ctx=ctx, ptr=res) 2939 return obj 2940 def insert_domain(arg0, arg1): 2941 try: 2942 if not arg0.__class__ is pw_aff: 2943 arg0 = pw_aff(arg0) 2944 except: 2945 raise 2946 try: 2947 if not arg1.__class__ is space: 2948 arg1 = space(arg1) 2949 except: 2950 return union_pw_aff(arg0).insert_domain(arg1) 2951 ctx = arg0.ctx 2952 res = isl.isl_pw_aff_insert_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 2953 obj = pw_aff(ctx=ctx, ptr=res) 2954 return obj 2955 def intersect_domain(arg0, arg1): 2956 try: 2957 if not arg0.__class__ is pw_aff: 2958 arg0 = pw_aff(arg0) 2959 except: 2960 raise 2961 try: 2962 if not arg1.__class__ is set: 2963 arg1 = set(arg1) 2964 except: 2965 return union_pw_aff(arg0).intersect_domain(arg1) 2966 ctx = arg0.ctx 2967 res = isl.isl_pw_aff_intersect_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2968 obj = pw_aff(ctx=ctx, ptr=res) 2969 return obj 2970 def intersect_params(arg0, arg1): 2971 try: 2972 if not arg0.__class__ is pw_aff: 2973 arg0 = pw_aff(arg0) 2974 except: 2975 raise 2976 try: 2977 if not arg1.__class__ is set: 2978 arg1 = set(arg1) 2979 except: 2980 return union_pw_aff(arg0).intersect_params(arg1) 2981 ctx = arg0.ctx 2982 res = isl.isl_pw_aff_intersect_params(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 2983 obj = pw_aff(ctx=ctx, ptr=res) 2984 return obj 2985 def isa_aff(arg0): 2986 try: 2987 if not arg0.__class__ is pw_aff: 2988 arg0 = pw_aff(arg0) 2989 except: 2990 raise 2991 ctx = arg0.ctx 2992 res = isl.isl_pw_aff_isa_aff(arg0.ptr) 2993 if res < 0: 2994 raise 2995 return bool(res) 2996 def le_set(arg0, arg1): 2997 try: 2998 if not arg0.__class__ is pw_aff: 2999 arg0 = pw_aff(arg0) 3000 except: 3001 raise 3002 try: 3003 if not arg1.__class__ is pw_aff: 3004 arg1 = pw_aff(arg1) 3005 except: 3006 return union_pw_aff(arg0).le_set(arg1) 3007 ctx = arg0.ctx 3008 res = isl.isl_pw_aff_le_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3009 obj = set(ctx=ctx, ptr=res) 3010 return obj 3011 def lt_set(arg0, arg1): 3012 try: 3013 if not arg0.__class__ is pw_aff: 3014 arg0 = pw_aff(arg0) 3015 except: 3016 raise 3017 try: 3018 if not arg1.__class__ is pw_aff: 3019 arg1 = pw_aff(arg1) 3020 except: 3021 return union_pw_aff(arg0).lt_set(arg1) 3022 ctx = arg0.ctx 3023 res = isl.isl_pw_aff_lt_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3024 obj = set(ctx=ctx, ptr=res) 3025 return obj 3026 def max(arg0, arg1): 3027 try: 3028 if not arg0.__class__ is pw_aff: 3029 arg0 = pw_aff(arg0) 3030 except: 3031 raise 3032 try: 3033 if not arg1.__class__ is pw_aff: 3034 arg1 = pw_aff(arg1) 3035 except: 3036 return union_pw_aff(arg0).max(arg1) 3037 ctx = arg0.ctx 3038 res = isl.isl_pw_aff_max(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3039 obj = pw_aff(ctx=ctx, ptr=res) 3040 return obj 3041 def min(arg0, arg1): 3042 try: 3043 if not arg0.__class__ is pw_aff: 3044 arg0 = pw_aff(arg0) 3045 except: 3046 raise 3047 try: 3048 if not arg1.__class__ is pw_aff: 3049 arg1 = pw_aff(arg1) 3050 except: 3051 return union_pw_aff(arg0).min(arg1) 3052 ctx = arg0.ctx 3053 res = isl.isl_pw_aff_min(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3054 obj = pw_aff(ctx=ctx, ptr=res) 3055 return obj 3056 def mod(*args): 3057 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3058 args = list(args) 3059 try: 3060 if not args[1].__class__ is val: 3061 args[1] = val(args[1]) 3062 except: 3063 raise 3064 ctx = args[0].ctx 3065 res = isl.isl_pw_aff_mod_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3066 obj = pw_aff(ctx=ctx, ptr=res) 3067 return obj 3068 raise Error 3069 def mul(arg0, arg1): 3070 try: 3071 if not arg0.__class__ is pw_aff: 3072 arg0 = pw_aff(arg0) 3073 except: 3074 raise 3075 try: 3076 if not arg1.__class__ is pw_aff: 3077 arg1 = pw_aff(arg1) 3078 except: 3079 return union_pw_aff(arg0).mul(arg1) 3080 ctx = arg0.ctx 3081 res = isl.isl_pw_aff_mul(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3082 obj = pw_aff(ctx=ctx, ptr=res) 3083 return obj 3084 def ne_set(arg0, arg1): 3085 try: 3086 if not arg0.__class__ is pw_aff: 3087 arg0 = pw_aff(arg0) 3088 except: 3089 raise 3090 try: 3091 if not arg1.__class__ is pw_aff: 3092 arg1 = pw_aff(arg1) 3093 except: 3094 return union_pw_aff(arg0).ne_set(arg1) 3095 ctx = arg0.ctx 3096 res = isl.isl_pw_aff_ne_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3097 obj = set(ctx=ctx, ptr=res) 3098 return obj 3099 def neg(arg0): 3100 try: 3101 if not arg0.__class__ is pw_aff: 3102 arg0 = pw_aff(arg0) 3103 except: 3104 raise 3105 ctx = arg0.ctx 3106 res = isl.isl_pw_aff_neg(isl.isl_pw_aff_copy(arg0.ptr)) 3107 obj = pw_aff(ctx=ctx, ptr=res) 3108 return obj 3109 @staticmethod 3110 def param_on_domain(*args): 3111 if len(args) == 2 and args[0].__class__ is set and (args[1].__class__ is id or type(args[1]) == str): 3112 args = list(args) 3113 try: 3114 if not args[1].__class__ is id: 3115 args[1] = id(args[1]) 3116 except: 3117 raise 3118 ctx = args[0].ctx 3119 res = isl.isl_pw_aff_param_on_domain_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 3120 obj = pw_aff(ctx=ctx, ptr=res) 3121 return obj 3122 raise Error 3123 def pullback(*args): 3124 if len(args) == 2 and args[1].__class__ is multi_aff: 3125 ctx = args[0].ctx 3126 res = isl.isl_pw_aff_pullback_multi_aff(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 3127 obj = pw_aff(ctx=ctx, ptr=res) 3128 return obj 3129 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 3130 ctx = args[0].ctx 3131 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)) 3132 obj = pw_aff(ctx=ctx, ptr=res) 3133 return obj 3134 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 3135 ctx = args[0].ctx 3136 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)) 3137 obj = pw_aff(ctx=ctx, ptr=res) 3138 return obj 3139 raise Error 3140 def scale(*args): 3141 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3142 args = list(args) 3143 try: 3144 if not args[1].__class__ is val: 3145 args[1] = val(args[1]) 3146 except: 3147 raise 3148 ctx = args[0].ctx 3149 res = isl.isl_pw_aff_scale_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3150 obj = pw_aff(ctx=ctx, ptr=res) 3151 return obj 3152 raise Error 3153 def scale_down(*args): 3154 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3155 args = list(args) 3156 try: 3157 if not args[1].__class__ is val: 3158 args[1] = val(args[1]) 3159 except: 3160 raise 3161 ctx = args[0].ctx 3162 res = isl.isl_pw_aff_scale_down_val(isl.isl_pw_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3163 obj = pw_aff(ctx=ctx, ptr=res) 3164 return obj 3165 raise Error 3166 def space(arg0): 3167 try: 3168 if not arg0.__class__ is pw_aff: 3169 arg0 = pw_aff(arg0) 3170 except: 3171 raise 3172 ctx = arg0.ctx 3173 res = isl.isl_pw_aff_get_space(arg0.ptr) 3174 obj = space(ctx=ctx, ptr=res) 3175 return obj 3176 def get_space(arg0): 3177 return arg0.space() 3178 def sub(arg0, arg1): 3179 try: 3180 if not arg0.__class__ is pw_aff: 3181 arg0 = pw_aff(arg0) 3182 except: 3183 raise 3184 try: 3185 if not arg1.__class__ is pw_aff: 3186 arg1 = pw_aff(arg1) 3187 except: 3188 return union_pw_aff(arg0).sub(arg1) 3189 ctx = arg0.ctx 3190 res = isl.isl_pw_aff_sub(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3191 obj = pw_aff(ctx=ctx, ptr=res) 3192 return obj 3193 def subtract_domain(arg0, arg1): 3194 try: 3195 if not arg0.__class__ is pw_aff: 3196 arg0 = pw_aff(arg0) 3197 except: 3198 raise 3199 try: 3200 if not arg1.__class__ is set: 3201 arg1 = set(arg1) 3202 except: 3203 return union_pw_aff(arg0).subtract_domain(arg1) 3204 ctx = arg0.ctx 3205 res = isl.isl_pw_aff_subtract_domain(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3206 obj = pw_aff(ctx=ctx, ptr=res) 3207 return obj 3208 def tdiv_q(arg0, arg1): 3209 try: 3210 if not arg0.__class__ is pw_aff: 3211 arg0 = pw_aff(arg0) 3212 except: 3213 raise 3214 try: 3215 if not arg1.__class__ is pw_aff: 3216 arg1 = pw_aff(arg1) 3217 except: 3218 return union_pw_aff(arg0).tdiv_q(arg1) 3219 ctx = arg0.ctx 3220 res = isl.isl_pw_aff_tdiv_q(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3221 obj = pw_aff(ctx=ctx, ptr=res) 3222 return obj 3223 def tdiv_r(arg0, arg1): 3224 try: 3225 if not arg0.__class__ is pw_aff: 3226 arg0 = pw_aff(arg0) 3227 except: 3228 raise 3229 try: 3230 if not arg1.__class__ is pw_aff: 3231 arg1 = pw_aff(arg1) 3232 except: 3233 return union_pw_aff(arg0).tdiv_r(arg1) 3234 ctx = arg0.ctx 3235 res = isl.isl_pw_aff_tdiv_r(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3236 obj = pw_aff(ctx=ctx, ptr=res) 3237 return obj 3238 def to_list(arg0): 3239 try: 3240 if not arg0.__class__ is pw_aff: 3241 arg0 = pw_aff(arg0) 3242 except: 3243 raise 3244 ctx = arg0.ctx 3245 res = isl.isl_pw_aff_to_list(isl.isl_pw_aff_copy(arg0.ptr)) 3246 obj = pw_aff_list(ctx=ctx, ptr=res) 3247 return obj 3248 def to_union_pw_aff(arg0): 3249 try: 3250 if not arg0.__class__ is pw_aff: 3251 arg0 = pw_aff(arg0) 3252 except: 3253 raise 3254 ctx = arg0.ctx 3255 res = isl.isl_pw_aff_to_union_pw_aff(isl.isl_pw_aff_copy(arg0.ptr)) 3256 obj = union_pw_aff(ctx=ctx, ptr=res) 3257 return obj 3258 def union_add(arg0, arg1): 3259 try: 3260 if not arg0.__class__ is pw_aff: 3261 arg0 = pw_aff(arg0) 3262 except: 3263 raise 3264 try: 3265 if not arg1.__class__ is pw_aff: 3266 arg1 = pw_aff(arg1) 3267 except: 3268 return union_pw_aff(arg0).union_add(arg1) 3269 ctx = arg0.ctx 3270 res = isl.isl_pw_aff_union_add(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 3271 obj = pw_aff(ctx=ctx, ptr=res) 3272 return obj 3273 3274isl.isl_pw_aff_from_aff.restype = c_void_p 3275isl.isl_pw_aff_from_aff.argtypes = [c_void_p] 3276isl.isl_pw_aff_read_from_str.restype = c_void_p 3277isl.isl_pw_aff_read_from_str.argtypes = [Context, c_char_p] 3278isl.isl_pw_aff_add.restype = c_void_p 3279isl.isl_pw_aff_add.argtypes = [c_void_p, c_void_p] 3280isl.isl_pw_aff_add_constant_val.restype = c_void_p 3281isl.isl_pw_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 3282isl.isl_pw_aff_as_aff.restype = c_void_p 3283isl.isl_pw_aff_as_aff.argtypes = [c_void_p] 3284isl.isl_pw_aff_as_map.restype = c_void_p 3285isl.isl_pw_aff_as_map.argtypes = [c_void_p] 3286isl.isl_pw_aff_bind_id.restype = c_void_p 3287isl.isl_pw_aff_bind_id.argtypes = [c_void_p, c_void_p] 3288isl.isl_pw_aff_bind_domain.restype = c_void_p 3289isl.isl_pw_aff_bind_domain.argtypes = [c_void_p, c_void_p] 3290isl.isl_pw_aff_bind_domain_wrapped_domain.restype = c_void_p 3291isl.isl_pw_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 3292isl.isl_pw_aff_ceil.restype = c_void_p 3293isl.isl_pw_aff_ceil.argtypes = [c_void_p] 3294isl.isl_pw_aff_coalesce.restype = c_void_p 3295isl.isl_pw_aff_coalesce.argtypes = [c_void_p] 3296isl.isl_pw_aff_cond.restype = c_void_p 3297isl.isl_pw_aff_cond.argtypes = [c_void_p, c_void_p, c_void_p] 3298isl.isl_pw_aff_div.restype = c_void_p 3299isl.isl_pw_aff_div.argtypes = [c_void_p, c_void_p] 3300isl.isl_pw_aff_domain.restype = c_void_p 3301isl.isl_pw_aff_domain.argtypes = [c_void_p] 3302isl.isl_pw_aff_eq_set.restype = c_void_p 3303isl.isl_pw_aff_eq_set.argtypes = [c_void_p, c_void_p] 3304isl.isl_pw_aff_eval.restype = c_void_p 3305isl.isl_pw_aff_eval.argtypes = [c_void_p, c_void_p] 3306isl.isl_pw_aff_floor.restype = c_void_p 3307isl.isl_pw_aff_floor.argtypes = [c_void_p] 3308isl.isl_pw_aff_ge_set.restype = c_void_p 3309isl.isl_pw_aff_ge_set.argtypes = [c_void_p, c_void_p] 3310isl.isl_pw_aff_gist.restype = c_void_p 3311isl.isl_pw_aff_gist.argtypes = [c_void_p, c_void_p] 3312isl.isl_pw_aff_gt_set.restype = c_void_p 3313isl.isl_pw_aff_gt_set.argtypes = [c_void_p, c_void_p] 3314isl.isl_pw_aff_insert_domain.restype = c_void_p 3315isl.isl_pw_aff_insert_domain.argtypes = [c_void_p, c_void_p] 3316isl.isl_pw_aff_intersect_domain.restype = c_void_p 3317isl.isl_pw_aff_intersect_domain.argtypes = [c_void_p, c_void_p] 3318isl.isl_pw_aff_intersect_params.restype = c_void_p 3319isl.isl_pw_aff_intersect_params.argtypes = [c_void_p, c_void_p] 3320isl.isl_pw_aff_isa_aff.argtypes = [c_void_p] 3321isl.isl_pw_aff_le_set.restype = c_void_p 3322isl.isl_pw_aff_le_set.argtypes = [c_void_p, c_void_p] 3323isl.isl_pw_aff_lt_set.restype = c_void_p 3324isl.isl_pw_aff_lt_set.argtypes = [c_void_p, c_void_p] 3325isl.isl_pw_aff_max.restype = c_void_p 3326isl.isl_pw_aff_max.argtypes = [c_void_p, c_void_p] 3327isl.isl_pw_aff_min.restype = c_void_p 3328isl.isl_pw_aff_min.argtypes = [c_void_p, c_void_p] 3329isl.isl_pw_aff_mod_val.restype = c_void_p 3330isl.isl_pw_aff_mod_val.argtypes = [c_void_p, c_void_p] 3331isl.isl_pw_aff_mul.restype = c_void_p 3332isl.isl_pw_aff_mul.argtypes = [c_void_p, c_void_p] 3333isl.isl_pw_aff_ne_set.restype = c_void_p 3334isl.isl_pw_aff_ne_set.argtypes = [c_void_p, c_void_p] 3335isl.isl_pw_aff_neg.restype = c_void_p 3336isl.isl_pw_aff_neg.argtypes = [c_void_p] 3337isl.isl_pw_aff_param_on_domain_id.restype = c_void_p 3338isl.isl_pw_aff_param_on_domain_id.argtypes = [c_void_p, c_void_p] 3339isl.isl_pw_aff_pullback_multi_aff.restype = c_void_p 3340isl.isl_pw_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3341isl.isl_pw_aff_pullback_multi_pw_aff.restype = c_void_p 3342isl.isl_pw_aff_pullback_multi_pw_aff.argtypes = [c_void_p, c_void_p] 3343isl.isl_pw_aff_pullback_pw_multi_aff.restype = c_void_p 3344isl.isl_pw_aff_pullback_pw_multi_aff.argtypes = [c_void_p, c_void_p] 3345isl.isl_pw_aff_scale_val.restype = c_void_p 3346isl.isl_pw_aff_scale_val.argtypes = [c_void_p, c_void_p] 3347isl.isl_pw_aff_scale_down_val.restype = c_void_p 3348isl.isl_pw_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3349isl.isl_pw_aff_get_space.restype = c_void_p 3350isl.isl_pw_aff_get_space.argtypes = [c_void_p] 3351isl.isl_pw_aff_sub.restype = c_void_p 3352isl.isl_pw_aff_sub.argtypes = [c_void_p, c_void_p] 3353isl.isl_pw_aff_subtract_domain.restype = c_void_p 3354isl.isl_pw_aff_subtract_domain.argtypes = [c_void_p, c_void_p] 3355isl.isl_pw_aff_tdiv_q.restype = c_void_p 3356isl.isl_pw_aff_tdiv_q.argtypes = [c_void_p, c_void_p] 3357isl.isl_pw_aff_tdiv_r.restype = c_void_p 3358isl.isl_pw_aff_tdiv_r.argtypes = [c_void_p, c_void_p] 3359isl.isl_pw_aff_to_list.restype = c_void_p 3360isl.isl_pw_aff_to_list.argtypes = [c_void_p] 3361isl.isl_pw_aff_to_union_pw_aff.restype = c_void_p 3362isl.isl_pw_aff_to_union_pw_aff.argtypes = [c_void_p] 3363isl.isl_pw_aff_union_add.restype = c_void_p 3364isl.isl_pw_aff_union_add.argtypes = [c_void_p, c_void_p] 3365isl.isl_pw_aff_copy.restype = c_void_p 3366isl.isl_pw_aff_copy.argtypes = [c_void_p] 3367isl.isl_pw_aff_free.restype = c_void_p 3368isl.isl_pw_aff_free.argtypes = [c_void_p] 3369isl.isl_pw_aff_to_str.restype = POINTER(c_char) 3370isl.isl_pw_aff_to_str.argtypes = [c_void_p] 3371 3372class multi_aff(pw_multi_aff, multi_pw_aff): 3373 def __init__(self, *args, **keywords): 3374 if "ptr" in keywords: 3375 self.ctx = keywords["ctx"] 3376 self.ptr = keywords["ptr"] 3377 return 3378 if len(args) == 1 and args[0].__class__ is aff: 3379 self.ctx = Context.getDefaultInstance() 3380 self.ptr = isl.isl_multi_aff_from_aff(isl.isl_aff_copy(args[0].ptr)) 3381 return 3382 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is aff_list: 3383 self.ctx = Context.getDefaultInstance() 3384 self.ptr = isl.isl_multi_aff_from_aff_list(isl.isl_space_copy(args[0].ptr), isl.isl_aff_list_copy(args[1].ptr)) 3385 return 3386 if len(args) == 1 and type(args[0]) == str: 3387 self.ctx = Context.getDefaultInstance() 3388 self.ptr = isl.isl_multi_aff_read_from_str(self.ctx, args[0].encode('ascii')) 3389 return 3390 raise Error 3391 def __del__(self): 3392 if hasattr(self, 'ptr'): 3393 isl.isl_multi_aff_free(self.ptr) 3394 def __str__(arg0): 3395 try: 3396 if not arg0.__class__ is multi_aff: 3397 arg0 = multi_aff(arg0) 3398 except: 3399 raise 3400 ptr = isl.isl_multi_aff_to_str(arg0.ptr) 3401 res = cast(ptr, c_char_p).value.decode('ascii') 3402 libc.free(ptr) 3403 return res 3404 def __repr__(self): 3405 s = str(self) 3406 if '"' in s: 3407 return 'isl.multi_aff("""%s""")' % s 3408 else: 3409 return 'isl.multi_aff("%s")' % s 3410 def add(arg0, arg1): 3411 try: 3412 if not arg0.__class__ is multi_aff: 3413 arg0 = multi_aff(arg0) 3414 except: 3415 raise 3416 try: 3417 if not arg1.__class__ is multi_aff: 3418 arg1 = multi_aff(arg1) 3419 except: 3420 return pw_multi_aff(arg0).add(arg1) 3421 ctx = arg0.ctx 3422 res = isl.isl_multi_aff_add(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3423 obj = multi_aff(ctx=ctx, ptr=res) 3424 return obj 3425 def add_constant(*args): 3426 if len(args) == 2 and args[1].__class__ is multi_val: 3427 ctx = args[0].ctx 3428 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)) 3429 obj = multi_aff(ctx=ctx, ptr=res) 3430 return obj 3431 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3432 args = list(args) 3433 try: 3434 if not args[1].__class__ is val: 3435 args[1] = val(args[1]) 3436 except: 3437 raise 3438 ctx = args[0].ctx 3439 res = isl.isl_multi_aff_add_constant_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3440 obj = multi_aff(ctx=ctx, ptr=res) 3441 return obj 3442 raise Error 3443 def as_map(arg0): 3444 try: 3445 if not arg0.__class__ is multi_aff: 3446 arg0 = multi_aff(arg0) 3447 except: 3448 raise 3449 ctx = arg0.ctx 3450 res = isl.isl_multi_aff_as_map(isl.isl_multi_aff_copy(arg0.ptr)) 3451 obj = map(ctx=ctx, ptr=res) 3452 return obj 3453 def as_set(arg0): 3454 try: 3455 if not arg0.__class__ is multi_aff: 3456 arg0 = multi_aff(arg0) 3457 except: 3458 raise 3459 ctx = arg0.ctx 3460 res = isl.isl_multi_aff_as_set(isl.isl_multi_aff_copy(arg0.ptr)) 3461 obj = set(ctx=ctx, ptr=res) 3462 return obj 3463 def at(arg0, arg1): 3464 try: 3465 if not arg0.__class__ is multi_aff: 3466 arg0 = multi_aff(arg0) 3467 except: 3468 raise 3469 ctx = arg0.ctx 3470 res = isl.isl_multi_aff_get_at(arg0.ptr, arg1) 3471 obj = aff(ctx=ctx, ptr=res) 3472 return obj 3473 def get_at(arg0, arg1): 3474 return arg0.at(arg1) 3475 def bind(arg0, arg1): 3476 try: 3477 if not arg0.__class__ is multi_aff: 3478 arg0 = multi_aff(arg0) 3479 except: 3480 raise 3481 try: 3482 if not arg1.__class__ is multi_id: 3483 arg1 = multi_id(arg1) 3484 except: 3485 return pw_multi_aff(arg0).bind(arg1) 3486 ctx = arg0.ctx 3487 res = isl.isl_multi_aff_bind(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3488 obj = basic_set(ctx=ctx, ptr=res) 3489 return obj 3490 def bind_domain(arg0, arg1): 3491 try: 3492 if not arg0.__class__ is multi_aff: 3493 arg0 = multi_aff(arg0) 3494 except: 3495 raise 3496 try: 3497 if not arg1.__class__ is multi_id: 3498 arg1 = multi_id(arg1) 3499 except: 3500 return pw_multi_aff(arg0).bind_domain(arg1) 3501 ctx = arg0.ctx 3502 res = isl.isl_multi_aff_bind_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3503 obj = multi_aff(ctx=ctx, ptr=res) 3504 return obj 3505 def bind_domain_wrapped_domain(arg0, arg1): 3506 try: 3507 if not arg0.__class__ is multi_aff: 3508 arg0 = multi_aff(arg0) 3509 except: 3510 raise 3511 try: 3512 if not arg1.__class__ is multi_id: 3513 arg1 = multi_id(arg1) 3514 except: 3515 return pw_multi_aff(arg0).bind_domain_wrapped_domain(arg1) 3516 ctx = arg0.ctx 3517 res = isl.isl_multi_aff_bind_domain_wrapped_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3518 obj = multi_aff(ctx=ctx, ptr=res) 3519 return obj 3520 def constant_multi_val(arg0): 3521 try: 3522 if not arg0.__class__ is multi_aff: 3523 arg0 = multi_aff(arg0) 3524 except: 3525 raise 3526 ctx = arg0.ctx 3527 res = isl.isl_multi_aff_get_constant_multi_val(arg0.ptr) 3528 obj = multi_val(ctx=ctx, ptr=res) 3529 return obj 3530 def get_constant_multi_val(arg0): 3531 return arg0.constant_multi_val() 3532 @staticmethod 3533 def domain_map(arg0): 3534 try: 3535 if not arg0.__class__ is space: 3536 arg0 = space(arg0) 3537 except: 3538 raise 3539 ctx = arg0.ctx 3540 res = isl.isl_multi_aff_domain_map(isl.isl_space_copy(arg0.ptr)) 3541 obj = multi_aff(ctx=ctx, ptr=res) 3542 return obj 3543 def flat_range_product(arg0, arg1): 3544 try: 3545 if not arg0.__class__ is multi_aff: 3546 arg0 = multi_aff(arg0) 3547 except: 3548 raise 3549 try: 3550 if not arg1.__class__ is multi_aff: 3551 arg1 = multi_aff(arg1) 3552 except: 3553 return pw_multi_aff(arg0).flat_range_product(arg1) 3554 ctx = arg0.ctx 3555 res = isl.isl_multi_aff_flat_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3556 obj = multi_aff(ctx=ctx, ptr=res) 3557 return obj 3558 def floor(arg0): 3559 try: 3560 if not arg0.__class__ is multi_aff: 3561 arg0 = multi_aff(arg0) 3562 except: 3563 raise 3564 ctx = arg0.ctx 3565 res = isl.isl_multi_aff_floor(isl.isl_multi_aff_copy(arg0.ptr)) 3566 obj = multi_aff(ctx=ctx, ptr=res) 3567 return obj 3568 def gist(arg0, arg1): 3569 try: 3570 if not arg0.__class__ is multi_aff: 3571 arg0 = multi_aff(arg0) 3572 except: 3573 raise 3574 try: 3575 if not arg1.__class__ is set: 3576 arg1 = set(arg1) 3577 except: 3578 return pw_multi_aff(arg0).gist(arg1) 3579 ctx = arg0.ctx 3580 res = isl.isl_multi_aff_gist(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 3581 obj = multi_aff(ctx=ctx, ptr=res) 3582 return obj 3583 def has_range_tuple_id(arg0): 3584 try: 3585 if not arg0.__class__ is multi_aff: 3586 arg0 = multi_aff(arg0) 3587 except: 3588 raise 3589 ctx = arg0.ctx 3590 res = isl.isl_multi_aff_has_range_tuple_id(arg0.ptr) 3591 if res < 0: 3592 raise 3593 return bool(res) 3594 def identity(*args): 3595 if len(args) == 1: 3596 ctx = args[0].ctx 3597 res = isl.isl_multi_aff_identity_multi_aff(isl.isl_multi_aff_copy(args[0].ptr)) 3598 obj = multi_aff(ctx=ctx, ptr=res) 3599 return obj 3600 raise Error 3601 @staticmethod 3602 def identity_on_domain(*args): 3603 if len(args) == 1 and args[0].__class__ is space: 3604 ctx = args[0].ctx 3605 res = isl.isl_multi_aff_identity_on_domain_space(isl.isl_space_copy(args[0].ptr)) 3606 obj = multi_aff(ctx=ctx, ptr=res) 3607 return obj 3608 raise Error 3609 def insert_domain(arg0, arg1): 3610 try: 3611 if not arg0.__class__ is multi_aff: 3612 arg0 = multi_aff(arg0) 3613 except: 3614 raise 3615 try: 3616 if not arg1.__class__ is space: 3617 arg1 = space(arg1) 3618 except: 3619 return pw_multi_aff(arg0).insert_domain(arg1) 3620 ctx = arg0.ctx 3621 res = isl.isl_multi_aff_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 3622 obj = multi_aff(ctx=ctx, ptr=res) 3623 return obj 3624 def involves_locals(arg0): 3625 try: 3626 if not arg0.__class__ is multi_aff: 3627 arg0 = multi_aff(arg0) 3628 except: 3629 raise 3630 ctx = arg0.ctx 3631 res = isl.isl_multi_aff_involves_locals(arg0.ptr) 3632 if res < 0: 3633 raise 3634 return bool(res) 3635 def involves_nan(arg0): 3636 try: 3637 if not arg0.__class__ is multi_aff: 3638 arg0 = multi_aff(arg0) 3639 except: 3640 raise 3641 ctx = arg0.ctx 3642 res = isl.isl_multi_aff_involves_nan(arg0.ptr) 3643 if res < 0: 3644 raise 3645 return bool(res) 3646 def list(arg0): 3647 try: 3648 if not arg0.__class__ is multi_aff: 3649 arg0 = multi_aff(arg0) 3650 except: 3651 raise 3652 ctx = arg0.ctx 3653 res = isl.isl_multi_aff_get_list(arg0.ptr) 3654 obj = aff_list(ctx=ctx, ptr=res) 3655 return obj 3656 def get_list(arg0): 3657 return arg0.list() 3658 @staticmethod 3659 def multi_val_on_domain(*args): 3660 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is multi_val: 3661 ctx = args[0].ctx 3662 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)) 3663 obj = multi_aff(ctx=ctx, ptr=res) 3664 return obj 3665 raise Error 3666 def neg(arg0): 3667 try: 3668 if not arg0.__class__ is multi_aff: 3669 arg0 = multi_aff(arg0) 3670 except: 3671 raise 3672 ctx = arg0.ctx 3673 res = isl.isl_multi_aff_neg(isl.isl_multi_aff_copy(arg0.ptr)) 3674 obj = multi_aff(ctx=ctx, ptr=res) 3675 return obj 3676 def plain_is_equal(arg0, arg1): 3677 try: 3678 if not arg0.__class__ is multi_aff: 3679 arg0 = multi_aff(arg0) 3680 except: 3681 raise 3682 try: 3683 if not arg1.__class__ is multi_aff: 3684 arg1 = multi_aff(arg1) 3685 except: 3686 return pw_multi_aff(arg0).plain_is_equal(arg1) 3687 ctx = arg0.ctx 3688 res = isl.isl_multi_aff_plain_is_equal(arg0.ptr, arg1.ptr) 3689 if res < 0: 3690 raise 3691 return bool(res) 3692 def product(arg0, arg1): 3693 try: 3694 if not arg0.__class__ is multi_aff: 3695 arg0 = multi_aff(arg0) 3696 except: 3697 raise 3698 try: 3699 if not arg1.__class__ is multi_aff: 3700 arg1 = multi_aff(arg1) 3701 except: 3702 return pw_multi_aff(arg0).product(arg1) 3703 ctx = arg0.ctx 3704 res = isl.isl_multi_aff_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3705 obj = multi_aff(ctx=ctx, ptr=res) 3706 return obj 3707 def pullback(*args): 3708 if len(args) == 2 and args[1].__class__ is multi_aff: 3709 ctx = args[0].ctx 3710 res = isl.isl_multi_aff_pullback_multi_aff(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 3711 obj = multi_aff(ctx=ctx, ptr=res) 3712 return obj 3713 raise Error 3714 @staticmethod 3715 def range_map(arg0): 3716 try: 3717 if not arg0.__class__ is space: 3718 arg0 = space(arg0) 3719 except: 3720 raise 3721 ctx = arg0.ctx 3722 res = isl.isl_multi_aff_range_map(isl.isl_space_copy(arg0.ptr)) 3723 obj = multi_aff(ctx=ctx, ptr=res) 3724 return obj 3725 def range_product(arg0, arg1): 3726 try: 3727 if not arg0.__class__ is multi_aff: 3728 arg0 = multi_aff(arg0) 3729 except: 3730 raise 3731 try: 3732 if not arg1.__class__ is multi_aff: 3733 arg1 = multi_aff(arg1) 3734 except: 3735 return pw_multi_aff(arg0).range_product(arg1) 3736 ctx = arg0.ctx 3737 res = isl.isl_multi_aff_range_product(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3738 obj = multi_aff(ctx=ctx, ptr=res) 3739 return obj 3740 def range_tuple_id(arg0): 3741 try: 3742 if not arg0.__class__ is multi_aff: 3743 arg0 = multi_aff(arg0) 3744 except: 3745 raise 3746 ctx = arg0.ctx 3747 res = isl.isl_multi_aff_get_range_tuple_id(arg0.ptr) 3748 obj = id(ctx=ctx, ptr=res) 3749 return obj 3750 def get_range_tuple_id(arg0): 3751 return arg0.range_tuple_id() 3752 def reset_range_tuple_id(arg0): 3753 try: 3754 if not arg0.__class__ is multi_aff: 3755 arg0 = multi_aff(arg0) 3756 except: 3757 raise 3758 ctx = arg0.ctx 3759 res = isl.isl_multi_aff_reset_range_tuple_id(isl.isl_multi_aff_copy(arg0.ptr)) 3760 obj = multi_aff(ctx=ctx, ptr=res) 3761 return obj 3762 def scale(*args): 3763 if len(args) == 2 and args[1].__class__ is multi_val: 3764 ctx = args[0].ctx 3765 res = isl.isl_multi_aff_scale_multi_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 3766 obj = multi_aff(ctx=ctx, ptr=res) 3767 return obj 3768 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3769 args = list(args) 3770 try: 3771 if not args[1].__class__ is val: 3772 args[1] = val(args[1]) 3773 except: 3774 raise 3775 ctx = args[0].ctx 3776 res = isl.isl_multi_aff_scale_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3777 obj = multi_aff(ctx=ctx, ptr=res) 3778 return obj 3779 raise Error 3780 def scale_down(*args): 3781 if len(args) == 2 and args[1].__class__ is multi_val: 3782 ctx = args[0].ctx 3783 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)) 3784 obj = multi_aff(ctx=ctx, ptr=res) 3785 return obj 3786 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 3787 args = list(args) 3788 try: 3789 if not args[1].__class__ is val: 3790 args[1] = val(args[1]) 3791 except: 3792 raise 3793 ctx = args[0].ctx 3794 res = isl.isl_multi_aff_scale_down_val(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 3795 obj = multi_aff(ctx=ctx, ptr=res) 3796 return obj 3797 raise Error 3798 def set_at(arg0, arg1, arg2): 3799 try: 3800 if not arg0.__class__ is multi_aff: 3801 arg0 = multi_aff(arg0) 3802 except: 3803 raise 3804 try: 3805 if not arg2.__class__ is aff: 3806 arg2 = aff(arg2) 3807 except: 3808 return pw_multi_aff(arg0).set_at(arg1, arg2) 3809 ctx = arg0.ctx 3810 res = isl.isl_multi_aff_set_at(isl.isl_multi_aff_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 3811 obj = multi_aff(ctx=ctx, ptr=res) 3812 return obj 3813 def set_range_tuple(*args): 3814 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 3815 args = list(args) 3816 try: 3817 if not args[1].__class__ is id: 3818 args[1] = id(args[1]) 3819 except: 3820 raise 3821 ctx = args[0].ctx 3822 res = isl.isl_multi_aff_set_range_tuple_id(isl.isl_multi_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 3823 obj = multi_aff(ctx=ctx, ptr=res) 3824 return obj 3825 raise Error 3826 def size(arg0): 3827 try: 3828 if not arg0.__class__ is multi_aff: 3829 arg0 = multi_aff(arg0) 3830 except: 3831 raise 3832 ctx = arg0.ctx 3833 res = isl.isl_multi_aff_size(arg0.ptr) 3834 if res < 0: 3835 raise 3836 return int(res) 3837 def space(arg0): 3838 try: 3839 if not arg0.__class__ is multi_aff: 3840 arg0 = multi_aff(arg0) 3841 except: 3842 raise 3843 ctx = arg0.ctx 3844 res = isl.isl_multi_aff_get_space(arg0.ptr) 3845 obj = space(ctx=ctx, ptr=res) 3846 return obj 3847 def get_space(arg0): 3848 return arg0.space() 3849 def sub(arg0, arg1): 3850 try: 3851 if not arg0.__class__ is multi_aff: 3852 arg0 = multi_aff(arg0) 3853 except: 3854 raise 3855 try: 3856 if not arg1.__class__ is multi_aff: 3857 arg1 = multi_aff(arg1) 3858 except: 3859 return pw_multi_aff(arg0).sub(arg1) 3860 ctx = arg0.ctx 3861 res = isl.isl_multi_aff_sub(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_aff_copy(arg1.ptr)) 3862 obj = multi_aff(ctx=ctx, ptr=res) 3863 return obj 3864 def to_multi_pw_aff(arg0): 3865 try: 3866 if not arg0.__class__ is multi_aff: 3867 arg0 = multi_aff(arg0) 3868 except: 3869 raise 3870 ctx = arg0.ctx 3871 res = isl.isl_multi_aff_to_multi_pw_aff(isl.isl_multi_aff_copy(arg0.ptr)) 3872 obj = multi_pw_aff(ctx=ctx, ptr=res) 3873 return obj 3874 def to_multi_union_pw_aff(arg0): 3875 try: 3876 if not arg0.__class__ is multi_aff: 3877 arg0 = multi_aff(arg0) 3878 except: 3879 raise 3880 ctx = arg0.ctx 3881 res = isl.isl_multi_aff_to_multi_union_pw_aff(isl.isl_multi_aff_copy(arg0.ptr)) 3882 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 3883 return obj 3884 def to_pw_multi_aff(arg0): 3885 try: 3886 if not arg0.__class__ is multi_aff: 3887 arg0 = multi_aff(arg0) 3888 except: 3889 raise 3890 ctx = arg0.ctx 3891 res = isl.isl_multi_aff_to_pw_multi_aff(isl.isl_multi_aff_copy(arg0.ptr)) 3892 obj = pw_multi_aff(ctx=ctx, ptr=res) 3893 return obj 3894 def unbind_params_insert_domain(arg0, arg1): 3895 try: 3896 if not arg0.__class__ is multi_aff: 3897 arg0 = multi_aff(arg0) 3898 except: 3899 raise 3900 try: 3901 if not arg1.__class__ is multi_id: 3902 arg1 = multi_id(arg1) 3903 except: 3904 return pw_multi_aff(arg0).unbind_params_insert_domain(arg1) 3905 ctx = arg0.ctx 3906 res = isl.isl_multi_aff_unbind_params_insert_domain(isl.isl_multi_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 3907 obj = multi_aff(ctx=ctx, ptr=res) 3908 return obj 3909 @staticmethod 3910 def zero(arg0): 3911 try: 3912 if not arg0.__class__ is space: 3913 arg0 = space(arg0) 3914 except: 3915 raise 3916 ctx = arg0.ctx 3917 res = isl.isl_multi_aff_zero(isl.isl_space_copy(arg0.ptr)) 3918 obj = multi_aff(ctx=ctx, ptr=res) 3919 return obj 3920 3921isl.isl_multi_aff_from_aff.restype = c_void_p 3922isl.isl_multi_aff_from_aff.argtypes = [c_void_p] 3923isl.isl_multi_aff_from_aff_list.restype = c_void_p 3924isl.isl_multi_aff_from_aff_list.argtypes = [c_void_p, c_void_p] 3925isl.isl_multi_aff_read_from_str.restype = c_void_p 3926isl.isl_multi_aff_read_from_str.argtypes = [Context, c_char_p] 3927isl.isl_multi_aff_add.restype = c_void_p 3928isl.isl_multi_aff_add.argtypes = [c_void_p, c_void_p] 3929isl.isl_multi_aff_add_constant_multi_val.restype = c_void_p 3930isl.isl_multi_aff_add_constant_multi_val.argtypes = [c_void_p, c_void_p] 3931isl.isl_multi_aff_add_constant_val.restype = c_void_p 3932isl.isl_multi_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 3933isl.isl_multi_aff_as_map.restype = c_void_p 3934isl.isl_multi_aff_as_map.argtypes = [c_void_p] 3935isl.isl_multi_aff_as_set.restype = c_void_p 3936isl.isl_multi_aff_as_set.argtypes = [c_void_p] 3937isl.isl_multi_aff_get_at.restype = c_void_p 3938isl.isl_multi_aff_get_at.argtypes = [c_void_p, c_int] 3939isl.isl_multi_aff_bind.restype = c_void_p 3940isl.isl_multi_aff_bind.argtypes = [c_void_p, c_void_p] 3941isl.isl_multi_aff_bind_domain.restype = c_void_p 3942isl.isl_multi_aff_bind_domain.argtypes = [c_void_p, c_void_p] 3943isl.isl_multi_aff_bind_domain_wrapped_domain.restype = c_void_p 3944isl.isl_multi_aff_bind_domain_wrapped_domain.argtypes = [c_void_p, c_void_p] 3945isl.isl_multi_aff_get_constant_multi_val.restype = c_void_p 3946isl.isl_multi_aff_get_constant_multi_val.argtypes = [c_void_p] 3947isl.isl_multi_aff_domain_map.restype = c_void_p 3948isl.isl_multi_aff_domain_map.argtypes = [c_void_p] 3949isl.isl_multi_aff_flat_range_product.restype = c_void_p 3950isl.isl_multi_aff_flat_range_product.argtypes = [c_void_p, c_void_p] 3951isl.isl_multi_aff_floor.restype = c_void_p 3952isl.isl_multi_aff_floor.argtypes = [c_void_p] 3953isl.isl_multi_aff_gist.restype = c_void_p 3954isl.isl_multi_aff_gist.argtypes = [c_void_p, c_void_p] 3955isl.isl_multi_aff_has_range_tuple_id.argtypes = [c_void_p] 3956isl.isl_multi_aff_identity_multi_aff.restype = c_void_p 3957isl.isl_multi_aff_identity_multi_aff.argtypes = [c_void_p] 3958isl.isl_multi_aff_identity_on_domain_space.restype = c_void_p 3959isl.isl_multi_aff_identity_on_domain_space.argtypes = [c_void_p] 3960isl.isl_multi_aff_insert_domain.restype = c_void_p 3961isl.isl_multi_aff_insert_domain.argtypes = [c_void_p, c_void_p] 3962isl.isl_multi_aff_involves_locals.argtypes = [c_void_p] 3963isl.isl_multi_aff_involves_nan.argtypes = [c_void_p] 3964isl.isl_multi_aff_get_list.restype = c_void_p 3965isl.isl_multi_aff_get_list.argtypes = [c_void_p] 3966isl.isl_multi_aff_multi_val_on_domain_space.restype = c_void_p 3967isl.isl_multi_aff_multi_val_on_domain_space.argtypes = [c_void_p, c_void_p] 3968isl.isl_multi_aff_neg.restype = c_void_p 3969isl.isl_multi_aff_neg.argtypes = [c_void_p] 3970isl.isl_multi_aff_plain_is_equal.argtypes = [c_void_p, c_void_p] 3971isl.isl_multi_aff_product.restype = c_void_p 3972isl.isl_multi_aff_product.argtypes = [c_void_p, c_void_p] 3973isl.isl_multi_aff_pullback_multi_aff.restype = c_void_p 3974isl.isl_multi_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 3975isl.isl_multi_aff_range_map.restype = c_void_p 3976isl.isl_multi_aff_range_map.argtypes = [c_void_p] 3977isl.isl_multi_aff_range_product.restype = c_void_p 3978isl.isl_multi_aff_range_product.argtypes = [c_void_p, c_void_p] 3979isl.isl_multi_aff_get_range_tuple_id.restype = c_void_p 3980isl.isl_multi_aff_get_range_tuple_id.argtypes = [c_void_p] 3981isl.isl_multi_aff_reset_range_tuple_id.restype = c_void_p 3982isl.isl_multi_aff_reset_range_tuple_id.argtypes = [c_void_p] 3983isl.isl_multi_aff_scale_multi_val.restype = c_void_p 3984isl.isl_multi_aff_scale_multi_val.argtypes = [c_void_p, c_void_p] 3985isl.isl_multi_aff_scale_val.restype = c_void_p 3986isl.isl_multi_aff_scale_val.argtypes = [c_void_p, c_void_p] 3987isl.isl_multi_aff_scale_down_multi_val.restype = c_void_p 3988isl.isl_multi_aff_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 3989isl.isl_multi_aff_scale_down_val.restype = c_void_p 3990isl.isl_multi_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 3991isl.isl_multi_aff_set_at.restype = c_void_p 3992isl.isl_multi_aff_set_at.argtypes = [c_void_p, c_int, c_void_p] 3993isl.isl_multi_aff_set_range_tuple_id.restype = c_void_p 3994isl.isl_multi_aff_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 3995isl.isl_multi_aff_size.argtypes = [c_void_p] 3996isl.isl_multi_aff_get_space.restype = c_void_p 3997isl.isl_multi_aff_get_space.argtypes = [c_void_p] 3998isl.isl_multi_aff_sub.restype = c_void_p 3999isl.isl_multi_aff_sub.argtypes = [c_void_p, c_void_p] 4000isl.isl_multi_aff_to_multi_pw_aff.restype = c_void_p 4001isl.isl_multi_aff_to_multi_pw_aff.argtypes = [c_void_p] 4002isl.isl_multi_aff_to_multi_union_pw_aff.restype = c_void_p 4003isl.isl_multi_aff_to_multi_union_pw_aff.argtypes = [c_void_p] 4004isl.isl_multi_aff_to_pw_multi_aff.restype = c_void_p 4005isl.isl_multi_aff_to_pw_multi_aff.argtypes = [c_void_p] 4006isl.isl_multi_aff_unbind_params_insert_domain.restype = c_void_p 4007isl.isl_multi_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 4008isl.isl_multi_aff_zero.restype = c_void_p 4009isl.isl_multi_aff_zero.argtypes = [c_void_p] 4010isl.isl_multi_aff_copy.restype = c_void_p 4011isl.isl_multi_aff_copy.argtypes = [c_void_p] 4012isl.isl_multi_aff_free.restype = c_void_p 4013isl.isl_multi_aff_free.argtypes = [c_void_p] 4014isl.isl_multi_aff_to_str.restype = POINTER(c_char) 4015isl.isl_multi_aff_to_str.argtypes = [c_void_p] 4016 4017class aff(pw_aff, multi_aff): 4018 def __init__(self, *args, **keywords): 4019 if "ptr" in keywords: 4020 self.ctx = keywords["ctx"] 4021 self.ptr = keywords["ptr"] 4022 return 4023 if len(args) == 1 and type(args[0]) == str: 4024 self.ctx = Context.getDefaultInstance() 4025 self.ptr = isl.isl_aff_read_from_str(self.ctx, args[0].encode('ascii')) 4026 return 4027 raise Error 4028 def __del__(self): 4029 if hasattr(self, 'ptr'): 4030 isl.isl_aff_free(self.ptr) 4031 def __str__(arg0): 4032 try: 4033 if not arg0.__class__ is aff: 4034 arg0 = aff(arg0) 4035 except: 4036 raise 4037 ptr = isl.isl_aff_to_str(arg0.ptr) 4038 res = cast(ptr, c_char_p).value.decode('ascii') 4039 libc.free(ptr) 4040 return res 4041 def __repr__(self): 4042 s = str(self) 4043 if '"' in s: 4044 return 'isl.aff("""%s""")' % s 4045 else: 4046 return 'isl.aff("%s")' % s 4047 def add(arg0, arg1): 4048 try: 4049 if not arg0.__class__ is aff: 4050 arg0 = aff(arg0) 4051 except: 4052 raise 4053 try: 4054 if not arg1.__class__ is aff: 4055 arg1 = aff(arg1) 4056 except: 4057 return pw_aff(arg0).add(arg1) 4058 ctx = arg0.ctx 4059 res = isl.isl_aff_add(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4060 obj = aff(ctx=ctx, ptr=res) 4061 return obj 4062 def add_constant(*args): 4063 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4064 args = list(args) 4065 try: 4066 if not args[1].__class__ is val: 4067 args[1] = val(args[1]) 4068 except: 4069 raise 4070 ctx = args[0].ctx 4071 res = isl.isl_aff_add_constant_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4072 obj = aff(ctx=ctx, ptr=res) 4073 return obj 4074 raise Error 4075 def bind(*args): 4076 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 4077 args = list(args) 4078 try: 4079 if not args[1].__class__ is id: 4080 args[1] = id(args[1]) 4081 except: 4082 raise 4083 ctx = args[0].ctx 4084 res = isl.isl_aff_bind_id(isl.isl_aff_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 4085 obj = basic_set(ctx=ctx, ptr=res) 4086 return obj 4087 raise Error 4088 def ceil(arg0): 4089 try: 4090 if not arg0.__class__ is aff: 4091 arg0 = aff(arg0) 4092 except: 4093 raise 4094 ctx = arg0.ctx 4095 res = isl.isl_aff_ceil(isl.isl_aff_copy(arg0.ptr)) 4096 obj = aff(ctx=ctx, ptr=res) 4097 return obj 4098 def constant_val(arg0): 4099 try: 4100 if not arg0.__class__ is aff: 4101 arg0 = aff(arg0) 4102 except: 4103 raise 4104 ctx = arg0.ctx 4105 res = isl.isl_aff_get_constant_val(arg0.ptr) 4106 obj = val(ctx=ctx, ptr=res) 4107 return obj 4108 def get_constant_val(arg0): 4109 return arg0.constant_val() 4110 def div(arg0, arg1): 4111 try: 4112 if not arg0.__class__ is aff: 4113 arg0 = aff(arg0) 4114 except: 4115 raise 4116 try: 4117 if not arg1.__class__ is aff: 4118 arg1 = aff(arg1) 4119 except: 4120 return pw_aff(arg0).div(arg1) 4121 ctx = arg0.ctx 4122 res = isl.isl_aff_div(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4123 obj = aff(ctx=ctx, ptr=res) 4124 return obj 4125 def eq_set(arg0, arg1): 4126 try: 4127 if not arg0.__class__ is aff: 4128 arg0 = aff(arg0) 4129 except: 4130 raise 4131 try: 4132 if not arg1.__class__ is aff: 4133 arg1 = aff(arg1) 4134 except: 4135 return pw_aff(arg0).eq_set(arg1) 4136 ctx = arg0.ctx 4137 res = isl.isl_aff_eq_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4138 obj = set(ctx=ctx, ptr=res) 4139 return obj 4140 def eval(arg0, arg1): 4141 try: 4142 if not arg0.__class__ is aff: 4143 arg0 = aff(arg0) 4144 except: 4145 raise 4146 try: 4147 if not arg1.__class__ is point: 4148 arg1 = point(arg1) 4149 except: 4150 return pw_aff(arg0).eval(arg1) 4151 ctx = arg0.ctx 4152 res = isl.isl_aff_eval(isl.isl_aff_copy(arg0.ptr), isl.isl_point_copy(arg1.ptr)) 4153 obj = val(ctx=ctx, ptr=res) 4154 return obj 4155 def floor(arg0): 4156 try: 4157 if not arg0.__class__ is aff: 4158 arg0 = aff(arg0) 4159 except: 4160 raise 4161 ctx = arg0.ctx 4162 res = isl.isl_aff_floor(isl.isl_aff_copy(arg0.ptr)) 4163 obj = aff(ctx=ctx, ptr=res) 4164 return obj 4165 def ge_set(arg0, arg1): 4166 try: 4167 if not arg0.__class__ is aff: 4168 arg0 = aff(arg0) 4169 except: 4170 raise 4171 try: 4172 if not arg1.__class__ is aff: 4173 arg1 = aff(arg1) 4174 except: 4175 return pw_aff(arg0).ge_set(arg1) 4176 ctx = arg0.ctx 4177 res = isl.isl_aff_ge_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4178 obj = set(ctx=ctx, ptr=res) 4179 return obj 4180 def gist(arg0, arg1): 4181 try: 4182 if not arg0.__class__ is aff: 4183 arg0 = aff(arg0) 4184 except: 4185 raise 4186 try: 4187 if not arg1.__class__ is set: 4188 arg1 = set(arg1) 4189 except: 4190 return pw_aff(arg0).gist(arg1) 4191 ctx = arg0.ctx 4192 res = isl.isl_aff_gist(isl.isl_aff_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 4193 obj = aff(ctx=ctx, ptr=res) 4194 return obj 4195 def gt_set(arg0, arg1): 4196 try: 4197 if not arg0.__class__ is aff: 4198 arg0 = aff(arg0) 4199 except: 4200 raise 4201 try: 4202 if not arg1.__class__ is aff: 4203 arg1 = aff(arg1) 4204 except: 4205 return pw_aff(arg0).gt_set(arg1) 4206 ctx = arg0.ctx 4207 res = isl.isl_aff_gt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4208 obj = set(ctx=ctx, ptr=res) 4209 return obj 4210 def is_cst(arg0): 4211 try: 4212 if not arg0.__class__ is aff: 4213 arg0 = aff(arg0) 4214 except: 4215 raise 4216 ctx = arg0.ctx 4217 res = isl.isl_aff_is_cst(arg0.ptr) 4218 if res < 0: 4219 raise 4220 return bool(res) 4221 def le_set(arg0, arg1): 4222 try: 4223 if not arg0.__class__ is aff: 4224 arg0 = aff(arg0) 4225 except: 4226 raise 4227 try: 4228 if not arg1.__class__ is aff: 4229 arg1 = aff(arg1) 4230 except: 4231 return pw_aff(arg0).le_set(arg1) 4232 ctx = arg0.ctx 4233 res = isl.isl_aff_le_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4234 obj = set(ctx=ctx, ptr=res) 4235 return obj 4236 def lt_set(arg0, arg1): 4237 try: 4238 if not arg0.__class__ is aff: 4239 arg0 = aff(arg0) 4240 except: 4241 raise 4242 try: 4243 if not arg1.__class__ is aff: 4244 arg1 = aff(arg1) 4245 except: 4246 return pw_aff(arg0).lt_set(arg1) 4247 ctx = arg0.ctx 4248 res = isl.isl_aff_lt_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4249 obj = set(ctx=ctx, ptr=res) 4250 return obj 4251 def mod(*args): 4252 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4253 args = list(args) 4254 try: 4255 if not args[1].__class__ is val: 4256 args[1] = val(args[1]) 4257 except: 4258 raise 4259 ctx = args[0].ctx 4260 res = isl.isl_aff_mod_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4261 obj = aff(ctx=ctx, ptr=res) 4262 return obj 4263 raise Error 4264 def mul(arg0, arg1): 4265 try: 4266 if not arg0.__class__ is aff: 4267 arg0 = aff(arg0) 4268 except: 4269 raise 4270 try: 4271 if not arg1.__class__ is aff: 4272 arg1 = aff(arg1) 4273 except: 4274 return pw_aff(arg0).mul(arg1) 4275 ctx = arg0.ctx 4276 res = isl.isl_aff_mul(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4277 obj = aff(ctx=ctx, ptr=res) 4278 return obj 4279 def ne_set(arg0, arg1): 4280 try: 4281 if not arg0.__class__ is aff: 4282 arg0 = aff(arg0) 4283 except: 4284 raise 4285 try: 4286 if not arg1.__class__ is aff: 4287 arg1 = aff(arg1) 4288 except: 4289 return pw_aff(arg0).ne_set(arg1) 4290 ctx = arg0.ctx 4291 res = isl.isl_aff_ne_set(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4292 obj = set(ctx=ctx, ptr=res) 4293 return obj 4294 def neg(arg0): 4295 try: 4296 if not arg0.__class__ is aff: 4297 arg0 = aff(arg0) 4298 except: 4299 raise 4300 ctx = arg0.ctx 4301 res = isl.isl_aff_neg(isl.isl_aff_copy(arg0.ptr)) 4302 obj = aff(ctx=ctx, ptr=res) 4303 return obj 4304 def pullback(*args): 4305 if len(args) == 2 and args[1].__class__ is multi_aff: 4306 ctx = args[0].ctx 4307 res = isl.isl_aff_pullback_multi_aff(isl.isl_aff_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 4308 obj = aff(ctx=ctx, ptr=res) 4309 return obj 4310 raise Error 4311 def scale(*args): 4312 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4313 args = list(args) 4314 try: 4315 if not args[1].__class__ is val: 4316 args[1] = val(args[1]) 4317 except: 4318 raise 4319 ctx = args[0].ctx 4320 res = isl.isl_aff_scale_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4321 obj = aff(ctx=ctx, ptr=res) 4322 return obj 4323 raise Error 4324 def scale_down(*args): 4325 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 4326 args = list(args) 4327 try: 4328 if not args[1].__class__ is val: 4329 args[1] = val(args[1]) 4330 except: 4331 raise 4332 ctx = args[0].ctx 4333 res = isl.isl_aff_scale_down_val(isl.isl_aff_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 4334 obj = aff(ctx=ctx, ptr=res) 4335 return obj 4336 raise Error 4337 def sub(arg0, arg1): 4338 try: 4339 if not arg0.__class__ is aff: 4340 arg0 = aff(arg0) 4341 except: 4342 raise 4343 try: 4344 if not arg1.__class__ is aff: 4345 arg1 = aff(arg1) 4346 except: 4347 return pw_aff(arg0).sub(arg1) 4348 ctx = arg0.ctx 4349 res = isl.isl_aff_sub(isl.isl_aff_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4350 obj = aff(ctx=ctx, ptr=res) 4351 return obj 4352 def to_list(arg0): 4353 try: 4354 if not arg0.__class__ is aff: 4355 arg0 = aff(arg0) 4356 except: 4357 raise 4358 ctx = arg0.ctx 4359 res = isl.isl_aff_to_list(isl.isl_aff_copy(arg0.ptr)) 4360 obj = aff_list(ctx=ctx, ptr=res) 4361 return obj 4362 def unbind_params_insert_domain(arg0, arg1): 4363 try: 4364 if not arg0.__class__ is aff: 4365 arg0 = aff(arg0) 4366 except: 4367 raise 4368 try: 4369 if not arg1.__class__ is multi_id: 4370 arg1 = multi_id(arg1) 4371 except: 4372 return pw_aff(arg0).unbind_params_insert_domain(arg1) 4373 ctx = arg0.ctx 4374 res = isl.isl_aff_unbind_params_insert_domain(isl.isl_aff_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 4375 obj = aff(ctx=ctx, ptr=res) 4376 return obj 4377 @staticmethod 4378 def zero_on_domain(*args): 4379 if len(args) == 1 and args[0].__class__ is space: 4380 ctx = args[0].ctx 4381 res = isl.isl_aff_zero_on_domain_space(isl.isl_space_copy(args[0].ptr)) 4382 obj = aff(ctx=ctx, ptr=res) 4383 return obj 4384 raise Error 4385 4386isl.isl_aff_read_from_str.restype = c_void_p 4387isl.isl_aff_read_from_str.argtypes = [Context, c_char_p] 4388isl.isl_aff_add.restype = c_void_p 4389isl.isl_aff_add.argtypes = [c_void_p, c_void_p] 4390isl.isl_aff_add_constant_val.restype = c_void_p 4391isl.isl_aff_add_constant_val.argtypes = [c_void_p, c_void_p] 4392isl.isl_aff_bind_id.restype = c_void_p 4393isl.isl_aff_bind_id.argtypes = [c_void_p, c_void_p] 4394isl.isl_aff_ceil.restype = c_void_p 4395isl.isl_aff_ceil.argtypes = [c_void_p] 4396isl.isl_aff_get_constant_val.restype = c_void_p 4397isl.isl_aff_get_constant_val.argtypes = [c_void_p] 4398isl.isl_aff_div.restype = c_void_p 4399isl.isl_aff_div.argtypes = [c_void_p, c_void_p] 4400isl.isl_aff_eq_set.restype = c_void_p 4401isl.isl_aff_eq_set.argtypes = [c_void_p, c_void_p] 4402isl.isl_aff_eval.restype = c_void_p 4403isl.isl_aff_eval.argtypes = [c_void_p, c_void_p] 4404isl.isl_aff_floor.restype = c_void_p 4405isl.isl_aff_floor.argtypes = [c_void_p] 4406isl.isl_aff_ge_set.restype = c_void_p 4407isl.isl_aff_ge_set.argtypes = [c_void_p, c_void_p] 4408isl.isl_aff_gist.restype = c_void_p 4409isl.isl_aff_gist.argtypes = [c_void_p, c_void_p] 4410isl.isl_aff_gt_set.restype = c_void_p 4411isl.isl_aff_gt_set.argtypes = [c_void_p, c_void_p] 4412isl.isl_aff_is_cst.argtypes = [c_void_p] 4413isl.isl_aff_le_set.restype = c_void_p 4414isl.isl_aff_le_set.argtypes = [c_void_p, c_void_p] 4415isl.isl_aff_lt_set.restype = c_void_p 4416isl.isl_aff_lt_set.argtypes = [c_void_p, c_void_p] 4417isl.isl_aff_mod_val.restype = c_void_p 4418isl.isl_aff_mod_val.argtypes = [c_void_p, c_void_p] 4419isl.isl_aff_mul.restype = c_void_p 4420isl.isl_aff_mul.argtypes = [c_void_p, c_void_p] 4421isl.isl_aff_ne_set.restype = c_void_p 4422isl.isl_aff_ne_set.argtypes = [c_void_p, c_void_p] 4423isl.isl_aff_neg.restype = c_void_p 4424isl.isl_aff_neg.argtypes = [c_void_p] 4425isl.isl_aff_pullback_multi_aff.restype = c_void_p 4426isl.isl_aff_pullback_multi_aff.argtypes = [c_void_p, c_void_p] 4427isl.isl_aff_scale_val.restype = c_void_p 4428isl.isl_aff_scale_val.argtypes = [c_void_p, c_void_p] 4429isl.isl_aff_scale_down_val.restype = c_void_p 4430isl.isl_aff_scale_down_val.argtypes = [c_void_p, c_void_p] 4431isl.isl_aff_sub.restype = c_void_p 4432isl.isl_aff_sub.argtypes = [c_void_p, c_void_p] 4433isl.isl_aff_to_list.restype = c_void_p 4434isl.isl_aff_to_list.argtypes = [c_void_p] 4435isl.isl_aff_unbind_params_insert_domain.restype = c_void_p 4436isl.isl_aff_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 4437isl.isl_aff_zero_on_domain_space.restype = c_void_p 4438isl.isl_aff_zero_on_domain_space.argtypes = [c_void_p] 4439isl.isl_aff_copy.restype = c_void_p 4440isl.isl_aff_copy.argtypes = [c_void_p] 4441isl.isl_aff_free.restype = c_void_p 4442isl.isl_aff_free.argtypes = [c_void_p] 4443isl.isl_aff_to_str.restype = POINTER(c_char) 4444isl.isl_aff_to_str.argtypes = [c_void_p] 4445 4446class aff_list(object): 4447 def __init__(self, *args, **keywords): 4448 if "ptr" in keywords: 4449 self.ctx = keywords["ctx"] 4450 self.ptr = keywords["ptr"] 4451 return 4452 if len(args) == 1 and type(args[0]) == int: 4453 self.ctx = Context.getDefaultInstance() 4454 self.ptr = isl.isl_aff_list_alloc(self.ctx, args[0]) 4455 return 4456 if len(args) == 1 and args[0].__class__ is aff: 4457 self.ctx = Context.getDefaultInstance() 4458 self.ptr = isl.isl_aff_list_from_aff(isl.isl_aff_copy(args[0].ptr)) 4459 return 4460 if len(args) == 1 and type(args[0]) == str: 4461 self.ctx = Context.getDefaultInstance() 4462 self.ptr = isl.isl_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 4463 return 4464 raise Error 4465 def __del__(self): 4466 if hasattr(self, 'ptr'): 4467 isl.isl_aff_list_free(self.ptr) 4468 def __str__(arg0): 4469 try: 4470 if not arg0.__class__ is aff_list: 4471 arg0 = aff_list(arg0) 4472 except: 4473 raise 4474 ptr = isl.isl_aff_list_to_str(arg0.ptr) 4475 res = cast(ptr, c_char_p).value.decode('ascii') 4476 libc.free(ptr) 4477 return res 4478 def __repr__(self): 4479 s = str(self) 4480 if '"' in s: 4481 return 'isl.aff_list("""%s""")' % s 4482 else: 4483 return 'isl.aff_list("%s")' % s 4484 def add(arg0, arg1): 4485 try: 4486 if not arg0.__class__ is aff_list: 4487 arg0 = aff_list(arg0) 4488 except: 4489 raise 4490 try: 4491 if not arg1.__class__ is aff: 4492 arg1 = aff(arg1) 4493 except: 4494 raise 4495 ctx = arg0.ctx 4496 res = isl.isl_aff_list_add(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_copy(arg1.ptr)) 4497 obj = aff_list(ctx=ctx, ptr=res) 4498 return obj 4499 def at(arg0, arg1): 4500 try: 4501 if not arg0.__class__ is aff_list: 4502 arg0 = aff_list(arg0) 4503 except: 4504 raise 4505 ctx = arg0.ctx 4506 res = isl.isl_aff_list_get_at(arg0.ptr, arg1) 4507 obj = aff(ctx=ctx, ptr=res) 4508 return obj 4509 def get_at(arg0, arg1): 4510 return arg0.at(arg1) 4511 def clear(arg0): 4512 try: 4513 if not arg0.__class__ is aff_list: 4514 arg0 = aff_list(arg0) 4515 except: 4516 raise 4517 ctx = arg0.ctx 4518 res = isl.isl_aff_list_clear(isl.isl_aff_list_copy(arg0.ptr)) 4519 obj = aff_list(ctx=ctx, ptr=res) 4520 return obj 4521 def concat(arg0, arg1): 4522 try: 4523 if not arg0.__class__ is aff_list: 4524 arg0 = aff_list(arg0) 4525 except: 4526 raise 4527 try: 4528 if not arg1.__class__ is aff_list: 4529 arg1 = aff_list(arg1) 4530 except: 4531 raise 4532 ctx = arg0.ctx 4533 res = isl.isl_aff_list_concat(isl.isl_aff_list_copy(arg0.ptr), isl.isl_aff_list_copy(arg1.ptr)) 4534 obj = aff_list(ctx=ctx, ptr=res) 4535 return obj 4536 def drop(arg0, arg1, arg2): 4537 try: 4538 if not arg0.__class__ is aff_list: 4539 arg0 = aff_list(arg0) 4540 except: 4541 raise 4542 ctx = arg0.ctx 4543 res = isl.isl_aff_list_drop(isl.isl_aff_list_copy(arg0.ptr), arg1, arg2) 4544 obj = aff_list(ctx=ctx, ptr=res) 4545 return obj 4546 def foreach(arg0, arg1): 4547 try: 4548 if not arg0.__class__ is aff_list: 4549 arg0 = aff_list(arg0) 4550 except: 4551 raise 4552 exc_info = [None] 4553 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 4554 def cb_func(cb_arg0, cb_arg1): 4555 cb_arg0 = aff(ctx=arg0.ctx, ptr=(cb_arg0)) 4556 try: 4557 arg1(cb_arg0) 4558 except BaseException as e: 4559 exc_info[0] = e 4560 return -1 4561 return 0 4562 cb = fn(cb_func) 4563 ctx = arg0.ctx 4564 res = isl.isl_aff_list_foreach(arg0.ptr, cb, None) 4565 if exc_info[0] is not None: 4566 raise exc_info[0] 4567 if res < 0: 4568 raise 4569 def insert(arg0, arg1, arg2): 4570 try: 4571 if not arg0.__class__ is aff_list: 4572 arg0 = aff_list(arg0) 4573 except: 4574 raise 4575 try: 4576 if not arg2.__class__ is aff: 4577 arg2 = aff(arg2) 4578 except: 4579 raise 4580 ctx = arg0.ctx 4581 res = isl.isl_aff_list_insert(isl.isl_aff_list_copy(arg0.ptr), arg1, isl.isl_aff_copy(arg2.ptr)) 4582 obj = aff_list(ctx=ctx, ptr=res) 4583 return obj 4584 def size(arg0): 4585 try: 4586 if not arg0.__class__ is aff_list: 4587 arg0 = aff_list(arg0) 4588 except: 4589 raise 4590 ctx = arg0.ctx 4591 res = isl.isl_aff_list_size(arg0.ptr) 4592 if res < 0: 4593 raise 4594 return int(res) 4595 4596isl.isl_aff_list_alloc.restype = c_void_p 4597isl.isl_aff_list_alloc.argtypes = [Context, c_int] 4598isl.isl_aff_list_from_aff.restype = c_void_p 4599isl.isl_aff_list_from_aff.argtypes = [c_void_p] 4600isl.isl_aff_list_read_from_str.restype = c_void_p 4601isl.isl_aff_list_read_from_str.argtypes = [Context, c_char_p] 4602isl.isl_aff_list_add.restype = c_void_p 4603isl.isl_aff_list_add.argtypes = [c_void_p, c_void_p] 4604isl.isl_aff_list_get_at.restype = c_void_p 4605isl.isl_aff_list_get_at.argtypes = [c_void_p, c_int] 4606isl.isl_aff_list_clear.restype = c_void_p 4607isl.isl_aff_list_clear.argtypes = [c_void_p] 4608isl.isl_aff_list_concat.restype = c_void_p 4609isl.isl_aff_list_concat.argtypes = [c_void_p, c_void_p] 4610isl.isl_aff_list_drop.restype = c_void_p 4611isl.isl_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 4612isl.isl_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 4613isl.isl_aff_list_insert.restype = c_void_p 4614isl.isl_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 4615isl.isl_aff_list_size.argtypes = [c_void_p] 4616isl.isl_aff_list_copy.restype = c_void_p 4617isl.isl_aff_list_copy.argtypes = [c_void_p] 4618isl.isl_aff_list_free.restype = c_void_p 4619isl.isl_aff_list_free.argtypes = [c_void_p] 4620isl.isl_aff_list_to_str.restype = POINTER(c_char) 4621isl.isl_aff_list_to_str.argtypes = [c_void_p] 4622 4623class ast_build(object): 4624 def __init__(self, *args, **keywords): 4625 if "ptr" in keywords: 4626 self.ctx = keywords["ctx"] 4627 self.ptr = keywords["ptr"] 4628 return 4629 if len(args) == 0: 4630 self.ctx = Context.getDefaultInstance() 4631 self.ptr = isl.isl_ast_build_alloc(self.ctx) 4632 return 4633 raise Error 4634 def __del__(self): 4635 if hasattr(self, 'ptr'): 4636 isl.isl_ast_build_free(self.ptr) 4637 def copy_callbacks(self, obj): 4638 if hasattr(obj, 'at_each_domain'): 4639 self.at_each_domain = obj.at_each_domain 4640 def set_at_each_domain(arg0, arg1): 4641 try: 4642 if not arg0.__class__ is ast_build: 4643 arg0 = ast_build(arg0) 4644 except: 4645 raise 4646 exc_info = [None] 4647 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_void_p) 4648 def cb_func(cb_arg0, cb_arg1, cb_arg2): 4649 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 4650 cb_arg1 = ast_build(ctx=arg0.ctx, ptr=isl.isl_ast_build_copy(cb_arg1)) 4651 try: 4652 res = arg1(cb_arg0, cb_arg1) 4653 except BaseException as e: 4654 exc_info[0] = e 4655 return None 4656 return isl.isl_ast_node_copy(res.ptr) 4657 cb = fn(cb_func) 4658 ctx = arg0.ctx 4659 res = isl.isl_ast_build_set_at_each_domain(isl.isl_ast_build_copy(arg0.ptr), cb, None) 4660 if exc_info[0] is not None: 4661 raise exc_info[0] 4662 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4663 exc_info = arg0.at_each_domain['exc_info'][0] 4664 arg0.at_each_domain['exc_info'][0] = None 4665 if exc_info is not None: 4666 raise exc_info 4667 obj = ast_build(ctx=ctx, ptr=res) 4668 obj.copy_callbacks(arg0) 4669 obj.at_each_domain = { 'func': cb, 'exc_info': exc_info } 4670 return obj 4671 def access_from(*args): 4672 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 4673 ctx = args[0].ctx 4674 res = isl.isl_ast_build_access_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 4675 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4676 exc_info = args[0].at_each_domain['exc_info'][0] 4677 args[0].at_each_domain['exc_info'][0] = None 4678 if exc_info is not None: 4679 raise exc_info 4680 obj = ast_expr(ctx=ctx, ptr=res) 4681 return obj 4682 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 4683 ctx = args[0].ctx 4684 res = isl.isl_ast_build_access_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 4685 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4686 exc_info = args[0].at_each_domain['exc_info'][0] 4687 args[0].at_each_domain['exc_info'][0] = None 4688 if exc_info is not None: 4689 raise exc_info 4690 obj = ast_expr(ctx=ctx, ptr=res) 4691 return obj 4692 raise Error 4693 def call_from(*args): 4694 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 4695 ctx = args[0].ctx 4696 res = isl.isl_ast_build_call_from_multi_pw_aff(args[0].ptr, isl.isl_multi_pw_aff_copy(args[1].ptr)) 4697 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4698 exc_info = args[0].at_each_domain['exc_info'][0] 4699 args[0].at_each_domain['exc_info'][0] = None 4700 if exc_info is not None: 4701 raise exc_info 4702 obj = ast_expr(ctx=ctx, ptr=res) 4703 return obj 4704 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 4705 ctx = args[0].ctx 4706 res = isl.isl_ast_build_call_from_pw_multi_aff(args[0].ptr, isl.isl_pw_multi_aff_copy(args[1].ptr)) 4707 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4708 exc_info = args[0].at_each_domain['exc_info'][0] 4709 args[0].at_each_domain['exc_info'][0] = None 4710 if exc_info is not None: 4711 raise exc_info 4712 obj = ast_expr(ctx=ctx, ptr=res) 4713 return obj 4714 raise Error 4715 def expr_from(*args): 4716 if len(args) == 2 and args[1].__class__ is pw_aff: 4717 ctx = args[0].ctx 4718 res = isl.isl_ast_build_expr_from_pw_aff(args[0].ptr, isl.isl_pw_aff_copy(args[1].ptr)) 4719 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4720 exc_info = args[0].at_each_domain['exc_info'][0] 4721 args[0].at_each_domain['exc_info'][0] = None 4722 if exc_info is not None: 4723 raise exc_info 4724 obj = ast_expr(ctx=ctx, ptr=res) 4725 return obj 4726 if len(args) == 2 and args[1].__class__ is set: 4727 ctx = args[0].ctx 4728 res = isl.isl_ast_build_expr_from_set(args[0].ptr, isl.isl_set_copy(args[1].ptr)) 4729 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4730 exc_info = args[0].at_each_domain['exc_info'][0] 4731 args[0].at_each_domain['exc_info'][0] = None 4732 if exc_info is not None: 4733 raise exc_info 4734 obj = ast_expr(ctx=ctx, ptr=res) 4735 return obj 4736 raise Error 4737 @staticmethod 4738 def from_context(arg0): 4739 try: 4740 if not arg0.__class__ is set: 4741 arg0 = set(arg0) 4742 except: 4743 raise 4744 ctx = arg0.ctx 4745 res = isl.isl_ast_build_from_context(isl.isl_set_copy(arg0.ptr)) 4746 obj = ast_build(ctx=ctx, ptr=res) 4747 return obj 4748 def node_from(*args): 4749 if len(args) == 2 and args[1].__class__ is schedule: 4750 ctx = args[0].ctx 4751 res = isl.isl_ast_build_node_from_schedule(args[0].ptr, isl.isl_schedule_copy(args[1].ptr)) 4752 if hasattr(args[0], 'at_each_domain') and args[0].at_each_domain['exc_info'] != None: 4753 exc_info = args[0].at_each_domain['exc_info'][0] 4754 args[0].at_each_domain['exc_info'][0] = None 4755 if exc_info is not None: 4756 raise exc_info 4757 obj = ast_node(ctx=ctx, ptr=res) 4758 return obj 4759 raise Error 4760 def node_from_schedule_map(arg0, arg1): 4761 try: 4762 if not arg0.__class__ is ast_build: 4763 arg0 = ast_build(arg0) 4764 except: 4765 raise 4766 try: 4767 if not arg1.__class__ is union_map: 4768 arg1 = union_map(arg1) 4769 except: 4770 raise 4771 ctx = arg0.ctx 4772 res = isl.isl_ast_build_node_from_schedule_map(arg0.ptr, isl.isl_union_map_copy(arg1.ptr)) 4773 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4774 exc_info = arg0.at_each_domain['exc_info'][0] 4775 arg0.at_each_domain['exc_info'][0] = None 4776 if exc_info is not None: 4777 raise exc_info 4778 obj = ast_node(ctx=ctx, ptr=res) 4779 return obj 4780 def schedule(arg0): 4781 try: 4782 if not arg0.__class__ is ast_build: 4783 arg0 = ast_build(arg0) 4784 except: 4785 raise 4786 ctx = arg0.ctx 4787 res = isl.isl_ast_build_get_schedule(arg0.ptr) 4788 if hasattr(arg0, 'at_each_domain') and arg0.at_each_domain['exc_info'] != None: 4789 exc_info = arg0.at_each_domain['exc_info'][0] 4790 arg0.at_each_domain['exc_info'][0] = None 4791 if exc_info is not None: 4792 raise exc_info 4793 obj = union_map(ctx=ctx, ptr=res) 4794 return obj 4795 def get_schedule(arg0): 4796 return arg0.schedule() 4797 4798isl.isl_ast_build_alloc.restype = c_void_p 4799isl.isl_ast_build_alloc.argtypes = [Context] 4800isl.isl_ast_build_set_at_each_domain.restype = c_void_p 4801isl.isl_ast_build_set_at_each_domain.argtypes = [c_void_p, c_void_p, c_void_p] 4802isl.isl_ast_build_access_from_multi_pw_aff.restype = c_void_p 4803isl.isl_ast_build_access_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 4804isl.isl_ast_build_access_from_pw_multi_aff.restype = c_void_p 4805isl.isl_ast_build_access_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 4806isl.isl_ast_build_call_from_multi_pw_aff.restype = c_void_p 4807isl.isl_ast_build_call_from_multi_pw_aff.argtypes = [c_void_p, c_void_p] 4808isl.isl_ast_build_call_from_pw_multi_aff.restype = c_void_p 4809isl.isl_ast_build_call_from_pw_multi_aff.argtypes = [c_void_p, c_void_p] 4810isl.isl_ast_build_expr_from_pw_aff.restype = c_void_p 4811isl.isl_ast_build_expr_from_pw_aff.argtypes = [c_void_p, c_void_p] 4812isl.isl_ast_build_expr_from_set.restype = c_void_p 4813isl.isl_ast_build_expr_from_set.argtypes = [c_void_p, c_void_p] 4814isl.isl_ast_build_from_context.restype = c_void_p 4815isl.isl_ast_build_from_context.argtypes = [c_void_p] 4816isl.isl_ast_build_node_from_schedule.restype = c_void_p 4817isl.isl_ast_build_node_from_schedule.argtypes = [c_void_p, c_void_p] 4818isl.isl_ast_build_node_from_schedule_map.restype = c_void_p 4819isl.isl_ast_build_node_from_schedule_map.argtypes = [c_void_p, c_void_p] 4820isl.isl_ast_build_get_schedule.restype = c_void_p 4821isl.isl_ast_build_get_schedule.argtypes = [c_void_p] 4822isl.isl_ast_build_copy.restype = c_void_p 4823isl.isl_ast_build_copy.argtypes = [c_void_p] 4824isl.isl_ast_build_free.restype = c_void_p 4825isl.isl_ast_build_free.argtypes = [c_void_p] 4826 4827class ast_expr(object): 4828 def __init__(self, *args, **keywords): 4829 if "ptr" in keywords: 4830 self.ctx = keywords["ctx"] 4831 self.ptr = keywords["ptr"] 4832 return 4833 if len(args) == 1 and isinstance(args[0], ast_expr_op): 4834 self.ctx = args[0].ctx 4835 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4836 return 4837 if len(args) == 1 and isinstance(args[0], ast_expr_id): 4838 self.ctx = args[0].ctx 4839 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4840 return 4841 if len(args) == 1 and isinstance(args[0], ast_expr_int): 4842 self.ctx = args[0].ctx 4843 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 4844 return 4845 raise Error 4846 def __del__(self): 4847 if hasattr(self, 'ptr'): 4848 isl.isl_ast_expr_free(self.ptr) 4849 def __new__(cls, *args, **keywords): 4850 if "ptr" in keywords: 4851 type = isl.isl_ast_expr_get_type(keywords["ptr"]) 4852 if type == 0: 4853 return ast_expr_op(**keywords) 4854 if type == 1: 4855 return ast_expr_id(**keywords) 4856 if type == 2: 4857 return ast_expr_int(**keywords) 4858 raise 4859 return super(ast_expr, cls).__new__(cls) 4860 def __str__(arg0): 4861 try: 4862 if not arg0.__class__ is ast_expr: 4863 arg0 = ast_expr(arg0) 4864 except: 4865 raise 4866 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4867 res = cast(ptr, c_char_p).value.decode('ascii') 4868 libc.free(ptr) 4869 return res 4870 def __repr__(self): 4871 s = str(self) 4872 if '"' in s: 4873 return 'isl.ast_expr("""%s""")' % s 4874 else: 4875 return 'isl.ast_expr("%s")' % s 4876 def to_C_str(arg0): 4877 try: 4878 if not arg0.__class__ is ast_expr: 4879 arg0 = ast_expr(arg0) 4880 except: 4881 raise 4882 ctx = arg0.ctx 4883 res = isl.isl_ast_expr_to_C_str(arg0.ptr) 4884 if res == 0: 4885 raise 4886 string = cast(res, c_char_p).value.decode('ascii') 4887 libc.free(res) 4888 return string 4889 4890isl.isl_ast_expr_to_C_str.restype = POINTER(c_char) 4891isl.isl_ast_expr_to_C_str.argtypes = [c_void_p] 4892isl.isl_ast_expr_copy.restype = c_void_p 4893isl.isl_ast_expr_copy.argtypes = [c_void_p] 4894isl.isl_ast_expr_free.restype = c_void_p 4895isl.isl_ast_expr_free.argtypes = [c_void_p] 4896isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4897isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4898isl.isl_ast_expr_get_type.argtypes = [c_void_p] 4899 4900class ast_expr_id(ast_expr): 4901 def __init__(self, *args, **keywords): 4902 if "ptr" in keywords: 4903 self.ctx = keywords["ctx"] 4904 self.ptr = keywords["ptr"] 4905 return 4906 raise Error 4907 def __del__(self): 4908 if hasattr(self, 'ptr'): 4909 isl.isl_ast_expr_free(self.ptr) 4910 def __new__(cls, *args, **keywords): 4911 return super(ast_expr_id, cls).__new__(cls) 4912 def __str__(arg0): 4913 try: 4914 if not arg0.__class__ is ast_expr_id: 4915 arg0 = ast_expr_id(arg0) 4916 except: 4917 raise 4918 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4919 res = cast(ptr, c_char_p).value.decode('ascii') 4920 libc.free(ptr) 4921 return res 4922 def __repr__(self): 4923 s = str(self) 4924 if '"' in s: 4925 return 'isl.ast_expr_id("""%s""")' % s 4926 else: 4927 return 'isl.ast_expr_id("%s")' % s 4928 def id(arg0): 4929 try: 4930 if not arg0.__class__ is ast_expr: 4931 arg0 = ast_expr(arg0) 4932 except: 4933 raise 4934 ctx = arg0.ctx 4935 res = isl.isl_ast_expr_id_get_id(arg0.ptr) 4936 obj = id(ctx=ctx, ptr=res) 4937 return obj 4938 def get_id(arg0): 4939 return arg0.id() 4940 4941isl.isl_ast_expr_id_get_id.restype = c_void_p 4942isl.isl_ast_expr_id_get_id.argtypes = [c_void_p] 4943isl.isl_ast_expr_copy.restype = c_void_p 4944isl.isl_ast_expr_copy.argtypes = [c_void_p] 4945isl.isl_ast_expr_free.restype = c_void_p 4946isl.isl_ast_expr_free.argtypes = [c_void_p] 4947isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4948isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4949 4950class ast_expr_int(ast_expr): 4951 def __init__(self, *args, **keywords): 4952 if "ptr" in keywords: 4953 self.ctx = keywords["ctx"] 4954 self.ptr = keywords["ptr"] 4955 return 4956 raise Error 4957 def __del__(self): 4958 if hasattr(self, 'ptr'): 4959 isl.isl_ast_expr_free(self.ptr) 4960 def __new__(cls, *args, **keywords): 4961 return super(ast_expr_int, cls).__new__(cls) 4962 def __str__(arg0): 4963 try: 4964 if not arg0.__class__ is ast_expr_int: 4965 arg0 = ast_expr_int(arg0) 4966 except: 4967 raise 4968 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 4969 res = cast(ptr, c_char_p).value.decode('ascii') 4970 libc.free(ptr) 4971 return res 4972 def __repr__(self): 4973 s = str(self) 4974 if '"' in s: 4975 return 'isl.ast_expr_int("""%s""")' % s 4976 else: 4977 return 'isl.ast_expr_int("%s")' % s 4978 def val(arg0): 4979 try: 4980 if not arg0.__class__ is ast_expr: 4981 arg0 = ast_expr(arg0) 4982 except: 4983 raise 4984 ctx = arg0.ctx 4985 res = isl.isl_ast_expr_int_get_val(arg0.ptr) 4986 obj = val(ctx=ctx, ptr=res) 4987 return obj 4988 def get_val(arg0): 4989 return arg0.val() 4990 4991isl.isl_ast_expr_int_get_val.restype = c_void_p 4992isl.isl_ast_expr_int_get_val.argtypes = [c_void_p] 4993isl.isl_ast_expr_copy.restype = c_void_p 4994isl.isl_ast_expr_copy.argtypes = [c_void_p] 4995isl.isl_ast_expr_free.restype = c_void_p 4996isl.isl_ast_expr_free.argtypes = [c_void_p] 4997isl.isl_ast_expr_to_str.restype = POINTER(c_char) 4998isl.isl_ast_expr_to_str.argtypes = [c_void_p] 4999 5000class ast_expr_op(ast_expr): 5001 def __init__(self, *args, **keywords): 5002 if "ptr" in keywords: 5003 self.ctx = keywords["ctx"] 5004 self.ptr = keywords["ptr"] 5005 return 5006 if len(args) == 1 and isinstance(args[0], ast_expr_op_and): 5007 self.ctx = args[0].ctx 5008 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5009 return 5010 if len(args) == 1 and isinstance(args[0], ast_expr_op_and_then): 5011 self.ctx = args[0].ctx 5012 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5013 return 5014 if len(args) == 1 and isinstance(args[0], ast_expr_op_or): 5015 self.ctx = args[0].ctx 5016 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5017 return 5018 if len(args) == 1 and isinstance(args[0], ast_expr_op_or_else): 5019 self.ctx = args[0].ctx 5020 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5021 return 5022 if len(args) == 1 and isinstance(args[0], ast_expr_op_max): 5023 self.ctx = args[0].ctx 5024 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5025 return 5026 if len(args) == 1 and isinstance(args[0], ast_expr_op_min): 5027 self.ctx = args[0].ctx 5028 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5029 return 5030 if len(args) == 1 and isinstance(args[0], ast_expr_op_minus): 5031 self.ctx = args[0].ctx 5032 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5033 return 5034 if len(args) == 1 and isinstance(args[0], ast_expr_op_add): 5035 self.ctx = args[0].ctx 5036 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5037 return 5038 if len(args) == 1 and isinstance(args[0], ast_expr_op_sub): 5039 self.ctx = args[0].ctx 5040 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5041 return 5042 if len(args) == 1 and isinstance(args[0], ast_expr_op_mul): 5043 self.ctx = args[0].ctx 5044 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5045 return 5046 if len(args) == 1 and isinstance(args[0], ast_expr_op_div): 5047 self.ctx = args[0].ctx 5048 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5049 return 5050 if len(args) == 1 and isinstance(args[0], ast_expr_op_fdiv_q): 5051 self.ctx = args[0].ctx 5052 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5053 return 5054 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_q): 5055 self.ctx = args[0].ctx 5056 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5057 return 5058 if len(args) == 1 and isinstance(args[0], ast_expr_op_pdiv_r): 5059 self.ctx = args[0].ctx 5060 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5061 return 5062 if len(args) == 1 and isinstance(args[0], ast_expr_op_zdiv_r): 5063 self.ctx = args[0].ctx 5064 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5065 return 5066 if len(args) == 1 and isinstance(args[0], ast_expr_op_cond): 5067 self.ctx = args[0].ctx 5068 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5069 return 5070 if len(args) == 1 and isinstance(args[0], ast_expr_op_select): 5071 self.ctx = args[0].ctx 5072 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5073 return 5074 if len(args) == 1 and isinstance(args[0], ast_expr_op_eq): 5075 self.ctx = args[0].ctx 5076 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5077 return 5078 if len(args) == 1 and isinstance(args[0], ast_expr_op_le): 5079 self.ctx = args[0].ctx 5080 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5081 return 5082 if len(args) == 1 and isinstance(args[0], ast_expr_op_lt): 5083 self.ctx = args[0].ctx 5084 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5085 return 5086 if len(args) == 1 and isinstance(args[0], ast_expr_op_ge): 5087 self.ctx = args[0].ctx 5088 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5089 return 5090 if len(args) == 1 and isinstance(args[0], ast_expr_op_gt): 5091 self.ctx = args[0].ctx 5092 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5093 return 5094 if len(args) == 1 and isinstance(args[0], ast_expr_op_call): 5095 self.ctx = args[0].ctx 5096 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5097 return 5098 if len(args) == 1 and isinstance(args[0], ast_expr_op_access): 5099 self.ctx = args[0].ctx 5100 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5101 return 5102 if len(args) == 1 and isinstance(args[0], ast_expr_op_member): 5103 self.ctx = args[0].ctx 5104 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5105 return 5106 if len(args) == 1 and isinstance(args[0], ast_expr_op_address_of): 5107 self.ctx = args[0].ctx 5108 self.ptr = isl.isl_ast_expr_copy(args[0].ptr) 5109 return 5110 raise Error 5111 def __del__(self): 5112 if hasattr(self, 'ptr'): 5113 isl.isl_ast_expr_free(self.ptr) 5114 def __new__(cls, *args, **keywords): 5115 if "ptr" in keywords: 5116 type = isl.isl_ast_expr_op_get_type(keywords["ptr"]) 5117 if type == 0: 5118 return ast_expr_op_and(**keywords) 5119 if type == 1: 5120 return ast_expr_op_and_then(**keywords) 5121 if type == 2: 5122 return ast_expr_op_or(**keywords) 5123 if type == 3: 5124 return ast_expr_op_or_else(**keywords) 5125 if type == 4: 5126 return ast_expr_op_max(**keywords) 5127 if type == 5: 5128 return ast_expr_op_min(**keywords) 5129 if type == 6: 5130 return ast_expr_op_minus(**keywords) 5131 if type == 7: 5132 return ast_expr_op_add(**keywords) 5133 if type == 8: 5134 return ast_expr_op_sub(**keywords) 5135 if type == 9: 5136 return ast_expr_op_mul(**keywords) 5137 if type == 10: 5138 return ast_expr_op_div(**keywords) 5139 if type == 11: 5140 return ast_expr_op_fdiv_q(**keywords) 5141 if type == 12: 5142 return ast_expr_op_pdiv_q(**keywords) 5143 if type == 13: 5144 return ast_expr_op_pdiv_r(**keywords) 5145 if type == 14: 5146 return ast_expr_op_zdiv_r(**keywords) 5147 if type == 15: 5148 return ast_expr_op_cond(**keywords) 5149 if type == 16: 5150 return ast_expr_op_select(**keywords) 5151 if type == 17: 5152 return ast_expr_op_eq(**keywords) 5153 if type == 18: 5154 return ast_expr_op_le(**keywords) 5155 if type == 19: 5156 return ast_expr_op_lt(**keywords) 5157 if type == 20: 5158 return ast_expr_op_ge(**keywords) 5159 if type == 21: 5160 return ast_expr_op_gt(**keywords) 5161 if type == 22: 5162 return ast_expr_op_call(**keywords) 5163 if type == 23: 5164 return ast_expr_op_access(**keywords) 5165 if type == 24: 5166 return ast_expr_op_member(**keywords) 5167 if type == 25: 5168 return ast_expr_op_address_of(**keywords) 5169 raise 5170 return super(ast_expr_op, cls).__new__(cls) 5171 def __str__(arg0): 5172 try: 5173 if not arg0.__class__ is ast_expr_op: 5174 arg0 = ast_expr_op(arg0) 5175 except: 5176 raise 5177 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5178 res = cast(ptr, c_char_p).value.decode('ascii') 5179 libc.free(ptr) 5180 return res 5181 def __repr__(self): 5182 s = str(self) 5183 if '"' in s: 5184 return 'isl.ast_expr_op("""%s""")' % s 5185 else: 5186 return 'isl.ast_expr_op("%s")' % s 5187 def arg(arg0, arg1): 5188 try: 5189 if not arg0.__class__ is ast_expr: 5190 arg0 = ast_expr(arg0) 5191 except: 5192 raise 5193 ctx = arg0.ctx 5194 res = isl.isl_ast_expr_op_get_arg(arg0.ptr, arg1) 5195 obj = ast_expr(ctx=ctx, ptr=res) 5196 return obj 5197 def get_arg(arg0, arg1): 5198 return arg0.arg(arg1) 5199 def n_arg(arg0): 5200 try: 5201 if not arg0.__class__ is ast_expr: 5202 arg0 = ast_expr(arg0) 5203 except: 5204 raise 5205 ctx = arg0.ctx 5206 res = isl.isl_ast_expr_op_get_n_arg(arg0.ptr) 5207 if res < 0: 5208 raise 5209 return int(res) 5210 def get_n_arg(arg0): 5211 return arg0.n_arg() 5212 5213isl.isl_ast_expr_op_get_arg.restype = c_void_p 5214isl.isl_ast_expr_op_get_arg.argtypes = [c_void_p, c_int] 5215isl.isl_ast_expr_op_get_n_arg.argtypes = [c_void_p] 5216isl.isl_ast_expr_copy.restype = c_void_p 5217isl.isl_ast_expr_copy.argtypes = [c_void_p] 5218isl.isl_ast_expr_free.restype = c_void_p 5219isl.isl_ast_expr_free.argtypes = [c_void_p] 5220isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5221isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5222isl.isl_ast_expr_op_get_type.argtypes = [c_void_p] 5223 5224class ast_expr_op_access(ast_expr_op): 5225 def __init__(self, *args, **keywords): 5226 if "ptr" in keywords: 5227 self.ctx = keywords["ctx"] 5228 self.ptr = keywords["ptr"] 5229 return 5230 raise Error 5231 def __del__(self): 5232 if hasattr(self, 'ptr'): 5233 isl.isl_ast_expr_free(self.ptr) 5234 def __new__(cls, *args, **keywords): 5235 return super(ast_expr_op_access, cls).__new__(cls) 5236 def __str__(arg0): 5237 try: 5238 if not arg0.__class__ is ast_expr_op_access: 5239 arg0 = ast_expr_op_access(arg0) 5240 except: 5241 raise 5242 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5243 res = cast(ptr, c_char_p).value.decode('ascii') 5244 libc.free(ptr) 5245 return res 5246 def __repr__(self): 5247 s = str(self) 5248 if '"' in s: 5249 return 'isl.ast_expr_op_access("""%s""")' % s 5250 else: 5251 return 'isl.ast_expr_op_access("%s")' % s 5252 5253isl.isl_ast_expr_copy.restype = c_void_p 5254isl.isl_ast_expr_copy.argtypes = [c_void_p] 5255isl.isl_ast_expr_free.restype = c_void_p 5256isl.isl_ast_expr_free.argtypes = [c_void_p] 5257isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5258isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5259 5260class ast_expr_op_add(ast_expr_op): 5261 def __init__(self, *args, **keywords): 5262 if "ptr" in keywords: 5263 self.ctx = keywords["ctx"] 5264 self.ptr = keywords["ptr"] 5265 return 5266 raise Error 5267 def __del__(self): 5268 if hasattr(self, 'ptr'): 5269 isl.isl_ast_expr_free(self.ptr) 5270 def __new__(cls, *args, **keywords): 5271 return super(ast_expr_op_add, cls).__new__(cls) 5272 def __str__(arg0): 5273 try: 5274 if not arg0.__class__ is ast_expr_op_add: 5275 arg0 = ast_expr_op_add(arg0) 5276 except: 5277 raise 5278 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5279 res = cast(ptr, c_char_p).value.decode('ascii') 5280 libc.free(ptr) 5281 return res 5282 def __repr__(self): 5283 s = str(self) 5284 if '"' in s: 5285 return 'isl.ast_expr_op_add("""%s""")' % s 5286 else: 5287 return 'isl.ast_expr_op_add("%s")' % s 5288 5289isl.isl_ast_expr_copy.restype = c_void_p 5290isl.isl_ast_expr_copy.argtypes = [c_void_p] 5291isl.isl_ast_expr_free.restype = c_void_p 5292isl.isl_ast_expr_free.argtypes = [c_void_p] 5293isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5294isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5295 5296class ast_expr_op_address_of(ast_expr_op): 5297 def __init__(self, *args, **keywords): 5298 if "ptr" in keywords: 5299 self.ctx = keywords["ctx"] 5300 self.ptr = keywords["ptr"] 5301 return 5302 raise Error 5303 def __del__(self): 5304 if hasattr(self, 'ptr'): 5305 isl.isl_ast_expr_free(self.ptr) 5306 def __new__(cls, *args, **keywords): 5307 return super(ast_expr_op_address_of, cls).__new__(cls) 5308 def __str__(arg0): 5309 try: 5310 if not arg0.__class__ is ast_expr_op_address_of: 5311 arg0 = ast_expr_op_address_of(arg0) 5312 except: 5313 raise 5314 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5315 res = cast(ptr, c_char_p).value.decode('ascii') 5316 libc.free(ptr) 5317 return res 5318 def __repr__(self): 5319 s = str(self) 5320 if '"' in s: 5321 return 'isl.ast_expr_op_address_of("""%s""")' % s 5322 else: 5323 return 'isl.ast_expr_op_address_of("%s")' % s 5324 5325isl.isl_ast_expr_copy.restype = c_void_p 5326isl.isl_ast_expr_copy.argtypes = [c_void_p] 5327isl.isl_ast_expr_free.restype = c_void_p 5328isl.isl_ast_expr_free.argtypes = [c_void_p] 5329isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5330isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5331 5332class ast_expr_op_and(ast_expr_op): 5333 def __init__(self, *args, **keywords): 5334 if "ptr" in keywords: 5335 self.ctx = keywords["ctx"] 5336 self.ptr = keywords["ptr"] 5337 return 5338 raise Error 5339 def __del__(self): 5340 if hasattr(self, 'ptr'): 5341 isl.isl_ast_expr_free(self.ptr) 5342 def __new__(cls, *args, **keywords): 5343 return super(ast_expr_op_and, cls).__new__(cls) 5344 def __str__(arg0): 5345 try: 5346 if not arg0.__class__ is ast_expr_op_and: 5347 arg0 = ast_expr_op_and(arg0) 5348 except: 5349 raise 5350 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5351 res = cast(ptr, c_char_p).value.decode('ascii') 5352 libc.free(ptr) 5353 return res 5354 def __repr__(self): 5355 s = str(self) 5356 if '"' in s: 5357 return 'isl.ast_expr_op_and("""%s""")' % s 5358 else: 5359 return 'isl.ast_expr_op_and("%s")' % s 5360 5361isl.isl_ast_expr_copy.restype = c_void_p 5362isl.isl_ast_expr_copy.argtypes = [c_void_p] 5363isl.isl_ast_expr_free.restype = c_void_p 5364isl.isl_ast_expr_free.argtypes = [c_void_p] 5365isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5366isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5367 5368class ast_expr_op_and_then(ast_expr_op): 5369 def __init__(self, *args, **keywords): 5370 if "ptr" in keywords: 5371 self.ctx = keywords["ctx"] 5372 self.ptr = keywords["ptr"] 5373 return 5374 raise Error 5375 def __del__(self): 5376 if hasattr(self, 'ptr'): 5377 isl.isl_ast_expr_free(self.ptr) 5378 def __new__(cls, *args, **keywords): 5379 return super(ast_expr_op_and_then, cls).__new__(cls) 5380 def __str__(arg0): 5381 try: 5382 if not arg0.__class__ is ast_expr_op_and_then: 5383 arg0 = ast_expr_op_and_then(arg0) 5384 except: 5385 raise 5386 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5387 res = cast(ptr, c_char_p).value.decode('ascii') 5388 libc.free(ptr) 5389 return res 5390 def __repr__(self): 5391 s = str(self) 5392 if '"' in s: 5393 return 'isl.ast_expr_op_and_then("""%s""")' % s 5394 else: 5395 return 'isl.ast_expr_op_and_then("%s")' % s 5396 5397isl.isl_ast_expr_copy.restype = c_void_p 5398isl.isl_ast_expr_copy.argtypes = [c_void_p] 5399isl.isl_ast_expr_free.restype = c_void_p 5400isl.isl_ast_expr_free.argtypes = [c_void_p] 5401isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5402isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5403 5404class ast_expr_op_call(ast_expr_op): 5405 def __init__(self, *args, **keywords): 5406 if "ptr" in keywords: 5407 self.ctx = keywords["ctx"] 5408 self.ptr = keywords["ptr"] 5409 return 5410 raise Error 5411 def __del__(self): 5412 if hasattr(self, 'ptr'): 5413 isl.isl_ast_expr_free(self.ptr) 5414 def __new__(cls, *args, **keywords): 5415 return super(ast_expr_op_call, cls).__new__(cls) 5416 def __str__(arg0): 5417 try: 5418 if not arg0.__class__ is ast_expr_op_call: 5419 arg0 = ast_expr_op_call(arg0) 5420 except: 5421 raise 5422 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5423 res = cast(ptr, c_char_p).value.decode('ascii') 5424 libc.free(ptr) 5425 return res 5426 def __repr__(self): 5427 s = str(self) 5428 if '"' in s: 5429 return 'isl.ast_expr_op_call("""%s""")' % s 5430 else: 5431 return 'isl.ast_expr_op_call("%s")' % s 5432 5433isl.isl_ast_expr_copy.restype = c_void_p 5434isl.isl_ast_expr_copy.argtypes = [c_void_p] 5435isl.isl_ast_expr_free.restype = c_void_p 5436isl.isl_ast_expr_free.argtypes = [c_void_p] 5437isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5438isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5439 5440class ast_expr_op_cond(ast_expr_op): 5441 def __init__(self, *args, **keywords): 5442 if "ptr" in keywords: 5443 self.ctx = keywords["ctx"] 5444 self.ptr = keywords["ptr"] 5445 return 5446 raise Error 5447 def __del__(self): 5448 if hasattr(self, 'ptr'): 5449 isl.isl_ast_expr_free(self.ptr) 5450 def __new__(cls, *args, **keywords): 5451 return super(ast_expr_op_cond, cls).__new__(cls) 5452 def __str__(arg0): 5453 try: 5454 if not arg0.__class__ is ast_expr_op_cond: 5455 arg0 = ast_expr_op_cond(arg0) 5456 except: 5457 raise 5458 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5459 res = cast(ptr, c_char_p).value.decode('ascii') 5460 libc.free(ptr) 5461 return res 5462 def __repr__(self): 5463 s = str(self) 5464 if '"' in s: 5465 return 'isl.ast_expr_op_cond("""%s""")' % s 5466 else: 5467 return 'isl.ast_expr_op_cond("%s")' % s 5468 5469isl.isl_ast_expr_copy.restype = c_void_p 5470isl.isl_ast_expr_copy.argtypes = [c_void_p] 5471isl.isl_ast_expr_free.restype = c_void_p 5472isl.isl_ast_expr_free.argtypes = [c_void_p] 5473isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5474isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5475 5476class ast_expr_op_div(ast_expr_op): 5477 def __init__(self, *args, **keywords): 5478 if "ptr" in keywords: 5479 self.ctx = keywords["ctx"] 5480 self.ptr = keywords["ptr"] 5481 return 5482 raise Error 5483 def __del__(self): 5484 if hasattr(self, 'ptr'): 5485 isl.isl_ast_expr_free(self.ptr) 5486 def __new__(cls, *args, **keywords): 5487 return super(ast_expr_op_div, cls).__new__(cls) 5488 def __str__(arg0): 5489 try: 5490 if not arg0.__class__ is ast_expr_op_div: 5491 arg0 = ast_expr_op_div(arg0) 5492 except: 5493 raise 5494 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5495 res = cast(ptr, c_char_p).value.decode('ascii') 5496 libc.free(ptr) 5497 return res 5498 def __repr__(self): 5499 s = str(self) 5500 if '"' in s: 5501 return 'isl.ast_expr_op_div("""%s""")' % s 5502 else: 5503 return 'isl.ast_expr_op_div("%s")' % s 5504 5505isl.isl_ast_expr_copy.restype = c_void_p 5506isl.isl_ast_expr_copy.argtypes = [c_void_p] 5507isl.isl_ast_expr_free.restype = c_void_p 5508isl.isl_ast_expr_free.argtypes = [c_void_p] 5509isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5510isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5511 5512class ast_expr_op_eq(ast_expr_op): 5513 def __init__(self, *args, **keywords): 5514 if "ptr" in keywords: 5515 self.ctx = keywords["ctx"] 5516 self.ptr = keywords["ptr"] 5517 return 5518 raise Error 5519 def __del__(self): 5520 if hasattr(self, 'ptr'): 5521 isl.isl_ast_expr_free(self.ptr) 5522 def __new__(cls, *args, **keywords): 5523 return super(ast_expr_op_eq, cls).__new__(cls) 5524 def __str__(arg0): 5525 try: 5526 if not arg0.__class__ is ast_expr_op_eq: 5527 arg0 = ast_expr_op_eq(arg0) 5528 except: 5529 raise 5530 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5531 res = cast(ptr, c_char_p).value.decode('ascii') 5532 libc.free(ptr) 5533 return res 5534 def __repr__(self): 5535 s = str(self) 5536 if '"' in s: 5537 return 'isl.ast_expr_op_eq("""%s""")' % s 5538 else: 5539 return 'isl.ast_expr_op_eq("%s")' % s 5540 5541isl.isl_ast_expr_copy.restype = c_void_p 5542isl.isl_ast_expr_copy.argtypes = [c_void_p] 5543isl.isl_ast_expr_free.restype = c_void_p 5544isl.isl_ast_expr_free.argtypes = [c_void_p] 5545isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5546isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5547 5548class ast_expr_op_fdiv_q(ast_expr_op): 5549 def __init__(self, *args, **keywords): 5550 if "ptr" in keywords: 5551 self.ctx = keywords["ctx"] 5552 self.ptr = keywords["ptr"] 5553 return 5554 raise Error 5555 def __del__(self): 5556 if hasattr(self, 'ptr'): 5557 isl.isl_ast_expr_free(self.ptr) 5558 def __new__(cls, *args, **keywords): 5559 return super(ast_expr_op_fdiv_q, cls).__new__(cls) 5560 def __str__(arg0): 5561 try: 5562 if not arg0.__class__ is ast_expr_op_fdiv_q: 5563 arg0 = ast_expr_op_fdiv_q(arg0) 5564 except: 5565 raise 5566 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5567 res = cast(ptr, c_char_p).value.decode('ascii') 5568 libc.free(ptr) 5569 return res 5570 def __repr__(self): 5571 s = str(self) 5572 if '"' in s: 5573 return 'isl.ast_expr_op_fdiv_q("""%s""")' % s 5574 else: 5575 return 'isl.ast_expr_op_fdiv_q("%s")' % s 5576 5577isl.isl_ast_expr_copy.restype = c_void_p 5578isl.isl_ast_expr_copy.argtypes = [c_void_p] 5579isl.isl_ast_expr_free.restype = c_void_p 5580isl.isl_ast_expr_free.argtypes = [c_void_p] 5581isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5582isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5583 5584class ast_expr_op_ge(ast_expr_op): 5585 def __init__(self, *args, **keywords): 5586 if "ptr" in keywords: 5587 self.ctx = keywords["ctx"] 5588 self.ptr = keywords["ptr"] 5589 return 5590 raise Error 5591 def __del__(self): 5592 if hasattr(self, 'ptr'): 5593 isl.isl_ast_expr_free(self.ptr) 5594 def __new__(cls, *args, **keywords): 5595 return super(ast_expr_op_ge, cls).__new__(cls) 5596 def __str__(arg0): 5597 try: 5598 if not arg0.__class__ is ast_expr_op_ge: 5599 arg0 = ast_expr_op_ge(arg0) 5600 except: 5601 raise 5602 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5603 res = cast(ptr, c_char_p).value.decode('ascii') 5604 libc.free(ptr) 5605 return res 5606 def __repr__(self): 5607 s = str(self) 5608 if '"' in s: 5609 return 'isl.ast_expr_op_ge("""%s""")' % s 5610 else: 5611 return 'isl.ast_expr_op_ge("%s")' % s 5612 5613isl.isl_ast_expr_copy.restype = c_void_p 5614isl.isl_ast_expr_copy.argtypes = [c_void_p] 5615isl.isl_ast_expr_free.restype = c_void_p 5616isl.isl_ast_expr_free.argtypes = [c_void_p] 5617isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5618isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5619 5620class ast_expr_op_gt(ast_expr_op): 5621 def __init__(self, *args, **keywords): 5622 if "ptr" in keywords: 5623 self.ctx = keywords["ctx"] 5624 self.ptr = keywords["ptr"] 5625 return 5626 raise Error 5627 def __del__(self): 5628 if hasattr(self, 'ptr'): 5629 isl.isl_ast_expr_free(self.ptr) 5630 def __new__(cls, *args, **keywords): 5631 return super(ast_expr_op_gt, cls).__new__(cls) 5632 def __str__(arg0): 5633 try: 5634 if not arg0.__class__ is ast_expr_op_gt: 5635 arg0 = ast_expr_op_gt(arg0) 5636 except: 5637 raise 5638 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5639 res = cast(ptr, c_char_p).value.decode('ascii') 5640 libc.free(ptr) 5641 return res 5642 def __repr__(self): 5643 s = str(self) 5644 if '"' in s: 5645 return 'isl.ast_expr_op_gt("""%s""")' % s 5646 else: 5647 return 'isl.ast_expr_op_gt("%s")' % s 5648 5649isl.isl_ast_expr_copy.restype = c_void_p 5650isl.isl_ast_expr_copy.argtypes = [c_void_p] 5651isl.isl_ast_expr_free.restype = c_void_p 5652isl.isl_ast_expr_free.argtypes = [c_void_p] 5653isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5654isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5655 5656class ast_expr_op_le(ast_expr_op): 5657 def __init__(self, *args, **keywords): 5658 if "ptr" in keywords: 5659 self.ctx = keywords["ctx"] 5660 self.ptr = keywords["ptr"] 5661 return 5662 raise Error 5663 def __del__(self): 5664 if hasattr(self, 'ptr'): 5665 isl.isl_ast_expr_free(self.ptr) 5666 def __new__(cls, *args, **keywords): 5667 return super(ast_expr_op_le, cls).__new__(cls) 5668 def __str__(arg0): 5669 try: 5670 if not arg0.__class__ is ast_expr_op_le: 5671 arg0 = ast_expr_op_le(arg0) 5672 except: 5673 raise 5674 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5675 res = cast(ptr, c_char_p).value.decode('ascii') 5676 libc.free(ptr) 5677 return res 5678 def __repr__(self): 5679 s = str(self) 5680 if '"' in s: 5681 return 'isl.ast_expr_op_le("""%s""")' % s 5682 else: 5683 return 'isl.ast_expr_op_le("%s")' % s 5684 5685isl.isl_ast_expr_copy.restype = c_void_p 5686isl.isl_ast_expr_copy.argtypes = [c_void_p] 5687isl.isl_ast_expr_free.restype = c_void_p 5688isl.isl_ast_expr_free.argtypes = [c_void_p] 5689isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5690isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5691 5692class ast_expr_op_lt(ast_expr_op): 5693 def __init__(self, *args, **keywords): 5694 if "ptr" in keywords: 5695 self.ctx = keywords["ctx"] 5696 self.ptr = keywords["ptr"] 5697 return 5698 raise Error 5699 def __del__(self): 5700 if hasattr(self, 'ptr'): 5701 isl.isl_ast_expr_free(self.ptr) 5702 def __new__(cls, *args, **keywords): 5703 return super(ast_expr_op_lt, cls).__new__(cls) 5704 def __str__(arg0): 5705 try: 5706 if not arg0.__class__ is ast_expr_op_lt: 5707 arg0 = ast_expr_op_lt(arg0) 5708 except: 5709 raise 5710 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5711 res = cast(ptr, c_char_p).value.decode('ascii') 5712 libc.free(ptr) 5713 return res 5714 def __repr__(self): 5715 s = str(self) 5716 if '"' in s: 5717 return 'isl.ast_expr_op_lt("""%s""")' % s 5718 else: 5719 return 'isl.ast_expr_op_lt("%s")' % s 5720 5721isl.isl_ast_expr_copy.restype = c_void_p 5722isl.isl_ast_expr_copy.argtypes = [c_void_p] 5723isl.isl_ast_expr_free.restype = c_void_p 5724isl.isl_ast_expr_free.argtypes = [c_void_p] 5725isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5726isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5727 5728class ast_expr_op_max(ast_expr_op): 5729 def __init__(self, *args, **keywords): 5730 if "ptr" in keywords: 5731 self.ctx = keywords["ctx"] 5732 self.ptr = keywords["ptr"] 5733 return 5734 raise Error 5735 def __del__(self): 5736 if hasattr(self, 'ptr'): 5737 isl.isl_ast_expr_free(self.ptr) 5738 def __new__(cls, *args, **keywords): 5739 return super(ast_expr_op_max, cls).__new__(cls) 5740 def __str__(arg0): 5741 try: 5742 if not arg0.__class__ is ast_expr_op_max: 5743 arg0 = ast_expr_op_max(arg0) 5744 except: 5745 raise 5746 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5747 res = cast(ptr, c_char_p).value.decode('ascii') 5748 libc.free(ptr) 5749 return res 5750 def __repr__(self): 5751 s = str(self) 5752 if '"' in s: 5753 return 'isl.ast_expr_op_max("""%s""")' % s 5754 else: 5755 return 'isl.ast_expr_op_max("%s")' % s 5756 5757isl.isl_ast_expr_copy.restype = c_void_p 5758isl.isl_ast_expr_copy.argtypes = [c_void_p] 5759isl.isl_ast_expr_free.restype = c_void_p 5760isl.isl_ast_expr_free.argtypes = [c_void_p] 5761isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5762isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5763 5764class ast_expr_op_member(ast_expr_op): 5765 def __init__(self, *args, **keywords): 5766 if "ptr" in keywords: 5767 self.ctx = keywords["ctx"] 5768 self.ptr = keywords["ptr"] 5769 return 5770 raise Error 5771 def __del__(self): 5772 if hasattr(self, 'ptr'): 5773 isl.isl_ast_expr_free(self.ptr) 5774 def __new__(cls, *args, **keywords): 5775 return super(ast_expr_op_member, cls).__new__(cls) 5776 def __str__(arg0): 5777 try: 5778 if not arg0.__class__ is ast_expr_op_member: 5779 arg0 = ast_expr_op_member(arg0) 5780 except: 5781 raise 5782 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5783 res = cast(ptr, c_char_p).value.decode('ascii') 5784 libc.free(ptr) 5785 return res 5786 def __repr__(self): 5787 s = str(self) 5788 if '"' in s: 5789 return 'isl.ast_expr_op_member("""%s""")' % s 5790 else: 5791 return 'isl.ast_expr_op_member("%s")' % s 5792 5793isl.isl_ast_expr_copy.restype = c_void_p 5794isl.isl_ast_expr_copy.argtypes = [c_void_p] 5795isl.isl_ast_expr_free.restype = c_void_p 5796isl.isl_ast_expr_free.argtypes = [c_void_p] 5797isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5798isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5799 5800class ast_expr_op_min(ast_expr_op): 5801 def __init__(self, *args, **keywords): 5802 if "ptr" in keywords: 5803 self.ctx = keywords["ctx"] 5804 self.ptr = keywords["ptr"] 5805 return 5806 raise Error 5807 def __del__(self): 5808 if hasattr(self, 'ptr'): 5809 isl.isl_ast_expr_free(self.ptr) 5810 def __new__(cls, *args, **keywords): 5811 return super(ast_expr_op_min, cls).__new__(cls) 5812 def __str__(arg0): 5813 try: 5814 if not arg0.__class__ is ast_expr_op_min: 5815 arg0 = ast_expr_op_min(arg0) 5816 except: 5817 raise 5818 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5819 res = cast(ptr, c_char_p).value.decode('ascii') 5820 libc.free(ptr) 5821 return res 5822 def __repr__(self): 5823 s = str(self) 5824 if '"' in s: 5825 return 'isl.ast_expr_op_min("""%s""")' % s 5826 else: 5827 return 'isl.ast_expr_op_min("%s")' % s 5828 5829isl.isl_ast_expr_copy.restype = c_void_p 5830isl.isl_ast_expr_copy.argtypes = [c_void_p] 5831isl.isl_ast_expr_free.restype = c_void_p 5832isl.isl_ast_expr_free.argtypes = [c_void_p] 5833isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5834isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5835 5836class ast_expr_op_minus(ast_expr_op): 5837 def __init__(self, *args, **keywords): 5838 if "ptr" in keywords: 5839 self.ctx = keywords["ctx"] 5840 self.ptr = keywords["ptr"] 5841 return 5842 raise Error 5843 def __del__(self): 5844 if hasattr(self, 'ptr'): 5845 isl.isl_ast_expr_free(self.ptr) 5846 def __new__(cls, *args, **keywords): 5847 return super(ast_expr_op_minus, cls).__new__(cls) 5848 def __str__(arg0): 5849 try: 5850 if not arg0.__class__ is ast_expr_op_minus: 5851 arg0 = ast_expr_op_minus(arg0) 5852 except: 5853 raise 5854 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5855 res = cast(ptr, c_char_p).value.decode('ascii') 5856 libc.free(ptr) 5857 return res 5858 def __repr__(self): 5859 s = str(self) 5860 if '"' in s: 5861 return 'isl.ast_expr_op_minus("""%s""")' % s 5862 else: 5863 return 'isl.ast_expr_op_minus("%s")' % s 5864 5865isl.isl_ast_expr_copy.restype = c_void_p 5866isl.isl_ast_expr_copy.argtypes = [c_void_p] 5867isl.isl_ast_expr_free.restype = c_void_p 5868isl.isl_ast_expr_free.argtypes = [c_void_p] 5869isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5870isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5871 5872class ast_expr_op_mul(ast_expr_op): 5873 def __init__(self, *args, **keywords): 5874 if "ptr" in keywords: 5875 self.ctx = keywords["ctx"] 5876 self.ptr = keywords["ptr"] 5877 return 5878 raise Error 5879 def __del__(self): 5880 if hasattr(self, 'ptr'): 5881 isl.isl_ast_expr_free(self.ptr) 5882 def __new__(cls, *args, **keywords): 5883 return super(ast_expr_op_mul, cls).__new__(cls) 5884 def __str__(arg0): 5885 try: 5886 if not arg0.__class__ is ast_expr_op_mul: 5887 arg0 = ast_expr_op_mul(arg0) 5888 except: 5889 raise 5890 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5891 res = cast(ptr, c_char_p).value.decode('ascii') 5892 libc.free(ptr) 5893 return res 5894 def __repr__(self): 5895 s = str(self) 5896 if '"' in s: 5897 return 'isl.ast_expr_op_mul("""%s""")' % s 5898 else: 5899 return 'isl.ast_expr_op_mul("%s")' % s 5900 5901isl.isl_ast_expr_copy.restype = c_void_p 5902isl.isl_ast_expr_copy.argtypes = [c_void_p] 5903isl.isl_ast_expr_free.restype = c_void_p 5904isl.isl_ast_expr_free.argtypes = [c_void_p] 5905isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5906isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5907 5908class ast_expr_op_or(ast_expr_op): 5909 def __init__(self, *args, **keywords): 5910 if "ptr" in keywords: 5911 self.ctx = keywords["ctx"] 5912 self.ptr = keywords["ptr"] 5913 return 5914 raise Error 5915 def __del__(self): 5916 if hasattr(self, 'ptr'): 5917 isl.isl_ast_expr_free(self.ptr) 5918 def __new__(cls, *args, **keywords): 5919 return super(ast_expr_op_or, cls).__new__(cls) 5920 def __str__(arg0): 5921 try: 5922 if not arg0.__class__ is ast_expr_op_or: 5923 arg0 = ast_expr_op_or(arg0) 5924 except: 5925 raise 5926 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5927 res = cast(ptr, c_char_p).value.decode('ascii') 5928 libc.free(ptr) 5929 return res 5930 def __repr__(self): 5931 s = str(self) 5932 if '"' in s: 5933 return 'isl.ast_expr_op_or("""%s""")' % s 5934 else: 5935 return 'isl.ast_expr_op_or("%s")' % s 5936 5937isl.isl_ast_expr_copy.restype = c_void_p 5938isl.isl_ast_expr_copy.argtypes = [c_void_p] 5939isl.isl_ast_expr_free.restype = c_void_p 5940isl.isl_ast_expr_free.argtypes = [c_void_p] 5941isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5942isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5943 5944class ast_expr_op_or_else(ast_expr_op): 5945 def __init__(self, *args, **keywords): 5946 if "ptr" in keywords: 5947 self.ctx = keywords["ctx"] 5948 self.ptr = keywords["ptr"] 5949 return 5950 raise Error 5951 def __del__(self): 5952 if hasattr(self, 'ptr'): 5953 isl.isl_ast_expr_free(self.ptr) 5954 def __new__(cls, *args, **keywords): 5955 return super(ast_expr_op_or_else, cls).__new__(cls) 5956 def __str__(arg0): 5957 try: 5958 if not arg0.__class__ is ast_expr_op_or_else: 5959 arg0 = ast_expr_op_or_else(arg0) 5960 except: 5961 raise 5962 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5963 res = cast(ptr, c_char_p).value.decode('ascii') 5964 libc.free(ptr) 5965 return res 5966 def __repr__(self): 5967 s = str(self) 5968 if '"' in s: 5969 return 'isl.ast_expr_op_or_else("""%s""")' % s 5970 else: 5971 return 'isl.ast_expr_op_or_else("%s")' % s 5972 5973isl.isl_ast_expr_copy.restype = c_void_p 5974isl.isl_ast_expr_copy.argtypes = [c_void_p] 5975isl.isl_ast_expr_free.restype = c_void_p 5976isl.isl_ast_expr_free.argtypes = [c_void_p] 5977isl.isl_ast_expr_to_str.restype = POINTER(c_char) 5978isl.isl_ast_expr_to_str.argtypes = [c_void_p] 5979 5980class ast_expr_op_pdiv_q(ast_expr_op): 5981 def __init__(self, *args, **keywords): 5982 if "ptr" in keywords: 5983 self.ctx = keywords["ctx"] 5984 self.ptr = keywords["ptr"] 5985 return 5986 raise Error 5987 def __del__(self): 5988 if hasattr(self, 'ptr'): 5989 isl.isl_ast_expr_free(self.ptr) 5990 def __new__(cls, *args, **keywords): 5991 return super(ast_expr_op_pdiv_q, cls).__new__(cls) 5992 def __str__(arg0): 5993 try: 5994 if not arg0.__class__ is ast_expr_op_pdiv_q: 5995 arg0 = ast_expr_op_pdiv_q(arg0) 5996 except: 5997 raise 5998 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 5999 res = cast(ptr, c_char_p).value.decode('ascii') 6000 libc.free(ptr) 6001 return res 6002 def __repr__(self): 6003 s = str(self) 6004 if '"' in s: 6005 return 'isl.ast_expr_op_pdiv_q("""%s""")' % s 6006 else: 6007 return 'isl.ast_expr_op_pdiv_q("%s")' % s 6008 6009isl.isl_ast_expr_copy.restype = c_void_p 6010isl.isl_ast_expr_copy.argtypes = [c_void_p] 6011isl.isl_ast_expr_free.restype = c_void_p 6012isl.isl_ast_expr_free.argtypes = [c_void_p] 6013isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6014isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6015 6016class ast_expr_op_pdiv_r(ast_expr_op): 6017 def __init__(self, *args, **keywords): 6018 if "ptr" in keywords: 6019 self.ctx = keywords["ctx"] 6020 self.ptr = keywords["ptr"] 6021 return 6022 raise Error 6023 def __del__(self): 6024 if hasattr(self, 'ptr'): 6025 isl.isl_ast_expr_free(self.ptr) 6026 def __new__(cls, *args, **keywords): 6027 return super(ast_expr_op_pdiv_r, cls).__new__(cls) 6028 def __str__(arg0): 6029 try: 6030 if not arg0.__class__ is ast_expr_op_pdiv_r: 6031 arg0 = ast_expr_op_pdiv_r(arg0) 6032 except: 6033 raise 6034 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6035 res = cast(ptr, c_char_p).value.decode('ascii') 6036 libc.free(ptr) 6037 return res 6038 def __repr__(self): 6039 s = str(self) 6040 if '"' in s: 6041 return 'isl.ast_expr_op_pdiv_r("""%s""")' % s 6042 else: 6043 return 'isl.ast_expr_op_pdiv_r("%s")' % s 6044 6045isl.isl_ast_expr_copy.restype = c_void_p 6046isl.isl_ast_expr_copy.argtypes = [c_void_p] 6047isl.isl_ast_expr_free.restype = c_void_p 6048isl.isl_ast_expr_free.argtypes = [c_void_p] 6049isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6050isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6051 6052class ast_expr_op_select(ast_expr_op): 6053 def __init__(self, *args, **keywords): 6054 if "ptr" in keywords: 6055 self.ctx = keywords["ctx"] 6056 self.ptr = keywords["ptr"] 6057 return 6058 raise Error 6059 def __del__(self): 6060 if hasattr(self, 'ptr'): 6061 isl.isl_ast_expr_free(self.ptr) 6062 def __new__(cls, *args, **keywords): 6063 return super(ast_expr_op_select, cls).__new__(cls) 6064 def __str__(arg0): 6065 try: 6066 if not arg0.__class__ is ast_expr_op_select: 6067 arg0 = ast_expr_op_select(arg0) 6068 except: 6069 raise 6070 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6071 res = cast(ptr, c_char_p).value.decode('ascii') 6072 libc.free(ptr) 6073 return res 6074 def __repr__(self): 6075 s = str(self) 6076 if '"' in s: 6077 return 'isl.ast_expr_op_select("""%s""")' % s 6078 else: 6079 return 'isl.ast_expr_op_select("%s")' % s 6080 6081isl.isl_ast_expr_copy.restype = c_void_p 6082isl.isl_ast_expr_copy.argtypes = [c_void_p] 6083isl.isl_ast_expr_free.restype = c_void_p 6084isl.isl_ast_expr_free.argtypes = [c_void_p] 6085isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6086isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6087 6088class ast_expr_op_sub(ast_expr_op): 6089 def __init__(self, *args, **keywords): 6090 if "ptr" in keywords: 6091 self.ctx = keywords["ctx"] 6092 self.ptr = keywords["ptr"] 6093 return 6094 raise Error 6095 def __del__(self): 6096 if hasattr(self, 'ptr'): 6097 isl.isl_ast_expr_free(self.ptr) 6098 def __new__(cls, *args, **keywords): 6099 return super(ast_expr_op_sub, cls).__new__(cls) 6100 def __str__(arg0): 6101 try: 6102 if not arg0.__class__ is ast_expr_op_sub: 6103 arg0 = ast_expr_op_sub(arg0) 6104 except: 6105 raise 6106 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6107 res = cast(ptr, c_char_p).value.decode('ascii') 6108 libc.free(ptr) 6109 return res 6110 def __repr__(self): 6111 s = str(self) 6112 if '"' in s: 6113 return 'isl.ast_expr_op_sub("""%s""")' % s 6114 else: 6115 return 'isl.ast_expr_op_sub("%s")' % s 6116 6117isl.isl_ast_expr_copy.restype = c_void_p 6118isl.isl_ast_expr_copy.argtypes = [c_void_p] 6119isl.isl_ast_expr_free.restype = c_void_p 6120isl.isl_ast_expr_free.argtypes = [c_void_p] 6121isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6122isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6123 6124class ast_expr_op_zdiv_r(ast_expr_op): 6125 def __init__(self, *args, **keywords): 6126 if "ptr" in keywords: 6127 self.ctx = keywords["ctx"] 6128 self.ptr = keywords["ptr"] 6129 return 6130 raise Error 6131 def __del__(self): 6132 if hasattr(self, 'ptr'): 6133 isl.isl_ast_expr_free(self.ptr) 6134 def __new__(cls, *args, **keywords): 6135 return super(ast_expr_op_zdiv_r, cls).__new__(cls) 6136 def __str__(arg0): 6137 try: 6138 if not arg0.__class__ is ast_expr_op_zdiv_r: 6139 arg0 = ast_expr_op_zdiv_r(arg0) 6140 except: 6141 raise 6142 ptr = isl.isl_ast_expr_to_str(arg0.ptr) 6143 res = cast(ptr, c_char_p).value.decode('ascii') 6144 libc.free(ptr) 6145 return res 6146 def __repr__(self): 6147 s = str(self) 6148 if '"' in s: 6149 return 'isl.ast_expr_op_zdiv_r("""%s""")' % s 6150 else: 6151 return 'isl.ast_expr_op_zdiv_r("%s")' % s 6152 6153isl.isl_ast_expr_copy.restype = c_void_p 6154isl.isl_ast_expr_copy.argtypes = [c_void_p] 6155isl.isl_ast_expr_free.restype = c_void_p 6156isl.isl_ast_expr_free.argtypes = [c_void_p] 6157isl.isl_ast_expr_to_str.restype = POINTER(c_char) 6158isl.isl_ast_expr_to_str.argtypes = [c_void_p] 6159 6160class ast_node(object): 6161 def __init__(self, *args, **keywords): 6162 if "ptr" in keywords: 6163 self.ctx = keywords["ctx"] 6164 self.ptr = keywords["ptr"] 6165 return 6166 if len(args) == 1 and isinstance(args[0], ast_node_for): 6167 self.ctx = args[0].ctx 6168 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6169 return 6170 if len(args) == 1 and isinstance(args[0], ast_node_if): 6171 self.ctx = args[0].ctx 6172 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6173 return 6174 if len(args) == 1 and isinstance(args[0], ast_node_block): 6175 self.ctx = args[0].ctx 6176 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6177 return 6178 if len(args) == 1 and isinstance(args[0], ast_node_mark): 6179 self.ctx = args[0].ctx 6180 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6181 return 6182 if len(args) == 1 and isinstance(args[0], ast_node_user): 6183 self.ctx = args[0].ctx 6184 self.ptr = isl.isl_ast_node_copy(args[0].ptr) 6185 return 6186 raise Error 6187 def __del__(self): 6188 if hasattr(self, 'ptr'): 6189 isl.isl_ast_node_free(self.ptr) 6190 def __new__(cls, *args, **keywords): 6191 if "ptr" in keywords: 6192 type = isl.isl_ast_node_get_type(keywords["ptr"]) 6193 if type == 1: 6194 return ast_node_for(**keywords) 6195 if type == 2: 6196 return ast_node_if(**keywords) 6197 if type == 3: 6198 return ast_node_block(**keywords) 6199 if type == 4: 6200 return ast_node_mark(**keywords) 6201 if type == 5: 6202 return ast_node_user(**keywords) 6203 raise 6204 return super(ast_node, cls).__new__(cls) 6205 def __str__(arg0): 6206 try: 6207 if not arg0.__class__ is ast_node: 6208 arg0 = ast_node(arg0) 6209 except: 6210 raise 6211 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6212 res = cast(ptr, c_char_p).value.decode('ascii') 6213 libc.free(ptr) 6214 return res 6215 def __repr__(self): 6216 s = str(self) 6217 if '"' in s: 6218 return 'isl.ast_node("""%s""")' % s 6219 else: 6220 return 'isl.ast_node("%s")' % s 6221 def to_C_str(arg0): 6222 try: 6223 if not arg0.__class__ is ast_node: 6224 arg0 = ast_node(arg0) 6225 except: 6226 raise 6227 ctx = arg0.ctx 6228 res = isl.isl_ast_node_to_C_str(arg0.ptr) 6229 if res == 0: 6230 raise 6231 string = cast(res, c_char_p).value.decode('ascii') 6232 libc.free(res) 6233 return string 6234 def to_list(arg0): 6235 try: 6236 if not arg0.__class__ is ast_node: 6237 arg0 = ast_node(arg0) 6238 except: 6239 raise 6240 ctx = arg0.ctx 6241 res = isl.isl_ast_node_to_list(isl.isl_ast_node_copy(arg0.ptr)) 6242 obj = ast_node_list(ctx=ctx, ptr=res) 6243 return obj 6244 6245isl.isl_ast_node_to_C_str.restype = POINTER(c_char) 6246isl.isl_ast_node_to_C_str.argtypes = [c_void_p] 6247isl.isl_ast_node_to_list.restype = c_void_p 6248isl.isl_ast_node_to_list.argtypes = [c_void_p] 6249isl.isl_ast_node_copy.restype = c_void_p 6250isl.isl_ast_node_copy.argtypes = [c_void_p] 6251isl.isl_ast_node_free.restype = c_void_p 6252isl.isl_ast_node_free.argtypes = [c_void_p] 6253isl.isl_ast_node_to_str.restype = POINTER(c_char) 6254isl.isl_ast_node_to_str.argtypes = [c_void_p] 6255isl.isl_ast_node_get_type.argtypes = [c_void_p] 6256 6257class ast_node_block(ast_node): 6258 def __init__(self, *args, **keywords): 6259 if "ptr" in keywords: 6260 self.ctx = keywords["ctx"] 6261 self.ptr = keywords["ptr"] 6262 return 6263 raise Error 6264 def __del__(self): 6265 if hasattr(self, 'ptr'): 6266 isl.isl_ast_node_free(self.ptr) 6267 def __new__(cls, *args, **keywords): 6268 return super(ast_node_block, cls).__new__(cls) 6269 def __str__(arg0): 6270 try: 6271 if not arg0.__class__ is ast_node_block: 6272 arg0 = ast_node_block(arg0) 6273 except: 6274 raise 6275 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6276 res = cast(ptr, c_char_p).value.decode('ascii') 6277 libc.free(ptr) 6278 return res 6279 def __repr__(self): 6280 s = str(self) 6281 if '"' in s: 6282 return 'isl.ast_node_block("""%s""")' % s 6283 else: 6284 return 'isl.ast_node_block("%s")' % s 6285 def children(arg0): 6286 try: 6287 if not arg0.__class__ is ast_node: 6288 arg0 = ast_node(arg0) 6289 except: 6290 raise 6291 ctx = arg0.ctx 6292 res = isl.isl_ast_node_block_get_children(arg0.ptr) 6293 obj = ast_node_list(ctx=ctx, ptr=res) 6294 return obj 6295 def get_children(arg0): 6296 return arg0.children() 6297 6298isl.isl_ast_node_block_get_children.restype = c_void_p 6299isl.isl_ast_node_block_get_children.argtypes = [c_void_p] 6300isl.isl_ast_node_copy.restype = c_void_p 6301isl.isl_ast_node_copy.argtypes = [c_void_p] 6302isl.isl_ast_node_free.restype = c_void_p 6303isl.isl_ast_node_free.argtypes = [c_void_p] 6304isl.isl_ast_node_to_str.restype = POINTER(c_char) 6305isl.isl_ast_node_to_str.argtypes = [c_void_p] 6306 6307class ast_node_for(ast_node): 6308 def __init__(self, *args, **keywords): 6309 if "ptr" in keywords: 6310 self.ctx = keywords["ctx"] 6311 self.ptr = keywords["ptr"] 6312 return 6313 raise Error 6314 def __del__(self): 6315 if hasattr(self, 'ptr'): 6316 isl.isl_ast_node_free(self.ptr) 6317 def __new__(cls, *args, **keywords): 6318 return super(ast_node_for, cls).__new__(cls) 6319 def __str__(arg0): 6320 try: 6321 if not arg0.__class__ is ast_node_for: 6322 arg0 = ast_node_for(arg0) 6323 except: 6324 raise 6325 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6326 res = cast(ptr, c_char_p).value.decode('ascii') 6327 libc.free(ptr) 6328 return res 6329 def __repr__(self): 6330 s = str(self) 6331 if '"' in s: 6332 return 'isl.ast_node_for("""%s""")' % s 6333 else: 6334 return 'isl.ast_node_for("%s")' % s 6335 def body(arg0): 6336 try: 6337 if not arg0.__class__ is ast_node: 6338 arg0 = ast_node(arg0) 6339 except: 6340 raise 6341 ctx = arg0.ctx 6342 res = isl.isl_ast_node_for_get_body(arg0.ptr) 6343 obj = ast_node(ctx=ctx, ptr=res) 6344 return obj 6345 def get_body(arg0): 6346 return arg0.body() 6347 def cond(arg0): 6348 try: 6349 if not arg0.__class__ is ast_node: 6350 arg0 = ast_node(arg0) 6351 except: 6352 raise 6353 ctx = arg0.ctx 6354 res = isl.isl_ast_node_for_get_cond(arg0.ptr) 6355 obj = ast_expr(ctx=ctx, ptr=res) 6356 return obj 6357 def get_cond(arg0): 6358 return arg0.cond() 6359 def inc(arg0): 6360 try: 6361 if not arg0.__class__ is ast_node: 6362 arg0 = ast_node(arg0) 6363 except: 6364 raise 6365 ctx = arg0.ctx 6366 res = isl.isl_ast_node_for_get_inc(arg0.ptr) 6367 obj = ast_expr(ctx=ctx, ptr=res) 6368 return obj 6369 def get_inc(arg0): 6370 return arg0.inc() 6371 def init(arg0): 6372 try: 6373 if not arg0.__class__ is ast_node: 6374 arg0 = ast_node(arg0) 6375 except: 6376 raise 6377 ctx = arg0.ctx 6378 res = isl.isl_ast_node_for_get_init(arg0.ptr) 6379 obj = ast_expr(ctx=ctx, ptr=res) 6380 return obj 6381 def get_init(arg0): 6382 return arg0.init() 6383 def is_degenerate(arg0): 6384 try: 6385 if not arg0.__class__ is ast_node: 6386 arg0 = ast_node(arg0) 6387 except: 6388 raise 6389 ctx = arg0.ctx 6390 res = isl.isl_ast_node_for_is_degenerate(arg0.ptr) 6391 if res < 0: 6392 raise 6393 return bool(res) 6394 def iterator(arg0): 6395 try: 6396 if not arg0.__class__ is ast_node: 6397 arg0 = ast_node(arg0) 6398 except: 6399 raise 6400 ctx = arg0.ctx 6401 res = isl.isl_ast_node_for_get_iterator(arg0.ptr) 6402 obj = ast_expr(ctx=ctx, ptr=res) 6403 return obj 6404 def get_iterator(arg0): 6405 return arg0.iterator() 6406 6407isl.isl_ast_node_for_get_body.restype = c_void_p 6408isl.isl_ast_node_for_get_body.argtypes = [c_void_p] 6409isl.isl_ast_node_for_get_cond.restype = c_void_p 6410isl.isl_ast_node_for_get_cond.argtypes = [c_void_p] 6411isl.isl_ast_node_for_get_inc.restype = c_void_p 6412isl.isl_ast_node_for_get_inc.argtypes = [c_void_p] 6413isl.isl_ast_node_for_get_init.restype = c_void_p 6414isl.isl_ast_node_for_get_init.argtypes = [c_void_p] 6415isl.isl_ast_node_for_is_degenerate.argtypes = [c_void_p] 6416isl.isl_ast_node_for_get_iterator.restype = c_void_p 6417isl.isl_ast_node_for_get_iterator.argtypes = [c_void_p] 6418isl.isl_ast_node_copy.restype = c_void_p 6419isl.isl_ast_node_copy.argtypes = [c_void_p] 6420isl.isl_ast_node_free.restype = c_void_p 6421isl.isl_ast_node_free.argtypes = [c_void_p] 6422isl.isl_ast_node_to_str.restype = POINTER(c_char) 6423isl.isl_ast_node_to_str.argtypes = [c_void_p] 6424 6425class ast_node_if(ast_node): 6426 def __init__(self, *args, **keywords): 6427 if "ptr" in keywords: 6428 self.ctx = keywords["ctx"] 6429 self.ptr = keywords["ptr"] 6430 return 6431 raise Error 6432 def __del__(self): 6433 if hasattr(self, 'ptr'): 6434 isl.isl_ast_node_free(self.ptr) 6435 def __new__(cls, *args, **keywords): 6436 return super(ast_node_if, cls).__new__(cls) 6437 def __str__(arg0): 6438 try: 6439 if not arg0.__class__ is ast_node_if: 6440 arg0 = ast_node_if(arg0) 6441 except: 6442 raise 6443 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6444 res = cast(ptr, c_char_p).value.decode('ascii') 6445 libc.free(ptr) 6446 return res 6447 def __repr__(self): 6448 s = str(self) 6449 if '"' in s: 6450 return 'isl.ast_node_if("""%s""")' % s 6451 else: 6452 return 'isl.ast_node_if("%s")' % s 6453 def cond(arg0): 6454 try: 6455 if not arg0.__class__ is ast_node: 6456 arg0 = ast_node(arg0) 6457 except: 6458 raise 6459 ctx = arg0.ctx 6460 res = isl.isl_ast_node_if_get_cond(arg0.ptr) 6461 obj = ast_expr(ctx=ctx, ptr=res) 6462 return obj 6463 def get_cond(arg0): 6464 return arg0.cond() 6465 def else_node(arg0): 6466 try: 6467 if not arg0.__class__ is ast_node: 6468 arg0 = ast_node(arg0) 6469 except: 6470 raise 6471 ctx = arg0.ctx 6472 res = isl.isl_ast_node_if_get_else_node(arg0.ptr) 6473 obj = ast_node(ctx=ctx, ptr=res) 6474 return obj 6475 def get_else_node(arg0): 6476 return arg0.else_node() 6477 def has_else_node(arg0): 6478 try: 6479 if not arg0.__class__ is ast_node: 6480 arg0 = ast_node(arg0) 6481 except: 6482 raise 6483 ctx = arg0.ctx 6484 res = isl.isl_ast_node_if_has_else_node(arg0.ptr) 6485 if res < 0: 6486 raise 6487 return bool(res) 6488 def then_node(arg0): 6489 try: 6490 if not arg0.__class__ is ast_node: 6491 arg0 = ast_node(arg0) 6492 except: 6493 raise 6494 ctx = arg0.ctx 6495 res = isl.isl_ast_node_if_get_then_node(arg0.ptr) 6496 obj = ast_node(ctx=ctx, ptr=res) 6497 return obj 6498 def get_then_node(arg0): 6499 return arg0.then_node() 6500 6501isl.isl_ast_node_if_get_cond.restype = c_void_p 6502isl.isl_ast_node_if_get_cond.argtypes = [c_void_p] 6503isl.isl_ast_node_if_get_else_node.restype = c_void_p 6504isl.isl_ast_node_if_get_else_node.argtypes = [c_void_p] 6505isl.isl_ast_node_if_has_else_node.argtypes = [c_void_p] 6506isl.isl_ast_node_if_get_then_node.restype = c_void_p 6507isl.isl_ast_node_if_get_then_node.argtypes = [c_void_p] 6508isl.isl_ast_node_copy.restype = c_void_p 6509isl.isl_ast_node_copy.argtypes = [c_void_p] 6510isl.isl_ast_node_free.restype = c_void_p 6511isl.isl_ast_node_free.argtypes = [c_void_p] 6512isl.isl_ast_node_to_str.restype = POINTER(c_char) 6513isl.isl_ast_node_to_str.argtypes = [c_void_p] 6514 6515class ast_node_list(object): 6516 def __init__(self, *args, **keywords): 6517 if "ptr" in keywords: 6518 self.ctx = keywords["ctx"] 6519 self.ptr = keywords["ptr"] 6520 return 6521 if len(args) == 1 and type(args[0]) == int: 6522 self.ctx = Context.getDefaultInstance() 6523 self.ptr = isl.isl_ast_node_list_alloc(self.ctx, args[0]) 6524 return 6525 if len(args) == 1 and args[0].__class__ is ast_node: 6526 self.ctx = Context.getDefaultInstance() 6527 self.ptr = isl.isl_ast_node_list_from_ast_node(isl.isl_ast_node_copy(args[0].ptr)) 6528 return 6529 raise Error 6530 def __del__(self): 6531 if hasattr(self, 'ptr'): 6532 isl.isl_ast_node_list_free(self.ptr) 6533 def __str__(arg0): 6534 try: 6535 if not arg0.__class__ is ast_node_list: 6536 arg0 = ast_node_list(arg0) 6537 except: 6538 raise 6539 ptr = isl.isl_ast_node_list_to_str(arg0.ptr) 6540 res = cast(ptr, c_char_p).value.decode('ascii') 6541 libc.free(ptr) 6542 return res 6543 def __repr__(self): 6544 s = str(self) 6545 if '"' in s: 6546 return 'isl.ast_node_list("""%s""")' % s 6547 else: 6548 return 'isl.ast_node_list("%s")' % s 6549 def add(arg0, arg1): 6550 try: 6551 if not arg0.__class__ is ast_node_list: 6552 arg0 = ast_node_list(arg0) 6553 except: 6554 raise 6555 try: 6556 if not arg1.__class__ is ast_node: 6557 arg1 = ast_node(arg1) 6558 except: 6559 raise 6560 ctx = arg0.ctx 6561 res = isl.isl_ast_node_list_add(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_copy(arg1.ptr)) 6562 obj = ast_node_list(ctx=ctx, ptr=res) 6563 return obj 6564 def at(arg0, arg1): 6565 try: 6566 if not arg0.__class__ is ast_node_list: 6567 arg0 = ast_node_list(arg0) 6568 except: 6569 raise 6570 ctx = arg0.ctx 6571 res = isl.isl_ast_node_list_get_at(arg0.ptr, arg1) 6572 obj = ast_node(ctx=ctx, ptr=res) 6573 return obj 6574 def get_at(arg0, arg1): 6575 return arg0.at(arg1) 6576 def clear(arg0): 6577 try: 6578 if not arg0.__class__ is ast_node_list: 6579 arg0 = ast_node_list(arg0) 6580 except: 6581 raise 6582 ctx = arg0.ctx 6583 res = isl.isl_ast_node_list_clear(isl.isl_ast_node_list_copy(arg0.ptr)) 6584 obj = ast_node_list(ctx=ctx, ptr=res) 6585 return obj 6586 def concat(arg0, arg1): 6587 try: 6588 if not arg0.__class__ is ast_node_list: 6589 arg0 = ast_node_list(arg0) 6590 except: 6591 raise 6592 try: 6593 if not arg1.__class__ is ast_node_list: 6594 arg1 = ast_node_list(arg1) 6595 except: 6596 raise 6597 ctx = arg0.ctx 6598 res = isl.isl_ast_node_list_concat(isl.isl_ast_node_list_copy(arg0.ptr), isl.isl_ast_node_list_copy(arg1.ptr)) 6599 obj = ast_node_list(ctx=ctx, ptr=res) 6600 return obj 6601 def drop(arg0, arg1, arg2): 6602 try: 6603 if not arg0.__class__ is ast_node_list: 6604 arg0 = ast_node_list(arg0) 6605 except: 6606 raise 6607 ctx = arg0.ctx 6608 res = isl.isl_ast_node_list_drop(isl.isl_ast_node_list_copy(arg0.ptr), arg1, arg2) 6609 obj = ast_node_list(ctx=ctx, ptr=res) 6610 return obj 6611 def foreach(arg0, arg1): 6612 try: 6613 if not arg0.__class__ is ast_node_list: 6614 arg0 = ast_node_list(arg0) 6615 except: 6616 raise 6617 exc_info = [None] 6618 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 6619 def cb_func(cb_arg0, cb_arg1): 6620 cb_arg0 = ast_node(ctx=arg0.ctx, ptr=(cb_arg0)) 6621 try: 6622 arg1(cb_arg0) 6623 except BaseException as e: 6624 exc_info[0] = e 6625 return -1 6626 return 0 6627 cb = fn(cb_func) 6628 ctx = arg0.ctx 6629 res = isl.isl_ast_node_list_foreach(arg0.ptr, cb, None) 6630 if exc_info[0] is not None: 6631 raise exc_info[0] 6632 if res < 0: 6633 raise 6634 def insert(arg0, arg1, arg2): 6635 try: 6636 if not arg0.__class__ is ast_node_list: 6637 arg0 = ast_node_list(arg0) 6638 except: 6639 raise 6640 try: 6641 if not arg2.__class__ is ast_node: 6642 arg2 = ast_node(arg2) 6643 except: 6644 raise 6645 ctx = arg0.ctx 6646 res = isl.isl_ast_node_list_insert(isl.isl_ast_node_list_copy(arg0.ptr), arg1, isl.isl_ast_node_copy(arg2.ptr)) 6647 obj = ast_node_list(ctx=ctx, ptr=res) 6648 return obj 6649 def size(arg0): 6650 try: 6651 if not arg0.__class__ is ast_node_list: 6652 arg0 = ast_node_list(arg0) 6653 except: 6654 raise 6655 ctx = arg0.ctx 6656 res = isl.isl_ast_node_list_size(arg0.ptr) 6657 if res < 0: 6658 raise 6659 return int(res) 6660 6661isl.isl_ast_node_list_alloc.restype = c_void_p 6662isl.isl_ast_node_list_alloc.argtypes = [Context, c_int] 6663isl.isl_ast_node_list_from_ast_node.restype = c_void_p 6664isl.isl_ast_node_list_from_ast_node.argtypes = [c_void_p] 6665isl.isl_ast_node_list_add.restype = c_void_p 6666isl.isl_ast_node_list_add.argtypes = [c_void_p, c_void_p] 6667isl.isl_ast_node_list_get_at.restype = c_void_p 6668isl.isl_ast_node_list_get_at.argtypes = [c_void_p, c_int] 6669isl.isl_ast_node_list_clear.restype = c_void_p 6670isl.isl_ast_node_list_clear.argtypes = [c_void_p] 6671isl.isl_ast_node_list_concat.restype = c_void_p 6672isl.isl_ast_node_list_concat.argtypes = [c_void_p, c_void_p] 6673isl.isl_ast_node_list_drop.restype = c_void_p 6674isl.isl_ast_node_list_drop.argtypes = [c_void_p, c_int, c_int] 6675isl.isl_ast_node_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 6676isl.isl_ast_node_list_insert.restype = c_void_p 6677isl.isl_ast_node_list_insert.argtypes = [c_void_p, c_int, c_void_p] 6678isl.isl_ast_node_list_size.argtypes = [c_void_p] 6679isl.isl_ast_node_list_copy.restype = c_void_p 6680isl.isl_ast_node_list_copy.argtypes = [c_void_p] 6681isl.isl_ast_node_list_free.restype = c_void_p 6682isl.isl_ast_node_list_free.argtypes = [c_void_p] 6683isl.isl_ast_node_list_to_str.restype = POINTER(c_char) 6684isl.isl_ast_node_list_to_str.argtypes = [c_void_p] 6685 6686class ast_node_mark(ast_node): 6687 def __init__(self, *args, **keywords): 6688 if "ptr" in keywords: 6689 self.ctx = keywords["ctx"] 6690 self.ptr = keywords["ptr"] 6691 return 6692 raise Error 6693 def __del__(self): 6694 if hasattr(self, 'ptr'): 6695 isl.isl_ast_node_free(self.ptr) 6696 def __new__(cls, *args, **keywords): 6697 return super(ast_node_mark, cls).__new__(cls) 6698 def __str__(arg0): 6699 try: 6700 if not arg0.__class__ is ast_node_mark: 6701 arg0 = ast_node_mark(arg0) 6702 except: 6703 raise 6704 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6705 res = cast(ptr, c_char_p).value.decode('ascii') 6706 libc.free(ptr) 6707 return res 6708 def __repr__(self): 6709 s = str(self) 6710 if '"' in s: 6711 return 'isl.ast_node_mark("""%s""")' % s 6712 else: 6713 return 'isl.ast_node_mark("%s")' % s 6714 def id(arg0): 6715 try: 6716 if not arg0.__class__ is ast_node: 6717 arg0 = ast_node(arg0) 6718 except: 6719 raise 6720 ctx = arg0.ctx 6721 res = isl.isl_ast_node_mark_get_id(arg0.ptr) 6722 obj = id(ctx=ctx, ptr=res) 6723 return obj 6724 def get_id(arg0): 6725 return arg0.id() 6726 def node(arg0): 6727 try: 6728 if not arg0.__class__ is ast_node: 6729 arg0 = ast_node(arg0) 6730 except: 6731 raise 6732 ctx = arg0.ctx 6733 res = isl.isl_ast_node_mark_get_node(arg0.ptr) 6734 obj = ast_node(ctx=ctx, ptr=res) 6735 return obj 6736 def get_node(arg0): 6737 return arg0.node() 6738 6739isl.isl_ast_node_mark_get_id.restype = c_void_p 6740isl.isl_ast_node_mark_get_id.argtypes = [c_void_p] 6741isl.isl_ast_node_mark_get_node.restype = c_void_p 6742isl.isl_ast_node_mark_get_node.argtypes = [c_void_p] 6743isl.isl_ast_node_copy.restype = c_void_p 6744isl.isl_ast_node_copy.argtypes = [c_void_p] 6745isl.isl_ast_node_free.restype = c_void_p 6746isl.isl_ast_node_free.argtypes = [c_void_p] 6747isl.isl_ast_node_to_str.restype = POINTER(c_char) 6748isl.isl_ast_node_to_str.argtypes = [c_void_p] 6749 6750class ast_node_user(ast_node): 6751 def __init__(self, *args, **keywords): 6752 if "ptr" in keywords: 6753 self.ctx = keywords["ctx"] 6754 self.ptr = keywords["ptr"] 6755 return 6756 raise Error 6757 def __del__(self): 6758 if hasattr(self, 'ptr'): 6759 isl.isl_ast_node_free(self.ptr) 6760 def __new__(cls, *args, **keywords): 6761 return super(ast_node_user, cls).__new__(cls) 6762 def __str__(arg0): 6763 try: 6764 if not arg0.__class__ is ast_node_user: 6765 arg0 = ast_node_user(arg0) 6766 except: 6767 raise 6768 ptr = isl.isl_ast_node_to_str(arg0.ptr) 6769 res = cast(ptr, c_char_p).value.decode('ascii') 6770 libc.free(ptr) 6771 return res 6772 def __repr__(self): 6773 s = str(self) 6774 if '"' in s: 6775 return 'isl.ast_node_user("""%s""")' % s 6776 else: 6777 return 'isl.ast_node_user("%s")' % s 6778 def expr(arg0): 6779 try: 6780 if not arg0.__class__ is ast_node: 6781 arg0 = ast_node(arg0) 6782 except: 6783 raise 6784 ctx = arg0.ctx 6785 res = isl.isl_ast_node_user_get_expr(arg0.ptr) 6786 obj = ast_expr(ctx=ctx, ptr=res) 6787 return obj 6788 def get_expr(arg0): 6789 return arg0.expr() 6790 6791isl.isl_ast_node_user_get_expr.restype = c_void_p 6792isl.isl_ast_node_user_get_expr.argtypes = [c_void_p] 6793isl.isl_ast_node_copy.restype = c_void_p 6794isl.isl_ast_node_copy.argtypes = [c_void_p] 6795isl.isl_ast_node_free.restype = c_void_p 6796isl.isl_ast_node_free.argtypes = [c_void_p] 6797isl.isl_ast_node_to_str.restype = POINTER(c_char) 6798isl.isl_ast_node_to_str.argtypes = [c_void_p] 6799 6800class union_map(object): 6801 def __init__(self, *args, **keywords): 6802 if "ptr" in keywords: 6803 self.ctx = keywords["ctx"] 6804 self.ptr = keywords["ptr"] 6805 return 6806 if len(args) == 1 and args[0].__class__ is basic_map: 6807 self.ctx = Context.getDefaultInstance() 6808 self.ptr = isl.isl_union_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 6809 return 6810 if len(args) == 1 and args[0].__class__ is map: 6811 self.ctx = Context.getDefaultInstance() 6812 self.ptr = isl.isl_union_map_from_map(isl.isl_map_copy(args[0].ptr)) 6813 return 6814 if len(args) == 1 and type(args[0]) == str: 6815 self.ctx = Context.getDefaultInstance() 6816 self.ptr = isl.isl_union_map_read_from_str(self.ctx, args[0].encode('ascii')) 6817 return 6818 raise Error 6819 def __del__(self): 6820 if hasattr(self, 'ptr'): 6821 isl.isl_union_map_free(self.ptr) 6822 def __str__(arg0): 6823 try: 6824 if not arg0.__class__ is union_map: 6825 arg0 = union_map(arg0) 6826 except: 6827 raise 6828 ptr = isl.isl_union_map_to_str(arg0.ptr) 6829 res = cast(ptr, c_char_p).value.decode('ascii') 6830 libc.free(ptr) 6831 return res 6832 def __repr__(self): 6833 s = str(self) 6834 if '"' in s: 6835 return 'isl.union_map("""%s""")' % s 6836 else: 6837 return 'isl.union_map("%s")' % s 6838 def affine_hull(arg0): 6839 try: 6840 if not arg0.__class__ is union_map: 6841 arg0 = union_map(arg0) 6842 except: 6843 raise 6844 ctx = arg0.ctx 6845 res = isl.isl_union_map_affine_hull(isl.isl_union_map_copy(arg0.ptr)) 6846 obj = union_map(ctx=ctx, ptr=res) 6847 return obj 6848 def apply_domain(arg0, arg1): 6849 try: 6850 if not arg0.__class__ is union_map: 6851 arg0 = union_map(arg0) 6852 except: 6853 raise 6854 try: 6855 if not arg1.__class__ is union_map: 6856 arg1 = union_map(arg1) 6857 except: 6858 raise 6859 ctx = arg0.ctx 6860 res = isl.isl_union_map_apply_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6861 obj = union_map(ctx=ctx, ptr=res) 6862 return obj 6863 def apply_range(arg0, arg1): 6864 try: 6865 if not arg0.__class__ is union_map: 6866 arg0 = union_map(arg0) 6867 except: 6868 raise 6869 try: 6870 if not arg1.__class__ is union_map: 6871 arg1 = union_map(arg1) 6872 except: 6873 raise 6874 ctx = arg0.ctx 6875 res = isl.isl_union_map_apply_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 6876 obj = union_map(ctx=ctx, ptr=res) 6877 return obj 6878 def as_map(arg0): 6879 try: 6880 if not arg0.__class__ is union_map: 6881 arg0 = union_map(arg0) 6882 except: 6883 raise 6884 ctx = arg0.ctx 6885 res = isl.isl_union_map_as_map(isl.isl_union_map_copy(arg0.ptr)) 6886 obj = map(ctx=ctx, ptr=res) 6887 return obj 6888 def as_multi_union_pw_aff(arg0): 6889 try: 6890 if not arg0.__class__ is union_map: 6891 arg0 = union_map(arg0) 6892 except: 6893 raise 6894 ctx = arg0.ctx 6895 res = isl.isl_union_map_as_multi_union_pw_aff(isl.isl_union_map_copy(arg0.ptr)) 6896 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 6897 return obj 6898 def as_union_pw_multi_aff(arg0): 6899 try: 6900 if not arg0.__class__ is union_map: 6901 arg0 = union_map(arg0) 6902 except: 6903 raise 6904 ctx = arg0.ctx 6905 res = isl.isl_union_map_as_union_pw_multi_aff(isl.isl_union_map_copy(arg0.ptr)) 6906 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 6907 return obj 6908 def bind_range(arg0, arg1): 6909 try: 6910 if not arg0.__class__ is union_map: 6911 arg0 = union_map(arg0) 6912 except: 6913 raise 6914 try: 6915 if not arg1.__class__ is multi_id: 6916 arg1 = multi_id(arg1) 6917 except: 6918 raise 6919 ctx = arg0.ctx 6920 res = isl.isl_union_map_bind_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 6921 obj = union_set(ctx=ctx, ptr=res) 6922 return obj 6923 def coalesce(arg0): 6924 try: 6925 if not arg0.__class__ is union_map: 6926 arg0 = union_map(arg0) 6927 except: 6928 raise 6929 ctx = arg0.ctx 6930 res = isl.isl_union_map_coalesce(isl.isl_union_map_copy(arg0.ptr)) 6931 obj = union_map(ctx=ctx, ptr=res) 6932 return obj 6933 def compute_divs(arg0): 6934 try: 6935 if not arg0.__class__ is union_map: 6936 arg0 = union_map(arg0) 6937 except: 6938 raise 6939 ctx = arg0.ctx 6940 res = isl.isl_union_map_compute_divs(isl.isl_union_map_copy(arg0.ptr)) 6941 obj = union_map(ctx=ctx, ptr=res) 6942 return obj 6943 def curry(arg0): 6944 try: 6945 if not arg0.__class__ is union_map: 6946 arg0 = union_map(arg0) 6947 except: 6948 raise 6949 ctx = arg0.ctx 6950 res = isl.isl_union_map_curry(isl.isl_union_map_copy(arg0.ptr)) 6951 obj = union_map(ctx=ctx, ptr=res) 6952 return obj 6953 def deltas(arg0): 6954 try: 6955 if not arg0.__class__ is union_map: 6956 arg0 = union_map(arg0) 6957 except: 6958 raise 6959 ctx = arg0.ctx 6960 res = isl.isl_union_map_deltas(isl.isl_union_map_copy(arg0.ptr)) 6961 obj = union_set(ctx=ctx, ptr=res) 6962 return obj 6963 def detect_equalities(arg0): 6964 try: 6965 if not arg0.__class__ is union_map: 6966 arg0 = union_map(arg0) 6967 except: 6968 raise 6969 ctx = arg0.ctx 6970 res = isl.isl_union_map_detect_equalities(isl.isl_union_map_copy(arg0.ptr)) 6971 obj = union_map(ctx=ctx, ptr=res) 6972 return obj 6973 def domain(arg0): 6974 try: 6975 if not arg0.__class__ is union_map: 6976 arg0 = union_map(arg0) 6977 except: 6978 raise 6979 ctx = arg0.ctx 6980 res = isl.isl_union_map_domain(isl.isl_union_map_copy(arg0.ptr)) 6981 obj = union_set(ctx=ctx, ptr=res) 6982 return obj 6983 def domain_factor_domain(arg0): 6984 try: 6985 if not arg0.__class__ is union_map: 6986 arg0 = union_map(arg0) 6987 except: 6988 raise 6989 ctx = arg0.ctx 6990 res = isl.isl_union_map_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 6991 obj = union_map(ctx=ctx, ptr=res) 6992 return obj 6993 def domain_factor_range(arg0): 6994 try: 6995 if not arg0.__class__ is union_map: 6996 arg0 = union_map(arg0) 6997 except: 6998 raise 6999 ctx = arg0.ctx 7000 res = isl.isl_union_map_domain_factor_range(isl.isl_union_map_copy(arg0.ptr)) 7001 obj = union_map(ctx=ctx, ptr=res) 7002 return obj 7003 def domain_map(arg0): 7004 try: 7005 if not arg0.__class__ is union_map: 7006 arg0 = union_map(arg0) 7007 except: 7008 raise 7009 ctx = arg0.ctx 7010 res = isl.isl_union_map_domain_map(isl.isl_union_map_copy(arg0.ptr)) 7011 obj = union_map(ctx=ctx, ptr=res) 7012 return obj 7013 def domain_map_union_pw_multi_aff(arg0): 7014 try: 7015 if not arg0.__class__ is union_map: 7016 arg0 = union_map(arg0) 7017 except: 7018 raise 7019 ctx = arg0.ctx 7020 res = isl.isl_union_map_domain_map_union_pw_multi_aff(isl.isl_union_map_copy(arg0.ptr)) 7021 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 7022 return obj 7023 def domain_product(arg0, arg1): 7024 try: 7025 if not arg0.__class__ is union_map: 7026 arg0 = union_map(arg0) 7027 except: 7028 raise 7029 try: 7030 if not arg1.__class__ is union_map: 7031 arg1 = union_map(arg1) 7032 except: 7033 raise 7034 ctx = arg0.ctx 7035 res = isl.isl_union_map_domain_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7036 obj = union_map(ctx=ctx, ptr=res) 7037 return obj 7038 @staticmethod 7039 def empty(*args): 7040 if len(args) == 0: 7041 ctx = Context.getDefaultInstance() 7042 res = isl.isl_union_map_empty_ctx(ctx) 7043 obj = union_map(ctx=ctx, ptr=res) 7044 return obj 7045 raise Error 7046 def eq_at(*args): 7047 if len(args) == 2 and args[1].__class__ is multi_union_pw_aff: 7048 ctx = args[0].ctx 7049 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)) 7050 obj = union_map(ctx=ctx, ptr=res) 7051 return obj 7052 raise Error 7053 def every_map(arg0, arg1): 7054 try: 7055 if not arg0.__class__ is union_map: 7056 arg0 = union_map(arg0) 7057 except: 7058 raise 7059 exc_info = [None] 7060 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7061 def cb_func(cb_arg0, cb_arg1): 7062 cb_arg0 = map(ctx=arg0.ctx, ptr=isl.isl_map_copy(cb_arg0)) 7063 try: 7064 res = arg1(cb_arg0) 7065 except BaseException as e: 7066 exc_info[0] = e 7067 return -1 7068 return 1 if res else 0 7069 cb = fn(cb_func) 7070 ctx = arg0.ctx 7071 res = isl.isl_union_map_every_map(arg0.ptr, cb, None) 7072 if exc_info[0] is not None: 7073 raise exc_info[0] 7074 if res < 0: 7075 raise 7076 return bool(res) 7077 def extract_map(arg0, arg1): 7078 try: 7079 if not arg0.__class__ is union_map: 7080 arg0 = union_map(arg0) 7081 except: 7082 raise 7083 try: 7084 if not arg1.__class__ is space: 7085 arg1 = space(arg1) 7086 except: 7087 raise 7088 ctx = arg0.ctx 7089 res = isl.isl_union_map_extract_map(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 7090 obj = map(ctx=ctx, ptr=res) 7091 return obj 7092 def factor_domain(arg0): 7093 try: 7094 if not arg0.__class__ is union_map: 7095 arg0 = union_map(arg0) 7096 except: 7097 raise 7098 ctx = arg0.ctx 7099 res = isl.isl_union_map_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 7100 obj = union_map(ctx=ctx, ptr=res) 7101 return obj 7102 def factor_range(arg0): 7103 try: 7104 if not arg0.__class__ is union_map: 7105 arg0 = union_map(arg0) 7106 except: 7107 raise 7108 ctx = arg0.ctx 7109 res = isl.isl_union_map_factor_range(isl.isl_union_map_copy(arg0.ptr)) 7110 obj = union_map(ctx=ctx, ptr=res) 7111 return obj 7112 def fixed_power(*args): 7113 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 7114 args = list(args) 7115 try: 7116 if not args[1].__class__ is val: 7117 args[1] = val(args[1]) 7118 except: 7119 raise 7120 ctx = args[0].ctx 7121 res = isl.isl_union_map_fixed_power_val(isl.isl_union_map_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 7122 obj = union_map(ctx=ctx, ptr=res) 7123 return obj 7124 raise Error 7125 def foreach_map(arg0, arg1): 7126 try: 7127 if not arg0.__class__ is union_map: 7128 arg0 = union_map(arg0) 7129 except: 7130 raise 7131 exc_info = [None] 7132 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 7133 def cb_func(cb_arg0, cb_arg1): 7134 cb_arg0 = map(ctx=arg0.ctx, ptr=(cb_arg0)) 7135 try: 7136 arg1(cb_arg0) 7137 except BaseException as e: 7138 exc_info[0] = e 7139 return -1 7140 return 0 7141 cb = fn(cb_func) 7142 ctx = arg0.ctx 7143 res = isl.isl_union_map_foreach_map(arg0.ptr, cb, None) 7144 if exc_info[0] is not None: 7145 raise exc_info[0] 7146 if res < 0: 7147 raise 7148 @staticmethod 7149 def convert_from(*args): 7150 if len(args) == 1 and args[0].__class__ is multi_union_pw_aff: 7151 ctx = args[0].ctx 7152 res = isl.isl_union_map_from_multi_union_pw_aff(isl.isl_multi_union_pw_aff_copy(args[0].ptr)) 7153 obj = union_map(ctx=ctx, ptr=res) 7154 return obj 7155 if len(args) == 1 and args[0].__class__ is union_pw_multi_aff: 7156 ctx = args[0].ctx 7157 res = isl.isl_union_map_from_union_pw_multi_aff(isl.isl_union_pw_multi_aff_copy(args[0].ptr)) 7158 obj = union_map(ctx=ctx, ptr=res) 7159 return obj 7160 raise Error 7161 @staticmethod 7162 def from_domain(arg0): 7163 try: 7164 if not arg0.__class__ is union_set: 7165 arg0 = union_set(arg0) 7166 except: 7167 raise 7168 ctx = arg0.ctx 7169 res = isl.isl_union_map_from_domain(isl.isl_union_set_copy(arg0.ptr)) 7170 obj = union_map(ctx=ctx, ptr=res) 7171 return obj 7172 @staticmethod 7173 def from_domain_and_range(arg0, arg1): 7174 try: 7175 if not arg0.__class__ is union_set: 7176 arg0 = union_set(arg0) 7177 except: 7178 raise 7179 try: 7180 if not arg1.__class__ is union_set: 7181 arg1 = union_set(arg1) 7182 except: 7183 raise 7184 ctx = arg0.ctx 7185 res = isl.isl_union_map_from_domain_and_range(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7186 obj = union_map(ctx=ctx, ptr=res) 7187 return obj 7188 @staticmethod 7189 def from_range(arg0): 7190 try: 7191 if not arg0.__class__ is union_set: 7192 arg0 = union_set(arg0) 7193 except: 7194 raise 7195 ctx = arg0.ctx 7196 res = isl.isl_union_map_from_range(isl.isl_union_set_copy(arg0.ptr)) 7197 obj = union_map(ctx=ctx, ptr=res) 7198 return obj 7199 def gist(arg0, arg1): 7200 try: 7201 if not arg0.__class__ is union_map: 7202 arg0 = union_map(arg0) 7203 except: 7204 raise 7205 try: 7206 if not arg1.__class__ is union_map: 7207 arg1 = union_map(arg1) 7208 except: 7209 raise 7210 ctx = arg0.ctx 7211 res = isl.isl_union_map_gist(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7212 obj = union_map(ctx=ctx, ptr=res) 7213 return obj 7214 def gist_domain(arg0, arg1): 7215 try: 7216 if not arg0.__class__ is union_map: 7217 arg0 = union_map(arg0) 7218 except: 7219 raise 7220 try: 7221 if not arg1.__class__ is union_set: 7222 arg1 = union_set(arg1) 7223 except: 7224 raise 7225 ctx = arg0.ctx 7226 res = isl.isl_union_map_gist_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7227 obj = union_map(ctx=ctx, ptr=res) 7228 return obj 7229 def gist_params(arg0, arg1): 7230 try: 7231 if not arg0.__class__ is union_map: 7232 arg0 = union_map(arg0) 7233 except: 7234 raise 7235 try: 7236 if not arg1.__class__ is set: 7237 arg1 = set(arg1) 7238 except: 7239 raise 7240 ctx = arg0.ctx 7241 res = isl.isl_union_map_gist_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7242 obj = union_map(ctx=ctx, ptr=res) 7243 return obj 7244 def gist_range(arg0, arg1): 7245 try: 7246 if not arg0.__class__ is union_map: 7247 arg0 = union_map(arg0) 7248 except: 7249 raise 7250 try: 7251 if not arg1.__class__ is union_set: 7252 arg1 = union_set(arg1) 7253 except: 7254 raise 7255 ctx = arg0.ctx 7256 res = isl.isl_union_map_gist_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7257 obj = union_map(ctx=ctx, ptr=res) 7258 return obj 7259 def intersect(arg0, arg1): 7260 try: 7261 if not arg0.__class__ is union_map: 7262 arg0 = union_map(arg0) 7263 except: 7264 raise 7265 try: 7266 if not arg1.__class__ is union_map: 7267 arg1 = union_map(arg1) 7268 except: 7269 raise 7270 ctx = arg0.ctx 7271 res = isl.isl_union_map_intersect(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7272 obj = union_map(ctx=ctx, ptr=res) 7273 return obj 7274 def intersect_domain(*args): 7275 if len(args) == 2 and args[1].__class__ is space: 7276 ctx = args[0].ctx 7277 res = isl.isl_union_map_intersect_domain_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 7278 obj = union_map(ctx=ctx, ptr=res) 7279 return obj 7280 if len(args) == 2 and args[1].__class__ is union_set: 7281 ctx = args[0].ctx 7282 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)) 7283 obj = union_map(ctx=ctx, ptr=res) 7284 return obj 7285 raise Error 7286 def intersect_domain_factor_domain(arg0, arg1): 7287 try: 7288 if not arg0.__class__ is union_map: 7289 arg0 = union_map(arg0) 7290 except: 7291 raise 7292 try: 7293 if not arg1.__class__ is union_map: 7294 arg1 = union_map(arg1) 7295 except: 7296 raise 7297 ctx = arg0.ctx 7298 res = isl.isl_union_map_intersect_domain_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7299 obj = union_map(ctx=ctx, ptr=res) 7300 return obj 7301 def intersect_domain_factor_range(arg0, arg1): 7302 try: 7303 if not arg0.__class__ is union_map: 7304 arg0 = union_map(arg0) 7305 except: 7306 raise 7307 try: 7308 if not arg1.__class__ is union_map: 7309 arg1 = union_map(arg1) 7310 except: 7311 raise 7312 ctx = arg0.ctx 7313 res = isl.isl_union_map_intersect_domain_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7314 obj = union_map(ctx=ctx, ptr=res) 7315 return obj 7316 def intersect_params(arg0, arg1): 7317 try: 7318 if not arg0.__class__ is union_map: 7319 arg0 = union_map(arg0) 7320 except: 7321 raise 7322 try: 7323 if not arg1.__class__ is set: 7324 arg1 = set(arg1) 7325 except: 7326 raise 7327 ctx = arg0.ctx 7328 res = isl.isl_union_map_intersect_params(isl.isl_union_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 7329 obj = union_map(ctx=ctx, ptr=res) 7330 return obj 7331 def intersect_range(*args): 7332 if len(args) == 2 and args[1].__class__ is space: 7333 ctx = args[0].ctx 7334 res = isl.isl_union_map_intersect_range_space(isl.isl_union_map_copy(args[0].ptr), isl.isl_space_copy(args[1].ptr)) 7335 obj = union_map(ctx=ctx, ptr=res) 7336 return obj 7337 if len(args) == 2 and args[1].__class__ is union_set: 7338 ctx = args[0].ctx 7339 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)) 7340 obj = union_map(ctx=ctx, ptr=res) 7341 return obj 7342 raise Error 7343 def intersect_range_factor_domain(arg0, arg1): 7344 try: 7345 if not arg0.__class__ is union_map: 7346 arg0 = union_map(arg0) 7347 except: 7348 raise 7349 try: 7350 if not arg1.__class__ is union_map: 7351 arg1 = union_map(arg1) 7352 except: 7353 raise 7354 ctx = arg0.ctx 7355 res = isl.isl_union_map_intersect_range_factor_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7356 obj = union_map(ctx=ctx, ptr=res) 7357 return obj 7358 def intersect_range_factor_range(arg0, arg1): 7359 try: 7360 if not arg0.__class__ is union_map: 7361 arg0 = union_map(arg0) 7362 except: 7363 raise 7364 try: 7365 if not arg1.__class__ is union_map: 7366 arg1 = union_map(arg1) 7367 except: 7368 raise 7369 ctx = arg0.ctx 7370 res = isl.isl_union_map_intersect_range_factor_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7371 obj = union_map(ctx=ctx, ptr=res) 7372 return obj 7373 def is_bijective(arg0): 7374 try: 7375 if not arg0.__class__ is union_map: 7376 arg0 = union_map(arg0) 7377 except: 7378 raise 7379 ctx = arg0.ctx 7380 res = isl.isl_union_map_is_bijective(arg0.ptr) 7381 if res < 0: 7382 raise 7383 return bool(res) 7384 def is_disjoint(arg0, arg1): 7385 try: 7386 if not arg0.__class__ is union_map: 7387 arg0 = union_map(arg0) 7388 except: 7389 raise 7390 try: 7391 if not arg1.__class__ is union_map: 7392 arg1 = union_map(arg1) 7393 except: 7394 raise 7395 ctx = arg0.ctx 7396 res = isl.isl_union_map_is_disjoint(arg0.ptr, arg1.ptr) 7397 if res < 0: 7398 raise 7399 return bool(res) 7400 def is_empty(arg0): 7401 try: 7402 if not arg0.__class__ is union_map: 7403 arg0 = union_map(arg0) 7404 except: 7405 raise 7406 ctx = arg0.ctx 7407 res = isl.isl_union_map_is_empty(arg0.ptr) 7408 if res < 0: 7409 raise 7410 return bool(res) 7411 def is_equal(arg0, arg1): 7412 try: 7413 if not arg0.__class__ is union_map: 7414 arg0 = union_map(arg0) 7415 except: 7416 raise 7417 try: 7418 if not arg1.__class__ is union_map: 7419 arg1 = union_map(arg1) 7420 except: 7421 raise 7422 ctx = arg0.ctx 7423 res = isl.isl_union_map_is_equal(arg0.ptr, arg1.ptr) 7424 if res < 0: 7425 raise 7426 return bool(res) 7427 def is_injective(arg0): 7428 try: 7429 if not arg0.__class__ is union_map: 7430 arg0 = union_map(arg0) 7431 except: 7432 raise 7433 ctx = arg0.ctx 7434 res = isl.isl_union_map_is_injective(arg0.ptr) 7435 if res < 0: 7436 raise 7437 return bool(res) 7438 def is_single_valued(arg0): 7439 try: 7440 if not arg0.__class__ is union_map: 7441 arg0 = union_map(arg0) 7442 except: 7443 raise 7444 ctx = arg0.ctx 7445 res = isl.isl_union_map_is_single_valued(arg0.ptr) 7446 if res < 0: 7447 raise 7448 return bool(res) 7449 def is_strict_subset(arg0, arg1): 7450 try: 7451 if not arg0.__class__ is union_map: 7452 arg0 = union_map(arg0) 7453 except: 7454 raise 7455 try: 7456 if not arg1.__class__ is union_map: 7457 arg1 = union_map(arg1) 7458 except: 7459 raise 7460 ctx = arg0.ctx 7461 res = isl.isl_union_map_is_strict_subset(arg0.ptr, arg1.ptr) 7462 if res < 0: 7463 raise 7464 return bool(res) 7465 def is_subset(arg0, arg1): 7466 try: 7467 if not arg0.__class__ is union_map: 7468 arg0 = union_map(arg0) 7469 except: 7470 raise 7471 try: 7472 if not arg1.__class__ is union_map: 7473 arg1 = union_map(arg1) 7474 except: 7475 raise 7476 ctx = arg0.ctx 7477 res = isl.isl_union_map_is_subset(arg0.ptr, arg1.ptr) 7478 if res < 0: 7479 raise 7480 return bool(res) 7481 def isa_map(arg0): 7482 try: 7483 if not arg0.__class__ is union_map: 7484 arg0 = union_map(arg0) 7485 except: 7486 raise 7487 ctx = arg0.ctx 7488 res = isl.isl_union_map_isa_map(arg0.ptr) 7489 if res < 0: 7490 raise 7491 return bool(res) 7492 def lexmax(arg0): 7493 try: 7494 if not arg0.__class__ is union_map: 7495 arg0 = union_map(arg0) 7496 except: 7497 raise 7498 ctx = arg0.ctx 7499 res = isl.isl_union_map_lexmax(isl.isl_union_map_copy(arg0.ptr)) 7500 obj = union_map(ctx=ctx, ptr=res) 7501 return obj 7502 def lexmin(arg0): 7503 try: 7504 if not arg0.__class__ is union_map: 7505 arg0 = union_map(arg0) 7506 except: 7507 raise 7508 ctx = arg0.ctx 7509 res = isl.isl_union_map_lexmin(isl.isl_union_map_copy(arg0.ptr)) 7510 obj = union_map(ctx=ctx, ptr=res) 7511 return obj 7512 def map_list(arg0): 7513 try: 7514 if not arg0.__class__ is union_map: 7515 arg0 = union_map(arg0) 7516 except: 7517 raise 7518 ctx = arg0.ctx 7519 res = isl.isl_union_map_get_map_list(arg0.ptr) 7520 obj = map_list(ctx=ctx, ptr=res) 7521 return obj 7522 def get_map_list(arg0): 7523 return arg0.map_list() 7524 def polyhedral_hull(arg0): 7525 try: 7526 if not arg0.__class__ is union_map: 7527 arg0 = union_map(arg0) 7528 except: 7529 raise 7530 ctx = arg0.ctx 7531 res = isl.isl_union_map_polyhedral_hull(isl.isl_union_map_copy(arg0.ptr)) 7532 obj = union_map(ctx=ctx, ptr=res) 7533 return obj 7534 def preimage_domain(*args): 7535 if len(args) == 2 and args[1].__class__ is multi_aff: 7536 ctx = args[0].ctx 7537 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)) 7538 obj = union_map(ctx=ctx, ptr=res) 7539 return obj 7540 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 7541 ctx = args[0].ctx 7542 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)) 7543 obj = union_map(ctx=ctx, ptr=res) 7544 return obj 7545 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 7546 ctx = args[0].ctx 7547 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)) 7548 obj = union_map(ctx=ctx, ptr=res) 7549 return obj 7550 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 7551 ctx = args[0].ctx 7552 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)) 7553 obj = union_map(ctx=ctx, ptr=res) 7554 return obj 7555 raise Error 7556 def preimage_range(*args): 7557 if len(args) == 2 and args[1].__class__ is multi_aff: 7558 ctx = args[0].ctx 7559 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)) 7560 obj = union_map(ctx=ctx, ptr=res) 7561 return obj 7562 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 7563 ctx = args[0].ctx 7564 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)) 7565 obj = union_map(ctx=ctx, ptr=res) 7566 return obj 7567 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 7568 ctx = args[0].ctx 7569 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)) 7570 obj = union_map(ctx=ctx, ptr=res) 7571 return obj 7572 raise Error 7573 def product(arg0, arg1): 7574 try: 7575 if not arg0.__class__ is union_map: 7576 arg0 = union_map(arg0) 7577 except: 7578 raise 7579 try: 7580 if not arg1.__class__ is union_map: 7581 arg1 = union_map(arg1) 7582 except: 7583 raise 7584 ctx = arg0.ctx 7585 res = isl.isl_union_map_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7586 obj = union_map(ctx=ctx, ptr=res) 7587 return obj 7588 def project_out_all_params(arg0): 7589 try: 7590 if not arg0.__class__ is union_map: 7591 arg0 = union_map(arg0) 7592 except: 7593 raise 7594 ctx = arg0.ctx 7595 res = isl.isl_union_map_project_out_all_params(isl.isl_union_map_copy(arg0.ptr)) 7596 obj = union_map(ctx=ctx, ptr=res) 7597 return obj 7598 def range(arg0): 7599 try: 7600 if not arg0.__class__ is union_map: 7601 arg0 = union_map(arg0) 7602 except: 7603 raise 7604 ctx = arg0.ctx 7605 res = isl.isl_union_map_range(isl.isl_union_map_copy(arg0.ptr)) 7606 obj = union_set(ctx=ctx, ptr=res) 7607 return obj 7608 def range_factor_domain(arg0): 7609 try: 7610 if not arg0.__class__ is union_map: 7611 arg0 = union_map(arg0) 7612 except: 7613 raise 7614 ctx = arg0.ctx 7615 res = isl.isl_union_map_range_factor_domain(isl.isl_union_map_copy(arg0.ptr)) 7616 obj = union_map(ctx=ctx, ptr=res) 7617 return obj 7618 def range_factor_range(arg0): 7619 try: 7620 if not arg0.__class__ is union_map: 7621 arg0 = union_map(arg0) 7622 except: 7623 raise 7624 ctx = arg0.ctx 7625 res = isl.isl_union_map_range_factor_range(isl.isl_union_map_copy(arg0.ptr)) 7626 obj = union_map(ctx=ctx, ptr=res) 7627 return obj 7628 def range_map(arg0): 7629 try: 7630 if not arg0.__class__ is union_map: 7631 arg0 = union_map(arg0) 7632 except: 7633 raise 7634 ctx = arg0.ctx 7635 res = isl.isl_union_map_range_map(isl.isl_union_map_copy(arg0.ptr)) 7636 obj = union_map(ctx=ctx, ptr=res) 7637 return obj 7638 def range_product(arg0, arg1): 7639 try: 7640 if not arg0.__class__ is union_map: 7641 arg0 = union_map(arg0) 7642 except: 7643 raise 7644 try: 7645 if not arg1.__class__ is union_map: 7646 arg1 = union_map(arg1) 7647 except: 7648 raise 7649 ctx = arg0.ctx 7650 res = isl.isl_union_map_range_product(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7651 obj = union_map(ctx=ctx, ptr=res) 7652 return obj 7653 def range_reverse(arg0): 7654 try: 7655 if not arg0.__class__ is union_map: 7656 arg0 = union_map(arg0) 7657 except: 7658 raise 7659 ctx = arg0.ctx 7660 res = isl.isl_union_map_range_reverse(isl.isl_union_map_copy(arg0.ptr)) 7661 obj = union_map(ctx=ctx, ptr=res) 7662 return obj 7663 def reverse(arg0): 7664 try: 7665 if not arg0.__class__ is union_map: 7666 arg0 = union_map(arg0) 7667 except: 7668 raise 7669 ctx = arg0.ctx 7670 res = isl.isl_union_map_reverse(isl.isl_union_map_copy(arg0.ptr)) 7671 obj = union_map(ctx=ctx, ptr=res) 7672 return obj 7673 def space(arg0): 7674 try: 7675 if not arg0.__class__ is union_map: 7676 arg0 = union_map(arg0) 7677 except: 7678 raise 7679 ctx = arg0.ctx 7680 res = isl.isl_union_map_get_space(arg0.ptr) 7681 obj = space(ctx=ctx, ptr=res) 7682 return obj 7683 def get_space(arg0): 7684 return arg0.space() 7685 def subtract(arg0, arg1): 7686 try: 7687 if not arg0.__class__ is union_map: 7688 arg0 = union_map(arg0) 7689 except: 7690 raise 7691 try: 7692 if not arg1.__class__ is union_map: 7693 arg1 = union_map(arg1) 7694 except: 7695 raise 7696 ctx = arg0.ctx 7697 res = isl.isl_union_map_subtract(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7698 obj = union_map(ctx=ctx, ptr=res) 7699 return obj 7700 def subtract_domain(arg0, arg1): 7701 try: 7702 if not arg0.__class__ is union_map: 7703 arg0 = union_map(arg0) 7704 except: 7705 raise 7706 try: 7707 if not arg1.__class__ is union_set: 7708 arg1 = union_set(arg1) 7709 except: 7710 raise 7711 ctx = arg0.ctx 7712 res = isl.isl_union_map_subtract_domain(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7713 obj = union_map(ctx=ctx, ptr=res) 7714 return obj 7715 def subtract_range(arg0, arg1): 7716 try: 7717 if not arg0.__class__ is union_map: 7718 arg0 = union_map(arg0) 7719 except: 7720 raise 7721 try: 7722 if not arg1.__class__ is union_set: 7723 arg1 = union_set(arg1) 7724 except: 7725 raise 7726 ctx = arg0.ctx 7727 res = isl.isl_union_map_subtract_range(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 7728 obj = union_map(ctx=ctx, ptr=res) 7729 return obj 7730 def uncurry(arg0): 7731 try: 7732 if not arg0.__class__ is union_map: 7733 arg0 = union_map(arg0) 7734 except: 7735 raise 7736 ctx = arg0.ctx 7737 res = isl.isl_union_map_uncurry(isl.isl_union_map_copy(arg0.ptr)) 7738 obj = union_map(ctx=ctx, ptr=res) 7739 return obj 7740 def union(arg0, arg1): 7741 try: 7742 if not arg0.__class__ is union_map: 7743 arg0 = union_map(arg0) 7744 except: 7745 raise 7746 try: 7747 if not arg1.__class__ is union_map: 7748 arg1 = union_map(arg1) 7749 except: 7750 raise 7751 ctx = arg0.ctx 7752 res = isl.isl_union_map_union(isl.isl_union_map_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 7753 obj = union_map(ctx=ctx, ptr=res) 7754 return obj 7755 def universe(arg0): 7756 try: 7757 if not arg0.__class__ is union_map: 7758 arg0 = union_map(arg0) 7759 except: 7760 raise 7761 ctx = arg0.ctx 7762 res = isl.isl_union_map_universe(isl.isl_union_map_copy(arg0.ptr)) 7763 obj = union_map(ctx=ctx, ptr=res) 7764 return obj 7765 def wrap(arg0): 7766 try: 7767 if not arg0.__class__ is union_map: 7768 arg0 = union_map(arg0) 7769 except: 7770 raise 7771 ctx = arg0.ctx 7772 res = isl.isl_union_map_wrap(isl.isl_union_map_copy(arg0.ptr)) 7773 obj = union_set(ctx=ctx, ptr=res) 7774 return obj 7775 def zip(arg0): 7776 try: 7777 if not arg0.__class__ is union_map: 7778 arg0 = union_map(arg0) 7779 except: 7780 raise 7781 ctx = arg0.ctx 7782 res = isl.isl_union_map_zip(isl.isl_union_map_copy(arg0.ptr)) 7783 obj = union_map(ctx=ctx, ptr=res) 7784 return obj 7785 7786isl.isl_union_map_from_basic_map.restype = c_void_p 7787isl.isl_union_map_from_basic_map.argtypes = [c_void_p] 7788isl.isl_union_map_from_map.restype = c_void_p 7789isl.isl_union_map_from_map.argtypes = [c_void_p] 7790isl.isl_union_map_read_from_str.restype = c_void_p 7791isl.isl_union_map_read_from_str.argtypes = [Context, c_char_p] 7792isl.isl_union_map_affine_hull.restype = c_void_p 7793isl.isl_union_map_affine_hull.argtypes = [c_void_p] 7794isl.isl_union_map_apply_domain.restype = c_void_p 7795isl.isl_union_map_apply_domain.argtypes = [c_void_p, c_void_p] 7796isl.isl_union_map_apply_range.restype = c_void_p 7797isl.isl_union_map_apply_range.argtypes = [c_void_p, c_void_p] 7798isl.isl_union_map_as_map.restype = c_void_p 7799isl.isl_union_map_as_map.argtypes = [c_void_p] 7800isl.isl_union_map_as_multi_union_pw_aff.restype = c_void_p 7801isl.isl_union_map_as_multi_union_pw_aff.argtypes = [c_void_p] 7802isl.isl_union_map_as_union_pw_multi_aff.restype = c_void_p 7803isl.isl_union_map_as_union_pw_multi_aff.argtypes = [c_void_p] 7804isl.isl_union_map_bind_range.restype = c_void_p 7805isl.isl_union_map_bind_range.argtypes = [c_void_p, c_void_p] 7806isl.isl_union_map_coalesce.restype = c_void_p 7807isl.isl_union_map_coalesce.argtypes = [c_void_p] 7808isl.isl_union_map_compute_divs.restype = c_void_p 7809isl.isl_union_map_compute_divs.argtypes = [c_void_p] 7810isl.isl_union_map_curry.restype = c_void_p 7811isl.isl_union_map_curry.argtypes = [c_void_p] 7812isl.isl_union_map_deltas.restype = c_void_p 7813isl.isl_union_map_deltas.argtypes = [c_void_p] 7814isl.isl_union_map_detect_equalities.restype = c_void_p 7815isl.isl_union_map_detect_equalities.argtypes = [c_void_p] 7816isl.isl_union_map_domain.restype = c_void_p 7817isl.isl_union_map_domain.argtypes = [c_void_p] 7818isl.isl_union_map_domain_factor_domain.restype = c_void_p 7819isl.isl_union_map_domain_factor_domain.argtypes = [c_void_p] 7820isl.isl_union_map_domain_factor_range.restype = c_void_p 7821isl.isl_union_map_domain_factor_range.argtypes = [c_void_p] 7822isl.isl_union_map_domain_map.restype = c_void_p 7823isl.isl_union_map_domain_map.argtypes = [c_void_p] 7824isl.isl_union_map_domain_map_union_pw_multi_aff.restype = c_void_p 7825isl.isl_union_map_domain_map_union_pw_multi_aff.argtypes = [c_void_p] 7826isl.isl_union_map_domain_product.restype = c_void_p 7827isl.isl_union_map_domain_product.argtypes = [c_void_p, c_void_p] 7828isl.isl_union_map_empty_ctx.restype = c_void_p 7829isl.isl_union_map_empty_ctx.argtypes = [Context] 7830isl.isl_union_map_eq_at_multi_union_pw_aff.restype = c_void_p 7831isl.isl_union_map_eq_at_multi_union_pw_aff.argtypes = [c_void_p, c_void_p] 7832isl.isl_union_map_every_map.argtypes = [c_void_p, c_void_p, c_void_p] 7833isl.isl_union_map_extract_map.restype = c_void_p 7834isl.isl_union_map_extract_map.argtypes = [c_void_p, c_void_p] 7835isl.isl_union_map_factor_domain.restype = c_void_p 7836isl.isl_union_map_factor_domain.argtypes = [c_void_p] 7837isl.isl_union_map_factor_range.restype = c_void_p 7838isl.isl_union_map_factor_range.argtypes = [c_void_p] 7839isl.isl_union_map_fixed_power_val.restype = c_void_p 7840isl.isl_union_map_fixed_power_val.argtypes = [c_void_p, c_void_p] 7841isl.isl_union_map_foreach_map.argtypes = [c_void_p, c_void_p, c_void_p] 7842isl.isl_union_map_from_multi_union_pw_aff.restype = c_void_p 7843isl.isl_union_map_from_multi_union_pw_aff.argtypes = [c_void_p] 7844isl.isl_union_map_from_union_pw_multi_aff.restype = c_void_p 7845isl.isl_union_map_from_union_pw_multi_aff.argtypes = [c_void_p] 7846isl.isl_union_map_from_domain.restype = c_void_p 7847isl.isl_union_map_from_domain.argtypes = [c_void_p] 7848isl.isl_union_map_from_domain_and_range.restype = c_void_p 7849isl.isl_union_map_from_domain_and_range.argtypes = [c_void_p, c_void_p] 7850isl.isl_union_map_from_range.restype = c_void_p 7851isl.isl_union_map_from_range.argtypes = [c_void_p] 7852isl.isl_union_map_gist.restype = c_void_p 7853isl.isl_union_map_gist.argtypes = [c_void_p, c_void_p] 7854isl.isl_union_map_gist_domain.restype = c_void_p 7855isl.isl_union_map_gist_domain.argtypes = [c_void_p, c_void_p] 7856isl.isl_union_map_gist_params.restype = c_void_p 7857isl.isl_union_map_gist_params.argtypes = [c_void_p, c_void_p] 7858isl.isl_union_map_gist_range.restype = c_void_p 7859isl.isl_union_map_gist_range.argtypes = [c_void_p, c_void_p] 7860isl.isl_union_map_intersect.restype = c_void_p 7861isl.isl_union_map_intersect.argtypes = [c_void_p, c_void_p] 7862isl.isl_union_map_intersect_domain_space.restype = c_void_p 7863isl.isl_union_map_intersect_domain_space.argtypes = [c_void_p, c_void_p] 7864isl.isl_union_map_intersect_domain_union_set.restype = c_void_p 7865isl.isl_union_map_intersect_domain_union_set.argtypes = [c_void_p, c_void_p] 7866isl.isl_union_map_intersect_domain_factor_domain.restype = c_void_p 7867isl.isl_union_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 7868isl.isl_union_map_intersect_domain_factor_range.restype = c_void_p 7869isl.isl_union_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 7870isl.isl_union_map_intersect_params.restype = c_void_p 7871isl.isl_union_map_intersect_params.argtypes = [c_void_p, c_void_p] 7872isl.isl_union_map_intersect_range_space.restype = c_void_p 7873isl.isl_union_map_intersect_range_space.argtypes = [c_void_p, c_void_p] 7874isl.isl_union_map_intersect_range_union_set.restype = c_void_p 7875isl.isl_union_map_intersect_range_union_set.argtypes = [c_void_p, c_void_p] 7876isl.isl_union_map_intersect_range_factor_domain.restype = c_void_p 7877isl.isl_union_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 7878isl.isl_union_map_intersect_range_factor_range.restype = c_void_p 7879isl.isl_union_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 7880isl.isl_union_map_is_bijective.argtypes = [c_void_p] 7881isl.isl_union_map_is_disjoint.argtypes = [c_void_p, c_void_p] 7882isl.isl_union_map_is_empty.argtypes = [c_void_p] 7883isl.isl_union_map_is_equal.argtypes = [c_void_p, c_void_p] 7884isl.isl_union_map_is_injective.argtypes = [c_void_p] 7885isl.isl_union_map_is_single_valued.argtypes = [c_void_p] 7886isl.isl_union_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 7887isl.isl_union_map_is_subset.argtypes = [c_void_p, c_void_p] 7888isl.isl_union_map_isa_map.argtypes = [c_void_p] 7889isl.isl_union_map_lexmax.restype = c_void_p 7890isl.isl_union_map_lexmax.argtypes = [c_void_p] 7891isl.isl_union_map_lexmin.restype = c_void_p 7892isl.isl_union_map_lexmin.argtypes = [c_void_p] 7893isl.isl_union_map_get_map_list.restype = c_void_p 7894isl.isl_union_map_get_map_list.argtypes = [c_void_p] 7895isl.isl_union_map_polyhedral_hull.restype = c_void_p 7896isl.isl_union_map_polyhedral_hull.argtypes = [c_void_p] 7897isl.isl_union_map_preimage_domain_multi_aff.restype = c_void_p 7898isl.isl_union_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 7899isl.isl_union_map_preimage_domain_multi_pw_aff.restype = c_void_p 7900isl.isl_union_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 7901isl.isl_union_map_preimage_domain_pw_multi_aff.restype = c_void_p 7902isl.isl_union_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7903isl.isl_union_map_preimage_domain_union_pw_multi_aff.restype = c_void_p 7904isl.isl_union_map_preimage_domain_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7905isl.isl_union_map_preimage_range_multi_aff.restype = c_void_p 7906isl.isl_union_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 7907isl.isl_union_map_preimage_range_pw_multi_aff.restype = c_void_p 7908isl.isl_union_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7909isl.isl_union_map_preimage_range_union_pw_multi_aff.restype = c_void_p 7910isl.isl_union_map_preimage_range_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 7911isl.isl_union_map_product.restype = c_void_p 7912isl.isl_union_map_product.argtypes = [c_void_p, c_void_p] 7913isl.isl_union_map_project_out_all_params.restype = c_void_p 7914isl.isl_union_map_project_out_all_params.argtypes = [c_void_p] 7915isl.isl_union_map_range.restype = c_void_p 7916isl.isl_union_map_range.argtypes = [c_void_p] 7917isl.isl_union_map_range_factor_domain.restype = c_void_p 7918isl.isl_union_map_range_factor_domain.argtypes = [c_void_p] 7919isl.isl_union_map_range_factor_range.restype = c_void_p 7920isl.isl_union_map_range_factor_range.argtypes = [c_void_p] 7921isl.isl_union_map_range_map.restype = c_void_p 7922isl.isl_union_map_range_map.argtypes = [c_void_p] 7923isl.isl_union_map_range_product.restype = c_void_p 7924isl.isl_union_map_range_product.argtypes = [c_void_p, c_void_p] 7925isl.isl_union_map_range_reverse.restype = c_void_p 7926isl.isl_union_map_range_reverse.argtypes = [c_void_p] 7927isl.isl_union_map_reverse.restype = c_void_p 7928isl.isl_union_map_reverse.argtypes = [c_void_p] 7929isl.isl_union_map_get_space.restype = c_void_p 7930isl.isl_union_map_get_space.argtypes = [c_void_p] 7931isl.isl_union_map_subtract.restype = c_void_p 7932isl.isl_union_map_subtract.argtypes = [c_void_p, c_void_p] 7933isl.isl_union_map_subtract_domain.restype = c_void_p 7934isl.isl_union_map_subtract_domain.argtypes = [c_void_p, c_void_p] 7935isl.isl_union_map_subtract_range.restype = c_void_p 7936isl.isl_union_map_subtract_range.argtypes = [c_void_p, c_void_p] 7937isl.isl_union_map_uncurry.restype = c_void_p 7938isl.isl_union_map_uncurry.argtypes = [c_void_p] 7939isl.isl_union_map_union.restype = c_void_p 7940isl.isl_union_map_union.argtypes = [c_void_p, c_void_p] 7941isl.isl_union_map_universe.restype = c_void_p 7942isl.isl_union_map_universe.argtypes = [c_void_p] 7943isl.isl_union_map_wrap.restype = c_void_p 7944isl.isl_union_map_wrap.argtypes = [c_void_p] 7945isl.isl_union_map_zip.restype = c_void_p 7946isl.isl_union_map_zip.argtypes = [c_void_p] 7947isl.isl_union_map_copy.restype = c_void_p 7948isl.isl_union_map_copy.argtypes = [c_void_p] 7949isl.isl_union_map_free.restype = c_void_p 7950isl.isl_union_map_free.argtypes = [c_void_p] 7951isl.isl_union_map_to_str.restype = POINTER(c_char) 7952isl.isl_union_map_to_str.argtypes = [c_void_p] 7953 7954class map(union_map): 7955 def __init__(self, *args, **keywords): 7956 if "ptr" in keywords: 7957 self.ctx = keywords["ctx"] 7958 self.ptr = keywords["ptr"] 7959 return 7960 if len(args) == 1 and args[0].__class__ is basic_map: 7961 self.ctx = Context.getDefaultInstance() 7962 self.ptr = isl.isl_map_from_basic_map(isl.isl_basic_map_copy(args[0].ptr)) 7963 return 7964 if len(args) == 1 and type(args[0]) == str: 7965 self.ctx = Context.getDefaultInstance() 7966 self.ptr = isl.isl_map_read_from_str(self.ctx, args[0].encode('ascii')) 7967 return 7968 raise Error 7969 def __del__(self): 7970 if hasattr(self, 'ptr'): 7971 isl.isl_map_free(self.ptr) 7972 def __str__(arg0): 7973 try: 7974 if not arg0.__class__ is map: 7975 arg0 = map(arg0) 7976 except: 7977 raise 7978 ptr = isl.isl_map_to_str(arg0.ptr) 7979 res = cast(ptr, c_char_p).value.decode('ascii') 7980 libc.free(ptr) 7981 return res 7982 def __repr__(self): 7983 s = str(self) 7984 if '"' in s: 7985 return 'isl.map("""%s""")' % s 7986 else: 7987 return 'isl.map("%s")' % s 7988 def affine_hull(arg0): 7989 try: 7990 if not arg0.__class__ is map: 7991 arg0 = map(arg0) 7992 except: 7993 raise 7994 ctx = arg0.ctx 7995 res = isl.isl_map_affine_hull(isl.isl_map_copy(arg0.ptr)) 7996 obj = basic_map(ctx=ctx, ptr=res) 7997 return obj 7998 def apply_domain(arg0, arg1): 7999 try: 8000 if not arg0.__class__ is map: 8001 arg0 = map(arg0) 8002 except: 8003 raise 8004 try: 8005 if not arg1.__class__ is map: 8006 arg1 = map(arg1) 8007 except: 8008 return union_map(arg0).apply_domain(arg1) 8009 ctx = arg0.ctx 8010 res = isl.isl_map_apply_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8011 obj = map(ctx=ctx, ptr=res) 8012 return obj 8013 def apply_range(arg0, arg1): 8014 try: 8015 if not arg0.__class__ is map: 8016 arg0 = map(arg0) 8017 except: 8018 raise 8019 try: 8020 if not arg1.__class__ is map: 8021 arg1 = map(arg1) 8022 except: 8023 return union_map(arg0).apply_range(arg1) 8024 ctx = arg0.ctx 8025 res = isl.isl_map_apply_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8026 obj = map(ctx=ctx, ptr=res) 8027 return obj 8028 def as_pw_multi_aff(arg0): 8029 try: 8030 if not arg0.__class__ is map: 8031 arg0 = map(arg0) 8032 except: 8033 raise 8034 ctx = arg0.ctx 8035 res = isl.isl_map_as_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 8036 obj = pw_multi_aff(ctx=ctx, ptr=res) 8037 return obj 8038 def bind_domain(arg0, arg1): 8039 try: 8040 if not arg0.__class__ is map: 8041 arg0 = map(arg0) 8042 except: 8043 raise 8044 try: 8045 if not arg1.__class__ is multi_id: 8046 arg1 = multi_id(arg1) 8047 except: 8048 return union_map(arg0).bind_domain(arg1) 8049 ctx = arg0.ctx 8050 res = isl.isl_map_bind_domain(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 8051 obj = set(ctx=ctx, ptr=res) 8052 return obj 8053 def bind_range(arg0, arg1): 8054 try: 8055 if not arg0.__class__ is map: 8056 arg0 = map(arg0) 8057 except: 8058 raise 8059 try: 8060 if not arg1.__class__ is multi_id: 8061 arg1 = multi_id(arg1) 8062 except: 8063 return union_map(arg0).bind_range(arg1) 8064 ctx = arg0.ctx 8065 res = isl.isl_map_bind_range(isl.isl_map_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 8066 obj = set(ctx=ctx, ptr=res) 8067 return obj 8068 def coalesce(arg0): 8069 try: 8070 if not arg0.__class__ is map: 8071 arg0 = map(arg0) 8072 except: 8073 raise 8074 ctx = arg0.ctx 8075 res = isl.isl_map_coalesce(isl.isl_map_copy(arg0.ptr)) 8076 obj = map(ctx=ctx, ptr=res) 8077 return obj 8078 def complement(arg0): 8079 try: 8080 if not arg0.__class__ is map: 8081 arg0 = map(arg0) 8082 except: 8083 raise 8084 ctx = arg0.ctx 8085 res = isl.isl_map_complement(isl.isl_map_copy(arg0.ptr)) 8086 obj = map(ctx=ctx, ptr=res) 8087 return obj 8088 def curry(arg0): 8089 try: 8090 if not arg0.__class__ is map: 8091 arg0 = map(arg0) 8092 except: 8093 raise 8094 ctx = arg0.ctx 8095 res = isl.isl_map_curry(isl.isl_map_copy(arg0.ptr)) 8096 obj = map(ctx=ctx, ptr=res) 8097 return obj 8098 def deltas(arg0): 8099 try: 8100 if not arg0.__class__ is map: 8101 arg0 = map(arg0) 8102 except: 8103 raise 8104 ctx = arg0.ctx 8105 res = isl.isl_map_deltas(isl.isl_map_copy(arg0.ptr)) 8106 obj = set(ctx=ctx, ptr=res) 8107 return obj 8108 def detect_equalities(arg0): 8109 try: 8110 if not arg0.__class__ is map: 8111 arg0 = map(arg0) 8112 except: 8113 raise 8114 ctx = arg0.ctx 8115 res = isl.isl_map_detect_equalities(isl.isl_map_copy(arg0.ptr)) 8116 obj = map(ctx=ctx, ptr=res) 8117 return obj 8118 def domain(arg0): 8119 try: 8120 if not arg0.__class__ is map: 8121 arg0 = map(arg0) 8122 except: 8123 raise 8124 ctx = arg0.ctx 8125 res = isl.isl_map_domain(isl.isl_map_copy(arg0.ptr)) 8126 obj = set(ctx=ctx, ptr=res) 8127 return obj 8128 def domain_factor_domain(arg0): 8129 try: 8130 if not arg0.__class__ is map: 8131 arg0 = map(arg0) 8132 except: 8133 raise 8134 ctx = arg0.ctx 8135 res = isl.isl_map_domain_factor_domain(isl.isl_map_copy(arg0.ptr)) 8136 obj = map(ctx=ctx, ptr=res) 8137 return obj 8138 def domain_factor_range(arg0): 8139 try: 8140 if not arg0.__class__ is map: 8141 arg0 = map(arg0) 8142 except: 8143 raise 8144 ctx = arg0.ctx 8145 res = isl.isl_map_domain_factor_range(isl.isl_map_copy(arg0.ptr)) 8146 obj = map(ctx=ctx, ptr=res) 8147 return obj 8148 def domain_product(arg0, arg1): 8149 try: 8150 if not arg0.__class__ is map: 8151 arg0 = map(arg0) 8152 except: 8153 raise 8154 try: 8155 if not arg1.__class__ is map: 8156 arg1 = map(arg1) 8157 except: 8158 return union_map(arg0).domain_product(arg1) 8159 ctx = arg0.ctx 8160 res = isl.isl_map_domain_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8161 obj = map(ctx=ctx, ptr=res) 8162 return obj 8163 def domain_tuple_dim(arg0): 8164 try: 8165 if not arg0.__class__ is map: 8166 arg0 = map(arg0) 8167 except: 8168 raise 8169 ctx = arg0.ctx 8170 res = isl.isl_map_domain_tuple_dim(arg0.ptr) 8171 if res < 0: 8172 raise 8173 return int(res) 8174 def domain_tuple_id(arg0): 8175 try: 8176 if not arg0.__class__ is map: 8177 arg0 = map(arg0) 8178 except: 8179 raise 8180 ctx = arg0.ctx 8181 res = isl.isl_map_get_domain_tuple_id(arg0.ptr) 8182 obj = id(ctx=ctx, ptr=res) 8183 return obj 8184 def get_domain_tuple_id(arg0): 8185 return arg0.domain_tuple_id() 8186 @staticmethod 8187 def empty(arg0): 8188 try: 8189 if not arg0.__class__ is space: 8190 arg0 = space(arg0) 8191 except: 8192 raise 8193 ctx = arg0.ctx 8194 res = isl.isl_map_empty(isl.isl_space_copy(arg0.ptr)) 8195 obj = map(ctx=ctx, ptr=res) 8196 return obj 8197 def eq_at(*args): 8198 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8199 ctx = args[0].ctx 8200 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)) 8201 obj = map(ctx=ctx, ptr=res) 8202 return obj 8203 raise Error 8204 def factor_domain(arg0): 8205 try: 8206 if not arg0.__class__ is map: 8207 arg0 = map(arg0) 8208 except: 8209 raise 8210 ctx = arg0.ctx 8211 res = isl.isl_map_factor_domain(isl.isl_map_copy(arg0.ptr)) 8212 obj = map(ctx=ctx, ptr=res) 8213 return obj 8214 def factor_range(arg0): 8215 try: 8216 if not arg0.__class__ is map: 8217 arg0 = map(arg0) 8218 except: 8219 raise 8220 ctx = arg0.ctx 8221 res = isl.isl_map_factor_range(isl.isl_map_copy(arg0.ptr)) 8222 obj = map(ctx=ctx, ptr=res) 8223 return obj 8224 def flatten(arg0): 8225 try: 8226 if not arg0.__class__ is map: 8227 arg0 = map(arg0) 8228 except: 8229 raise 8230 ctx = arg0.ctx 8231 res = isl.isl_map_flatten(isl.isl_map_copy(arg0.ptr)) 8232 obj = map(ctx=ctx, ptr=res) 8233 return obj 8234 def flatten_domain(arg0): 8235 try: 8236 if not arg0.__class__ is map: 8237 arg0 = map(arg0) 8238 except: 8239 raise 8240 ctx = arg0.ctx 8241 res = isl.isl_map_flatten_domain(isl.isl_map_copy(arg0.ptr)) 8242 obj = map(ctx=ctx, ptr=res) 8243 return obj 8244 def flatten_range(arg0): 8245 try: 8246 if not arg0.__class__ is map: 8247 arg0 = map(arg0) 8248 except: 8249 raise 8250 ctx = arg0.ctx 8251 res = isl.isl_map_flatten_range(isl.isl_map_copy(arg0.ptr)) 8252 obj = map(ctx=ctx, ptr=res) 8253 return obj 8254 def foreach_basic_map(arg0, arg1): 8255 try: 8256 if not arg0.__class__ is map: 8257 arg0 = map(arg0) 8258 except: 8259 raise 8260 exc_info = [None] 8261 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 8262 def cb_func(cb_arg0, cb_arg1): 8263 cb_arg0 = basic_map(ctx=arg0.ctx, ptr=(cb_arg0)) 8264 try: 8265 arg1(cb_arg0) 8266 except BaseException as e: 8267 exc_info[0] = e 8268 return -1 8269 return 0 8270 cb = fn(cb_func) 8271 ctx = arg0.ctx 8272 res = isl.isl_map_foreach_basic_map(arg0.ptr, cb, None) 8273 if exc_info[0] is not None: 8274 raise exc_info[0] 8275 if res < 0: 8276 raise 8277 def gist(arg0, arg1): 8278 try: 8279 if not arg0.__class__ is map: 8280 arg0 = map(arg0) 8281 except: 8282 raise 8283 try: 8284 if not arg1.__class__ is map: 8285 arg1 = map(arg1) 8286 except: 8287 return union_map(arg0).gist(arg1) 8288 ctx = arg0.ctx 8289 res = isl.isl_map_gist(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8290 obj = map(ctx=ctx, ptr=res) 8291 return obj 8292 def gist_domain(arg0, arg1): 8293 try: 8294 if not arg0.__class__ is map: 8295 arg0 = map(arg0) 8296 except: 8297 raise 8298 try: 8299 if not arg1.__class__ is set: 8300 arg1 = set(arg1) 8301 except: 8302 return union_map(arg0).gist_domain(arg1) 8303 ctx = arg0.ctx 8304 res = isl.isl_map_gist_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8305 obj = map(ctx=ctx, ptr=res) 8306 return obj 8307 def has_domain_tuple_id(arg0): 8308 try: 8309 if not arg0.__class__ is map: 8310 arg0 = map(arg0) 8311 except: 8312 raise 8313 ctx = arg0.ctx 8314 res = isl.isl_map_has_domain_tuple_id(arg0.ptr) 8315 if res < 0: 8316 raise 8317 return bool(res) 8318 def has_range_tuple_id(arg0): 8319 try: 8320 if not arg0.__class__ is map: 8321 arg0 = map(arg0) 8322 except: 8323 raise 8324 ctx = arg0.ctx 8325 res = isl.isl_map_has_range_tuple_id(arg0.ptr) 8326 if res < 0: 8327 raise 8328 return bool(res) 8329 def intersect(arg0, arg1): 8330 try: 8331 if not arg0.__class__ is map: 8332 arg0 = map(arg0) 8333 except: 8334 raise 8335 try: 8336 if not arg1.__class__ is map: 8337 arg1 = map(arg1) 8338 except: 8339 return union_map(arg0).intersect(arg1) 8340 ctx = arg0.ctx 8341 res = isl.isl_map_intersect(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8342 obj = map(ctx=ctx, ptr=res) 8343 return obj 8344 def intersect_domain(arg0, arg1): 8345 try: 8346 if not arg0.__class__ is map: 8347 arg0 = map(arg0) 8348 except: 8349 raise 8350 try: 8351 if not arg1.__class__ is set: 8352 arg1 = set(arg1) 8353 except: 8354 return union_map(arg0).intersect_domain(arg1) 8355 ctx = arg0.ctx 8356 res = isl.isl_map_intersect_domain(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8357 obj = map(ctx=ctx, ptr=res) 8358 return obj 8359 def intersect_domain_factor_domain(arg0, arg1): 8360 try: 8361 if not arg0.__class__ is map: 8362 arg0 = map(arg0) 8363 except: 8364 raise 8365 try: 8366 if not arg1.__class__ is map: 8367 arg1 = map(arg1) 8368 except: 8369 return union_map(arg0).intersect_domain_factor_domain(arg1) 8370 ctx = arg0.ctx 8371 res = isl.isl_map_intersect_domain_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8372 obj = map(ctx=ctx, ptr=res) 8373 return obj 8374 def intersect_domain_factor_range(arg0, arg1): 8375 try: 8376 if not arg0.__class__ is map: 8377 arg0 = map(arg0) 8378 except: 8379 raise 8380 try: 8381 if not arg1.__class__ is map: 8382 arg1 = map(arg1) 8383 except: 8384 return union_map(arg0).intersect_domain_factor_range(arg1) 8385 ctx = arg0.ctx 8386 res = isl.isl_map_intersect_domain_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8387 obj = map(ctx=ctx, ptr=res) 8388 return obj 8389 def intersect_params(arg0, arg1): 8390 try: 8391 if not arg0.__class__ is map: 8392 arg0 = map(arg0) 8393 except: 8394 raise 8395 try: 8396 if not arg1.__class__ is set: 8397 arg1 = set(arg1) 8398 except: 8399 return union_map(arg0).intersect_params(arg1) 8400 ctx = arg0.ctx 8401 res = isl.isl_map_intersect_params(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8402 obj = map(ctx=ctx, ptr=res) 8403 return obj 8404 def intersect_range(arg0, arg1): 8405 try: 8406 if not arg0.__class__ is map: 8407 arg0 = map(arg0) 8408 except: 8409 raise 8410 try: 8411 if not arg1.__class__ is set: 8412 arg1 = set(arg1) 8413 except: 8414 return union_map(arg0).intersect_range(arg1) 8415 ctx = arg0.ctx 8416 res = isl.isl_map_intersect_range(isl.isl_map_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 8417 obj = map(ctx=ctx, ptr=res) 8418 return obj 8419 def intersect_range_factor_domain(arg0, arg1): 8420 try: 8421 if not arg0.__class__ is map: 8422 arg0 = map(arg0) 8423 except: 8424 raise 8425 try: 8426 if not arg1.__class__ is map: 8427 arg1 = map(arg1) 8428 except: 8429 return union_map(arg0).intersect_range_factor_domain(arg1) 8430 ctx = arg0.ctx 8431 res = isl.isl_map_intersect_range_factor_domain(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8432 obj = map(ctx=ctx, ptr=res) 8433 return obj 8434 def intersect_range_factor_range(arg0, arg1): 8435 try: 8436 if not arg0.__class__ is map: 8437 arg0 = map(arg0) 8438 except: 8439 raise 8440 try: 8441 if not arg1.__class__ is map: 8442 arg1 = map(arg1) 8443 except: 8444 return union_map(arg0).intersect_range_factor_range(arg1) 8445 ctx = arg0.ctx 8446 res = isl.isl_map_intersect_range_factor_range(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8447 obj = map(ctx=ctx, ptr=res) 8448 return obj 8449 def is_bijective(arg0): 8450 try: 8451 if not arg0.__class__ is map: 8452 arg0 = map(arg0) 8453 except: 8454 raise 8455 ctx = arg0.ctx 8456 res = isl.isl_map_is_bijective(arg0.ptr) 8457 if res < 0: 8458 raise 8459 return bool(res) 8460 def is_disjoint(arg0, arg1): 8461 try: 8462 if not arg0.__class__ is map: 8463 arg0 = map(arg0) 8464 except: 8465 raise 8466 try: 8467 if not arg1.__class__ is map: 8468 arg1 = map(arg1) 8469 except: 8470 return union_map(arg0).is_disjoint(arg1) 8471 ctx = arg0.ctx 8472 res = isl.isl_map_is_disjoint(arg0.ptr, arg1.ptr) 8473 if res < 0: 8474 raise 8475 return bool(res) 8476 def is_empty(arg0): 8477 try: 8478 if not arg0.__class__ is map: 8479 arg0 = map(arg0) 8480 except: 8481 raise 8482 ctx = arg0.ctx 8483 res = isl.isl_map_is_empty(arg0.ptr) 8484 if res < 0: 8485 raise 8486 return bool(res) 8487 def is_equal(arg0, arg1): 8488 try: 8489 if not arg0.__class__ is map: 8490 arg0 = map(arg0) 8491 except: 8492 raise 8493 try: 8494 if not arg1.__class__ is map: 8495 arg1 = map(arg1) 8496 except: 8497 return union_map(arg0).is_equal(arg1) 8498 ctx = arg0.ctx 8499 res = isl.isl_map_is_equal(arg0.ptr, arg1.ptr) 8500 if res < 0: 8501 raise 8502 return bool(res) 8503 def is_injective(arg0): 8504 try: 8505 if not arg0.__class__ is map: 8506 arg0 = map(arg0) 8507 except: 8508 raise 8509 ctx = arg0.ctx 8510 res = isl.isl_map_is_injective(arg0.ptr) 8511 if res < 0: 8512 raise 8513 return bool(res) 8514 def is_single_valued(arg0): 8515 try: 8516 if not arg0.__class__ is map: 8517 arg0 = map(arg0) 8518 except: 8519 raise 8520 ctx = arg0.ctx 8521 res = isl.isl_map_is_single_valued(arg0.ptr) 8522 if res < 0: 8523 raise 8524 return bool(res) 8525 def is_strict_subset(arg0, arg1): 8526 try: 8527 if not arg0.__class__ is map: 8528 arg0 = map(arg0) 8529 except: 8530 raise 8531 try: 8532 if not arg1.__class__ is map: 8533 arg1 = map(arg1) 8534 except: 8535 return union_map(arg0).is_strict_subset(arg1) 8536 ctx = arg0.ctx 8537 res = isl.isl_map_is_strict_subset(arg0.ptr, arg1.ptr) 8538 if res < 0: 8539 raise 8540 return bool(res) 8541 def is_subset(arg0, arg1): 8542 try: 8543 if not arg0.__class__ is map: 8544 arg0 = map(arg0) 8545 except: 8546 raise 8547 try: 8548 if not arg1.__class__ is map: 8549 arg1 = map(arg1) 8550 except: 8551 return union_map(arg0).is_subset(arg1) 8552 ctx = arg0.ctx 8553 res = isl.isl_map_is_subset(arg0.ptr, arg1.ptr) 8554 if res < 0: 8555 raise 8556 return bool(res) 8557 def lex_ge_at(*args): 8558 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8559 ctx = args[0].ctx 8560 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)) 8561 obj = map(ctx=ctx, ptr=res) 8562 return obj 8563 raise Error 8564 def lex_gt_at(*args): 8565 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8566 ctx = args[0].ctx 8567 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)) 8568 obj = map(ctx=ctx, ptr=res) 8569 return obj 8570 raise Error 8571 def lex_le_at(*args): 8572 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8573 ctx = args[0].ctx 8574 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)) 8575 obj = map(ctx=ctx, ptr=res) 8576 return obj 8577 raise Error 8578 def lex_lt_at(*args): 8579 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8580 ctx = args[0].ctx 8581 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)) 8582 obj = map(ctx=ctx, ptr=res) 8583 return obj 8584 raise Error 8585 def lexmax(arg0): 8586 try: 8587 if not arg0.__class__ is map: 8588 arg0 = map(arg0) 8589 except: 8590 raise 8591 ctx = arg0.ctx 8592 res = isl.isl_map_lexmax(isl.isl_map_copy(arg0.ptr)) 8593 obj = map(ctx=ctx, ptr=res) 8594 return obj 8595 def lexmax_pw_multi_aff(arg0): 8596 try: 8597 if not arg0.__class__ is map: 8598 arg0 = map(arg0) 8599 except: 8600 raise 8601 ctx = arg0.ctx 8602 res = isl.isl_map_lexmax_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 8603 obj = pw_multi_aff(ctx=ctx, ptr=res) 8604 return obj 8605 def lexmin(arg0): 8606 try: 8607 if not arg0.__class__ is map: 8608 arg0 = map(arg0) 8609 except: 8610 raise 8611 ctx = arg0.ctx 8612 res = isl.isl_map_lexmin(isl.isl_map_copy(arg0.ptr)) 8613 obj = map(ctx=ctx, ptr=res) 8614 return obj 8615 def lexmin_pw_multi_aff(arg0): 8616 try: 8617 if not arg0.__class__ is map: 8618 arg0 = map(arg0) 8619 except: 8620 raise 8621 ctx = arg0.ctx 8622 res = isl.isl_map_lexmin_pw_multi_aff(isl.isl_map_copy(arg0.ptr)) 8623 obj = pw_multi_aff(ctx=ctx, ptr=res) 8624 return obj 8625 def lower_bound(*args): 8626 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8627 ctx = args[0].ctx 8628 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)) 8629 obj = map(ctx=ctx, ptr=res) 8630 return obj 8631 raise Error 8632 def max_multi_pw_aff(arg0): 8633 try: 8634 if not arg0.__class__ is map: 8635 arg0 = map(arg0) 8636 except: 8637 raise 8638 ctx = arg0.ctx 8639 res = isl.isl_map_max_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 8640 obj = multi_pw_aff(ctx=ctx, ptr=res) 8641 return obj 8642 def min_multi_pw_aff(arg0): 8643 try: 8644 if not arg0.__class__ is map: 8645 arg0 = map(arg0) 8646 except: 8647 raise 8648 ctx = arg0.ctx 8649 res = isl.isl_map_min_multi_pw_aff(isl.isl_map_copy(arg0.ptr)) 8650 obj = multi_pw_aff(ctx=ctx, ptr=res) 8651 return obj 8652 def n_basic_map(arg0): 8653 try: 8654 if not arg0.__class__ is map: 8655 arg0 = map(arg0) 8656 except: 8657 raise 8658 ctx = arg0.ctx 8659 res = isl.isl_map_n_basic_map(arg0.ptr) 8660 if res < 0: 8661 raise 8662 return int(res) 8663 def polyhedral_hull(arg0): 8664 try: 8665 if not arg0.__class__ is map: 8666 arg0 = map(arg0) 8667 except: 8668 raise 8669 ctx = arg0.ctx 8670 res = isl.isl_map_polyhedral_hull(isl.isl_map_copy(arg0.ptr)) 8671 obj = basic_map(ctx=ctx, ptr=res) 8672 return obj 8673 def preimage_domain(*args): 8674 if len(args) == 2 and args[1].__class__ is multi_aff: 8675 ctx = args[0].ctx 8676 res = isl.isl_map_preimage_domain_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 8677 obj = map(ctx=ctx, ptr=res) 8678 return obj 8679 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8680 ctx = args[0].ctx 8681 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)) 8682 obj = map(ctx=ctx, ptr=res) 8683 return obj 8684 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8685 ctx = args[0].ctx 8686 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)) 8687 obj = map(ctx=ctx, ptr=res) 8688 return obj 8689 raise Error 8690 def preimage_range(*args): 8691 if len(args) == 2 and args[1].__class__ is multi_aff: 8692 ctx = args[0].ctx 8693 res = isl.isl_map_preimage_range_multi_aff(isl.isl_map_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 8694 obj = map(ctx=ctx, ptr=res) 8695 return obj 8696 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 8697 ctx = args[0].ctx 8698 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)) 8699 obj = map(ctx=ctx, ptr=res) 8700 return obj 8701 raise Error 8702 def product(arg0, arg1): 8703 try: 8704 if not arg0.__class__ is map: 8705 arg0 = map(arg0) 8706 except: 8707 raise 8708 try: 8709 if not arg1.__class__ is map: 8710 arg1 = map(arg1) 8711 except: 8712 return union_map(arg0).product(arg1) 8713 ctx = arg0.ctx 8714 res = isl.isl_map_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8715 obj = map(ctx=ctx, ptr=res) 8716 return obj 8717 def project_out_all_params(arg0): 8718 try: 8719 if not arg0.__class__ is map: 8720 arg0 = map(arg0) 8721 except: 8722 raise 8723 ctx = arg0.ctx 8724 res = isl.isl_map_project_out_all_params(isl.isl_map_copy(arg0.ptr)) 8725 obj = map(ctx=ctx, ptr=res) 8726 return obj 8727 def range(arg0): 8728 try: 8729 if not arg0.__class__ is map: 8730 arg0 = map(arg0) 8731 except: 8732 raise 8733 ctx = arg0.ctx 8734 res = isl.isl_map_range(isl.isl_map_copy(arg0.ptr)) 8735 obj = set(ctx=ctx, ptr=res) 8736 return obj 8737 def range_factor_domain(arg0): 8738 try: 8739 if not arg0.__class__ is map: 8740 arg0 = map(arg0) 8741 except: 8742 raise 8743 ctx = arg0.ctx 8744 res = isl.isl_map_range_factor_domain(isl.isl_map_copy(arg0.ptr)) 8745 obj = map(ctx=ctx, ptr=res) 8746 return obj 8747 def range_factor_range(arg0): 8748 try: 8749 if not arg0.__class__ is map: 8750 arg0 = map(arg0) 8751 except: 8752 raise 8753 ctx = arg0.ctx 8754 res = isl.isl_map_range_factor_range(isl.isl_map_copy(arg0.ptr)) 8755 obj = map(ctx=ctx, ptr=res) 8756 return obj 8757 def range_lattice_tile(arg0): 8758 try: 8759 if not arg0.__class__ is map: 8760 arg0 = map(arg0) 8761 except: 8762 raise 8763 ctx = arg0.ctx 8764 res = isl.isl_map_get_range_lattice_tile(arg0.ptr) 8765 obj = fixed_box(ctx=ctx, ptr=res) 8766 return obj 8767 def get_range_lattice_tile(arg0): 8768 return arg0.range_lattice_tile() 8769 def range_product(arg0, arg1): 8770 try: 8771 if not arg0.__class__ is map: 8772 arg0 = map(arg0) 8773 except: 8774 raise 8775 try: 8776 if not arg1.__class__ is map: 8777 arg1 = map(arg1) 8778 except: 8779 return union_map(arg0).range_product(arg1) 8780 ctx = arg0.ctx 8781 res = isl.isl_map_range_product(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8782 obj = map(ctx=ctx, ptr=res) 8783 return obj 8784 def range_reverse(arg0): 8785 try: 8786 if not arg0.__class__ is map: 8787 arg0 = map(arg0) 8788 except: 8789 raise 8790 ctx = arg0.ctx 8791 res = isl.isl_map_range_reverse(isl.isl_map_copy(arg0.ptr)) 8792 obj = map(ctx=ctx, ptr=res) 8793 return obj 8794 def range_simple_fixed_box_hull(arg0): 8795 try: 8796 if not arg0.__class__ is map: 8797 arg0 = map(arg0) 8798 except: 8799 raise 8800 ctx = arg0.ctx 8801 res = isl.isl_map_get_range_simple_fixed_box_hull(arg0.ptr) 8802 obj = fixed_box(ctx=ctx, ptr=res) 8803 return obj 8804 def get_range_simple_fixed_box_hull(arg0): 8805 return arg0.range_simple_fixed_box_hull() 8806 def range_tuple_dim(arg0): 8807 try: 8808 if not arg0.__class__ is map: 8809 arg0 = map(arg0) 8810 except: 8811 raise 8812 ctx = arg0.ctx 8813 res = isl.isl_map_range_tuple_dim(arg0.ptr) 8814 if res < 0: 8815 raise 8816 return int(res) 8817 def range_tuple_id(arg0): 8818 try: 8819 if not arg0.__class__ is map: 8820 arg0 = map(arg0) 8821 except: 8822 raise 8823 ctx = arg0.ctx 8824 res = isl.isl_map_get_range_tuple_id(arg0.ptr) 8825 obj = id(ctx=ctx, ptr=res) 8826 return obj 8827 def get_range_tuple_id(arg0): 8828 return arg0.range_tuple_id() 8829 def reverse(arg0): 8830 try: 8831 if not arg0.__class__ is map: 8832 arg0 = map(arg0) 8833 except: 8834 raise 8835 ctx = arg0.ctx 8836 res = isl.isl_map_reverse(isl.isl_map_copy(arg0.ptr)) 8837 obj = map(ctx=ctx, ptr=res) 8838 return obj 8839 def sample(arg0): 8840 try: 8841 if not arg0.__class__ is map: 8842 arg0 = map(arg0) 8843 except: 8844 raise 8845 ctx = arg0.ctx 8846 res = isl.isl_map_sample(isl.isl_map_copy(arg0.ptr)) 8847 obj = basic_map(ctx=ctx, ptr=res) 8848 return obj 8849 def set_domain_tuple(*args): 8850 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 8851 args = list(args) 8852 try: 8853 if not args[1].__class__ is id: 8854 args[1] = id(args[1]) 8855 except: 8856 raise 8857 ctx = args[0].ctx 8858 res = isl.isl_map_set_domain_tuple_id(isl.isl_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 8859 obj = map(ctx=ctx, ptr=res) 8860 return obj 8861 raise Error 8862 def set_range_tuple(*args): 8863 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 8864 args = list(args) 8865 try: 8866 if not args[1].__class__ is id: 8867 args[1] = id(args[1]) 8868 except: 8869 raise 8870 ctx = args[0].ctx 8871 res = isl.isl_map_set_range_tuple_id(isl.isl_map_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 8872 obj = map(ctx=ctx, ptr=res) 8873 return obj 8874 raise Error 8875 def space(arg0): 8876 try: 8877 if not arg0.__class__ is map: 8878 arg0 = map(arg0) 8879 except: 8880 raise 8881 ctx = arg0.ctx 8882 res = isl.isl_map_get_space(arg0.ptr) 8883 obj = space(ctx=ctx, ptr=res) 8884 return obj 8885 def get_space(arg0): 8886 return arg0.space() 8887 def subtract(arg0, arg1): 8888 try: 8889 if not arg0.__class__ is map: 8890 arg0 = map(arg0) 8891 except: 8892 raise 8893 try: 8894 if not arg1.__class__ is map: 8895 arg1 = map(arg1) 8896 except: 8897 return union_map(arg0).subtract(arg1) 8898 ctx = arg0.ctx 8899 res = isl.isl_map_subtract(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8900 obj = map(ctx=ctx, ptr=res) 8901 return obj 8902 def to_list(arg0): 8903 try: 8904 if not arg0.__class__ is map: 8905 arg0 = map(arg0) 8906 except: 8907 raise 8908 ctx = arg0.ctx 8909 res = isl.isl_map_to_list(isl.isl_map_copy(arg0.ptr)) 8910 obj = map_list(ctx=ctx, ptr=res) 8911 return obj 8912 def to_union_map(arg0): 8913 try: 8914 if not arg0.__class__ is map: 8915 arg0 = map(arg0) 8916 except: 8917 raise 8918 ctx = arg0.ctx 8919 res = isl.isl_map_to_union_map(isl.isl_map_copy(arg0.ptr)) 8920 obj = union_map(ctx=ctx, ptr=res) 8921 return obj 8922 def uncurry(arg0): 8923 try: 8924 if not arg0.__class__ is map: 8925 arg0 = map(arg0) 8926 except: 8927 raise 8928 ctx = arg0.ctx 8929 res = isl.isl_map_uncurry(isl.isl_map_copy(arg0.ptr)) 8930 obj = map(ctx=ctx, ptr=res) 8931 return obj 8932 def union(arg0, arg1): 8933 try: 8934 if not arg0.__class__ is map: 8935 arg0 = map(arg0) 8936 except: 8937 raise 8938 try: 8939 if not arg1.__class__ is map: 8940 arg1 = map(arg1) 8941 except: 8942 return union_map(arg0).union(arg1) 8943 ctx = arg0.ctx 8944 res = isl.isl_map_union(isl.isl_map_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 8945 obj = map(ctx=ctx, ptr=res) 8946 return obj 8947 @staticmethod 8948 def universe(arg0): 8949 try: 8950 if not arg0.__class__ is space: 8951 arg0 = space(arg0) 8952 except: 8953 raise 8954 ctx = arg0.ctx 8955 res = isl.isl_map_universe(isl.isl_space_copy(arg0.ptr)) 8956 obj = map(ctx=ctx, ptr=res) 8957 return obj 8958 def unshifted_simple_hull(arg0): 8959 try: 8960 if not arg0.__class__ is map: 8961 arg0 = map(arg0) 8962 except: 8963 raise 8964 ctx = arg0.ctx 8965 res = isl.isl_map_unshifted_simple_hull(isl.isl_map_copy(arg0.ptr)) 8966 obj = basic_map(ctx=ctx, ptr=res) 8967 return obj 8968 def upper_bound(*args): 8969 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 8970 ctx = args[0].ctx 8971 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)) 8972 obj = map(ctx=ctx, ptr=res) 8973 return obj 8974 raise Error 8975 def wrap(arg0): 8976 try: 8977 if not arg0.__class__ is map: 8978 arg0 = map(arg0) 8979 except: 8980 raise 8981 ctx = arg0.ctx 8982 res = isl.isl_map_wrap(isl.isl_map_copy(arg0.ptr)) 8983 obj = set(ctx=ctx, ptr=res) 8984 return obj 8985 def zip(arg0): 8986 try: 8987 if not arg0.__class__ is map: 8988 arg0 = map(arg0) 8989 except: 8990 raise 8991 ctx = arg0.ctx 8992 res = isl.isl_map_zip(isl.isl_map_copy(arg0.ptr)) 8993 obj = map(ctx=ctx, ptr=res) 8994 return obj 8995 8996isl.isl_map_from_basic_map.restype = c_void_p 8997isl.isl_map_from_basic_map.argtypes = [c_void_p] 8998isl.isl_map_read_from_str.restype = c_void_p 8999isl.isl_map_read_from_str.argtypes = [Context, c_char_p] 9000isl.isl_map_affine_hull.restype = c_void_p 9001isl.isl_map_affine_hull.argtypes = [c_void_p] 9002isl.isl_map_apply_domain.restype = c_void_p 9003isl.isl_map_apply_domain.argtypes = [c_void_p, c_void_p] 9004isl.isl_map_apply_range.restype = c_void_p 9005isl.isl_map_apply_range.argtypes = [c_void_p, c_void_p] 9006isl.isl_map_as_pw_multi_aff.restype = c_void_p 9007isl.isl_map_as_pw_multi_aff.argtypes = [c_void_p] 9008isl.isl_map_bind_domain.restype = c_void_p 9009isl.isl_map_bind_domain.argtypes = [c_void_p, c_void_p] 9010isl.isl_map_bind_range.restype = c_void_p 9011isl.isl_map_bind_range.argtypes = [c_void_p, c_void_p] 9012isl.isl_map_coalesce.restype = c_void_p 9013isl.isl_map_coalesce.argtypes = [c_void_p] 9014isl.isl_map_complement.restype = c_void_p 9015isl.isl_map_complement.argtypes = [c_void_p] 9016isl.isl_map_curry.restype = c_void_p 9017isl.isl_map_curry.argtypes = [c_void_p] 9018isl.isl_map_deltas.restype = c_void_p 9019isl.isl_map_deltas.argtypes = [c_void_p] 9020isl.isl_map_detect_equalities.restype = c_void_p 9021isl.isl_map_detect_equalities.argtypes = [c_void_p] 9022isl.isl_map_domain.restype = c_void_p 9023isl.isl_map_domain.argtypes = [c_void_p] 9024isl.isl_map_domain_factor_domain.restype = c_void_p 9025isl.isl_map_domain_factor_domain.argtypes = [c_void_p] 9026isl.isl_map_domain_factor_range.restype = c_void_p 9027isl.isl_map_domain_factor_range.argtypes = [c_void_p] 9028isl.isl_map_domain_product.restype = c_void_p 9029isl.isl_map_domain_product.argtypes = [c_void_p, c_void_p] 9030isl.isl_map_domain_tuple_dim.argtypes = [c_void_p] 9031isl.isl_map_get_domain_tuple_id.restype = c_void_p 9032isl.isl_map_get_domain_tuple_id.argtypes = [c_void_p] 9033isl.isl_map_empty.restype = c_void_p 9034isl.isl_map_empty.argtypes = [c_void_p] 9035isl.isl_map_eq_at_multi_pw_aff.restype = c_void_p 9036isl.isl_map_eq_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9037isl.isl_map_factor_domain.restype = c_void_p 9038isl.isl_map_factor_domain.argtypes = [c_void_p] 9039isl.isl_map_factor_range.restype = c_void_p 9040isl.isl_map_factor_range.argtypes = [c_void_p] 9041isl.isl_map_flatten.restype = c_void_p 9042isl.isl_map_flatten.argtypes = [c_void_p] 9043isl.isl_map_flatten_domain.restype = c_void_p 9044isl.isl_map_flatten_domain.argtypes = [c_void_p] 9045isl.isl_map_flatten_range.restype = c_void_p 9046isl.isl_map_flatten_range.argtypes = [c_void_p] 9047isl.isl_map_foreach_basic_map.argtypes = [c_void_p, c_void_p, c_void_p] 9048isl.isl_map_gist.restype = c_void_p 9049isl.isl_map_gist.argtypes = [c_void_p, c_void_p] 9050isl.isl_map_gist_domain.restype = c_void_p 9051isl.isl_map_gist_domain.argtypes = [c_void_p, c_void_p] 9052isl.isl_map_has_domain_tuple_id.argtypes = [c_void_p] 9053isl.isl_map_has_range_tuple_id.argtypes = [c_void_p] 9054isl.isl_map_intersect.restype = c_void_p 9055isl.isl_map_intersect.argtypes = [c_void_p, c_void_p] 9056isl.isl_map_intersect_domain.restype = c_void_p 9057isl.isl_map_intersect_domain.argtypes = [c_void_p, c_void_p] 9058isl.isl_map_intersect_domain_factor_domain.restype = c_void_p 9059isl.isl_map_intersect_domain_factor_domain.argtypes = [c_void_p, c_void_p] 9060isl.isl_map_intersect_domain_factor_range.restype = c_void_p 9061isl.isl_map_intersect_domain_factor_range.argtypes = [c_void_p, c_void_p] 9062isl.isl_map_intersect_params.restype = c_void_p 9063isl.isl_map_intersect_params.argtypes = [c_void_p, c_void_p] 9064isl.isl_map_intersect_range.restype = c_void_p 9065isl.isl_map_intersect_range.argtypes = [c_void_p, c_void_p] 9066isl.isl_map_intersect_range_factor_domain.restype = c_void_p 9067isl.isl_map_intersect_range_factor_domain.argtypes = [c_void_p, c_void_p] 9068isl.isl_map_intersect_range_factor_range.restype = c_void_p 9069isl.isl_map_intersect_range_factor_range.argtypes = [c_void_p, c_void_p] 9070isl.isl_map_is_bijective.argtypes = [c_void_p] 9071isl.isl_map_is_disjoint.argtypes = [c_void_p, c_void_p] 9072isl.isl_map_is_empty.argtypes = [c_void_p] 9073isl.isl_map_is_equal.argtypes = [c_void_p, c_void_p] 9074isl.isl_map_is_injective.argtypes = [c_void_p] 9075isl.isl_map_is_single_valued.argtypes = [c_void_p] 9076isl.isl_map_is_strict_subset.argtypes = [c_void_p, c_void_p] 9077isl.isl_map_is_subset.argtypes = [c_void_p, c_void_p] 9078isl.isl_map_lex_ge_at_multi_pw_aff.restype = c_void_p 9079isl.isl_map_lex_ge_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9080isl.isl_map_lex_gt_at_multi_pw_aff.restype = c_void_p 9081isl.isl_map_lex_gt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9082isl.isl_map_lex_le_at_multi_pw_aff.restype = c_void_p 9083isl.isl_map_lex_le_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9084isl.isl_map_lex_lt_at_multi_pw_aff.restype = c_void_p 9085isl.isl_map_lex_lt_at_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9086isl.isl_map_lexmax.restype = c_void_p 9087isl.isl_map_lexmax.argtypes = [c_void_p] 9088isl.isl_map_lexmax_pw_multi_aff.restype = c_void_p 9089isl.isl_map_lexmax_pw_multi_aff.argtypes = [c_void_p] 9090isl.isl_map_lexmin.restype = c_void_p 9091isl.isl_map_lexmin.argtypes = [c_void_p] 9092isl.isl_map_lexmin_pw_multi_aff.restype = c_void_p 9093isl.isl_map_lexmin_pw_multi_aff.argtypes = [c_void_p] 9094isl.isl_map_lower_bound_multi_pw_aff.restype = c_void_p 9095isl.isl_map_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9096isl.isl_map_max_multi_pw_aff.restype = c_void_p 9097isl.isl_map_max_multi_pw_aff.argtypes = [c_void_p] 9098isl.isl_map_min_multi_pw_aff.restype = c_void_p 9099isl.isl_map_min_multi_pw_aff.argtypes = [c_void_p] 9100isl.isl_map_n_basic_map.argtypes = [c_void_p] 9101isl.isl_map_polyhedral_hull.restype = c_void_p 9102isl.isl_map_polyhedral_hull.argtypes = [c_void_p] 9103isl.isl_map_preimage_domain_multi_aff.restype = c_void_p 9104isl.isl_map_preimage_domain_multi_aff.argtypes = [c_void_p, c_void_p] 9105isl.isl_map_preimage_domain_multi_pw_aff.restype = c_void_p 9106isl.isl_map_preimage_domain_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9107isl.isl_map_preimage_domain_pw_multi_aff.restype = c_void_p 9108isl.isl_map_preimage_domain_pw_multi_aff.argtypes = [c_void_p, c_void_p] 9109isl.isl_map_preimage_range_multi_aff.restype = c_void_p 9110isl.isl_map_preimage_range_multi_aff.argtypes = [c_void_p, c_void_p] 9111isl.isl_map_preimage_range_pw_multi_aff.restype = c_void_p 9112isl.isl_map_preimage_range_pw_multi_aff.argtypes = [c_void_p, c_void_p] 9113isl.isl_map_product.restype = c_void_p 9114isl.isl_map_product.argtypes = [c_void_p, c_void_p] 9115isl.isl_map_project_out_all_params.restype = c_void_p 9116isl.isl_map_project_out_all_params.argtypes = [c_void_p] 9117isl.isl_map_range.restype = c_void_p 9118isl.isl_map_range.argtypes = [c_void_p] 9119isl.isl_map_range_factor_domain.restype = c_void_p 9120isl.isl_map_range_factor_domain.argtypes = [c_void_p] 9121isl.isl_map_range_factor_range.restype = c_void_p 9122isl.isl_map_range_factor_range.argtypes = [c_void_p] 9123isl.isl_map_get_range_lattice_tile.restype = c_void_p 9124isl.isl_map_get_range_lattice_tile.argtypes = [c_void_p] 9125isl.isl_map_range_product.restype = c_void_p 9126isl.isl_map_range_product.argtypes = [c_void_p, c_void_p] 9127isl.isl_map_range_reverse.restype = c_void_p 9128isl.isl_map_range_reverse.argtypes = [c_void_p] 9129isl.isl_map_get_range_simple_fixed_box_hull.restype = c_void_p 9130isl.isl_map_get_range_simple_fixed_box_hull.argtypes = [c_void_p] 9131isl.isl_map_range_tuple_dim.argtypes = [c_void_p] 9132isl.isl_map_get_range_tuple_id.restype = c_void_p 9133isl.isl_map_get_range_tuple_id.argtypes = [c_void_p] 9134isl.isl_map_reverse.restype = c_void_p 9135isl.isl_map_reverse.argtypes = [c_void_p] 9136isl.isl_map_sample.restype = c_void_p 9137isl.isl_map_sample.argtypes = [c_void_p] 9138isl.isl_map_set_domain_tuple_id.restype = c_void_p 9139isl.isl_map_set_domain_tuple_id.argtypes = [c_void_p, c_void_p] 9140isl.isl_map_set_range_tuple_id.restype = c_void_p 9141isl.isl_map_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 9142isl.isl_map_get_space.restype = c_void_p 9143isl.isl_map_get_space.argtypes = [c_void_p] 9144isl.isl_map_subtract.restype = c_void_p 9145isl.isl_map_subtract.argtypes = [c_void_p, c_void_p] 9146isl.isl_map_to_list.restype = c_void_p 9147isl.isl_map_to_list.argtypes = [c_void_p] 9148isl.isl_map_to_union_map.restype = c_void_p 9149isl.isl_map_to_union_map.argtypes = [c_void_p] 9150isl.isl_map_uncurry.restype = c_void_p 9151isl.isl_map_uncurry.argtypes = [c_void_p] 9152isl.isl_map_union.restype = c_void_p 9153isl.isl_map_union.argtypes = [c_void_p, c_void_p] 9154isl.isl_map_universe.restype = c_void_p 9155isl.isl_map_universe.argtypes = [c_void_p] 9156isl.isl_map_unshifted_simple_hull.restype = c_void_p 9157isl.isl_map_unshifted_simple_hull.argtypes = [c_void_p] 9158isl.isl_map_upper_bound_multi_pw_aff.restype = c_void_p 9159isl.isl_map_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 9160isl.isl_map_wrap.restype = c_void_p 9161isl.isl_map_wrap.argtypes = [c_void_p] 9162isl.isl_map_zip.restype = c_void_p 9163isl.isl_map_zip.argtypes = [c_void_p] 9164isl.isl_map_copy.restype = c_void_p 9165isl.isl_map_copy.argtypes = [c_void_p] 9166isl.isl_map_free.restype = c_void_p 9167isl.isl_map_free.argtypes = [c_void_p] 9168isl.isl_map_to_str.restype = POINTER(c_char) 9169isl.isl_map_to_str.argtypes = [c_void_p] 9170 9171class basic_map(map): 9172 def __init__(self, *args, **keywords): 9173 if "ptr" in keywords: 9174 self.ctx = keywords["ctx"] 9175 self.ptr = keywords["ptr"] 9176 return 9177 if len(args) == 1 and type(args[0]) == str: 9178 self.ctx = Context.getDefaultInstance() 9179 self.ptr = isl.isl_basic_map_read_from_str(self.ctx, args[0].encode('ascii')) 9180 return 9181 raise Error 9182 def __del__(self): 9183 if hasattr(self, 'ptr'): 9184 isl.isl_basic_map_free(self.ptr) 9185 def __str__(arg0): 9186 try: 9187 if not arg0.__class__ is basic_map: 9188 arg0 = basic_map(arg0) 9189 except: 9190 raise 9191 ptr = isl.isl_basic_map_to_str(arg0.ptr) 9192 res = cast(ptr, c_char_p).value.decode('ascii') 9193 libc.free(ptr) 9194 return res 9195 def __repr__(self): 9196 s = str(self) 9197 if '"' in s: 9198 return 'isl.basic_map("""%s""")' % s 9199 else: 9200 return 'isl.basic_map("%s")' % s 9201 def affine_hull(arg0): 9202 try: 9203 if not arg0.__class__ is basic_map: 9204 arg0 = basic_map(arg0) 9205 except: 9206 raise 9207 ctx = arg0.ctx 9208 res = isl.isl_basic_map_affine_hull(isl.isl_basic_map_copy(arg0.ptr)) 9209 obj = basic_map(ctx=ctx, ptr=res) 9210 return obj 9211 def apply_domain(arg0, arg1): 9212 try: 9213 if not arg0.__class__ is basic_map: 9214 arg0 = basic_map(arg0) 9215 except: 9216 raise 9217 try: 9218 if not arg1.__class__ is basic_map: 9219 arg1 = basic_map(arg1) 9220 except: 9221 return map(arg0).apply_domain(arg1) 9222 ctx = arg0.ctx 9223 res = isl.isl_basic_map_apply_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 9224 obj = basic_map(ctx=ctx, ptr=res) 9225 return obj 9226 def apply_range(arg0, arg1): 9227 try: 9228 if not arg0.__class__ is basic_map: 9229 arg0 = basic_map(arg0) 9230 except: 9231 raise 9232 try: 9233 if not arg1.__class__ is basic_map: 9234 arg1 = basic_map(arg1) 9235 except: 9236 return map(arg0).apply_range(arg1) 9237 ctx = arg0.ctx 9238 res = isl.isl_basic_map_apply_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 9239 obj = basic_map(ctx=ctx, ptr=res) 9240 return obj 9241 def deltas(arg0): 9242 try: 9243 if not arg0.__class__ is basic_map: 9244 arg0 = basic_map(arg0) 9245 except: 9246 raise 9247 ctx = arg0.ctx 9248 res = isl.isl_basic_map_deltas(isl.isl_basic_map_copy(arg0.ptr)) 9249 obj = basic_set(ctx=ctx, ptr=res) 9250 return obj 9251 def detect_equalities(arg0): 9252 try: 9253 if not arg0.__class__ is basic_map: 9254 arg0 = basic_map(arg0) 9255 except: 9256 raise 9257 ctx = arg0.ctx 9258 res = isl.isl_basic_map_detect_equalities(isl.isl_basic_map_copy(arg0.ptr)) 9259 obj = basic_map(ctx=ctx, ptr=res) 9260 return obj 9261 def flatten(arg0): 9262 try: 9263 if not arg0.__class__ is basic_map: 9264 arg0 = basic_map(arg0) 9265 except: 9266 raise 9267 ctx = arg0.ctx 9268 res = isl.isl_basic_map_flatten(isl.isl_basic_map_copy(arg0.ptr)) 9269 obj = basic_map(ctx=ctx, ptr=res) 9270 return obj 9271 def flatten_domain(arg0): 9272 try: 9273 if not arg0.__class__ is basic_map: 9274 arg0 = basic_map(arg0) 9275 except: 9276 raise 9277 ctx = arg0.ctx 9278 res = isl.isl_basic_map_flatten_domain(isl.isl_basic_map_copy(arg0.ptr)) 9279 obj = basic_map(ctx=ctx, ptr=res) 9280 return obj 9281 def flatten_range(arg0): 9282 try: 9283 if not arg0.__class__ is basic_map: 9284 arg0 = basic_map(arg0) 9285 except: 9286 raise 9287 ctx = arg0.ctx 9288 res = isl.isl_basic_map_flatten_range(isl.isl_basic_map_copy(arg0.ptr)) 9289 obj = basic_map(ctx=ctx, ptr=res) 9290 return obj 9291 def gist(arg0, arg1): 9292 try: 9293 if not arg0.__class__ is basic_map: 9294 arg0 = basic_map(arg0) 9295 except: 9296 raise 9297 try: 9298 if not arg1.__class__ is basic_map: 9299 arg1 = basic_map(arg1) 9300 except: 9301 return map(arg0).gist(arg1) 9302 ctx = arg0.ctx 9303 res = isl.isl_basic_map_gist(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 9304 obj = basic_map(ctx=ctx, ptr=res) 9305 return obj 9306 def intersect(arg0, arg1): 9307 try: 9308 if not arg0.__class__ is basic_map: 9309 arg0 = basic_map(arg0) 9310 except: 9311 raise 9312 try: 9313 if not arg1.__class__ is basic_map: 9314 arg1 = basic_map(arg1) 9315 except: 9316 return map(arg0).intersect(arg1) 9317 ctx = arg0.ctx 9318 res = isl.isl_basic_map_intersect(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 9319 obj = basic_map(ctx=ctx, ptr=res) 9320 return obj 9321 def intersect_domain(arg0, arg1): 9322 try: 9323 if not arg0.__class__ is basic_map: 9324 arg0 = basic_map(arg0) 9325 except: 9326 raise 9327 try: 9328 if not arg1.__class__ is basic_set: 9329 arg1 = basic_set(arg1) 9330 except: 9331 return map(arg0).intersect_domain(arg1) 9332 ctx = arg0.ctx 9333 res = isl.isl_basic_map_intersect_domain(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 9334 obj = basic_map(ctx=ctx, ptr=res) 9335 return obj 9336 def intersect_range(arg0, arg1): 9337 try: 9338 if not arg0.__class__ is basic_map: 9339 arg0 = basic_map(arg0) 9340 except: 9341 raise 9342 try: 9343 if not arg1.__class__ is basic_set: 9344 arg1 = basic_set(arg1) 9345 except: 9346 return map(arg0).intersect_range(arg1) 9347 ctx = arg0.ctx 9348 res = isl.isl_basic_map_intersect_range(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 9349 obj = basic_map(ctx=ctx, ptr=res) 9350 return obj 9351 def is_empty(arg0): 9352 try: 9353 if not arg0.__class__ is basic_map: 9354 arg0 = basic_map(arg0) 9355 except: 9356 raise 9357 ctx = arg0.ctx 9358 res = isl.isl_basic_map_is_empty(arg0.ptr) 9359 if res < 0: 9360 raise 9361 return bool(res) 9362 def is_equal(arg0, arg1): 9363 try: 9364 if not arg0.__class__ is basic_map: 9365 arg0 = basic_map(arg0) 9366 except: 9367 raise 9368 try: 9369 if not arg1.__class__ is basic_map: 9370 arg1 = basic_map(arg1) 9371 except: 9372 return map(arg0).is_equal(arg1) 9373 ctx = arg0.ctx 9374 res = isl.isl_basic_map_is_equal(arg0.ptr, arg1.ptr) 9375 if res < 0: 9376 raise 9377 return bool(res) 9378 def is_subset(arg0, arg1): 9379 try: 9380 if not arg0.__class__ is basic_map: 9381 arg0 = basic_map(arg0) 9382 except: 9383 raise 9384 try: 9385 if not arg1.__class__ is basic_map: 9386 arg1 = basic_map(arg1) 9387 except: 9388 return map(arg0).is_subset(arg1) 9389 ctx = arg0.ctx 9390 res = isl.isl_basic_map_is_subset(arg0.ptr, arg1.ptr) 9391 if res < 0: 9392 raise 9393 return bool(res) 9394 def lexmax(arg0): 9395 try: 9396 if not arg0.__class__ is basic_map: 9397 arg0 = basic_map(arg0) 9398 except: 9399 raise 9400 ctx = arg0.ctx 9401 res = isl.isl_basic_map_lexmax(isl.isl_basic_map_copy(arg0.ptr)) 9402 obj = map(ctx=ctx, ptr=res) 9403 return obj 9404 def lexmin(arg0): 9405 try: 9406 if not arg0.__class__ is basic_map: 9407 arg0 = basic_map(arg0) 9408 except: 9409 raise 9410 ctx = arg0.ctx 9411 res = isl.isl_basic_map_lexmin(isl.isl_basic_map_copy(arg0.ptr)) 9412 obj = map(ctx=ctx, ptr=res) 9413 return obj 9414 def reverse(arg0): 9415 try: 9416 if not arg0.__class__ is basic_map: 9417 arg0 = basic_map(arg0) 9418 except: 9419 raise 9420 ctx = arg0.ctx 9421 res = isl.isl_basic_map_reverse(isl.isl_basic_map_copy(arg0.ptr)) 9422 obj = basic_map(ctx=ctx, ptr=res) 9423 return obj 9424 def sample(arg0): 9425 try: 9426 if not arg0.__class__ is basic_map: 9427 arg0 = basic_map(arg0) 9428 except: 9429 raise 9430 ctx = arg0.ctx 9431 res = isl.isl_basic_map_sample(isl.isl_basic_map_copy(arg0.ptr)) 9432 obj = basic_map(ctx=ctx, ptr=res) 9433 return obj 9434 def union(arg0, arg1): 9435 try: 9436 if not arg0.__class__ is basic_map: 9437 arg0 = basic_map(arg0) 9438 except: 9439 raise 9440 try: 9441 if not arg1.__class__ is basic_map: 9442 arg1 = basic_map(arg1) 9443 except: 9444 return map(arg0).union(arg1) 9445 ctx = arg0.ctx 9446 res = isl.isl_basic_map_union(isl.isl_basic_map_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 9447 obj = map(ctx=ctx, ptr=res) 9448 return obj 9449 9450isl.isl_basic_map_read_from_str.restype = c_void_p 9451isl.isl_basic_map_read_from_str.argtypes = [Context, c_char_p] 9452isl.isl_basic_map_affine_hull.restype = c_void_p 9453isl.isl_basic_map_affine_hull.argtypes = [c_void_p] 9454isl.isl_basic_map_apply_domain.restype = c_void_p 9455isl.isl_basic_map_apply_domain.argtypes = [c_void_p, c_void_p] 9456isl.isl_basic_map_apply_range.restype = c_void_p 9457isl.isl_basic_map_apply_range.argtypes = [c_void_p, c_void_p] 9458isl.isl_basic_map_deltas.restype = c_void_p 9459isl.isl_basic_map_deltas.argtypes = [c_void_p] 9460isl.isl_basic_map_detect_equalities.restype = c_void_p 9461isl.isl_basic_map_detect_equalities.argtypes = [c_void_p] 9462isl.isl_basic_map_flatten.restype = c_void_p 9463isl.isl_basic_map_flatten.argtypes = [c_void_p] 9464isl.isl_basic_map_flatten_domain.restype = c_void_p 9465isl.isl_basic_map_flatten_domain.argtypes = [c_void_p] 9466isl.isl_basic_map_flatten_range.restype = c_void_p 9467isl.isl_basic_map_flatten_range.argtypes = [c_void_p] 9468isl.isl_basic_map_gist.restype = c_void_p 9469isl.isl_basic_map_gist.argtypes = [c_void_p, c_void_p] 9470isl.isl_basic_map_intersect.restype = c_void_p 9471isl.isl_basic_map_intersect.argtypes = [c_void_p, c_void_p] 9472isl.isl_basic_map_intersect_domain.restype = c_void_p 9473isl.isl_basic_map_intersect_domain.argtypes = [c_void_p, c_void_p] 9474isl.isl_basic_map_intersect_range.restype = c_void_p 9475isl.isl_basic_map_intersect_range.argtypes = [c_void_p, c_void_p] 9476isl.isl_basic_map_is_empty.argtypes = [c_void_p] 9477isl.isl_basic_map_is_equal.argtypes = [c_void_p, c_void_p] 9478isl.isl_basic_map_is_subset.argtypes = [c_void_p, c_void_p] 9479isl.isl_basic_map_lexmax.restype = c_void_p 9480isl.isl_basic_map_lexmax.argtypes = [c_void_p] 9481isl.isl_basic_map_lexmin.restype = c_void_p 9482isl.isl_basic_map_lexmin.argtypes = [c_void_p] 9483isl.isl_basic_map_reverse.restype = c_void_p 9484isl.isl_basic_map_reverse.argtypes = [c_void_p] 9485isl.isl_basic_map_sample.restype = c_void_p 9486isl.isl_basic_map_sample.argtypes = [c_void_p] 9487isl.isl_basic_map_union.restype = c_void_p 9488isl.isl_basic_map_union.argtypes = [c_void_p, c_void_p] 9489isl.isl_basic_map_copy.restype = c_void_p 9490isl.isl_basic_map_copy.argtypes = [c_void_p] 9491isl.isl_basic_map_free.restype = c_void_p 9492isl.isl_basic_map_free.argtypes = [c_void_p] 9493isl.isl_basic_map_to_str.restype = POINTER(c_char) 9494isl.isl_basic_map_to_str.argtypes = [c_void_p] 9495 9496class union_set(object): 9497 def __init__(self, *args, **keywords): 9498 if "ptr" in keywords: 9499 self.ctx = keywords["ctx"] 9500 self.ptr = keywords["ptr"] 9501 return 9502 if len(args) == 1 and args[0].__class__ is basic_set: 9503 self.ctx = Context.getDefaultInstance() 9504 self.ptr = isl.isl_union_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 9505 return 9506 if len(args) == 1 and args[0].__class__ is point: 9507 self.ctx = Context.getDefaultInstance() 9508 self.ptr = isl.isl_union_set_from_point(isl.isl_point_copy(args[0].ptr)) 9509 return 9510 if len(args) == 1 and args[0].__class__ is set: 9511 self.ctx = Context.getDefaultInstance() 9512 self.ptr = isl.isl_union_set_from_set(isl.isl_set_copy(args[0].ptr)) 9513 return 9514 if len(args) == 1 and type(args[0]) == str: 9515 self.ctx = Context.getDefaultInstance() 9516 self.ptr = isl.isl_union_set_read_from_str(self.ctx, args[0].encode('ascii')) 9517 return 9518 raise Error 9519 def __del__(self): 9520 if hasattr(self, 'ptr'): 9521 isl.isl_union_set_free(self.ptr) 9522 def __str__(arg0): 9523 try: 9524 if not arg0.__class__ is union_set: 9525 arg0 = union_set(arg0) 9526 except: 9527 raise 9528 ptr = isl.isl_union_set_to_str(arg0.ptr) 9529 res = cast(ptr, c_char_p).value.decode('ascii') 9530 libc.free(ptr) 9531 return res 9532 def __repr__(self): 9533 s = str(self) 9534 if '"' in s: 9535 return 'isl.union_set("""%s""")' % s 9536 else: 9537 return 'isl.union_set("%s")' % s 9538 def affine_hull(arg0): 9539 try: 9540 if not arg0.__class__ is union_set: 9541 arg0 = union_set(arg0) 9542 except: 9543 raise 9544 ctx = arg0.ctx 9545 res = isl.isl_union_set_affine_hull(isl.isl_union_set_copy(arg0.ptr)) 9546 obj = union_set(ctx=ctx, ptr=res) 9547 return obj 9548 def apply(arg0, arg1): 9549 try: 9550 if not arg0.__class__ is union_set: 9551 arg0 = union_set(arg0) 9552 except: 9553 raise 9554 try: 9555 if not arg1.__class__ is union_map: 9556 arg1 = union_map(arg1) 9557 except: 9558 raise 9559 ctx = arg0.ctx 9560 res = isl.isl_union_set_apply(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 9561 obj = union_set(ctx=ctx, ptr=res) 9562 return obj 9563 def as_set(arg0): 9564 try: 9565 if not arg0.__class__ is union_set: 9566 arg0 = union_set(arg0) 9567 except: 9568 raise 9569 ctx = arg0.ctx 9570 res = isl.isl_union_set_as_set(isl.isl_union_set_copy(arg0.ptr)) 9571 obj = set(ctx=ctx, ptr=res) 9572 return obj 9573 def coalesce(arg0): 9574 try: 9575 if not arg0.__class__ is union_set: 9576 arg0 = union_set(arg0) 9577 except: 9578 raise 9579 ctx = arg0.ctx 9580 res = isl.isl_union_set_coalesce(isl.isl_union_set_copy(arg0.ptr)) 9581 obj = union_set(ctx=ctx, ptr=res) 9582 return obj 9583 def compute_divs(arg0): 9584 try: 9585 if not arg0.__class__ is union_set: 9586 arg0 = union_set(arg0) 9587 except: 9588 raise 9589 ctx = arg0.ctx 9590 res = isl.isl_union_set_compute_divs(isl.isl_union_set_copy(arg0.ptr)) 9591 obj = union_set(ctx=ctx, ptr=res) 9592 return obj 9593 def detect_equalities(arg0): 9594 try: 9595 if not arg0.__class__ is union_set: 9596 arg0 = union_set(arg0) 9597 except: 9598 raise 9599 ctx = arg0.ctx 9600 res = isl.isl_union_set_detect_equalities(isl.isl_union_set_copy(arg0.ptr)) 9601 obj = union_set(ctx=ctx, ptr=res) 9602 return obj 9603 @staticmethod 9604 def empty(*args): 9605 if len(args) == 0: 9606 ctx = Context.getDefaultInstance() 9607 res = isl.isl_union_set_empty_ctx(ctx) 9608 obj = union_set(ctx=ctx, ptr=res) 9609 return obj 9610 raise Error 9611 def every_set(arg0, arg1): 9612 try: 9613 if not arg0.__class__ is union_set: 9614 arg0 = union_set(arg0) 9615 except: 9616 raise 9617 exc_info = [None] 9618 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9619 def cb_func(cb_arg0, cb_arg1): 9620 cb_arg0 = set(ctx=arg0.ctx, ptr=isl.isl_set_copy(cb_arg0)) 9621 try: 9622 res = arg1(cb_arg0) 9623 except BaseException as e: 9624 exc_info[0] = e 9625 return -1 9626 return 1 if res else 0 9627 cb = fn(cb_func) 9628 ctx = arg0.ctx 9629 res = isl.isl_union_set_every_set(arg0.ptr, cb, None) 9630 if exc_info[0] is not None: 9631 raise exc_info[0] 9632 if res < 0: 9633 raise 9634 return bool(res) 9635 def extract_set(arg0, arg1): 9636 try: 9637 if not arg0.__class__ is union_set: 9638 arg0 = union_set(arg0) 9639 except: 9640 raise 9641 try: 9642 if not arg1.__class__ is space: 9643 arg1 = space(arg1) 9644 except: 9645 raise 9646 ctx = arg0.ctx 9647 res = isl.isl_union_set_extract_set(arg0.ptr, isl.isl_space_copy(arg1.ptr)) 9648 obj = set(ctx=ctx, ptr=res) 9649 return obj 9650 def foreach_point(arg0, arg1): 9651 try: 9652 if not arg0.__class__ is union_set: 9653 arg0 = union_set(arg0) 9654 except: 9655 raise 9656 exc_info = [None] 9657 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9658 def cb_func(cb_arg0, cb_arg1): 9659 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 9660 try: 9661 arg1(cb_arg0) 9662 except BaseException as e: 9663 exc_info[0] = e 9664 return -1 9665 return 0 9666 cb = fn(cb_func) 9667 ctx = arg0.ctx 9668 res = isl.isl_union_set_foreach_point(arg0.ptr, cb, None) 9669 if exc_info[0] is not None: 9670 raise exc_info[0] 9671 if res < 0: 9672 raise 9673 def foreach_set(arg0, arg1): 9674 try: 9675 if not arg0.__class__ is union_set: 9676 arg0 = union_set(arg0) 9677 except: 9678 raise 9679 exc_info = [None] 9680 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 9681 def cb_func(cb_arg0, cb_arg1): 9682 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 9683 try: 9684 arg1(cb_arg0) 9685 except BaseException as e: 9686 exc_info[0] = e 9687 return -1 9688 return 0 9689 cb = fn(cb_func) 9690 ctx = arg0.ctx 9691 res = isl.isl_union_set_foreach_set(arg0.ptr, cb, None) 9692 if exc_info[0] is not None: 9693 raise exc_info[0] 9694 if res < 0: 9695 raise 9696 def gist(arg0, arg1): 9697 try: 9698 if not arg0.__class__ is union_set: 9699 arg0 = union_set(arg0) 9700 except: 9701 raise 9702 try: 9703 if not arg1.__class__ is union_set: 9704 arg1 = union_set(arg1) 9705 except: 9706 raise 9707 ctx = arg0.ctx 9708 res = isl.isl_union_set_gist(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9709 obj = union_set(ctx=ctx, ptr=res) 9710 return obj 9711 def gist_params(arg0, arg1): 9712 try: 9713 if not arg0.__class__ is union_set: 9714 arg0 = union_set(arg0) 9715 except: 9716 raise 9717 try: 9718 if not arg1.__class__ is set: 9719 arg1 = set(arg1) 9720 except: 9721 raise 9722 ctx = arg0.ctx 9723 res = isl.isl_union_set_gist_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9724 obj = union_set(ctx=ctx, ptr=res) 9725 return obj 9726 def identity(arg0): 9727 try: 9728 if not arg0.__class__ is union_set: 9729 arg0 = union_set(arg0) 9730 except: 9731 raise 9732 ctx = arg0.ctx 9733 res = isl.isl_union_set_identity(isl.isl_union_set_copy(arg0.ptr)) 9734 obj = union_map(ctx=ctx, ptr=res) 9735 return obj 9736 def intersect(arg0, arg1): 9737 try: 9738 if not arg0.__class__ is union_set: 9739 arg0 = union_set(arg0) 9740 except: 9741 raise 9742 try: 9743 if not arg1.__class__ is union_set: 9744 arg1 = union_set(arg1) 9745 except: 9746 raise 9747 ctx = arg0.ctx 9748 res = isl.isl_union_set_intersect(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9749 obj = union_set(ctx=ctx, ptr=res) 9750 return obj 9751 def intersect_params(arg0, arg1): 9752 try: 9753 if not arg0.__class__ is union_set: 9754 arg0 = union_set(arg0) 9755 except: 9756 raise 9757 try: 9758 if not arg1.__class__ is set: 9759 arg1 = set(arg1) 9760 except: 9761 raise 9762 ctx = arg0.ctx 9763 res = isl.isl_union_set_intersect_params(isl.isl_union_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 9764 obj = union_set(ctx=ctx, ptr=res) 9765 return obj 9766 def is_disjoint(arg0, arg1): 9767 try: 9768 if not arg0.__class__ is union_set: 9769 arg0 = union_set(arg0) 9770 except: 9771 raise 9772 try: 9773 if not arg1.__class__ is union_set: 9774 arg1 = union_set(arg1) 9775 except: 9776 raise 9777 ctx = arg0.ctx 9778 res = isl.isl_union_set_is_disjoint(arg0.ptr, arg1.ptr) 9779 if res < 0: 9780 raise 9781 return bool(res) 9782 def is_empty(arg0): 9783 try: 9784 if not arg0.__class__ is union_set: 9785 arg0 = union_set(arg0) 9786 except: 9787 raise 9788 ctx = arg0.ctx 9789 res = isl.isl_union_set_is_empty(arg0.ptr) 9790 if res < 0: 9791 raise 9792 return bool(res) 9793 def is_equal(arg0, arg1): 9794 try: 9795 if not arg0.__class__ is union_set: 9796 arg0 = union_set(arg0) 9797 except: 9798 raise 9799 try: 9800 if not arg1.__class__ is union_set: 9801 arg1 = union_set(arg1) 9802 except: 9803 raise 9804 ctx = arg0.ctx 9805 res = isl.isl_union_set_is_equal(arg0.ptr, arg1.ptr) 9806 if res < 0: 9807 raise 9808 return bool(res) 9809 def is_strict_subset(arg0, arg1): 9810 try: 9811 if not arg0.__class__ is union_set: 9812 arg0 = union_set(arg0) 9813 except: 9814 raise 9815 try: 9816 if not arg1.__class__ is union_set: 9817 arg1 = union_set(arg1) 9818 except: 9819 raise 9820 ctx = arg0.ctx 9821 res = isl.isl_union_set_is_strict_subset(arg0.ptr, arg1.ptr) 9822 if res < 0: 9823 raise 9824 return bool(res) 9825 def is_subset(arg0, arg1): 9826 try: 9827 if not arg0.__class__ is union_set: 9828 arg0 = union_set(arg0) 9829 except: 9830 raise 9831 try: 9832 if not arg1.__class__ is union_set: 9833 arg1 = union_set(arg1) 9834 except: 9835 raise 9836 ctx = arg0.ctx 9837 res = isl.isl_union_set_is_subset(arg0.ptr, arg1.ptr) 9838 if res < 0: 9839 raise 9840 return bool(res) 9841 def isa_set(arg0): 9842 try: 9843 if not arg0.__class__ is union_set: 9844 arg0 = union_set(arg0) 9845 except: 9846 raise 9847 ctx = arg0.ctx 9848 res = isl.isl_union_set_isa_set(arg0.ptr) 9849 if res < 0: 9850 raise 9851 return bool(res) 9852 def lexmax(arg0): 9853 try: 9854 if not arg0.__class__ is union_set: 9855 arg0 = union_set(arg0) 9856 except: 9857 raise 9858 ctx = arg0.ctx 9859 res = isl.isl_union_set_lexmax(isl.isl_union_set_copy(arg0.ptr)) 9860 obj = union_set(ctx=ctx, ptr=res) 9861 return obj 9862 def lexmin(arg0): 9863 try: 9864 if not arg0.__class__ is union_set: 9865 arg0 = union_set(arg0) 9866 except: 9867 raise 9868 ctx = arg0.ctx 9869 res = isl.isl_union_set_lexmin(isl.isl_union_set_copy(arg0.ptr)) 9870 obj = union_set(ctx=ctx, ptr=res) 9871 return obj 9872 def polyhedral_hull(arg0): 9873 try: 9874 if not arg0.__class__ is union_set: 9875 arg0 = union_set(arg0) 9876 except: 9877 raise 9878 ctx = arg0.ctx 9879 res = isl.isl_union_set_polyhedral_hull(isl.isl_union_set_copy(arg0.ptr)) 9880 obj = union_set(ctx=ctx, ptr=res) 9881 return obj 9882 def preimage(*args): 9883 if len(args) == 2 and args[1].__class__ is multi_aff: 9884 ctx = args[0].ctx 9885 res = isl.isl_union_set_preimage_multi_aff(isl.isl_union_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 9886 obj = union_set(ctx=ctx, ptr=res) 9887 return obj 9888 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 9889 ctx = args[0].ctx 9890 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)) 9891 obj = union_set(ctx=ctx, ptr=res) 9892 return obj 9893 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 9894 ctx = args[0].ctx 9895 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)) 9896 obj = union_set(ctx=ctx, ptr=res) 9897 return obj 9898 raise Error 9899 def sample_point(arg0): 9900 try: 9901 if not arg0.__class__ is union_set: 9902 arg0 = union_set(arg0) 9903 except: 9904 raise 9905 ctx = arg0.ctx 9906 res = isl.isl_union_set_sample_point(isl.isl_union_set_copy(arg0.ptr)) 9907 obj = point(ctx=ctx, ptr=res) 9908 return obj 9909 def set_list(arg0): 9910 try: 9911 if not arg0.__class__ is union_set: 9912 arg0 = union_set(arg0) 9913 except: 9914 raise 9915 ctx = arg0.ctx 9916 res = isl.isl_union_set_get_set_list(arg0.ptr) 9917 obj = set_list(ctx=ctx, ptr=res) 9918 return obj 9919 def get_set_list(arg0): 9920 return arg0.set_list() 9921 def space(arg0): 9922 try: 9923 if not arg0.__class__ is union_set: 9924 arg0 = union_set(arg0) 9925 except: 9926 raise 9927 ctx = arg0.ctx 9928 res = isl.isl_union_set_get_space(arg0.ptr) 9929 obj = space(ctx=ctx, ptr=res) 9930 return obj 9931 def get_space(arg0): 9932 return arg0.space() 9933 def subtract(arg0, arg1): 9934 try: 9935 if not arg0.__class__ is union_set: 9936 arg0 = union_set(arg0) 9937 except: 9938 raise 9939 try: 9940 if not arg1.__class__ is union_set: 9941 arg1 = union_set(arg1) 9942 except: 9943 raise 9944 ctx = arg0.ctx 9945 res = isl.isl_union_set_subtract(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9946 obj = union_set(ctx=ctx, ptr=res) 9947 return obj 9948 def to_list(arg0): 9949 try: 9950 if not arg0.__class__ is union_set: 9951 arg0 = union_set(arg0) 9952 except: 9953 raise 9954 ctx = arg0.ctx 9955 res = isl.isl_union_set_to_list(isl.isl_union_set_copy(arg0.ptr)) 9956 obj = union_set_list(ctx=ctx, ptr=res) 9957 return obj 9958 def union(arg0, arg1): 9959 try: 9960 if not arg0.__class__ is union_set: 9961 arg0 = union_set(arg0) 9962 except: 9963 raise 9964 try: 9965 if not arg1.__class__ is union_set: 9966 arg1 = union_set(arg1) 9967 except: 9968 raise 9969 ctx = arg0.ctx 9970 res = isl.isl_union_set_union(isl.isl_union_set_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 9971 obj = union_set(ctx=ctx, ptr=res) 9972 return obj 9973 def universe(arg0): 9974 try: 9975 if not arg0.__class__ is union_set: 9976 arg0 = union_set(arg0) 9977 except: 9978 raise 9979 ctx = arg0.ctx 9980 res = isl.isl_union_set_universe(isl.isl_union_set_copy(arg0.ptr)) 9981 obj = union_set(ctx=ctx, ptr=res) 9982 return obj 9983 def unwrap(arg0): 9984 try: 9985 if not arg0.__class__ is union_set: 9986 arg0 = union_set(arg0) 9987 except: 9988 raise 9989 ctx = arg0.ctx 9990 res = isl.isl_union_set_unwrap(isl.isl_union_set_copy(arg0.ptr)) 9991 obj = union_map(ctx=ctx, ptr=res) 9992 return obj 9993 9994isl.isl_union_set_from_basic_set.restype = c_void_p 9995isl.isl_union_set_from_basic_set.argtypes = [c_void_p] 9996isl.isl_union_set_from_point.restype = c_void_p 9997isl.isl_union_set_from_point.argtypes = [c_void_p] 9998isl.isl_union_set_from_set.restype = c_void_p 9999isl.isl_union_set_from_set.argtypes = [c_void_p] 10000isl.isl_union_set_read_from_str.restype = c_void_p 10001isl.isl_union_set_read_from_str.argtypes = [Context, c_char_p] 10002isl.isl_union_set_affine_hull.restype = c_void_p 10003isl.isl_union_set_affine_hull.argtypes = [c_void_p] 10004isl.isl_union_set_apply.restype = c_void_p 10005isl.isl_union_set_apply.argtypes = [c_void_p, c_void_p] 10006isl.isl_union_set_as_set.restype = c_void_p 10007isl.isl_union_set_as_set.argtypes = [c_void_p] 10008isl.isl_union_set_coalesce.restype = c_void_p 10009isl.isl_union_set_coalesce.argtypes = [c_void_p] 10010isl.isl_union_set_compute_divs.restype = c_void_p 10011isl.isl_union_set_compute_divs.argtypes = [c_void_p] 10012isl.isl_union_set_detect_equalities.restype = c_void_p 10013isl.isl_union_set_detect_equalities.argtypes = [c_void_p] 10014isl.isl_union_set_empty_ctx.restype = c_void_p 10015isl.isl_union_set_empty_ctx.argtypes = [Context] 10016isl.isl_union_set_every_set.argtypes = [c_void_p, c_void_p, c_void_p] 10017isl.isl_union_set_extract_set.restype = c_void_p 10018isl.isl_union_set_extract_set.argtypes = [c_void_p, c_void_p] 10019isl.isl_union_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 10020isl.isl_union_set_foreach_set.argtypes = [c_void_p, c_void_p, c_void_p] 10021isl.isl_union_set_gist.restype = c_void_p 10022isl.isl_union_set_gist.argtypes = [c_void_p, c_void_p] 10023isl.isl_union_set_gist_params.restype = c_void_p 10024isl.isl_union_set_gist_params.argtypes = [c_void_p, c_void_p] 10025isl.isl_union_set_identity.restype = c_void_p 10026isl.isl_union_set_identity.argtypes = [c_void_p] 10027isl.isl_union_set_intersect.restype = c_void_p 10028isl.isl_union_set_intersect.argtypes = [c_void_p, c_void_p] 10029isl.isl_union_set_intersect_params.restype = c_void_p 10030isl.isl_union_set_intersect_params.argtypes = [c_void_p, c_void_p] 10031isl.isl_union_set_is_disjoint.argtypes = [c_void_p, c_void_p] 10032isl.isl_union_set_is_empty.argtypes = [c_void_p] 10033isl.isl_union_set_is_equal.argtypes = [c_void_p, c_void_p] 10034isl.isl_union_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 10035isl.isl_union_set_is_subset.argtypes = [c_void_p, c_void_p] 10036isl.isl_union_set_isa_set.argtypes = [c_void_p] 10037isl.isl_union_set_lexmax.restype = c_void_p 10038isl.isl_union_set_lexmax.argtypes = [c_void_p] 10039isl.isl_union_set_lexmin.restype = c_void_p 10040isl.isl_union_set_lexmin.argtypes = [c_void_p] 10041isl.isl_union_set_polyhedral_hull.restype = c_void_p 10042isl.isl_union_set_polyhedral_hull.argtypes = [c_void_p] 10043isl.isl_union_set_preimage_multi_aff.restype = c_void_p 10044isl.isl_union_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 10045isl.isl_union_set_preimage_pw_multi_aff.restype = c_void_p 10046isl.isl_union_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10047isl.isl_union_set_preimage_union_pw_multi_aff.restype = c_void_p 10048isl.isl_union_set_preimage_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10049isl.isl_union_set_sample_point.restype = c_void_p 10050isl.isl_union_set_sample_point.argtypes = [c_void_p] 10051isl.isl_union_set_get_set_list.restype = c_void_p 10052isl.isl_union_set_get_set_list.argtypes = [c_void_p] 10053isl.isl_union_set_get_space.restype = c_void_p 10054isl.isl_union_set_get_space.argtypes = [c_void_p] 10055isl.isl_union_set_subtract.restype = c_void_p 10056isl.isl_union_set_subtract.argtypes = [c_void_p, c_void_p] 10057isl.isl_union_set_to_list.restype = c_void_p 10058isl.isl_union_set_to_list.argtypes = [c_void_p] 10059isl.isl_union_set_union.restype = c_void_p 10060isl.isl_union_set_union.argtypes = [c_void_p, c_void_p] 10061isl.isl_union_set_universe.restype = c_void_p 10062isl.isl_union_set_universe.argtypes = [c_void_p] 10063isl.isl_union_set_unwrap.restype = c_void_p 10064isl.isl_union_set_unwrap.argtypes = [c_void_p] 10065isl.isl_union_set_copy.restype = c_void_p 10066isl.isl_union_set_copy.argtypes = [c_void_p] 10067isl.isl_union_set_free.restype = c_void_p 10068isl.isl_union_set_free.argtypes = [c_void_p] 10069isl.isl_union_set_to_str.restype = POINTER(c_char) 10070isl.isl_union_set_to_str.argtypes = [c_void_p] 10071 10072class set(union_set): 10073 def __init__(self, *args, **keywords): 10074 if "ptr" in keywords: 10075 self.ctx = keywords["ctx"] 10076 self.ptr = keywords["ptr"] 10077 return 10078 if len(args) == 1 and args[0].__class__ is basic_set: 10079 self.ctx = Context.getDefaultInstance() 10080 self.ptr = isl.isl_set_from_basic_set(isl.isl_basic_set_copy(args[0].ptr)) 10081 return 10082 if len(args) == 1 and args[0].__class__ is point: 10083 self.ctx = Context.getDefaultInstance() 10084 self.ptr = isl.isl_set_from_point(isl.isl_point_copy(args[0].ptr)) 10085 return 10086 if len(args) == 1 and type(args[0]) == str: 10087 self.ctx = Context.getDefaultInstance() 10088 self.ptr = isl.isl_set_read_from_str(self.ctx, args[0].encode('ascii')) 10089 return 10090 raise Error 10091 def __del__(self): 10092 if hasattr(self, 'ptr'): 10093 isl.isl_set_free(self.ptr) 10094 def __str__(arg0): 10095 try: 10096 if not arg0.__class__ is set: 10097 arg0 = set(arg0) 10098 except: 10099 raise 10100 ptr = isl.isl_set_to_str(arg0.ptr) 10101 res = cast(ptr, c_char_p).value.decode('ascii') 10102 libc.free(ptr) 10103 return res 10104 def __repr__(self): 10105 s = str(self) 10106 if '"' in s: 10107 return 'isl.set("""%s""")' % s 10108 else: 10109 return 'isl.set("%s")' % s 10110 def affine_hull(arg0): 10111 try: 10112 if not arg0.__class__ is set: 10113 arg0 = set(arg0) 10114 except: 10115 raise 10116 ctx = arg0.ctx 10117 res = isl.isl_set_affine_hull(isl.isl_set_copy(arg0.ptr)) 10118 obj = basic_set(ctx=ctx, ptr=res) 10119 return obj 10120 def apply(arg0, arg1): 10121 try: 10122 if not arg0.__class__ is set: 10123 arg0 = set(arg0) 10124 except: 10125 raise 10126 try: 10127 if not arg1.__class__ is map: 10128 arg1 = map(arg1) 10129 except: 10130 return union_set(arg0).apply(arg1) 10131 ctx = arg0.ctx 10132 res = isl.isl_set_apply(isl.isl_set_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 10133 obj = set(ctx=ctx, ptr=res) 10134 return obj 10135 def as_pw_multi_aff(arg0): 10136 try: 10137 if not arg0.__class__ is set: 10138 arg0 = set(arg0) 10139 except: 10140 raise 10141 ctx = arg0.ctx 10142 res = isl.isl_set_as_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 10143 obj = pw_multi_aff(ctx=ctx, ptr=res) 10144 return obj 10145 def bind(arg0, arg1): 10146 try: 10147 if not arg0.__class__ is set: 10148 arg0 = set(arg0) 10149 except: 10150 raise 10151 try: 10152 if not arg1.__class__ is multi_id: 10153 arg1 = multi_id(arg1) 10154 except: 10155 return union_set(arg0).bind(arg1) 10156 ctx = arg0.ctx 10157 res = isl.isl_set_bind(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 10158 obj = set(ctx=ctx, ptr=res) 10159 return obj 10160 def coalesce(arg0): 10161 try: 10162 if not arg0.__class__ is set: 10163 arg0 = set(arg0) 10164 except: 10165 raise 10166 ctx = arg0.ctx 10167 res = isl.isl_set_coalesce(isl.isl_set_copy(arg0.ptr)) 10168 obj = set(ctx=ctx, ptr=res) 10169 return obj 10170 def complement(arg0): 10171 try: 10172 if not arg0.__class__ is set: 10173 arg0 = set(arg0) 10174 except: 10175 raise 10176 ctx = arg0.ctx 10177 res = isl.isl_set_complement(isl.isl_set_copy(arg0.ptr)) 10178 obj = set(ctx=ctx, ptr=res) 10179 return obj 10180 def detect_equalities(arg0): 10181 try: 10182 if not arg0.__class__ is set: 10183 arg0 = set(arg0) 10184 except: 10185 raise 10186 ctx = arg0.ctx 10187 res = isl.isl_set_detect_equalities(isl.isl_set_copy(arg0.ptr)) 10188 obj = set(ctx=ctx, ptr=res) 10189 return obj 10190 def dim_max_val(arg0, arg1): 10191 try: 10192 if not arg0.__class__ is set: 10193 arg0 = set(arg0) 10194 except: 10195 raise 10196 ctx = arg0.ctx 10197 res = isl.isl_set_dim_max_val(isl.isl_set_copy(arg0.ptr), arg1) 10198 obj = val(ctx=ctx, ptr=res) 10199 return obj 10200 def dim_min_val(arg0, arg1): 10201 try: 10202 if not arg0.__class__ is set: 10203 arg0 = set(arg0) 10204 except: 10205 raise 10206 ctx = arg0.ctx 10207 res = isl.isl_set_dim_min_val(isl.isl_set_copy(arg0.ptr), arg1) 10208 obj = val(ctx=ctx, ptr=res) 10209 return obj 10210 @staticmethod 10211 def empty(arg0): 10212 try: 10213 if not arg0.__class__ is space: 10214 arg0 = space(arg0) 10215 except: 10216 raise 10217 ctx = arg0.ctx 10218 res = isl.isl_set_empty(isl.isl_space_copy(arg0.ptr)) 10219 obj = set(ctx=ctx, ptr=res) 10220 return obj 10221 def flatten(arg0): 10222 try: 10223 if not arg0.__class__ is set: 10224 arg0 = set(arg0) 10225 except: 10226 raise 10227 ctx = arg0.ctx 10228 res = isl.isl_set_flatten(isl.isl_set_copy(arg0.ptr)) 10229 obj = set(ctx=ctx, ptr=res) 10230 return obj 10231 def foreach_basic_set(arg0, arg1): 10232 try: 10233 if not arg0.__class__ is set: 10234 arg0 = set(arg0) 10235 except: 10236 raise 10237 exc_info = [None] 10238 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10239 def cb_func(cb_arg0, cb_arg1): 10240 cb_arg0 = basic_set(ctx=arg0.ctx, ptr=(cb_arg0)) 10241 try: 10242 arg1(cb_arg0) 10243 except BaseException as e: 10244 exc_info[0] = e 10245 return -1 10246 return 0 10247 cb = fn(cb_func) 10248 ctx = arg0.ctx 10249 res = isl.isl_set_foreach_basic_set(arg0.ptr, cb, None) 10250 if exc_info[0] is not None: 10251 raise exc_info[0] 10252 if res < 0: 10253 raise 10254 def foreach_point(arg0, arg1): 10255 try: 10256 if not arg0.__class__ is set: 10257 arg0 = set(arg0) 10258 except: 10259 raise 10260 exc_info = [None] 10261 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 10262 def cb_func(cb_arg0, cb_arg1): 10263 cb_arg0 = point(ctx=arg0.ctx, ptr=(cb_arg0)) 10264 try: 10265 arg1(cb_arg0) 10266 except BaseException as e: 10267 exc_info[0] = e 10268 return -1 10269 return 0 10270 cb = fn(cb_func) 10271 ctx = arg0.ctx 10272 res = isl.isl_set_foreach_point(arg0.ptr, cb, None) 10273 if exc_info[0] is not None: 10274 raise exc_info[0] 10275 if res < 0: 10276 raise 10277 def gist(arg0, arg1): 10278 try: 10279 if not arg0.__class__ is set: 10280 arg0 = set(arg0) 10281 except: 10282 raise 10283 try: 10284 if not arg1.__class__ is set: 10285 arg1 = set(arg1) 10286 except: 10287 return union_set(arg0).gist(arg1) 10288 ctx = arg0.ctx 10289 res = isl.isl_set_gist(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10290 obj = set(ctx=ctx, ptr=res) 10291 return obj 10292 def identity(arg0): 10293 try: 10294 if not arg0.__class__ is set: 10295 arg0 = set(arg0) 10296 except: 10297 raise 10298 ctx = arg0.ctx 10299 res = isl.isl_set_identity(isl.isl_set_copy(arg0.ptr)) 10300 obj = map(ctx=ctx, ptr=res) 10301 return obj 10302 def indicator_function(arg0): 10303 try: 10304 if not arg0.__class__ is set: 10305 arg0 = set(arg0) 10306 except: 10307 raise 10308 ctx = arg0.ctx 10309 res = isl.isl_set_indicator_function(isl.isl_set_copy(arg0.ptr)) 10310 obj = pw_aff(ctx=ctx, ptr=res) 10311 return obj 10312 def insert_domain(arg0, arg1): 10313 try: 10314 if not arg0.__class__ is set: 10315 arg0 = set(arg0) 10316 except: 10317 raise 10318 try: 10319 if not arg1.__class__ is space: 10320 arg1 = space(arg1) 10321 except: 10322 return union_set(arg0).insert_domain(arg1) 10323 ctx = arg0.ctx 10324 res = isl.isl_set_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 10325 obj = map(ctx=ctx, ptr=res) 10326 return obj 10327 def intersect(arg0, arg1): 10328 try: 10329 if not arg0.__class__ is set: 10330 arg0 = set(arg0) 10331 except: 10332 raise 10333 try: 10334 if not arg1.__class__ is set: 10335 arg1 = set(arg1) 10336 except: 10337 return union_set(arg0).intersect(arg1) 10338 ctx = arg0.ctx 10339 res = isl.isl_set_intersect(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10340 obj = set(ctx=ctx, ptr=res) 10341 return obj 10342 def intersect_params(arg0, arg1): 10343 try: 10344 if not arg0.__class__ is set: 10345 arg0 = set(arg0) 10346 except: 10347 raise 10348 try: 10349 if not arg1.__class__ is set: 10350 arg1 = set(arg1) 10351 except: 10352 return union_set(arg0).intersect_params(arg1) 10353 ctx = arg0.ctx 10354 res = isl.isl_set_intersect_params(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10355 obj = set(ctx=ctx, ptr=res) 10356 return obj 10357 def involves_locals(arg0): 10358 try: 10359 if not arg0.__class__ is set: 10360 arg0 = set(arg0) 10361 except: 10362 raise 10363 ctx = arg0.ctx 10364 res = isl.isl_set_involves_locals(arg0.ptr) 10365 if res < 0: 10366 raise 10367 return bool(res) 10368 def is_disjoint(arg0, arg1): 10369 try: 10370 if not arg0.__class__ is set: 10371 arg0 = set(arg0) 10372 except: 10373 raise 10374 try: 10375 if not arg1.__class__ is set: 10376 arg1 = set(arg1) 10377 except: 10378 return union_set(arg0).is_disjoint(arg1) 10379 ctx = arg0.ctx 10380 res = isl.isl_set_is_disjoint(arg0.ptr, arg1.ptr) 10381 if res < 0: 10382 raise 10383 return bool(res) 10384 def is_empty(arg0): 10385 try: 10386 if not arg0.__class__ is set: 10387 arg0 = set(arg0) 10388 except: 10389 raise 10390 ctx = arg0.ctx 10391 res = isl.isl_set_is_empty(arg0.ptr) 10392 if res < 0: 10393 raise 10394 return bool(res) 10395 def is_equal(arg0, arg1): 10396 try: 10397 if not arg0.__class__ is set: 10398 arg0 = set(arg0) 10399 except: 10400 raise 10401 try: 10402 if not arg1.__class__ is set: 10403 arg1 = set(arg1) 10404 except: 10405 return union_set(arg0).is_equal(arg1) 10406 ctx = arg0.ctx 10407 res = isl.isl_set_is_equal(arg0.ptr, arg1.ptr) 10408 if res < 0: 10409 raise 10410 return bool(res) 10411 def is_singleton(arg0): 10412 try: 10413 if not arg0.__class__ is set: 10414 arg0 = set(arg0) 10415 except: 10416 raise 10417 ctx = arg0.ctx 10418 res = isl.isl_set_is_singleton(arg0.ptr) 10419 if res < 0: 10420 raise 10421 return bool(res) 10422 def is_strict_subset(arg0, arg1): 10423 try: 10424 if not arg0.__class__ is set: 10425 arg0 = set(arg0) 10426 except: 10427 raise 10428 try: 10429 if not arg1.__class__ is set: 10430 arg1 = set(arg1) 10431 except: 10432 return union_set(arg0).is_strict_subset(arg1) 10433 ctx = arg0.ctx 10434 res = isl.isl_set_is_strict_subset(arg0.ptr, arg1.ptr) 10435 if res < 0: 10436 raise 10437 return bool(res) 10438 def is_subset(arg0, arg1): 10439 try: 10440 if not arg0.__class__ is set: 10441 arg0 = set(arg0) 10442 except: 10443 raise 10444 try: 10445 if not arg1.__class__ is set: 10446 arg1 = set(arg1) 10447 except: 10448 return union_set(arg0).is_subset(arg1) 10449 ctx = arg0.ctx 10450 res = isl.isl_set_is_subset(arg0.ptr, arg1.ptr) 10451 if res < 0: 10452 raise 10453 return bool(res) 10454 def is_wrapping(arg0): 10455 try: 10456 if not arg0.__class__ is set: 10457 arg0 = set(arg0) 10458 except: 10459 raise 10460 ctx = arg0.ctx 10461 res = isl.isl_set_is_wrapping(arg0.ptr) 10462 if res < 0: 10463 raise 10464 return bool(res) 10465 def lexmax(arg0): 10466 try: 10467 if not arg0.__class__ is set: 10468 arg0 = set(arg0) 10469 except: 10470 raise 10471 ctx = arg0.ctx 10472 res = isl.isl_set_lexmax(isl.isl_set_copy(arg0.ptr)) 10473 obj = set(ctx=ctx, ptr=res) 10474 return obj 10475 def lexmax_pw_multi_aff(arg0): 10476 try: 10477 if not arg0.__class__ is set: 10478 arg0 = set(arg0) 10479 except: 10480 raise 10481 ctx = arg0.ctx 10482 res = isl.isl_set_lexmax_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 10483 obj = pw_multi_aff(ctx=ctx, ptr=res) 10484 return obj 10485 def lexmin(arg0): 10486 try: 10487 if not arg0.__class__ is set: 10488 arg0 = set(arg0) 10489 except: 10490 raise 10491 ctx = arg0.ctx 10492 res = isl.isl_set_lexmin(isl.isl_set_copy(arg0.ptr)) 10493 obj = set(ctx=ctx, ptr=res) 10494 return obj 10495 def lexmin_pw_multi_aff(arg0): 10496 try: 10497 if not arg0.__class__ is set: 10498 arg0 = set(arg0) 10499 except: 10500 raise 10501 ctx = arg0.ctx 10502 res = isl.isl_set_lexmin_pw_multi_aff(isl.isl_set_copy(arg0.ptr)) 10503 obj = pw_multi_aff(ctx=ctx, ptr=res) 10504 return obj 10505 def lower_bound(*args): 10506 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 10507 ctx = args[0].ctx 10508 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)) 10509 obj = set(ctx=ctx, ptr=res) 10510 return obj 10511 if len(args) == 2 and args[1].__class__ is multi_val: 10512 ctx = args[0].ctx 10513 res = isl.isl_set_lower_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 10514 obj = set(ctx=ctx, ptr=res) 10515 return obj 10516 raise Error 10517 def max_multi_pw_aff(arg0): 10518 try: 10519 if not arg0.__class__ is set: 10520 arg0 = set(arg0) 10521 except: 10522 raise 10523 ctx = arg0.ctx 10524 res = isl.isl_set_max_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 10525 obj = multi_pw_aff(ctx=ctx, ptr=res) 10526 return obj 10527 def max_val(arg0, arg1): 10528 try: 10529 if not arg0.__class__ is set: 10530 arg0 = set(arg0) 10531 except: 10532 raise 10533 try: 10534 if not arg1.__class__ is aff: 10535 arg1 = aff(arg1) 10536 except: 10537 return union_set(arg0).max_val(arg1) 10538 ctx = arg0.ctx 10539 res = isl.isl_set_max_val(arg0.ptr, arg1.ptr) 10540 obj = val(ctx=ctx, ptr=res) 10541 return obj 10542 def min_multi_pw_aff(arg0): 10543 try: 10544 if not arg0.__class__ is set: 10545 arg0 = set(arg0) 10546 except: 10547 raise 10548 ctx = arg0.ctx 10549 res = isl.isl_set_min_multi_pw_aff(isl.isl_set_copy(arg0.ptr)) 10550 obj = multi_pw_aff(ctx=ctx, ptr=res) 10551 return obj 10552 def min_val(arg0, arg1): 10553 try: 10554 if not arg0.__class__ is set: 10555 arg0 = set(arg0) 10556 except: 10557 raise 10558 try: 10559 if not arg1.__class__ is aff: 10560 arg1 = aff(arg1) 10561 except: 10562 return union_set(arg0).min_val(arg1) 10563 ctx = arg0.ctx 10564 res = isl.isl_set_min_val(arg0.ptr, arg1.ptr) 10565 obj = val(ctx=ctx, ptr=res) 10566 return obj 10567 def n_basic_set(arg0): 10568 try: 10569 if not arg0.__class__ is set: 10570 arg0 = set(arg0) 10571 except: 10572 raise 10573 ctx = arg0.ctx 10574 res = isl.isl_set_n_basic_set(arg0.ptr) 10575 if res < 0: 10576 raise 10577 return int(res) 10578 def params(arg0): 10579 try: 10580 if not arg0.__class__ is set: 10581 arg0 = set(arg0) 10582 except: 10583 raise 10584 ctx = arg0.ctx 10585 res = isl.isl_set_params(isl.isl_set_copy(arg0.ptr)) 10586 obj = set(ctx=ctx, ptr=res) 10587 return obj 10588 def plain_multi_val_if_fixed(arg0): 10589 try: 10590 if not arg0.__class__ is set: 10591 arg0 = set(arg0) 10592 except: 10593 raise 10594 ctx = arg0.ctx 10595 res = isl.isl_set_get_plain_multi_val_if_fixed(arg0.ptr) 10596 obj = multi_val(ctx=ctx, ptr=res) 10597 return obj 10598 def get_plain_multi_val_if_fixed(arg0): 10599 return arg0.plain_multi_val_if_fixed() 10600 def polyhedral_hull(arg0): 10601 try: 10602 if not arg0.__class__ is set: 10603 arg0 = set(arg0) 10604 except: 10605 raise 10606 ctx = arg0.ctx 10607 res = isl.isl_set_polyhedral_hull(isl.isl_set_copy(arg0.ptr)) 10608 obj = basic_set(ctx=ctx, ptr=res) 10609 return obj 10610 def preimage(*args): 10611 if len(args) == 2 and args[1].__class__ is multi_aff: 10612 ctx = args[0].ctx 10613 res = isl.isl_set_preimage_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_aff_copy(args[1].ptr)) 10614 obj = set(ctx=ctx, ptr=res) 10615 return obj 10616 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 10617 ctx = args[0].ctx 10618 res = isl.isl_set_preimage_multi_pw_aff(isl.isl_set_copy(args[0].ptr), isl.isl_multi_pw_aff_copy(args[1].ptr)) 10619 obj = set(ctx=ctx, ptr=res) 10620 return obj 10621 if len(args) == 2 and args[1].__class__ is pw_multi_aff: 10622 ctx = args[0].ctx 10623 res = isl.isl_set_preimage_pw_multi_aff(isl.isl_set_copy(args[0].ptr), isl.isl_pw_multi_aff_copy(args[1].ptr)) 10624 obj = set(ctx=ctx, ptr=res) 10625 return obj 10626 raise Error 10627 def product(arg0, arg1): 10628 try: 10629 if not arg0.__class__ is set: 10630 arg0 = set(arg0) 10631 except: 10632 raise 10633 try: 10634 if not arg1.__class__ is set: 10635 arg1 = set(arg1) 10636 except: 10637 return union_set(arg0).product(arg1) 10638 ctx = arg0.ctx 10639 res = isl.isl_set_product(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10640 obj = set(ctx=ctx, ptr=res) 10641 return obj 10642 def project_out_all_params(arg0): 10643 try: 10644 if not arg0.__class__ is set: 10645 arg0 = set(arg0) 10646 except: 10647 raise 10648 ctx = arg0.ctx 10649 res = isl.isl_set_project_out_all_params(isl.isl_set_copy(arg0.ptr)) 10650 obj = set(ctx=ctx, ptr=res) 10651 return obj 10652 def project_out_param(*args): 10653 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 10654 args = list(args) 10655 try: 10656 if not args[1].__class__ is id: 10657 args[1] = id(args[1]) 10658 except: 10659 raise 10660 ctx = args[0].ctx 10661 res = isl.isl_set_project_out_param_id(isl.isl_set_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 10662 obj = set(ctx=ctx, ptr=res) 10663 return obj 10664 if len(args) == 2 and args[1].__class__ is id_list: 10665 ctx = args[0].ctx 10666 res = isl.isl_set_project_out_param_id_list(isl.isl_set_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 10667 obj = set(ctx=ctx, ptr=res) 10668 return obj 10669 raise Error 10670 def pw_multi_aff_on_domain(*args): 10671 if len(args) == 2 and args[1].__class__ is multi_val: 10672 ctx = args[0].ctx 10673 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)) 10674 obj = pw_multi_aff(ctx=ctx, ptr=res) 10675 return obj 10676 raise Error 10677 def sample(arg0): 10678 try: 10679 if not arg0.__class__ is set: 10680 arg0 = set(arg0) 10681 except: 10682 raise 10683 ctx = arg0.ctx 10684 res = isl.isl_set_sample(isl.isl_set_copy(arg0.ptr)) 10685 obj = basic_set(ctx=ctx, ptr=res) 10686 return obj 10687 def sample_point(arg0): 10688 try: 10689 if not arg0.__class__ is set: 10690 arg0 = set(arg0) 10691 except: 10692 raise 10693 ctx = arg0.ctx 10694 res = isl.isl_set_sample_point(isl.isl_set_copy(arg0.ptr)) 10695 obj = point(ctx=ctx, ptr=res) 10696 return obj 10697 def simple_fixed_box_hull(arg0): 10698 try: 10699 if not arg0.__class__ is set: 10700 arg0 = set(arg0) 10701 except: 10702 raise 10703 ctx = arg0.ctx 10704 res = isl.isl_set_get_simple_fixed_box_hull(arg0.ptr) 10705 obj = fixed_box(ctx=ctx, ptr=res) 10706 return obj 10707 def get_simple_fixed_box_hull(arg0): 10708 return arg0.simple_fixed_box_hull() 10709 def space(arg0): 10710 try: 10711 if not arg0.__class__ is set: 10712 arg0 = set(arg0) 10713 except: 10714 raise 10715 ctx = arg0.ctx 10716 res = isl.isl_set_get_space(arg0.ptr) 10717 obj = space(ctx=ctx, ptr=res) 10718 return obj 10719 def get_space(arg0): 10720 return arg0.space() 10721 def stride(arg0, arg1): 10722 try: 10723 if not arg0.__class__ is set: 10724 arg0 = set(arg0) 10725 except: 10726 raise 10727 ctx = arg0.ctx 10728 res = isl.isl_set_get_stride(arg0.ptr, arg1) 10729 obj = val(ctx=ctx, ptr=res) 10730 return obj 10731 def get_stride(arg0, arg1): 10732 return arg0.stride(arg1) 10733 def subtract(arg0, arg1): 10734 try: 10735 if not arg0.__class__ is set: 10736 arg0 = set(arg0) 10737 except: 10738 raise 10739 try: 10740 if not arg1.__class__ is set: 10741 arg1 = set(arg1) 10742 except: 10743 return union_set(arg0).subtract(arg1) 10744 ctx = arg0.ctx 10745 res = isl.isl_set_subtract(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10746 obj = set(ctx=ctx, ptr=res) 10747 return obj 10748 def to_list(arg0): 10749 try: 10750 if not arg0.__class__ is set: 10751 arg0 = set(arg0) 10752 except: 10753 raise 10754 ctx = arg0.ctx 10755 res = isl.isl_set_to_list(isl.isl_set_copy(arg0.ptr)) 10756 obj = set_list(ctx=ctx, ptr=res) 10757 return obj 10758 def to_union_set(arg0): 10759 try: 10760 if not arg0.__class__ is set: 10761 arg0 = set(arg0) 10762 except: 10763 raise 10764 ctx = arg0.ctx 10765 res = isl.isl_set_to_union_set(isl.isl_set_copy(arg0.ptr)) 10766 obj = union_set(ctx=ctx, ptr=res) 10767 return obj 10768 def translation(arg0): 10769 try: 10770 if not arg0.__class__ is set: 10771 arg0 = set(arg0) 10772 except: 10773 raise 10774 ctx = arg0.ctx 10775 res = isl.isl_set_translation(isl.isl_set_copy(arg0.ptr)) 10776 obj = map(ctx=ctx, ptr=res) 10777 return obj 10778 def tuple_dim(arg0): 10779 try: 10780 if not arg0.__class__ is set: 10781 arg0 = set(arg0) 10782 except: 10783 raise 10784 ctx = arg0.ctx 10785 res = isl.isl_set_tuple_dim(arg0.ptr) 10786 if res < 0: 10787 raise 10788 return int(res) 10789 def unbind_params(arg0, arg1): 10790 try: 10791 if not arg0.__class__ is set: 10792 arg0 = set(arg0) 10793 except: 10794 raise 10795 try: 10796 if not arg1.__class__ is multi_id: 10797 arg1 = multi_id(arg1) 10798 except: 10799 return union_set(arg0).unbind_params(arg1) 10800 ctx = arg0.ctx 10801 res = isl.isl_set_unbind_params(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 10802 obj = set(ctx=ctx, ptr=res) 10803 return obj 10804 def unbind_params_insert_domain(arg0, arg1): 10805 try: 10806 if not arg0.__class__ is set: 10807 arg0 = set(arg0) 10808 except: 10809 raise 10810 try: 10811 if not arg1.__class__ is multi_id: 10812 arg1 = multi_id(arg1) 10813 except: 10814 return union_set(arg0).unbind_params_insert_domain(arg1) 10815 ctx = arg0.ctx 10816 res = isl.isl_set_unbind_params_insert_domain(isl.isl_set_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 10817 obj = map(ctx=ctx, ptr=res) 10818 return obj 10819 def union(arg0, arg1): 10820 try: 10821 if not arg0.__class__ is set: 10822 arg0 = set(arg0) 10823 except: 10824 raise 10825 try: 10826 if not arg1.__class__ is set: 10827 arg1 = set(arg1) 10828 except: 10829 return union_set(arg0).union(arg1) 10830 ctx = arg0.ctx 10831 res = isl.isl_set_union(isl.isl_set_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 10832 obj = set(ctx=ctx, ptr=res) 10833 return obj 10834 @staticmethod 10835 def universe(arg0): 10836 try: 10837 if not arg0.__class__ is space: 10838 arg0 = space(arg0) 10839 except: 10840 raise 10841 ctx = arg0.ctx 10842 res = isl.isl_set_universe(isl.isl_space_copy(arg0.ptr)) 10843 obj = set(ctx=ctx, ptr=res) 10844 return obj 10845 def unshifted_simple_hull(arg0): 10846 try: 10847 if not arg0.__class__ is set: 10848 arg0 = set(arg0) 10849 except: 10850 raise 10851 ctx = arg0.ctx 10852 res = isl.isl_set_unshifted_simple_hull(isl.isl_set_copy(arg0.ptr)) 10853 obj = basic_set(ctx=ctx, ptr=res) 10854 return obj 10855 def unwrap(arg0): 10856 try: 10857 if not arg0.__class__ is set: 10858 arg0 = set(arg0) 10859 except: 10860 raise 10861 ctx = arg0.ctx 10862 res = isl.isl_set_unwrap(isl.isl_set_copy(arg0.ptr)) 10863 obj = map(ctx=ctx, ptr=res) 10864 return obj 10865 def upper_bound(*args): 10866 if len(args) == 2 and args[1].__class__ is multi_pw_aff: 10867 ctx = args[0].ctx 10868 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)) 10869 obj = set(ctx=ctx, ptr=res) 10870 return obj 10871 if len(args) == 2 and args[1].__class__ is multi_val: 10872 ctx = args[0].ctx 10873 res = isl.isl_set_upper_bound_multi_val(isl.isl_set_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 10874 obj = set(ctx=ctx, ptr=res) 10875 return obj 10876 raise Error 10877 10878isl.isl_set_from_basic_set.restype = c_void_p 10879isl.isl_set_from_basic_set.argtypes = [c_void_p] 10880isl.isl_set_from_point.restype = c_void_p 10881isl.isl_set_from_point.argtypes = [c_void_p] 10882isl.isl_set_read_from_str.restype = c_void_p 10883isl.isl_set_read_from_str.argtypes = [Context, c_char_p] 10884isl.isl_set_affine_hull.restype = c_void_p 10885isl.isl_set_affine_hull.argtypes = [c_void_p] 10886isl.isl_set_apply.restype = c_void_p 10887isl.isl_set_apply.argtypes = [c_void_p, c_void_p] 10888isl.isl_set_as_pw_multi_aff.restype = c_void_p 10889isl.isl_set_as_pw_multi_aff.argtypes = [c_void_p] 10890isl.isl_set_bind.restype = c_void_p 10891isl.isl_set_bind.argtypes = [c_void_p, c_void_p] 10892isl.isl_set_coalesce.restype = c_void_p 10893isl.isl_set_coalesce.argtypes = [c_void_p] 10894isl.isl_set_complement.restype = c_void_p 10895isl.isl_set_complement.argtypes = [c_void_p] 10896isl.isl_set_detect_equalities.restype = c_void_p 10897isl.isl_set_detect_equalities.argtypes = [c_void_p] 10898isl.isl_set_dim_max_val.restype = c_void_p 10899isl.isl_set_dim_max_val.argtypes = [c_void_p, c_int] 10900isl.isl_set_dim_min_val.restype = c_void_p 10901isl.isl_set_dim_min_val.argtypes = [c_void_p, c_int] 10902isl.isl_set_empty.restype = c_void_p 10903isl.isl_set_empty.argtypes = [c_void_p] 10904isl.isl_set_flatten.restype = c_void_p 10905isl.isl_set_flatten.argtypes = [c_void_p] 10906isl.isl_set_foreach_basic_set.argtypes = [c_void_p, c_void_p, c_void_p] 10907isl.isl_set_foreach_point.argtypes = [c_void_p, c_void_p, c_void_p] 10908isl.isl_set_gist.restype = c_void_p 10909isl.isl_set_gist.argtypes = [c_void_p, c_void_p] 10910isl.isl_set_identity.restype = c_void_p 10911isl.isl_set_identity.argtypes = [c_void_p] 10912isl.isl_set_indicator_function.restype = c_void_p 10913isl.isl_set_indicator_function.argtypes = [c_void_p] 10914isl.isl_set_insert_domain.restype = c_void_p 10915isl.isl_set_insert_domain.argtypes = [c_void_p, c_void_p] 10916isl.isl_set_intersect.restype = c_void_p 10917isl.isl_set_intersect.argtypes = [c_void_p, c_void_p] 10918isl.isl_set_intersect_params.restype = c_void_p 10919isl.isl_set_intersect_params.argtypes = [c_void_p, c_void_p] 10920isl.isl_set_involves_locals.argtypes = [c_void_p] 10921isl.isl_set_is_disjoint.argtypes = [c_void_p, c_void_p] 10922isl.isl_set_is_empty.argtypes = [c_void_p] 10923isl.isl_set_is_equal.argtypes = [c_void_p, c_void_p] 10924isl.isl_set_is_singleton.argtypes = [c_void_p] 10925isl.isl_set_is_strict_subset.argtypes = [c_void_p, c_void_p] 10926isl.isl_set_is_subset.argtypes = [c_void_p, c_void_p] 10927isl.isl_set_is_wrapping.argtypes = [c_void_p] 10928isl.isl_set_lexmax.restype = c_void_p 10929isl.isl_set_lexmax.argtypes = [c_void_p] 10930isl.isl_set_lexmax_pw_multi_aff.restype = c_void_p 10931isl.isl_set_lexmax_pw_multi_aff.argtypes = [c_void_p] 10932isl.isl_set_lexmin.restype = c_void_p 10933isl.isl_set_lexmin.argtypes = [c_void_p] 10934isl.isl_set_lexmin_pw_multi_aff.restype = c_void_p 10935isl.isl_set_lexmin_pw_multi_aff.argtypes = [c_void_p] 10936isl.isl_set_lower_bound_multi_pw_aff.restype = c_void_p 10937isl.isl_set_lower_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10938isl.isl_set_lower_bound_multi_val.restype = c_void_p 10939isl.isl_set_lower_bound_multi_val.argtypes = [c_void_p, c_void_p] 10940isl.isl_set_max_multi_pw_aff.restype = c_void_p 10941isl.isl_set_max_multi_pw_aff.argtypes = [c_void_p] 10942isl.isl_set_max_val.restype = c_void_p 10943isl.isl_set_max_val.argtypes = [c_void_p, c_void_p] 10944isl.isl_set_min_multi_pw_aff.restype = c_void_p 10945isl.isl_set_min_multi_pw_aff.argtypes = [c_void_p] 10946isl.isl_set_min_val.restype = c_void_p 10947isl.isl_set_min_val.argtypes = [c_void_p, c_void_p] 10948isl.isl_set_n_basic_set.argtypes = [c_void_p] 10949isl.isl_set_params.restype = c_void_p 10950isl.isl_set_params.argtypes = [c_void_p] 10951isl.isl_set_get_plain_multi_val_if_fixed.restype = c_void_p 10952isl.isl_set_get_plain_multi_val_if_fixed.argtypes = [c_void_p] 10953isl.isl_set_polyhedral_hull.restype = c_void_p 10954isl.isl_set_polyhedral_hull.argtypes = [c_void_p] 10955isl.isl_set_preimage_multi_aff.restype = c_void_p 10956isl.isl_set_preimage_multi_aff.argtypes = [c_void_p, c_void_p] 10957isl.isl_set_preimage_multi_pw_aff.restype = c_void_p 10958isl.isl_set_preimage_multi_pw_aff.argtypes = [c_void_p, c_void_p] 10959isl.isl_set_preimage_pw_multi_aff.restype = c_void_p 10960isl.isl_set_preimage_pw_multi_aff.argtypes = [c_void_p, c_void_p] 10961isl.isl_set_product.restype = c_void_p 10962isl.isl_set_product.argtypes = [c_void_p, c_void_p] 10963isl.isl_set_project_out_all_params.restype = c_void_p 10964isl.isl_set_project_out_all_params.argtypes = [c_void_p] 10965isl.isl_set_project_out_param_id.restype = c_void_p 10966isl.isl_set_project_out_param_id.argtypes = [c_void_p, c_void_p] 10967isl.isl_set_project_out_param_id_list.restype = c_void_p 10968isl.isl_set_project_out_param_id_list.argtypes = [c_void_p, c_void_p] 10969isl.isl_set_pw_multi_aff_on_domain_multi_val.restype = c_void_p 10970isl.isl_set_pw_multi_aff_on_domain_multi_val.argtypes = [c_void_p, c_void_p] 10971isl.isl_set_sample.restype = c_void_p 10972isl.isl_set_sample.argtypes = [c_void_p] 10973isl.isl_set_sample_point.restype = c_void_p 10974isl.isl_set_sample_point.argtypes = [c_void_p] 10975isl.isl_set_get_simple_fixed_box_hull.restype = c_void_p 10976isl.isl_set_get_simple_fixed_box_hull.argtypes = [c_void_p] 10977isl.isl_set_get_space.restype = c_void_p 10978isl.isl_set_get_space.argtypes = [c_void_p] 10979isl.isl_set_get_stride.restype = c_void_p 10980isl.isl_set_get_stride.argtypes = [c_void_p, c_int] 10981isl.isl_set_subtract.restype = c_void_p 10982isl.isl_set_subtract.argtypes = [c_void_p, c_void_p] 10983isl.isl_set_to_list.restype = c_void_p 10984isl.isl_set_to_list.argtypes = [c_void_p] 10985isl.isl_set_to_union_set.restype = c_void_p 10986isl.isl_set_to_union_set.argtypes = [c_void_p] 10987isl.isl_set_translation.restype = c_void_p 10988isl.isl_set_translation.argtypes = [c_void_p] 10989isl.isl_set_tuple_dim.argtypes = [c_void_p] 10990isl.isl_set_unbind_params.restype = c_void_p 10991isl.isl_set_unbind_params.argtypes = [c_void_p, c_void_p] 10992isl.isl_set_unbind_params_insert_domain.restype = c_void_p 10993isl.isl_set_unbind_params_insert_domain.argtypes = [c_void_p, c_void_p] 10994isl.isl_set_union.restype = c_void_p 10995isl.isl_set_union.argtypes = [c_void_p, c_void_p] 10996isl.isl_set_universe.restype = c_void_p 10997isl.isl_set_universe.argtypes = [c_void_p] 10998isl.isl_set_unshifted_simple_hull.restype = c_void_p 10999isl.isl_set_unshifted_simple_hull.argtypes = [c_void_p] 11000isl.isl_set_unwrap.restype = c_void_p 11001isl.isl_set_unwrap.argtypes = [c_void_p] 11002isl.isl_set_upper_bound_multi_pw_aff.restype = c_void_p 11003isl.isl_set_upper_bound_multi_pw_aff.argtypes = [c_void_p, c_void_p] 11004isl.isl_set_upper_bound_multi_val.restype = c_void_p 11005isl.isl_set_upper_bound_multi_val.argtypes = [c_void_p, c_void_p] 11006isl.isl_set_copy.restype = c_void_p 11007isl.isl_set_copy.argtypes = [c_void_p] 11008isl.isl_set_free.restype = c_void_p 11009isl.isl_set_free.argtypes = [c_void_p] 11010isl.isl_set_to_str.restype = POINTER(c_char) 11011isl.isl_set_to_str.argtypes = [c_void_p] 11012 11013class basic_set(set): 11014 def __init__(self, *args, **keywords): 11015 if "ptr" in keywords: 11016 self.ctx = keywords["ctx"] 11017 self.ptr = keywords["ptr"] 11018 return 11019 if len(args) == 1 and args[0].__class__ is point: 11020 self.ctx = Context.getDefaultInstance() 11021 self.ptr = isl.isl_basic_set_from_point(isl.isl_point_copy(args[0].ptr)) 11022 return 11023 if len(args) == 1 and type(args[0]) == str: 11024 self.ctx = Context.getDefaultInstance() 11025 self.ptr = isl.isl_basic_set_read_from_str(self.ctx, args[0].encode('ascii')) 11026 return 11027 raise Error 11028 def __del__(self): 11029 if hasattr(self, 'ptr'): 11030 isl.isl_basic_set_free(self.ptr) 11031 def __str__(arg0): 11032 try: 11033 if not arg0.__class__ is basic_set: 11034 arg0 = basic_set(arg0) 11035 except: 11036 raise 11037 ptr = isl.isl_basic_set_to_str(arg0.ptr) 11038 res = cast(ptr, c_char_p).value.decode('ascii') 11039 libc.free(ptr) 11040 return res 11041 def __repr__(self): 11042 s = str(self) 11043 if '"' in s: 11044 return 'isl.basic_set("""%s""")' % s 11045 else: 11046 return 'isl.basic_set("%s")' % s 11047 def affine_hull(arg0): 11048 try: 11049 if not arg0.__class__ is basic_set: 11050 arg0 = basic_set(arg0) 11051 except: 11052 raise 11053 ctx = arg0.ctx 11054 res = isl.isl_basic_set_affine_hull(isl.isl_basic_set_copy(arg0.ptr)) 11055 obj = basic_set(ctx=ctx, ptr=res) 11056 return obj 11057 def apply(arg0, arg1): 11058 try: 11059 if not arg0.__class__ is basic_set: 11060 arg0 = basic_set(arg0) 11061 except: 11062 raise 11063 try: 11064 if not arg1.__class__ is basic_map: 11065 arg1 = basic_map(arg1) 11066 except: 11067 return set(arg0).apply(arg1) 11068 ctx = arg0.ctx 11069 res = isl.isl_basic_set_apply(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_map_copy(arg1.ptr)) 11070 obj = basic_set(ctx=ctx, ptr=res) 11071 return obj 11072 def detect_equalities(arg0): 11073 try: 11074 if not arg0.__class__ is basic_set: 11075 arg0 = basic_set(arg0) 11076 except: 11077 raise 11078 ctx = arg0.ctx 11079 res = isl.isl_basic_set_detect_equalities(isl.isl_basic_set_copy(arg0.ptr)) 11080 obj = basic_set(ctx=ctx, ptr=res) 11081 return obj 11082 def dim_max_val(arg0, arg1): 11083 try: 11084 if not arg0.__class__ is basic_set: 11085 arg0 = basic_set(arg0) 11086 except: 11087 raise 11088 ctx = arg0.ctx 11089 res = isl.isl_basic_set_dim_max_val(isl.isl_basic_set_copy(arg0.ptr), arg1) 11090 obj = val(ctx=ctx, ptr=res) 11091 return obj 11092 def flatten(arg0): 11093 try: 11094 if not arg0.__class__ is basic_set: 11095 arg0 = basic_set(arg0) 11096 except: 11097 raise 11098 ctx = arg0.ctx 11099 res = isl.isl_basic_set_flatten(isl.isl_basic_set_copy(arg0.ptr)) 11100 obj = basic_set(ctx=ctx, ptr=res) 11101 return obj 11102 def gist(arg0, arg1): 11103 try: 11104 if not arg0.__class__ is basic_set: 11105 arg0 = basic_set(arg0) 11106 except: 11107 raise 11108 try: 11109 if not arg1.__class__ is basic_set: 11110 arg1 = basic_set(arg1) 11111 except: 11112 return set(arg0).gist(arg1) 11113 ctx = arg0.ctx 11114 res = isl.isl_basic_set_gist(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 11115 obj = basic_set(ctx=ctx, ptr=res) 11116 return obj 11117 def intersect(arg0, arg1): 11118 try: 11119 if not arg0.__class__ is basic_set: 11120 arg0 = basic_set(arg0) 11121 except: 11122 raise 11123 try: 11124 if not arg1.__class__ is basic_set: 11125 arg1 = basic_set(arg1) 11126 except: 11127 return set(arg0).intersect(arg1) 11128 ctx = arg0.ctx 11129 res = isl.isl_basic_set_intersect(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 11130 obj = basic_set(ctx=ctx, ptr=res) 11131 return obj 11132 def intersect_params(arg0, arg1): 11133 try: 11134 if not arg0.__class__ is basic_set: 11135 arg0 = basic_set(arg0) 11136 except: 11137 raise 11138 try: 11139 if not arg1.__class__ is basic_set: 11140 arg1 = basic_set(arg1) 11141 except: 11142 return set(arg0).intersect_params(arg1) 11143 ctx = arg0.ctx 11144 res = isl.isl_basic_set_intersect_params(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 11145 obj = basic_set(ctx=ctx, ptr=res) 11146 return obj 11147 def is_empty(arg0): 11148 try: 11149 if not arg0.__class__ is basic_set: 11150 arg0 = basic_set(arg0) 11151 except: 11152 raise 11153 ctx = arg0.ctx 11154 res = isl.isl_basic_set_is_empty(arg0.ptr) 11155 if res < 0: 11156 raise 11157 return bool(res) 11158 def is_equal(arg0, arg1): 11159 try: 11160 if not arg0.__class__ is basic_set: 11161 arg0 = basic_set(arg0) 11162 except: 11163 raise 11164 try: 11165 if not arg1.__class__ is basic_set: 11166 arg1 = basic_set(arg1) 11167 except: 11168 return set(arg0).is_equal(arg1) 11169 ctx = arg0.ctx 11170 res = isl.isl_basic_set_is_equal(arg0.ptr, arg1.ptr) 11171 if res < 0: 11172 raise 11173 return bool(res) 11174 def is_subset(arg0, arg1): 11175 try: 11176 if not arg0.__class__ is basic_set: 11177 arg0 = basic_set(arg0) 11178 except: 11179 raise 11180 try: 11181 if not arg1.__class__ is basic_set: 11182 arg1 = basic_set(arg1) 11183 except: 11184 return set(arg0).is_subset(arg1) 11185 ctx = arg0.ctx 11186 res = isl.isl_basic_set_is_subset(arg0.ptr, arg1.ptr) 11187 if res < 0: 11188 raise 11189 return bool(res) 11190 def is_wrapping(arg0): 11191 try: 11192 if not arg0.__class__ is basic_set: 11193 arg0 = basic_set(arg0) 11194 except: 11195 raise 11196 ctx = arg0.ctx 11197 res = isl.isl_basic_set_is_wrapping(arg0.ptr) 11198 if res < 0: 11199 raise 11200 return bool(res) 11201 def lexmax(arg0): 11202 try: 11203 if not arg0.__class__ is basic_set: 11204 arg0 = basic_set(arg0) 11205 except: 11206 raise 11207 ctx = arg0.ctx 11208 res = isl.isl_basic_set_lexmax(isl.isl_basic_set_copy(arg0.ptr)) 11209 obj = set(ctx=ctx, ptr=res) 11210 return obj 11211 def lexmin(arg0): 11212 try: 11213 if not arg0.__class__ is basic_set: 11214 arg0 = basic_set(arg0) 11215 except: 11216 raise 11217 ctx = arg0.ctx 11218 res = isl.isl_basic_set_lexmin(isl.isl_basic_set_copy(arg0.ptr)) 11219 obj = set(ctx=ctx, ptr=res) 11220 return obj 11221 def params(arg0): 11222 try: 11223 if not arg0.__class__ is basic_set: 11224 arg0 = basic_set(arg0) 11225 except: 11226 raise 11227 ctx = arg0.ctx 11228 res = isl.isl_basic_set_params(isl.isl_basic_set_copy(arg0.ptr)) 11229 obj = basic_set(ctx=ctx, ptr=res) 11230 return obj 11231 def sample(arg0): 11232 try: 11233 if not arg0.__class__ is basic_set: 11234 arg0 = basic_set(arg0) 11235 except: 11236 raise 11237 ctx = arg0.ctx 11238 res = isl.isl_basic_set_sample(isl.isl_basic_set_copy(arg0.ptr)) 11239 obj = basic_set(ctx=ctx, ptr=res) 11240 return obj 11241 def sample_point(arg0): 11242 try: 11243 if not arg0.__class__ is basic_set: 11244 arg0 = basic_set(arg0) 11245 except: 11246 raise 11247 ctx = arg0.ctx 11248 res = isl.isl_basic_set_sample_point(isl.isl_basic_set_copy(arg0.ptr)) 11249 obj = point(ctx=ctx, ptr=res) 11250 return obj 11251 def to_set(arg0): 11252 try: 11253 if not arg0.__class__ is basic_set: 11254 arg0 = basic_set(arg0) 11255 except: 11256 raise 11257 ctx = arg0.ctx 11258 res = isl.isl_basic_set_to_set(isl.isl_basic_set_copy(arg0.ptr)) 11259 obj = set(ctx=ctx, ptr=res) 11260 return obj 11261 def union(arg0, arg1): 11262 try: 11263 if not arg0.__class__ is basic_set: 11264 arg0 = basic_set(arg0) 11265 except: 11266 raise 11267 try: 11268 if not arg1.__class__ is basic_set: 11269 arg1 = basic_set(arg1) 11270 except: 11271 return set(arg0).union(arg1) 11272 ctx = arg0.ctx 11273 res = isl.isl_basic_set_union(isl.isl_basic_set_copy(arg0.ptr), isl.isl_basic_set_copy(arg1.ptr)) 11274 obj = set(ctx=ctx, ptr=res) 11275 return obj 11276 11277isl.isl_basic_set_from_point.restype = c_void_p 11278isl.isl_basic_set_from_point.argtypes = [c_void_p] 11279isl.isl_basic_set_read_from_str.restype = c_void_p 11280isl.isl_basic_set_read_from_str.argtypes = [Context, c_char_p] 11281isl.isl_basic_set_affine_hull.restype = c_void_p 11282isl.isl_basic_set_affine_hull.argtypes = [c_void_p] 11283isl.isl_basic_set_apply.restype = c_void_p 11284isl.isl_basic_set_apply.argtypes = [c_void_p, c_void_p] 11285isl.isl_basic_set_detect_equalities.restype = c_void_p 11286isl.isl_basic_set_detect_equalities.argtypes = [c_void_p] 11287isl.isl_basic_set_dim_max_val.restype = c_void_p 11288isl.isl_basic_set_dim_max_val.argtypes = [c_void_p, c_int] 11289isl.isl_basic_set_flatten.restype = c_void_p 11290isl.isl_basic_set_flatten.argtypes = [c_void_p] 11291isl.isl_basic_set_gist.restype = c_void_p 11292isl.isl_basic_set_gist.argtypes = [c_void_p, c_void_p] 11293isl.isl_basic_set_intersect.restype = c_void_p 11294isl.isl_basic_set_intersect.argtypes = [c_void_p, c_void_p] 11295isl.isl_basic_set_intersect_params.restype = c_void_p 11296isl.isl_basic_set_intersect_params.argtypes = [c_void_p, c_void_p] 11297isl.isl_basic_set_is_empty.argtypes = [c_void_p] 11298isl.isl_basic_set_is_equal.argtypes = [c_void_p, c_void_p] 11299isl.isl_basic_set_is_subset.argtypes = [c_void_p, c_void_p] 11300isl.isl_basic_set_is_wrapping.argtypes = [c_void_p] 11301isl.isl_basic_set_lexmax.restype = c_void_p 11302isl.isl_basic_set_lexmax.argtypes = [c_void_p] 11303isl.isl_basic_set_lexmin.restype = c_void_p 11304isl.isl_basic_set_lexmin.argtypes = [c_void_p] 11305isl.isl_basic_set_params.restype = c_void_p 11306isl.isl_basic_set_params.argtypes = [c_void_p] 11307isl.isl_basic_set_sample.restype = c_void_p 11308isl.isl_basic_set_sample.argtypes = [c_void_p] 11309isl.isl_basic_set_sample_point.restype = c_void_p 11310isl.isl_basic_set_sample_point.argtypes = [c_void_p] 11311isl.isl_basic_set_to_set.restype = c_void_p 11312isl.isl_basic_set_to_set.argtypes = [c_void_p] 11313isl.isl_basic_set_union.restype = c_void_p 11314isl.isl_basic_set_union.argtypes = [c_void_p, c_void_p] 11315isl.isl_basic_set_copy.restype = c_void_p 11316isl.isl_basic_set_copy.argtypes = [c_void_p] 11317isl.isl_basic_set_free.restype = c_void_p 11318isl.isl_basic_set_free.argtypes = [c_void_p] 11319isl.isl_basic_set_to_str.restype = POINTER(c_char) 11320isl.isl_basic_set_to_str.argtypes = [c_void_p] 11321 11322class fixed_box(object): 11323 def __init__(self, *args, **keywords): 11324 if "ptr" in keywords: 11325 self.ctx = keywords["ctx"] 11326 self.ptr = keywords["ptr"] 11327 return 11328 raise Error 11329 def __del__(self): 11330 if hasattr(self, 'ptr'): 11331 isl.isl_fixed_box_free(self.ptr) 11332 def __str__(arg0): 11333 try: 11334 if not arg0.__class__ is fixed_box: 11335 arg0 = fixed_box(arg0) 11336 except: 11337 raise 11338 ptr = isl.isl_fixed_box_to_str(arg0.ptr) 11339 res = cast(ptr, c_char_p).value.decode('ascii') 11340 libc.free(ptr) 11341 return res 11342 def __repr__(self): 11343 s = str(self) 11344 if '"' in s: 11345 return 'isl.fixed_box("""%s""")' % s 11346 else: 11347 return 'isl.fixed_box("%s")' % s 11348 def is_valid(arg0): 11349 try: 11350 if not arg0.__class__ is fixed_box: 11351 arg0 = fixed_box(arg0) 11352 except: 11353 raise 11354 ctx = arg0.ctx 11355 res = isl.isl_fixed_box_is_valid(arg0.ptr) 11356 if res < 0: 11357 raise 11358 return bool(res) 11359 def offset(arg0): 11360 try: 11361 if not arg0.__class__ is fixed_box: 11362 arg0 = fixed_box(arg0) 11363 except: 11364 raise 11365 ctx = arg0.ctx 11366 res = isl.isl_fixed_box_get_offset(arg0.ptr) 11367 obj = multi_aff(ctx=ctx, ptr=res) 11368 return obj 11369 def get_offset(arg0): 11370 return arg0.offset() 11371 def size(arg0): 11372 try: 11373 if not arg0.__class__ is fixed_box: 11374 arg0 = fixed_box(arg0) 11375 except: 11376 raise 11377 ctx = arg0.ctx 11378 res = isl.isl_fixed_box_get_size(arg0.ptr) 11379 obj = multi_val(ctx=ctx, ptr=res) 11380 return obj 11381 def get_size(arg0): 11382 return arg0.size() 11383 def space(arg0): 11384 try: 11385 if not arg0.__class__ is fixed_box: 11386 arg0 = fixed_box(arg0) 11387 except: 11388 raise 11389 ctx = arg0.ctx 11390 res = isl.isl_fixed_box_get_space(arg0.ptr) 11391 obj = space(ctx=ctx, ptr=res) 11392 return obj 11393 def get_space(arg0): 11394 return arg0.space() 11395 11396isl.isl_fixed_box_is_valid.argtypes = [c_void_p] 11397isl.isl_fixed_box_get_offset.restype = c_void_p 11398isl.isl_fixed_box_get_offset.argtypes = [c_void_p] 11399isl.isl_fixed_box_get_size.restype = c_void_p 11400isl.isl_fixed_box_get_size.argtypes = [c_void_p] 11401isl.isl_fixed_box_get_space.restype = c_void_p 11402isl.isl_fixed_box_get_space.argtypes = [c_void_p] 11403isl.isl_fixed_box_copy.restype = c_void_p 11404isl.isl_fixed_box_copy.argtypes = [c_void_p] 11405isl.isl_fixed_box_free.restype = c_void_p 11406isl.isl_fixed_box_free.argtypes = [c_void_p] 11407isl.isl_fixed_box_to_str.restype = POINTER(c_char) 11408isl.isl_fixed_box_to_str.argtypes = [c_void_p] 11409 11410class id(object): 11411 def __init__(self, *args, **keywords): 11412 if "ptr" in keywords: 11413 self.ctx = keywords["ctx"] 11414 self.ptr = keywords["ptr"] 11415 return 11416 if len(args) == 1 and type(args[0]) == str: 11417 self.ctx = Context.getDefaultInstance() 11418 self.ptr = isl.isl_id_read_from_str(self.ctx, args[0].encode('ascii')) 11419 return 11420 raise Error 11421 def __del__(self): 11422 if hasattr(self, 'ptr'): 11423 isl.isl_id_free(self.ptr) 11424 def __str__(arg0): 11425 try: 11426 if not arg0.__class__ is id: 11427 arg0 = id(arg0) 11428 except: 11429 raise 11430 ptr = isl.isl_id_to_str(arg0.ptr) 11431 res = cast(ptr, c_char_p).value.decode('ascii') 11432 libc.free(ptr) 11433 return res 11434 def __repr__(self): 11435 s = str(self) 11436 if '"' in s: 11437 return 'isl.id("""%s""")' % s 11438 else: 11439 return 'isl.id("%s")' % s 11440 def name(arg0): 11441 try: 11442 if not arg0.__class__ is id: 11443 arg0 = id(arg0) 11444 except: 11445 raise 11446 ctx = arg0.ctx 11447 res = isl.isl_id_get_name(arg0.ptr) 11448 if res == 0: 11449 raise 11450 string = cast(res, c_char_p).value.decode('ascii') 11451 return string 11452 def get_name(arg0): 11453 return arg0.name() 11454 def to_list(arg0): 11455 try: 11456 if not arg0.__class__ is id: 11457 arg0 = id(arg0) 11458 except: 11459 raise 11460 ctx = arg0.ctx 11461 res = isl.isl_id_to_list(isl.isl_id_copy(arg0.ptr)) 11462 obj = id_list(ctx=ctx, ptr=res) 11463 return obj 11464 11465isl.isl_id_read_from_str.restype = c_void_p 11466isl.isl_id_read_from_str.argtypes = [Context, c_char_p] 11467isl.isl_id_get_name.restype = POINTER(c_char) 11468isl.isl_id_get_name.argtypes = [c_void_p] 11469isl.isl_id_to_list.restype = c_void_p 11470isl.isl_id_to_list.argtypes = [c_void_p] 11471isl.isl_id_copy.restype = c_void_p 11472isl.isl_id_copy.argtypes = [c_void_p] 11473isl.isl_id_free.restype = c_void_p 11474isl.isl_id_free.argtypes = [c_void_p] 11475isl.isl_id_to_str.restype = POINTER(c_char) 11476isl.isl_id_to_str.argtypes = [c_void_p] 11477 11478class id_list(object): 11479 def __init__(self, *args, **keywords): 11480 if "ptr" in keywords: 11481 self.ctx = keywords["ctx"] 11482 self.ptr = keywords["ptr"] 11483 return 11484 if len(args) == 1 and type(args[0]) == int: 11485 self.ctx = Context.getDefaultInstance() 11486 self.ptr = isl.isl_id_list_alloc(self.ctx, args[0]) 11487 return 11488 if len(args) == 1 and (args[0].__class__ is id or type(args[0]) == str): 11489 args = list(args) 11490 try: 11491 if not args[0].__class__ is id: 11492 args[0] = id(args[0]) 11493 except: 11494 raise 11495 self.ctx = Context.getDefaultInstance() 11496 self.ptr = isl.isl_id_list_from_id(isl.isl_id_copy(args[0].ptr)) 11497 return 11498 if len(args) == 1 and type(args[0]) == str: 11499 self.ctx = Context.getDefaultInstance() 11500 self.ptr = isl.isl_id_list_read_from_str(self.ctx, args[0].encode('ascii')) 11501 return 11502 raise Error 11503 def __del__(self): 11504 if hasattr(self, 'ptr'): 11505 isl.isl_id_list_free(self.ptr) 11506 def __str__(arg0): 11507 try: 11508 if not arg0.__class__ is id_list: 11509 arg0 = id_list(arg0) 11510 except: 11511 raise 11512 ptr = isl.isl_id_list_to_str(arg0.ptr) 11513 res = cast(ptr, c_char_p).value.decode('ascii') 11514 libc.free(ptr) 11515 return res 11516 def __repr__(self): 11517 s = str(self) 11518 if '"' in s: 11519 return 'isl.id_list("""%s""")' % s 11520 else: 11521 return 'isl.id_list("%s")' % s 11522 def add(arg0, arg1): 11523 try: 11524 if not arg0.__class__ is id_list: 11525 arg0 = id_list(arg0) 11526 except: 11527 raise 11528 try: 11529 if not arg1.__class__ is id: 11530 arg1 = id(arg1) 11531 except: 11532 raise 11533 ctx = arg0.ctx 11534 res = isl.isl_id_list_add(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 11535 obj = id_list(ctx=ctx, ptr=res) 11536 return obj 11537 def at(arg0, arg1): 11538 try: 11539 if not arg0.__class__ is id_list: 11540 arg0 = id_list(arg0) 11541 except: 11542 raise 11543 ctx = arg0.ctx 11544 res = isl.isl_id_list_get_at(arg0.ptr, arg1) 11545 obj = id(ctx=ctx, ptr=res) 11546 return obj 11547 def get_at(arg0, arg1): 11548 return arg0.at(arg1) 11549 def clear(arg0): 11550 try: 11551 if not arg0.__class__ is id_list: 11552 arg0 = id_list(arg0) 11553 except: 11554 raise 11555 ctx = arg0.ctx 11556 res = isl.isl_id_list_clear(isl.isl_id_list_copy(arg0.ptr)) 11557 obj = id_list(ctx=ctx, ptr=res) 11558 return obj 11559 def concat(arg0, arg1): 11560 try: 11561 if not arg0.__class__ is id_list: 11562 arg0 = id_list(arg0) 11563 except: 11564 raise 11565 try: 11566 if not arg1.__class__ is id_list: 11567 arg1 = id_list(arg1) 11568 except: 11569 raise 11570 ctx = arg0.ctx 11571 res = isl.isl_id_list_concat(isl.isl_id_list_copy(arg0.ptr), isl.isl_id_list_copy(arg1.ptr)) 11572 obj = id_list(ctx=ctx, ptr=res) 11573 return obj 11574 def drop(arg0, arg1, arg2): 11575 try: 11576 if not arg0.__class__ is id_list: 11577 arg0 = id_list(arg0) 11578 except: 11579 raise 11580 ctx = arg0.ctx 11581 res = isl.isl_id_list_drop(isl.isl_id_list_copy(arg0.ptr), arg1, arg2) 11582 obj = id_list(ctx=ctx, ptr=res) 11583 return obj 11584 def foreach(arg0, arg1): 11585 try: 11586 if not arg0.__class__ is id_list: 11587 arg0 = id_list(arg0) 11588 except: 11589 raise 11590 exc_info = [None] 11591 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11592 def cb_func(cb_arg0, cb_arg1): 11593 cb_arg0 = id(ctx=arg0.ctx, ptr=(cb_arg0)) 11594 try: 11595 arg1(cb_arg0) 11596 except BaseException as e: 11597 exc_info[0] = e 11598 return -1 11599 return 0 11600 cb = fn(cb_func) 11601 ctx = arg0.ctx 11602 res = isl.isl_id_list_foreach(arg0.ptr, cb, None) 11603 if exc_info[0] is not None: 11604 raise exc_info[0] 11605 if res < 0: 11606 raise 11607 def insert(arg0, arg1, arg2): 11608 try: 11609 if not arg0.__class__ is id_list: 11610 arg0 = id_list(arg0) 11611 except: 11612 raise 11613 try: 11614 if not arg2.__class__ is id: 11615 arg2 = id(arg2) 11616 except: 11617 raise 11618 ctx = arg0.ctx 11619 res = isl.isl_id_list_insert(isl.isl_id_list_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 11620 obj = id_list(ctx=ctx, ptr=res) 11621 return obj 11622 def size(arg0): 11623 try: 11624 if not arg0.__class__ is id_list: 11625 arg0 = id_list(arg0) 11626 except: 11627 raise 11628 ctx = arg0.ctx 11629 res = isl.isl_id_list_size(arg0.ptr) 11630 if res < 0: 11631 raise 11632 return int(res) 11633 11634isl.isl_id_list_alloc.restype = c_void_p 11635isl.isl_id_list_alloc.argtypes = [Context, c_int] 11636isl.isl_id_list_from_id.restype = c_void_p 11637isl.isl_id_list_from_id.argtypes = [c_void_p] 11638isl.isl_id_list_read_from_str.restype = c_void_p 11639isl.isl_id_list_read_from_str.argtypes = [Context, c_char_p] 11640isl.isl_id_list_add.restype = c_void_p 11641isl.isl_id_list_add.argtypes = [c_void_p, c_void_p] 11642isl.isl_id_list_get_at.restype = c_void_p 11643isl.isl_id_list_get_at.argtypes = [c_void_p, c_int] 11644isl.isl_id_list_clear.restype = c_void_p 11645isl.isl_id_list_clear.argtypes = [c_void_p] 11646isl.isl_id_list_concat.restype = c_void_p 11647isl.isl_id_list_concat.argtypes = [c_void_p, c_void_p] 11648isl.isl_id_list_drop.restype = c_void_p 11649isl.isl_id_list_drop.argtypes = [c_void_p, c_int, c_int] 11650isl.isl_id_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 11651isl.isl_id_list_insert.restype = c_void_p 11652isl.isl_id_list_insert.argtypes = [c_void_p, c_int, c_void_p] 11653isl.isl_id_list_size.argtypes = [c_void_p] 11654isl.isl_id_list_copy.restype = c_void_p 11655isl.isl_id_list_copy.argtypes = [c_void_p] 11656isl.isl_id_list_free.restype = c_void_p 11657isl.isl_id_list_free.argtypes = [c_void_p] 11658isl.isl_id_list_to_str.restype = POINTER(c_char) 11659isl.isl_id_list_to_str.argtypes = [c_void_p] 11660 11661class map_list(object): 11662 def __init__(self, *args, **keywords): 11663 if "ptr" in keywords: 11664 self.ctx = keywords["ctx"] 11665 self.ptr = keywords["ptr"] 11666 return 11667 if len(args) == 1 and type(args[0]) == int: 11668 self.ctx = Context.getDefaultInstance() 11669 self.ptr = isl.isl_map_list_alloc(self.ctx, args[0]) 11670 return 11671 if len(args) == 1 and args[0].__class__ is map: 11672 self.ctx = Context.getDefaultInstance() 11673 self.ptr = isl.isl_map_list_from_map(isl.isl_map_copy(args[0].ptr)) 11674 return 11675 if len(args) == 1 and type(args[0]) == str: 11676 self.ctx = Context.getDefaultInstance() 11677 self.ptr = isl.isl_map_list_read_from_str(self.ctx, args[0].encode('ascii')) 11678 return 11679 raise Error 11680 def __del__(self): 11681 if hasattr(self, 'ptr'): 11682 isl.isl_map_list_free(self.ptr) 11683 def __str__(arg0): 11684 try: 11685 if not arg0.__class__ is map_list: 11686 arg0 = map_list(arg0) 11687 except: 11688 raise 11689 ptr = isl.isl_map_list_to_str(arg0.ptr) 11690 res = cast(ptr, c_char_p).value.decode('ascii') 11691 libc.free(ptr) 11692 return res 11693 def __repr__(self): 11694 s = str(self) 11695 if '"' in s: 11696 return 'isl.map_list("""%s""")' % s 11697 else: 11698 return 'isl.map_list("%s")' % s 11699 def add(arg0, arg1): 11700 try: 11701 if not arg0.__class__ is map_list: 11702 arg0 = map_list(arg0) 11703 except: 11704 raise 11705 try: 11706 if not arg1.__class__ is map: 11707 arg1 = map(arg1) 11708 except: 11709 raise 11710 ctx = arg0.ctx 11711 res = isl.isl_map_list_add(isl.isl_map_list_copy(arg0.ptr), isl.isl_map_copy(arg1.ptr)) 11712 obj = map_list(ctx=ctx, ptr=res) 11713 return obj 11714 def at(arg0, arg1): 11715 try: 11716 if not arg0.__class__ is map_list: 11717 arg0 = map_list(arg0) 11718 except: 11719 raise 11720 ctx = arg0.ctx 11721 res = isl.isl_map_list_get_at(arg0.ptr, arg1) 11722 obj = map(ctx=ctx, ptr=res) 11723 return obj 11724 def get_at(arg0, arg1): 11725 return arg0.at(arg1) 11726 def clear(arg0): 11727 try: 11728 if not arg0.__class__ is map_list: 11729 arg0 = map_list(arg0) 11730 except: 11731 raise 11732 ctx = arg0.ctx 11733 res = isl.isl_map_list_clear(isl.isl_map_list_copy(arg0.ptr)) 11734 obj = map_list(ctx=ctx, ptr=res) 11735 return obj 11736 def concat(arg0, arg1): 11737 try: 11738 if not arg0.__class__ is map_list: 11739 arg0 = map_list(arg0) 11740 except: 11741 raise 11742 try: 11743 if not arg1.__class__ is map_list: 11744 arg1 = map_list(arg1) 11745 except: 11746 raise 11747 ctx = arg0.ctx 11748 res = isl.isl_map_list_concat(isl.isl_map_list_copy(arg0.ptr), isl.isl_map_list_copy(arg1.ptr)) 11749 obj = map_list(ctx=ctx, ptr=res) 11750 return obj 11751 def drop(arg0, arg1, arg2): 11752 try: 11753 if not arg0.__class__ is map_list: 11754 arg0 = map_list(arg0) 11755 except: 11756 raise 11757 ctx = arg0.ctx 11758 res = isl.isl_map_list_drop(isl.isl_map_list_copy(arg0.ptr), arg1, arg2) 11759 obj = map_list(ctx=ctx, ptr=res) 11760 return obj 11761 def foreach(arg0, arg1): 11762 try: 11763 if not arg0.__class__ is map_list: 11764 arg0 = map_list(arg0) 11765 except: 11766 raise 11767 exc_info = [None] 11768 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 11769 def cb_func(cb_arg0, cb_arg1): 11770 cb_arg0 = map(ctx=arg0.ctx, ptr=(cb_arg0)) 11771 try: 11772 arg1(cb_arg0) 11773 except BaseException as e: 11774 exc_info[0] = e 11775 return -1 11776 return 0 11777 cb = fn(cb_func) 11778 ctx = arg0.ctx 11779 res = isl.isl_map_list_foreach(arg0.ptr, cb, None) 11780 if exc_info[0] is not None: 11781 raise exc_info[0] 11782 if res < 0: 11783 raise 11784 def insert(arg0, arg1, arg2): 11785 try: 11786 if not arg0.__class__ is map_list: 11787 arg0 = map_list(arg0) 11788 except: 11789 raise 11790 try: 11791 if not arg2.__class__ is map: 11792 arg2 = map(arg2) 11793 except: 11794 raise 11795 ctx = arg0.ctx 11796 res = isl.isl_map_list_insert(isl.isl_map_list_copy(arg0.ptr), arg1, isl.isl_map_copy(arg2.ptr)) 11797 obj = map_list(ctx=ctx, ptr=res) 11798 return obj 11799 def size(arg0): 11800 try: 11801 if not arg0.__class__ is map_list: 11802 arg0 = map_list(arg0) 11803 except: 11804 raise 11805 ctx = arg0.ctx 11806 res = isl.isl_map_list_size(arg0.ptr) 11807 if res < 0: 11808 raise 11809 return int(res) 11810 11811isl.isl_map_list_alloc.restype = c_void_p 11812isl.isl_map_list_alloc.argtypes = [Context, c_int] 11813isl.isl_map_list_from_map.restype = c_void_p 11814isl.isl_map_list_from_map.argtypes = [c_void_p] 11815isl.isl_map_list_read_from_str.restype = c_void_p 11816isl.isl_map_list_read_from_str.argtypes = [Context, c_char_p] 11817isl.isl_map_list_add.restype = c_void_p 11818isl.isl_map_list_add.argtypes = [c_void_p, c_void_p] 11819isl.isl_map_list_get_at.restype = c_void_p 11820isl.isl_map_list_get_at.argtypes = [c_void_p, c_int] 11821isl.isl_map_list_clear.restype = c_void_p 11822isl.isl_map_list_clear.argtypes = [c_void_p] 11823isl.isl_map_list_concat.restype = c_void_p 11824isl.isl_map_list_concat.argtypes = [c_void_p, c_void_p] 11825isl.isl_map_list_drop.restype = c_void_p 11826isl.isl_map_list_drop.argtypes = [c_void_p, c_int, c_int] 11827isl.isl_map_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 11828isl.isl_map_list_insert.restype = c_void_p 11829isl.isl_map_list_insert.argtypes = [c_void_p, c_int, c_void_p] 11830isl.isl_map_list_size.argtypes = [c_void_p] 11831isl.isl_map_list_copy.restype = c_void_p 11832isl.isl_map_list_copy.argtypes = [c_void_p] 11833isl.isl_map_list_free.restype = c_void_p 11834isl.isl_map_list_free.argtypes = [c_void_p] 11835isl.isl_map_list_to_str.restype = POINTER(c_char) 11836isl.isl_map_list_to_str.argtypes = [c_void_p] 11837 11838class multi_id(object): 11839 def __init__(self, *args, **keywords): 11840 if "ptr" in keywords: 11841 self.ctx = keywords["ctx"] 11842 self.ptr = keywords["ptr"] 11843 return 11844 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is id_list: 11845 self.ctx = Context.getDefaultInstance() 11846 self.ptr = isl.isl_multi_id_from_id_list(isl.isl_space_copy(args[0].ptr), isl.isl_id_list_copy(args[1].ptr)) 11847 return 11848 if len(args) == 1 and type(args[0]) == str: 11849 self.ctx = Context.getDefaultInstance() 11850 self.ptr = isl.isl_multi_id_read_from_str(self.ctx, args[0].encode('ascii')) 11851 return 11852 raise Error 11853 def __del__(self): 11854 if hasattr(self, 'ptr'): 11855 isl.isl_multi_id_free(self.ptr) 11856 def __str__(arg0): 11857 try: 11858 if not arg0.__class__ is multi_id: 11859 arg0 = multi_id(arg0) 11860 except: 11861 raise 11862 ptr = isl.isl_multi_id_to_str(arg0.ptr) 11863 res = cast(ptr, c_char_p).value.decode('ascii') 11864 libc.free(ptr) 11865 return res 11866 def __repr__(self): 11867 s = str(self) 11868 if '"' in s: 11869 return 'isl.multi_id("""%s""")' % s 11870 else: 11871 return 'isl.multi_id("%s")' % s 11872 def at(arg0, arg1): 11873 try: 11874 if not arg0.__class__ is multi_id: 11875 arg0 = multi_id(arg0) 11876 except: 11877 raise 11878 ctx = arg0.ctx 11879 res = isl.isl_multi_id_get_at(arg0.ptr, arg1) 11880 obj = id(ctx=ctx, ptr=res) 11881 return obj 11882 def get_at(arg0, arg1): 11883 return arg0.at(arg1) 11884 def flat_range_product(arg0, arg1): 11885 try: 11886 if not arg0.__class__ is multi_id: 11887 arg0 = multi_id(arg0) 11888 except: 11889 raise 11890 try: 11891 if not arg1.__class__ is multi_id: 11892 arg1 = multi_id(arg1) 11893 except: 11894 raise 11895 ctx = arg0.ctx 11896 res = isl.isl_multi_id_flat_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 11897 obj = multi_id(ctx=ctx, ptr=res) 11898 return obj 11899 def list(arg0): 11900 try: 11901 if not arg0.__class__ is multi_id: 11902 arg0 = multi_id(arg0) 11903 except: 11904 raise 11905 ctx = arg0.ctx 11906 res = isl.isl_multi_id_get_list(arg0.ptr) 11907 obj = id_list(ctx=ctx, ptr=res) 11908 return obj 11909 def get_list(arg0): 11910 return arg0.list() 11911 def plain_is_equal(arg0, arg1): 11912 try: 11913 if not arg0.__class__ is multi_id: 11914 arg0 = multi_id(arg0) 11915 except: 11916 raise 11917 try: 11918 if not arg1.__class__ is multi_id: 11919 arg1 = multi_id(arg1) 11920 except: 11921 raise 11922 ctx = arg0.ctx 11923 res = isl.isl_multi_id_plain_is_equal(arg0.ptr, arg1.ptr) 11924 if res < 0: 11925 raise 11926 return bool(res) 11927 def range_product(arg0, arg1): 11928 try: 11929 if not arg0.__class__ is multi_id: 11930 arg0 = multi_id(arg0) 11931 except: 11932 raise 11933 try: 11934 if not arg1.__class__ is multi_id: 11935 arg1 = multi_id(arg1) 11936 except: 11937 raise 11938 ctx = arg0.ctx 11939 res = isl.isl_multi_id_range_product(isl.isl_multi_id_copy(arg0.ptr), isl.isl_multi_id_copy(arg1.ptr)) 11940 obj = multi_id(ctx=ctx, ptr=res) 11941 return obj 11942 def set_at(arg0, arg1, arg2): 11943 try: 11944 if not arg0.__class__ is multi_id: 11945 arg0 = multi_id(arg0) 11946 except: 11947 raise 11948 try: 11949 if not arg2.__class__ is id: 11950 arg2 = id(arg2) 11951 except: 11952 raise 11953 ctx = arg0.ctx 11954 res = isl.isl_multi_id_set_at(isl.isl_multi_id_copy(arg0.ptr), arg1, isl.isl_id_copy(arg2.ptr)) 11955 obj = multi_id(ctx=ctx, ptr=res) 11956 return obj 11957 def size(arg0): 11958 try: 11959 if not arg0.__class__ is multi_id: 11960 arg0 = multi_id(arg0) 11961 except: 11962 raise 11963 ctx = arg0.ctx 11964 res = isl.isl_multi_id_size(arg0.ptr) 11965 if res < 0: 11966 raise 11967 return int(res) 11968 def space(arg0): 11969 try: 11970 if not arg0.__class__ is multi_id: 11971 arg0 = multi_id(arg0) 11972 except: 11973 raise 11974 ctx = arg0.ctx 11975 res = isl.isl_multi_id_get_space(arg0.ptr) 11976 obj = space(ctx=ctx, ptr=res) 11977 return obj 11978 def get_space(arg0): 11979 return arg0.space() 11980 11981isl.isl_multi_id_from_id_list.restype = c_void_p 11982isl.isl_multi_id_from_id_list.argtypes = [c_void_p, c_void_p] 11983isl.isl_multi_id_read_from_str.restype = c_void_p 11984isl.isl_multi_id_read_from_str.argtypes = [Context, c_char_p] 11985isl.isl_multi_id_get_at.restype = c_void_p 11986isl.isl_multi_id_get_at.argtypes = [c_void_p, c_int] 11987isl.isl_multi_id_flat_range_product.restype = c_void_p 11988isl.isl_multi_id_flat_range_product.argtypes = [c_void_p, c_void_p] 11989isl.isl_multi_id_get_list.restype = c_void_p 11990isl.isl_multi_id_get_list.argtypes = [c_void_p] 11991isl.isl_multi_id_plain_is_equal.argtypes = [c_void_p, c_void_p] 11992isl.isl_multi_id_range_product.restype = c_void_p 11993isl.isl_multi_id_range_product.argtypes = [c_void_p, c_void_p] 11994isl.isl_multi_id_set_at.restype = c_void_p 11995isl.isl_multi_id_set_at.argtypes = [c_void_p, c_int, c_void_p] 11996isl.isl_multi_id_size.argtypes = [c_void_p] 11997isl.isl_multi_id_get_space.restype = c_void_p 11998isl.isl_multi_id_get_space.argtypes = [c_void_p] 11999isl.isl_multi_id_copy.restype = c_void_p 12000isl.isl_multi_id_copy.argtypes = [c_void_p] 12001isl.isl_multi_id_free.restype = c_void_p 12002isl.isl_multi_id_free.argtypes = [c_void_p] 12003isl.isl_multi_id_to_str.restype = POINTER(c_char) 12004isl.isl_multi_id_to_str.argtypes = [c_void_p] 12005 12006class multi_val(object): 12007 def __init__(self, *args, **keywords): 12008 if "ptr" in keywords: 12009 self.ctx = keywords["ctx"] 12010 self.ptr = keywords["ptr"] 12011 return 12012 if len(args) == 2 and args[0].__class__ is space and args[1].__class__ is val_list: 12013 self.ctx = Context.getDefaultInstance() 12014 self.ptr = isl.isl_multi_val_from_val_list(isl.isl_space_copy(args[0].ptr), isl.isl_val_list_copy(args[1].ptr)) 12015 return 12016 if len(args) == 1 and type(args[0]) == str: 12017 self.ctx = Context.getDefaultInstance() 12018 self.ptr = isl.isl_multi_val_read_from_str(self.ctx, args[0].encode('ascii')) 12019 return 12020 raise Error 12021 def __del__(self): 12022 if hasattr(self, 'ptr'): 12023 isl.isl_multi_val_free(self.ptr) 12024 def __str__(arg0): 12025 try: 12026 if not arg0.__class__ is multi_val: 12027 arg0 = multi_val(arg0) 12028 except: 12029 raise 12030 ptr = isl.isl_multi_val_to_str(arg0.ptr) 12031 res = cast(ptr, c_char_p).value.decode('ascii') 12032 libc.free(ptr) 12033 return res 12034 def __repr__(self): 12035 s = str(self) 12036 if '"' in s: 12037 return 'isl.multi_val("""%s""")' % s 12038 else: 12039 return 'isl.multi_val("%s")' % s 12040 def add(*args): 12041 if len(args) == 2 and args[1].__class__ is multi_val: 12042 ctx = args[0].ctx 12043 res = isl.isl_multi_val_add(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 12044 obj = multi_val(ctx=ctx, ptr=res) 12045 return obj 12046 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 12047 args = list(args) 12048 try: 12049 if not args[1].__class__ is val: 12050 args[1] = val(args[1]) 12051 except: 12052 raise 12053 ctx = args[0].ctx 12054 res = isl.isl_multi_val_add_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 12055 obj = multi_val(ctx=ctx, ptr=res) 12056 return obj 12057 raise Error 12058 def at(arg0, arg1): 12059 try: 12060 if not arg0.__class__ is multi_val: 12061 arg0 = multi_val(arg0) 12062 except: 12063 raise 12064 ctx = arg0.ctx 12065 res = isl.isl_multi_val_get_at(arg0.ptr, arg1) 12066 obj = val(ctx=ctx, ptr=res) 12067 return obj 12068 def get_at(arg0, arg1): 12069 return arg0.at(arg1) 12070 def flat_range_product(arg0, arg1): 12071 try: 12072 if not arg0.__class__ is multi_val: 12073 arg0 = multi_val(arg0) 12074 except: 12075 raise 12076 try: 12077 if not arg1.__class__ is multi_val: 12078 arg1 = multi_val(arg1) 12079 except: 12080 raise 12081 ctx = arg0.ctx 12082 res = isl.isl_multi_val_flat_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12083 obj = multi_val(ctx=ctx, ptr=res) 12084 return obj 12085 def has_range_tuple_id(arg0): 12086 try: 12087 if not arg0.__class__ is multi_val: 12088 arg0 = multi_val(arg0) 12089 except: 12090 raise 12091 ctx = arg0.ctx 12092 res = isl.isl_multi_val_has_range_tuple_id(arg0.ptr) 12093 if res < 0: 12094 raise 12095 return bool(res) 12096 def involves_nan(arg0): 12097 try: 12098 if not arg0.__class__ is multi_val: 12099 arg0 = multi_val(arg0) 12100 except: 12101 raise 12102 ctx = arg0.ctx 12103 res = isl.isl_multi_val_involves_nan(arg0.ptr) 12104 if res < 0: 12105 raise 12106 return bool(res) 12107 def list(arg0): 12108 try: 12109 if not arg0.__class__ is multi_val: 12110 arg0 = multi_val(arg0) 12111 except: 12112 raise 12113 ctx = arg0.ctx 12114 res = isl.isl_multi_val_get_list(arg0.ptr) 12115 obj = val_list(ctx=ctx, ptr=res) 12116 return obj 12117 def get_list(arg0): 12118 return arg0.list() 12119 def max(arg0, arg1): 12120 try: 12121 if not arg0.__class__ is multi_val: 12122 arg0 = multi_val(arg0) 12123 except: 12124 raise 12125 try: 12126 if not arg1.__class__ is multi_val: 12127 arg1 = multi_val(arg1) 12128 except: 12129 raise 12130 ctx = arg0.ctx 12131 res = isl.isl_multi_val_max(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12132 obj = multi_val(ctx=ctx, ptr=res) 12133 return obj 12134 def min(arg0, arg1): 12135 try: 12136 if not arg0.__class__ is multi_val: 12137 arg0 = multi_val(arg0) 12138 except: 12139 raise 12140 try: 12141 if not arg1.__class__ is multi_val: 12142 arg1 = multi_val(arg1) 12143 except: 12144 raise 12145 ctx = arg0.ctx 12146 res = isl.isl_multi_val_min(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12147 obj = multi_val(ctx=ctx, ptr=res) 12148 return obj 12149 def neg(arg0): 12150 try: 12151 if not arg0.__class__ is multi_val: 12152 arg0 = multi_val(arg0) 12153 except: 12154 raise 12155 ctx = arg0.ctx 12156 res = isl.isl_multi_val_neg(isl.isl_multi_val_copy(arg0.ptr)) 12157 obj = multi_val(ctx=ctx, ptr=res) 12158 return obj 12159 def plain_is_equal(arg0, arg1): 12160 try: 12161 if not arg0.__class__ is multi_val: 12162 arg0 = multi_val(arg0) 12163 except: 12164 raise 12165 try: 12166 if not arg1.__class__ is multi_val: 12167 arg1 = multi_val(arg1) 12168 except: 12169 raise 12170 ctx = arg0.ctx 12171 res = isl.isl_multi_val_plain_is_equal(arg0.ptr, arg1.ptr) 12172 if res < 0: 12173 raise 12174 return bool(res) 12175 def product(arg0, arg1): 12176 try: 12177 if not arg0.__class__ is multi_val: 12178 arg0 = multi_val(arg0) 12179 except: 12180 raise 12181 try: 12182 if not arg1.__class__ is multi_val: 12183 arg1 = multi_val(arg1) 12184 except: 12185 raise 12186 ctx = arg0.ctx 12187 res = isl.isl_multi_val_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12188 obj = multi_val(ctx=ctx, ptr=res) 12189 return obj 12190 def range_product(arg0, arg1): 12191 try: 12192 if not arg0.__class__ is multi_val: 12193 arg0 = multi_val(arg0) 12194 except: 12195 raise 12196 try: 12197 if not arg1.__class__ is multi_val: 12198 arg1 = multi_val(arg1) 12199 except: 12200 raise 12201 ctx = arg0.ctx 12202 res = isl.isl_multi_val_range_product(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12203 obj = multi_val(ctx=ctx, ptr=res) 12204 return obj 12205 def range_tuple_id(arg0): 12206 try: 12207 if not arg0.__class__ is multi_val: 12208 arg0 = multi_val(arg0) 12209 except: 12210 raise 12211 ctx = arg0.ctx 12212 res = isl.isl_multi_val_get_range_tuple_id(arg0.ptr) 12213 obj = id(ctx=ctx, ptr=res) 12214 return obj 12215 def get_range_tuple_id(arg0): 12216 return arg0.range_tuple_id() 12217 def reset_range_tuple_id(arg0): 12218 try: 12219 if not arg0.__class__ is multi_val: 12220 arg0 = multi_val(arg0) 12221 except: 12222 raise 12223 ctx = arg0.ctx 12224 res = isl.isl_multi_val_reset_range_tuple_id(isl.isl_multi_val_copy(arg0.ptr)) 12225 obj = multi_val(ctx=ctx, ptr=res) 12226 return obj 12227 def scale(*args): 12228 if len(args) == 2 and args[1].__class__ is multi_val: 12229 ctx = args[0].ctx 12230 res = isl.isl_multi_val_scale_multi_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_multi_val_copy(args[1].ptr)) 12231 obj = multi_val(ctx=ctx, ptr=res) 12232 return obj 12233 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 12234 args = list(args) 12235 try: 12236 if not args[1].__class__ is val: 12237 args[1] = val(args[1]) 12238 except: 12239 raise 12240 ctx = args[0].ctx 12241 res = isl.isl_multi_val_scale_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 12242 obj = multi_val(ctx=ctx, ptr=res) 12243 return obj 12244 raise Error 12245 def scale_down(*args): 12246 if len(args) == 2 and args[1].__class__ is multi_val: 12247 ctx = args[0].ctx 12248 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)) 12249 obj = multi_val(ctx=ctx, ptr=res) 12250 return obj 12251 if len(args) == 2 and (args[1].__class__ is val or type(args[1]) == int): 12252 args = list(args) 12253 try: 12254 if not args[1].__class__ is val: 12255 args[1] = val(args[1]) 12256 except: 12257 raise 12258 ctx = args[0].ctx 12259 res = isl.isl_multi_val_scale_down_val(isl.isl_multi_val_copy(args[0].ptr), isl.isl_val_copy(args[1].ptr)) 12260 obj = multi_val(ctx=ctx, ptr=res) 12261 return obj 12262 raise Error 12263 def set_at(arg0, arg1, arg2): 12264 try: 12265 if not arg0.__class__ is multi_val: 12266 arg0 = multi_val(arg0) 12267 except: 12268 raise 12269 try: 12270 if not arg2.__class__ is val: 12271 arg2 = val(arg2) 12272 except: 12273 raise 12274 ctx = arg0.ctx 12275 res = isl.isl_multi_val_set_at(isl.isl_multi_val_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 12276 obj = multi_val(ctx=ctx, ptr=res) 12277 return obj 12278 def set_range_tuple(*args): 12279 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 12280 args = list(args) 12281 try: 12282 if not args[1].__class__ is id: 12283 args[1] = id(args[1]) 12284 except: 12285 raise 12286 ctx = args[0].ctx 12287 res = isl.isl_multi_val_set_range_tuple_id(isl.isl_multi_val_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 12288 obj = multi_val(ctx=ctx, ptr=res) 12289 return obj 12290 raise Error 12291 def size(arg0): 12292 try: 12293 if not arg0.__class__ is multi_val: 12294 arg0 = multi_val(arg0) 12295 except: 12296 raise 12297 ctx = arg0.ctx 12298 res = isl.isl_multi_val_size(arg0.ptr) 12299 if res < 0: 12300 raise 12301 return int(res) 12302 def space(arg0): 12303 try: 12304 if not arg0.__class__ is multi_val: 12305 arg0 = multi_val(arg0) 12306 except: 12307 raise 12308 ctx = arg0.ctx 12309 res = isl.isl_multi_val_get_space(arg0.ptr) 12310 obj = space(ctx=ctx, ptr=res) 12311 return obj 12312 def get_space(arg0): 12313 return arg0.space() 12314 def sub(arg0, arg1): 12315 try: 12316 if not arg0.__class__ is multi_val: 12317 arg0 = multi_val(arg0) 12318 except: 12319 raise 12320 try: 12321 if not arg1.__class__ is multi_val: 12322 arg1 = multi_val(arg1) 12323 except: 12324 raise 12325 ctx = arg0.ctx 12326 res = isl.isl_multi_val_sub(isl.isl_multi_val_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 12327 obj = multi_val(ctx=ctx, ptr=res) 12328 return obj 12329 @staticmethod 12330 def zero(arg0): 12331 try: 12332 if not arg0.__class__ is space: 12333 arg0 = space(arg0) 12334 except: 12335 raise 12336 ctx = arg0.ctx 12337 res = isl.isl_multi_val_zero(isl.isl_space_copy(arg0.ptr)) 12338 obj = multi_val(ctx=ctx, ptr=res) 12339 return obj 12340 12341isl.isl_multi_val_from_val_list.restype = c_void_p 12342isl.isl_multi_val_from_val_list.argtypes = [c_void_p, c_void_p] 12343isl.isl_multi_val_read_from_str.restype = c_void_p 12344isl.isl_multi_val_read_from_str.argtypes = [Context, c_char_p] 12345isl.isl_multi_val_add.restype = c_void_p 12346isl.isl_multi_val_add.argtypes = [c_void_p, c_void_p] 12347isl.isl_multi_val_add_val.restype = c_void_p 12348isl.isl_multi_val_add_val.argtypes = [c_void_p, c_void_p] 12349isl.isl_multi_val_get_at.restype = c_void_p 12350isl.isl_multi_val_get_at.argtypes = [c_void_p, c_int] 12351isl.isl_multi_val_flat_range_product.restype = c_void_p 12352isl.isl_multi_val_flat_range_product.argtypes = [c_void_p, c_void_p] 12353isl.isl_multi_val_has_range_tuple_id.argtypes = [c_void_p] 12354isl.isl_multi_val_involves_nan.argtypes = [c_void_p] 12355isl.isl_multi_val_get_list.restype = c_void_p 12356isl.isl_multi_val_get_list.argtypes = [c_void_p] 12357isl.isl_multi_val_max.restype = c_void_p 12358isl.isl_multi_val_max.argtypes = [c_void_p, c_void_p] 12359isl.isl_multi_val_min.restype = c_void_p 12360isl.isl_multi_val_min.argtypes = [c_void_p, c_void_p] 12361isl.isl_multi_val_neg.restype = c_void_p 12362isl.isl_multi_val_neg.argtypes = [c_void_p] 12363isl.isl_multi_val_plain_is_equal.argtypes = [c_void_p, c_void_p] 12364isl.isl_multi_val_product.restype = c_void_p 12365isl.isl_multi_val_product.argtypes = [c_void_p, c_void_p] 12366isl.isl_multi_val_range_product.restype = c_void_p 12367isl.isl_multi_val_range_product.argtypes = [c_void_p, c_void_p] 12368isl.isl_multi_val_get_range_tuple_id.restype = c_void_p 12369isl.isl_multi_val_get_range_tuple_id.argtypes = [c_void_p] 12370isl.isl_multi_val_reset_range_tuple_id.restype = c_void_p 12371isl.isl_multi_val_reset_range_tuple_id.argtypes = [c_void_p] 12372isl.isl_multi_val_scale_multi_val.restype = c_void_p 12373isl.isl_multi_val_scale_multi_val.argtypes = [c_void_p, c_void_p] 12374isl.isl_multi_val_scale_val.restype = c_void_p 12375isl.isl_multi_val_scale_val.argtypes = [c_void_p, c_void_p] 12376isl.isl_multi_val_scale_down_multi_val.restype = c_void_p 12377isl.isl_multi_val_scale_down_multi_val.argtypes = [c_void_p, c_void_p] 12378isl.isl_multi_val_scale_down_val.restype = c_void_p 12379isl.isl_multi_val_scale_down_val.argtypes = [c_void_p, c_void_p] 12380isl.isl_multi_val_set_at.restype = c_void_p 12381isl.isl_multi_val_set_at.argtypes = [c_void_p, c_int, c_void_p] 12382isl.isl_multi_val_set_range_tuple_id.restype = c_void_p 12383isl.isl_multi_val_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 12384isl.isl_multi_val_size.argtypes = [c_void_p] 12385isl.isl_multi_val_get_space.restype = c_void_p 12386isl.isl_multi_val_get_space.argtypes = [c_void_p] 12387isl.isl_multi_val_sub.restype = c_void_p 12388isl.isl_multi_val_sub.argtypes = [c_void_p, c_void_p] 12389isl.isl_multi_val_zero.restype = c_void_p 12390isl.isl_multi_val_zero.argtypes = [c_void_p] 12391isl.isl_multi_val_copy.restype = c_void_p 12392isl.isl_multi_val_copy.argtypes = [c_void_p] 12393isl.isl_multi_val_free.restype = c_void_p 12394isl.isl_multi_val_free.argtypes = [c_void_p] 12395isl.isl_multi_val_to_str.restype = POINTER(c_char) 12396isl.isl_multi_val_to_str.argtypes = [c_void_p] 12397 12398class point(basic_set): 12399 def __init__(self, *args, **keywords): 12400 if "ptr" in keywords: 12401 self.ctx = keywords["ctx"] 12402 self.ptr = keywords["ptr"] 12403 return 12404 raise Error 12405 def __del__(self): 12406 if hasattr(self, 'ptr'): 12407 isl.isl_point_free(self.ptr) 12408 def __str__(arg0): 12409 try: 12410 if not arg0.__class__ is point: 12411 arg0 = point(arg0) 12412 except: 12413 raise 12414 ptr = isl.isl_point_to_str(arg0.ptr) 12415 res = cast(ptr, c_char_p).value.decode('ascii') 12416 libc.free(ptr) 12417 return res 12418 def __repr__(self): 12419 s = str(self) 12420 if '"' in s: 12421 return 'isl.point("""%s""")' % s 12422 else: 12423 return 'isl.point("%s")' % s 12424 def multi_val(arg0): 12425 try: 12426 if not arg0.__class__ is point: 12427 arg0 = point(arg0) 12428 except: 12429 raise 12430 ctx = arg0.ctx 12431 res = isl.isl_point_get_multi_val(arg0.ptr) 12432 obj = multi_val(ctx=ctx, ptr=res) 12433 return obj 12434 def get_multi_val(arg0): 12435 return arg0.multi_val() 12436 def to_set(arg0): 12437 try: 12438 if not arg0.__class__ is point: 12439 arg0 = point(arg0) 12440 except: 12441 raise 12442 ctx = arg0.ctx 12443 res = isl.isl_point_to_set(isl.isl_point_copy(arg0.ptr)) 12444 obj = set(ctx=ctx, ptr=res) 12445 return obj 12446 12447isl.isl_point_get_multi_val.restype = c_void_p 12448isl.isl_point_get_multi_val.argtypes = [c_void_p] 12449isl.isl_point_to_set.restype = c_void_p 12450isl.isl_point_to_set.argtypes = [c_void_p] 12451isl.isl_point_copy.restype = c_void_p 12452isl.isl_point_copy.argtypes = [c_void_p] 12453isl.isl_point_free.restype = c_void_p 12454isl.isl_point_free.argtypes = [c_void_p] 12455isl.isl_point_to_str.restype = POINTER(c_char) 12456isl.isl_point_to_str.argtypes = [c_void_p] 12457 12458class pw_aff_list(object): 12459 def __init__(self, *args, **keywords): 12460 if "ptr" in keywords: 12461 self.ctx = keywords["ctx"] 12462 self.ptr = keywords["ptr"] 12463 return 12464 if len(args) == 1 and type(args[0]) == int: 12465 self.ctx = Context.getDefaultInstance() 12466 self.ptr = isl.isl_pw_aff_list_alloc(self.ctx, args[0]) 12467 return 12468 if len(args) == 1 and args[0].__class__ is pw_aff: 12469 self.ctx = Context.getDefaultInstance() 12470 self.ptr = isl.isl_pw_aff_list_from_pw_aff(isl.isl_pw_aff_copy(args[0].ptr)) 12471 return 12472 if len(args) == 1 and type(args[0]) == str: 12473 self.ctx = Context.getDefaultInstance() 12474 self.ptr = isl.isl_pw_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 12475 return 12476 raise Error 12477 def __del__(self): 12478 if hasattr(self, 'ptr'): 12479 isl.isl_pw_aff_list_free(self.ptr) 12480 def __str__(arg0): 12481 try: 12482 if not arg0.__class__ is pw_aff_list: 12483 arg0 = pw_aff_list(arg0) 12484 except: 12485 raise 12486 ptr = isl.isl_pw_aff_list_to_str(arg0.ptr) 12487 res = cast(ptr, c_char_p).value.decode('ascii') 12488 libc.free(ptr) 12489 return res 12490 def __repr__(self): 12491 s = str(self) 12492 if '"' in s: 12493 return 'isl.pw_aff_list("""%s""")' % s 12494 else: 12495 return 'isl.pw_aff_list("%s")' % s 12496 def add(arg0, arg1): 12497 try: 12498 if not arg0.__class__ is pw_aff_list: 12499 arg0 = pw_aff_list(arg0) 12500 except: 12501 raise 12502 try: 12503 if not arg1.__class__ is pw_aff: 12504 arg1 = pw_aff(arg1) 12505 except: 12506 raise 12507 ctx = arg0.ctx 12508 res = isl.isl_pw_aff_list_add(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr)) 12509 obj = pw_aff_list(ctx=ctx, ptr=res) 12510 return obj 12511 def at(arg0, arg1): 12512 try: 12513 if not arg0.__class__ is pw_aff_list: 12514 arg0 = pw_aff_list(arg0) 12515 except: 12516 raise 12517 ctx = arg0.ctx 12518 res = isl.isl_pw_aff_list_get_at(arg0.ptr, arg1) 12519 obj = pw_aff(ctx=ctx, ptr=res) 12520 return obj 12521 def get_at(arg0, arg1): 12522 return arg0.at(arg1) 12523 def clear(arg0): 12524 try: 12525 if not arg0.__class__ is pw_aff_list: 12526 arg0 = pw_aff_list(arg0) 12527 except: 12528 raise 12529 ctx = arg0.ctx 12530 res = isl.isl_pw_aff_list_clear(isl.isl_pw_aff_list_copy(arg0.ptr)) 12531 obj = pw_aff_list(ctx=ctx, ptr=res) 12532 return obj 12533 def concat(arg0, arg1): 12534 try: 12535 if not arg0.__class__ is pw_aff_list: 12536 arg0 = pw_aff_list(arg0) 12537 except: 12538 raise 12539 try: 12540 if not arg1.__class__ is pw_aff_list: 12541 arg1 = pw_aff_list(arg1) 12542 except: 12543 raise 12544 ctx = arg0.ctx 12545 res = isl.isl_pw_aff_list_concat(isl.isl_pw_aff_list_copy(arg0.ptr), isl.isl_pw_aff_list_copy(arg1.ptr)) 12546 obj = pw_aff_list(ctx=ctx, ptr=res) 12547 return obj 12548 def drop(arg0, arg1, arg2): 12549 try: 12550 if not arg0.__class__ is pw_aff_list: 12551 arg0 = pw_aff_list(arg0) 12552 except: 12553 raise 12554 ctx = arg0.ctx 12555 res = isl.isl_pw_aff_list_drop(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, arg2) 12556 obj = pw_aff_list(ctx=ctx, ptr=res) 12557 return obj 12558 def foreach(arg0, arg1): 12559 try: 12560 if not arg0.__class__ is pw_aff_list: 12561 arg0 = pw_aff_list(arg0) 12562 except: 12563 raise 12564 exc_info = [None] 12565 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 12566 def cb_func(cb_arg0, cb_arg1): 12567 cb_arg0 = pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 12568 try: 12569 arg1(cb_arg0) 12570 except BaseException as e: 12571 exc_info[0] = e 12572 return -1 12573 return 0 12574 cb = fn(cb_func) 12575 ctx = arg0.ctx 12576 res = isl.isl_pw_aff_list_foreach(arg0.ptr, cb, None) 12577 if exc_info[0] is not None: 12578 raise exc_info[0] 12579 if res < 0: 12580 raise 12581 def insert(arg0, arg1, arg2): 12582 try: 12583 if not arg0.__class__ is pw_aff_list: 12584 arg0 = pw_aff_list(arg0) 12585 except: 12586 raise 12587 try: 12588 if not arg2.__class__ is pw_aff: 12589 arg2 = pw_aff(arg2) 12590 except: 12591 raise 12592 ctx = arg0.ctx 12593 res = isl.isl_pw_aff_list_insert(isl.isl_pw_aff_list_copy(arg0.ptr), arg1, isl.isl_pw_aff_copy(arg2.ptr)) 12594 obj = pw_aff_list(ctx=ctx, ptr=res) 12595 return obj 12596 def size(arg0): 12597 try: 12598 if not arg0.__class__ is pw_aff_list: 12599 arg0 = pw_aff_list(arg0) 12600 except: 12601 raise 12602 ctx = arg0.ctx 12603 res = isl.isl_pw_aff_list_size(arg0.ptr) 12604 if res < 0: 12605 raise 12606 return int(res) 12607 12608isl.isl_pw_aff_list_alloc.restype = c_void_p 12609isl.isl_pw_aff_list_alloc.argtypes = [Context, c_int] 12610isl.isl_pw_aff_list_from_pw_aff.restype = c_void_p 12611isl.isl_pw_aff_list_from_pw_aff.argtypes = [c_void_p] 12612isl.isl_pw_aff_list_read_from_str.restype = c_void_p 12613isl.isl_pw_aff_list_read_from_str.argtypes = [Context, c_char_p] 12614isl.isl_pw_aff_list_add.restype = c_void_p 12615isl.isl_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 12616isl.isl_pw_aff_list_get_at.restype = c_void_p 12617isl.isl_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 12618isl.isl_pw_aff_list_clear.restype = c_void_p 12619isl.isl_pw_aff_list_clear.argtypes = [c_void_p] 12620isl.isl_pw_aff_list_concat.restype = c_void_p 12621isl.isl_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 12622isl.isl_pw_aff_list_drop.restype = c_void_p 12623isl.isl_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 12624isl.isl_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 12625isl.isl_pw_aff_list_insert.restype = c_void_p 12626isl.isl_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 12627isl.isl_pw_aff_list_size.argtypes = [c_void_p] 12628isl.isl_pw_aff_list_copy.restype = c_void_p 12629isl.isl_pw_aff_list_copy.argtypes = [c_void_p] 12630isl.isl_pw_aff_list_free.restype = c_void_p 12631isl.isl_pw_aff_list_free.argtypes = [c_void_p] 12632isl.isl_pw_aff_list_to_str.restype = POINTER(c_char) 12633isl.isl_pw_aff_list_to_str.argtypes = [c_void_p] 12634 12635class pw_multi_aff_list(object): 12636 def __init__(self, *args, **keywords): 12637 if "ptr" in keywords: 12638 self.ctx = keywords["ctx"] 12639 self.ptr = keywords["ptr"] 12640 return 12641 if len(args) == 1 and type(args[0]) == int: 12642 self.ctx = Context.getDefaultInstance() 12643 self.ptr = isl.isl_pw_multi_aff_list_alloc(self.ctx, args[0]) 12644 return 12645 if len(args) == 1 and args[0].__class__ is pw_multi_aff: 12646 self.ctx = Context.getDefaultInstance() 12647 self.ptr = isl.isl_pw_multi_aff_list_from_pw_multi_aff(isl.isl_pw_multi_aff_copy(args[0].ptr)) 12648 return 12649 if len(args) == 1 and type(args[0]) == str: 12650 self.ctx = Context.getDefaultInstance() 12651 self.ptr = isl.isl_pw_multi_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 12652 return 12653 raise Error 12654 def __del__(self): 12655 if hasattr(self, 'ptr'): 12656 isl.isl_pw_multi_aff_list_free(self.ptr) 12657 def __str__(arg0): 12658 try: 12659 if not arg0.__class__ is pw_multi_aff_list: 12660 arg0 = pw_multi_aff_list(arg0) 12661 except: 12662 raise 12663 ptr = isl.isl_pw_multi_aff_list_to_str(arg0.ptr) 12664 res = cast(ptr, c_char_p).value.decode('ascii') 12665 libc.free(ptr) 12666 return res 12667 def __repr__(self): 12668 s = str(self) 12669 if '"' in s: 12670 return 'isl.pw_multi_aff_list("""%s""")' % s 12671 else: 12672 return 'isl.pw_multi_aff_list("%s")' % s 12673 def add(arg0, arg1): 12674 try: 12675 if not arg0.__class__ is pw_multi_aff_list: 12676 arg0 = pw_multi_aff_list(arg0) 12677 except: 12678 raise 12679 try: 12680 if not arg1.__class__ is pw_multi_aff: 12681 arg1 = pw_multi_aff(arg1) 12682 except: 12683 raise 12684 ctx = arg0.ctx 12685 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)) 12686 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 12687 return obj 12688 def at(arg0, arg1): 12689 try: 12690 if not arg0.__class__ is pw_multi_aff_list: 12691 arg0 = pw_multi_aff_list(arg0) 12692 except: 12693 raise 12694 ctx = arg0.ctx 12695 res = isl.isl_pw_multi_aff_list_get_at(arg0.ptr, arg1) 12696 obj = pw_multi_aff(ctx=ctx, ptr=res) 12697 return obj 12698 def get_at(arg0, arg1): 12699 return arg0.at(arg1) 12700 def clear(arg0): 12701 try: 12702 if not arg0.__class__ is pw_multi_aff_list: 12703 arg0 = pw_multi_aff_list(arg0) 12704 except: 12705 raise 12706 ctx = arg0.ctx 12707 res = isl.isl_pw_multi_aff_list_clear(isl.isl_pw_multi_aff_list_copy(arg0.ptr)) 12708 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 12709 return obj 12710 def concat(arg0, arg1): 12711 try: 12712 if not arg0.__class__ is pw_multi_aff_list: 12713 arg0 = pw_multi_aff_list(arg0) 12714 except: 12715 raise 12716 try: 12717 if not arg1.__class__ is pw_multi_aff_list: 12718 arg1 = pw_multi_aff_list(arg1) 12719 except: 12720 raise 12721 ctx = arg0.ctx 12722 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)) 12723 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 12724 return obj 12725 def drop(arg0, arg1, arg2): 12726 try: 12727 if not arg0.__class__ is pw_multi_aff_list: 12728 arg0 = pw_multi_aff_list(arg0) 12729 except: 12730 raise 12731 ctx = arg0.ctx 12732 res = isl.isl_pw_multi_aff_list_drop(isl.isl_pw_multi_aff_list_copy(arg0.ptr), arg1, arg2) 12733 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 12734 return obj 12735 def foreach(arg0, arg1): 12736 try: 12737 if not arg0.__class__ is pw_multi_aff_list: 12738 arg0 = pw_multi_aff_list(arg0) 12739 except: 12740 raise 12741 exc_info = [None] 12742 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 12743 def cb_func(cb_arg0, cb_arg1): 12744 cb_arg0 = pw_multi_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 12745 try: 12746 arg1(cb_arg0) 12747 except BaseException as e: 12748 exc_info[0] = e 12749 return -1 12750 return 0 12751 cb = fn(cb_func) 12752 ctx = arg0.ctx 12753 res = isl.isl_pw_multi_aff_list_foreach(arg0.ptr, cb, None) 12754 if exc_info[0] is not None: 12755 raise exc_info[0] 12756 if res < 0: 12757 raise 12758 def insert(arg0, arg1, arg2): 12759 try: 12760 if not arg0.__class__ is pw_multi_aff_list: 12761 arg0 = pw_multi_aff_list(arg0) 12762 except: 12763 raise 12764 try: 12765 if not arg2.__class__ is pw_multi_aff: 12766 arg2 = pw_multi_aff(arg2) 12767 except: 12768 raise 12769 ctx = arg0.ctx 12770 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)) 12771 obj = pw_multi_aff_list(ctx=ctx, ptr=res) 12772 return obj 12773 def size(arg0): 12774 try: 12775 if not arg0.__class__ is pw_multi_aff_list: 12776 arg0 = pw_multi_aff_list(arg0) 12777 except: 12778 raise 12779 ctx = arg0.ctx 12780 res = isl.isl_pw_multi_aff_list_size(arg0.ptr) 12781 if res < 0: 12782 raise 12783 return int(res) 12784 12785isl.isl_pw_multi_aff_list_alloc.restype = c_void_p 12786isl.isl_pw_multi_aff_list_alloc.argtypes = [Context, c_int] 12787isl.isl_pw_multi_aff_list_from_pw_multi_aff.restype = c_void_p 12788isl.isl_pw_multi_aff_list_from_pw_multi_aff.argtypes = [c_void_p] 12789isl.isl_pw_multi_aff_list_read_from_str.restype = c_void_p 12790isl.isl_pw_multi_aff_list_read_from_str.argtypes = [Context, c_char_p] 12791isl.isl_pw_multi_aff_list_add.restype = c_void_p 12792isl.isl_pw_multi_aff_list_add.argtypes = [c_void_p, c_void_p] 12793isl.isl_pw_multi_aff_list_get_at.restype = c_void_p 12794isl.isl_pw_multi_aff_list_get_at.argtypes = [c_void_p, c_int] 12795isl.isl_pw_multi_aff_list_clear.restype = c_void_p 12796isl.isl_pw_multi_aff_list_clear.argtypes = [c_void_p] 12797isl.isl_pw_multi_aff_list_concat.restype = c_void_p 12798isl.isl_pw_multi_aff_list_concat.argtypes = [c_void_p, c_void_p] 12799isl.isl_pw_multi_aff_list_drop.restype = c_void_p 12800isl.isl_pw_multi_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 12801isl.isl_pw_multi_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 12802isl.isl_pw_multi_aff_list_insert.restype = c_void_p 12803isl.isl_pw_multi_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 12804isl.isl_pw_multi_aff_list_size.argtypes = [c_void_p] 12805isl.isl_pw_multi_aff_list_copy.restype = c_void_p 12806isl.isl_pw_multi_aff_list_copy.argtypes = [c_void_p] 12807isl.isl_pw_multi_aff_list_free.restype = c_void_p 12808isl.isl_pw_multi_aff_list_free.argtypes = [c_void_p] 12809isl.isl_pw_multi_aff_list_to_str.restype = POINTER(c_char) 12810isl.isl_pw_multi_aff_list_to_str.argtypes = [c_void_p] 12811 12812class schedule(object): 12813 def __init__(self, *args, **keywords): 12814 if "ptr" in keywords: 12815 self.ctx = keywords["ctx"] 12816 self.ptr = keywords["ptr"] 12817 return 12818 if len(args) == 1 and type(args[0]) == str: 12819 self.ctx = Context.getDefaultInstance() 12820 self.ptr = isl.isl_schedule_read_from_str(self.ctx, args[0].encode('ascii')) 12821 return 12822 raise Error 12823 def __del__(self): 12824 if hasattr(self, 'ptr'): 12825 isl.isl_schedule_free(self.ptr) 12826 def __str__(arg0): 12827 try: 12828 if not arg0.__class__ is schedule: 12829 arg0 = schedule(arg0) 12830 except: 12831 raise 12832 ptr = isl.isl_schedule_to_str(arg0.ptr) 12833 res = cast(ptr, c_char_p).value.decode('ascii') 12834 libc.free(ptr) 12835 return res 12836 def __repr__(self): 12837 s = str(self) 12838 if '"' in s: 12839 return 'isl.schedule("""%s""")' % s 12840 else: 12841 return 'isl.schedule("%s")' % s 12842 def domain(arg0): 12843 try: 12844 if not arg0.__class__ is schedule: 12845 arg0 = schedule(arg0) 12846 except: 12847 raise 12848 ctx = arg0.ctx 12849 res = isl.isl_schedule_get_domain(arg0.ptr) 12850 obj = union_set(ctx=ctx, ptr=res) 12851 return obj 12852 def get_domain(arg0): 12853 return arg0.domain() 12854 @staticmethod 12855 def from_domain(arg0): 12856 try: 12857 if not arg0.__class__ is union_set: 12858 arg0 = union_set(arg0) 12859 except: 12860 raise 12861 ctx = arg0.ctx 12862 res = isl.isl_schedule_from_domain(isl.isl_union_set_copy(arg0.ptr)) 12863 obj = schedule(ctx=ctx, ptr=res) 12864 return obj 12865 def map(arg0): 12866 try: 12867 if not arg0.__class__ is schedule: 12868 arg0 = schedule(arg0) 12869 except: 12870 raise 12871 ctx = arg0.ctx 12872 res = isl.isl_schedule_get_map(arg0.ptr) 12873 obj = union_map(ctx=ctx, ptr=res) 12874 return obj 12875 def get_map(arg0): 12876 return arg0.map() 12877 def pullback(*args): 12878 if len(args) == 2 and args[1].__class__ is union_pw_multi_aff: 12879 ctx = args[0].ctx 12880 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)) 12881 obj = schedule(ctx=ctx, ptr=res) 12882 return obj 12883 raise Error 12884 def root(arg0): 12885 try: 12886 if not arg0.__class__ is schedule: 12887 arg0 = schedule(arg0) 12888 except: 12889 raise 12890 ctx = arg0.ctx 12891 res = isl.isl_schedule_get_root(arg0.ptr) 12892 obj = schedule_node(ctx=ctx, ptr=res) 12893 return obj 12894 def get_root(arg0): 12895 return arg0.root() 12896 12897isl.isl_schedule_read_from_str.restype = c_void_p 12898isl.isl_schedule_read_from_str.argtypes = [Context, c_char_p] 12899isl.isl_schedule_get_domain.restype = c_void_p 12900isl.isl_schedule_get_domain.argtypes = [c_void_p] 12901isl.isl_schedule_from_domain.restype = c_void_p 12902isl.isl_schedule_from_domain.argtypes = [c_void_p] 12903isl.isl_schedule_get_map.restype = c_void_p 12904isl.isl_schedule_get_map.argtypes = [c_void_p] 12905isl.isl_schedule_pullback_union_pw_multi_aff.restype = c_void_p 12906isl.isl_schedule_pullback_union_pw_multi_aff.argtypes = [c_void_p, c_void_p] 12907isl.isl_schedule_get_root.restype = c_void_p 12908isl.isl_schedule_get_root.argtypes = [c_void_p] 12909isl.isl_schedule_copy.restype = c_void_p 12910isl.isl_schedule_copy.argtypes = [c_void_p] 12911isl.isl_schedule_free.restype = c_void_p 12912isl.isl_schedule_free.argtypes = [c_void_p] 12913isl.isl_schedule_to_str.restype = POINTER(c_char) 12914isl.isl_schedule_to_str.argtypes = [c_void_p] 12915 12916class schedule_constraints(object): 12917 def __init__(self, *args, **keywords): 12918 if "ptr" in keywords: 12919 self.ctx = keywords["ctx"] 12920 self.ptr = keywords["ptr"] 12921 return 12922 if len(args) == 1 and type(args[0]) == str: 12923 self.ctx = Context.getDefaultInstance() 12924 self.ptr = isl.isl_schedule_constraints_read_from_str(self.ctx, args[0].encode('ascii')) 12925 return 12926 raise Error 12927 def __del__(self): 12928 if hasattr(self, 'ptr'): 12929 isl.isl_schedule_constraints_free(self.ptr) 12930 def __str__(arg0): 12931 try: 12932 if not arg0.__class__ is schedule_constraints: 12933 arg0 = schedule_constraints(arg0) 12934 except: 12935 raise 12936 ptr = isl.isl_schedule_constraints_to_str(arg0.ptr) 12937 res = cast(ptr, c_char_p).value.decode('ascii') 12938 libc.free(ptr) 12939 return res 12940 def __repr__(self): 12941 s = str(self) 12942 if '"' in s: 12943 return 'isl.schedule_constraints("""%s""")' % s 12944 else: 12945 return 'isl.schedule_constraints("%s")' % s 12946 def coincidence(arg0): 12947 try: 12948 if not arg0.__class__ is schedule_constraints: 12949 arg0 = schedule_constraints(arg0) 12950 except: 12951 raise 12952 ctx = arg0.ctx 12953 res = isl.isl_schedule_constraints_get_coincidence(arg0.ptr) 12954 obj = union_map(ctx=ctx, ptr=res) 12955 return obj 12956 def get_coincidence(arg0): 12957 return arg0.coincidence() 12958 def compute_schedule(arg0): 12959 try: 12960 if not arg0.__class__ is schedule_constraints: 12961 arg0 = schedule_constraints(arg0) 12962 except: 12963 raise 12964 ctx = arg0.ctx 12965 res = isl.isl_schedule_constraints_compute_schedule(isl.isl_schedule_constraints_copy(arg0.ptr)) 12966 obj = schedule(ctx=ctx, ptr=res) 12967 return obj 12968 def conditional_validity(arg0): 12969 try: 12970 if not arg0.__class__ is schedule_constraints: 12971 arg0 = schedule_constraints(arg0) 12972 except: 12973 raise 12974 ctx = arg0.ctx 12975 res = isl.isl_schedule_constraints_get_conditional_validity(arg0.ptr) 12976 obj = union_map(ctx=ctx, ptr=res) 12977 return obj 12978 def get_conditional_validity(arg0): 12979 return arg0.conditional_validity() 12980 def conditional_validity_condition(arg0): 12981 try: 12982 if not arg0.__class__ is schedule_constraints: 12983 arg0 = schedule_constraints(arg0) 12984 except: 12985 raise 12986 ctx = arg0.ctx 12987 res = isl.isl_schedule_constraints_get_conditional_validity_condition(arg0.ptr) 12988 obj = union_map(ctx=ctx, ptr=res) 12989 return obj 12990 def get_conditional_validity_condition(arg0): 12991 return arg0.conditional_validity_condition() 12992 def context(arg0): 12993 try: 12994 if not arg0.__class__ is schedule_constraints: 12995 arg0 = schedule_constraints(arg0) 12996 except: 12997 raise 12998 ctx = arg0.ctx 12999 res = isl.isl_schedule_constraints_get_context(arg0.ptr) 13000 obj = set(ctx=ctx, ptr=res) 13001 return obj 13002 def get_context(arg0): 13003 return arg0.context() 13004 def domain(arg0): 13005 try: 13006 if not arg0.__class__ is schedule_constraints: 13007 arg0 = schedule_constraints(arg0) 13008 except: 13009 raise 13010 ctx = arg0.ctx 13011 res = isl.isl_schedule_constraints_get_domain(arg0.ptr) 13012 obj = union_set(ctx=ctx, ptr=res) 13013 return obj 13014 def get_domain(arg0): 13015 return arg0.domain() 13016 @staticmethod 13017 def on_domain(arg0): 13018 try: 13019 if not arg0.__class__ is union_set: 13020 arg0 = union_set(arg0) 13021 except: 13022 raise 13023 ctx = arg0.ctx 13024 res = isl.isl_schedule_constraints_on_domain(isl.isl_union_set_copy(arg0.ptr)) 13025 obj = schedule_constraints(ctx=ctx, ptr=res) 13026 return obj 13027 def proximity(arg0): 13028 try: 13029 if not arg0.__class__ is schedule_constraints: 13030 arg0 = schedule_constraints(arg0) 13031 except: 13032 raise 13033 ctx = arg0.ctx 13034 res = isl.isl_schedule_constraints_get_proximity(arg0.ptr) 13035 obj = union_map(ctx=ctx, ptr=res) 13036 return obj 13037 def get_proximity(arg0): 13038 return arg0.proximity() 13039 def set_coincidence(arg0, arg1): 13040 try: 13041 if not arg0.__class__ is schedule_constraints: 13042 arg0 = schedule_constraints(arg0) 13043 except: 13044 raise 13045 try: 13046 if not arg1.__class__ is union_map: 13047 arg1 = union_map(arg1) 13048 except: 13049 raise 13050 ctx = arg0.ctx 13051 res = isl.isl_schedule_constraints_set_coincidence(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13052 obj = schedule_constraints(ctx=ctx, ptr=res) 13053 return obj 13054 def set_conditional_validity(arg0, arg1, arg2): 13055 try: 13056 if not arg0.__class__ is schedule_constraints: 13057 arg0 = schedule_constraints(arg0) 13058 except: 13059 raise 13060 try: 13061 if not arg1.__class__ is union_map: 13062 arg1 = union_map(arg1) 13063 except: 13064 raise 13065 try: 13066 if not arg2.__class__ is union_map: 13067 arg2 = union_map(arg2) 13068 except: 13069 raise 13070 ctx = arg0.ctx 13071 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)) 13072 obj = schedule_constraints(ctx=ctx, ptr=res) 13073 return obj 13074 def set_context(arg0, arg1): 13075 try: 13076 if not arg0.__class__ is schedule_constraints: 13077 arg0 = schedule_constraints(arg0) 13078 except: 13079 raise 13080 try: 13081 if not arg1.__class__ is set: 13082 arg1 = set(arg1) 13083 except: 13084 raise 13085 ctx = arg0.ctx 13086 res = isl.isl_schedule_constraints_set_context(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 13087 obj = schedule_constraints(ctx=ctx, ptr=res) 13088 return obj 13089 def set_proximity(arg0, arg1): 13090 try: 13091 if not arg0.__class__ is schedule_constraints: 13092 arg0 = schedule_constraints(arg0) 13093 except: 13094 raise 13095 try: 13096 if not arg1.__class__ is union_map: 13097 arg1 = union_map(arg1) 13098 except: 13099 raise 13100 ctx = arg0.ctx 13101 res = isl.isl_schedule_constraints_set_proximity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13102 obj = schedule_constraints(ctx=ctx, ptr=res) 13103 return obj 13104 def set_validity(arg0, arg1): 13105 try: 13106 if not arg0.__class__ is schedule_constraints: 13107 arg0 = schedule_constraints(arg0) 13108 except: 13109 raise 13110 try: 13111 if not arg1.__class__ is union_map: 13112 arg1 = union_map(arg1) 13113 except: 13114 raise 13115 ctx = arg0.ctx 13116 res = isl.isl_schedule_constraints_set_validity(isl.isl_schedule_constraints_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 13117 obj = schedule_constraints(ctx=ctx, ptr=res) 13118 return obj 13119 def validity(arg0): 13120 try: 13121 if not arg0.__class__ is schedule_constraints: 13122 arg0 = schedule_constraints(arg0) 13123 except: 13124 raise 13125 ctx = arg0.ctx 13126 res = isl.isl_schedule_constraints_get_validity(arg0.ptr) 13127 obj = union_map(ctx=ctx, ptr=res) 13128 return obj 13129 def get_validity(arg0): 13130 return arg0.validity() 13131 13132isl.isl_schedule_constraints_read_from_str.restype = c_void_p 13133isl.isl_schedule_constraints_read_from_str.argtypes = [Context, c_char_p] 13134isl.isl_schedule_constraints_get_coincidence.restype = c_void_p 13135isl.isl_schedule_constraints_get_coincidence.argtypes = [c_void_p] 13136isl.isl_schedule_constraints_compute_schedule.restype = c_void_p 13137isl.isl_schedule_constraints_compute_schedule.argtypes = [c_void_p] 13138isl.isl_schedule_constraints_get_conditional_validity.restype = c_void_p 13139isl.isl_schedule_constraints_get_conditional_validity.argtypes = [c_void_p] 13140isl.isl_schedule_constraints_get_conditional_validity_condition.restype = c_void_p 13141isl.isl_schedule_constraints_get_conditional_validity_condition.argtypes = [c_void_p] 13142isl.isl_schedule_constraints_get_context.restype = c_void_p 13143isl.isl_schedule_constraints_get_context.argtypes = [c_void_p] 13144isl.isl_schedule_constraints_get_domain.restype = c_void_p 13145isl.isl_schedule_constraints_get_domain.argtypes = [c_void_p] 13146isl.isl_schedule_constraints_on_domain.restype = c_void_p 13147isl.isl_schedule_constraints_on_domain.argtypes = [c_void_p] 13148isl.isl_schedule_constraints_get_proximity.restype = c_void_p 13149isl.isl_schedule_constraints_get_proximity.argtypes = [c_void_p] 13150isl.isl_schedule_constraints_set_coincidence.restype = c_void_p 13151isl.isl_schedule_constraints_set_coincidence.argtypes = [c_void_p, c_void_p] 13152isl.isl_schedule_constraints_set_conditional_validity.restype = c_void_p 13153isl.isl_schedule_constraints_set_conditional_validity.argtypes = [c_void_p, c_void_p, c_void_p] 13154isl.isl_schedule_constraints_set_context.restype = c_void_p 13155isl.isl_schedule_constraints_set_context.argtypes = [c_void_p, c_void_p] 13156isl.isl_schedule_constraints_set_proximity.restype = c_void_p 13157isl.isl_schedule_constraints_set_proximity.argtypes = [c_void_p, c_void_p] 13158isl.isl_schedule_constraints_set_validity.restype = c_void_p 13159isl.isl_schedule_constraints_set_validity.argtypes = [c_void_p, c_void_p] 13160isl.isl_schedule_constraints_get_validity.restype = c_void_p 13161isl.isl_schedule_constraints_get_validity.argtypes = [c_void_p] 13162isl.isl_schedule_constraints_copy.restype = c_void_p 13163isl.isl_schedule_constraints_copy.argtypes = [c_void_p] 13164isl.isl_schedule_constraints_free.restype = c_void_p 13165isl.isl_schedule_constraints_free.argtypes = [c_void_p] 13166isl.isl_schedule_constraints_to_str.restype = POINTER(c_char) 13167isl.isl_schedule_constraints_to_str.argtypes = [c_void_p] 13168 13169class schedule_node(object): 13170 def __init__(self, *args, **keywords): 13171 if "ptr" in keywords: 13172 self.ctx = keywords["ctx"] 13173 self.ptr = keywords["ptr"] 13174 return 13175 if len(args) == 1 and isinstance(args[0], schedule_node_band): 13176 self.ctx = args[0].ctx 13177 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13178 return 13179 if len(args) == 1 and isinstance(args[0], schedule_node_context): 13180 self.ctx = args[0].ctx 13181 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13182 return 13183 if len(args) == 1 and isinstance(args[0], schedule_node_domain): 13184 self.ctx = args[0].ctx 13185 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13186 return 13187 if len(args) == 1 and isinstance(args[0], schedule_node_expansion): 13188 self.ctx = args[0].ctx 13189 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13190 return 13191 if len(args) == 1 and isinstance(args[0], schedule_node_extension): 13192 self.ctx = args[0].ctx 13193 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13194 return 13195 if len(args) == 1 and isinstance(args[0], schedule_node_filter): 13196 self.ctx = args[0].ctx 13197 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13198 return 13199 if len(args) == 1 and isinstance(args[0], schedule_node_leaf): 13200 self.ctx = args[0].ctx 13201 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13202 return 13203 if len(args) == 1 and isinstance(args[0], schedule_node_guard): 13204 self.ctx = args[0].ctx 13205 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13206 return 13207 if len(args) == 1 and isinstance(args[0], schedule_node_mark): 13208 self.ctx = args[0].ctx 13209 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13210 return 13211 if len(args) == 1 and isinstance(args[0], schedule_node_sequence): 13212 self.ctx = args[0].ctx 13213 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13214 return 13215 if len(args) == 1 and isinstance(args[0], schedule_node_set): 13216 self.ctx = args[0].ctx 13217 self.ptr = isl.isl_schedule_node_copy(args[0].ptr) 13218 return 13219 raise Error 13220 def __del__(self): 13221 if hasattr(self, 'ptr'): 13222 isl.isl_schedule_node_free(self.ptr) 13223 def __new__(cls, *args, **keywords): 13224 if "ptr" in keywords: 13225 type = isl.isl_schedule_node_get_type(keywords["ptr"]) 13226 if type == 0: 13227 return schedule_node_band(**keywords) 13228 if type == 1: 13229 return schedule_node_context(**keywords) 13230 if type == 2: 13231 return schedule_node_domain(**keywords) 13232 if type == 3: 13233 return schedule_node_expansion(**keywords) 13234 if type == 4: 13235 return schedule_node_extension(**keywords) 13236 if type == 5: 13237 return schedule_node_filter(**keywords) 13238 if type == 6: 13239 return schedule_node_leaf(**keywords) 13240 if type == 7: 13241 return schedule_node_guard(**keywords) 13242 if type == 8: 13243 return schedule_node_mark(**keywords) 13244 if type == 9: 13245 return schedule_node_sequence(**keywords) 13246 if type == 10: 13247 return schedule_node_set(**keywords) 13248 raise 13249 return super(schedule_node, cls).__new__(cls) 13250 def __str__(arg0): 13251 try: 13252 if not arg0.__class__ is schedule_node: 13253 arg0 = schedule_node(arg0) 13254 except: 13255 raise 13256 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13257 res = cast(ptr, c_char_p).value.decode('ascii') 13258 libc.free(ptr) 13259 return res 13260 def __repr__(self): 13261 s = str(self) 13262 if '"' in s: 13263 return 'isl.schedule_node("""%s""")' % s 13264 else: 13265 return 'isl.schedule_node("%s")' % s 13266 def ancestor(arg0, arg1): 13267 try: 13268 if not arg0.__class__ is schedule_node: 13269 arg0 = schedule_node(arg0) 13270 except: 13271 raise 13272 ctx = arg0.ctx 13273 res = isl.isl_schedule_node_ancestor(isl.isl_schedule_node_copy(arg0.ptr), arg1) 13274 obj = schedule_node(ctx=ctx, ptr=res) 13275 return obj 13276 def ancestor_child_position(arg0, arg1): 13277 try: 13278 if not arg0.__class__ is schedule_node: 13279 arg0 = schedule_node(arg0) 13280 except: 13281 raise 13282 try: 13283 if not arg1.__class__ is schedule_node: 13284 arg1 = schedule_node(arg1) 13285 except: 13286 raise 13287 ctx = arg0.ctx 13288 res = isl.isl_schedule_node_get_ancestor_child_position(arg0.ptr, arg1.ptr) 13289 if res < 0: 13290 raise 13291 return int(res) 13292 def get_ancestor_child_position(arg0, arg1): 13293 return arg0.ancestor_child_position(arg1) 13294 def child(arg0, arg1): 13295 try: 13296 if not arg0.__class__ is schedule_node: 13297 arg0 = schedule_node(arg0) 13298 except: 13299 raise 13300 ctx = arg0.ctx 13301 res = isl.isl_schedule_node_child(isl.isl_schedule_node_copy(arg0.ptr), arg1) 13302 obj = schedule_node(ctx=ctx, ptr=res) 13303 return obj 13304 def child_position(arg0): 13305 try: 13306 if not arg0.__class__ is schedule_node: 13307 arg0 = schedule_node(arg0) 13308 except: 13309 raise 13310 ctx = arg0.ctx 13311 res = isl.isl_schedule_node_get_child_position(arg0.ptr) 13312 if res < 0: 13313 raise 13314 return int(res) 13315 def get_child_position(arg0): 13316 return arg0.child_position() 13317 def every_descendant(arg0, arg1): 13318 try: 13319 if not arg0.__class__ is schedule_node: 13320 arg0 = schedule_node(arg0) 13321 except: 13322 raise 13323 exc_info = [None] 13324 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13325 def cb_func(cb_arg0, cb_arg1): 13326 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 13327 try: 13328 res = arg1(cb_arg0) 13329 except BaseException as e: 13330 exc_info[0] = e 13331 return -1 13332 return 1 if res else 0 13333 cb = fn(cb_func) 13334 ctx = arg0.ctx 13335 res = isl.isl_schedule_node_every_descendant(arg0.ptr, cb, None) 13336 if exc_info[0] is not None: 13337 raise exc_info[0] 13338 if res < 0: 13339 raise 13340 return bool(res) 13341 def first_child(arg0): 13342 try: 13343 if not arg0.__class__ is schedule_node: 13344 arg0 = schedule_node(arg0) 13345 except: 13346 raise 13347 ctx = arg0.ctx 13348 res = isl.isl_schedule_node_first_child(isl.isl_schedule_node_copy(arg0.ptr)) 13349 obj = schedule_node(ctx=ctx, ptr=res) 13350 return obj 13351 def foreach_ancestor_top_down(arg0, arg1): 13352 try: 13353 if not arg0.__class__ is schedule_node: 13354 arg0 = schedule_node(arg0) 13355 except: 13356 raise 13357 exc_info = [None] 13358 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13359 def cb_func(cb_arg0, cb_arg1): 13360 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 13361 try: 13362 arg1(cb_arg0) 13363 except BaseException as e: 13364 exc_info[0] = e 13365 return -1 13366 return 0 13367 cb = fn(cb_func) 13368 ctx = arg0.ctx 13369 res = isl.isl_schedule_node_foreach_ancestor_top_down(arg0.ptr, cb, None) 13370 if exc_info[0] is not None: 13371 raise exc_info[0] 13372 if res < 0: 13373 raise 13374 def foreach_descendant_top_down(arg0, arg1): 13375 try: 13376 if not arg0.__class__ is schedule_node: 13377 arg0 = schedule_node(arg0) 13378 except: 13379 raise 13380 exc_info = [None] 13381 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 13382 def cb_func(cb_arg0, cb_arg1): 13383 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=isl.isl_schedule_node_copy(cb_arg0)) 13384 try: 13385 res = arg1(cb_arg0) 13386 except BaseException as e: 13387 exc_info[0] = e 13388 return -1 13389 return 1 if res else 0 13390 cb = fn(cb_func) 13391 ctx = arg0.ctx 13392 res = isl.isl_schedule_node_foreach_descendant_top_down(arg0.ptr, cb, None) 13393 if exc_info[0] is not None: 13394 raise exc_info[0] 13395 if res < 0: 13396 raise 13397 @staticmethod 13398 def from_domain(arg0): 13399 try: 13400 if not arg0.__class__ is union_set: 13401 arg0 = union_set(arg0) 13402 except: 13403 raise 13404 ctx = arg0.ctx 13405 res = isl.isl_schedule_node_from_domain(isl.isl_union_set_copy(arg0.ptr)) 13406 obj = schedule_node(ctx=ctx, ptr=res) 13407 return obj 13408 @staticmethod 13409 def from_extension(arg0): 13410 try: 13411 if not arg0.__class__ is union_map: 13412 arg0 = union_map(arg0) 13413 except: 13414 raise 13415 ctx = arg0.ctx 13416 res = isl.isl_schedule_node_from_extension(isl.isl_union_map_copy(arg0.ptr)) 13417 obj = schedule_node(ctx=ctx, ptr=res) 13418 return obj 13419 def graft_after(arg0, arg1): 13420 try: 13421 if not arg0.__class__ is schedule_node: 13422 arg0 = schedule_node(arg0) 13423 except: 13424 raise 13425 try: 13426 if not arg1.__class__ is schedule_node: 13427 arg1 = schedule_node(arg1) 13428 except: 13429 raise 13430 ctx = arg0.ctx 13431 res = isl.isl_schedule_node_graft_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 13432 obj = schedule_node(ctx=ctx, ptr=res) 13433 return obj 13434 def graft_before(arg0, arg1): 13435 try: 13436 if not arg0.__class__ is schedule_node: 13437 arg0 = schedule_node(arg0) 13438 except: 13439 raise 13440 try: 13441 if not arg1.__class__ is schedule_node: 13442 arg1 = schedule_node(arg1) 13443 except: 13444 raise 13445 ctx = arg0.ctx 13446 res = isl.isl_schedule_node_graft_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_schedule_node_copy(arg1.ptr)) 13447 obj = schedule_node(ctx=ctx, ptr=res) 13448 return obj 13449 def has_children(arg0): 13450 try: 13451 if not arg0.__class__ is schedule_node: 13452 arg0 = schedule_node(arg0) 13453 except: 13454 raise 13455 ctx = arg0.ctx 13456 res = isl.isl_schedule_node_has_children(arg0.ptr) 13457 if res < 0: 13458 raise 13459 return bool(res) 13460 def has_next_sibling(arg0): 13461 try: 13462 if not arg0.__class__ is schedule_node: 13463 arg0 = schedule_node(arg0) 13464 except: 13465 raise 13466 ctx = arg0.ctx 13467 res = isl.isl_schedule_node_has_next_sibling(arg0.ptr) 13468 if res < 0: 13469 raise 13470 return bool(res) 13471 def has_parent(arg0): 13472 try: 13473 if not arg0.__class__ is schedule_node: 13474 arg0 = schedule_node(arg0) 13475 except: 13476 raise 13477 ctx = arg0.ctx 13478 res = isl.isl_schedule_node_has_parent(arg0.ptr) 13479 if res < 0: 13480 raise 13481 return bool(res) 13482 def has_previous_sibling(arg0): 13483 try: 13484 if not arg0.__class__ is schedule_node: 13485 arg0 = schedule_node(arg0) 13486 except: 13487 raise 13488 ctx = arg0.ctx 13489 res = isl.isl_schedule_node_has_previous_sibling(arg0.ptr) 13490 if res < 0: 13491 raise 13492 return bool(res) 13493 def insert_context(arg0, arg1): 13494 try: 13495 if not arg0.__class__ is schedule_node: 13496 arg0 = schedule_node(arg0) 13497 except: 13498 raise 13499 try: 13500 if not arg1.__class__ is set: 13501 arg1 = set(arg1) 13502 except: 13503 raise 13504 ctx = arg0.ctx 13505 res = isl.isl_schedule_node_insert_context(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 13506 obj = schedule_node(ctx=ctx, ptr=res) 13507 return obj 13508 def insert_filter(arg0, arg1): 13509 try: 13510 if not arg0.__class__ is schedule_node: 13511 arg0 = schedule_node(arg0) 13512 except: 13513 raise 13514 try: 13515 if not arg1.__class__ is union_set: 13516 arg1 = union_set(arg1) 13517 except: 13518 raise 13519 ctx = arg0.ctx 13520 res = isl.isl_schedule_node_insert_filter(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 13521 obj = schedule_node(ctx=ctx, ptr=res) 13522 return obj 13523 def insert_guard(arg0, arg1): 13524 try: 13525 if not arg0.__class__ is schedule_node: 13526 arg0 = schedule_node(arg0) 13527 except: 13528 raise 13529 try: 13530 if not arg1.__class__ is set: 13531 arg1 = set(arg1) 13532 except: 13533 raise 13534 ctx = arg0.ctx 13535 res = isl.isl_schedule_node_insert_guard(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 13536 obj = schedule_node(ctx=ctx, ptr=res) 13537 return obj 13538 def insert_mark(arg0, arg1): 13539 try: 13540 if not arg0.__class__ is schedule_node: 13541 arg0 = schedule_node(arg0) 13542 except: 13543 raise 13544 try: 13545 if not arg1.__class__ is id: 13546 arg1 = id(arg1) 13547 except: 13548 raise 13549 ctx = arg0.ctx 13550 res = isl.isl_schedule_node_insert_mark(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_id_copy(arg1.ptr)) 13551 obj = schedule_node(ctx=ctx, ptr=res) 13552 return obj 13553 def insert_partial_schedule(arg0, arg1): 13554 try: 13555 if not arg0.__class__ is schedule_node: 13556 arg0 = schedule_node(arg0) 13557 except: 13558 raise 13559 try: 13560 if not arg1.__class__ is multi_union_pw_aff: 13561 arg1 = multi_union_pw_aff(arg1) 13562 except: 13563 raise 13564 ctx = arg0.ctx 13565 res = isl.isl_schedule_node_insert_partial_schedule(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 13566 obj = schedule_node(ctx=ctx, ptr=res) 13567 return obj 13568 def insert_sequence(arg0, arg1): 13569 try: 13570 if not arg0.__class__ is schedule_node: 13571 arg0 = schedule_node(arg0) 13572 except: 13573 raise 13574 try: 13575 if not arg1.__class__ is union_set_list: 13576 arg1 = union_set_list(arg1) 13577 except: 13578 raise 13579 ctx = arg0.ctx 13580 res = isl.isl_schedule_node_insert_sequence(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 13581 obj = schedule_node(ctx=ctx, ptr=res) 13582 return obj 13583 def insert_set(arg0, arg1): 13584 try: 13585 if not arg0.__class__ is schedule_node: 13586 arg0 = schedule_node(arg0) 13587 except: 13588 raise 13589 try: 13590 if not arg1.__class__ is union_set_list: 13591 arg1 = union_set_list(arg1) 13592 except: 13593 raise 13594 ctx = arg0.ctx 13595 res = isl.isl_schedule_node_insert_set(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 13596 obj = schedule_node(ctx=ctx, ptr=res) 13597 return obj 13598 def is_equal(arg0, arg1): 13599 try: 13600 if not arg0.__class__ is schedule_node: 13601 arg0 = schedule_node(arg0) 13602 except: 13603 raise 13604 try: 13605 if not arg1.__class__ is schedule_node: 13606 arg1 = schedule_node(arg1) 13607 except: 13608 raise 13609 ctx = arg0.ctx 13610 res = isl.isl_schedule_node_is_equal(arg0.ptr, arg1.ptr) 13611 if res < 0: 13612 raise 13613 return bool(res) 13614 def is_subtree_anchored(arg0): 13615 try: 13616 if not arg0.__class__ is schedule_node: 13617 arg0 = schedule_node(arg0) 13618 except: 13619 raise 13620 ctx = arg0.ctx 13621 res = isl.isl_schedule_node_is_subtree_anchored(arg0.ptr) 13622 if res < 0: 13623 raise 13624 return bool(res) 13625 def map_descendant_bottom_up(arg0, arg1): 13626 try: 13627 if not arg0.__class__ is schedule_node: 13628 arg0 = schedule_node(arg0) 13629 except: 13630 raise 13631 exc_info = [None] 13632 fn = CFUNCTYPE(c_void_p, c_void_p, c_void_p) 13633 def cb_func(cb_arg0, cb_arg1): 13634 cb_arg0 = schedule_node(ctx=arg0.ctx, ptr=(cb_arg0)) 13635 try: 13636 res = arg1(cb_arg0) 13637 except BaseException as e: 13638 exc_info[0] = e 13639 return None 13640 return isl.isl_schedule_node_copy(res.ptr) 13641 cb = fn(cb_func) 13642 ctx = arg0.ctx 13643 res = isl.isl_schedule_node_map_descendant_bottom_up(isl.isl_schedule_node_copy(arg0.ptr), cb, None) 13644 if exc_info[0] is not None: 13645 raise exc_info[0] 13646 obj = schedule_node(ctx=ctx, ptr=res) 13647 return obj 13648 def n_children(arg0): 13649 try: 13650 if not arg0.__class__ is schedule_node: 13651 arg0 = schedule_node(arg0) 13652 except: 13653 raise 13654 ctx = arg0.ctx 13655 res = isl.isl_schedule_node_n_children(arg0.ptr) 13656 if res < 0: 13657 raise 13658 return int(res) 13659 def next_sibling(arg0): 13660 try: 13661 if not arg0.__class__ is schedule_node: 13662 arg0 = schedule_node(arg0) 13663 except: 13664 raise 13665 ctx = arg0.ctx 13666 res = isl.isl_schedule_node_next_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 13667 obj = schedule_node(ctx=ctx, ptr=res) 13668 return obj 13669 def order_after(arg0, arg1): 13670 try: 13671 if not arg0.__class__ is schedule_node: 13672 arg0 = schedule_node(arg0) 13673 except: 13674 raise 13675 try: 13676 if not arg1.__class__ is union_set: 13677 arg1 = union_set(arg1) 13678 except: 13679 raise 13680 ctx = arg0.ctx 13681 res = isl.isl_schedule_node_order_after(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 13682 obj = schedule_node(ctx=ctx, ptr=res) 13683 return obj 13684 def order_before(arg0, arg1): 13685 try: 13686 if not arg0.__class__ is schedule_node: 13687 arg0 = schedule_node(arg0) 13688 except: 13689 raise 13690 try: 13691 if not arg1.__class__ is union_set: 13692 arg1 = union_set(arg1) 13693 except: 13694 raise 13695 ctx = arg0.ctx 13696 res = isl.isl_schedule_node_order_before(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 13697 obj = schedule_node(ctx=ctx, ptr=res) 13698 return obj 13699 def parent(arg0): 13700 try: 13701 if not arg0.__class__ is schedule_node: 13702 arg0 = schedule_node(arg0) 13703 except: 13704 raise 13705 ctx = arg0.ctx 13706 res = isl.isl_schedule_node_parent(isl.isl_schedule_node_copy(arg0.ptr)) 13707 obj = schedule_node(ctx=ctx, ptr=res) 13708 return obj 13709 def prefix_schedule_multi_union_pw_aff(arg0): 13710 try: 13711 if not arg0.__class__ is schedule_node: 13712 arg0 = schedule_node(arg0) 13713 except: 13714 raise 13715 ctx = arg0.ctx 13716 res = isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(arg0.ptr) 13717 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 13718 return obj 13719 def get_prefix_schedule_multi_union_pw_aff(arg0): 13720 return arg0.prefix_schedule_multi_union_pw_aff() 13721 def prefix_schedule_union_map(arg0): 13722 try: 13723 if not arg0.__class__ is schedule_node: 13724 arg0 = schedule_node(arg0) 13725 except: 13726 raise 13727 ctx = arg0.ctx 13728 res = isl.isl_schedule_node_get_prefix_schedule_union_map(arg0.ptr) 13729 obj = union_map(ctx=ctx, ptr=res) 13730 return obj 13731 def get_prefix_schedule_union_map(arg0): 13732 return arg0.prefix_schedule_union_map() 13733 def prefix_schedule_union_pw_multi_aff(arg0): 13734 try: 13735 if not arg0.__class__ is schedule_node: 13736 arg0 = schedule_node(arg0) 13737 except: 13738 raise 13739 ctx = arg0.ctx 13740 res = isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(arg0.ptr) 13741 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 13742 return obj 13743 def get_prefix_schedule_union_pw_multi_aff(arg0): 13744 return arg0.prefix_schedule_union_pw_multi_aff() 13745 def previous_sibling(arg0): 13746 try: 13747 if not arg0.__class__ is schedule_node: 13748 arg0 = schedule_node(arg0) 13749 except: 13750 raise 13751 ctx = arg0.ctx 13752 res = isl.isl_schedule_node_previous_sibling(isl.isl_schedule_node_copy(arg0.ptr)) 13753 obj = schedule_node(ctx=ctx, ptr=res) 13754 return obj 13755 def root(arg0): 13756 try: 13757 if not arg0.__class__ is schedule_node: 13758 arg0 = schedule_node(arg0) 13759 except: 13760 raise 13761 ctx = arg0.ctx 13762 res = isl.isl_schedule_node_root(isl.isl_schedule_node_copy(arg0.ptr)) 13763 obj = schedule_node(ctx=ctx, ptr=res) 13764 return obj 13765 def schedule(arg0): 13766 try: 13767 if not arg0.__class__ is schedule_node: 13768 arg0 = schedule_node(arg0) 13769 except: 13770 raise 13771 ctx = arg0.ctx 13772 res = isl.isl_schedule_node_get_schedule(arg0.ptr) 13773 obj = schedule(ctx=ctx, ptr=res) 13774 return obj 13775 def get_schedule(arg0): 13776 return arg0.schedule() 13777 def shared_ancestor(arg0, arg1): 13778 try: 13779 if not arg0.__class__ is schedule_node: 13780 arg0 = schedule_node(arg0) 13781 except: 13782 raise 13783 try: 13784 if not arg1.__class__ is schedule_node: 13785 arg1 = schedule_node(arg1) 13786 except: 13787 raise 13788 ctx = arg0.ctx 13789 res = isl.isl_schedule_node_get_shared_ancestor(arg0.ptr, arg1.ptr) 13790 obj = schedule_node(ctx=ctx, ptr=res) 13791 return obj 13792 def get_shared_ancestor(arg0, arg1): 13793 return arg0.shared_ancestor(arg1) 13794 def tree_depth(arg0): 13795 try: 13796 if not arg0.__class__ is schedule_node: 13797 arg0 = schedule_node(arg0) 13798 except: 13799 raise 13800 ctx = arg0.ctx 13801 res = isl.isl_schedule_node_get_tree_depth(arg0.ptr) 13802 if res < 0: 13803 raise 13804 return int(res) 13805 def get_tree_depth(arg0): 13806 return arg0.tree_depth() 13807 13808isl.isl_schedule_node_ancestor.restype = c_void_p 13809isl.isl_schedule_node_ancestor.argtypes = [c_void_p, c_int] 13810isl.isl_schedule_node_get_ancestor_child_position.argtypes = [c_void_p, c_void_p] 13811isl.isl_schedule_node_child.restype = c_void_p 13812isl.isl_schedule_node_child.argtypes = [c_void_p, c_int] 13813isl.isl_schedule_node_get_child_position.argtypes = [c_void_p] 13814isl.isl_schedule_node_every_descendant.argtypes = [c_void_p, c_void_p, c_void_p] 13815isl.isl_schedule_node_first_child.restype = c_void_p 13816isl.isl_schedule_node_first_child.argtypes = [c_void_p] 13817isl.isl_schedule_node_foreach_ancestor_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 13818isl.isl_schedule_node_foreach_descendant_top_down.argtypes = [c_void_p, c_void_p, c_void_p] 13819isl.isl_schedule_node_from_domain.restype = c_void_p 13820isl.isl_schedule_node_from_domain.argtypes = [c_void_p] 13821isl.isl_schedule_node_from_extension.restype = c_void_p 13822isl.isl_schedule_node_from_extension.argtypes = [c_void_p] 13823isl.isl_schedule_node_graft_after.restype = c_void_p 13824isl.isl_schedule_node_graft_after.argtypes = [c_void_p, c_void_p] 13825isl.isl_schedule_node_graft_before.restype = c_void_p 13826isl.isl_schedule_node_graft_before.argtypes = [c_void_p, c_void_p] 13827isl.isl_schedule_node_has_children.argtypes = [c_void_p] 13828isl.isl_schedule_node_has_next_sibling.argtypes = [c_void_p] 13829isl.isl_schedule_node_has_parent.argtypes = [c_void_p] 13830isl.isl_schedule_node_has_previous_sibling.argtypes = [c_void_p] 13831isl.isl_schedule_node_insert_context.restype = c_void_p 13832isl.isl_schedule_node_insert_context.argtypes = [c_void_p, c_void_p] 13833isl.isl_schedule_node_insert_filter.restype = c_void_p 13834isl.isl_schedule_node_insert_filter.argtypes = [c_void_p, c_void_p] 13835isl.isl_schedule_node_insert_guard.restype = c_void_p 13836isl.isl_schedule_node_insert_guard.argtypes = [c_void_p, c_void_p] 13837isl.isl_schedule_node_insert_mark.restype = c_void_p 13838isl.isl_schedule_node_insert_mark.argtypes = [c_void_p, c_void_p] 13839isl.isl_schedule_node_insert_partial_schedule.restype = c_void_p 13840isl.isl_schedule_node_insert_partial_schedule.argtypes = [c_void_p, c_void_p] 13841isl.isl_schedule_node_insert_sequence.restype = c_void_p 13842isl.isl_schedule_node_insert_sequence.argtypes = [c_void_p, c_void_p] 13843isl.isl_schedule_node_insert_set.restype = c_void_p 13844isl.isl_schedule_node_insert_set.argtypes = [c_void_p, c_void_p] 13845isl.isl_schedule_node_is_equal.argtypes = [c_void_p, c_void_p] 13846isl.isl_schedule_node_is_subtree_anchored.argtypes = [c_void_p] 13847isl.isl_schedule_node_map_descendant_bottom_up.restype = c_void_p 13848isl.isl_schedule_node_map_descendant_bottom_up.argtypes = [c_void_p, c_void_p, c_void_p] 13849isl.isl_schedule_node_n_children.argtypes = [c_void_p] 13850isl.isl_schedule_node_next_sibling.restype = c_void_p 13851isl.isl_schedule_node_next_sibling.argtypes = [c_void_p] 13852isl.isl_schedule_node_order_after.restype = c_void_p 13853isl.isl_schedule_node_order_after.argtypes = [c_void_p, c_void_p] 13854isl.isl_schedule_node_order_before.restype = c_void_p 13855isl.isl_schedule_node_order_before.argtypes = [c_void_p, c_void_p] 13856isl.isl_schedule_node_parent.restype = c_void_p 13857isl.isl_schedule_node_parent.argtypes = [c_void_p] 13858isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.restype = c_void_p 13859isl.isl_schedule_node_get_prefix_schedule_multi_union_pw_aff.argtypes = [c_void_p] 13860isl.isl_schedule_node_get_prefix_schedule_union_map.restype = c_void_p 13861isl.isl_schedule_node_get_prefix_schedule_union_map.argtypes = [c_void_p] 13862isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.restype = c_void_p 13863isl.isl_schedule_node_get_prefix_schedule_union_pw_multi_aff.argtypes = [c_void_p] 13864isl.isl_schedule_node_previous_sibling.restype = c_void_p 13865isl.isl_schedule_node_previous_sibling.argtypes = [c_void_p] 13866isl.isl_schedule_node_root.restype = c_void_p 13867isl.isl_schedule_node_root.argtypes = [c_void_p] 13868isl.isl_schedule_node_get_schedule.restype = c_void_p 13869isl.isl_schedule_node_get_schedule.argtypes = [c_void_p] 13870isl.isl_schedule_node_get_shared_ancestor.restype = c_void_p 13871isl.isl_schedule_node_get_shared_ancestor.argtypes = [c_void_p, c_void_p] 13872isl.isl_schedule_node_get_tree_depth.argtypes = [c_void_p] 13873isl.isl_schedule_node_copy.restype = c_void_p 13874isl.isl_schedule_node_copy.argtypes = [c_void_p] 13875isl.isl_schedule_node_free.restype = c_void_p 13876isl.isl_schedule_node_free.argtypes = [c_void_p] 13877isl.isl_schedule_node_to_str.restype = POINTER(c_char) 13878isl.isl_schedule_node_to_str.argtypes = [c_void_p] 13879isl.isl_schedule_node_get_type.argtypes = [c_void_p] 13880 13881class schedule_node_band(schedule_node): 13882 def __init__(self, *args, **keywords): 13883 if "ptr" in keywords: 13884 self.ctx = keywords["ctx"] 13885 self.ptr = keywords["ptr"] 13886 return 13887 raise Error 13888 def __del__(self): 13889 if hasattr(self, 'ptr'): 13890 isl.isl_schedule_node_free(self.ptr) 13891 def __new__(cls, *args, **keywords): 13892 return super(schedule_node_band, cls).__new__(cls) 13893 def __str__(arg0): 13894 try: 13895 if not arg0.__class__ is schedule_node_band: 13896 arg0 = schedule_node_band(arg0) 13897 except: 13898 raise 13899 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 13900 res = cast(ptr, c_char_p).value.decode('ascii') 13901 libc.free(ptr) 13902 return res 13903 def __repr__(self): 13904 s = str(self) 13905 if '"' in s: 13906 return 'isl.schedule_node_band("""%s""")' % s 13907 else: 13908 return 'isl.schedule_node_band("%s")' % s 13909 def ast_build_options(arg0): 13910 try: 13911 if not arg0.__class__ is schedule_node: 13912 arg0 = schedule_node(arg0) 13913 except: 13914 raise 13915 ctx = arg0.ctx 13916 res = isl.isl_schedule_node_band_get_ast_build_options(arg0.ptr) 13917 obj = union_set(ctx=ctx, ptr=res) 13918 return obj 13919 def get_ast_build_options(arg0): 13920 return arg0.ast_build_options() 13921 def ast_isolate_option(arg0): 13922 try: 13923 if not arg0.__class__ is schedule_node: 13924 arg0 = schedule_node(arg0) 13925 except: 13926 raise 13927 ctx = arg0.ctx 13928 res = isl.isl_schedule_node_band_get_ast_isolate_option(arg0.ptr) 13929 obj = set(ctx=ctx, ptr=res) 13930 return obj 13931 def get_ast_isolate_option(arg0): 13932 return arg0.ast_isolate_option() 13933 def member_get_coincident(arg0, arg1): 13934 try: 13935 if not arg0.__class__ is schedule_node: 13936 arg0 = schedule_node(arg0) 13937 except: 13938 raise 13939 ctx = arg0.ctx 13940 res = isl.isl_schedule_node_band_member_get_coincident(arg0.ptr, arg1) 13941 if res < 0: 13942 raise 13943 return bool(res) 13944 def member_set_coincident(arg0, arg1, arg2): 13945 try: 13946 if not arg0.__class__ is schedule_node: 13947 arg0 = schedule_node(arg0) 13948 except: 13949 raise 13950 ctx = arg0.ctx 13951 res = isl.isl_schedule_node_band_member_set_coincident(isl.isl_schedule_node_copy(arg0.ptr), arg1, arg2) 13952 obj = schedule_node(ctx=ctx, ptr=res) 13953 return obj 13954 def mod(arg0, arg1): 13955 try: 13956 if not arg0.__class__ is schedule_node: 13957 arg0 = schedule_node(arg0) 13958 except: 13959 raise 13960 try: 13961 if not arg1.__class__ is multi_val: 13962 arg1 = multi_val(arg1) 13963 except: 13964 raise 13965 ctx = arg0.ctx 13966 res = isl.isl_schedule_node_band_mod(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 13967 obj = schedule_node(ctx=ctx, ptr=res) 13968 return obj 13969 def n_member(arg0): 13970 try: 13971 if not arg0.__class__ is schedule_node: 13972 arg0 = schedule_node(arg0) 13973 except: 13974 raise 13975 ctx = arg0.ctx 13976 res = isl.isl_schedule_node_band_n_member(arg0.ptr) 13977 if res < 0: 13978 raise 13979 return int(res) 13980 def partial_schedule(arg0): 13981 try: 13982 if not arg0.__class__ is schedule_node: 13983 arg0 = schedule_node(arg0) 13984 except: 13985 raise 13986 ctx = arg0.ctx 13987 res = isl.isl_schedule_node_band_get_partial_schedule(arg0.ptr) 13988 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 13989 return obj 13990 def get_partial_schedule(arg0): 13991 return arg0.partial_schedule() 13992 def permutable(arg0): 13993 try: 13994 if not arg0.__class__ is schedule_node: 13995 arg0 = schedule_node(arg0) 13996 except: 13997 raise 13998 ctx = arg0.ctx 13999 res = isl.isl_schedule_node_band_get_permutable(arg0.ptr) 14000 if res < 0: 14001 raise 14002 return bool(res) 14003 def get_permutable(arg0): 14004 return arg0.permutable() 14005 def scale(arg0, arg1): 14006 try: 14007 if not arg0.__class__ is schedule_node: 14008 arg0 = schedule_node(arg0) 14009 except: 14010 raise 14011 try: 14012 if not arg1.__class__ is multi_val: 14013 arg1 = multi_val(arg1) 14014 except: 14015 raise 14016 ctx = arg0.ctx 14017 res = isl.isl_schedule_node_band_scale(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14018 obj = schedule_node(ctx=ctx, ptr=res) 14019 return obj 14020 def scale_down(arg0, arg1): 14021 try: 14022 if not arg0.__class__ is schedule_node: 14023 arg0 = schedule_node(arg0) 14024 except: 14025 raise 14026 try: 14027 if not arg1.__class__ is multi_val: 14028 arg1 = multi_val(arg1) 14029 except: 14030 raise 14031 ctx = arg0.ctx 14032 res = isl.isl_schedule_node_band_scale_down(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14033 obj = schedule_node(ctx=ctx, ptr=res) 14034 return obj 14035 def set_ast_build_options(arg0, arg1): 14036 try: 14037 if not arg0.__class__ is schedule_node: 14038 arg0 = schedule_node(arg0) 14039 except: 14040 raise 14041 try: 14042 if not arg1.__class__ is union_set: 14043 arg1 = union_set(arg1) 14044 except: 14045 raise 14046 ctx = arg0.ctx 14047 res = isl.isl_schedule_node_band_set_ast_build_options(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 14048 obj = schedule_node(ctx=ctx, ptr=res) 14049 return obj 14050 def set_permutable(arg0, arg1): 14051 try: 14052 if not arg0.__class__ is schedule_node: 14053 arg0 = schedule_node(arg0) 14054 except: 14055 raise 14056 ctx = arg0.ctx 14057 res = isl.isl_schedule_node_band_set_permutable(isl.isl_schedule_node_copy(arg0.ptr), arg1) 14058 obj = schedule_node(ctx=ctx, ptr=res) 14059 return obj 14060 def shift(arg0, arg1): 14061 try: 14062 if not arg0.__class__ is schedule_node: 14063 arg0 = schedule_node(arg0) 14064 except: 14065 raise 14066 try: 14067 if not arg1.__class__ is multi_union_pw_aff: 14068 arg1 = multi_union_pw_aff(arg1) 14069 except: 14070 raise 14071 ctx = arg0.ctx 14072 res = isl.isl_schedule_node_band_shift(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_union_pw_aff_copy(arg1.ptr)) 14073 obj = schedule_node(ctx=ctx, ptr=res) 14074 return obj 14075 def split(arg0, arg1): 14076 try: 14077 if not arg0.__class__ is schedule_node: 14078 arg0 = schedule_node(arg0) 14079 except: 14080 raise 14081 ctx = arg0.ctx 14082 res = isl.isl_schedule_node_band_split(isl.isl_schedule_node_copy(arg0.ptr), arg1) 14083 obj = schedule_node(ctx=ctx, ptr=res) 14084 return obj 14085 def tile(arg0, arg1): 14086 try: 14087 if not arg0.__class__ is schedule_node: 14088 arg0 = schedule_node(arg0) 14089 except: 14090 raise 14091 try: 14092 if not arg1.__class__ is multi_val: 14093 arg1 = multi_val(arg1) 14094 except: 14095 raise 14096 ctx = arg0.ctx 14097 res = isl.isl_schedule_node_band_tile(isl.isl_schedule_node_copy(arg0.ptr), isl.isl_multi_val_copy(arg1.ptr)) 14098 obj = schedule_node(ctx=ctx, ptr=res) 14099 return obj 14100 def member_set_ast_loop_default(arg0, arg1): 14101 try: 14102 if not arg0.__class__ is schedule_node: 14103 arg0 = schedule_node(arg0) 14104 except: 14105 raise 14106 ctx = arg0.ctx 14107 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 0) 14108 obj = schedule_node(ctx=ctx, ptr=res) 14109 return obj 14110 def member_set_ast_loop_atomic(arg0, arg1): 14111 try: 14112 if not arg0.__class__ is schedule_node: 14113 arg0 = schedule_node(arg0) 14114 except: 14115 raise 14116 ctx = arg0.ctx 14117 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 1) 14118 obj = schedule_node(ctx=ctx, ptr=res) 14119 return obj 14120 def member_set_ast_loop_unroll(arg0, arg1): 14121 try: 14122 if not arg0.__class__ is schedule_node: 14123 arg0 = schedule_node(arg0) 14124 except: 14125 raise 14126 ctx = arg0.ctx 14127 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 2) 14128 obj = schedule_node(ctx=ctx, ptr=res) 14129 return obj 14130 def member_set_ast_loop_separate(arg0, arg1): 14131 try: 14132 if not arg0.__class__ is schedule_node: 14133 arg0 = schedule_node(arg0) 14134 except: 14135 raise 14136 ctx = arg0.ctx 14137 res = isl.isl_schedule_node_band_member_set_ast_loop_type(isl.isl_schedule_node_copy(arg0.ptr), arg1, 3) 14138 obj = schedule_node(ctx=ctx, ptr=res) 14139 return obj 14140 14141isl.isl_schedule_node_band_get_ast_build_options.restype = c_void_p 14142isl.isl_schedule_node_band_get_ast_build_options.argtypes = [c_void_p] 14143isl.isl_schedule_node_band_get_ast_isolate_option.restype = c_void_p 14144isl.isl_schedule_node_band_get_ast_isolate_option.argtypes = [c_void_p] 14145isl.isl_schedule_node_band_member_get_coincident.argtypes = [c_void_p, c_int] 14146isl.isl_schedule_node_band_member_set_coincident.restype = c_void_p 14147isl.isl_schedule_node_band_member_set_coincident.argtypes = [c_void_p, c_int, c_int] 14148isl.isl_schedule_node_band_mod.restype = c_void_p 14149isl.isl_schedule_node_band_mod.argtypes = [c_void_p, c_void_p] 14150isl.isl_schedule_node_band_n_member.argtypes = [c_void_p] 14151isl.isl_schedule_node_band_get_partial_schedule.restype = c_void_p 14152isl.isl_schedule_node_band_get_partial_schedule.argtypes = [c_void_p] 14153isl.isl_schedule_node_band_get_permutable.argtypes = [c_void_p] 14154isl.isl_schedule_node_band_scale.restype = c_void_p 14155isl.isl_schedule_node_band_scale.argtypes = [c_void_p, c_void_p] 14156isl.isl_schedule_node_band_scale_down.restype = c_void_p 14157isl.isl_schedule_node_band_scale_down.argtypes = [c_void_p, c_void_p] 14158isl.isl_schedule_node_band_set_ast_build_options.restype = c_void_p 14159isl.isl_schedule_node_band_set_ast_build_options.argtypes = [c_void_p, c_void_p] 14160isl.isl_schedule_node_band_set_permutable.restype = c_void_p 14161isl.isl_schedule_node_band_set_permutable.argtypes = [c_void_p, c_int] 14162isl.isl_schedule_node_band_shift.restype = c_void_p 14163isl.isl_schedule_node_band_shift.argtypes = [c_void_p, c_void_p] 14164isl.isl_schedule_node_band_split.restype = c_void_p 14165isl.isl_schedule_node_band_split.argtypes = [c_void_p, c_int] 14166isl.isl_schedule_node_band_tile.restype = c_void_p 14167isl.isl_schedule_node_band_tile.argtypes = [c_void_p, c_void_p] 14168isl.isl_schedule_node_band_member_set_ast_loop_type.restype = c_void_p 14169isl.isl_schedule_node_band_member_set_ast_loop_type.argtypes = [c_void_p, c_int, c_int] 14170isl.isl_schedule_node_copy.restype = c_void_p 14171isl.isl_schedule_node_copy.argtypes = [c_void_p] 14172isl.isl_schedule_node_free.restype = c_void_p 14173isl.isl_schedule_node_free.argtypes = [c_void_p] 14174isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14175isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14176 14177class schedule_node_context(schedule_node): 14178 def __init__(self, *args, **keywords): 14179 if "ptr" in keywords: 14180 self.ctx = keywords["ctx"] 14181 self.ptr = keywords["ptr"] 14182 return 14183 raise Error 14184 def __del__(self): 14185 if hasattr(self, 'ptr'): 14186 isl.isl_schedule_node_free(self.ptr) 14187 def __new__(cls, *args, **keywords): 14188 return super(schedule_node_context, cls).__new__(cls) 14189 def __str__(arg0): 14190 try: 14191 if not arg0.__class__ is schedule_node_context: 14192 arg0 = schedule_node_context(arg0) 14193 except: 14194 raise 14195 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14196 res = cast(ptr, c_char_p).value.decode('ascii') 14197 libc.free(ptr) 14198 return res 14199 def __repr__(self): 14200 s = str(self) 14201 if '"' in s: 14202 return 'isl.schedule_node_context("""%s""")' % s 14203 else: 14204 return 'isl.schedule_node_context("%s")' % s 14205 def context(arg0): 14206 try: 14207 if not arg0.__class__ is schedule_node: 14208 arg0 = schedule_node(arg0) 14209 except: 14210 raise 14211 ctx = arg0.ctx 14212 res = isl.isl_schedule_node_context_get_context(arg0.ptr) 14213 obj = set(ctx=ctx, ptr=res) 14214 return obj 14215 def get_context(arg0): 14216 return arg0.context() 14217 14218isl.isl_schedule_node_context_get_context.restype = c_void_p 14219isl.isl_schedule_node_context_get_context.argtypes = [c_void_p] 14220isl.isl_schedule_node_copy.restype = c_void_p 14221isl.isl_schedule_node_copy.argtypes = [c_void_p] 14222isl.isl_schedule_node_free.restype = c_void_p 14223isl.isl_schedule_node_free.argtypes = [c_void_p] 14224isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14225isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14226 14227class schedule_node_domain(schedule_node): 14228 def __init__(self, *args, **keywords): 14229 if "ptr" in keywords: 14230 self.ctx = keywords["ctx"] 14231 self.ptr = keywords["ptr"] 14232 return 14233 raise Error 14234 def __del__(self): 14235 if hasattr(self, 'ptr'): 14236 isl.isl_schedule_node_free(self.ptr) 14237 def __new__(cls, *args, **keywords): 14238 return super(schedule_node_domain, cls).__new__(cls) 14239 def __str__(arg0): 14240 try: 14241 if not arg0.__class__ is schedule_node_domain: 14242 arg0 = schedule_node_domain(arg0) 14243 except: 14244 raise 14245 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14246 res = cast(ptr, c_char_p).value.decode('ascii') 14247 libc.free(ptr) 14248 return res 14249 def __repr__(self): 14250 s = str(self) 14251 if '"' in s: 14252 return 'isl.schedule_node_domain("""%s""")' % s 14253 else: 14254 return 'isl.schedule_node_domain("%s")' % s 14255 def domain(arg0): 14256 try: 14257 if not arg0.__class__ is schedule_node: 14258 arg0 = schedule_node(arg0) 14259 except: 14260 raise 14261 ctx = arg0.ctx 14262 res = isl.isl_schedule_node_domain_get_domain(arg0.ptr) 14263 obj = union_set(ctx=ctx, ptr=res) 14264 return obj 14265 def get_domain(arg0): 14266 return arg0.domain() 14267 14268isl.isl_schedule_node_domain_get_domain.restype = c_void_p 14269isl.isl_schedule_node_domain_get_domain.argtypes = [c_void_p] 14270isl.isl_schedule_node_copy.restype = c_void_p 14271isl.isl_schedule_node_copy.argtypes = [c_void_p] 14272isl.isl_schedule_node_free.restype = c_void_p 14273isl.isl_schedule_node_free.argtypes = [c_void_p] 14274isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14275isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14276 14277class schedule_node_expansion(schedule_node): 14278 def __init__(self, *args, **keywords): 14279 if "ptr" in keywords: 14280 self.ctx = keywords["ctx"] 14281 self.ptr = keywords["ptr"] 14282 return 14283 raise Error 14284 def __del__(self): 14285 if hasattr(self, 'ptr'): 14286 isl.isl_schedule_node_free(self.ptr) 14287 def __new__(cls, *args, **keywords): 14288 return super(schedule_node_expansion, cls).__new__(cls) 14289 def __str__(arg0): 14290 try: 14291 if not arg0.__class__ is schedule_node_expansion: 14292 arg0 = schedule_node_expansion(arg0) 14293 except: 14294 raise 14295 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14296 res = cast(ptr, c_char_p).value.decode('ascii') 14297 libc.free(ptr) 14298 return res 14299 def __repr__(self): 14300 s = str(self) 14301 if '"' in s: 14302 return 'isl.schedule_node_expansion("""%s""")' % s 14303 else: 14304 return 'isl.schedule_node_expansion("%s")' % s 14305 def contraction(arg0): 14306 try: 14307 if not arg0.__class__ is schedule_node: 14308 arg0 = schedule_node(arg0) 14309 except: 14310 raise 14311 ctx = arg0.ctx 14312 res = isl.isl_schedule_node_expansion_get_contraction(arg0.ptr) 14313 obj = union_pw_multi_aff(ctx=ctx, ptr=res) 14314 return obj 14315 def get_contraction(arg0): 14316 return arg0.contraction() 14317 def expansion(arg0): 14318 try: 14319 if not arg0.__class__ is schedule_node: 14320 arg0 = schedule_node(arg0) 14321 except: 14322 raise 14323 ctx = arg0.ctx 14324 res = isl.isl_schedule_node_expansion_get_expansion(arg0.ptr) 14325 obj = union_map(ctx=ctx, ptr=res) 14326 return obj 14327 def get_expansion(arg0): 14328 return arg0.expansion() 14329 14330isl.isl_schedule_node_expansion_get_contraction.restype = c_void_p 14331isl.isl_schedule_node_expansion_get_contraction.argtypes = [c_void_p] 14332isl.isl_schedule_node_expansion_get_expansion.restype = c_void_p 14333isl.isl_schedule_node_expansion_get_expansion.argtypes = [c_void_p] 14334isl.isl_schedule_node_copy.restype = c_void_p 14335isl.isl_schedule_node_copy.argtypes = [c_void_p] 14336isl.isl_schedule_node_free.restype = c_void_p 14337isl.isl_schedule_node_free.argtypes = [c_void_p] 14338isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14339isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14340 14341class schedule_node_extension(schedule_node): 14342 def __init__(self, *args, **keywords): 14343 if "ptr" in keywords: 14344 self.ctx = keywords["ctx"] 14345 self.ptr = keywords["ptr"] 14346 return 14347 raise Error 14348 def __del__(self): 14349 if hasattr(self, 'ptr'): 14350 isl.isl_schedule_node_free(self.ptr) 14351 def __new__(cls, *args, **keywords): 14352 return super(schedule_node_extension, cls).__new__(cls) 14353 def __str__(arg0): 14354 try: 14355 if not arg0.__class__ is schedule_node_extension: 14356 arg0 = schedule_node_extension(arg0) 14357 except: 14358 raise 14359 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14360 res = cast(ptr, c_char_p).value.decode('ascii') 14361 libc.free(ptr) 14362 return res 14363 def __repr__(self): 14364 s = str(self) 14365 if '"' in s: 14366 return 'isl.schedule_node_extension("""%s""")' % s 14367 else: 14368 return 'isl.schedule_node_extension("%s")' % s 14369 def extension(arg0): 14370 try: 14371 if not arg0.__class__ is schedule_node: 14372 arg0 = schedule_node(arg0) 14373 except: 14374 raise 14375 ctx = arg0.ctx 14376 res = isl.isl_schedule_node_extension_get_extension(arg0.ptr) 14377 obj = union_map(ctx=ctx, ptr=res) 14378 return obj 14379 def get_extension(arg0): 14380 return arg0.extension() 14381 14382isl.isl_schedule_node_extension_get_extension.restype = c_void_p 14383isl.isl_schedule_node_extension_get_extension.argtypes = [c_void_p] 14384isl.isl_schedule_node_copy.restype = c_void_p 14385isl.isl_schedule_node_copy.argtypes = [c_void_p] 14386isl.isl_schedule_node_free.restype = c_void_p 14387isl.isl_schedule_node_free.argtypes = [c_void_p] 14388isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14389isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14390 14391class schedule_node_filter(schedule_node): 14392 def __init__(self, *args, **keywords): 14393 if "ptr" in keywords: 14394 self.ctx = keywords["ctx"] 14395 self.ptr = keywords["ptr"] 14396 return 14397 raise Error 14398 def __del__(self): 14399 if hasattr(self, 'ptr'): 14400 isl.isl_schedule_node_free(self.ptr) 14401 def __new__(cls, *args, **keywords): 14402 return super(schedule_node_filter, cls).__new__(cls) 14403 def __str__(arg0): 14404 try: 14405 if not arg0.__class__ is schedule_node_filter: 14406 arg0 = schedule_node_filter(arg0) 14407 except: 14408 raise 14409 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14410 res = cast(ptr, c_char_p).value.decode('ascii') 14411 libc.free(ptr) 14412 return res 14413 def __repr__(self): 14414 s = str(self) 14415 if '"' in s: 14416 return 'isl.schedule_node_filter("""%s""")' % s 14417 else: 14418 return 'isl.schedule_node_filter("%s")' % s 14419 def filter(arg0): 14420 try: 14421 if not arg0.__class__ is schedule_node: 14422 arg0 = schedule_node(arg0) 14423 except: 14424 raise 14425 ctx = arg0.ctx 14426 res = isl.isl_schedule_node_filter_get_filter(arg0.ptr) 14427 obj = union_set(ctx=ctx, ptr=res) 14428 return obj 14429 def get_filter(arg0): 14430 return arg0.filter() 14431 14432isl.isl_schedule_node_filter_get_filter.restype = c_void_p 14433isl.isl_schedule_node_filter_get_filter.argtypes = [c_void_p] 14434isl.isl_schedule_node_copy.restype = c_void_p 14435isl.isl_schedule_node_copy.argtypes = [c_void_p] 14436isl.isl_schedule_node_free.restype = c_void_p 14437isl.isl_schedule_node_free.argtypes = [c_void_p] 14438isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14439isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14440 14441class schedule_node_guard(schedule_node): 14442 def __init__(self, *args, **keywords): 14443 if "ptr" in keywords: 14444 self.ctx = keywords["ctx"] 14445 self.ptr = keywords["ptr"] 14446 return 14447 raise Error 14448 def __del__(self): 14449 if hasattr(self, 'ptr'): 14450 isl.isl_schedule_node_free(self.ptr) 14451 def __new__(cls, *args, **keywords): 14452 return super(schedule_node_guard, cls).__new__(cls) 14453 def __str__(arg0): 14454 try: 14455 if not arg0.__class__ is schedule_node_guard: 14456 arg0 = schedule_node_guard(arg0) 14457 except: 14458 raise 14459 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14460 res = cast(ptr, c_char_p).value.decode('ascii') 14461 libc.free(ptr) 14462 return res 14463 def __repr__(self): 14464 s = str(self) 14465 if '"' in s: 14466 return 'isl.schedule_node_guard("""%s""")' % s 14467 else: 14468 return 'isl.schedule_node_guard("%s")' % s 14469 def guard(arg0): 14470 try: 14471 if not arg0.__class__ is schedule_node: 14472 arg0 = schedule_node(arg0) 14473 except: 14474 raise 14475 ctx = arg0.ctx 14476 res = isl.isl_schedule_node_guard_get_guard(arg0.ptr) 14477 obj = set(ctx=ctx, ptr=res) 14478 return obj 14479 def get_guard(arg0): 14480 return arg0.guard() 14481 14482isl.isl_schedule_node_guard_get_guard.restype = c_void_p 14483isl.isl_schedule_node_guard_get_guard.argtypes = [c_void_p] 14484isl.isl_schedule_node_copy.restype = c_void_p 14485isl.isl_schedule_node_copy.argtypes = [c_void_p] 14486isl.isl_schedule_node_free.restype = c_void_p 14487isl.isl_schedule_node_free.argtypes = [c_void_p] 14488isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14489isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14490 14491class schedule_node_leaf(schedule_node): 14492 def __init__(self, *args, **keywords): 14493 if "ptr" in keywords: 14494 self.ctx = keywords["ctx"] 14495 self.ptr = keywords["ptr"] 14496 return 14497 raise Error 14498 def __del__(self): 14499 if hasattr(self, 'ptr'): 14500 isl.isl_schedule_node_free(self.ptr) 14501 def __new__(cls, *args, **keywords): 14502 return super(schedule_node_leaf, cls).__new__(cls) 14503 def __str__(arg0): 14504 try: 14505 if not arg0.__class__ is schedule_node_leaf: 14506 arg0 = schedule_node_leaf(arg0) 14507 except: 14508 raise 14509 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14510 res = cast(ptr, c_char_p).value.decode('ascii') 14511 libc.free(ptr) 14512 return res 14513 def __repr__(self): 14514 s = str(self) 14515 if '"' in s: 14516 return 'isl.schedule_node_leaf("""%s""")' % s 14517 else: 14518 return 'isl.schedule_node_leaf("%s")' % s 14519 14520isl.isl_schedule_node_copy.restype = c_void_p 14521isl.isl_schedule_node_copy.argtypes = [c_void_p] 14522isl.isl_schedule_node_free.restype = c_void_p 14523isl.isl_schedule_node_free.argtypes = [c_void_p] 14524isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14525isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14526 14527class schedule_node_mark(schedule_node): 14528 def __init__(self, *args, **keywords): 14529 if "ptr" in keywords: 14530 self.ctx = keywords["ctx"] 14531 self.ptr = keywords["ptr"] 14532 return 14533 raise Error 14534 def __del__(self): 14535 if hasattr(self, 'ptr'): 14536 isl.isl_schedule_node_free(self.ptr) 14537 def __new__(cls, *args, **keywords): 14538 return super(schedule_node_mark, cls).__new__(cls) 14539 def __str__(arg0): 14540 try: 14541 if not arg0.__class__ is schedule_node_mark: 14542 arg0 = schedule_node_mark(arg0) 14543 except: 14544 raise 14545 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14546 res = cast(ptr, c_char_p).value.decode('ascii') 14547 libc.free(ptr) 14548 return res 14549 def __repr__(self): 14550 s = str(self) 14551 if '"' in s: 14552 return 'isl.schedule_node_mark("""%s""")' % s 14553 else: 14554 return 'isl.schedule_node_mark("%s")' % s 14555 14556isl.isl_schedule_node_copy.restype = c_void_p 14557isl.isl_schedule_node_copy.argtypes = [c_void_p] 14558isl.isl_schedule_node_free.restype = c_void_p 14559isl.isl_schedule_node_free.argtypes = [c_void_p] 14560isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14561isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14562 14563class schedule_node_sequence(schedule_node): 14564 def __init__(self, *args, **keywords): 14565 if "ptr" in keywords: 14566 self.ctx = keywords["ctx"] 14567 self.ptr = keywords["ptr"] 14568 return 14569 raise Error 14570 def __del__(self): 14571 if hasattr(self, 'ptr'): 14572 isl.isl_schedule_node_free(self.ptr) 14573 def __new__(cls, *args, **keywords): 14574 return super(schedule_node_sequence, cls).__new__(cls) 14575 def __str__(arg0): 14576 try: 14577 if not arg0.__class__ is schedule_node_sequence: 14578 arg0 = schedule_node_sequence(arg0) 14579 except: 14580 raise 14581 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14582 res = cast(ptr, c_char_p).value.decode('ascii') 14583 libc.free(ptr) 14584 return res 14585 def __repr__(self): 14586 s = str(self) 14587 if '"' in s: 14588 return 'isl.schedule_node_sequence("""%s""")' % s 14589 else: 14590 return 'isl.schedule_node_sequence("%s")' % s 14591 14592isl.isl_schedule_node_copy.restype = c_void_p 14593isl.isl_schedule_node_copy.argtypes = [c_void_p] 14594isl.isl_schedule_node_free.restype = c_void_p 14595isl.isl_schedule_node_free.argtypes = [c_void_p] 14596isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14597isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14598 14599class schedule_node_set(schedule_node): 14600 def __init__(self, *args, **keywords): 14601 if "ptr" in keywords: 14602 self.ctx = keywords["ctx"] 14603 self.ptr = keywords["ptr"] 14604 return 14605 raise Error 14606 def __del__(self): 14607 if hasattr(self, 'ptr'): 14608 isl.isl_schedule_node_free(self.ptr) 14609 def __new__(cls, *args, **keywords): 14610 return super(schedule_node_set, cls).__new__(cls) 14611 def __str__(arg0): 14612 try: 14613 if not arg0.__class__ is schedule_node_set: 14614 arg0 = schedule_node_set(arg0) 14615 except: 14616 raise 14617 ptr = isl.isl_schedule_node_to_str(arg0.ptr) 14618 res = cast(ptr, c_char_p).value.decode('ascii') 14619 libc.free(ptr) 14620 return res 14621 def __repr__(self): 14622 s = str(self) 14623 if '"' in s: 14624 return 'isl.schedule_node_set("""%s""")' % s 14625 else: 14626 return 'isl.schedule_node_set("%s")' % s 14627 14628isl.isl_schedule_node_copy.restype = c_void_p 14629isl.isl_schedule_node_copy.argtypes = [c_void_p] 14630isl.isl_schedule_node_free.restype = c_void_p 14631isl.isl_schedule_node_free.argtypes = [c_void_p] 14632isl.isl_schedule_node_to_str.restype = POINTER(c_char) 14633isl.isl_schedule_node_to_str.argtypes = [c_void_p] 14634 14635class set_list(object): 14636 def __init__(self, *args, **keywords): 14637 if "ptr" in keywords: 14638 self.ctx = keywords["ctx"] 14639 self.ptr = keywords["ptr"] 14640 return 14641 if len(args) == 1 and type(args[0]) == int: 14642 self.ctx = Context.getDefaultInstance() 14643 self.ptr = isl.isl_set_list_alloc(self.ctx, args[0]) 14644 return 14645 if len(args) == 1 and args[0].__class__ is set: 14646 self.ctx = Context.getDefaultInstance() 14647 self.ptr = isl.isl_set_list_from_set(isl.isl_set_copy(args[0].ptr)) 14648 return 14649 if len(args) == 1 and type(args[0]) == str: 14650 self.ctx = Context.getDefaultInstance() 14651 self.ptr = isl.isl_set_list_read_from_str(self.ctx, args[0].encode('ascii')) 14652 return 14653 raise Error 14654 def __del__(self): 14655 if hasattr(self, 'ptr'): 14656 isl.isl_set_list_free(self.ptr) 14657 def __str__(arg0): 14658 try: 14659 if not arg0.__class__ is set_list: 14660 arg0 = set_list(arg0) 14661 except: 14662 raise 14663 ptr = isl.isl_set_list_to_str(arg0.ptr) 14664 res = cast(ptr, c_char_p).value.decode('ascii') 14665 libc.free(ptr) 14666 return res 14667 def __repr__(self): 14668 s = str(self) 14669 if '"' in s: 14670 return 'isl.set_list("""%s""")' % s 14671 else: 14672 return 'isl.set_list("%s")' % s 14673 def add(arg0, arg1): 14674 try: 14675 if not arg0.__class__ is set_list: 14676 arg0 = set_list(arg0) 14677 except: 14678 raise 14679 try: 14680 if not arg1.__class__ is set: 14681 arg1 = set(arg1) 14682 except: 14683 raise 14684 ctx = arg0.ctx 14685 res = isl.isl_set_list_add(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_copy(arg1.ptr)) 14686 obj = set_list(ctx=ctx, ptr=res) 14687 return obj 14688 def at(arg0, arg1): 14689 try: 14690 if not arg0.__class__ is set_list: 14691 arg0 = set_list(arg0) 14692 except: 14693 raise 14694 ctx = arg0.ctx 14695 res = isl.isl_set_list_get_at(arg0.ptr, arg1) 14696 obj = set(ctx=ctx, ptr=res) 14697 return obj 14698 def get_at(arg0, arg1): 14699 return arg0.at(arg1) 14700 def clear(arg0): 14701 try: 14702 if not arg0.__class__ is set_list: 14703 arg0 = set_list(arg0) 14704 except: 14705 raise 14706 ctx = arg0.ctx 14707 res = isl.isl_set_list_clear(isl.isl_set_list_copy(arg0.ptr)) 14708 obj = set_list(ctx=ctx, ptr=res) 14709 return obj 14710 def concat(arg0, arg1): 14711 try: 14712 if not arg0.__class__ is set_list: 14713 arg0 = set_list(arg0) 14714 except: 14715 raise 14716 try: 14717 if not arg1.__class__ is set_list: 14718 arg1 = set_list(arg1) 14719 except: 14720 raise 14721 ctx = arg0.ctx 14722 res = isl.isl_set_list_concat(isl.isl_set_list_copy(arg0.ptr), isl.isl_set_list_copy(arg1.ptr)) 14723 obj = set_list(ctx=ctx, ptr=res) 14724 return obj 14725 def drop(arg0, arg1, arg2): 14726 try: 14727 if not arg0.__class__ is set_list: 14728 arg0 = set_list(arg0) 14729 except: 14730 raise 14731 ctx = arg0.ctx 14732 res = isl.isl_set_list_drop(isl.isl_set_list_copy(arg0.ptr), arg1, arg2) 14733 obj = set_list(ctx=ctx, ptr=res) 14734 return obj 14735 def foreach(arg0, arg1): 14736 try: 14737 if not arg0.__class__ is set_list: 14738 arg0 = set_list(arg0) 14739 except: 14740 raise 14741 exc_info = [None] 14742 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 14743 def cb_func(cb_arg0, cb_arg1): 14744 cb_arg0 = set(ctx=arg0.ctx, ptr=(cb_arg0)) 14745 try: 14746 arg1(cb_arg0) 14747 except BaseException as e: 14748 exc_info[0] = e 14749 return -1 14750 return 0 14751 cb = fn(cb_func) 14752 ctx = arg0.ctx 14753 res = isl.isl_set_list_foreach(arg0.ptr, cb, None) 14754 if exc_info[0] is not None: 14755 raise exc_info[0] 14756 if res < 0: 14757 raise 14758 def insert(arg0, arg1, arg2): 14759 try: 14760 if not arg0.__class__ is set_list: 14761 arg0 = set_list(arg0) 14762 except: 14763 raise 14764 try: 14765 if not arg2.__class__ is set: 14766 arg2 = set(arg2) 14767 except: 14768 raise 14769 ctx = arg0.ctx 14770 res = isl.isl_set_list_insert(isl.isl_set_list_copy(arg0.ptr), arg1, isl.isl_set_copy(arg2.ptr)) 14771 obj = set_list(ctx=ctx, ptr=res) 14772 return obj 14773 def size(arg0): 14774 try: 14775 if not arg0.__class__ is set_list: 14776 arg0 = set_list(arg0) 14777 except: 14778 raise 14779 ctx = arg0.ctx 14780 res = isl.isl_set_list_size(arg0.ptr) 14781 if res < 0: 14782 raise 14783 return int(res) 14784 14785isl.isl_set_list_alloc.restype = c_void_p 14786isl.isl_set_list_alloc.argtypes = [Context, c_int] 14787isl.isl_set_list_from_set.restype = c_void_p 14788isl.isl_set_list_from_set.argtypes = [c_void_p] 14789isl.isl_set_list_read_from_str.restype = c_void_p 14790isl.isl_set_list_read_from_str.argtypes = [Context, c_char_p] 14791isl.isl_set_list_add.restype = c_void_p 14792isl.isl_set_list_add.argtypes = [c_void_p, c_void_p] 14793isl.isl_set_list_get_at.restype = c_void_p 14794isl.isl_set_list_get_at.argtypes = [c_void_p, c_int] 14795isl.isl_set_list_clear.restype = c_void_p 14796isl.isl_set_list_clear.argtypes = [c_void_p] 14797isl.isl_set_list_concat.restype = c_void_p 14798isl.isl_set_list_concat.argtypes = [c_void_p, c_void_p] 14799isl.isl_set_list_drop.restype = c_void_p 14800isl.isl_set_list_drop.argtypes = [c_void_p, c_int, c_int] 14801isl.isl_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 14802isl.isl_set_list_insert.restype = c_void_p 14803isl.isl_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] 14804isl.isl_set_list_size.argtypes = [c_void_p] 14805isl.isl_set_list_copy.restype = c_void_p 14806isl.isl_set_list_copy.argtypes = [c_void_p] 14807isl.isl_set_list_free.restype = c_void_p 14808isl.isl_set_list_free.argtypes = [c_void_p] 14809isl.isl_set_list_to_str.restype = POINTER(c_char) 14810isl.isl_set_list_to_str.argtypes = [c_void_p] 14811 14812class space(object): 14813 def __init__(self, *args, **keywords): 14814 if "ptr" in keywords: 14815 self.ctx = keywords["ctx"] 14816 self.ptr = keywords["ptr"] 14817 return 14818 raise Error 14819 def __del__(self): 14820 if hasattr(self, 'ptr'): 14821 isl.isl_space_free(self.ptr) 14822 def __str__(arg0): 14823 try: 14824 if not arg0.__class__ is space: 14825 arg0 = space(arg0) 14826 except: 14827 raise 14828 ptr = isl.isl_space_to_str(arg0.ptr) 14829 res = cast(ptr, c_char_p).value.decode('ascii') 14830 libc.free(ptr) 14831 return res 14832 def __repr__(self): 14833 s = str(self) 14834 if '"' in s: 14835 return 'isl.space("""%s""")' % s 14836 else: 14837 return 'isl.space("%s")' % s 14838 def add_named_tuple(*args): 14839 if len(args) == 3 and (args[1].__class__ is id or type(args[1]) == str) and type(args[2]) == int: 14840 args = list(args) 14841 try: 14842 if not args[1].__class__ is id: 14843 args[1] = id(args[1]) 14844 except: 14845 raise 14846 ctx = args[0].ctx 14847 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]) 14848 obj = space(ctx=ctx, ptr=res) 14849 return obj 14850 raise Error 14851 def add_param(*args): 14852 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 14853 args = list(args) 14854 try: 14855 if not args[1].__class__ is id: 14856 args[1] = id(args[1]) 14857 except: 14858 raise 14859 ctx = args[0].ctx 14860 res = isl.isl_space_add_param_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 14861 obj = space(ctx=ctx, ptr=res) 14862 return obj 14863 raise Error 14864 def add_unnamed_tuple(*args): 14865 if len(args) == 2 and type(args[1]) == int: 14866 ctx = args[0].ctx 14867 res = isl.isl_space_add_unnamed_tuple_ui(isl.isl_space_copy(args[0].ptr), args[1]) 14868 obj = space(ctx=ctx, ptr=res) 14869 return obj 14870 raise Error 14871 def curry(arg0): 14872 try: 14873 if not arg0.__class__ is space: 14874 arg0 = space(arg0) 14875 except: 14876 raise 14877 ctx = arg0.ctx 14878 res = isl.isl_space_curry(isl.isl_space_copy(arg0.ptr)) 14879 obj = space(ctx=ctx, ptr=res) 14880 return obj 14881 def domain(arg0): 14882 try: 14883 if not arg0.__class__ is space: 14884 arg0 = space(arg0) 14885 except: 14886 raise 14887 ctx = arg0.ctx 14888 res = isl.isl_space_domain(isl.isl_space_copy(arg0.ptr)) 14889 obj = space(ctx=ctx, ptr=res) 14890 return obj 14891 def domain_map_multi_aff(arg0): 14892 try: 14893 if not arg0.__class__ is space: 14894 arg0 = space(arg0) 14895 except: 14896 raise 14897 ctx = arg0.ctx 14898 res = isl.isl_space_domain_map_multi_aff(isl.isl_space_copy(arg0.ptr)) 14899 obj = multi_aff(ctx=ctx, ptr=res) 14900 return obj 14901 def domain_map_pw_multi_aff(arg0): 14902 try: 14903 if not arg0.__class__ is space: 14904 arg0 = space(arg0) 14905 except: 14906 raise 14907 ctx = arg0.ctx 14908 res = isl.isl_space_domain_map_pw_multi_aff(isl.isl_space_copy(arg0.ptr)) 14909 obj = pw_multi_aff(ctx=ctx, ptr=res) 14910 return obj 14911 def domain_tuple_id(arg0): 14912 try: 14913 if not arg0.__class__ is space: 14914 arg0 = space(arg0) 14915 except: 14916 raise 14917 ctx = arg0.ctx 14918 res = isl.isl_space_get_domain_tuple_id(arg0.ptr) 14919 obj = id(ctx=ctx, ptr=res) 14920 return obj 14921 def get_domain_tuple_id(arg0): 14922 return arg0.domain_tuple_id() 14923 def flatten_domain(arg0): 14924 try: 14925 if not arg0.__class__ is space: 14926 arg0 = space(arg0) 14927 except: 14928 raise 14929 ctx = arg0.ctx 14930 res = isl.isl_space_flatten_domain(isl.isl_space_copy(arg0.ptr)) 14931 obj = space(ctx=ctx, ptr=res) 14932 return obj 14933 def flatten_range(arg0): 14934 try: 14935 if not arg0.__class__ is space: 14936 arg0 = space(arg0) 14937 except: 14938 raise 14939 ctx = arg0.ctx 14940 res = isl.isl_space_flatten_range(isl.isl_space_copy(arg0.ptr)) 14941 obj = space(ctx=ctx, ptr=res) 14942 return obj 14943 def has_domain_tuple_id(arg0): 14944 try: 14945 if not arg0.__class__ is space: 14946 arg0 = space(arg0) 14947 except: 14948 raise 14949 ctx = arg0.ctx 14950 res = isl.isl_space_has_domain_tuple_id(arg0.ptr) 14951 if res < 0: 14952 raise 14953 return bool(res) 14954 def has_range_tuple_id(arg0): 14955 try: 14956 if not arg0.__class__ is space: 14957 arg0 = space(arg0) 14958 except: 14959 raise 14960 ctx = arg0.ctx 14961 res = isl.isl_space_has_range_tuple_id(arg0.ptr) 14962 if res < 0: 14963 raise 14964 return bool(res) 14965 def identity_multi_aff_on_domain(arg0): 14966 try: 14967 if not arg0.__class__ is space: 14968 arg0 = space(arg0) 14969 except: 14970 raise 14971 ctx = arg0.ctx 14972 res = isl.isl_space_identity_multi_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 14973 obj = multi_aff(ctx=ctx, ptr=res) 14974 return obj 14975 def identity_multi_pw_aff_on_domain(arg0): 14976 try: 14977 if not arg0.__class__ is space: 14978 arg0 = space(arg0) 14979 except: 14980 raise 14981 ctx = arg0.ctx 14982 res = isl.isl_space_identity_multi_pw_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 14983 obj = multi_pw_aff(ctx=ctx, ptr=res) 14984 return obj 14985 def identity_pw_multi_aff_on_domain(arg0): 14986 try: 14987 if not arg0.__class__ is space: 14988 arg0 = space(arg0) 14989 except: 14990 raise 14991 ctx = arg0.ctx 14992 res = isl.isl_space_identity_pw_multi_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 14993 obj = pw_multi_aff(ctx=ctx, ptr=res) 14994 return obj 14995 def is_equal(arg0, arg1): 14996 try: 14997 if not arg0.__class__ is space: 14998 arg0 = space(arg0) 14999 except: 15000 raise 15001 try: 15002 if not arg1.__class__ is space: 15003 arg1 = space(arg1) 15004 except: 15005 raise 15006 ctx = arg0.ctx 15007 res = isl.isl_space_is_equal(arg0.ptr, arg1.ptr) 15008 if res < 0: 15009 raise 15010 return bool(res) 15011 def is_wrapping(arg0): 15012 try: 15013 if not arg0.__class__ is space: 15014 arg0 = space(arg0) 15015 except: 15016 raise 15017 ctx = arg0.ctx 15018 res = isl.isl_space_is_wrapping(arg0.ptr) 15019 if res < 0: 15020 raise 15021 return bool(res) 15022 def map_from_set(arg0): 15023 try: 15024 if not arg0.__class__ is space: 15025 arg0 = space(arg0) 15026 except: 15027 raise 15028 ctx = arg0.ctx 15029 res = isl.isl_space_map_from_set(isl.isl_space_copy(arg0.ptr)) 15030 obj = space(ctx=ctx, ptr=res) 15031 return obj 15032 def multi_aff(arg0, arg1): 15033 try: 15034 if not arg0.__class__ is space: 15035 arg0 = space(arg0) 15036 except: 15037 raise 15038 try: 15039 if not arg1.__class__ is aff_list: 15040 arg1 = aff_list(arg1) 15041 except: 15042 raise 15043 ctx = arg0.ctx 15044 res = isl.isl_space_multi_aff(isl.isl_space_copy(arg0.ptr), isl.isl_aff_list_copy(arg1.ptr)) 15045 obj = multi_aff(ctx=ctx, ptr=res) 15046 return obj 15047 def multi_aff_on_domain(*args): 15048 if len(args) == 2 and args[1].__class__ is multi_val: 15049 ctx = args[0].ctx 15050 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)) 15051 obj = multi_aff(ctx=ctx, ptr=res) 15052 return obj 15053 raise Error 15054 def multi_id(arg0, arg1): 15055 try: 15056 if not arg0.__class__ is space: 15057 arg0 = space(arg0) 15058 except: 15059 raise 15060 try: 15061 if not arg1.__class__ is id_list: 15062 arg1 = id_list(arg1) 15063 except: 15064 raise 15065 ctx = arg0.ctx 15066 res = isl.isl_space_multi_id(isl.isl_space_copy(arg0.ptr), isl.isl_id_list_copy(arg1.ptr)) 15067 obj = multi_id(ctx=ctx, ptr=res) 15068 return obj 15069 def multi_pw_aff(arg0, arg1): 15070 try: 15071 if not arg0.__class__ is space: 15072 arg0 = space(arg0) 15073 except: 15074 raise 15075 try: 15076 if not arg1.__class__ is pw_aff_list: 15077 arg1 = pw_aff_list(arg1) 15078 except: 15079 raise 15080 ctx = arg0.ctx 15081 res = isl.isl_space_multi_pw_aff(isl.isl_space_copy(arg0.ptr), isl.isl_pw_aff_list_copy(arg1.ptr)) 15082 obj = multi_pw_aff(ctx=ctx, ptr=res) 15083 return obj 15084 def multi_union_pw_aff(arg0, arg1): 15085 try: 15086 if not arg0.__class__ is space: 15087 arg0 = space(arg0) 15088 except: 15089 raise 15090 try: 15091 if not arg1.__class__ is union_pw_aff_list: 15092 arg1 = union_pw_aff_list(arg1) 15093 except: 15094 raise 15095 ctx = arg0.ctx 15096 res = isl.isl_space_multi_union_pw_aff(isl.isl_space_copy(arg0.ptr), isl.isl_union_pw_aff_list_copy(arg1.ptr)) 15097 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 15098 return obj 15099 def multi_val(arg0, arg1): 15100 try: 15101 if not arg0.__class__ is space: 15102 arg0 = space(arg0) 15103 except: 15104 raise 15105 try: 15106 if not arg1.__class__ is val_list: 15107 arg1 = val_list(arg1) 15108 except: 15109 raise 15110 ctx = arg0.ctx 15111 res = isl.isl_space_multi_val(isl.isl_space_copy(arg0.ptr), isl.isl_val_list_copy(arg1.ptr)) 15112 obj = multi_val(ctx=ctx, ptr=res) 15113 return obj 15114 def param_aff_on_domain(*args): 15115 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 15116 args = list(args) 15117 try: 15118 if not args[1].__class__ is id: 15119 args[1] = id(args[1]) 15120 except: 15121 raise 15122 ctx = args[0].ctx 15123 res = isl.isl_space_param_aff_on_domain_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 15124 obj = aff(ctx=ctx, ptr=res) 15125 return obj 15126 raise Error 15127 def params(arg0): 15128 try: 15129 if not arg0.__class__ is space: 15130 arg0 = space(arg0) 15131 except: 15132 raise 15133 ctx = arg0.ctx 15134 res = isl.isl_space_params(isl.isl_space_copy(arg0.ptr)) 15135 obj = space(ctx=ctx, ptr=res) 15136 return obj 15137 def product(arg0, arg1): 15138 try: 15139 if not arg0.__class__ is space: 15140 arg0 = space(arg0) 15141 except: 15142 raise 15143 try: 15144 if not arg1.__class__ is space: 15145 arg1 = space(arg1) 15146 except: 15147 raise 15148 ctx = arg0.ctx 15149 res = isl.isl_space_product(isl.isl_space_copy(arg0.ptr), isl.isl_space_copy(arg1.ptr)) 15150 obj = space(ctx=ctx, ptr=res) 15151 return obj 15152 def range(arg0): 15153 try: 15154 if not arg0.__class__ is space: 15155 arg0 = space(arg0) 15156 except: 15157 raise 15158 ctx = arg0.ctx 15159 res = isl.isl_space_range(isl.isl_space_copy(arg0.ptr)) 15160 obj = space(ctx=ctx, ptr=res) 15161 return obj 15162 def range_map_multi_aff(arg0): 15163 try: 15164 if not arg0.__class__ is space: 15165 arg0 = space(arg0) 15166 except: 15167 raise 15168 ctx = arg0.ctx 15169 res = isl.isl_space_range_map_multi_aff(isl.isl_space_copy(arg0.ptr)) 15170 obj = multi_aff(ctx=ctx, ptr=res) 15171 return obj 15172 def range_map_pw_multi_aff(arg0): 15173 try: 15174 if not arg0.__class__ is space: 15175 arg0 = space(arg0) 15176 except: 15177 raise 15178 ctx = arg0.ctx 15179 res = isl.isl_space_range_map_pw_multi_aff(isl.isl_space_copy(arg0.ptr)) 15180 obj = pw_multi_aff(ctx=ctx, ptr=res) 15181 return obj 15182 def range_reverse(arg0): 15183 try: 15184 if not arg0.__class__ is space: 15185 arg0 = space(arg0) 15186 except: 15187 raise 15188 ctx = arg0.ctx 15189 res = isl.isl_space_range_reverse(isl.isl_space_copy(arg0.ptr)) 15190 obj = space(ctx=ctx, ptr=res) 15191 return obj 15192 def range_tuple_id(arg0): 15193 try: 15194 if not arg0.__class__ is space: 15195 arg0 = space(arg0) 15196 except: 15197 raise 15198 ctx = arg0.ctx 15199 res = isl.isl_space_get_range_tuple_id(arg0.ptr) 15200 obj = id(ctx=ctx, ptr=res) 15201 return obj 15202 def get_range_tuple_id(arg0): 15203 return arg0.range_tuple_id() 15204 def reverse(arg0): 15205 try: 15206 if not arg0.__class__ is space: 15207 arg0 = space(arg0) 15208 except: 15209 raise 15210 ctx = arg0.ctx 15211 res = isl.isl_space_reverse(isl.isl_space_copy(arg0.ptr)) 15212 obj = space(ctx=ctx, ptr=res) 15213 return obj 15214 def set_domain_tuple(*args): 15215 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 15216 args = list(args) 15217 try: 15218 if not args[1].__class__ is id: 15219 args[1] = id(args[1]) 15220 except: 15221 raise 15222 ctx = args[0].ctx 15223 res = isl.isl_space_set_domain_tuple_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 15224 obj = space(ctx=ctx, ptr=res) 15225 return obj 15226 raise Error 15227 def set_range_tuple(*args): 15228 if len(args) == 2 and (args[1].__class__ is id or type(args[1]) == str): 15229 args = list(args) 15230 try: 15231 if not args[1].__class__ is id: 15232 args[1] = id(args[1]) 15233 except: 15234 raise 15235 ctx = args[0].ctx 15236 res = isl.isl_space_set_range_tuple_id(isl.isl_space_copy(args[0].ptr), isl.isl_id_copy(args[1].ptr)) 15237 obj = space(ctx=ctx, ptr=res) 15238 return obj 15239 raise Error 15240 def uncurry(arg0): 15241 try: 15242 if not arg0.__class__ is space: 15243 arg0 = space(arg0) 15244 except: 15245 raise 15246 ctx = arg0.ctx 15247 res = isl.isl_space_uncurry(isl.isl_space_copy(arg0.ptr)) 15248 obj = space(ctx=ctx, ptr=res) 15249 return obj 15250 @staticmethod 15251 def unit(): 15252 ctx = Context.getDefaultInstance() 15253 res = isl.isl_space_unit(ctx) 15254 obj = space(ctx=ctx, ptr=res) 15255 return obj 15256 def universe_map(arg0): 15257 try: 15258 if not arg0.__class__ is space: 15259 arg0 = space(arg0) 15260 except: 15261 raise 15262 ctx = arg0.ctx 15263 res = isl.isl_space_universe_map(isl.isl_space_copy(arg0.ptr)) 15264 obj = map(ctx=ctx, ptr=res) 15265 return obj 15266 def universe_set(arg0): 15267 try: 15268 if not arg0.__class__ is space: 15269 arg0 = space(arg0) 15270 except: 15271 raise 15272 ctx = arg0.ctx 15273 res = isl.isl_space_universe_set(isl.isl_space_copy(arg0.ptr)) 15274 obj = set(ctx=ctx, ptr=res) 15275 return obj 15276 def unwrap(arg0): 15277 try: 15278 if not arg0.__class__ is space: 15279 arg0 = space(arg0) 15280 except: 15281 raise 15282 ctx = arg0.ctx 15283 res = isl.isl_space_unwrap(isl.isl_space_copy(arg0.ptr)) 15284 obj = space(ctx=ctx, ptr=res) 15285 return obj 15286 def wrap(arg0): 15287 try: 15288 if not arg0.__class__ is space: 15289 arg0 = space(arg0) 15290 except: 15291 raise 15292 ctx = arg0.ctx 15293 res = isl.isl_space_wrap(isl.isl_space_copy(arg0.ptr)) 15294 obj = space(ctx=ctx, ptr=res) 15295 return obj 15296 def zero_aff_on_domain(arg0): 15297 try: 15298 if not arg0.__class__ is space: 15299 arg0 = space(arg0) 15300 except: 15301 raise 15302 ctx = arg0.ctx 15303 res = isl.isl_space_zero_aff_on_domain(isl.isl_space_copy(arg0.ptr)) 15304 obj = aff(ctx=ctx, ptr=res) 15305 return obj 15306 def zero_multi_aff(arg0): 15307 try: 15308 if not arg0.__class__ is space: 15309 arg0 = space(arg0) 15310 except: 15311 raise 15312 ctx = arg0.ctx 15313 res = isl.isl_space_zero_multi_aff(isl.isl_space_copy(arg0.ptr)) 15314 obj = multi_aff(ctx=ctx, ptr=res) 15315 return obj 15316 def zero_multi_pw_aff(arg0): 15317 try: 15318 if not arg0.__class__ is space: 15319 arg0 = space(arg0) 15320 except: 15321 raise 15322 ctx = arg0.ctx 15323 res = isl.isl_space_zero_multi_pw_aff(isl.isl_space_copy(arg0.ptr)) 15324 obj = multi_pw_aff(ctx=ctx, ptr=res) 15325 return obj 15326 def zero_multi_union_pw_aff(arg0): 15327 try: 15328 if not arg0.__class__ is space: 15329 arg0 = space(arg0) 15330 except: 15331 raise 15332 ctx = arg0.ctx 15333 res = isl.isl_space_zero_multi_union_pw_aff(isl.isl_space_copy(arg0.ptr)) 15334 obj = multi_union_pw_aff(ctx=ctx, ptr=res) 15335 return obj 15336 def zero_multi_val(arg0): 15337 try: 15338 if not arg0.__class__ is space: 15339 arg0 = space(arg0) 15340 except: 15341 raise 15342 ctx = arg0.ctx 15343 res = isl.isl_space_zero_multi_val(isl.isl_space_copy(arg0.ptr)) 15344 obj = multi_val(ctx=ctx, ptr=res) 15345 return obj 15346 15347isl.isl_space_add_named_tuple_id_ui.restype = c_void_p 15348isl.isl_space_add_named_tuple_id_ui.argtypes = [c_void_p, c_void_p, c_int] 15349isl.isl_space_add_param_id.restype = c_void_p 15350isl.isl_space_add_param_id.argtypes = [c_void_p, c_void_p] 15351isl.isl_space_add_unnamed_tuple_ui.restype = c_void_p 15352isl.isl_space_add_unnamed_tuple_ui.argtypes = [c_void_p, c_int] 15353isl.isl_space_curry.restype = c_void_p 15354isl.isl_space_curry.argtypes = [c_void_p] 15355isl.isl_space_domain.restype = c_void_p 15356isl.isl_space_domain.argtypes = [c_void_p] 15357isl.isl_space_domain_map_multi_aff.restype = c_void_p 15358isl.isl_space_domain_map_multi_aff.argtypes = [c_void_p] 15359isl.isl_space_domain_map_pw_multi_aff.restype = c_void_p 15360isl.isl_space_domain_map_pw_multi_aff.argtypes = [c_void_p] 15361isl.isl_space_get_domain_tuple_id.restype = c_void_p 15362isl.isl_space_get_domain_tuple_id.argtypes = [c_void_p] 15363isl.isl_space_flatten_domain.restype = c_void_p 15364isl.isl_space_flatten_domain.argtypes = [c_void_p] 15365isl.isl_space_flatten_range.restype = c_void_p 15366isl.isl_space_flatten_range.argtypes = [c_void_p] 15367isl.isl_space_has_domain_tuple_id.argtypes = [c_void_p] 15368isl.isl_space_has_range_tuple_id.argtypes = [c_void_p] 15369isl.isl_space_identity_multi_aff_on_domain.restype = c_void_p 15370isl.isl_space_identity_multi_aff_on_domain.argtypes = [c_void_p] 15371isl.isl_space_identity_multi_pw_aff_on_domain.restype = c_void_p 15372isl.isl_space_identity_multi_pw_aff_on_domain.argtypes = [c_void_p] 15373isl.isl_space_identity_pw_multi_aff_on_domain.restype = c_void_p 15374isl.isl_space_identity_pw_multi_aff_on_domain.argtypes = [c_void_p] 15375isl.isl_space_is_equal.argtypes = [c_void_p, c_void_p] 15376isl.isl_space_is_wrapping.argtypes = [c_void_p] 15377isl.isl_space_map_from_set.restype = c_void_p 15378isl.isl_space_map_from_set.argtypes = [c_void_p] 15379isl.isl_space_multi_aff.restype = c_void_p 15380isl.isl_space_multi_aff.argtypes = [c_void_p, c_void_p] 15381isl.isl_space_multi_aff_on_domain_multi_val.restype = c_void_p 15382isl.isl_space_multi_aff_on_domain_multi_val.argtypes = [c_void_p, c_void_p] 15383isl.isl_space_multi_id.restype = c_void_p 15384isl.isl_space_multi_id.argtypes = [c_void_p, c_void_p] 15385isl.isl_space_multi_pw_aff.restype = c_void_p 15386isl.isl_space_multi_pw_aff.argtypes = [c_void_p, c_void_p] 15387isl.isl_space_multi_union_pw_aff.restype = c_void_p 15388isl.isl_space_multi_union_pw_aff.argtypes = [c_void_p, c_void_p] 15389isl.isl_space_multi_val.restype = c_void_p 15390isl.isl_space_multi_val.argtypes = [c_void_p, c_void_p] 15391isl.isl_space_param_aff_on_domain_id.restype = c_void_p 15392isl.isl_space_param_aff_on_domain_id.argtypes = [c_void_p, c_void_p] 15393isl.isl_space_params.restype = c_void_p 15394isl.isl_space_params.argtypes = [c_void_p] 15395isl.isl_space_product.restype = c_void_p 15396isl.isl_space_product.argtypes = [c_void_p, c_void_p] 15397isl.isl_space_range.restype = c_void_p 15398isl.isl_space_range.argtypes = [c_void_p] 15399isl.isl_space_range_map_multi_aff.restype = c_void_p 15400isl.isl_space_range_map_multi_aff.argtypes = [c_void_p] 15401isl.isl_space_range_map_pw_multi_aff.restype = c_void_p 15402isl.isl_space_range_map_pw_multi_aff.argtypes = [c_void_p] 15403isl.isl_space_range_reverse.restype = c_void_p 15404isl.isl_space_range_reverse.argtypes = [c_void_p] 15405isl.isl_space_get_range_tuple_id.restype = c_void_p 15406isl.isl_space_get_range_tuple_id.argtypes = [c_void_p] 15407isl.isl_space_reverse.restype = c_void_p 15408isl.isl_space_reverse.argtypes = [c_void_p] 15409isl.isl_space_set_domain_tuple_id.restype = c_void_p 15410isl.isl_space_set_domain_tuple_id.argtypes = [c_void_p, c_void_p] 15411isl.isl_space_set_range_tuple_id.restype = c_void_p 15412isl.isl_space_set_range_tuple_id.argtypes = [c_void_p, c_void_p] 15413isl.isl_space_uncurry.restype = c_void_p 15414isl.isl_space_uncurry.argtypes = [c_void_p] 15415isl.isl_space_unit.restype = c_void_p 15416isl.isl_space_unit.argtypes = [Context] 15417isl.isl_space_universe_map.restype = c_void_p 15418isl.isl_space_universe_map.argtypes = [c_void_p] 15419isl.isl_space_universe_set.restype = c_void_p 15420isl.isl_space_universe_set.argtypes = [c_void_p] 15421isl.isl_space_unwrap.restype = c_void_p 15422isl.isl_space_unwrap.argtypes = [c_void_p] 15423isl.isl_space_wrap.restype = c_void_p 15424isl.isl_space_wrap.argtypes = [c_void_p] 15425isl.isl_space_zero_aff_on_domain.restype = c_void_p 15426isl.isl_space_zero_aff_on_domain.argtypes = [c_void_p] 15427isl.isl_space_zero_multi_aff.restype = c_void_p 15428isl.isl_space_zero_multi_aff.argtypes = [c_void_p] 15429isl.isl_space_zero_multi_pw_aff.restype = c_void_p 15430isl.isl_space_zero_multi_pw_aff.argtypes = [c_void_p] 15431isl.isl_space_zero_multi_union_pw_aff.restype = c_void_p 15432isl.isl_space_zero_multi_union_pw_aff.argtypes = [c_void_p] 15433isl.isl_space_zero_multi_val.restype = c_void_p 15434isl.isl_space_zero_multi_val.argtypes = [c_void_p] 15435isl.isl_space_copy.restype = c_void_p 15436isl.isl_space_copy.argtypes = [c_void_p] 15437isl.isl_space_free.restype = c_void_p 15438isl.isl_space_free.argtypes = [c_void_p] 15439isl.isl_space_to_str.restype = POINTER(c_char) 15440isl.isl_space_to_str.argtypes = [c_void_p] 15441 15442class union_access_info(object): 15443 def __init__(self, *args, **keywords): 15444 if "ptr" in keywords: 15445 self.ctx = keywords["ctx"] 15446 self.ptr = keywords["ptr"] 15447 return 15448 if len(args) == 1 and args[0].__class__ is union_map: 15449 self.ctx = Context.getDefaultInstance() 15450 self.ptr = isl.isl_union_access_info_from_sink(isl.isl_union_map_copy(args[0].ptr)) 15451 return 15452 raise Error 15453 def __del__(self): 15454 if hasattr(self, 'ptr'): 15455 isl.isl_union_access_info_free(self.ptr) 15456 def __str__(arg0): 15457 try: 15458 if not arg0.__class__ is union_access_info: 15459 arg0 = union_access_info(arg0) 15460 except: 15461 raise 15462 ptr = isl.isl_union_access_info_to_str(arg0.ptr) 15463 res = cast(ptr, c_char_p).value.decode('ascii') 15464 libc.free(ptr) 15465 return res 15466 def __repr__(self): 15467 s = str(self) 15468 if '"' in s: 15469 return 'isl.union_access_info("""%s""")' % s 15470 else: 15471 return 'isl.union_access_info("%s")' % s 15472 def compute_flow(arg0): 15473 try: 15474 if not arg0.__class__ is union_access_info: 15475 arg0 = union_access_info(arg0) 15476 except: 15477 raise 15478 ctx = arg0.ctx 15479 res = isl.isl_union_access_info_compute_flow(isl.isl_union_access_info_copy(arg0.ptr)) 15480 obj = union_flow(ctx=ctx, ptr=res) 15481 return obj 15482 def set_kill(arg0, arg1): 15483 try: 15484 if not arg0.__class__ is union_access_info: 15485 arg0 = union_access_info(arg0) 15486 except: 15487 raise 15488 try: 15489 if not arg1.__class__ is union_map: 15490 arg1 = union_map(arg1) 15491 except: 15492 raise 15493 ctx = arg0.ctx 15494 res = isl.isl_union_access_info_set_kill(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15495 obj = union_access_info(ctx=ctx, ptr=res) 15496 return obj 15497 def set_may_source(arg0, arg1): 15498 try: 15499 if not arg0.__class__ is union_access_info: 15500 arg0 = union_access_info(arg0) 15501 except: 15502 raise 15503 try: 15504 if not arg1.__class__ is union_map: 15505 arg1 = union_map(arg1) 15506 except: 15507 raise 15508 ctx = arg0.ctx 15509 res = isl.isl_union_access_info_set_may_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15510 obj = union_access_info(ctx=ctx, ptr=res) 15511 return obj 15512 def set_must_source(arg0, arg1): 15513 try: 15514 if not arg0.__class__ is union_access_info: 15515 arg0 = union_access_info(arg0) 15516 except: 15517 raise 15518 try: 15519 if not arg1.__class__ is union_map: 15520 arg1 = union_map(arg1) 15521 except: 15522 raise 15523 ctx = arg0.ctx 15524 res = isl.isl_union_access_info_set_must_source(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15525 obj = union_access_info(ctx=ctx, ptr=res) 15526 return obj 15527 def set_schedule(arg0, arg1): 15528 try: 15529 if not arg0.__class__ is union_access_info: 15530 arg0 = union_access_info(arg0) 15531 except: 15532 raise 15533 try: 15534 if not arg1.__class__ is schedule: 15535 arg1 = schedule(arg1) 15536 except: 15537 raise 15538 ctx = arg0.ctx 15539 res = isl.isl_union_access_info_set_schedule(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_schedule_copy(arg1.ptr)) 15540 obj = union_access_info(ctx=ctx, ptr=res) 15541 return obj 15542 def set_schedule_map(arg0, arg1): 15543 try: 15544 if not arg0.__class__ is union_access_info: 15545 arg0 = union_access_info(arg0) 15546 except: 15547 raise 15548 try: 15549 if not arg1.__class__ is union_map: 15550 arg1 = union_map(arg1) 15551 except: 15552 raise 15553 ctx = arg0.ctx 15554 res = isl.isl_union_access_info_set_schedule_map(isl.isl_union_access_info_copy(arg0.ptr), isl.isl_union_map_copy(arg1.ptr)) 15555 obj = union_access_info(ctx=ctx, ptr=res) 15556 return obj 15557 15558isl.isl_union_access_info_from_sink.restype = c_void_p 15559isl.isl_union_access_info_from_sink.argtypes = [c_void_p] 15560isl.isl_union_access_info_compute_flow.restype = c_void_p 15561isl.isl_union_access_info_compute_flow.argtypes = [c_void_p] 15562isl.isl_union_access_info_set_kill.restype = c_void_p 15563isl.isl_union_access_info_set_kill.argtypes = [c_void_p, c_void_p] 15564isl.isl_union_access_info_set_may_source.restype = c_void_p 15565isl.isl_union_access_info_set_may_source.argtypes = [c_void_p, c_void_p] 15566isl.isl_union_access_info_set_must_source.restype = c_void_p 15567isl.isl_union_access_info_set_must_source.argtypes = [c_void_p, c_void_p] 15568isl.isl_union_access_info_set_schedule.restype = c_void_p 15569isl.isl_union_access_info_set_schedule.argtypes = [c_void_p, c_void_p] 15570isl.isl_union_access_info_set_schedule_map.restype = c_void_p 15571isl.isl_union_access_info_set_schedule_map.argtypes = [c_void_p, c_void_p] 15572isl.isl_union_access_info_copy.restype = c_void_p 15573isl.isl_union_access_info_copy.argtypes = [c_void_p] 15574isl.isl_union_access_info_free.restype = c_void_p 15575isl.isl_union_access_info_free.argtypes = [c_void_p] 15576isl.isl_union_access_info_to_str.restype = POINTER(c_char) 15577isl.isl_union_access_info_to_str.argtypes = [c_void_p] 15578 15579class union_flow(object): 15580 def __init__(self, *args, **keywords): 15581 if "ptr" in keywords: 15582 self.ctx = keywords["ctx"] 15583 self.ptr = keywords["ptr"] 15584 return 15585 raise Error 15586 def __del__(self): 15587 if hasattr(self, 'ptr'): 15588 isl.isl_union_flow_free(self.ptr) 15589 def __str__(arg0): 15590 try: 15591 if not arg0.__class__ is union_flow: 15592 arg0 = union_flow(arg0) 15593 except: 15594 raise 15595 ptr = isl.isl_union_flow_to_str(arg0.ptr) 15596 res = cast(ptr, c_char_p).value.decode('ascii') 15597 libc.free(ptr) 15598 return res 15599 def __repr__(self): 15600 s = str(self) 15601 if '"' in s: 15602 return 'isl.union_flow("""%s""")' % s 15603 else: 15604 return 'isl.union_flow("%s")' % s 15605 def full_may_dependence(arg0): 15606 try: 15607 if not arg0.__class__ is union_flow: 15608 arg0 = union_flow(arg0) 15609 except: 15610 raise 15611 ctx = arg0.ctx 15612 res = isl.isl_union_flow_get_full_may_dependence(arg0.ptr) 15613 obj = union_map(ctx=ctx, ptr=res) 15614 return obj 15615 def get_full_may_dependence(arg0): 15616 return arg0.full_may_dependence() 15617 def full_must_dependence(arg0): 15618 try: 15619 if not arg0.__class__ is union_flow: 15620 arg0 = union_flow(arg0) 15621 except: 15622 raise 15623 ctx = arg0.ctx 15624 res = isl.isl_union_flow_get_full_must_dependence(arg0.ptr) 15625 obj = union_map(ctx=ctx, ptr=res) 15626 return obj 15627 def get_full_must_dependence(arg0): 15628 return arg0.full_must_dependence() 15629 def may_dependence(arg0): 15630 try: 15631 if not arg0.__class__ is union_flow: 15632 arg0 = union_flow(arg0) 15633 except: 15634 raise 15635 ctx = arg0.ctx 15636 res = isl.isl_union_flow_get_may_dependence(arg0.ptr) 15637 obj = union_map(ctx=ctx, ptr=res) 15638 return obj 15639 def get_may_dependence(arg0): 15640 return arg0.may_dependence() 15641 def may_no_source(arg0): 15642 try: 15643 if not arg0.__class__ is union_flow: 15644 arg0 = union_flow(arg0) 15645 except: 15646 raise 15647 ctx = arg0.ctx 15648 res = isl.isl_union_flow_get_may_no_source(arg0.ptr) 15649 obj = union_map(ctx=ctx, ptr=res) 15650 return obj 15651 def get_may_no_source(arg0): 15652 return arg0.may_no_source() 15653 def must_dependence(arg0): 15654 try: 15655 if not arg0.__class__ is union_flow: 15656 arg0 = union_flow(arg0) 15657 except: 15658 raise 15659 ctx = arg0.ctx 15660 res = isl.isl_union_flow_get_must_dependence(arg0.ptr) 15661 obj = union_map(ctx=ctx, ptr=res) 15662 return obj 15663 def get_must_dependence(arg0): 15664 return arg0.must_dependence() 15665 def must_no_source(arg0): 15666 try: 15667 if not arg0.__class__ is union_flow: 15668 arg0 = union_flow(arg0) 15669 except: 15670 raise 15671 ctx = arg0.ctx 15672 res = isl.isl_union_flow_get_must_no_source(arg0.ptr) 15673 obj = union_map(ctx=ctx, ptr=res) 15674 return obj 15675 def get_must_no_source(arg0): 15676 return arg0.must_no_source() 15677 15678isl.isl_union_flow_get_full_may_dependence.restype = c_void_p 15679isl.isl_union_flow_get_full_may_dependence.argtypes = [c_void_p] 15680isl.isl_union_flow_get_full_must_dependence.restype = c_void_p 15681isl.isl_union_flow_get_full_must_dependence.argtypes = [c_void_p] 15682isl.isl_union_flow_get_may_dependence.restype = c_void_p 15683isl.isl_union_flow_get_may_dependence.argtypes = [c_void_p] 15684isl.isl_union_flow_get_may_no_source.restype = c_void_p 15685isl.isl_union_flow_get_may_no_source.argtypes = [c_void_p] 15686isl.isl_union_flow_get_must_dependence.restype = c_void_p 15687isl.isl_union_flow_get_must_dependence.argtypes = [c_void_p] 15688isl.isl_union_flow_get_must_no_source.restype = c_void_p 15689isl.isl_union_flow_get_must_no_source.argtypes = [c_void_p] 15690isl.isl_union_flow_copy.restype = c_void_p 15691isl.isl_union_flow_copy.argtypes = [c_void_p] 15692isl.isl_union_flow_free.restype = c_void_p 15693isl.isl_union_flow_free.argtypes = [c_void_p] 15694isl.isl_union_flow_to_str.restype = POINTER(c_char) 15695isl.isl_union_flow_to_str.argtypes = [c_void_p] 15696 15697class union_pw_aff_list(object): 15698 def __init__(self, *args, **keywords): 15699 if "ptr" in keywords: 15700 self.ctx = keywords["ctx"] 15701 self.ptr = keywords["ptr"] 15702 return 15703 if len(args) == 1 and type(args[0]) == int: 15704 self.ctx = Context.getDefaultInstance() 15705 self.ptr = isl.isl_union_pw_aff_list_alloc(self.ctx, args[0]) 15706 return 15707 if len(args) == 1 and args[0].__class__ is union_pw_aff: 15708 self.ctx = Context.getDefaultInstance() 15709 self.ptr = isl.isl_union_pw_aff_list_from_union_pw_aff(isl.isl_union_pw_aff_copy(args[0].ptr)) 15710 return 15711 if len(args) == 1 and type(args[0]) == str: 15712 self.ctx = Context.getDefaultInstance() 15713 self.ptr = isl.isl_union_pw_aff_list_read_from_str(self.ctx, args[0].encode('ascii')) 15714 return 15715 raise Error 15716 def __del__(self): 15717 if hasattr(self, 'ptr'): 15718 isl.isl_union_pw_aff_list_free(self.ptr) 15719 def __str__(arg0): 15720 try: 15721 if not arg0.__class__ is union_pw_aff_list: 15722 arg0 = union_pw_aff_list(arg0) 15723 except: 15724 raise 15725 ptr = isl.isl_union_pw_aff_list_to_str(arg0.ptr) 15726 res = cast(ptr, c_char_p).value.decode('ascii') 15727 libc.free(ptr) 15728 return res 15729 def __repr__(self): 15730 s = str(self) 15731 if '"' in s: 15732 return 'isl.union_pw_aff_list("""%s""")' % s 15733 else: 15734 return 'isl.union_pw_aff_list("%s")' % s 15735 def add(arg0, arg1): 15736 try: 15737 if not arg0.__class__ is union_pw_aff_list: 15738 arg0 = union_pw_aff_list(arg0) 15739 except: 15740 raise 15741 try: 15742 if not arg1.__class__ is union_pw_aff: 15743 arg1 = union_pw_aff(arg1) 15744 except: 15745 raise 15746 ctx = arg0.ctx 15747 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)) 15748 obj = union_pw_aff_list(ctx=ctx, ptr=res) 15749 return obj 15750 def at(arg0, arg1): 15751 try: 15752 if not arg0.__class__ is union_pw_aff_list: 15753 arg0 = union_pw_aff_list(arg0) 15754 except: 15755 raise 15756 ctx = arg0.ctx 15757 res = isl.isl_union_pw_aff_list_get_at(arg0.ptr, arg1) 15758 obj = union_pw_aff(ctx=ctx, ptr=res) 15759 return obj 15760 def get_at(arg0, arg1): 15761 return arg0.at(arg1) 15762 def clear(arg0): 15763 try: 15764 if not arg0.__class__ is union_pw_aff_list: 15765 arg0 = union_pw_aff_list(arg0) 15766 except: 15767 raise 15768 ctx = arg0.ctx 15769 res = isl.isl_union_pw_aff_list_clear(isl.isl_union_pw_aff_list_copy(arg0.ptr)) 15770 obj = union_pw_aff_list(ctx=ctx, ptr=res) 15771 return obj 15772 def concat(arg0, arg1): 15773 try: 15774 if not arg0.__class__ is union_pw_aff_list: 15775 arg0 = union_pw_aff_list(arg0) 15776 except: 15777 raise 15778 try: 15779 if not arg1.__class__ is union_pw_aff_list: 15780 arg1 = union_pw_aff_list(arg1) 15781 except: 15782 raise 15783 ctx = arg0.ctx 15784 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)) 15785 obj = union_pw_aff_list(ctx=ctx, ptr=res) 15786 return obj 15787 def drop(arg0, arg1, arg2): 15788 try: 15789 if not arg0.__class__ is union_pw_aff_list: 15790 arg0 = union_pw_aff_list(arg0) 15791 except: 15792 raise 15793 ctx = arg0.ctx 15794 res = isl.isl_union_pw_aff_list_drop(isl.isl_union_pw_aff_list_copy(arg0.ptr), arg1, arg2) 15795 obj = union_pw_aff_list(ctx=ctx, ptr=res) 15796 return obj 15797 def foreach(arg0, arg1): 15798 try: 15799 if not arg0.__class__ is union_pw_aff_list: 15800 arg0 = union_pw_aff_list(arg0) 15801 except: 15802 raise 15803 exc_info = [None] 15804 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15805 def cb_func(cb_arg0, cb_arg1): 15806 cb_arg0 = union_pw_aff(ctx=arg0.ctx, ptr=(cb_arg0)) 15807 try: 15808 arg1(cb_arg0) 15809 except BaseException as e: 15810 exc_info[0] = e 15811 return -1 15812 return 0 15813 cb = fn(cb_func) 15814 ctx = arg0.ctx 15815 res = isl.isl_union_pw_aff_list_foreach(arg0.ptr, cb, None) 15816 if exc_info[0] is not None: 15817 raise exc_info[0] 15818 if res < 0: 15819 raise 15820 def insert(arg0, arg1, arg2): 15821 try: 15822 if not arg0.__class__ is union_pw_aff_list: 15823 arg0 = union_pw_aff_list(arg0) 15824 except: 15825 raise 15826 try: 15827 if not arg2.__class__ is union_pw_aff: 15828 arg2 = union_pw_aff(arg2) 15829 except: 15830 raise 15831 ctx = arg0.ctx 15832 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)) 15833 obj = union_pw_aff_list(ctx=ctx, ptr=res) 15834 return obj 15835 def size(arg0): 15836 try: 15837 if not arg0.__class__ is union_pw_aff_list: 15838 arg0 = union_pw_aff_list(arg0) 15839 except: 15840 raise 15841 ctx = arg0.ctx 15842 res = isl.isl_union_pw_aff_list_size(arg0.ptr) 15843 if res < 0: 15844 raise 15845 return int(res) 15846 15847isl.isl_union_pw_aff_list_alloc.restype = c_void_p 15848isl.isl_union_pw_aff_list_alloc.argtypes = [Context, c_int] 15849isl.isl_union_pw_aff_list_from_union_pw_aff.restype = c_void_p 15850isl.isl_union_pw_aff_list_from_union_pw_aff.argtypes = [c_void_p] 15851isl.isl_union_pw_aff_list_read_from_str.restype = c_void_p 15852isl.isl_union_pw_aff_list_read_from_str.argtypes = [Context, c_char_p] 15853isl.isl_union_pw_aff_list_add.restype = c_void_p 15854isl.isl_union_pw_aff_list_add.argtypes = [c_void_p, c_void_p] 15855isl.isl_union_pw_aff_list_get_at.restype = c_void_p 15856isl.isl_union_pw_aff_list_get_at.argtypes = [c_void_p, c_int] 15857isl.isl_union_pw_aff_list_clear.restype = c_void_p 15858isl.isl_union_pw_aff_list_clear.argtypes = [c_void_p] 15859isl.isl_union_pw_aff_list_concat.restype = c_void_p 15860isl.isl_union_pw_aff_list_concat.argtypes = [c_void_p, c_void_p] 15861isl.isl_union_pw_aff_list_drop.restype = c_void_p 15862isl.isl_union_pw_aff_list_drop.argtypes = [c_void_p, c_int, c_int] 15863isl.isl_union_pw_aff_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 15864isl.isl_union_pw_aff_list_insert.restype = c_void_p 15865isl.isl_union_pw_aff_list_insert.argtypes = [c_void_p, c_int, c_void_p] 15866isl.isl_union_pw_aff_list_size.argtypes = [c_void_p] 15867isl.isl_union_pw_aff_list_copy.restype = c_void_p 15868isl.isl_union_pw_aff_list_copy.argtypes = [c_void_p] 15869isl.isl_union_pw_aff_list_free.restype = c_void_p 15870isl.isl_union_pw_aff_list_free.argtypes = [c_void_p] 15871isl.isl_union_pw_aff_list_to_str.restype = POINTER(c_char) 15872isl.isl_union_pw_aff_list_to_str.argtypes = [c_void_p] 15873 15874class union_set_list(object): 15875 def __init__(self, *args, **keywords): 15876 if "ptr" in keywords: 15877 self.ctx = keywords["ctx"] 15878 self.ptr = keywords["ptr"] 15879 return 15880 if len(args) == 1 and type(args[0]) == int: 15881 self.ctx = Context.getDefaultInstance() 15882 self.ptr = isl.isl_union_set_list_alloc(self.ctx, args[0]) 15883 return 15884 if len(args) == 1 and args[0].__class__ is union_set: 15885 self.ctx = Context.getDefaultInstance() 15886 self.ptr = isl.isl_union_set_list_from_union_set(isl.isl_union_set_copy(args[0].ptr)) 15887 return 15888 if len(args) == 1 and type(args[0]) == str: 15889 self.ctx = Context.getDefaultInstance() 15890 self.ptr = isl.isl_union_set_list_read_from_str(self.ctx, args[0].encode('ascii')) 15891 return 15892 raise Error 15893 def __del__(self): 15894 if hasattr(self, 'ptr'): 15895 isl.isl_union_set_list_free(self.ptr) 15896 def __str__(arg0): 15897 try: 15898 if not arg0.__class__ is union_set_list: 15899 arg0 = union_set_list(arg0) 15900 except: 15901 raise 15902 ptr = isl.isl_union_set_list_to_str(arg0.ptr) 15903 res = cast(ptr, c_char_p).value.decode('ascii') 15904 libc.free(ptr) 15905 return res 15906 def __repr__(self): 15907 s = str(self) 15908 if '"' in s: 15909 return 'isl.union_set_list("""%s""")' % s 15910 else: 15911 return 'isl.union_set_list("%s")' % s 15912 def add(arg0, arg1): 15913 try: 15914 if not arg0.__class__ is union_set_list: 15915 arg0 = union_set_list(arg0) 15916 except: 15917 raise 15918 try: 15919 if not arg1.__class__ is union_set: 15920 arg1 = union_set(arg1) 15921 except: 15922 raise 15923 ctx = arg0.ctx 15924 res = isl.isl_union_set_list_add(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_copy(arg1.ptr)) 15925 obj = union_set_list(ctx=ctx, ptr=res) 15926 return obj 15927 def at(arg0, arg1): 15928 try: 15929 if not arg0.__class__ is union_set_list: 15930 arg0 = union_set_list(arg0) 15931 except: 15932 raise 15933 ctx = arg0.ctx 15934 res = isl.isl_union_set_list_get_at(arg0.ptr, arg1) 15935 obj = union_set(ctx=ctx, ptr=res) 15936 return obj 15937 def get_at(arg0, arg1): 15938 return arg0.at(arg1) 15939 def clear(arg0): 15940 try: 15941 if not arg0.__class__ is union_set_list: 15942 arg0 = union_set_list(arg0) 15943 except: 15944 raise 15945 ctx = arg0.ctx 15946 res = isl.isl_union_set_list_clear(isl.isl_union_set_list_copy(arg0.ptr)) 15947 obj = union_set_list(ctx=ctx, ptr=res) 15948 return obj 15949 def concat(arg0, arg1): 15950 try: 15951 if not arg0.__class__ is union_set_list: 15952 arg0 = union_set_list(arg0) 15953 except: 15954 raise 15955 try: 15956 if not arg1.__class__ is union_set_list: 15957 arg1 = union_set_list(arg1) 15958 except: 15959 raise 15960 ctx = arg0.ctx 15961 res = isl.isl_union_set_list_concat(isl.isl_union_set_list_copy(arg0.ptr), isl.isl_union_set_list_copy(arg1.ptr)) 15962 obj = union_set_list(ctx=ctx, ptr=res) 15963 return obj 15964 def drop(arg0, arg1, arg2): 15965 try: 15966 if not arg0.__class__ is union_set_list: 15967 arg0 = union_set_list(arg0) 15968 except: 15969 raise 15970 ctx = arg0.ctx 15971 res = isl.isl_union_set_list_drop(isl.isl_union_set_list_copy(arg0.ptr), arg1, arg2) 15972 obj = union_set_list(ctx=ctx, ptr=res) 15973 return obj 15974 def foreach(arg0, arg1): 15975 try: 15976 if not arg0.__class__ is union_set_list: 15977 arg0 = union_set_list(arg0) 15978 except: 15979 raise 15980 exc_info = [None] 15981 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 15982 def cb_func(cb_arg0, cb_arg1): 15983 cb_arg0 = union_set(ctx=arg0.ctx, ptr=(cb_arg0)) 15984 try: 15985 arg1(cb_arg0) 15986 except BaseException as e: 15987 exc_info[0] = e 15988 return -1 15989 return 0 15990 cb = fn(cb_func) 15991 ctx = arg0.ctx 15992 res = isl.isl_union_set_list_foreach(arg0.ptr, cb, None) 15993 if exc_info[0] is not None: 15994 raise exc_info[0] 15995 if res < 0: 15996 raise 15997 def insert(arg0, arg1, arg2): 15998 try: 15999 if not arg0.__class__ is union_set_list: 16000 arg0 = union_set_list(arg0) 16001 except: 16002 raise 16003 try: 16004 if not arg2.__class__ is union_set: 16005 arg2 = union_set(arg2) 16006 except: 16007 raise 16008 ctx = arg0.ctx 16009 res = isl.isl_union_set_list_insert(isl.isl_union_set_list_copy(arg0.ptr), arg1, isl.isl_union_set_copy(arg2.ptr)) 16010 obj = union_set_list(ctx=ctx, ptr=res) 16011 return obj 16012 def size(arg0): 16013 try: 16014 if not arg0.__class__ is union_set_list: 16015 arg0 = union_set_list(arg0) 16016 except: 16017 raise 16018 ctx = arg0.ctx 16019 res = isl.isl_union_set_list_size(arg0.ptr) 16020 if res < 0: 16021 raise 16022 return int(res) 16023 16024isl.isl_union_set_list_alloc.restype = c_void_p 16025isl.isl_union_set_list_alloc.argtypes = [Context, c_int] 16026isl.isl_union_set_list_from_union_set.restype = c_void_p 16027isl.isl_union_set_list_from_union_set.argtypes = [c_void_p] 16028isl.isl_union_set_list_read_from_str.restype = c_void_p 16029isl.isl_union_set_list_read_from_str.argtypes = [Context, c_char_p] 16030isl.isl_union_set_list_add.restype = c_void_p 16031isl.isl_union_set_list_add.argtypes = [c_void_p, c_void_p] 16032isl.isl_union_set_list_get_at.restype = c_void_p 16033isl.isl_union_set_list_get_at.argtypes = [c_void_p, c_int] 16034isl.isl_union_set_list_clear.restype = c_void_p 16035isl.isl_union_set_list_clear.argtypes = [c_void_p] 16036isl.isl_union_set_list_concat.restype = c_void_p 16037isl.isl_union_set_list_concat.argtypes = [c_void_p, c_void_p] 16038isl.isl_union_set_list_drop.restype = c_void_p 16039isl.isl_union_set_list_drop.argtypes = [c_void_p, c_int, c_int] 16040isl.isl_union_set_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 16041isl.isl_union_set_list_insert.restype = c_void_p 16042isl.isl_union_set_list_insert.argtypes = [c_void_p, c_int, c_void_p] 16043isl.isl_union_set_list_size.argtypes = [c_void_p] 16044isl.isl_union_set_list_copy.restype = c_void_p 16045isl.isl_union_set_list_copy.argtypes = [c_void_p] 16046isl.isl_union_set_list_free.restype = c_void_p 16047isl.isl_union_set_list_free.argtypes = [c_void_p] 16048isl.isl_union_set_list_to_str.restype = POINTER(c_char) 16049isl.isl_union_set_list_to_str.argtypes = [c_void_p] 16050 16051class val(object): 16052 def __init__(self, *args, **keywords): 16053 if "ptr" in keywords: 16054 self.ctx = keywords["ctx"] 16055 self.ptr = keywords["ptr"] 16056 return 16057 if len(args) == 1 and type(args[0]) == int: 16058 self.ctx = Context.getDefaultInstance() 16059 self.ptr = isl.isl_val_int_from_si(self.ctx, args[0]) 16060 return 16061 if len(args) == 1 and type(args[0]) == str: 16062 self.ctx = Context.getDefaultInstance() 16063 self.ptr = isl.isl_val_read_from_str(self.ctx, args[0].encode('ascii')) 16064 return 16065 raise Error 16066 def __del__(self): 16067 if hasattr(self, 'ptr'): 16068 isl.isl_val_free(self.ptr) 16069 def __str__(arg0): 16070 try: 16071 if not arg0.__class__ is val: 16072 arg0 = val(arg0) 16073 except: 16074 raise 16075 ptr = isl.isl_val_to_str(arg0.ptr) 16076 res = cast(ptr, c_char_p).value.decode('ascii') 16077 libc.free(ptr) 16078 return res 16079 def __repr__(self): 16080 s = str(self) 16081 if '"' in s: 16082 return 'isl.val("""%s""")' % s 16083 else: 16084 return 'isl.val("%s")' % s 16085 def abs(arg0): 16086 try: 16087 if not arg0.__class__ is val: 16088 arg0 = val(arg0) 16089 except: 16090 raise 16091 ctx = arg0.ctx 16092 res = isl.isl_val_abs(isl.isl_val_copy(arg0.ptr)) 16093 obj = val(ctx=ctx, ptr=res) 16094 return obj 16095 def abs_eq(arg0, arg1): 16096 try: 16097 if not arg0.__class__ is val: 16098 arg0 = val(arg0) 16099 except: 16100 raise 16101 try: 16102 if not arg1.__class__ is val: 16103 arg1 = val(arg1) 16104 except: 16105 raise 16106 ctx = arg0.ctx 16107 res = isl.isl_val_abs_eq(arg0.ptr, arg1.ptr) 16108 if res < 0: 16109 raise 16110 return bool(res) 16111 def add(arg0, arg1): 16112 try: 16113 if not arg0.__class__ is val: 16114 arg0 = val(arg0) 16115 except: 16116 raise 16117 try: 16118 if not arg1.__class__ is val: 16119 arg1 = val(arg1) 16120 except: 16121 raise 16122 ctx = arg0.ctx 16123 res = isl.isl_val_add(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16124 obj = val(ctx=ctx, ptr=res) 16125 return obj 16126 def ceil(arg0): 16127 try: 16128 if not arg0.__class__ is val: 16129 arg0 = val(arg0) 16130 except: 16131 raise 16132 ctx = arg0.ctx 16133 res = isl.isl_val_ceil(isl.isl_val_copy(arg0.ptr)) 16134 obj = val(ctx=ctx, ptr=res) 16135 return obj 16136 def cmp_si(arg0, arg1): 16137 try: 16138 if not arg0.__class__ is val: 16139 arg0 = val(arg0) 16140 except: 16141 raise 16142 ctx = arg0.ctx 16143 res = isl.isl_val_cmp_si(arg0.ptr, arg1) 16144 return res 16145 def den_si(arg0): 16146 try: 16147 if not arg0.__class__ is val: 16148 arg0 = val(arg0) 16149 except: 16150 raise 16151 ctx = arg0.ctx 16152 res = isl.isl_val_get_den_si(arg0.ptr) 16153 return res 16154 def get_den_si(arg0): 16155 return arg0.den_si() 16156 def div(arg0, arg1): 16157 try: 16158 if not arg0.__class__ is val: 16159 arg0 = val(arg0) 16160 except: 16161 raise 16162 try: 16163 if not arg1.__class__ is val: 16164 arg1 = val(arg1) 16165 except: 16166 raise 16167 ctx = arg0.ctx 16168 res = isl.isl_val_div(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16169 obj = val(ctx=ctx, ptr=res) 16170 return obj 16171 def eq(arg0, arg1): 16172 try: 16173 if not arg0.__class__ is val: 16174 arg0 = val(arg0) 16175 except: 16176 raise 16177 try: 16178 if not arg1.__class__ is val: 16179 arg1 = val(arg1) 16180 except: 16181 raise 16182 ctx = arg0.ctx 16183 res = isl.isl_val_eq(arg0.ptr, arg1.ptr) 16184 if res < 0: 16185 raise 16186 return bool(res) 16187 def floor(arg0): 16188 try: 16189 if not arg0.__class__ is val: 16190 arg0 = val(arg0) 16191 except: 16192 raise 16193 ctx = arg0.ctx 16194 res = isl.isl_val_floor(isl.isl_val_copy(arg0.ptr)) 16195 obj = val(ctx=ctx, ptr=res) 16196 return obj 16197 def gcd(arg0, arg1): 16198 try: 16199 if not arg0.__class__ is val: 16200 arg0 = val(arg0) 16201 except: 16202 raise 16203 try: 16204 if not arg1.__class__ is val: 16205 arg1 = val(arg1) 16206 except: 16207 raise 16208 ctx = arg0.ctx 16209 res = isl.isl_val_gcd(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16210 obj = val(ctx=ctx, ptr=res) 16211 return obj 16212 def ge(arg0, arg1): 16213 try: 16214 if not arg0.__class__ is val: 16215 arg0 = val(arg0) 16216 except: 16217 raise 16218 try: 16219 if not arg1.__class__ is val: 16220 arg1 = val(arg1) 16221 except: 16222 raise 16223 ctx = arg0.ctx 16224 res = isl.isl_val_ge(arg0.ptr, arg1.ptr) 16225 if res < 0: 16226 raise 16227 return bool(res) 16228 def gt(arg0, arg1): 16229 try: 16230 if not arg0.__class__ is val: 16231 arg0 = val(arg0) 16232 except: 16233 raise 16234 try: 16235 if not arg1.__class__ is val: 16236 arg1 = val(arg1) 16237 except: 16238 raise 16239 ctx = arg0.ctx 16240 res = isl.isl_val_gt(arg0.ptr, arg1.ptr) 16241 if res < 0: 16242 raise 16243 return bool(res) 16244 @staticmethod 16245 def infty(): 16246 ctx = Context.getDefaultInstance() 16247 res = isl.isl_val_infty(ctx) 16248 obj = val(ctx=ctx, ptr=res) 16249 return obj 16250 def inv(arg0): 16251 try: 16252 if not arg0.__class__ is val: 16253 arg0 = val(arg0) 16254 except: 16255 raise 16256 ctx = arg0.ctx 16257 res = isl.isl_val_inv(isl.isl_val_copy(arg0.ptr)) 16258 obj = val(ctx=ctx, ptr=res) 16259 return obj 16260 def is_divisible_by(arg0, arg1): 16261 try: 16262 if not arg0.__class__ is val: 16263 arg0 = val(arg0) 16264 except: 16265 raise 16266 try: 16267 if not arg1.__class__ is val: 16268 arg1 = val(arg1) 16269 except: 16270 raise 16271 ctx = arg0.ctx 16272 res = isl.isl_val_is_divisible_by(arg0.ptr, arg1.ptr) 16273 if res < 0: 16274 raise 16275 return bool(res) 16276 def is_infty(arg0): 16277 try: 16278 if not arg0.__class__ is val: 16279 arg0 = val(arg0) 16280 except: 16281 raise 16282 ctx = arg0.ctx 16283 res = isl.isl_val_is_infty(arg0.ptr) 16284 if res < 0: 16285 raise 16286 return bool(res) 16287 def is_int(arg0): 16288 try: 16289 if not arg0.__class__ is val: 16290 arg0 = val(arg0) 16291 except: 16292 raise 16293 ctx = arg0.ctx 16294 res = isl.isl_val_is_int(arg0.ptr) 16295 if res < 0: 16296 raise 16297 return bool(res) 16298 def is_nan(arg0): 16299 try: 16300 if not arg0.__class__ is val: 16301 arg0 = val(arg0) 16302 except: 16303 raise 16304 ctx = arg0.ctx 16305 res = isl.isl_val_is_nan(arg0.ptr) 16306 if res < 0: 16307 raise 16308 return bool(res) 16309 def is_neg(arg0): 16310 try: 16311 if not arg0.__class__ is val: 16312 arg0 = val(arg0) 16313 except: 16314 raise 16315 ctx = arg0.ctx 16316 res = isl.isl_val_is_neg(arg0.ptr) 16317 if res < 0: 16318 raise 16319 return bool(res) 16320 def is_neginfty(arg0): 16321 try: 16322 if not arg0.__class__ is val: 16323 arg0 = val(arg0) 16324 except: 16325 raise 16326 ctx = arg0.ctx 16327 res = isl.isl_val_is_neginfty(arg0.ptr) 16328 if res < 0: 16329 raise 16330 return bool(res) 16331 def is_negone(arg0): 16332 try: 16333 if not arg0.__class__ is val: 16334 arg0 = val(arg0) 16335 except: 16336 raise 16337 ctx = arg0.ctx 16338 res = isl.isl_val_is_negone(arg0.ptr) 16339 if res < 0: 16340 raise 16341 return bool(res) 16342 def is_nonneg(arg0): 16343 try: 16344 if not arg0.__class__ is val: 16345 arg0 = val(arg0) 16346 except: 16347 raise 16348 ctx = arg0.ctx 16349 res = isl.isl_val_is_nonneg(arg0.ptr) 16350 if res < 0: 16351 raise 16352 return bool(res) 16353 def is_nonpos(arg0): 16354 try: 16355 if not arg0.__class__ is val: 16356 arg0 = val(arg0) 16357 except: 16358 raise 16359 ctx = arg0.ctx 16360 res = isl.isl_val_is_nonpos(arg0.ptr) 16361 if res < 0: 16362 raise 16363 return bool(res) 16364 def is_one(arg0): 16365 try: 16366 if not arg0.__class__ is val: 16367 arg0 = val(arg0) 16368 except: 16369 raise 16370 ctx = arg0.ctx 16371 res = isl.isl_val_is_one(arg0.ptr) 16372 if res < 0: 16373 raise 16374 return bool(res) 16375 def is_pos(arg0): 16376 try: 16377 if not arg0.__class__ is val: 16378 arg0 = val(arg0) 16379 except: 16380 raise 16381 ctx = arg0.ctx 16382 res = isl.isl_val_is_pos(arg0.ptr) 16383 if res < 0: 16384 raise 16385 return bool(res) 16386 def is_rat(arg0): 16387 try: 16388 if not arg0.__class__ is val: 16389 arg0 = val(arg0) 16390 except: 16391 raise 16392 ctx = arg0.ctx 16393 res = isl.isl_val_is_rat(arg0.ptr) 16394 if res < 0: 16395 raise 16396 return bool(res) 16397 def is_zero(arg0): 16398 try: 16399 if not arg0.__class__ is val: 16400 arg0 = val(arg0) 16401 except: 16402 raise 16403 ctx = arg0.ctx 16404 res = isl.isl_val_is_zero(arg0.ptr) 16405 if res < 0: 16406 raise 16407 return bool(res) 16408 def le(arg0, arg1): 16409 try: 16410 if not arg0.__class__ is val: 16411 arg0 = val(arg0) 16412 except: 16413 raise 16414 try: 16415 if not arg1.__class__ is val: 16416 arg1 = val(arg1) 16417 except: 16418 raise 16419 ctx = arg0.ctx 16420 res = isl.isl_val_le(arg0.ptr, arg1.ptr) 16421 if res < 0: 16422 raise 16423 return bool(res) 16424 def lt(arg0, arg1): 16425 try: 16426 if not arg0.__class__ is val: 16427 arg0 = val(arg0) 16428 except: 16429 raise 16430 try: 16431 if not arg1.__class__ is val: 16432 arg1 = val(arg1) 16433 except: 16434 raise 16435 ctx = arg0.ctx 16436 res = isl.isl_val_lt(arg0.ptr, arg1.ptr) 16437 if res < 0: 16438 raise 16439 return bool(res) 16440 def max(arg0, arg1): 16441 try: 16442 if not arg0.__class__ is val: 16443 arg0 = val(arg0) 16444 except: 16445 raise 16446 try: 16447 if not arg1.__class__ is val: 16448 arg1 = val(arg1) 16449 except: 16450 raise 16451 ctx = arg0.ctx 16452 res = isl.isl_val_max(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16453 obj = val(ctx=ctx, ptr=res) 16454 return obj 16455 def min(arg0, arg1): 16456 try: 16457 if not arg0.__class__ is val: 16458 arg0 = val(arg0) 16459 except: 16460 raise 16461 try: 16462 if not arg1.__class__ is val: 16463 arg1 = val(arg1) 16464 except: 16465 raise 16466 ctx = arg0.ctx 16467 res = isl.isl_val_min(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16468 obj = val(ctx=ctx, ptr=res) 16469 return obj 16470 def mod(arg0, arg1): 16471 try: 16472 if not arg0.__class__ is val: 16473 arg0 = val(arg0) 16474 except: 16475 raise 16476 try: 16477 if not arg1.__class__ is val: 16478 arg1 = val(arg1) 16479 except: 16480 raise 16481 ctx = arg0.ctx 16482 res = isl.isl_val_mod(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16483 obj = val(ctx=ctx, ptr=res) 16484 return obj 16485 def mul(arg0, arg1): 16486 try: 16487 if not arg0.__class__ is val: 16488 arg0 = val(arg0) 16489 except: 16490 raise 16491 try: 16492 if not arg1.__class__ is val: 16493 arg1 = val(arg1) 16494 except: 16495 raise 16496 ctx = arg0.ctx 16497 res = isl.isl_val_mul(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16498 obj = val(ctx=ctx, ptr=res) 16499 return obj 16500 @staticmethod 16501 def nan(): 16502 ctx = Context.getDefaultInstance() 16503 res = isl.isl_val_nan(ctx) 16504 obj = val(ctx=ctx, ptr=res) 16505 return obj 16506 def ne(arg0, arg1): 16507 try: 16508 if not arg0.__class__ is val: 16509 arg0 = val(arg0) 16510 except: 16511 raise 16512 try: 16513 if not arg1.__class__ is val: 16514 arg1 = val(arg1) 16515 except: 16516 raise 16517 ctx = arg0.ctx 16518 res = isl.isl_val_ne(arg0.ptr, arg1.ptr) 16519 if res < 0: 16520 raise 16521 return bool(res) 16522 def neg(arg0): 16523 try: 16524 if not arg0.__class__ is val: 16525 arg0 = val(arg0) 16526 except: 16527 raise 16528 ctx = arg0.ctx 16529 res = isl.isl_val_neg(isl.isl_val_copy(arg0.ptr)) 16530 obj = val(ctx=ctx, ptr=res) 16531 return obj 16532 @staticmethod 16533 def neginfty(): 16534 ctx = Context.getDefaultInstance() 16535 res = isl.isl_val_neginfty(ctx) 16536 obj = val(ctx=ctx, ptr=res) 16537 return obj 16538 @staticmethod 16539 def negone(): 16540 ctx = Context.getDefaultInstance() 16541 res = isl.isl_val_negone(ctx) 16542 obj = val(ctx=ctx, ptr=res) 16543 return obj 16544 def num_si(arg0): 16545 try: 16546 if not arg0.__class__ is val: 16547 arg0 = val(arg0) 16548 except: 16549 raise 16550 ctx = arg0.ctx 16551 res = isl.isl_val_get_num_si(arg0.ptr) 16552 return res 16553 def get_num_si(arg0): 16554 return arg0.num_si() 16555 @staticmethod 16556 def one(): 16557 ctx = Context.getDefaultInstance() 16558 res = isl.isl_val_one(ctx) 16559 obj = val(ctx=ctx, ptr=res) 16560 return obj 16561 def pow2(arg0): 16562 try: 16563 if not arg0.__class__ is val: 16564 arg0 = val(arg0) 16565 except: 16566 raise 16567 ctx = arg0.ctx 16568 res = isl.isl_val_pow2(isl.isl_val_copy(arg0.ptr)) 16569 obj = val(ctx=ctx, ptr=res) 16570 return obj 16571 def sgn(arg0): 16572 try: 16573 if not arg0.__class__ is val: 16574 arg0 = val(arg0) 16575 except: 16576 raise 16577 ctx = arg0.ctx 16578 res = isl.isl_val_sgn(arg0.ptr) 16579 return res 16580 def sub(arg0, arg1): 16581 try: 16582 if not arg0.__class__ is val: 16583 arg0 = val(arg0) 16584 except: 16585 raise 16586 try: 16587 if not arg1.__class__ is val: 16588 arg1 = val(arg1) 16589 except: 16590 raise 16591 ctx = arg0.ctx 16592 res = isl.isl_val_sub(isl.isl_val_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16593 obj = val(ctx=ctx, ptr=res) 16594 return obj 16595 def to_list(arg0): 16596 try: 16597 if not arg0.__class__ is val: 16598 arg0 = val(arg0) 16599 except: 16600 raise 16601 ctx = arg0.ctx 16602 res = isl.isl_val_to_list(isl.isl_val_copy(arg0.ptr)) 16603 obj = val_list(ctx=ctx, ptr=res) 16604 return obj 16605 def trunc(arg0): 16606 try: 16607 if not arg0.__class__ is val: 16608 arg0 = val(arg0) 16609 except: 16610 raise 16611 ctx = arg0.ctx 16612 res = isl.isl_val_trunc(isl.isl_val_copy(arg0.ptr)) 16613 obj = val(ctx=ctx, ptr=res) 16614 return obj 16615 @staticmethod 16616 def zero(): 16617 ctx = Context.getDefaultInstance() 16618 res = isl.isl_val_zero(ctx) 16619 obj = val(ctx=ctx, ptr=res) 16620 return obj 16621 16622isl.isl_val_int_from_si.restype = c_void_p 16623isl.isl_val_int_from_si.argtypes = [Context, c_long] 16624isl.isl_val_read_from_str.restype = c_void_p 16625isl.isl_val_read_from_str.argtypes = [Context, c_char_p] 16626isl.isl_val_abs.restype = c_void_p 16627isl.isl_val_abs.argtypes = [c_void_p] 16628isl.isl_val_abs_eq.argtypes = [c_void_p, c_void_p] 16629isl.isl_val_add.restype = c_void_p 16630isl.isl_val_add.argtypes = [c_void_p, c_void_p] 16631isl.isl_val_ceil.restype = c_void_p 16632isl.isl_val_ceil.argtypes = [c_void_p] 16633isl.isl_val_cmp_si.argtypes = [c_void_p, c_long] 16634isl.isl_val_get_den_si.argtypes = [c_void_p] 16635isl.isl_val_div.restype = c_void_p 16636isl.isl_val_div.argtypes = [c_void_p, c_void_p] 16637isl.isl_val_eq.argtypes = [c_void_p, c_void_p] 16638isl.isl_val_floor.restype = c_void_p 16639isl.isl_val_floor.argtypes = [c_void_p] 16640isl.isl_val_gcd.restype = c_void_p 16641isl.isl_val_gcd.argtypes = [c_void_p, c_void_p] 16642isl.isl_val_ge.argtypes = [c_void_p, c_void_p] 16643isl.isl_val_gt.argtypes = [c_void_p, c_void_p] 16644isl.isl_val_infty.restype = c_void_p 16645isl.isl_val_infty.argtypes = [Context] 16646isl.isl_val_inv.restype = c_void_p 16647isl.isl_val_inv.argtypes = [c_void_p] 16648isl.isl_val_is_divisible_by.argtypes = [c_void_p, c_void_p] 16649isl.isl_val_is_infty.argtypes = [c_void_p] 16650isl.isl_val_is_int.argtypes = [c_void_p] 16651isl.isl_val_is_nan.argtypes = [c_void_p] 16652isl.isl_val_is_neg.argtypes = [c_void_p] 16653isl.isl_val_is_neginfty.argtypes = [c_void_p] 16654isl.isl_val_is_negone.argtypes = [c_void_p] 16655isl.isl_val_is_nonneg.argtypes = [c_void_p] 16656isl.isl_val_is_nonpos.argtypes = [c_void_p] 16657isl.isl_val_is_one.argtypes = [c_void_p] 16658isl.isl_val_is_pos.argtypes = [c_void_p] 16659isl.isl_val_is_rat.argtypes = [c_void_p] 16660isl.isl_val_is_zero.argtypes = [c_void_p] 16661isl.isl_val_le.argtypes = [c_void_p, c_void_p] 16662isl.isl_val_lt.argtypes = [c_void_p, c_void_p] 16663isl.isl_val_max.restype = c_void_p 16664isl.isl_val_max.argtypes = [c_void_p, c_void_p] 16665isl.isl_val_min.restype = c_void_p 16666isl.isl_val_min.argtypes = [c_void_p, c_void_p] 16667isl.isl_val_mod.restype = c_void_p 16668isl.isl_val_mod.argtypes = [c_void_p, c_void_p] 16669isl.isl_val_mul.restype = c_void_p 16670isl.isl_val_mul.argtypes = [c_void_p, c_void_p] 16671isl.isl_val_nan.restype = c_void_p 16672isl.isl_val_nan.argtypes = [Context] 16673isl.isl_val_ne.argtypes = [c_void_p, c_void_p] 16674isl.isl_val_neg.restype = c_void_p 16675isl.isl_val_neg.argtypes = [c_void_p] 16676isl.isl_val_neginfty.restype = c_void_p 16677isl.isl_val_neginfty.argtypes = [Context] 16678isl.isl_val_negone.restype = c_void_p 16679isl.isl_val_negone.argtypes = [Context] 16680isl.isl_val_get_num_si.argtypes = [c_void_p] 16681isl.isl_val_one.restype = c_void_p 16682isl.isl_val_one.argtypes = [Context] 16683isl.isl_val_pow2.restype = c_void_p 16684isl.isl_val_pow2.argtypes = [c_void_p] 16685isl.isl_val_sgn.argtypes = [c_void_p] 16686isl.isl_val_sub.restype = c_void_p 16687isl.isl_val_sub.argtypes = [c_void_p, c_void_p] 16688isl.isl_val_to_list.restype = c_void_p 16689isl.isl_val_to_list.argtypes = [c_void_p] 16690isl.isl_val_trunc.restype = c_void_p 16691isl.isl_val_trunc.argtypes = [c_void_p] 16692isl.isl_val_zero.restype = c_void_p 16693isl.isl_val_zero.argtypes = [Context] 16694isl.isl_val_copy.restype = c_void_p 16695isl.isl_val_copy.argtypes = [c_void_p] 16696isl.isl_val_free.restype = c_void_p 16697isl.isl_val_free.argtypes = [c_void_p] 16698isl.isl_val_to_str.restype = POINTER(c_char) 16699isl.isl_val_to_str.argtypes = [c_void_p] 16700 16701class val_list(object): 16702 def __init__(self, *args, **keywords): 16703 if "ptr" in keywords: 16704 self.ctx = keywords["ctx"] 16705 self.ptr = keywords["ptr"] 16706 return 16707 if len(args) == 1 and type(args[0]) == int: 16708 self.ctx = Context.getDefaultInstance() 16709 self.ptr = isl.isl_val_list_alloc(self.ctx, args[0]) 16710 return 16711 if len(args) == 1 and (args[0].__class__ is val or type(args[0]) == int): 16712 args = list(args) 16713 try: 16714 if not args[0].__class__ is val: 16715 args[0] = val(args[0]) 16716 except: 16717 raise 16718 self.ctx = Context.getDefaultInstance() 16719 self.ptr = isl.isl_val_list_from_val(isl.isl_val_copy(args[0].ptr)) 16720 return 16721 if len(args) == 1 and type(args[0]) == str: 16722 self.ctx = Context.getDefaultInstance() 16723 self.ptr = isl.isl_val_list_read_from_str(self.ctx, args[0].encode('ascii')) 16724 return 16725 raise Error 16726 def __del__(self): 16727 if hasattr(self, 'ptr'): 16728 isl.isl_val_list_free(self.ptr) 16729 def __str__(arg0): 16730 try: 16731 if not arg0.__class__ is val_list: 16732 arg0 = val_list(arg0) 16733 except: 16734 raise 16735 ptr = isl.isl_val_list_to_str(arg0.ptr) 16736 res = cast(ptr, c_char_p).value.decode('ascii') 16737 libc.free(ptr) 16738 return res 16739 def __repr__(self): 16740 s = str(self) 16741 if '"' in s: 16742 return 'isl.val_list("""%s""")' % s 16743 else: 16744 return 'isl.val_list("%s")' % s 16745 def add(arg0, arg1): 16746 try: 16747 if not arg0.__class__ is val_list: 16748 arg0 = val_list(arg0) 16749 except: 16750 raise 16751 try: 16752 if not arg1.__class__ is val: 16753 arg1 = val(arg1) 16754 except: 16755 raise 16756 ctx = arg0.ctx 16757 res = isl.isl_val_list_add(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_copy(arg1.ptr)) 16758 obj = val_list(ctx=ctx, ptr=res) 16759 return obj 16760 def at(arg0, arg1): 16761 try: 16762 if not arg0.__class__ is val_list: 16763 arg0 = val_list(arg0) 16764 except: 16765 raise 16766 ctx = arg0.ctx 16767 res = isl.isl_val_list_get_at(arg0.ptr, arg1) 16768 obj = val(ctx=ctx, ptr=res) 16769 return obj 16770 def get_at(arg0, arg1): 16771 return arg0.at(arg1) 16772 def clear(arg0): 16773 try: 16774 if not arg0.__class__ is val_list: 16775 arg0 = val_list(arg0) 16776 except: 16777 raise 16778 ctx = arg0.ctx 16779 res = isl.isl_val_list_clear(isl.isl_val_list_copy(arg0.ptr)) 16780 obj = val_list(ctx=ctx, ptr=res) 16781 return obj 16782 def concat(arg0, arg1): 16783 try: 16784 if not arg0.__class__ is val_list: 16785 arg0 = val_list(arg0) 16786 except: 16787 raise 16788 try: 16789 if not arg1.__class__ is val_list: 16790 arg1 = val_list(arg1) 16791 except: 16792 raise 16793 ctx = arg0.ctx 16794 res = isl.isl_val_list_concat(isl.isl_val_list_copy(arg0.ptr), isl.isl_val_list_copy(arg1.ptr)) 16795 obj = val_list(ctx=ctx, ptr=res) 16796 return obj 16797 def drop(arg0, arg1, arg2): 16798 try: 16799 if not arg0.__class__ is val_list: 16800 arg0 = val_list(arg0) 16801 except: 16802 raise 16803 ctx = arg0.ctx 16804 res = isl.isl_val_list_drop(isl.isl_val_list_copy(arg0.ptr), arg1, arg2) 16805 obj = val_list(ctx=ctx, ptr=res) 16806 return obj 16807 def foreach(arg0, arg1): 16808 try: 16809 if not arg0.__class__ is val_list: 16810 arg0 = val_list(arg0) 16811 except: 16812 raise 16813 exc_info = [None] 16814 fn = CFUNCTYPE(c_int, c_void_p, c_void_p) 16815 def cb_func(cb_arg0, cb_arg1): 16816 cb_arg0 = val(ctx=arg0.ctx, ptr=(cb_arg0)) 16817 try: 16818 arg1(cb_arg0) 16819 except BaseException as e: 16820 exc_info[0] = e 16821 return -1 16822 return 0 16823 cb = fn(cb_func) 16824 ctx = arg0.ctx 16825 res = isl.isl_val_list_foreach(arg0.ptr, cb, None) 16826 if exc_info[0] is not None: 16827 raise exc_info[0] 16828 if res < 0: 16829 raise 16830 def insert(arg0, arg1, arg2): 16831 try: 16832 if not arg0.__class__ is val_list: 16833 arg0 = val_list(arg0) 16834 except: 16835 raise 16836 try: 16837 if not arg2.__class__ is val: 16838 arg2 = val(arg2) 16839 except: 16840 raise 16841 ctx = arg0.ctx 16842 res = isl.isl_val_list_insert(isl.isl_val_list_copy(arg0.ptr), arg1, isl.isl_val_copy(arg2.ptr)) 16843 obj = val_list(ctx=ctx, ptr=res) 16844 return obj 16845 def size(arg0): 16846 try: 16847 if not arg0.__class__ is val_list: 16848 arg0 = val_list(arg0) 16849 except: 16850 raise 16851 ctx = arg0.ctx 16852 res = isl.isl_val_list_size(arg0.ptr) 16853 if res < 0: 16854 raise 16855 return int(res) 16856 16857isl.isl_val_list_alloc.restype = c_void_p 16858isl.isl_val_list_alloc.argtypes = [Context, c_int] 16859isl.isl_val_list_from_val.restype = c_void_p 16860isl.isl_val_list_from_val.argtypes = [c_void_p] 16861isl.isl_val_list_read_from_str.restype = c_void_p 16862isl.isl_val_list_read_from_str.argtypes = [Context, c_char_p] 16863isl.isl_val_list_add.restype = c_void_p 16864isl.isl_val_list_add.argtypes = [c_void_p, c_void_p] 16865isl.isl_val_list_get_at.restype = c_void_p 16866isl.isl_val_list_get_at.argtypes = [c_void_p, c_int] 16867isl.isl_val_list_clear.restype = c_void_p 16868isl.isl_val_list_clear.argtypes = [c_void_p] 16869isl.isl_val_list_concat.restype = c_void_p 16870isl.isl_val_list_concat.argtypes = [c_void_p, c_void_p] 16871isl.isl_val_list_drop.restype = c_void_p 16872isl.isl_val_list_drop.argtypes = [c_void_p, c_int, c_int] 16873isl.isl_val_list_foreach.argtypes = [c_void_p, c_void_p, c_void_p] 16874isl.isl_val_list_insert.restype = c_void_p 16875isl.isl_val_list_insert.argtypes = [c_void_p, c_int, c_void_p] 16876isl.isl_val_list_size.argtypes = [c_void_p] 16877isl.isl_val_list_copy.restype = c_void_p 16878isl.isl_val_list_copy.argtypes = [c_void_p] 16879isl.isl_val_list_free.restype = c_void_p 16880isl.isl_val_list_free.argtypes = [c_void_p] 16881isl.isl_val_list_to_str.restype = POINTER(c_char) 16882isl.isl_val_list_to_str.argtypes = [c_void_p] 16883