isl_basic_set_intersect_params: extract out isl_basic_map_intersect_params
[isl.git] / include / isl / cpp.h
blob3a529b60c50f20d2a57a15eab0616a75a567dcec
1 /// These are automatically generated C++ bindings for isl.
2 ///
3 /// isl is a library for computing with integer sets and maps described by
4 /// Presburger formulas. On top of this, isl provides various tools for
5 /// polyhedral compilation, ranging from dependence analysis over scheduling
6 /// to AST generation.
8 #ifndef ISL_CPP
9 #define ISL_CPP
11 #include <isl/ctx.h>
12 #include <isl/options.h>
14 #include <functional>
15 #include <memory>
16 #include <ostream>
17 #include <stdexcept>
18 #include <string>
19 #include <type_traits>
21 #if __cplusplus >= 201703L
22 #include <any>
23 #include <optional>
24 #endif
26 /* ISL_USE_EXCEPTIONS should be defined to 1 if exceptions are available.
27 * gcc and clang define __cpp_exceptions; MSVC and xlC define _CPPUNWIND.
28 * Older versions of gcc (e.g., 4.9) only define __EXCEPTIONS.
29 * If exceptions are not available, any error condition will result
30 * in an abort.
32 #ifndef ISL_USE_EXCEPTIONS
33 #if defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(__EXCEPTIONS)
34 #define ISL_USE_EXCEPTIONS 1
35 #else
36 #define ISL_USE_EXCEPTIONS 0
37 #endif
38 #endif
40 namespace isl {
42 class ctx {
43 isl_ctx *ptr;
44 public:
45 /* implicit */ ctx(isl_ctx *ctx) : ptr(ctx) {}
46 isl_ctx *release() {
47 auto tmp = ptr;
48 ptr = nullptr;
49 return tmp;
51 isl_ctx *get() {
52 return ptr;
54 #if __cplusplus >= 201703L
55 static void free_user(void *user) {
56 std::any *p = static_cast<std::any *>(user);
57 delete p;
59 #endif
62 /* Macros hiding try/catch.
63 * If exceptions are not available, then no exceptions will be thrown and
64 * there is nothing to catch.
66 #if ISL_USE_EXCEPTIONS
67 #define ISL_CPP_TRY try
68 #define ISL_CPP_CATCH_ALL catch (...)
69 #else
70 #define ISL_CPP_TRY if (1)
71 #define ISL_CPP_CATCH_ALL if (0)
72 #endif
74 #if ISL_USE_EXCEPTIONS
76 /* Class capturing isl errors.
78 * The what() return value is stored in a reference counted string
79 * to ensure that the copy constructor and the assignment operator
80 * do not throw any exceptions.
82 class exception : public std::exception {
83 std::shared_ptr<std::string> what_str;
85 protected:
86 inline exception(const char *what_arg, const char *msg,
87 const char *file, int line);
88 public:
89 exception() {}
90 exception(const char *what_arg) {
91 what_str = std::make_shared<std::string>(what_arg);
93 static inline void throw_error(enum isl_error error, const char *msg,
94 const char *file, int line);
95 virtual const char *what() const noexcept override {
96 return what_str->c_str();
99 /* Default behavior on error conditions that occur inside isl calls
100 * performed from inside the bindings.
101 * In the case exceptions are available, isl should continue
102 * without printing a warning since the warning message
103 * will be included in the exception thrown from inside the bindings.
105 static constexpr auto on_error = ISL_ON_ERROR_CONTINUE;
106 /* Wrapper for throwing an exception with the given message.
108 static void throw_invalid(const char *msg, const char *file, int line) {
109 throw_error(isl_error_invalid, msg, file, line);
111 static inline void throw_last_error(ctx ctx);
114 /* Create an exception of a type described by "what_arg", with
115 * error message "msg" in line "line" of file "file".
117 * Create a string holding the what() return value that
118 * corresponds to what isl would have printed.
119 * If no error message or no error file was set, then use "what_arg" instead.
121 exception::exception(const char *what_arg, const char *msg, const char *file,
122 int line)
124 if (!msg || !file)
125 what_str = std::make_shared<std::string>(what_arg);
126 else
127 what_str = std::make_shared<std::string>(std::string(file) +
128 ":" + std::to_string(line) + ": " + msg);
131 class exception_abort : public exception {
132 friend exception;
133 exception_abort(const char *msg, const char *file, int line) :
134 exception("execution aborted", msg, file, line) {}
137 class exception_alloc : public exception {
138 friend exception;
139 exception_alloc(const char *msg, const char *file, int line) :
140 exception("memory allocation failure", msg, file, line) {}
143 class exception_unknown : public exception {
144 friend exception;
145 exception_unknown(const char *msg, const char *file, int line) :
146 exception("unknown failure", msg, file, line) {}
149 class exception_internal : public exception {
150 friend exception;
151 exception_internal(const char *msg, const char *file, int line) :
152 exception("internal error", msg, file, line) {}
155 class exception_invalid : public exception {
156 friend exception;
157 exception_invalid(const char *msg, const char *file, int line) :
158 exception("invalid argument", msg, file, line) {}
161 class exception_quota : public exception {
162 friend exception;
163 exception_quota(const char *msg, const char *file, int line) :
164 exception("quota exceeded", msg, file, line) {}
167 class exception_unsupported : public exception {
168 friend exception;
169 exception_unsupported(const char *msg, const char *file, int line) :
170 exception("unsupported operation", msg, file, line) {}
173 /* Throw an exception of the class that corresponds to "error", with
174 * error message "msg" in line "line" of file "file".
176 * isl_error_none is treated as an invalid error type.
178 void exception::throw_error(enum isl_error error, const char *msg,
179 const char *file, int line)
181 switch (error) {
182 case isl_error_none:
183 break;
184 case isl_error_abort: throw exception_abort(msg, file, line);
185 case isl_error_alloc: throw exception_alloc(msg, file, line);
186 case isl_error_unknown: throw exception_unknown(msg, file, line);
187 case isl_error_internal: throw exception_internal(msg, file, line);
188 case isl_error_invalid: throw exception_invalid(msg, file, line);
189 case isl_error_quota: throw exception_quota(msg, file, line);
190 case isl_error_unsupported:
191 throw exception_unsupported(msg, file, line);
194 throw exception_invalid("invalid error type", file, line);
197 /* Throw an exception corresponding to the last error on "ctx" and
198 * reset the error.
200 * If "ctx" is NULL or if it is not in an error state at the start,
201 * then an invalid argument exception is thrown.
203 void exception::throw_last_error(ctx ctx)
205 enum isl_error error;
206 const char *msg, *file;
207 int line;
209 error = isl_ctx_last_error(ctx.get());
210 msg = isl_ctx_last_error_msg(ctx.get());
211 file = isl_ctx_last_error_file(ctx.get());
212 line = isl_ctx_last_error_line(ctx.get());
213 isl_ctx_reset_error(ctx.get());
215 throw_error(error, msg, file, line);
218 #else
220 #include <stdio.h>
221 #include <stdlib.h>
223 class exception {
224 public:
225 /* Default behavior on error conditions that occur inside isl calls
226 * performed from inside the bindings.
227 * In the case exceptions are not available, isl should abort.
229 static constexpr auto on_error = ISL_ON_ERROR_ABORT;
230 /* Wrapper for throwing an exception with the given message.
231 * In the case exceptions are not available, print an error and abort.
233 static void throw_invalid(const char *msg, const char *file, int line) {
234 fprintf(stderr, "%s:%d: %s\n", file, line, msg);
235 abort();
237 /* Throw an exception corresponding to the last
238 * error on "ctx".
239 * isl should already abort when an error condition occurs,
240 * so this function should never be called.
242 static void throw_last_error(ctx ctx) {
243 abort();
247 #endif
249 /* Helper class for setting the on_error and resetting the option
250 * to the original value when leaving the scope.
252 class options_scoped_set_on_error {
253 isl_ctx *ctx;
254 int saved_on_error;
255 public:
256 options_scoped_set_on_error(class ctx ctx, int on_error) {
257 this->ctx = ctx.get();
258 saved_on_error = isl_options_get_on_error(this->ctx);
259 isl_options_set_on_error(this->ctx, on_error);
261 ~options_scoped_set_on_error() {
262 isl_options_set_on_error(ctx, saved_on_error);
266 } // namespace isl
268 #include <isl/id.h>
269 #include <isl/id_to_id.h>
270 #include <isl/space.h>
271 #include <isl/val.h>
272 #include <isl/aff.h>
273 #include <isl/set.h>
274 #include <isl/map.h>
275 #include <isl/ilp.h>
276 #include <isl/union_set.h>
277 #include <isl/union_map.h>
278 #include <isl/flow.h>
279 #include <isl/schedule.h>
280 #include <isl/schedule_node.h>
281 #include <isl/ast_build.h>
282 #include <isl/fixed_box.h>
284 namespace isl {
286 // forward declarations
287 class aff;
288 class aff_list;
289 class ast_build;
290 class ast_expr;
291 class ast_expr_id;
292 class ast_expr_int;
293 class ast_expr_op;
294 class ast_expr_op_access;
295 class ast_expr_op_add;
296 class ast_expr_op_address_of;
297 class ast_expr_op_and;
298 class ast_expr_op_and_then;
299 class ast_expr_op_call;
300 class ast_expr_op_cond;
301 class ast_expr_op_div;
302 class ast_expr_op_eq;
303 class ast_expr_op_fdiv_q;
304 class ast_expr_op_ge;
305 class ast_expr_op_gt;
306 class ast_expr_op_le;
307 class ast_expr_op_lt;
308 class ast_expr_op_max;
309 class ast_expr_op_member;
310 class ast_expr_op_min;
311 class ast_expr_op_minus;
312 class ast_expr_op_mul;
313 class ast_expr_op_or;
314 class ast_expr_op_or_else;
315 class ast_expr_op_pdiv_q;
316 class ast_expr_op_pdiv_r;
317 class ast_expr_op_select;
318 class ast_expr_op_sub;
319 class ast_expr_op_zdiv_r;
320 class ast_node;
321 class ast_node_block;
322 class ast_node_for;
323 class ast_node_if;
324 class ast_node_list;
325 class ast_node_mark;
326 class ast_node_user;
327 class basic_map;
328 class basic_set;
329 class fixed_box;
330 class id;
331 class id_list;
332 class id_to_ast_expr;
333 class id_to_id;
334 class map;
335 class map_list;
336 class multi_aff;
337 class multi_id;
338 class multi_pw_aff;
339 class multi_union_pw_aff;
340 class multi_val;
341 class point;
342 class pw_aff;
343 class pw_aff_list;
344 class pw_multi_aff;
345 class pw_multi_aff_list;
346 class schedule;
347 class schedule_constraints;
348 class schedule_node;
349 class schedule_node_band;
350 class schedule_node_context;
351 class schedule_node_domain;
352 class schedule_node_expansion;
353 class schedule_node_extension;
354 class schedule_node_filter;
355 class schedule_node_guard;
356 class schedule_node_leaf;
357 class schedule_node_mark;
358 class schedule_node_sequence;
359 class schedule_node_set;
360 class set;
361 class set_list;
362 class space;
363 class union_access_info;
364 class union_flow;
365 class union_map;
366 class union_pw_aff;
367 class union_pw_aff_list;
368 class union_pw_multi_aff;
369 class union_set;
370 class union_set_list;
371 class val;
372 class val_list;
374 // declarations for isl::aff
375 inline aff manage(__isl_take isl_aff *ptr);
376 inline aff manage_copy(__isl_keep isl_aff *ptr);
378 class aff {
379 friend inline aff manage(__isl_take isl_aff *ptr);
380 friend inline aff manage_copy(__isl_keep isl_aff *ptr);
382 protected:
383 isl_aff *ptr = nullptr;
385 inline explicit aff(__isl_take isl_aff *ptr);
387 public:
388 inline /* implicit */ aff();
389 inline /* implicit */ aff(const aff &obj);
390 inline explicit aff(isl::ctx ctx, const std::string &str);
391 inline aff &operator=(aff obj);
392 inline ~aff();
393 inline __isl_give isl_aff *copy() const &;
394 inline __isl_give isl_aff *copy() && = delete;
395 inline __isl_keep isl_aff *get() const;
396 inline __isl_give isl_aff *release();
397 inline bool is_null() const;
398 inline isl::ctx ctx() const;
400 inline isl::aff add(isl::aff aff2) const;
401 inline isl::multi_aff add(const isl::multi_aff &multi2) const;
402 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
403 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
404 inline isl::pw_aff add(const isl::pw_aff &pwaff2) const;
405 inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
406 inline isl::union_pw_aff add(const isl::union_pw_aff &upa2) const;
407 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
408 inline isl::aff add_constant(isl::val v) const;
409 inline isl::aff add_constant(long v) const;
410 inline isl::multi_aff add_constant(const isl::multi_val &mv) const;
411 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
412 inline isl::aff as_aff() const;
413 inline isl::map as_map() const;
414 inline isl::multi_aff as_multi_aff() const;
415 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
416 inline isl::pw_multi_aff as_pw_multi_aff() const;
417 inline isl::set as_set() const;
418 inline isl::union_map as_union_map() const;
419 inline isl::aff at(int pos) const;
420 inline isl::basic_set bind(isl::id id) const;
421 inline isl::basic_set bind(const std::string &id) const;
422 inline isl::basic_set bind(const isl::multi_id &tuple) const;
423 inline isl::pw_aff bind_domain(const isl::multi_id &tuple) const;
424 inline isl::pw_aff bind_domain_wrapped_domain(const isl::multi_id &tuple) const;
425 inline isl::aff ceil() const;
426 inline isl::pw_aff coalesce() const;
427 inline isl::pw_aff cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const;
428 inline isl::multi_val constant_multi_val() const;
429 inline isl::val constant_val() const;
430 inline isl::val get_constant_val() const;
431 inline isl::aff div(isl::aff aff2) const;
432 inline isl::pw_aff div(const isl::pw_aff &pa2) const;
433 inline isl::set domain() const;
434 inline isl::aff domain_reverse() const;
435 inline isl::pw_aff drop_unused_params() const;
436 inline isl::set eq_set(isl::aff aff2) const;
437 inline isl::set eq_set(const isl::pw_aff &pwaff2) const;
438 inline isl::val eval(isl::point pnt) const;
439 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
440 inline isl::multi_aff flat_range_product(const isl::multi_aff &multi2) const;
441 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
442 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
443 inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
444 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
445 inline isl::aff floor() const;
446 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
447 inline isl::set ge_set(isl::aff aff2) const;
448 inline isl::set ge_set(const isl::pw_aff &pwaff2) const;
449 inline isl::aff gist(isl::set context) const;
450 inline isl::union_pw_aff gist(const isl::union_set &context) const;
451 inline isl::aff gist(const isl::basic_set &context) const;
452 inline isl::aff gist(const isl::point &context) const;
453 inline isl::aff gist_params(isl::set context) const;
454 inline isl::set gt_set(isl::aff aff2) const;
455 inline isl::set gt_set(const isl::pw_aff &pwaff2) const;
456 inline bool has_range_tuple_id() const;
457 inline isl::multi_aff identity() const;
458 inline isl::pw_aff insert_domain(const isl::space &domain) const;
459 inline isl::pw_aff intersect_domain(const isl::set &set) const;
460 inline isl::union_pw_aff intersect_domain(const isl::space &space) const;
461 inline isl::union_pw_aff intersect_domain(const isl::union_set &uset) const;
462 inline isl::union_pw_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
463 inline isl::union_pw_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
464 inline isl::pw_aff intersect_params(const isl::set &set) const;
465 inline bool involves_locals() const;
466 inline bool involves_nan() const;
467 inline bool involves_param(const isl::id &id) const;
468 inline bool involves_param(const std::string &id) const;
469 inline bool involves_param(const isl::id_list &list) const;
470 inline bool is_cst() const;
471 inline bool isa_aff() const;
472 inline bool isa_multi_aff() const;
473 inline bool isa_pw_multi_aff() const;
474 inline isl::set le_set(isl::aff aff2) const;
475 inline isl::set le_set(const isl::pw_aff &pwaff2) const;
476 inline isl::aff_list list() const;
477 inline isl::set lt_set(isl::aff aff2) const;
478 inline isl::set lt_set(const isl::pw_aff &pwaff2) const;
479 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
480 inline isl::pw_aff max(const isl::pw_aff &pwaff2) const;
481 inline isl::multi_val max_multi_val() const;
482 inline isl::val max_val() const;
483 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
484 inline isl::pw_aff min(const isl::pw_aff &pwaff2) const;
485 inline isl::multi_val min_multi_val() const;
486 inline isl::val min_val() const;
487 inline isl::aff mod(isl::val mod) const;
488 inline isl::aff mod(long mod) const;
489 inline isl::aff mul(isl::aff aff2) const;
490 inline isl::pw_aff mul(const isl::pw_aff &pwaff2) const;
491 inline unsigned n_piece() const;
492 inline isl::set ne_set(isl::aff aff2) const;
493 inline isl::set ne_set(const isl::pw_aff &pwaff2) const;
494 inline isl::aff neg() const;
495 inline isl::set params() const;
496 inline bool plain_is_empty() const;
497 inline bool plain_is_equal(const isl::aff &aff2) const;
498 inline bool plain_is_equal(const isl::multi_aff &multi2) const;
499 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
500 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
501 inline bool plain_is_equal(const isl::pw_aff &pwaff2) const;
502 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
503 inline bool plain_is_equal(const isl::union_pw_aff &upa2) const;
504 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
505 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
506 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
507 inline isl::multi_aff product(const isl::multi_aff &multi2) const;
508 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
509 inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
510 inline isl::aff pullback(isl::multi_aff ma) const;
511 inline isl::pw_aff pullback(const isl::multi_pw_aff &mpa) const;
512 inline isl::pw_aff pullback(const isl::pw_multi_aff &pma) const;
513 inline isl::union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
514 inline isl::aff pullback(const isl::aff &ma) const;
515 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
516 inline isl::pw_multi_aff range_factor_domain() const;
517 inline isl::pw_multi_aff range_factor_range() const;
518 inline isl::multi_aff range_product(const isl::multi_aff &multi2) const;
519 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
520 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
521 inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
522 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
523 inline isl::id range_tuple_id() const;
524 inline isl::multi_aff reset_range_tuple_id() const;
525 inline isl::aff scale(isl::val v) const;
526 inline isl::aff scale(long v) const;
527 inline isl::multi_aff scale(const isl::multi_val &mv) const;
528 inline isl::aff scale_down(isl::val v) const;
529 inline isl::aff scale_down(long v) const;
530 inline isl::multi_aff scale_down(const isl::multi_val &mv) const;
531 inline isl::multi_aff set_at(int pos, const isl::aff &el) const;
532 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
533 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
534 inline isl::multi_aff set_range_tuple(const isl::id &id) const;
535 inline isl::multi_aff set_range_tuple(const std::string &id) const;
536 inline unsigned size() const;
537 inline isl::space space() const;
538 inline isl::aff sub(isl::aff aff2) const;
539 inline isl::multi_aff sub(const isl::multi_aff &multi2) const;
540 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
541 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
542 inline isl::pw_aff sub(const isl::pw_aff &pwaff2) const;
543 inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
544 inline isl::union_pw_aff sub(const isl::union_pw_aff &upa2) const;
545 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
546 inline isl::pw_aff subtract_domain(const isl::set &set) const;
547 inline isl::union_pw_aff subtract_domain(const isl::space &space) const;
548 inline isl::union_pw_aff subtract_domain(const isl::union_set &uset) const;
549 inline isl::pw_aff tdiv_q(const isl::pw_aff &pa2) const;
550 inline isl::pw_aff tdiv_r(const isl::pw_aff &pa2) const;
551 inline isl::aff_list to_list() const;
552 inline isl::multi_pw_aff to_multi_pw_aff() const;
553 inline isl::multi_union_pw_aff to_multi_union_pw_aff() const;
554 inline isl::pw_multi_aff to_pw_multi_aff() const;
555 inline isl::union_pw_aff to_union_pw_aff() const;
556 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
557 inline isl::aff unbind_params_insert_domain(isl::multi_id domain) const;
558 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
559 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
560 inline isl::pw_aff union_add(const isl::pw_aff &pwaff2) const;
561 inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
562 inline isl::union_pw_aff union_add(const isl::union_pw_aff &upa2) const;
563 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
564 static inline isl::aff zero_on_domain(isl::space space);
567 // declarations for isl::aff_list
568 inline aff_list manage(__isl_take isl_aff_list *ptr);
569 inline aff_list manage_copy(__isl_keep isl_aff_list *ptr);
571 class aff_list {
572 friend inline aff_list manage(__isl_take isl_aff_list *ptr);
573 friend inline aff_list manage_copy(__isl_keep isl_aff_list *ptr);
575 protected:
576 isl_aff_list *ptr = nullptr;
578 inline explicit aff_list(__isl_take isl_aff_list *ptr);
580 public:
581 inline /* implicit */ aff_list();
582 inline /* implicit */ aff_list(const aff_list &obj);
583 inline explicit aff_list(isl::ctx ctx, int n);
584 inline explicit aff_list(isl::aff el);
585 inline explicit aff_list(isl::ctx ctx, const std::string &str);
586 inline aff_list &operator=(aff_list obj);
587 inline ~aff_list();
588 inline __isl_give isl_aff_list *copy() const &;
589 inline __isl_give isl_aff_list *copy() && = delete;
590 inline __isl_keep isl_aff_list *get() const;
591 inline __isl_give isl_aff_list *release();
592 inline bool is_null() const;
593 inline isl::ctx ctx() const;
595 inline isl::aff_list add(isl::aff el) const;
596 inline isl::aff at(int index) const;
597 inline isl::aff get_at(int index) const;
598 inline isl::aff_list clear() const;
599 inline isl::aff_list concat(isl::aff_list list2) const;
600 inline isl::aff_list drop(unsigned int first, unsigned int n) const;
601 inline void foreach(const std::function<void(isl::aff)> &fn) const;
602 inline void foreach_scc(const std::function<bool(isl::aff, isl::aff)> &follows, const std::function<void(isl::aff_list)> &fn) const;
603 inline isl::aff_list insert(unsigned int pos, isl::aff el) const;
604 inline isl::aff_list set_at(int index, isl::aff el) const;
605 inline unsigned size() const;
608 // declarations for isl::ast_build
609 inline ast_build manage(__isl_take isl_ast_build *ptr);
610 inline ast_build manage_copy(__isl_keep isl_ast_build *ptr);
612 class ast_build {
613 friend inline ast_build manage(__isl_take isl_ast_build *ptr);
614 friend inline ast_build manage_copy(__isl_keep isl_ast_build *ptr);
616 protected:
617 isl_ast_build *ptr = nullptr;
619 inline explicit ast_build(__isl_take isl_ast_build *ptr);
621 public:
622 inline /* implicit */ ast_build();
623 inline /* implicit */ ast_build(const ast_build &obj);
624 inline explicit ast_build(isl::ctx ctx);
625 inline ast_build &operator=(ast_build obj);
626 inline ~ast_build();
627 inline __isl_give isl_ast_build *copy() const &;
628 inline __isl_give isl_ast_build *copy() && = delete;
629 inline __isl_keep isl_ast_build *get() const;
630 inline __isl_give isl_ast_build *release();
631 inline bool is_null() const;
632 inline isl::ctx ctx() const;
634 private:
635 inline ast_build &copy_callbacks(const ast_build &obj);
636 struct at_each_domain_data {
637 std::function<isl::ast_node(isl::ast_node, isl::ast_build)> func;
638 std::exception_ptr eptr;
640 std::shared_ptr<at_each_domain_data> at_each_domain_data;
641 static inline isl_ast_node *at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2);
642 inline void set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn);
643 public:
644 inline isl::ast_build set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const;
645 inline isl::ast_expr access_from(isl::multi_pw_aff mpa) const;
646 inline isl::ast_expr access_from(isl::pw_multi_aff pma) const;
647 inline isl::ast_expr call_from(isl::multi_pw_aff mpa) const;
648 inline isl::ast_expr call_from(isl::pw_multi_aff pma) const;
649 inline isl::ast_expr expr_from(isl::pw_aff pa) const;
650 inline isl::ast_expr expr_from(isl::set set) const;
651 static inline isl::ast_build from_context(isl::set set);
652 inline isl::ast_node node_from(isl::schedule schedule) const;
653 inline isl::ast_node node_from_schedule_map(isl::union_map schedule) const;
654 inline isl::union_map schedule() const;
655 inline isl::union_map get_schedule() const;
658 // declarations for isl::ast_expr
659 inline ast_expr manage(__isl_take isl_ast_expr *ptr);
660 inline ast_expr manage_copy(__isl_keep isl_ast_expr *ptr);
662 class ast_expr {
663 friend inline ast_expr manage(__isl_take isl_ast_expr *ptr);
664 friend inline ast_expr manage_copy(__isl_keep isl_ast_expr *ptr);
666 protected:
667 isl_ast_expr *ptr = nullptr;
669 inline explicit ast_expr(__isl_take isl_ast_expr *ptr);
671 public:
672 inline /* implicit */ ast_expr();
673 inline /* implicit */ ast_expr(const ast_expr &obj);
674 inline ast_expr &operator=(ast_expr obj);
675 inline ~ast_expr();
676 inline __isl_give isl_ast_expr *copy() const &;
677 inline __isl_give isl_ast_expr *copy() && = delete;
678 inline __isl_keep isl_ast_expr *get() const;
679 inline __isl_give isl_ast_expr *release();
680 inline bool is_null() const;
681 private:
682 template <typename T,
683 typename = typename std::enable_if<std::is_same<
684 const decltype(isl_ast_expr_get_type(NULL)),
685 const T>::value>::type>
686 inline bool isa_type(T subtype) const;
687 public:
688 template <class T> inline bool isa() const;
689 template <class T> inline T as() const;
690 inline isl::ctx ctx() const;
692 inline std::string to_C_str() const;
695 // declarations for isl::ast_expr_id
697 class ast_expr_id : public ast_expr {
698 template <class T>
699 friend bool ast_expr::isa() const;
700 friend ast_expr_id ast_expr::as<ast_expr_id>() const;
701 static const auto type = isl_ast_expr_id;
703 protected:
704 inline explicit ast_expr_id(__isl_take isl_ast_expr *ptr);
706 public:
707 inline /* implicit */ ast_expr_id();
708 inline /* implicit */ ast_expr_id(const ast_expr_id &obj);
709 inline ast_expr_id &operator=(ast_expr_id obj);
710 inline isl::ctx ctx() const;
712 inline isl::id id() const;
713 inline isl::id get_id() const;
716 // declarations for isl::ast_expr_int
718 class ast_expr_int : public ast_expr {
719 template <class T>
720 friend bool ast_expr::isa() const;
721 friend ast_expr_int ast_expr::as<ast_expr_int>() const;
722 static const auto type = isl_ast_expr_int;
724 protected:
725 inline explicit ast_expr_int(__isl_take isl_ast_expr *ptr);
727 public:
728 inline /* implicit */ ast_expr_int();
729 inline /* implicit */ ast_expr_int(const ast_expr_int &obj);
730 inline ast_expr_int &operator=(ast_expr_int obj);
731 inline isl::ctx ctx() const;
733 inline isl::val val() const;
734 inline isl::val get_val() const;
737 // declarations for isl::ast_expr_op
739 class ast_expr_op : public ast_expr {
740 template <class T>
741 friend bool ast_expr::isa() const;
742 friend ast_expr_op ast_expr::as<ast_expr_op>() const;
743 static const auto type = isl_ast_expr_op;
745 protected:
746 inline explicit ast_expr_op(__isl_take isl_ast_expr *ptr);
748 public:
749 inline /* implicit */ ast_expr_op();
750 inline /* implicit */ ast_expr_op(const ast_expr_op &obj);
751 inline ast_expr_op &operator=(ast_expr_op obj);
752 private:
753 template <typename T,
754 typename = typename std::enable_if<std::is_same<
755 const decltype(isl_ast_expr_op_get_type(NULL)),
756 const T>::value>::type>
757 inline bool isa_type(T subtype) const;
758 public:
759 template <class T> inline bool isa() const;
760 template <class T> inline T as() const;
761 inline isl::ctx ctx() const;
763 inline isl::ast_expr arg(int pos) const;
764 inline isl::ast_expr get_arg(int pos) const;
765 inline unsigned n_arg() const;
766 inline unsigned get_n_arg() const;
769 // declarations for isl::ast_expr_op_access
771 class ast_expr_op_access : public ast_expr_op {
772 template <class T>
773 friend bool ast_expr_op::isa() const;
774 friend ast_expr_op_access ast_expr_op::as<ast_expr_op_access>() const;
775 static const auto type = isl_ast_expr_op_access;
777 protected:
778 inline explicit ast_expr_op_access(__isl_take isl_ast_expr *ptr);
780 public:
781 inline /* implicit */ ast_expr_op_access();
782 inline /* implicit */ ast_expr_op_access(const ast_expr_op_access &obj);
783 inline ast_expr_op_access &operator=(ast_expr_op_access obj);
784 inline isl::ctx ctx() const;
788 // declarations for isl::ast_expr_op_add
790 class ast_expr_op_add : public ast_expr_op {
791 template <class T>
792 friend bool ast_expr_op::isa() const;
793 friend ast_expr_op_add ast_expr_op::as<ast_expr_op_add>() const;
794 static const auto type = isl_ast_expr_op_add;
796 protected:
797 inline explicit ast_expr_op_add(__isl_take isl_ast_expr *ptr);
799 public:
800 inline /* implicit */ ast_expr_op_add();
801 inline /* implicit */ ast_expr_op_add(const ast_expr_op_add &obj);
802 inline ast_expr_op_add &operator=(ast_expr_op_add obj);
803 inline isl::ctx ctx() const;
807 // declarations for isl::ast_expr_op_address_of
809 class ast_expr_op_address_of : public ast_expr_op {
810 template <class T>
811 friend bool ast_expr_op::isa() const;
812 friend ast_expr_op_address_of ast_expr_op::as<ast_expr_op_address_of>() const;
813 static const auto type = isl_ast_expr_op_address_of;
815 protected:
816 inline explicit ast_expr_op_address_of(__isl_take isl_ast_expr *ptr);
818 public:
819 inline /* implicit */ ast_expr_op_address_of();
820 inline /* implicit */ ast_expr_op_address_of(const ast_expr_op_address_of &obj);
821 inline ast_expr_op_address_of &operator=(ast_expr_op_address_of obj);
822 inline isl::ctx ctx() const;
826 // declarations for isl::ast_expr_op_and
828 class ast_expr_op_and : public ast_expr_op {
829 template <class T>
830 friend bool ast_expr_op::isa() const;
831 friend ast_expr_op_and ast_expr_op::as<ast_expr_op_and>() const;
832 static const auto type = isl_ast_expr_op_and;
834 protected:
835 inline explicit ast_expr_op_and(__isl_take isl_ast_expr *ptr);
837 public:
838 inline /* implicit */ ast_expr_op_and();
839 inline /* implicit */ ast_expr_op_and(const ast_expr_op_and &obj);
840 inline ast_expr_op_and &operator=(ast_expr_op_and obj);
841 inline isl::ctx ctx() const;
845 // declarations for isl::ast_expr_op_and_then
847 class ast_expr_op_and_then : public ast_expr_op {
848 template <class T>
849 friend bool ast_expr_op::isa() const;
850 friend ast_expr_op_and_then ast_expr_op::as<ast_expr_op_and_then>() const;
851 static const auto type = isl_ast_expr_op_and_then;
853 protected:
854 inline explicit ast_expr_op_and_then(__isl_take isl_ast_expr *ptr);
856 public:
857 inline /* implicit */ ast_expr_op_and_then();
858 inline /* implicit */ ast_expr_op_and_then(const ast_expr_op_and_then &obj);
859 inline ast_expr_op_and_then &operator=(ast_expr_op_and_then obj);
860 inline isl::ctx ctx() const;
864 // declarations for isl::ast_expr_op_call
866 class ast_expr_op_call : public ast_expr_op {
867 template <class T>
868 friend bool ast_expr_op::isa() const;
869 friend ast_expr_op_call ast_expr_op::as<ast_expr_op_call>() const;
870 static const auto type = isl_ast_expr_op_call;
872 protected:
873 inline explicit ast_expr_op_call(__isl_take isl_ast_expr *ptr);
875 public:
876 inline /* implicit */ ast_expr_op_call();
877 inline /* implicit */ ast_expr_op_call(const ast_expr_op_call &obj);
878 inline ast_expr_op_call &operator=(ast_expr_op_call obj);
879 inline isl::ctx ctx() const;
883 // declarations for isl::ast_expr_op_cond
885 class ast_expr_op_cond : public ast_expr_op {
886 template <class T>
887 friend bool ast_expr_op::isa() const;
888 friend ast_expr_op_cond ast_expr_op::as<ast_expr_op_cond>() const;
889 static const auto type = isl_ast_expr_op_cond;
891 protected:
892 inline explicit ast_expr_op_cond(__isl_take isl_ast_expr *ptr);
894 public:
895 inline /* implicit */ ast_expr_op_cond();
896 inline /* implicit */ ast_expr_op_cond(const ast_expr_op_cond &obj);
897 inline ast_expr_op_cond &operator=(ast_expr_op_cond obj);
898 inline isl::ctx ctx() const;
902 // declarations for isl::ast_expr_op_div
904 class ast_expr_op_div : public ast_expr_op {
905 template <class T>
906 friend bool ast_expr_op::isa() const;
907 friend ast_expr_op_div ast_expr_op::as<ast_expr_op_div>() const;
908 static const auto type = isl_ast_expr_op_div;
910 protected:
911 inline explicit ast_expr_op_div(__isl_take isl_ast_expr *ptr);
913 public:
914 inline /* implicit */ ast_expr_op_div();
915 inline /* implicit */ ast_expr_op_div(const ast_expr_op_div &obj);
916 inline ast_expr_op_div &operator=(ast_expr_op_div obj);
917 inline isl::ctx ctx() const;
921 // declarations for isl::ast_expr_op_eq
923 class ast_expr_op_eq : public ast_expr_op {
924 template <class T>
925 friend bool ast_expr_op::isa() const;
926 friend ast_expr_op_eq ast_expr_op::as<ast_expr_op_eq>() const;
927 static const auto type = isl_ast_expr_op_eq;
929 protected:
930 inline explicit ast_expr_op_eq(__isl_take isl_ast_expr *ptr);
932 public:
933 inline /* implicit */ ast_expr_op_eq();
934 inline /* implicit */ ast_expr_op_eq(const ast_expr_op_eq &obj);
935 inline ast_expr_op_eq &operator=(ast_expr_op_eq obj);
936 inline isl::ctx ctx() const;
940 // declarations for isl::ast_expr_op_fdiv_q
942 class ast_expr_op_fdiv_q : public ast_expr_op {
943 template <class T>
944 friend bool ast_expr_op::isa() const;
945 friend ast_expr_op_fdiv_q ast_expr_op::as<ast_expr_op_fdiv_q>() const;
946 static const auto type = isl_ast_expr_op_fdiv_q;
948 protected:
949 inline explicit ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr);
951 public:
952 inline /* implicit */ ast_expr_op_fdiv_q();
953 inline /* implicit */ ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj);
954 inline ast_expr_op_fdiv_q &operator=(ast_expr_op_fdiv_q obj);
955 inline isl::ctx ctx() const;
959 // declarations for isl::ast_expr_op_ge
961 class ast_expr_op_ge : public ast_expr_op {
962 template <class T>
963 friend bool ast_expr_op::isa() const;
964 friend ast_expr_op_ge ast_expr_op::as<ast_expr_op_ge>() const;
965 static const auto type = isl_ast_expr_op_ge;
967 protected:
968 inline explicit ast_expr_op_ge(__isl_take isl_ast_expr *ptr);
970 public:
971 inline /* implicit */ ast_expr_op_ge();
972 inline /* implicit */ ast_expr_op_ge(const ast_expr_op_ge &obj);
973 inline ast_expr_op_ge &operator=(ast_expr_op_ge obj);
974 inline isl::ctx ctx() const;
978 // declarations for isl::ast_expr_op_gt
980 class ast_expr_op_gt : public ast_expr_op {
981 template <class T>
982 friend bool ast_expr_op::isa() const;
983 friend ast_expr_op_gt ast_expr_op::as<ast_expr_op_gt>() const;
984 static const auto type = isl_ast_expr_op_gt;
986 protected:
987 inline explicit ast_expr_op_gt(__isl_take isl_ast_expr *ptr);
989 public:
990 inline /* implicit */ ast_expr_op_gt();
991 inline /* implicit */ ast_expr_op_gt(const ast_expr_op_gt &obj);
992 inline ast_expr_op_gt &operator=(ast_expr_op_gt obj);
993 inline isl::ctx ctx() const;
997 // declarations for isl::ast_expr_op_le
999 class ast_expr_op_le : public ast_expr_op {
1000 template <class T>
1001 friend bool ast_expr_op::isa() const;
1002 friend ast_expr_op_le ast_expr_op::as<ast_expr_op_le>() const;
1003 static const auto type = isl_ast_expr_op_le;
1005 protected:
1006 inline explicit ast_expr_op_le(__isl_take isl_ast_expr *ptr);
1008 public:
1009 inline /* implicit */ ast_expr_op_le();
1010 inline /* implicit */ ast_expr_op_le(const ast_expr_op_le &obj);
1011 inline ast_expr_op_le &operator=(ast_expr_op_le obj);
1012 inline isl::ctx ctx() const;
1016 // declarations for isl::ast_expr_op_lt
1018 class ast_expr_op_lt : public ast_expr_op {
1019 template <class T>
1020 friend bool ast_expr_op::isa() const;
1021 friend ast_expr_op_lt ast_expr_op::as<ast_expr_op_lt>() const;
1022 static const auto type = isl_ast_expr_op_lt;
1024 protected:
1025 inline explicit ast_expr_op_lt(__isl_take isl_ast_expr *ptr);
1027 public:
1028 inline /* implicit */ ast_expr_op_lt();
1029 inline /* implicit */ ast_expr_op_lt(const ast_expr_op_lt &obj);
1030 inline ast_expr_op_lt &operator=(ast_expr_op_lt obj);
1031 inline isl::ctx ctx() const;
1035 // declarations for isl::ast_expr_op_max
1037 class ast_expr_op_max : public ast_expr_op {
1038 template <class T>
1039 friend bool ast_expr_op::isa() const;
1040 friend ast_expr_op_max ast_expr_op::as<ast_expr_op_max>() const;
1041 static const auto type = isl_ast_expr_op_max;
1043 protected:
1044 inline explicit ast_expr_op_max(__isl_take isl_ast_expr *ptr);
1046 public:
1047 inline /* implicit */ ast_expr_op_max();
1048 inline /* implicit */ ast_expr_op_max(const ast_expr_op_max &obj);
1049 inline ast_expr_op_max &operator=(ast_expr_op_max obj);
1050 inline isl::ctx ctx() const;
1054 // declarations for isl::ast_expr_op_member
1056 class ast_expr_op_member : public ast_expr_op {
1057 template <class T>
1058 friend bool ast_expr_op::isa() const;
1059 friend ast_expr_op_member ast_expr_op::as<ast_expr_op_member>() const;
1060 static const auto type = isl_ast_expr_op_member;
1062 protected:
1063 inline explicit ast_expr_op_member(__isl_take isl_ast_expr *ptr);
1065 public:
1066 inline /* implicit */ ast_expr_op_member();
1067 inline /* implicit */ ast_expr_op_member(const ast_expr_op_member &obj);
1068 inline ast_expr_op_member &operator=(ast_expr_op_member obj);
1069 inline isl::ctx ctx() const;
1073 // declarations for isl::ast_expr_op_min
1075 class ast_expr_op_min : public ast_expr_op {
1076 template <class T>
1077 friend bool ast_expr_op::isa() const;
1078 friend ast_expr_op_min ast_expr_op::as<ast_expr_op_min>() const;
1079 static const auto type = isl_ast_expr_op_min;
1081 protected:
1082 inline explicit ast_expr_op_min(__isl_take isl_ast_expr *ptr);
1084 public:
1085 inline /* implicit */ ast_expr_op_min();
1086 inline /* implicit */ ast_expr_op_min(const ast_expr_op_min &obj);
1087 inline ast_expr_op_min &operator=(ast_expr_op_min obj);
1088 inline isl::ctx ctx() const;
1092 // declarations for isl::ast_expr_op_minus
1094 class ast_expr_op_minus : public ast_expr_op {
1095 template <class T>
1096 friend bool ast_expr_op::isa() const;
1097 friend ast_expr_op_minus ast_expr_op::as<ast_expr_op_minus>() const;
1098 static const auto type = isl_ast_expr_op_minus;
1100 protected:
1101 inline explicit ast_expr_op_minus(__isl_take isl_ast_expr *ptr);
1103 public:
1104 inline /* implicit */ ast_expr_op_minus();
1105 inline /* implicit */ ast_expr_op_minus(const ast_expr_op_minus &obj);
1106 inline ast_expr_op_minus &operator=(ast_expr_op_minus obj);
1107 inline isl::ctx ctx() const;
1111 // declarations for isl::ast_expr_op_mul
1113 class ast_expr_op_mul : public ast_expr_op {
1114 template <class T>
1115 friend bool ast_expr_op::isa() const;
1116 friend ast_expr_op_mul ast_expr_op::as<ast_expr_op_mul>() const;
1117 static const auto type = isl_ast_expr_op_mul;
1119 protected:
1120 inline explicit ast_expr_op_mul(__isl_take isl_ast_expr *ptr);
1122 public:
1123 inline /* implicit */ ast_expr_op_mul();
1124 inline /* implicit */ ast_expr_op_mul(const ast_expr_op_mul &obj);
1125 inline ast_expr_op_mul &operator=(ast_expr_op_mul obj);
1126 inline isl::ctx ctx() const;
1130 // declarations for isl::ast_expr_op_or
1132 class ast_expr_op_or : public ast_expr_op {
1133 template <class T>
1134 friend bool ast_expr_op::isa() const;
1135 friend ast_expr_op_or ast_expr_op::as<ast_expr_op_or>() const;
1136 static const auto type = isl_ast_expr_op_or;
1138 protected:
1139 inline explicit ast_expr_op_or(__isl_take isl_ast_expr *ptr);
1141 public:
1142 inline /* implicit */ ast_expr_op_or();
1143 inline /* implicit */ ast_expr_op_or(const ast_expr_op_or &obj);
1144 inline ast_expr_op_or &operator=(ast_expr_op_or obj);
1145 inline isl::ctx ctx() const;
1149 // declarations for isl::ast_expr_op_or_else
1151 class ast_expr_op_or_else : public ast_expr_op {
1152 template <class T>
1153 friend bool ast_expr_op::isa() const;
1154 friend ast_expr_op_or_else ast_expr_op::as<ast_expr_op_or_else>() const;
1155 static const auto type = isl_ast_expr_op_or_else;
1157 protected:
1158 inline explicit ast_expr_op_or_else(__isl_take isl_ast_expr *ptr);
1160 public:
1161 inline /* implicit */ ast_expr_op_or_else();
1162 inline /* implicit */ ast_expr_op_or_else(const ast_expr_op_or_else &obj);
1163 inline ast_expr_op_or_else &operator=(ast_expr_op_or_else obj);
1164 inline isl::ctx ctx() const;
1168 // declarations for isl::ast_expr_op_pdiv_q
1170 class ast_expr_op_pdiv_q : public ast_expr_op {
1171 template <class T>
1172 friend bool ast_expr_op::isa() const;
1173 friend ast_expr_op_pdiv_q ast_expr_op::as<ast_expr_op_pdiv_q>() const;
1174 static const auto type = isl_ast_expr_op_pdiv_q;
1176 protected:
1177 inline explicit ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr);
1179 public:
1180 inline /* implicit */ ast_expr_op_pdiv_q();
1181 inline /* implicit */ ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj);
1182 inline ast_expr_op_pdiv_q &operator=(ast_expr_op_pdiv_q obj);
1183 inline isl::ctx ctx() const;
1187 // declarations for isl::ast_expr_op_pdiv_r
1189 class ast_expr_op_pdiv_r : public ast_expr_op {
1190 template <class T>
1191 friend bool ast_expr_op::isa() const;
1192 friend ast_expr_op_pdiv_r ast_expr_op::as<ast_expr_op_pdiv_r>() const;
1193 static const auto type = isl_ast_expr_op_pdiv_r;
1195 protected:
1196 inline explicit ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr);
1198 public:
1199 inline /* implicit */ ast_expr_op_pdiv_r();
1200 inline /* implicit */ ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj);
1201 inline ast_expr_op_pdiv_r &operator=(ast_expr_op_pdiv_r obj);
1202 inline isl::ctx ctx() const;
1206 // declarations for isl::ast_expr_op_select
1208 class ast_expr_op_select : public ast_expr_op {
1209 template <class T>
1210 friend bool ast_expr_op::isa() const;
1211 friend ast_expr_op_select ast_expr_op::as<ast_expr_op_select>() const;
1212 static const auto type = isl_ast_expr_op_select;
1214 protected:
1215 inline explicit ast_expr_op_select(__isl_take isl_ast_expr *ptr);
1217 public:
1218 inline /* implicit */ ast_expr_op_select();
1219 inline /* implicit */ ast_expr_op_select(const ast_expr_op_select &obj);
1220 inline ast_expr_op_select &operator=(ast_expr_op_select obj);
1221 inline isl::ctx ctx() const;
1225 // declarations for isl::ast_expr_op_sub
1227 class ast_expr_op_sub : public ast_expr_op {
1228 template <class T>
1229 friend bool ast_expr_op::isa() const;
1230 friend ast_expr_op_sub ast_expr_op::as<ast_expr_op_sub>() const;
1231 static const auto type = isl_ast_expr_op_sub;
1233 protected:
1234 inline explicit ast_expr_op_sub(__isl_take isl_ast_expr *ptr);
1236 public:
1237 inline /* implicit */ ast_expr_op_sub();
1238 inline /* implicit */ ast_expr_op_sub(const ast_expr_op_sub &obj);
1239 inline ast_expr_op_sub &operator=(ast_expr_op_sub obj);
1240 inline isl::ctx ctx() const;
1244 // declarations for isl::ast_expr_op_zdiv_r
1246 class ast_expr_op_zdiv_r : public ast_expr_op {
1247 template <class T>
1248 friend bool ast_expr_op::isa() const;
1249 friend ast_expr_op_zdiv_r ast_expr_op::as<ast_expr_op_zdiv_r>() const;
1250 static const auto type = isl_ast_expr_op_zdiv_r;
1252 protected:
1253 inline explicit ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr);
1255 public:
1256 inline /* implicit */ ast_expr_op_zdiv_r();
1257 inline /* implicit */ ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj);
1258 inline ast_expr_op_zdiv_r &operator=(ast_expr_op_zdiv_r obj);
1259 inline isl::ctx ctx() const;
1263 // declarations for isl::ast_node
1264 inline ast_node manage(__isl_take isl_ast_node *ptr);
1265 inline ast_node manage_copy(__isl_keep isl_ast_node *ptr);
1267 class ast_node {
1268 friend inline ast_node manage(__isl_take isl_ast_node *ptr);
1269 friend inline ast_node manage_copy(__isl_keep isl_ast_node *ptr);
1271 protected:
1272 isl_ast_node *ptr = nullptr;
1274 inline explicit ast_node(__isl_take isl_ast_node *ptr);
1276 public:
1277 inline /* implicit */ ast_node();
1278 inline /* implicit */ ast_node(const ast_node &obj);
1279 inline ast_node &operator=(ast_node obj);
1280 inline ~ast_node();
1281 inline __isl_give isl_ast_node *copy() const &;
1282 inline __isl_give isl_ast_node *copy() && = delete;
1283 inline __isl_keep isl_ast_node *get() const;
1284 inline __isl_give isl_ast_node *release();
1285 inline bool is_null() const;
1286 private:
1287 template <typename T,
1288 typename = typename std::enable_if<std::is_same<
1289 const decltype(isl_ast_node_get_type(NULL)),
1290 const T>::value>::type>
1291 inline bool isa_type(T subtype) const;
1292 public:
1293 template <class T> inline bool isa() const;
1294 template <class T> inline T as() const;
1295 inline isl::ctx ctx() const;
1297 inline isl::ast_node map_descendant_bottom_up(const std::function<isl::ast_node(isl::ast_node)> &fn) const;
1298 inline std::string to_C_str() const;
1299 inline isl::ast_node_list to_list() const;
1302 // declarations for isl::ast_node_block
1304 class ast_node_block : public ast_node {
1305 template <class T>
1306 friend bool ast_node::isa() const;
1307 friend ast_node_block ast_node::as<ast_node_block>() const;
1308 static const auto type = isl_ast_node_block;
1310 protected:
1311 inline explicit ast_node_block(__isl_take isl_ast_node *ptr);
1313 public:
1314 inline /* implicit */ ast_node_block();
1315 inline /* implicit */ ast_node_block(const ast_node_block &obj);
1316 inline explicit ast_node_block(isl::ast_node_list list);
1317 inline ast_node_block &operator=(ast_node_block obj);
1318 inline isl::ctx ctx() const;
1320 inline isl::ast_node_list children() const;
1321 inline isl::ast_node_list get_children() const;
1324 // declarations for isl::ast_node_for
1326 class ast_node_for : public ast_node {
1327 template <class T>
1328 friend bool ast_node::isa() const;
1329 friend ast_node_for ast_node::as<ast_node_for>() const;
1330 static const auto type = isl_ast_node_for;
1332 protected:
1333 inline explicit ast_node_for(__isl_take isl_ast_node *ptr);
1335 public:
1336 inline /* implicit */ ast_node_for();
1337 inline /* implicit */ ast_node_for(const ast_node_for &obj);
1338 inline ast_node_for &operator=(ast_node_for obj);
1339 inline isl::ctx ctx() const;
1341 inline isl::ast_node body() const;
1342 inline isl::ast_node get_body() const;
1343 inline isl::ast_expr cond() const;
1344 inline isl::ast_expr get_cond() const;
1345 inline isl::ast_expr inc() const;
1346 inline isl::ast_expr get_inc() const;
1347 inline isl::ast_expr init() const;
1348 inline isl::ast_expr get_init() const;
1349 inline bool is_degenerate() const;
1350 inline isl::ast_expr iterator() const;
1351 inline isl::ast_expr get_iterator() const;
1354 // declarations for isl::ast_node_if
1356 class ast_node_if : public ast_node {
1357 template <class T>
1358 friend bool ast_node::isa() const;
1359 friend ast_node_if ast_node::as<ast_node_if>() const;
1360 static const auto type = isl_ast_node_if;
1362 protected:
1363 inline explicit ast_node_if(__isl_take isl_ast_node *ptr);
1365 public:
1366 inline /* implicit */ ast_node_if();
1367 inline /* implicit */ ast_node_if(const ast_node_if &obj);
1368 inline ast_node_if &operator=(ast_node_if obj);
1369 inline isl::ctx ctx() const;
1371 inline isl::ast_expr cond() const;
1372 inline isl::ast_expr get_cond() const;
1373 inline isl::ast_node else_node() const;
1374 inline isl::ast_node get_else_node() const;
1375 inline bool has_else_node() const;
1376 inline isl::ast_node then_node() const;
1377 inline isl::ast_node get_then_node() const;
1380 // declarations for isl::ast_node_list
1381 inline ast_node_list manage(__isl_take isl_ast_node_list *ptr);
1382 inline ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr);
1384 class ast_node_list {
1385 friend inline ast_node_list manage(__isl_take isl_ast_node_list *ptr);
1386 friend inline ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr);
1388 protected:
1389 isl_ast_node_list *ptr = nullptr;
1391 inline explicit ast_node_list(__isl_take isl_ast_node_list *ptr);
1393 public:
1394 inline /* implicit */ ast_node_list();
1395 inline /* implicit */ ast_node_list(const ast_node_list &obj);
1396 inline explicit ast_node_list(isl::ctx ctx, int n);
1397 inline explicit ast_node_list(isl::ast_node el);
1398 inline ast_node_list &operator=(ast_node_list obj);
1399 inline ~ast_node_list();
1400 inline __isl_give isl_ast_node_list *copy() const &;
1401 inline __isl_give isl_ast_node_list *copy() && = delete;
1402 inline __isl_keep isl_ast_node_list *get() const;
1403 inline __isl_give isl_ast_node_list *release();
1404 inline bool is_null() const;
1405 inline isl::ctx ctx() const;
1407 inline isl::ast_node_list add(isl::ast_node el) const;
1408 inline isl::ast_node at(int index) const;
1409 inline isl::ast_node get_at(int index) const;
1410 inline isl::ast_node_list clear() const;
1411 inline isl::ast_node_list concat(isl::ast_node_list list2) const;
1412 inline isl::ast_node_list drop(unsigned int first, unsigned int n) const;
1413 inline void foreach(const std::function<void(isl::ast_node)> &fn) const;
1414 inline void foreach_scc(const std::function<bool(isl::ast_node, isl::ast_node)> &follows, const std::function<void(isl::ast_node_list)> &fn) const;
1415 inline isl::ast_node_list insert(unsigned int pos, isl::ast_node el) const;
1416 inline isl::ast_node_list set_at(int index, isl::ast_node el) const;
1417 inline unsigned size() const;
1420 // declarations for isl::ast_node_mark
1422 class ast_node_mark : public ast_node {
1423 template <class T>
1424 friend bool ast_node::isa() const;
1425 friend ast_node_mark ast_node::as<ast_node_mark>() const;
1426 static const auto type = isl_ast_node_mark;
1428 protected:
1429 inline explicit ast_node_mark(__isl_take isl_ast_node *ptr);
1431 public:
1432 inline /* implicit */ ast_node_mark();
1433 inline /* implicit */ ast_node_mark(const ast_node_mark &obj);
1434 inline ast_node_mark &operator=(ast_node_mark obj);
1435 inline isl::ctx ctx() const;
1437 inline isl::id id() const;
1438 inline isl::id get_id() const;
1439 inline isl::ast_node node() const;
1440 inline isl::ast_node get_node() const;
1443 // declarations for isl::ast_node_user
1445 class ast_node_user : public ast_node {
1446 template <class T>
1447 friend bool ast_node::isa() const;
1448 friend ast_node_user ast_node::as<ast_node_user>() const;
1449 static const auto type = isl_ast_node_user;
1451 protected:
1452 inline explicit ast_node_user(__isl_take isl_ast_node *ptr);
1454 public:
1455 inline /* implicit */ ast_node_user();
1456 inline /* implicit */ ast_node_user(const ast_node_user &obj);
1457 inline explicit ast_node_user(isl::ast_expr expr);
1458 inline ast_node_user &operator=(ast_node_user obj);
1459 inline isl::ctx ctx() const;
1461 inline isl::ast_expr expr() const;
1462 inline isl::ast_expr get_expr() const;
1465 // declarations for isl::basic_map
1466 inline basic_map manage(__isl_take isl_basic_map *ptr);
1467 inline basic_map manage_copy(__isl_keep isl_basic_map *ptr);
1469 class basic_map {
1470 friend inline basic_map manage(__isl_take isl_basic_map *ptr);
1471 friend inline basic_map manage_copy(__isl_keep isl_basic_map *ptr);
1473 protected:
1474 isl_basic_map *ptr = nullptr;
1476 inline explicit basic_map(__isl_take isl_basic_map *ptr);
1478 public:
1479 inline /* implicit */ basic_map();
1480 inline /* implicit */ basic_map(const basic_map &obj);
1481 inline explicit basic_map(isl::ctx ctx, const std::string &str);
1482 inline basic_map &operator=(basic_map obj);
1483 inline ~basic_map();
1484 inline __isl_give isl_basic_map *copy() const &;
1485 inline __isl_give isl_basic_map *copy() && = delete;
1486 inline __isl_keep isl_basic_map *get() const;
1487 inline __isl_give isl_basic_map *release();
1488 inline bool is_null() const;
1489 inline isl::ctx ctx() const;
1491 inline isl::basic_map affine_hull() const;
1492 inline isl::basic_map apply_domain(isl::basic_map bmap2) const;
1493 inline isl::map apply_domain(const isl::map &map2) const;
1494 inline isl::union_map apply_domain(const isl::union_map &umap2) const;
1495 inline isl::basic_map apply_range(isl::basic_map bmap2) const;
1496 inline isl::map apply_range(const isl::map &map2) const;
1497 inline isl::union_map apply_range(const isl::union_map &umap2) const;
1498 inline isl::map as_map() const;
1499 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
1500 inline isl::pw_multi_aff as_pw_multi_aff() const;
1501 inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
1502 inline isl::set bind_domain(const isl::multi_id &tuple) const;
1503 inline isl::set bind_range(const isl::multi_id &tuple) const;
1504 inline isl::map coalesce() const;
1505 inline isl::map complement() const;
1506 inline isl::union_map compute_divs() const;
1507 inline isl::map curry() const;
1508 inline isl::basic_set deltas() const;
1509 inline isl::basic_map detect_equalities() const;
1510 inline isl::set domain() const;
1511 inline isl::map domain_factor_domain() const;
1512 inline isl::map domain_factor_range() const;
1513 inline isl::union_map domain_map() const;
1514 inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
1515 inline isl::map domain_product(const isl::map &map2) const;
1516 inline isl::union_map domain_product(const isl::union_map &umap2) const;
1517 inline isl::map domain_reverse() const;
1518 inline unsigned domain_tuple_dim() const;
1519 inline isl::id domain_tuple_id() const;
1520 inline isl::map drop_unused_params() const;
1521 inline isl::map eq_at(const isl::multi_pw_aff &mpa) const;
1522 inline isl::union_map eq_at(const isl::multi_union_pw_aff &mupa) const;
1523 inline bool every_map(const std::function<bool(isl::map)> &test) const;
1524 inline isl::map extract_map(const isl::space &space) const;
1525 inline isl::map factor_domain() const;
1526 inline isl::map factor_range() const;
1527 inline isl::map fixed_power(const isl::val &exp) const;
1528 inline isl::map fixed_power(long exp) const;
1529 inline isl::basic_map flatten() const;
1530 inline isl::basic_map flatten_domain() const;
1531 inline isl::basic_map flatten_range() const;
1532 inline void foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const;
1533 inline void foreach_map(const std::function<void(isl::map)> &fn) const;
1534 inline isl::basic_map gist(isl::basic_map context) const;
1535 inline isl::map gist(const isl::map &context) const;
1536 inline isl::union_map gist(const isl::union_map &context) const;
1537 inline isl::map gist_domain(const isl::set &context) const;
1538 inline isl::union_map gist_domain(const isl::union_set &uset) const;
1539 inline isl::map gist_params(const isl::set &context) const;
1540 inline isl::union_map gist_range(const isl::union_set &uset) const;
1541 inline bool has_domain_tuple_id() const;
1542 inline bool has_range_tuple_id() const;
1543 inline isl::basic_map intersect(isl::basic_map bmap2) const;
1544 inline isl::map intersect(const isl::map &map2) const;
1545 inline isl::union_map intersect(const isl::union_map &umap2) const;
1546 inline isl::basic_map intersect_domain(isl::basic_set bset) const;
1547 inline isl::map intersect_domain(const isl::set &set) const;
1548 inline isl::union_map intersect_domain(const isl::space &space) const;
1549 inline isl::union_map intersect_domain(const isl::union_set &uset) const;
1550 inline isl::basic_map intersect_domain(const isl::point &bset) const;
1551 inline isl::map intersect_domain_factor_domain(const isl::map &factor) const;
1552 inline isl::union_map intersect_domain_factor_domain(const isl::union_map &factor) const;
1553 inline isl::map intersect_domain_factor_range(const isl::map &factor) const;
1554 inline isl::union_map intersect_domain_factor_range(const isl::union_map &factor) const;
1555 inline isl::map intersect_domain_wrapped_domain(const isl::set &domain) const;
1556 inline isl::union_map intersect_domain_wrapped_domain(const isl::union_set &domain) const;
1557 inline isl::basic_map intersect_params(isl::basic_set bset) const;
1558 inline isl::map intersect_params(const isl::set &params) const;
1559 inline isl::basic_map intersect_params(const isl::point &bset) const;
1560 inline isl::basic_map intersect_range(isl::basic_set bset) const;
1561 inline isl::map intersect_range(const isl::set &set) const;
1562 inline isl::union_map intersect_range(const isl::space &space) const;
1563 inline isl::union_map intersect_range(const isl::union_set &uset) const;
1564 inline isl::basic_map intersect_range(const isl::point &bset) const;
1565 inline isl::map intersect_range_factor_domain(const isl::map &factor) const;
1566 inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
1567 inline isl::map intersect_range_factor_range(const isl::map &factor) const;
1568 inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
1569 inline isl::map intersect_range_wrapped_domain(const isl::set &domain) const;
1570 inline isl::union_map intersect_range_wrapped_domain(const isl::union_set &domain) const;
1571 inline bool is_bijective() const;
1572 inline bool is_disjoint(const isl::map &map2) const;
1573 inline bool is_disjoint(const isl::union_map &umap2) const;
1574 inline bool is_empty() const;
1575 inline bool is_equal(const isl::basic_map &bmap2) const;
1576 inline bool is_equal(const isl::map &map2) const;
1577 inline bool is_equal(const isl::union_map &umap2) const;
1578 inline bool is_injective() const;
1579 inline bool is_single_valued() const;
1580 inline bool is_strict_subset(const isl::map &map2) const;
1581 inline bool is_strict_subset(const isl::union_map &umap2) const;
1582 inline bool is_subset(const isl::basic_map &bmap2) const;
1583 inline bool is_subset(const isl::map &map2) const;
1584 inline bool is_subset(const isl::union_map &umap2) const;
1585 inline bool isa_map() const;
1586 inline isl::map lex_ge_at(const isl::multi_pw_aff &mpa) const;
1587 inline isl::map lex_gt_at(const isl::multi_pw_aff &mpa) const;
1588 inline isl::map lex_le_at(const isl::multi_pw_aff &mpa) const;
1589 inline isl::map lex_lt_at(const isl::multi_pw_aff &mpa) const;
1590 inline isl::map lexmax() const;
1591 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1592 inline isl::map lexmin() const;
1593 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1594 inline isl::map lower_bound(const isl::multi_pw_aff &lower) const;
1595 inline isl::map_list map_list() const;
1596 inline isl::multi_pw_aff max_multi_pw_aff() const;
1597 inline isl::multi_pw_aff min_multi_pw_aff() const;
1598 inline unsigned n_basic_map() const;
1599 inline isl::set params() const;
1600 inline isl::basic_map polyhedral_hull() const;
1601 inline isl::map preimage_domain(const isl::multi_aff &ma) const;
1602 inline isl::map preimage_domain(const isl::multi_pw_aff &mpa) const;
1603 inline isl::map preimage_domain(const isl::pw_multi_aff &pma) const;
1604 inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
1605 inline isl::map preimage_range(const isl::multi_aff &ma) const;
1606 inline isl::map preimage_range(const isl::pw_multi_aff &pma) const;
1607 inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
1608 inline isl::map product(const isl::map &map2) const;
1609 inline isl::union_map product(const isl::union_map &umap2) const;
1610 inline isl::map project_out_all_params() const;
1611 inline isl::map project_out_param(const isl::id &id) const;
1612 inline isl::map project_out_param(const std::string &id) const;
1613 inline isl::map project_out_param(const isl::id_list &list) const;
1614 inline isl::set range() const;
1615 inline isl::map range_factor_domain() const;
1616 inline isl::map range_factor_range() const;
1617 inline isl::fixed_box range_lattice_tile() const;
1618 inline isl::union_map range_map() const;
1619 inline isl::map range_product(const isl::map &map2) const;
1620 inline isl::union_map range_product(const isl::union_map &umap2) const;
1621 inline isl::map range_reverse() const;
1622 inline isl::fixed_box range_simple_fixed_box_hull() const;
1623 inline unsigned range_tuple_dim() const;
1624 inline isl::id range_tuple_id() const;
1625 inline isl::basic_map reverse() const;
1626 inline isl::basic_map sample() const;
1627 inline isl::map set_domain_tuple(const isl::id &id) const;
1628 inline isl::map set_domain_tuple(const std::string &id) const;
1629 inline isl::map set_range_tuple(const isl::id &id) const;
1630 inline isl::map set_range_tuple(const std::string &id) const;
1631 inline isl::space space() const;
1632 inline isl::map subtract(const isl::map &map2) const;
1633 inline isl::union_map subtract(const isl::union_map &umap2) const;
1634 inline isl::union_map subtract_domain(const isl::union_set &dom) const;
1635 inline isl::union_map subtract_range(const isl::union_set &dom) const;
1636 inline isl::map_list to_list() const;
1637 inline isl::union_map to_union_map() const;
1638 inline isl::map uncurry() const;
1639 inline isl::map unite(isl::basic_map bmap2) const;
1640 inline isl::map unite(const isl::map &map2) const;
1641 inline isl::union_map unite(const isl::union_map &umap2) const;
1642 inline isl::basic_map unshifted_simple_hull() const;
1643 inline isl::map upper_bound(const isl::multi_pw_aff &upper) const;
1644 inline isl::set wrap() const;
1645 inline isl::map zip() const;
1648 // declarations for isl::basic_set
1649 inline basic_set manage(__isl_take isl_basic_set *ptr);
1650 inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1652 class basic_set {
1653 friend inline basic_set manage(__isl_take isl_basic_set *ptr);
1654 friend inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1656 protected:
1657 isl_basic_set *ptr = nullptr;
1659 inline explicit basic_set(__isl_take isl_basic_set *ptr);
1661 public:
1662 inline /* implicit */ basic_set();
1663 inline /* implicit */ basic_set(const basic_set &obj);
1664 inline /* implicit */ basic_set(isl::point pnt);
1665 inline explicit basic_set(isl::ctx ctx, const std::string &str);
1666 inline basic_set &operator=(basic_set obj);
1667 inline ~basic_set();
1668 inline __isl_give isl_basic_set *copy() const &;
1669 inline __isl_give isl_basic_set *copy() && = delete;
1670 inline __isl_keep isl_basic_set *get() const;
1671 inline __isl_give isl_basic_set *release();
1672 inline bool is_null() const;
1673 inline isl::ctx ctx() const;
1675 inline isl::basic_set affine_hull() const;
1676 inline isl::basic_set apply(isl::basic_map bmap) const;
1677 inline isl::set apply(const isl::map &map) const;
1678 inline isl::union_set apply(const isl::union_map &umap) const;
1679 inline isl::pw_multi_aff as_pw_multi_aff() const;
1680 inline isl::set as_set() const;
1681 inline isl::set bind(const isl::multi_id &tuple) const;
1682 inline isl::set coalesce() const;
1683 inline isl::set complement() const;
1684 inline isl::union_set compute_divs() const;
1685 inline isl::basic_set detect_equalities() const;
1686 inline isl::val dim_max_val(int pos) const;
1687 inline isl::val dim_min_val(int pos) const;
1688 inline isl::set drop_unused_params() const;
1689 inline bool every_set(const std::function<bool(isl::set)> &test) const;
1690 inline isl::set extract_set(const isl::space &space) const;
1691 inline isl::basic_set flatten() const;
1692 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
1693 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
1694 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
1695 inline isl::basic_set gist(isl::basic_set context) const;
1696 inline isl::set gist(const isl::set &context) const;
1697 inline isl::union_set gist(const isl::union_set &context) const;
1698 inline isl::basic_set gist(const isl::point &context) const;
1699 inline isl::set gist_params(const isl::set &context) const;
1700 inline isl::map identity() const;
1701 inline isl::pw_aff indicator_function() const;
1702 inline isl::map insert_domain(const isl::space &domain) const;
1703 inline isl::basic_set intersect(isl::basic_set bset2) const;
1704 inline isl::set intersect(const isl::set &set2) const;
1705 inline isl::union_set intersect(const isl::union_set &uset2) const;
1706 inline isl::basic_set intersect(const isl::point &bset2) const;
1707 inline isl::basic_set intersect_params(isl::basic_set bset2) const;
1708 inline isl::set intersect_params(const isl::set &params) const;
1709 inline isl::basic_set intersect_params(const isl::point &bset2) const;
1710 inline bool involves_locals() const;
1711 inline bool is_disjoint(const isl::set &set2) const;
1712 inline bool is_disjoint(const isl::union_set &uset2) const;
1713 inline bool is_empty() const;
1714 inline bool is_equal(const isl::basic_set &bset2) const;
1715 inline bool is_equal(const isl::set &set2) const;
1716 inline bool is_equal(const isl::union_set &uset2) const;
1717 inline bool is_equal(const isl::point &bset2) const;
1718 inline bool is_singleton() const;
1719 inline bool is_strict_subset(const isl::set &set2) const;
1720 inline bool is_strict_subset(const isl::union_set &uset2) const;
1721 inline bool is_subset(const isl::basic_set &bset2) const;
1722 inline bool is_subset(const isl::set &set2) const;
1723 inline bool is_subset(const isl::union_set &uset2) const;
1724 inline bool is_subset(const isl::point &bset2) const;
1725 inline bool is_wrapping() const;
1726 inline bool isa_set() const;
1727 inline isl::fixed_box lattice_tile() const;
1728 inline isl::set lexmax() const;
1729 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1730 inline isl::set lexmin() const;
1731 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1732 inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
1733 inline isl::set lower_bound(const isl::multi_val &lower) const;
1734 inline isl::multi_pw_aff max_multi_pw_aff() const;
1735 inline isl::val max_val(const isl::aff &obj) const;
1736 inline isl::multi_pw_aff min_multi_pw_aff() const;
1737 inline isl::val min_val(const isl::aff &obj) const;
1738 inline unsigned n_basic_set() const;
1739 inline isl::pw_aff param_pw_aff_on_domain(const isl::id &id) const;
1740 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
1741 inline isl::basic_set params() const;
1742 inline isl::multi_val plain_multi_val_if_fixed() const;
1743 inline isl::basic_set polyhedral_hull() const;
1744 inline isl::set preimage(const isl::multi_aff &ma) const;
1745 inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
1746 inline isl::set preimage(const isl::pw_multi_aff &pma) const;
1747 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
1748 inline isl::set product(const isl::set &set2) const;
1749 inline isl::set project_out_all_params() const;
1750 inline isl::set project_out_param(const isl::id &id) const;
1751 inline isl::set project_out_param(const std::string &id) const;
1752 inline isl::set project_out_param(const isl::id_list &list) const;
1753 inline isl::pw_aff pw_aff_on_domain(const isl::val &v) const;
1754 inline isl::pw_aff pw_aff_on_domain(long v) const;
1755 inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
1756 inline isl::basic_set sample() const;
1757 inline isl::point sample_point() const;
1758 inline isl::set_list set_list() const;
1759 inline isl::fixed_box simple_fixed_box_hull() const;
1760 inline isl::space space() const;
1761 inline isl::val stride(int pos) const;
1762 inline isl::set subtract(const isl::set &set2) const;
1763 inline isl::union_set subtract(const isl::union_set &uset2) const;
1764 inline isl::set_list to_list() const;
1765 inline isl::set to_set() const;
1766 inline isl::union_set to_union_set() const;
1767 inline isl::map translation() const;
1768 inline unsigned tuple_dim() const;
1769 inline isl::set unbind_params(const isl::multi_id &tuple) const;
1770 inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
1771 inline isl::set unite(isl::basic_set bset2) const;
1772 inline isl::set unite(const isl::set &set2) const;
1773 inline isl::union_set unite(const isl::union_set &uset2) const;
1774 inline isl::set unite(const isl::point &bset2) const;
1775 inline isl::basic_set unshifted_simple_hull() const;
1776 inline isl::map unwrap() const;
1777 inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
1778 inline isl::set upper_bound(const isl::multi_val &upper) const;
1779 inline isl::set wrapped_reverse() const;
1782 // declarations for isl::fixed_box
1783 inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1784 inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1786 class fixed_box {
1787 friend inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1788 friend inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1790 protected:
1791 isl_fixed_box *ptr = nullptr;
1793 inline explicit fixed_box(__isl_take isl_fixed_box *ptr);
1795 public:
1796 inline /* implicit */ fixed_box();
1797 inline /* implicit */ fixed_box(const fixed_box &obj);
1798 inline explicit fixed_box(isl::ctx ctx, const std::string &str);
1799 inline fixed_box &operator=(fixed_box obj);
1800 inline ~fixed_box();
1801 inline __isl_give isl_fixed_box *copy() const &;
1802 inline __isl_give isl_fixed_box *copy() && = delete;
1803 inline __isl_keep isl_fixed_box *get() const;
1804 inline __isl_give isl_fixed_box *release();
1805 inline bool is_null() const;
1806 inline isl::ctx ctx() const;
1808 inline bool is_valid() const;
1809 inline isl::multi_aff offset() const;
1810 inline isl::multi_aff get_offset() const;
1811 inline isl::multi_val size() const;
1812 inline isl::multi_val get_size() const;
1813 inline isl::space space() const;
1814 inline isl::space get_space() const;
1817 // declarations for isl::id
1818 inline id manage(__isl_take isl_id *ptr);
1819 inline id manage_copy(__isl_keep isl_id *ptr);
1821 class id {
1822 friend inline id manage(__isl_take isl_id *ptr);
1823 friend inline id manage_copy(__isl_keep isl_id *ptr);
1825 protected:
1826 isl_id *ptr = nullptr;
1828 inline explicit id(__isl_take isl_id *ptr);
1830 public:
1831 inline /* implicit */ id();
1832 inline /* implicit */ id(const id &obj);
1833 inline explicit id(isl::ctx ctx, const std::string &str);
1834 inline id &operator=(id obj);
1835 inline ~id();
1836 inline __isl_give isl_id *copy() const &;
1837 inline __isl_give isl_id *copy() && = delete;
1838 inline __isl_keep isl_id *get() const;
1839 inline __isl_give isl_id *release();
1840 inline bool is_null() const;
1841 inline isl::ctx ctx() const;
1843 inline std::string name() const;
1844 inline std::string get_name() const;
1845 inline isl::id_list to_list() const;
1847 #if __cplusplus >= 201703L
1848 inline explicit id(isl::ctx ctx, const std::string &str, const std::any &any);
1849 template <class T>
1850 std::optional<T> try_user() const;
1851 template <class T>
1852 T user() const;
1853 #endif
1856 // declarations for isl::id_list
1857 inline id_list manage(__isl_take isl_id_list *ptr);
1858 inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1860 class id_list {
1861 friend inline id_list manage(__isl_take isl_id_list *ptr);
1862 friend inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1864 protected:
1865 isl_id_list *ptr = nullptr;
1867 inline explicit id_list(__isl_take isl_id_list *ptr);
1869 public:
1870 inline /* implicit */ id_list();
1871 inline /* implicit */ id_list(const id_list &obj);
1872 inline explicit id_list(isl::ctx ctx, int n);
1873 inline explicit id_list(isl::id el);
1874 inline explicit id_list(isl::ctx ctx, const std::string &str);
1875 inline id_list &operator=(id_list obj);
1876 inline ~id_list();
1877 inline __isl_give isl_id_list *copy() const &;
1878 inline __isl_give isl_id_list *copy() && = delete;
1879 inline __isl_keep isl_id_list *get() const;
1880 inline __isl_give isl_id_list *release();
1881 inline bool is_null() const;
1882 inline isl::ctx ctx() const;
1884 inline isl::id_list add(isl::id el) const;
1885 inline isl::id_list add(const std::string &el) const;
1886 inline isl::id at(int index) const;
1887 inline isl::id get_at(int index) const;
1888 inline isl::id_list clear() const;
1889 inline isl::id_list concat(isl::id_list list2) const;
1890 inline isl::id_list drop(unsigned int first, unsigned int n) const;
1891 inline void foreach(const std::function<void(isl::id)> &fn) const;
1892 inline void foreach_scc(const std::function<bool(isl::id, isl::id)> &follows, const std::function<void(isl::id_list)> &fn) const;
1893 inline isl::id_list insert(unsigned int pos, isl::id el) const;
1894 inline isl::id_list insert(unsigned int pos, const std::string &el) const;
1895 inline isl::id_list set_at(int index, isl::id el) const;
1896 inline isl::id_list set_at(int index, const std::string &el) const;
1897 inline unsigned size() const;
1900 // declarations for isl::id_to_ast_expr
1901 inline id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr);
1902 inline id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr);
1904 class id_to_ast_expr {
1905 friend inline id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr);
1906 friend inline id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr);
1908 protected:
1909 isl_id_to_ast_expr *ptr = nullptr;
1911 inline explicit id_to_ast_expr(__isl_take isl_id_to_ast_expr *ptr);
1913 public:
1914 inline /* implicit */ id_to_ast_expr();
1915 inline /* implicit */ id_to_ast_expr(const id_to_ast_expr &obj);
1916 inline explicit id_to_ast_expr(isl::ctx ctx, int min_size);
1917 inline explicit id_to_ast_expr(isl::ctx ctx, const std::string &str);
1918 inline id_to_ast_expr &operator=(id_to_ast_expr obj);
1919 inline ~id_to_ast_expr();
1920 inline __isl_give isl_id_to_ast_expr *copy() const &;
1921 inline __isl_give isl_id_to_ast_expr *copy() && = delete;
1922 inline __isl_keep isl_id_to_ast_expr *get() const;
1923 inline __isl_give isl_id_to_ast_expr *release();
1924 inline bool is_null() const;
1925 inline isl::ctx ctx() const;
1927 inline bool is_equal(const isl::id_to_ast_expr &hmap2) const;
1928 inline isl::id_to_ast_expr set(isl::id key, isl::ast_expr val) const;
1929 inline isl::id_to_ast_expr set(const std::string &key, const isl::ast_expr &val) const;
1932 // declarations for isl::id_to_id
1933 inline id_to_id manage(__isl_take isl_id_to_id *ptr);
1934 inline id_to_id manage_copy(__isl_keep isl_id_to_id *ptr);
1936 class id_to_id {
1937 friend inline id_to_id manage(__isl_take isl_id_to_id *ptr);
1938 friend inline id_to_id manage_copy(__isl_keep isl_id_to_id *ptr);
1940 protected:
1941 isl_id_to_id *ptr = nullptr;
1943 inline explicit id_to_id(__isl_take isl_id_to_id *ptr);
1945 public:
1946 inline /* implicit */ id_to_id();
1947 inline /* implicit */ id_to_id(const id_to_id &obj);
1948 inline explicit id_to_id(isl::ctx ctx, int min_size);
1949 inline explicit id_to_id(isl::ctx ctx, const std::string &str);
1950 inline id_to_id &operator=(id_to_id obj);
1951 inline ~id_to_id();
1952 inline __isl_give isl_id_to_id *copy() const &;
1953 inline __isl_give isl_id_to_id *copy() && = delete;
1954 inline __isl_keep isl_id_to_id *get() const;
1955 inline __isl_give isl_id_to_id *release();
1956 inline bool is_null() const;
1957 inline isl::ctx ctx() const;
1959 inline bool is_equal(const isl::id_to_id &hmap2) const;
1960 inline isl::id_to_id set(isl::id key, isl::id val) const;
1961 inline isl::id_to_id set(const isl::id &key, const std::string &val) const;
1962 inline isl::id_to_id set(const std::string &key, const isl::id &val) const;
1963 inline isl::id_to_id set(const std::string &key, const std::string &val) const;
1966 // declarations for isl::map
1967 inline map manage(__isl_take isl_map *ptr);
1968 inline map manage_copy(__isl_keep isl_map *ptr);
1970 class map {
1971 friend inline map manage(__isl_take isl_map *ptr);
1972 friend inline map manage_copy(__isl_keep isl_map *ptr);
1974 protected:
1975 isl_map *ptr = nullptr;
1977 inline explicit map(__isl_take isl_map *ptr);
1979 public:
1980 inline /* implicit */ map();
1981 inline /* implicit */ map(const map &obj);
1982 inline /* implicit */ map(isl::basic_map bmap);
1983 inline explicit map(isl::ctx ctx, const std::string &str);
1984 inline map &operator=(map obj);
1985 inline ~map();
1986 inline __isl_give isl_map *copy() const &;
1987 inline __isl_give isl_map *copy() && = delete;
1988 inline __isl_keep isl_map *get() const;
1989 inline __isl_give isl_map *release();
1990 inline bool is_null() const;
1991 inline isl::ctx ctx() const;
1993 inline isl::basic_map affine_hull() const;
1994 inline isl::map apply_domain(isl::map map2) const;
1995 inline isl::union_map apply_domain(const isl::union_map &umap2) const;
1996 inline isl::map apply_domain(const isl::basic_map &map2) const;
1997 inline isl::map apply_range(isl::map map2) const;
1998 inline isl::union_map apply_range(const isl::union_map &umap2) const;
1999 inline isl::map apply_range(const isl::basic_map &map2) const;
2000 inline isl::map as_map() const;
2001 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2002 inline isl::pw_multi_aff as_pw_multi_aff() const;
2003 inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
2004 inline isl::set bind_domain(isl::multi_id tuple) const;
2005 inline isl::set bind_range(isl::multi_id tuple) const;
2006 inline isl::map coalesce() const;
2007 inline isl::map complement() const;
2008 inline isl::union_map compute_divs() const;
2009 inline isl::map curry() const;
2010 inline isl::set deltas() const;
2011 inline isl::map detect_equalities() const;
2012 inline isl::set domain() const;
2013 inline isl::map domain_factor_domain() const;
2014 inline isl::map domain_factor_range() const;
2015 inline isl::union_map domain_map() const;
2016 inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
2017 inline isl::map domain_product(isl::map map2) const;
2018 inline isl::union_map domain_product(const isl::union_map &umap2) const;
2019 inline isl::map domain_product(const isl::basic_map &map2) const;
2020 inline isl::map domain_reverse() const;
2021 inline unsigned domain_tuple_dim() const;
2022 inline isl::id domain_tuple_id() const;
2023 inline isl::id get_domain_tuple_id() const;
2024 inline isl::map drop_unused_params() const;
2025 static inline isl::map empty(isl::space space);
2026 inline isl::map eq_at(isl::multi_pw_aff mpa) const;
2027 inline isl::union_map eq_at(const isl::multi_union_pw_aff &mupa) const;
2028 inline isl::map eq_at(const isl::aff &mpa) const;
2029 inline isl::map eq_at(const isl::multi_aff &mpa) const;
2030 inline isl::map eq_at(const isl::pw_aff &mpa) const;
2031 inline isl::map eq_at(const isl::pw_multi_aff &mpa) const;
2032 inline bool every_map(const std::function<bool(isl::map)> &test) const;
2033 inline isl::map extract_map(const isl::space &space) const;
2034 inline isl::map factor_domain() const;
2035 inline isl::map factor_range() const;
2036 inline isl::map fixed_power(isl::val exp) const;
2037 inline isl::map fixed_power(long exp) const;
2038 inline isl::map flatten() const;
2039 inline isl::map flatten_domain() const;
2040 inline isl::map flatten_range() const;
2041 inline void foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const;
2042 inline void foreach_map(const std::function<void(isl::map)> &fn) const;
2043 inline isl::map gist(isl::map context) const;
2044 inline isl::union_map gist(const isl::union_map &context) const;
2045 inline isl::map gist(const isl::basic_map &context) const;
2046 inline isl::map gist_domain(isl::set context) const;
2047 inline isl::union_map gist_domain(const isl::union_set &uset) const;
2048 inline isl::map gist_domain(const isl::basic_set &context) const;
2049 inline isl::map gist_domain(const isl::point &context) const;
2050 inline isl::map gist_params(isl::set context) const;
2051 inline isl::union_map gist_range(const isl::union_set &uset) const;
2052 inline bool has_domain_tuple_id() const;
2053 inline bool has_range_tuple_id() const;
2054 inline isl::map intersect(isl::map map2) const;
2055 inline isl::union_map intersect(const isl::union_map &umap2) const;
2056 inline isl::map intersect(const isl::basic_map &map2) const;
2057 inline isl::map intersect_domain(isl::set set) const;
2058 inline isl::union_map intersect_domain(const isl::space &space) const;
2059 inline isl::union_map intersect_domain(const isl::union_set &uset) const;
2060 inline isl::map intersect_domain(const isl::basic_set &set) const;
2061 inline isl::map intersect_domain(const isl::point &set) const;
2062 inline isl::map intersect_domain_factor_domain(isl::map factor) const;
2063 inline isl::union_map intersect_domain_factor_domain(const isl::union_map &factor) const;
2064 inline isl::map intersect_domain_factor_domain(const isl::basic_map &factor) const;
2065 inline isl::map intersect_domain_factor_range(isl::map factor) const;
2066 inline isl::union_map intersect_domain_factor_range(const isl::union_map &factor) const;
2067 inline isl::map intersect_domain_factor_range(const isl::basic_map &factor) const;
2068 inline isl::map intersect_domain_wrapped_domain(isl::set domain) const;
2069 inline isl::union_map intersect_domain_wrapped_domain(const isl::union_set &domain) const;
2070 inline isl::map intersect_domain_wrapped_domain(const isl::basic_set &domain) const;
2071 inline isl::map intersect_domain_wrapped_domain(const isl::point &domain) const;
2072 inline isl::map intersect_params(isl::set params) const;
2073 inline isl::map intersect_range(isl::set set) const;
2074 inline isl::union_map intersect_range(const isl::space &space) const;
2075 inline isl::union_map intersect_range(const isl::union_set &uset) const;
2076 inline isl::map intersect_range(const isl::basic_set &set) const;
2077 inline isl::map intersect_range(const isl::point &set) const;
2078 inline isl::map intersect_range_factor_domain(isl::map factor) const;
2079 inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
2080 inline isl::map intersect_range_factor_domain(const isl::basic_map &factor) const;
2081 inline isl::map intersect_range_factor_range(isl::map factor) const;
2082 inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
2083 inline isl::map intersect_range_factor_range(const isl::basic_map &factor) const;
2084 inline isl::map intersect_range_wrapped_domain(isl::set domain) const;
2085 inline isl::union_map intersect_range_wrapped_domain(const isl::union_set &domain) const;
2086 inline isl::map intersect_range_wrapped_domain(const isl::basic_set &domain) const;
2087 inline isl::map intersect_range_wrapped_domain(const isl::point &domain) const;
2088 inline bool is_bijective() const;
2089 inline bool is_disjoint(const isl::map &map2) const;
2090 inline bool is_disjoint(const isl::union_map &umap2) const;
2091 inline bool is_disjoint(const isl::basic_map &map2) const;
2092 inline bool is_empty() const;
2093 inline bool is_equal(const isl::map &map2) const;
2094 inline bool is_equal(const isl::union_map &umap2) const;
2095 inline bool is_equal(const isl::basic_map &map2) const;
2096 inline bool is_injective() const;
2097 inline bool is_single_valued() const;
2098 inline bool is_strict_subset(const isl::map &map2) const;
2099 inline bool is_strict_subset(const isl::union_map &umap2) const;
2100 inline bool is_strict_subset(const isl::basic_map &map2) const;
2101 inline bool is_subset(const isl::map &map2) const;
2102 inline bool is_subset(const isl::union_map &umap2) const;
2103 inline bool is_subset(const isl::basic_map &map2) const;
2104 inline bool isa_map() const;
2105 inline isl::map lex_ge_at(isl::multi_pw_aff mpa) const;
2106 inline isl::map lex_gt_at(isl::multi_pw_aff mpa) const;
2107 inline isl::map lex_le_at(isl::multi_pw_aff mpa) const;
2108 inline isl::map lex_lt_at(isl::multi_pw_aff mpa) const;
2109 inline isl::map lexmax() const;
2110 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
2111 inline isl::map lexmin() const;
2112 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
2113 inline isl::map lower_bound(isl::multi_pw_aff lower) const;
2114 inline isl::map_list map_list() const;
2115 inline isl::multi_pw_aff max_multi_pw_aff() const;
2116 inline isl::multi_pw_aff min_multi_pw_aff() const;
2117 inline unsigned n_basic_map() const;
2118 inline isl::set params() const;
2119 inline isl::basic_map polyhedral_hull() const;
2120 inline isl::map preimage_domain(isl::multi_aff ma) const;
2121 inline isl::map preimage_domain(isl::multi_pw_aff mpa) const;
2122 inline isl::map preimage_domain(isl::pw_multi_aff pma) const;
2123 inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
2124 inline isl::map preimage_range(isl::multi_aff ma) const;
2125 inline isl::map preimage_range(isl::pw_multi_aff pma) const;
2126 inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
2127 inline isl::map product(isl::map map2) const;
2128 inline isl::union_map product(const isl::union_map &umap2) const;
2129 inline isl::map product(const isl::basic_map &map2) const;
2130 inline isl::map project_out_all_params() const;
2131 inline isl::map project_out_param(isl::id id) const;
2132 inline isl::map project_out_param(const std::string &id) const;
2133 inline isl::map project_out_param(isl::id_list list) const;
2134 inline isl::set range() const;
2135 inline isl::map range_factor_domain() const;
2136 inline isl::map range_factor_range() const;
2137 inline isl::fixed_box range_lattice_tile() const;
2138 inline isl::fixed_box get_range_lattice_tile() const;
2139 inline isl::union_map range_map() const;
2140 inline isl::map range_product(isl::map map2) const;
2141 inline isl::union_map range_product(const isl::union_map &umap2) const;
2142 inline isl::map range_product(const isl::basic_map &map2) const;
2143 inline isl::map range_reverse() const;
2144 inline isl::fixed_box range_simple_fixed_box_hull() const;
2145 inline isl::fixed_box get_range_simple_fixed_box_hull() const;
2146 inline unsigned range_tuple_dim() const;
2147 inline isl::id range_tuple_id() const;
2148 inline isl::id get_range_tuple_id() const;
2149 inline isl::map reverse() const;
2150 inline isl::basic_map sample() const;
2151 inline isl::map set_domain_tuple(isl::id id) const;
2152 inline isl::map set_domain_tuple(const std::string &id) const;
2153 inline isl::map set_range_tuple(isl::id id) const;
2154 inline isl::map set_range_tuple(const std::string &id) const;
2155 inline isl::space space() const;
2156 inline isl::space get_space() const;
2157 inline isl::map subtract(isl::map map2) const;
2158 inline isl::union_map subtract(const isl::union_map &umap2) const;
2159 inline isl::map subtract(const isl::basic_map &map2) const;
2160 inline isl::union_map subtract_domain(const isl::union_set &dom) const;
2161 inline isl::union_map subtract_range(const isl::union_set &dom) const;
2162 inline isl::map_list to_list() const;
2163 inline isl::union_map to_union_map() const;
2164 inline isl::map uncurry() const;
2165 inline isl::map unite(isl::map map2) const;
2166 inline isl::union_map unite(const isl::union_map &umap2) const;
2167 inline isl::map unite(const isl::basic_map &map2) const;
2168 static inline isl::map universe(isl::space space);
2169 inline isl::basic_map unshifted_simple_hull() const;
2170 inline isl::map upper_bound(isl::multi_pw_aff upper) const;
2171 inline isl::set wrap() const;
2172 inline isl::map zip() const;
2175 // declarations for isl::map_list
2176 inline map_list manage(__isl_take isl_map_list *ptr);
2177 inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2179 class map_list {
2180 friend inline map_list manage(__isl_take isl_map_list *ptr);
2181 friend inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2183 protected:
2184 isl_map_list *ptr = nullptr;
2186 inline explicit map_list(__isl_take isl_map_list *ptr);
2188 public:
2189 inline /* implicit */ map_list();
2190 inline /* implicit */ map_list(const map_list &obj);
2191 inline explicit map_list(isl::ctx ctx, int n);
2192 inline explicit map_list(isl::map el);
2193 inline explicit map_list(isl::ctx ctx, const std::string &str);
2194 inline map_list &operator=(map_list obj);
2195 inline ~map_list();
2196 inline __isl_give isl_map_list *copy() const &;
2197 inline __isl_give isl_map_list *copy() && = delete;
2198 inline __isl_keep isl_map_list *get() const;
2199 inline __isl_give isl_map_list *release();
2200 inline bool is_null() const;
2201 inline isl::ctx ctx() const;
2203 inline isl::map_list add(isl::map el) const;
2204 inline isl::map at(int index) const;
2205 inline isl::map get_at(int index) const;
2206 inline isl::map_list clear() const;
2207 inline isl::map_list concat(isl::map_list list2) const;
2208 inline isl::map_list drop(unsigned int first, unsigned int n) const;
2209 inline void foreach(const std::function<void(isl::map)> &fn) const;
2210 inline void foreach_scc(const std::function<bool(isl::map, isl::map)> &follows, const std::function<void(isl::map_list)> &fn) const;
2211 inline isl::map_list insert(unsigned int pos, isl::map el) const;
2212 inline isl::map_list set_at(int index, isl::map el) const;
2213 inline unsigned size() const;
2216 // declarations for isl::multi_aff
2217 inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2218 inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2220 class multi_aff {
2221 friend inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2222 friend inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2224 protected:
2225 isl_multi_aff *ptr = nullptr;
2227 inline explicit multi_aff(__isl_take isl_multi_aff *ptr);
2229 public:
2230 inline /* implicit */ multi_aff();
2231 inline /* implicit */ multi_aff(const multi_aff &obj);
2232 inline /* implicit */ multi_aff(isl::aff aff);
2233 inline explicit multi_aff(isl::space space, isl::aff_list list);
2234 inline explicit multi_aff(isl::ctx ctx, const std::string &str);
2235 inline multi_aff &operator=(multi_aff obj);
2236 inline ~multi_aff();
2237 inline __isl_give isl_multi_aff *copy() const &;
2238 inline __isl_give isl_multi_aff *copy() && = delete;
2239 inline __isl_keep isl_multi_aff *get() const;
2240 inline __isl_give isl_multi_aff *release();
2241 inline bool is_null() const;
2242 inline isl::ctx ctx() const;
2244 inline isl::multi_aff add(isl::multi_aff multi2) const;
2245 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2246 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2247 inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2248 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2249 inline isl::multi_aff add(const isl::aff &multi2) const;
2250 inline isl::multi_aff add_constant(isl::multi_val mv) const;
2251 inline isl::multi_aff add_constant(isl::val v) const;
2252 inline isl::multi_aff add_constant(long v) const;
2253 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2254 inline isl::map as_map() const;
2255 inline isl::multi_aff as_multi_aff() const;
2256 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2257 inline isl::pw_multi_aff as_pw_multi_aff() const;
2258 inline isl::set as_set() const;
2259 inline isl::union_map as_union_map() const;
2260 inline isl::aff at(int pos) const;
2261 inline isl::aff get_at(int pos) const;
2262 inline isl::basic_set bind(isl::multi_id tuple) const;
2263 inline isl::multi_aff bind_domain(isl::multi_id tuple) const;
2264 inline isl::multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2265 inline isl::pw_multi_aff coalesce() const;
2266 inline isl::multi_val constant_multi_val() const;
2267 inline isl::multi_val get_constant_multi_val() const;
2268 inline isl::set domain() const;
2269 static inline isl::multi_aff domain_map(isl::space space);
2270 inline isl::multi_aff domain_reverse() const;
2271 inline isl::pw_multi_aff drop_unused_params() const;
2272 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2273 inline isl::multi_aff flat_range_product(isl::multi_aff multi2) const;
2274 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2275 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2276 inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2277 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2278 inline isl::multi_aff flat_range_product(const isl::aff &multi2) const;
2279 inline isl::multi_aff floor() const;
2280 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2281 inline isl::multi_aff gist(isl::set context) const;
2282 inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
2283 inline isl::multi_aff gist(const isl::basic_set &context) const;
2284 inline isl::multi_aff gist(const isl::point &context) const;
2285 inline isl::multi_aff gist_params(isl::set context) const;
2286 inline bool has_range_tuple_id() const;
2287 inline isl::multi_aff identity() const;
2288 static inline isl::multi_aff identity_on_domain(isl::space space);
2289 inline isl::multi_aff insert_domain(isl::space domain) const;
2290 inline isl::pw_multi_aff intersect_domain(const isl::set &set) const;
2291 inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
2292 inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
2293 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2294 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2295 inline isl::pw_multi_aff intersect_params(const isl::set &set) const;
2296 inline bool involves_locals() const;
2297 inline bool involves_nan() const;
2298 inline bool involves_param(const isl::id &id) const;
2299 inline bool involves_param(const std::string &id) const;
2300 inline bool involves_param(const isl::id_list &list) const;
2301 inline bool isa_multi_aff() const;
2302 inline bool isa_pw_multi_aff() const;
2303 inline isl::aff_list list() const;
2304 inline isl::aff_list get_list() const;
2305 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2306 inline isl::multi_val max_multi_val() const;
2307 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2308 inline isl::multi_val min_multi_val() const;
2309 static inline isl::multi_aff multi_val_on_domain(isl::space space, isl::multi_val mv);
2310 inline unsigned n_piece() const;
2311 inline isl::multi_aff neg() const;
2312 inline bool plain_is_empty() const;
2313 inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2314 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2315 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2316 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
2317 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
2318 inline bool plain_is_equal(const isl::aff &multi2) const;
2319 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2320 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2321 inline isl::multi_aff product(isl::multi_aff multi2) const;
2322 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2323 inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2324 inline isl::multi_aff product(const isl::aff &multi2) const;
2325 inline isl::multi_aff pullback(isl::multi_aff ma2) const;
2326 inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
2327 inline isl::pw_multi_aff pullback(const isl::pw_multi_aff &pma2) const;
2328 inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
2329 inline isl::multi_aff pullback(const isl::aff &ma2) const;
2330 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2331 inline isl::pw_multi_aff range_factor_domain() const;
2332 inline isl::pw_multi_aff range_factor_range() const;
2333 static inline isl::multi_aff range_map(isl::space space);
2334 inline isl::multi_aff range_product(isl::multi_aff multi2) const;
2335 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2336 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2337 inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2338 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2339 inline isl::multi_aff range_product(const isl::aff &multi2) const;
2340 inline isl::id range_tuple_id() const;
2341 inline isl::id get_range_tuple_id() const;
2342 inline isl::multi_aff reset_range_tuple_id() const;
2343 inline isl::multi_aff scale(isl::multi_val mv) const;
2344 inline isl::multi_aff scale(isl::val v) const;
2345 inline isl::multi_aff scale(long v) const;
2346 inline isl::multi_aff scale_down(isl::multi_val mv) const;
2347 inline isl::multi_aff scale_down(isl::val v) const;
2348 inline isl::multi_aff scale_down(long v) const;
2349 inline isl::multi_aff set_at(int pos, isl::aff el) const;
2350 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2351 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2352 inline isl::multi_aff set_range_tuple(isl::id id) const;
2353 inline isl::multi_aff set_range_tuple(const std::string &id) const;
2354 inline unsigned size() const;
2355 inline isl::space space() const;
2356 inline isl::space get_space() const;
2357 inline isl::multi_aff sub(isl::multi_aff multi2) const;
2358 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2359 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2360 inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2361 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2362 inline isl::multi_aff sub(const isl::aff &multi2) const;
2363 inline isl::pw_multi_aff subtract_domain(const isl::set &set) const;
2364 inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
2365 inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
2366 inline isl::pw_multi_aff_list to_list() const;
2367 inline isl::multi_pw_aff to_multi_pw_aff() const;
2368 inline isl::multi_union_pw_aff to_multi_union_pw_aff() const;
2369 inline isl::pw_multi_aff to_pw_multi_aff() const;
2370 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2371 inline isl::multi_aff unbind_params_insert_domain(isl::multi_id domain) const;
2372 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2373 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2374 inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2375 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2376 static inline isl::multi_aff zero(isl::space space);
2379 // declarations for isl::multi_id
2380 inline multi_id manage(__isl_take isl_multi_id *ptr);
2381 inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2383 class multi_id {
2384 friend inline multi_id manage(__isl_take isl_multi_id *ptr);
2385 friend inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2387 protected:
2388 isl_multi_id *ptr = nullptr;
2390 inline explicit multi_id(__isl_take isl_multi_id *ptr);
2392 public:
2393 inline /* implicit */ multi_id();
2394 inline /* implicit */ multi_id(const multi_id &obj);
2395 inline explicit multi_id(isl::space space, isl::id_list list);
2396 inline explicit multi_id(isl::ctx ctx, const std::string &str);
2397 inline multi_id &operator=(multi_id obj);
2398 inline ~multi_id();
2399 inline __isl_give isl_multi_id *copy() const &;
2400 inline __isl_give isl_multi_id *copy() && = delete;
2401 inline __isl_keep isl_multi_id *get() const;
2402 inline __isl_give isl_multi_id *release();
2403 inline bool is_null() const;
2404 inline isl::ctx ctx() const;
2406 inline isl::id at(int pos) const;
2407 inline isl::id get_at(int pos) const;
2408 inline isl::multi_id flat_range_product(isl::multi_id multi2) const;
2409 inline isl::id_list list() const;
2410 inline isl::id_list get_list() const;
2411 inline bool plain_is_equal(const isl::multi_id &multi2) const;
2412 inline isl::multi_id range_product(isl::multi_id multi2) const;
2413 inline isl::multi_id set_at(int pos, isl::id el) const;
2414 inline isl::multi_id set_at(int pos, const std::string &el) const;
2415 inline unsigned size() const;
2416 inline isl::space space() const;
2417 inline isl::space get_space() const;
2420 // declarations for isl::multi_pw_aff
2421 inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2422 inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2424 class multi_pw_aff {
2425 friend inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2426 friend inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2428 protected:
2429 isl_multi_pw_aff *ptr = nullptr;
2431 inline explicit multi_pw_aff(__isl_take isl_multi_pw_aff *ptr);
2433 public:
2434 inline /* implicit */ multi_pw_aff();
2435 inline /* implicit */ multi_pw_aff(const multi_pw_aff &obj);
2436 inline /* implicit */ multi_pw_aff(isl::aff aff);
2437 inline /* implicit */ multi_pw_aff(isl::multi_aff ma);
2438 inline /* implicit */ multi_pw_aff(isl::pw_aff pa);
2439 inline explicit multi_pw_aff(isl::space space, isl::pw_aff_list list);
2440 inline /* implicit */ multi_pw_aff(isl::pw_multi_aff pma);
2441 inline explicit multi_pw_aff(isl::ctx ctx, const std::string &str);
2442 inline multi_pw_aff &operator=(multi_pw_aff obj);
2443 inline ~multi_pw_aff();
2444 inline __isl_give isl_multi_pw_aff *copy() const &;
2445 inline __isl_give isl_multi_pw_aff *copy() && = delete;
2446 inline __isl_keep isl_multi_pw_aff *get() const;
2447 inline __isl_give isl_multi_pw_aff *release();
2448 inline bool is_null() const;
2449 inline isl::ctx ctx() const;
2451 inline isl::multi_pw_aff add(isl::multi_pw_aff multi2) const;
2452 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2453 inline isl::multi_pw_aff add(const isl::aff &multi2) const;
2454 inline isl::multi_pw_aff add(const isl::multi_aff &multi2) const;
2455 inline isl::multi_pw_aff add(const isl::pw_aff &multi2) const;
2456 inline isl::multi_pw_aff add(const isl::pw_multi_aff &multi2) const;
2457 inline isl::multi_pw_aff add_constant(isl::multi_val mv) const;
2458 inline isl::multi_pw_aff add_constant(isl::val v) const;
2459 inline isl::multi_pw_aff add_constant(long v) const;
2460 inline isl::map as_map() const;
2461 inline isl::multi_aff as_multi_aff() const;
2462 inline isl::set as_set() const;
2463 inline isl::pw_aff at(int pos) const;
2464 inline isl::pw_aff get_at(int pos) const;
2465 inline isl::set bind(isl::multi_id tuple) const;
2466 inline isl::multi_pw_aff bind_domain(isl::multi_id tuple) const;
2467 inline isl::multi_pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2468 inline isl::multi_pw_aff coalesce() const;
2469 inline isl::set domain() const;
2470 inline isl::multi_pw_aff domain_reverse() const;
2471 inline isl::multi_pw_aff flat_range_product(isl::multi_pw_aff multi2) const;
2472 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2473 inline isl::multi_pw_aff flat_range_product(const isl::aff &multi2) const;
2474 inline isl::multi_pw_aff flat_range_product(const isl::multi_aff &multi2) const;
2475 inline isl::multi_pw_aff flat_range_product(const isl::pw_aff &multi2) const;
2476 inline isl::multi_pw_aff flat_range_product(const isl::pw_multi_aff &multi2) const;
2477 inline isl::multi_pw_aff gist(isl::set set) const;
2478 inline isl::multi_union_pw_aff gist(const isl::union_set &context) const;
2479 inline isl::multi_pw_aff gist(const isl::basic_set &set) const;
2480 inline isl::multi_pw_aff gist(const isl::point &set) const;
2481 inline isl::multi_pw_aff gist_params(isl::set set) const;
2482 inline bool has_range_tuple_id() const;
2483 inline isl::multi_pw_aff identity() const;
2484 static inline isl::multi_pw_aff identity_on_domain(isl::space space);
2485 inline isl::multi_pw_aff insert_domain(isl::space domain) const;
2486 inline isl::multi_pw_aff intersect_domain(isl::set domain) const;
2487 inline isl::multi_union_pw_aff intersect_domain(const isl::union_set &uset) const;
2488 inline isl::multi_pw_aff intersect_domain(const isl::basic_set &domain) const;
2489 inline isl::multi_pw_aff intersect_domain(const isl::point &domain) const;
2490 inline isl::multi_pw_aff intersect_params(isl::set set) const;
2491 inline bool involves_nan() const;
2492 inline bool involves_param(const isl::id &id) const;
2493 inline bool involves_param(const std::string &id) const;
2494 inline bool involves_param(const isl::id_list &list) const;
2495 inline bool isa_multi_aff() const;
2496 inline isl::pw_aff_list list() const;
2497 inline isl::pw_aff_list get_list() const;
2498 inline isl::multi_pw_aff max(isl::multi_pw_aff multi2) const;
2499 inline isl::multi_val max_multi_val() const;
2500 inline isl::multi_pw_aff min(isl::multi_pw_aff multi2) const;
2501 inline isl::multi_val min_multi_val() const;
2502 inline isl::multi_pw_aff neg() const;
2503 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2504 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2505 inline bool plain_is_equal(const isl::aff &multi2) const;
2506 inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2507 inline bool plain_is_equal(const isl::pw_aff &multi2) const;
2508 inline bool plain_is_equal(const isl::pw_multi_aff &multi2) const;
2509 inline isl::multi_pw_aff product(isl::multi_pw_aff multi2) const;
2510 inline isl::multi_pw_aff pullback(isl::multi_aff ma) const;
2511 inline isl::multi_pw_aff pullback(isl::multi_pw_aff mpa2) const;
2512 inline isl::multi_pw_aff pullback(isl::pw_multi_aff pma) const;
2513 inline isl::multi_union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2514 inline isl::multi_pw_aff range_product(isl::multi_pw_aff multi2) const;
2515 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2516 inline isl::multi_pw_aff range_product(const isl::aff &multi2) const;
2517 inline isl::multi_pw_aff range_product(const isl::multi_aff &multi2) const;
2518 inline isl::multi_pw_aff range_product(const isl::pw_aff &multi2) const;
2519 inline isl::multi_pw_aff range_product(const isl::pw_multi_aff &multi2) const;
2520 inline isl::id range_tuple_id() const;
2521 inline isl::id get_range_tuple_id() const;
2522 inline isl::multi_pw_aff reset_range_tuple_id() const;
2523 inline isl::multi_pw_aff scale(isl::multi_val mv) const;
2524 inline isl::multi_pw_aff scale(isl::val v) const;
2525 inline isl::multi_pw_aff scale(long v) const;
2526 inline isl::multi_pw_aff scale_down(isl::multi_val mv) const;
2527 inline isl::multi_pw_aff scale_down(isl::val v) const;
2528 inline isl::multi_pw_aff scale_down(long v) const;
2529 inline isl::multi_pw_aff set_at(int pos, isl::pw_aff el) const;
2530 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2531 inline isl::multi_pw_aff set_range_tuple(isl::id id) const;
2532 inline isl::multi_pw_aff set_range_tuple(const std::string &id) const;
2533 inline unsigned size() const;
2534 inline isl::space space() const;
2535 inline isl::space get_space() const;
2536 inline isl::multi_pw_aff sub(isl::multi_pw_aff multi2) const;
2537 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2538 inline isl::multi_pw_aff sub(const isl::aff &multi2) const;
2539 inline isl::multi_pw_aff sub(const isl::multi_aff &multi2) const;
2540 inline isl::multi_pw_aff sub(const isl::pw_aff &multi2) const;
2541 inline isl::multi_pw_aff sub(const isl::pw_multi_aff &multi2) const;
2542 inline isl::multi_pw_aff unbind_params_insert_domain(isl::multi_id domain) const;
2543 inline isl::multi_pw_aff union_add(isl::multi_pw_aff mpa2) const;
2544 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2545 inline isl::multi_pw_aff union_add(const isl::aff &mpa2) const;
2546 inline isl::multi_pw_aff union_add(const isl::multi_aff &mpa2) const;
2547 inline isl::multi_pw_aff union_add(const isl::pw_aff &mpa2) const;
2548 inline isl::multi_pw_aff union_add(const isl::pw_multi_aff &mpa2) const;
2549 static inline isl::multi_pw_aff zero(isl::space space);
2552 // declarations for isl::multi_union_pw_aff
2553 inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2554 inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2556 class multi_union_pw_aff {
2557 friend inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2558 friend inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2560 protected:
2561 isl_multi_union_pw_aff *ptr = nullptr;
2563 inline explicit multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr);
2565 public:
2566 inline /* implicit */ multi_union_pw_aff();
2567 inline /* implicit */ multi_union_pw_aff(const multi_union_pw_aff &obj);
2568 inline /* implicit */ multi_union_pw_aff(isl::multi_pw_aff mpa);
2569 inline /* implicit */ multi_union_pw_aff(isl::union_pw_aff upa);
2570 inline explicit multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list);
2571 inline explicit multi_union_pw_aff(isl::ctx ctx, const std::string &str);
2572 inline multi_union_pw_aff &operator=(multi_union_pw_aff obj);
2573 inline ~multi_union_pw_aff();
2574 inline __isl_give isl_multi_union_pw_aff *copy() const &;
2575 inline __isl_give isl_multi_union_pw_aff *copy() && = delete;
2576 inline __isl_keep isl_multi_union_pw_aff *get() const;
2577 inline __isl_give isl_multi_union_pw_aff *release();
2578 inline bool is_null() const;
2579 inline isl::ctx ctx() const;
2581 inline isl::multi_union_pw_aff add(isl::multi_union_pw_aff multi2) const;
2582 inline isl::union_pw_aff at(int pos) const;
2583 inline isl::union_pw_aff get_at(int pos) const;
2584 inline isl::union_set bind(isl::multi_id tuple) const;
2585 inline isl::multi_union_pw_aff coalesce() const;
2586 inline isl::union_set domain() const;
2587 inline isl::multi_union_pw_aff flat_range_product(isl::multi_union_pw_aff multi2) const;
2588 inline isl::multi_union_pw_aff gist(isl::union_set context) const;
2589 inline isl::multi_union_pw_aff gist_params(isl::set context) const;
2590 inline bool has_range_tuple_id() const;
2591 inline isl::multi_union_pw_aff intersect_domain(isl::union_set uset) const;
2592 inline isl::multi_union_pw_aff intersect_params(isl::set params) const;
2593 inline bool involves_nan() const;
2594 inline isl::union_pw_aff_list list() const;
2595 inline isl::union_pw_aff_list get_list() const;
2596 inline isl::multi_union_pw_aff neg() const;
2597 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2598 inline isl::multi_union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
2599 inline isl::multi_union_pw_aff range_product(isl::multi_union_pw_aff multi2) const;
2600 inline isl::id range_tuple_id() const;
2601 inline isl::id get_range_tuple_id() const;
2602 inline isl::multi_union_pw_aff reset_range_tuple_id() const;
2603 inline isl::multi_union_pw_aff scale(isl::multi_val mv) const;
2604 inline isl::multi_union_pw_aff scale(isl::val v) const;
2605 inline isl::multi_union_pw_aff scale(long v) const;
2606 inline isl::multi_union_pw_aff scale_down(isl::multi_val mv) const;
2607 inline isl::multi_union_pw_aff scale_down(isl::val v) const;
2608 inline isl::multi_union_pw_aff scale_down(long v) const;
2609 inline isl::multi_union_pw_aff set_at(int pos, isl::union_pw_aff el) const;
2610 inline isl::multi_union_pw_aff set_range_tuple(isl::id id) const;
2611 inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
2612 inline unsigned size() const;
2613 inline isl::space space() const;
2614 inline isl::space get_space() const;
2615 inline isl::multi_union_pw_aff sub(isl::multi_union_pw_aff multi2) const;
2616 inline isl::multi_union_pw_aff union_add(isl::multi_union_pw_aff mupa2) const;
2617 static inline isl::multi_union_pw_aff zero(isl::space space);
2620 // declarations for isl::multi_val
2621 inline multi_val manage(__isl_take isl_multi_val *ptr);
2622 inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2624 class multi_val {
2625 friend inline multi_val manage(__isl_take isl_multi_val *ptr);
2626 friend inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2628 protected:
2629 isl_multi_val *ptr = nullptr;
2631 inline explicit multi_val(__isl_take isl_multi_val *ptr);
2633 public:
2634 inline /* implicit */ multi_val();
2635 inline /* implicit */ multi_val(const multi_val &obj);
2636 inline explicit multi_val(isl::space space, isl::val_list list);
2637 inline explicit multi_val(isl::ctx ctx, const std::string &str);
2638 inline multi_val &operator=(multi_val obj);
2639 inline ~multi_val();
2640 inline __isl_give isl_multi_val *copy() const &;
2641 inline __isl_give isl_multi_val *copy() && = delete;
2642 inline __isl_keep isl_multi_val *get() const;
2643 inline __isl_give isl_multi_val *release();
2644 inline bool is_null() const;
2645 inline isl::ctx ctx() const;
2647 inline isl::multi_val add(isl::multi_val multi2) const;
2648 inline isl::multi_val add(isl::val v) const;
2649 inline isl::multi_val add(long v) const;
2650 inline isl::val at(int pos) const;
2651 inline isl::val get_at(int pos) const;
2652 inline isl::multi_val flat_range_product(isl::multi_val multi2) const;
2653 inline bool has_range_tuple_id() const;
2654 inline bool involves_nan() const;
2655 inline isl::val_list list() const;
2656 inline isl::val_list get_list() const;
2657 inline isl::multi_val max(isl::multi_val multi2) const;
2658 inline isl::multi_val min(isl::multi_val multi2) const;
2659 inline isl::multi_val neg() const;
2660 inline bool plain_is_equal(const isl::multi_val &multi2) const;
2661 inline isl::multi_val product(isl::multi_val multi2) const;
2662 inline isl::multi_val range_product(isl::multi_val multi2) const;
2663 inline isl::id range_tuple_id() const;
2664 inline isl::id get_range_tuple_id() const;
2665 inline isl::multi_val reset_range_tuple_id() const;
2666 inline isl::multi_val scale(isl::multi_val mv) const;
2667 inline isl::multi_val scale(isl::val v) const;
2668 inline isl::multi_val scale(long v) const;
2669 inline isl::multi_val scale_down(isl::multi_val mv) const;
2670 inline isl::multi_val scale_down(isl::val v) const;
2671 inline isl::multi_val scale_down(long v) const;
2672 inline isl::multi_val set_at(int pos, isl::val el) const;
2673 inline isl::multi_val set_at(int pos, long el) const;
2674 inline isl::multi_val set_range_tuple(isl::id id) const;
2675 inline isl::multi_val set_range_tuple(const std::string &id) const;
2676 inline unsigned size() const;
2677 inline isl::space space() const;
2678 inline isl::space get_space() const;
2679 inline isl::multi_val sub(isl::multi_val multi2) const;
2680 static inline isl::multi_val zero(isl::space space);
2683 // declarations for isl::point
2684 inline point manage(__isl_take isl_point *ptr);
2685 inline point manage_copy(__isl_keep isl_point *ptr);
2687 class point {
2688 friend inline point manage(__isl_take isl_point *ptr);
2689 friend inline point manage_copy(__isl_keep isl_point *ptr);
2691 protected:
2692 isl_point *ptr = nullptr;
2694 inline explicit point(__isl_take isl_point *ptr);
2696 public:
2697 inline /* implicit */ point();
2698 inline /* implicit */ point(const point &obj);
2699 inline point &operator=(point obj);
2700 inline ~point();
2701 inline __isl_give isl_point *copy() const &;
2702 inline __isl_give isl_point *copy() && = delete;
2703 inline __isl_keep isl_point *get() const;
2704 inline __isl_give isl_point *release();
2705 inline bool is_null() const;
2706 inline isl::ctx ctx() const;
2708 inline isl::basic_set affine_hull() const;
2709 inline isl::basic_set apply(const isl::basic_map &bmap) const;
2710 inline isl::set apply(const isl::map &map) const;
2711 inline isl::union_set apply(const isl::union_map &umap) const;
2712 inline isl::pw_multi_aff as_pw_multi_aff() const;
2713 inline isl::set as_set() const;
2714 inline isl::set bind(const isl::multi_id &tuple) const;
2715 inline isl::set coalesce() const;
2716 inline isl::set complement() const;
2717 inline isl::union_set compute_divs() const;
2718 inline isl::basic_set detect_equalities() const;
2719 inline isl::val dim_max_val(int pos) const;
2720 inline isl::val dim_min_val(int pos) const;
2721 inline isl::set drop_unused_params() const;
2722 inline bool every_set(const std::function<bool(isl::set)> &test) const;
2723 inline isl::set extract_set(const isl::space &space) const;
2724 inline isl::basic_set flatten() const;
2725 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
2726 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
2727 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
2728 inline isl::basic_set gist(const isl::basic_set &context) const;
2729 inline isl::set gist(const isl::set &context) const;
2730 inline isl::union_set gist(const isl::union_set &context) const;
2731 inline isl::set gist_params(const isl::set &context) const;
2732 inline isl::map identity() const;
2733 inline isl::pw_aff indicator_function() const;
2734 inline isl::map insert_domain(const isl::space &domain) const;
2735 inline isl::basic_set intersect(const isl::basic_set &bset2) const;
2736 inline isl::set intersect(const isl::set &set2) const;
2737 inline isl::union_set intersect(const isl::union_set &uset2) const;
2738 inline isl::basic_set intersect_params(const isl::basic_set &bset2) const;
2739 inline isl::set intersect_params(const isl::set &params) const;
2740 inline bool involves_locals() const;
2741 inline bool is_disjoint(const isl::set &set2) const;
2742 inline bool is_disjoint(const isl::union_set &uset2) const;
2743 inline bool is_empty() const;
2744 inline bool is_equal(const isl::basic_set &bset2) const;
2745 inline bool is_equal(const isl::set &set2) const;
2746 inline bool is_equal(const isl::union_set &uset2) const;
2747 inline bool is_singleton() const;
2748 inline bool is_strict_subset(const isl::set &set2) const;
2749 inline bool is_strict_subset(const isl::union_set &uset2) const;
2750 inline bool is_subset(const isl::basic_set &bset2) const;
2751 inline bool is_subset(const isl::set &set2) const;
2752 inline bool is_subset(const isl::union_set &uset2) const;
2753 inline bool is_wrapping() const;
2754 inline bool isa_set() const;
2755 inline isl::fixed_box lattice_tile() const;
2756 inline isl::set lexmax() const;
2757 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
2758 inline isl::set lexmin() const;
2759 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
2760 inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
2761 inline isl::set lower_bound(const isl::multi_val &lower) const;
2762 inline isl::multi_pw_aff max_multi_pw_aff() const;
2763 inline isl::val max_val(const isl::aff &obj) const;
2764 inline isl::multi_pw_aff min_multi_pw_aff() const;
2765 inline isl::val min_val(const isl::aff &obj) const;
2766 inline isl::multi_val multi_val() const;
2767 inline isl::multi_val get_multi_val() const;
2768 inline unsigned n_basic_set() const;
2769 inline isl::pw_aff param_pw_aff_on_domain(const isl::id &id) const;
2770 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
2771 inline isl::basic_set params() const;
2772 inline isl::multi_val plain_multi_val_if_fixed() const;
2773 inline isl::basic_set polyhedral_hull() const;
2774 inline isl::set preimage(const isl::multi_aff &ma) const;
2775 inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
2776 inline isl::set preimage(const isl::pw_multi_aff &pma) const;
2777 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
2778 inline isl::set product(const isl::set &set2) const;
2779 inline isl::set project_out_all_params() const;
2780 inline isl::set project_out_param(const isl::id &id) const;
2781 inline isl::set project_out_param(const std::string &id) const;
2782 inline isl::set project_out_param(const isl::id_list &list) const;
2783 inline isl::pw_aff pw_aff_on_domain(const isl::val &v) const;
2784 inline isl::pw_aff pw_aff_on_domain(long v) const;
2785 inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
2786 inline isl::basic_set sample() const;
2787 inline isl::point sample_point() const;
2788 inline isl::set_list set_list() const;
2789 inline isl::fixed_box simple_fixed_box_hull() const;
2790 inline isl::space space() const;
2791 inline isl::val stride(int pos) const;
2792 inline isl::set subtract(const isl::set &set2) const;
2793 inline isl::union_set subtract(const isl::union_set &uset2) const;
2794 inline isl::set_list to_list() const;
2795 inline isl::set to_set() const;
2796 inline isl::union_set to_union_set() const;
2797 inline isl::map translation() const;
2798 inline unsigned tuple_dim() const;
2799 inline isl::set unbind_params(const isl::multi_id &tuple) const;
2800 inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
2801 inline isl::set unite(const isl::basic_set &bset2) const;
2802 inline isl::set unite(const isl::set &set2) const;
2803 inline isl::union_set unite(const isl::union_set &uset2) const;
2804 inline isl::basic_set unshifted_simple_hull() const;
2805 inline isl::map unwrap() const;
2806 inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
2807 inline isl::set upper_bound(const isl::multi_val &upper) const;
2808 inline isl::set wrapped_reverse() const;
2811 // declarations for isl::pw_aff
2812 inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2813 inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2815 class pw_aff {
2816 friend inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2817 friend inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2819 protected:
2820 isl_pw_aff *ptr = nullptr;
2822 inline explicit pw_aff(__isl_take isl_pw_aff *ptr);
2824 public:
2825 inline /* implicit */ pw_aff();
2826 inline /* implicit */ pw_aff(const pw_aff &obj);
2827 inline /* implicit */ pw_aff(isl::aff aff);
2828 inline explicit pw_aff(isl::ctx ctx, const std::string &str);
2829 inline pw_aff &operator=(pw_aff obj);
2830 inline ~pw_aff();
2831 inline __isl_give isl_pw_aff *copy() const &;
2832 inline __isl_give isl_pw_aff *copy() && = delete;
2833 inline __isl_keep isl_pw_aff *get() const;
2834 inline __isl_give isl_pw_aff *release();
2835 inline bool is_null() const;
2836 inline isl::ctx ctx() const;
2838 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2839 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2840 inline isl::pw_aff add(isl::pw_aff pwaff2) const;
2841 inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2842 inline isl::union_pw_aff add(const isl::union_pw_aff &upa2) const;
2843 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2844 inline isl::pw_aff add(const isl::aff &pwaff2) const;
2845 inline isl::pw_aff add_constant(isl::val v) const;
2846 inline isl::pw_aff add_constant(long v) const;
2847 inline isl::pw_multi_aff add_constant(const isl::multi_val &mv) const;
2848 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2849 inline isl::aff as_aff() const;
2850 inline isl::map as_map() const;
2851 inline isl::multi_aff as_multi_aff() const;
2852 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2853 inline isl::pw_multi_aff as_pw_multi_aff() const;
2854 inline isl::set as_set() const;
2855 inline isl::union_map as_union_map() const;
2856 inline isl::pw_aff at(int pos) const;
2857 inline isl::set bind(const isl::multi_id &tuple) const;
2858 inline isl::set bind(isl::id id) const;
2859 inline isl::set bind(const std::string &id) const;
2860 inline isl::pw_aff bind_domain(isl::multi_id tuple) const;
2861 inline isl::pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2862 inline isl::pw_aff ceil() const;
2863 inline isl::pw_aff coalesce() const;
2864 inline isl::pw_aff cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const;
2865 inline isl::pw_aff div(isl::pw_aff pa2) const;
2866 inline isl::set domain() const;
2867 inline isl::pw_aff domain_reverse() const;
2868 inline isl::pw_aff drop_unused_params() const;
2869 inline isl::set eq_set(isl::pw_aff pwaff2) const;
2870 inline isl::val eval(isl::point pnt) const;
2871 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2872 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2873 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2874 inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2875 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2876 inline isl::pw_aff floor() const;
2877 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2878 inline isl::set ge_set(isl::pw_aff pwaff2) const;
2879 inline isl::pw_aff gist(isl::set context) const;
2880 inline isl::union_pw_aff gist(const isl::union_set &context) const;
2881 inline isl::pw_aff gist(const isl::basic_set &context) const;
2882 inline isl::pw_aff gist(const isl::point &context) const;
2883 inline isl::pw_aff gist_params(isl::set context) const;
2884 inline isl::set gt_set(isl::pw_aff pwaff2) const;
2885 inline bool has_range_tuple_id() const;
2886 inline isl::multi_pw_aff identity() const;
2887 inline isl::pw_aff insert_domain(isl::space domain) const;
2888 inline isl::pw_aff intersect_domain(isl::set set) const;
2889 inline isl::union_pw_aff intersect_domain(const isl::space &space) const;
2890 inline isl::union_pw_aff intersect_domain(const isl::union_set &uset) const;
2891 inline isl::pw_aff intersect_domain(const isl::basic_set &set) const;
2892 inline isl::pw_aff intersect_domain(const isl::point &set) const;
2893 inline isl::union_pw_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2894 inline isl::union_pw_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2895 inline isl::pw_aff intersect_params(isl::set set) const;
2896 inline bool involves_locals() const;
2897 inline bool involves_nan() const;
2898 inline bool involves_param(const isl::id &id) const;
2899 inline bool involves_param(const std::string &id) const;
2900 inline bool involves_param(const isl::id_list &list) const;
2901 inline bool isa_aff() const;
2902 inline bool isa_multi_aff() const;
2903 inline bool isa_pw_multi_aff() const;
2904 inline isl::set le_set(isl::pw_aff pwaff2) const;
2905 inline isl::pw_aff_list list() const;
2906 inline isl::set lt_set(isl::pw_aff pwaff2) const;
2907 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2908 inline isl::pw_aff max(isl::pw_aff pwaff2) const;
2909 inline isl::pw_aff max(const isl::aff &pwaff2) const;
2910 inline isl::multi_val max_multi_val() const;
2911 inline isl::val max_val() const;
2912 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2913 inline isl::pw_aff min(isl::pw_aff pwaff2) const;
2914 inline isl::pw_aff min(const isl::aff &pwaff2) const;
2915 inline isl::multi_val min_multi_val() const;
2916 inline isl::val min_val() const;
2917 inline isl::pw_aff mod(isl::val mod) const;
2918 inline isl::pw_aff mod(long mod) const;
2919 inline isl::pw_aff mul(isl::pw_aff pwaff2) const;
2920 inline unsigned n_piece() const;
2921 inline isl::set ne_set(isl::pw_aff pwaff2) const;
2922 inline isl::pw_aff neg() const;
2923 static inline isl::pw_aff param_on_domain(isl::set domain, isl::id id);
2924 inline isl::set params() const;
2925 inline bool plain_is_empty() const;
2926 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2927 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2928 inline bool plain_is_equal(const isl::pw_aff &pwaff2) const;
2929 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
2930 inline bool plain_is_equal(const isl::union_pw_aff &upa2) const;
2931 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
2932 inline bool plain_is_equal(const isl::aff &pwaff2) const;
2933 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2934 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2935 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2936 inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2937 inline isl::pw_aff pullback(isl::multi_aff ma) const;
2938 inline isl::pw_aff pullback(isl::multi_pw_aff mpa) const;
2939 inline isl::pw_aff pullback(isl::pw_multi_aff pma) const;
2940 inline isl::union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2941 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2942 inline isl::pw_multi_aff range_factor_domain() const;
2943 inline isl::pw_multi_aff range_factor_range() const;
2944 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2945 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2946 inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2947 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2948 inline isl::id range_tuple_id() const;
2949 inline isl::multi_pw_aff reset_range_tuple_id() const;
2950 inline isl::pw_aff scale(isl::val v) const;
2951 inline isl::pw_aff scale(long v) const;
2952 inline isl::pw_multi_aff scale(const isl::multi_val &mv) const;
2953 inline isl::pw_aff scale_down(isl::val f) const;
2954 inline isl::pw_aff scale_down(long f) const;
2955 inline isl::pw_multi_aff scale_down(const isl::multi_val &mv) const;
2956 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2957 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2958 inline isl::pw_multi_aff set_range_tuple(const isl::id &id) const;
2959 inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
2960 inline unsigned size() const;
2961 inline isl::space space() const;
2962 inline isl::space get_space() const;
2963 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2964 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2965 inline isl::pw_aff sub(isl::pw_aff pwaff2) const;
2966 inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2967 inline isl::union_pw_aff sub(const isl::union_pw_aff &upa2) const;
2968 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2969 inline isl::pw_aff sub(const isl::aff &pwaff2) const;
2970 inline isl::pw_aff subtract_domain(isl::set set) const;
2971 inline isl::union_pw_aff subtract_domain(const isl::space &space) const;
2972 inline isl::union_pw_aff subtract_domain(const isl::union_set &uset) const;
2973 inline isl::pw_aff subtract_domain(const isl::basic_set &set) const;
2974 inline isl::pw_aff subtract_domain(const isl::point &set) const;
2975 inline isl::pw_aff tdiv_q(isl::pw_aff pa2) const;
2976 inline isl::pw_aff tdiv_r(isl::pw_aff pa2) const;
2977 inline isl::pw_aff_list to_list() const;
2978 inline isl::multi_pw_aff to_multi_pw_aff() const;
2979 inline isl::union_pw_aff to_union_pw_aff() const;
2980 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2981 inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
2982 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2983 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2984 inline isl::pw_aff union_add(isl::pw_aff pwaff2) const;
2985 inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2986 inline isl::union_pw_aff union_add(const isl::union_pw_aff &upa2) const;
2987 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2988 inline isl::pw_aff union_add(const isl::aff &pwaff2) const;
2991 // declarations for isl::pw_aff_list
2992 inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2993 inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2995 class pw_aff_list {
2996 friend inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2997 friend inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2999 protected:
3000 isl_pw_aff_list *ptr = nullptr;
3002 inline explicit pw_aff_list(__isl_take isl_pw_aff_list *ptr);
3004 public:
3005 inline /* implicit */ pw_aff_list();
3006 inline /* implicit */ pw_aff_list(const pw_aff_list &obj);
3007 inline explicit pw_aff_list(isl::ctx ctx, int n);
3008 inline explicit pw_aff_list(isl::pw_aff el);
3009 inline explicit pw_aff_list(isl::ctx ctx, const std::string &str);
3010 inline pw_aff_list &operator=(pw_aff_list obj);
3011 inline ~pw_aff_list();
3012 inline __isl_give isl_pw_aff_list *copy() const &;
3013 inline __isl_give isl_pw_aff_list *copy() && = delete;
3014 inline __isl_keep isl_pw_aff_list *get() const;
3015 inline __isl_give isl_pw_aff_list *release();
3016 inline bool is_null() const;
3017 inline isl::ctx ctx() const;
3019 inline isl::pw_aff_list add(isl::pw_aff el) const;
3020 inline isl::pw_aff at(int index) const;
3021 inline isl::pw_aff get_at(int index) const;
3022 inline isl::pw_aff_list clear() const;
3023 inline isl::pw_aff_list concat(isl::pw_aff_list list2) const;
3024 inline isl::pw_aff_list drop(unsigned int first, unsigned int n) const;
3025 inline void foreach(const std::function<void(isl::pw_aff)> &fn) const;
3026 inline void foreach_scc(const std::function<bool(isl::pw_aff, isl::pw_aff)> &follows, const std::function<void(isl::pw_aff_list)> &fn) const;
3027 inline isl::pw_aff_list insert(unsigned int pos, isl::pw_aff el) const;
3028 inline isl::pw_aff_list set_at(int index, isl::pw_aff el) const;
3029 inline unsigned size() const;
3032 // declarations for isl::pw_multi_aff
3033 inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
3034 inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
3036 class pw_multi_aff {
3037 friend inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
3038 friend inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
3040 protected:
3041 isl_pw_multi_aff *ptr = nullptr;
3043 inline explicit pw_multi_aff(__isl_take isl_pw_multi_aff *ptr);
3045 public:
3046 inline /* implicit */ pw_multi_aff();
3047 inline /* implicit */ pw_multi_aff(const pw_multi_aff &obj);
3048 inline /* implicit */ pw_multi_aff(isl::multi_aff ma);
3049 inline /* implicit */ pw_multi_aff(isl::pw_aff pa);
3050 inline explicit pw_multi_aff(isl::ctx ctx, const std::string &str);
3051 inline pw_multi_aff &operator=(pw_multi_aff obj);
3052 inline ~pw_multi_aff();
3053 inline __isl_give isl_pw_multi_aff *copy() const &;
3054 inline __isl_give isl_pw_multi_aff *copy() && = delete;
3055 inline __isl_keep isl_pw_multi_aff *get() const;
3056 inline __isl_give isl_pw_multi_aff *release();
3057 inline bool is_null() const;
3058 inline isl::ctx ctx() const;
3060 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
3061 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
3062 inline isl::pw_multi_aff add(isl::pw_multi_aff pma2) const;
3063 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
3064 inline isl::pw_multi_aff add(const isl::multi_aff &pma2) const;
3065 inline isl::pw_multi_aff add(const isl::pw_aff &pma2) const;
3066 inline isl::pw_multi_aff add_constant(isl::multi_val mv) const;
3067 inline isl::pw_multi_aff add_constant(isl::val v) const;
3068 inline isl::pw_multi_aff add_constant(long v) const;
3069 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
3070 inline isl::map as_map() const;
3071 inline isl::multi_aff as_multi_aff() const;
3072 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
3073 inline isl::pw_multi_aff as_pw_multi_aff() const;
3074 inline isl::set as_set() const;
3075 inline isl::union_map as_union_map() const;
3076 inline isl::pw_aff at(int pos) const;
3077 inline isl::pw_aff get_at(int pos) const;
3078 inline isl::set bind(const isl::multi_id &tuple) const;
3079 inline isl::pw_multi_aff bind_domain(isl::multi_id tuple) const;
3080 inline isl::pw_multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
3081 inline isl::pw_multi_aff coalesce() const;
3082 inline isl::set domain() const;
3083 static inline isl::pw_multi_aff domain_map(isl::space space);
3084 inline isl::pw_multi_aff domain_reverse() const;
3085 inline isl::pw_multi_aff drop_unused_params() const;
3086 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
3087 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
3088 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
3089 inline isl::pw_multi_aff flat_range_product(isl::pw_multi_aff pma2) const;
3090 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
3091 inline isl::pw_multi_aff flat_range_product(const isl::multi_aff &pma2) const;
3092 inline isl::pw_multi_aff flat_range_product(const isl::pw_aff &pma2) const;
3093 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
3094 inline isl::pw_multi_aff gist(isl::set set) const;
3095 inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
3096 inline isl::pw_multi_aff gist(const isl::basic_set &set) const;
3097 inline isl::pw_multi_aff gist(const isl::point &set) const;
3098 inline isl::pw_multi_aff gist_params(isl::set set) const;
3099 inline bool has_range_tuple_id() const;
3100 inline isl::multi_pw_aff identity() const;
3101 static inline isl::pw_multi_aff identity_on_domain(isl::space space);
3102 inline isl::pw_multi_aff insert_domain(isl::space domain) const;
3103 inline isl::pw_multi_aff intersect_domain(isl::set set) const;
3104 inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
3105 inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
3106 inline isl::pw_multi_aff intersect_domain(const isl::basic_set &set) const;
3107 inline isl::pw_multi_aff intersect_domain(const isl::point &set) const;
3108 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
3109 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
3110 inline isl::pw_multi_aff intersect_params(isl::set set) const;
3111 inline bool involves_locals() const;
3112 inline bool involves_nan() const;
3113 inline bool involves_param(const isl::id &id) const;
3114 inline bool involves_param(const std::string &id) const;
3115 inline bool involves_param(const isl::id_list &list) const;
3116 inline bool isa_multi_aff() const;
3117 inline bool isa_pw_multi_aff() const;
3118 inline isl::pw_aff_list list() const;
3119 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
3120 inline isl::multi_val max_multi_val() const;
3121 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
3122 inline isl::multi_val min_multi_val() const;
3123 static inline isl::pw_multi_aff multi_val_on_domain(isl::set domain, isl::multi_val mv);
3124 inline unsigned n_piece() const;
3125 inline isl::multi_pw_aff neg() const;
3126 inline bool plain_is_empty() const;
3127 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
3128 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
3129 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
3130 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
3131 inline bool plain_is_equal(const isl::multi_aff &pma2) const;
3132 inline bool plain_is_equal(const isl::pw_aff &pma2) const;
3133 inline isl::pw_multi_aff preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const;
3134 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
3135 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const;
3136 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const;
3137 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
3138 inline isl::pw_multi_aff product(isl::pw_multi_aff pma2) const;
3139 inline isl::pw_multi_aff product(const isl::multi_aff &pma2) const;
3140 inline isl::pw_multi_aff product(const isl::pw_aff &pma2) const;
3141 inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
3142 inline isl::pw_multi_aff pullback(isl::multi_aff ma) const;
3143 inline isl::pw_multi_aff pullback(isl::pw_multi_aff pma2) const;
3144 inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
3145 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
3146 inline isl::pw_multi_aff range_factor_domain() const;
3147 inline isl::pw_multi_aff range_factor_range() const;
3148 static inline isl::pw_multi_aff range_map(isl::space space);
3149 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
3150 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
3151 inline isl::pw_multi_aff range_product(isl::pw_multi_aff pma2) const;
3152 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
3153 inline isl::pw_multi_aff range_product(const isl::multi_aff &pma2) const;
3154 inline isl::pw_multi_aff range_product(const isl::pw_aff &pma2) const;
3155 inline isl::id range_tuple_id() const;
3156 inline isl::id get_range_tuple_id() const;
3157 inline isl::multi_pw_aff reset_range_tuple_id() const;
3158 inline isl::pw_multi_aff scale(isl::multi_val mv) const;
3159 inline isl::pw_multi_aff scale(isl::val v) const;
3160 inline isl::pw_multi_aff scale(long v) const;
3161 inline isl::pw_multi_aff scale_down(isl::multi_val mv) const;
3162 inline isl::pw_multi_aff scale_down(isl::val v) const;
3163 inline isl::pw_multi_aff scale_down(long v) const;
3164 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
3165 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
3166 inline isl::pw_multi_aff set_range_tuple(isl::id id) const;
3167 inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
3168 inline unsigned size() const;
3169 inline isl::space space() const;
3170 inline isl::space get_space() const;
3171 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
3172 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
3173 inline isl::pw_multi_aff sub(isl::pw_multi_aff pma2) const;
3174 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
3175 inline isl::pw_multi_aff sub(const isl::multi_aff &pma2) const;
3176 inline isl::pw_multi_aff sub(const isl::pw_aff &pma2) const;
3177 inline isl::pw_multi_aff subtract_domain(isl::set set) const;
3178 inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
3179 inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
3180 inline isl::pw_multi_aff subtract_domain(const isl::basic_set &set) const;
3181 inline isl::pw_multi_aff subtract_domain(const isl::point &set) const;
3182 inline isl::pw_multi_aff_list to_list() const;
3183 inline isl::multi_pw_aff to_multi_pw_aff() const;
3184 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
3185 inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
3186 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
3187 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
3188 inline isl::pw_multi_aff union_add(isl::pw_multi_aff pma2) const;
3189 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
3190 inline isl::pw_multi_aff union_add(const isl::multi_aff &pma2) const;
3191 inline isl::pw_multi_aff union_add(const isl::pw_aff &pma2) const;
3192 static inline isl::pw_multi_aff zero(isl::space space);
3195 // declarations for isl::pw_multi_aff_list
3196 inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3197 inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3199 class pw_multi_aff_list {
3200 friend inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3201 friend inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3203 protected:
3204 isl_pw_multi_aff_list *ptr = nullptr;
3206 inline explicit pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr);
3208 public:
3209 inline /* implicit */ pw_multi_aff_list();
3210 inline /* implicit */ pw_multi_aff_list(const pw_multi_aff_list &obj);
3211 inline explicit pw_multi_aff_list(isl::ctx ctx, int n);
3212 inline explicit pw_multi_aff_list(isl::pw_multi_aff el);
3213 inline explicit pw_multi_aff_list(isl::ctx ctx, const std::string &str);
3214 inline pw_multi_aff_list &operator=(pw_multi_aff_list obj);
3215 inline ~pw_multi_aff_list();
3216 inline __isl_give isl_pw_multi_aff_list *copy() const &;
3217 inline __isl_give isl_pw_multi_aff_list *copy() && = delete;
3218 inline __isl_keep isl_pw_multi_aff_list *get() const;
3219 inline __isl_give isl_pw_multi_aff_list *release();
3220 inline bool is_null() const;
3221 inline isl::ctx ctx() const;
3223 inline isl::pw_multi_aff_list add(isl::pw_multi_aff el) const;
3224 inline isl::pw_multi_aff at(int index) const;
3225 inline isl::pw_multi_aff get_at(int index) const;
3226 inline isl::pw_multi_aff_list clear() const;
3227 inline isl::pw_multi_aff_list concat(isl::pw_multi_aff_list list2) const;
3228 inline isl::pw_multi_aff_list drop(unsigned int first, unsigned int n) const;
3229 inline void foreach(const std::function<void(isl::pw_multi_aff)> &fn) const;
3230 inline void foreach_scc(const std::function<bool(isl::pw_multi_aff, isl::pw_multi_aff)> &follows, const std::function<void(isl::pw_multi_aff_list)> &fn) const;
3231 inline isl::pw_multi_aff_list insert(unsigned int pos, isl::pw_multi_aff el) const;
3232 inline isl::pw_multi_aff_list set_at(int index, isl::pw_multi_aff el) const;
3233 inline unsigned size() const;
3236 // declarations for isl::schedule
3237 inline schedule manage(__isl_take isl_schedule *ptr);
3238 inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3240 class schedule {
3241 friend inline schedule manage(__isl_take isl_schedule *ptr);
3242 friend inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3244 protected:
3245 isl_schedule *ptr = nullptr;
3247 inline explicit schedule(__isl_take isl_schedule *ptr);
3249 public:
3250 inline /* implicit */ schedule();
3251 inline /* implicit */ schedule(const schedule &obj);
3252 inline explicit schedule(isl::ctx ctx, const std::string &str);
3253 inline schedule &operator=(schedule obj);
3254 inline ~schedule();
3255 inline __isl_give isl_schedule *copy() const &;
3256 inline __isl_give isl_schedule *copy() && = delete;
3257 inline __isl_keep isl_schedule *get() const;
3258 inline __isl_give isl_schedule *release();
3259 inline bool is_null() const;
3260 inline isl::ctx ctx() const;
3262 inline isl::union_set domain() const;
3263 inline isl::union_set get_domain() const;
3264 static inline isl::schedule from_domain(isl::union_set domain);
3265 inline isl::union_map map() const;
3266 inline isl::union_map get_map() const;
3267 inline isl::schedule pullback(isl::union_pw_multi_aff upma) const;
3268 inline isl::schedule_node root() const;
3269 inline isl::schedule_node get_root() const;
3272 // declarations for isl::schedule_constraints
3273 inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3274 inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3276 class schedule_constraints {
3277 friend inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3278 friend inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3280 protected:
3281 isl_schedule_constraints *ptr = nullptr;
3283 inline explicit schedule_constraints(__isl_take isl_schedule_constraints *ptr);
3285 public:
3286 inline /* implicit */ schedule_constraints();
3287 inline /* implicit */ schedule_constraints(const schedule_constraints &obj);
3288 inline explicit schedule_constraints(isl::ctx ctx, const std::string &str);
3289 inline schedule_constraints &operator=(schedule_constraints obj);
3290 inline ~schedule_constraints();
3291 inline __isl_give isl_schedule_constraints *copy() const &;
3292 inline __isl_give isl_schedule_constraints *copy() && = delete;
3293 inline __isl_keep isl_schedule_constraints *get() const;
3294 inline __isl_give isl_schedule_constraints *release();
3295 inline bool is_null() const;
3296 inline isl::ctx ctx() const;
3298 inline isl::union_map coincidence() const;
3299 inline isl::union_map get_coincidence() const;
3300 inline isl::schedule compute_schedule() const;
3301 inline isl::union_map conditional_validity() const;
3302 inline isl::union_map get_conditional_validity() const;
3303 inline isl::union_map conditional_validity_condition() const;
3304 inline isl::union_map get_conditional_validity_condition() const;
3305 inline isl::set context() const;
3306 inline isl::set get_context() const;
3307 inline isl::union_set domain() const;
3308 inline isl::union_set get_domain() const;
3309 static inline isl::schedule_constraints on_domain(isl::union_set domain);
3310 inline isl::union_map proximity() const;
3311 inline isl::union_map get_proximity() const;
3312 inline isl::schedule_constraints set_coincidence(isl::union_map coincidence) const;
3313 inline isl::schedule_constraints set_conditional_validity(isl::union_map condition, isl::union_map validity) const;
3314 inline isl::schedule_constraints set_context(isl::set context) const;
3315 inline isl::schedule_constraints set_proximity(isl::union_map proximity) const;
3316 inline isl::schedule_constraints set_validity(isl::union_map validity) const;
3317 inline isl::union_map validity() const;
3318 inline isl::union_map get_validity() const;
3321 // declarations for isl::schedule_node
3322 inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3323 inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3325 class schedule_node {
3326 friend inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3327 friend inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3329 protected:
3330 isl_schedule_node *ptr = nullptr;
3332 inline explicit schedule_node(__isl_take isl_schedule_node *ptr);
3334 public:
3335 inline /* implicit */ schedule_node();
3336 inline /* implicit */ schedule_node(const schedule_node &obj);
3337 inline schedule_node &operator=(schedule_node obj);
3338 inline ~schedule_node();
3339 inline __isl_give isl_schedule_node *copy() const &;
3340 inline __isl_give isl_schedule_node *copy() && = delete;
3341 inline __isl_keep isl_schedule_node *get() const;
3342 inline __isl_give isl_schedule_node *release();
3343 inline bool is_null() const;
3344 private:
3345 template <typename T,
3346 typename = typename std::enable_if<std::is_same<
3347 const decltype(isl_schedule_node_get_type(NULL)),
3348 const T>::value>::type>
3349 inline bool isa_type(T subtype) const;
3350 public:
3351 template <class T> inline bool isa() const;
3352 template <class T> inline T as() const;
3353 inline isl::ctx ctx() const;
3355 inline isl::schedule_node ancestor(int generation) const;
3356 inline unsigned ancestor_child_position(const isl::schedule_node &ancestor) const;
3357 inline unsigned get_ancestor_child_position(const isl::schedule_node &ancestor) const;
3358 inline isl::schedule_node child(int pos) const;
3359 inline unsigned child_position() const;
3360 inline unsigned get_child_position() const;
3361 inline bool every_descendant(const std::function<bool(isl::schedule_node)> &test) const;
3362 inline isl::schedule_node first_child() const;
3363 inline void foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const;
3364 inline void foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const;
3365 static inline isl::schedule_node from_domain(isl::union_set domain);
3366 static inline isl::schedule_node from_extension(isl::union_map extension);
3367 inline isl::schedule_node graft_after(isl::schedule_node graft) const;
3368 inline isl::schedule_node graft_before(isl::schedule_node graft) const;
3369 inline bool has_children() const;
3370 inline bool has_next_sibling() const;
3371 inline bool has_parent() const;
3372 inline bool has_previous_sibling() const;
3373 inline isl::schedule_node insert_context(isl::set context) const;
3374 inline isl::schedule_node insert_filter(isl::union_set filter) const;
3375 inline isl::schedule_node insert_guard(isl::set context) const;
3376 inline isl::schedule_node insert_mark(isl::id mark) const;
3377 inline isl::schedule_node insert_mark(const std::string &mark) const;
3378 inline isl::schedule_node insert_partial_schedule(isl::multi_union_pw_aff schedule) const;
3379 inline isl::schedule_node insert_sequence(isl::union_set_list filters) const;
3380 inline isl::schedule_node insert_set(isl::union_set_list filters) const;
3381 inline bool is_equal(const isl::schedule_node &node2) const;
3382 inline bool is_subtree_anchored() const;
3383 inline isl::schedule_node map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const;
3384 inline unsigned n_children() const;
3385 inline isl::schedule_node next_sibling() const;
3386 inline isl::schedule_node order_after(isl::union_set filter) const;
3387 inline isl::schedule_node order_before(isl::union_set filter) const;
3388 inline isl::schedule_node parent() const;
3389 inline isl::multi_union_pw_aff prefix_schedule_multi_union_pw_aff() const;
3390 inline isl::multi_union_pw_aff get_prefix_schedule_multi_union_pw_aff() const;
3391 inline isl::union_map prefix_schedule_union_map() const;
3392 inline isl::union_map get_prefix_schedule_union_map() const;
3393 inline isl::union_pw_multi_aff prefix_schedule_union_pw_multi_aff() const;
3394 inline isl::union_pw_multi_aff get_prefix_schedule_union_pw_multi_aff() const;
3395 inline isl::schedule_node previous_sibling() const;
3396 inline isl::schedule_node root() const;
3397 inline isl::schedule schedule() const;
3398 inline isl::schedule get_schedule() const;
3399 inline isl::schedule_node shared_ancestor(const isl::schedule_node &node2) const;
3400 inline isl::schedule_node get_shared_ancestor(const isl::schedule_node &node2) const;
3401 inline unsigned tree_depth() const;
3402 inline unsigned get_tree_depth() const;
3405 // declarations for isl::schedule_node_band
3407 class schedule_node_band : public schedule_node {
3408 template <class T>
3409 friend bool schedule_node::isa() const;
3410 friend schedule_node_band schedule_node::as<schedule_node_band>() const;
3411 static const auto type = isl_schedule_node_band;
3413 protected:
3414 inline explicit schedule_node_band(__isl_take isl_schedule_node *ptr);
3416 public:
3417 inline /* implicit */ schedule_node_band();
3418 inline /* implicit */ schedule_node_band(const schedule_node_band &obj);
3419 inline schedule_node_band &operator=(schedule_node_band obj);
3420 inline isl::ctx ctx() const;
3422 inline isl::union_set ast_build_options() const;
3423 inline isl::union_set get_ast_build_options() const;
3424 inline isl::set ast_isolate_option() const;
3425 inline isl::set get_ast_isolate_option() const;
3426 inline bool member_get_coincident(int pos) const;
3427 inline schedule_node_band member_set_coincident(int pos, int coincident) const;
3428 inline schedule_node_band mod(isl::multi_val mv) const;
3429 inline unsigned n_member() const;
3430 inline isl::multi_union_pw_aff partial_schedule() const;
3431 inline isl::multi_union_pw_aff get_partial_schedule() const;
3432 inline bool permutable() const;
3433 inline bool get_permutable() const;
3434 inline schedule_node_band scale(isl::multi_val mv) const;
3435 inline schedule_node_band scale_down(isl::multi_val mv) const;
3436 inline schedule_node_band set_ast_build_options(isl::union_set options) const;
3437 inline schedule_node_band set_permutable(int permutable) const;
3438 inline schedule_node_band shift(isl::multi_union_pw_aff shift) const;
3439 inline schedule_node_band split(int pos) const;
3440 inline schedule_node_band tile(isl::multi_val sizes) const;
3441 inline schedule_node_band member_set_ast_loop_default(int pos) const;
3442 inline schedule_node_band member_set_ast_loop_atomic(int pos) const;
3443 inline schedule_node_band member_set_ast_loop_unroll(int pos) const;
3444 inline schedule_node_band member_set_ast_loop_separate(int pos) const;
3447 // declarations for isl::schedule_node_context
3449 class schedule_node_context : public schedule_node {
3450 template <class T>
3451 friend bool schedule_node::isa() const;
3452 friend schedule_node_context schedule_node::as<schedule_node_context>() const;
3453 static const auto type = isl_schedule_node_context;
3455 protected:
3456 inline explicit schedule_node_context(__isl_take isl_schedule_node *ptr);
3458 public:
3459 inline /* implicit */ schedule_node_context();
3460 inline /* implicit */ schedule_node_context(const schedule_node_context &obj);
3461 inline schedule_node_context &operator=(schedule_node_context obj);
3462 inline isl::ctx ctx() const;
3464 inline isl::set context() const;
3465 inline isl::set get_context() const;
3468 // declarations for isl::schedule_node_domain
3470 class schedule_node_domain : public schedule_node {
3471 template <class T>
3472 friend bool schedule_node::isa() const;
3473 friend schedule_node_domain schedule_node::as<schedule_node_domain>() const;
3474 static const auto type = isl_schedule_node_domain;
3476 protected:
3477 inline explicit schedule_node_domain(__isl_take isl_schedule_node *ptr);
3479 public:
3480 inline /* implicit */ schedule_node_domain();
3481 inline /* implicit */ schedule_node_domain(const schedule_node_domain &obj);
3482 inline schedule_node_domain &operator=(schedule_node_domain obj);
3483 inline isl::ctx ctx() const;
3485 inline isl::union_set domain() const;
3486 inline isl::union_set get_domain() const;
3489 // declarations for isl::schedule_node_expansion
3491 class schedule_node_expansion : public schedule_node {
3492 template <class T>
3493 friend bool schedule_node::isa() const;
3494 friend schedule_node_expansion schedule_node::as<schedule_node_expansion>() const;
3495 static const auto type = isl_schedule_node_expansion;
3497 protected:
3498 inline explicit schedule_node_expansion(__isl_take isl_schedule_node *ptr);
3500 public:
3501 inline /* implicit */ schedule_node_expansion();
3502 inline /* implicit */ schedule_node_expansion(const schedule_node_expansion &obj);
3503 inline schedule_node_expansion &operator=(schedule_node_expansion obj);
3504 inline isl::ctx ctx() const;
3506 inline isl::union_pw_multi_aff contraction() const;
3507 inline isl::union_pw_multi_aff get_contraction() const;
3508 inline isl::union_map expansion() const;
3509 inline isl::union_map get_expansion() const;
3512 // declarations for isl::schedule_node_extension
3514 class schedule_node_extension : public schedule_node {
3515 template <class T>
3516 friend bool schedule_node::isa() const;
3517 friend schedule_node_extension schedule_node::as<schedule_node_extension>() const;
3518 static const auto type = isl_schedule_node_extension;
3520 protected:
3521 inline explicit schedule_node_extension(__isl_take isl_schedule_node *ptr);
3523 public:
3524 inline /* implicit */ schedule_node_extension();
3525 inline /* implicit */ schedule_node_extension(const schedule_node_extension &obj);
3526 inline schedule_node_extension &operator=(schedule_node_extension obj);
3527 inline isl::ctx ctx() const;
3529 inline isl::union_map extension() const;
3530 inline isl::union_map get_extension() const;
3533 // declarations for isl::schedule_node_filter
3535 class schedule_node_filter : public schedule_node {
3536 template <class T>
3537 friend bool schedule_node::isa() const;
3538 friend schedule_node_filter schedule_node::as<schedule_node_filter>() const;
3539 static const auto type = isl_schedule_node_filter;
3541 protected:
3542 inline explicit schedule_node_filter(__isl_take isl_schedule_node *ptr);
3544 public:
3545 inline /* implicit */ schedule_node_filter();
3546 inline /* implicit */ schedule_node_filter(const schedule_node_filter &obj);
3547 inline schedule_node_filter &operator=(schedule_node_filter obj);
3548 inline isl::ctx ctx() const;
3550 inline isl::union_set filter() const;
3551 inline isl::union_set get_filter() const;
3554 // declarations for isl::schedule_node_guard
3556 class schedule_node_guard : public schedule_node {
3557 template <class T>
3558 friend bool schedule_node::isa() const;
3559 friend schedule_node_guard schedule_node::as<schedule_node_guard>() const;
3560 static const auto type = isl_schedule_node_guard;
3562 protected:
3563 inline explicit schedule_node_guard(__isl_take isl_schedule_node *ptr);
3565 public:
3566 inline /* implicit */ schedule_node_guard();
3567 inline /* implicit */ schedule_node_guard(const schedule_node_guard &obj);
3568 inline schedule_node_guard &operator=(schedule_node_guard obj);
3569 inline isl::ctx ctx() const;
3571 inline isl::set guard() const;
3572 inline isl::set get_guard() const;
3575 // declarations for isl::schedule_node_leaf
3577 class schedule_node_leaf : public schedule_node {
3578 template <class T>
3579 friend bool schedule_node::isa() const;
3580 friend schedule_node_leaf schedule_node::as<schedule_node_leaf>() const;
3581 static const auto type = isl_schedule_node_leaf;
3583 protected:
3584 inline explicit schedule_node_leaf(__isl_take isl_schedule_node *ptr);
3586 public:
3587 inline /* implicit */ schedule_node_leaf();
3588 inline /* implicit */ schedule_node_leaf(const schedule_node_leaf &obj);
3589 inline schedule_node_leaf &operator=(schedule_node_leaf obj);
3590 inline isl::ctx ctx() const;
3594 // declarations for isl::schedule_node_mark
3596 class schedule_node_mark : public schedule_node {
3597 template <class T>
3598 friend bool schedule_node::isa() const;
3599 friend schedule_node_mark schedule_node::as<schedule_node_mark>() const;
3600 static const auto type = isl_schedule_node_mark;
3602 protected:
3603 inline explicit schedule_node_mark(__isl_take isl_schedule_node *ptr);
3605 public:
3606 inline /* implicit */ schedule_node_mark();
3607 inline /* implicit */ schedule_node_mark(const schedule_node_mark &obj);
3608 inline schedule_node_mark &operator=(schedule_node_mark obj);
3609 inline isl::ctx ctx() const;
3613 // declarations for isl::schedule_node_sequence
3615 class schedule_node_sequence : public schedule_node {
3616 template <class T>
3617 friend bool schedule_node::isa() const;
3618 friend schedule_node_sequence schedule_node::as<schedule_node_sequence>() const;
3619 static const auto type = isl_schedule_node_sequence;
3621 protected:
3622 inline explicit schedule_node_sequence(__isl_take isl_schedule_node *ptr);
3624 public:
3625 inline /* implicit */ schedule_node_sequence();
3626 inline /* implicit */ schedule_node_sequence(const schedule_node_sequence &obj);
3627 inline schedule_node_sequence &operator=(schedule_node_sequence obj);
3628 inline isl::ctx ctx() const;
3632 // declarations for isl::schedule_node_set
3634 class schedule_node_set : public schedule_node {
3635 template <class T>
3636 friend bool schedule_node::isa() const;
3637 friend schedule_node_set schedule_node::as<schedule_node_set>() const;
3638 static const auto type = isl_schedule_node_set;
3640 protected:
3641 inline explicit schedule_node_set(__isl_take isl_schedule_node *ptr);
3643 public:
3644 inline /* implicit */ schedule_node_set();
3645 inline /* implicit */ schedule_node_set(const schedule_node_set &obj);
3646 inline schedule_node_set &operator=(schedule_node_set obj);
3647 inline isl::ctx ctx() const;
3651 // declarations for isl::set
3652 inline set manage(__isl_take isl_set *ptr);
3653 inline set manage_copy(__isl_keep isl_set *ptr);
3655 class set {
3656 friend inline set manage(__isl_take isl_set *ptr);
3657 friend inline set manage_copy(__isl_keep isl_set *ptr);
3659 protected:
3660 isl_set *ptr = nullptr;
3662 inline explicit set(__isl_take isl_set *ptr);
3664 public:
3665 inline /* implicit */ set();
3666 inline /* implicit */ set(const set &obj);
3667 inline /* implicit */ set(isl::basic_set bset);
3668 inline /* implicit */ set(isl::point pnt);
3669 inline explicit set(isl::ctx ctx, const std::string &str);
3670 inline set &operator=(set obj);
3671 inline ~set();
3672 inline __isl_give isl_set *copy() const &;
3673 inline __isl_give isl_set *copy() && = delete;
3674 inline __isl_keep isl_set *get() const;
3675 inline __isl_give isl_set *release();
3676 inline bool is_null() const;
3677 inline isl::ctx ctx() const;
3679 inline isl::basic_set affine_hull() const;
3680 inline isl::set apply(isl::map map) const;
3681 inline isl::union_set apply(const isl::union_map &umap) const;
3682 inline isl::set apply(const isl::basic_map &map) const;
3683 inline isl::pw_multi_aff as_pw_multi_aff() const;
3684 inline isl::set as_set() const;
3685 inline isl::set bind(isl::multi_id tuple) const;
3686 inline isl::set coalesce() const;
3687 inline isl::set complement() const;
3688 inline isl::union_set compute_divs() const;
3689 inline isl::set detect_equalities() const;
3690 inline isl::val dim_max_val(int pos) const;
3691 inline isl::val dim_min_val(int pos) const;
3692 inline isl::set drop_unused_params() const;
3693 static inline isl::set empty(isl::space space);
3694 inline bool every_set(const std::function<bool(isl::set)> &test) const;
3695 inline isl::set extract_set(const isl::space &space) const;
3696 inline isl::set flatten() const;
3697 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
3698 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
3699 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
3700 inline isl::set gist(isl::set context) const;
3701 inline isl::union_set gist(const isl::union_set &context) const;
3702 inline isl::set gist(const isl::basic_set &context) const;
3703 inline isl::set gist(const isl::point &context) const;
3704 inline isl::set gist_params(isl::set context) const;
3705 inline isl::map identity() const;
3706 inline isl::pw_aff indicator_function() const;
3707 inline isl::map insert_domain(isl::space domain) const;
3708 inline isl::set intersect(isl::set set2) const;
3709 inline isl::union_set intersect(const isl::union_set &uset2) const;
3710 inline isl::set intersect(const isl::basic_set &set2) const;
3711 inline isl::set intersect(const isl::point &set2) const;
3712 inline isl::set intersect_params(isl::set params) const;
3713 inline bool involves_locals() const;
3714 inline bool is_disjoint(const isl::set &set2) const;
3715 inline bool is_disjoint(const isl::union_set &uset2) const;
3716 inline bool is_disjoint(const isl::basic_set &set2) const;
3717 inline bool is_disjoint(const isl::point &set2) const;
3718 inline bool is_empty() const;
3719 inline bool is_equal(const isl::set &set2) const;
3720 inline bool is_equal(const isl::union_set &uset2) const;
3721 inline bool is_equal(const isl::basic_set &set2) const;
3722 inline bool is_equal(const isl::point &set2) const;
3723 inline bool is_singleton() const;
3724 inline bool is_strict_subset(const isl::set &set2) const;
3725 inline bool is_strict_subset(const isl::union_set &uset2) const;
3726 inline bool is_strict_subset(const isl::basic_set &set2) const;
3727 inline bool is_strict_subset(const isl::point &set2) const;
3728 inline bool is_subset(const isl::set &set2) const;
3729 inline bool is_subset(const isl::union_set &uset2) const;
3730 inline bool is_subset(const isl::basic_set &set2) const;
3731 inline bool is_subset(const isl::point &set2) const;
3732 inline bool is_wrapping() const;
3733 inline bool isa_set() const;
3734 inline isl::fixed_box lattice_tile() const;
3735 inline isl::fixed_box get_lattice_tile() const;
3736 inline isl::set lexmax() const;
3737 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
3738 inline isl::set lexmin() const;
3739 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
3740 inline isl::set lower_bound(isl::multi_pw_aff lower) const;
3741 inline isl::set lower_bound(isl::multi_val lower) const;
3742 inline isl::multi_pw_aff max_multi_pw_aff() const;
3743 inline isl::val max_val(const isl::aff &obj) const;
3744 inline isl::multi_pw_aff min_multi_pw_aff() const;
3745 inline isl::val min_val(const isl::aff &obj) const;
3746 inline unsigned n_basic_set() const;
3747 inline isl::pw_aff param_pw_aff_on_domain(isl::id id) const;
3748 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
3749 inline isl::set params() const;
3750 inline isl::multi_val plain_multi_val_if_fixed() const;
3751 inline isl::multi_val get_plain_multi_val_if_fixed() const;
3752 inline isl::basic_set polyhedral_hull() const;
3753 inline isl::set preimage(isl::multi_aff ma) const;
3754 inline isl::set preimage(isl::multi_pw_aff mpa) const;
3755 inline isl::set preimage(isl::pw_multi_aff pma) const;
3756 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
3757 inline isl::set product(isl::set set2) const;
3758 inline isl::set project_out_all_params() const;
3759 inline isl::set project_out_param(isl::id id) const;
3760 inline isl::set project_out_param(const std::string &id) const;
3761 inline isl::set project_out_param(isl::id_list list) const;
3762 inline isl::pw_aff pw_aff_on_domain(isl::val v) const;
3763 inline isl::pw_aff pw_aff_on_domain(long v) const;
3764 inline isl::pw_multi_aff pw_multi_aff_on_domain(isl::multi_val mv) const;
3765 inline isl::basic_set sample() const;
3766 inline isl::point sample_point() const;
3767 inline isl::set_list set_list() const;
3768 inline isl::fixed_box simple_fixed_box_hull() const;
3769 inline isl::fixed_box get_simple_fixed_box_hull() const;
3770 inline isl::space space() const;
3771 inline isl::space get_space() const;
3772 inline isl::val stride(int pos) const;
3773 inline isl::val get_stride(int pos) const;
3774 inline isl::set subtract(isl::set set2) const;
3775 inline isl::union_set subtract(const isl::union_set &uset2) const;
3776 inline isl::set subtract(const isl::basic_set &set2) const;
3777 inline isl::set subtract(const isl::point &set2) const;
3778 inline isl::set_list to_list() const;
3779 inline isl::union_set to_union_set() const;
3780 inline isl::map translation() const;
3781 inline unsigned tuple_dim() const;
3782 inline isl::set unbind_params(isl::multi_id tuple) const;
3783 inline isl::map unbind_params_insert_domain(isl::multi_id domain) const;
3784 inline isl::set unite(isl::set set2) const;
3785 inline isl::union_set unite(const isl::union_set &uset2) const;
3786 inline isl::set unite(const isl::basic_set &set2) const;
3787 inline isl::set unite(const isl::point &set2) const;
3788 static inline isl::set universe(isl::space space);
3789 inline isl::basic_set unshifted_simple_hull() const;
3790 inline isl::map unwrap() const;
3791 inline isl::set upper_bound(isl::multi_pw_aff upper) const;
3792 inline isl::set upper_bound(isl::multi_val upper) const;
3793 inline isl::set wrapped_reverse() const;
3796 // declarations for isl::set_list
3797 inline set_list manage(__isl_take isl_set_list *ptr);
3798 inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3800 class set_list {
3801 friend inline set_list manage(__isl_take isl_set_list *ptr);
3802 friend inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3804 protected:
3805 isl_set_list *ptr = nullptr;
3807 inline explicit set_list(__isl_take isl_set_list *ptr);
3809 public:
3810 inline /* implicit */ set_list();
3811 inline /* implicit */ set_list(const set_list &obj);
3812 inline explicit set_list(isl::ctx ctx, int n);
3813 inline explicit set_list(isl::set el);
3814 inline explicit set_list(isl::ctx ctx, const std::string &str);
3815 inline set_list &operator=(set_list obj);
3816 inline ~set_list();
3817 inline __isl_give isl_set_list *copy() const &;
3818 inline __isl_give isl_set_list *copy() && = delete;
3819 inline __isl_keep isl_set_list *get() const;
3820 inline __isl_give isl_set_list *release();
3821 inline bool is_null() const;
3822 inline isl::ctx ctx() const;
3824 inline isl::set_list add(isl::set el) const;
3825 inline isl::set at(int index) const;
3826 inline isl::set get_at(int index) const;
3827 inline isl::set_list clear() const;
3828 inline isl::set_list concat(isl::set_list list2) const;
3829 inline isl::set_list drop(unsigned int first, unsigned int n) const;
3830 inline void foreach(const std::function<void(isl::set)> &fn) const;
3831 inline void foreach_scc(const std::function<bool(isl::set, isl::set)> &follows, const std::function<void(isl::set_list)> &fn) const;
3832 inline isl::set_list insert(unsigned int pos, isl::set el) const;
3833 inline isl::set_list set_at(int index, isl::set el) const;
3834 inline unsigned size() const;
3837 // declarations for isl::space
3838 inline space manage(__isl_take isl_space *ptr);
3839 inline space manage_copy(__isl_keep isl_space *ptr);
3841 class space {
3842 friend inline space manage(__isl_take isl_space *ptr);
3843 friend inline space manage_copy(__isl_keep isl_space *ptr);
3845 protected:
3846 isl_space *ptr = nullptr;
3848 inline explicit space(__isl_take isl_space *ptr);
3850 public:
3851 inline /* implicit */ space();
3852 inline /* implicit */ space(const space &obj);
3853 inline explicit space(isl::ctx ctx, const std::string &str);
3854 inline space &operator=(space obj);
3855 inline ~space();
3856 inline __isl_give isl_space *copy() const &;
3857 inline __isl_give isl_space *copy() && = delete;
3858 inline __isl_keep isl_space *get() const;
3859 inline __isl_give isl_space *release();
3860 inline bool is_null() const;
3861 inline isl::ctx ctx() const;
3863 inline isl::space add_named_tuple(isl::id tuple_id, unsigned int dim) const;
3864 inline isl::space add_named_tuple(const std::string &tuple_id, unsigned int dim) const;
3865 inline isl::space add_param(isl::id id) const;
3866 inline isl::space add_param(const std::string &id) const;
3867 inline isl::space add_unnamed_tuple(unsigned int dim) const;
3868 inline isl::space curry() const;
3869 inline isl::space domain() const;
3870 inline isl::multi_aff domain_map_multi_aff() const;
3871 inline isl::pw_multi_aff domain_map_pw_multi_aff() const;
3872 inline isl::space domain_reverse() const;
3873 inline isl::id domain_tuple_id() const;
3874 inline isl::id get_domain_tuple_id() const;
3875 inline isl::space drop_all_params() const;
3876 inline isl::space flatten_domain() const;
3877 inline isl::space flatten_range() const;
3878 inline bool has_domain_tuple_id() const;
3879 inline bool has_range_tuple_id() const;
3880 inline isl::multi_aff identity_multi_aff_on_domain() const;
3881 inline isl::multi_pw_aff identity_multi_pw_aff_on_domain() const;
3882 inline isl::pw_multi_aff identity_pw_multi_aff_on_domain() const;
3883 inline bool is_equal(const isl::space &space2) const;
3884 inline bool is_wrapping() const;
3885 inline isl::space map_from_set() const;
3886 inline isl::multi_aff multi_aff(isl::aff_list list) const;
3887 inline isl::multi_aff multi_aff_on_domain(isl::multi_val mv) const;
3888 inline isl::multi_id multi_id(isl::id_list list) const;
3889 inline isl::multi_pw_aff multi_pw_aff(isl::pw_aff_list list) const;
3890 inline isl::multi_union_pw_aff multi_union_pw_aff(isl::union_pw_aff_list list) const;
3891 inline isl::multi_val multi_val(isl::val_list list) const;
3892 inline isl::aff param_aff_on_domain(isl::id id) const;
3893 inline isl::aff param_aff_on_domain(const std::string &id) const;
3894 inline isl::space params() const;
3895 inline isl::space product(isl::space right) const;
3896 inline isl::space range() const;
3897 inline isl::multi_aff range_map_multi_aff() const;
3898 inline isl::pw_multi_aff range_map_pw_multi_aff() const;
3899 inline isl::space range_reverse() const;
3900 inline isl::id range_tuple_id() const;
3901 inline isl::id get_range_tuple_id() const;
3902 inline isl::space reverse() const;
3903 inline isl::space set_domain_tuple(isl::id id) const;
3904 inline isl::space set_domain_tuple(const std::string &id) const;
3905 inline isl::space set_range_tuple(isl::id id) const;
3906 inline isl::space set_range_tuple(const std::string &id) const;
3907 inline isl::space uncurry() const;
3908 static inline isl::space unit(isl::ctx ctx);
3909 inline isl::map universe_map() const;
3910 inline isl::set universe_set() const;
3911 inline isl::space unwrap() const;
3912 inline isl::space wrap() const;
3913 inline isl::space wrapped_reverse() const;
3914 inline isl::aff zero_aff_on_domain() const;
3915 inline isl::multi_aff zero_multi_aff() const;
3916 inline isl::multi_pw_aff zero_multi_pw_aff() const;
3917 inline isl::multi_union_pw_aff zero_multi_union_pw_aff() const;
3918 inline isl::multi_val zero_multi_val() const;
3921 // declarations for isl::union_access_info
3922 inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3923 inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3925 class union_access_info {
3926 friend inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3927 friend inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3929 protected:
3930 isl_union_access_info *ptr = nullptr;
3932 inline explicit union_access_info(__isl_take isl_union_access_info *ptr);
3934 public:
3935 inline /* implicit */ union_access_info();
3936 inline /* implicit */ union_access_info(const union_access_info &obj);
3937 inline explicit union_access_info(isl::union_map sink);
3938 inline union_access_info &operator=(union_access_info obj);
3939 inline ~union_access_info();
3940 inline __isl_give isl_union_access_info *copy() const &;
3941 inline __isl_give isl_union_access_info *copy() && = delete;
3942 inline __isl_keep isl_union_access_info *get() const;
3943 inline __isl_give isl_union_access_info *release();
3944 inline bool is_null() const;
3945 inline isl::ctx ctx() const;
3947 inline isl::union_flow compute_flow() const;
3948 inline isl::union_access_info set_kill(isl::union_map kill) const;
3949 inline isl::union_access_info set_may_source(isl::union_map may_source) const;
3950 inline isl::union_access_info set_must_source(isl::union_map must_source) const;
3951 inline isl::union_access_info set_schedule(isl::schedule schedule) const;
3952 inline isl::union_access_info set_schedule_map(isl::union_map schedule_map) const;
3955 // declarations for isl::union_flow
3956 inline union_flow manage(__isl_take isl_union_flow *ptr);
3957 inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3959 class union_flow {
3960 friend inline union_flow manage(__isl_take isl_union_flow *ptr);
3961 friend inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3963 protected:
3964 isl_union_flow *ptr = nullptr;
3966 inline explicit union_flow(__isl_take isl_union_flow *ptr);
3968 public:
3969 inline /* implicit */ union_flow();
3970 inline /* implicit */ union_flow(const union_flow &obj);
3971 inline union_flow &operator=(union_flow obj);
3972 inline ~union_flow();
3973 inline __isl_give isl_union_flow *copy() const &;
3974 inline __isl_give isl_union_flow *copy() && = delete;
3975 inline __isl_keep isl_union_flow *get() const;
3976 inline __isl_give isl_union_flow *release();
3977 inline bool is_null() const;
3978 inline isl::ctx ctx() const;
3980 inline isl::union_map full_may_dependence() const;
3981 inline isl::union_map get_full_may_dependence() const;
3982 inline isl::union_map full_must_dependence() const;
3983 inline isl::union_map get_full_must_dependence() const;
3984 inline isl::union_map may_dependence() const;
3985 inline isl::union_map get_may_dependence() const;
3986 inline isl::union_map may_no_source() const;
3987 inline isl::union_map get_may_no_source() const;
3988 inline isl::union_map must_dependence() const;
3989 inline isl::union_map get_must_dependence() const;
3990 inline isl::union_map must_no_source() const;
3991 inline isl::union_map get_must_no_source() const;
3994 // declarations for isl::union_map
3995 inline union_map manage(__isl_take isl_union_map *ptr);
3996 inline union_map manage_copy(__isl_keep isl_union_map *ptr);
3998 class union_map {
3999 friend inline union_map manage(__isl_take isl_union_map *ptr);
4000 friend inline union_map manage_copy(__isl_keep isl_union_map *ptr);
4002 protected:
4003 isl_union_map *ptr = nullptr;
4005 inline explicit union_map(__isl_take isl_union_map *ptr);
4007 public:
4008 inline /* implicit */ union_map();
4009 inline /* implicit */ union_map(const union_map &obj);
4010 inline /* implicit */ union_map(isl::basic_map bmap);
4011 inline /* implicit */ union_map(isl::map map);
4012 inline explicit union_map(isl::ctx ctx, const std::string &str);
4013 inline union_map &operator=(union_map obj);
4014 inline ~union_map();
4015 inline __isl_give isl_union_map *copy() const &;
4016 inline __isl_give isl_union_map *copy() && = delete;
4017 inline __isl_keep isl_union_map *get() const;
4018 inline __isl_give isl_union_map *release();
4019 inline bool is_null() const;
4020 inline isl::ctx ctx() const;
4022 inline isl::union_map affine_hull() const;
4023 inline isl::union_map apply_domain(isl::union_map umap2) const;
4024 inline isl::union_map apply_range(isl::union_map umap2) const;
4025 inline isl::map as_map() const;
4026 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4027 inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
4028 inline isl::union_set bind_range(isl::multi_id tuple) const;
4029 inline isl::union_map coalesce() const;
4030 inline isl::union_map compute_divs() const;
4031 inline isl::union_map curry() const;
4032 inline isl::union_set deltas() const;
4033 inline isl::union_map detect_equalities() const;
4034 inline isl::union_set domain() const;
4035 inline isl::union_map domain_factor_domain() const;
4036 inline isl::union_map domain_factor_range() const;
4037 inline isl::union_map domain_map() const;
4038 inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
4039 inline isl::union_map domain_product(isl::union_map umap2) const;
4040 inline isl::union_map domain_reverse() const;
4041 inline isl::union_map drop_unused_params() const;
4042 static inline isl::union_map empty(isl::ctx ctx);
4043 inline isl::union_map eq_at(isl::multi_union_pw_aff mupa) const;
4044 inline bool every_map(const std::function<bool(isl::map)> &test) const;
4045 inline isl::map extract_map(isl::space space) const;
4046 inline isl::union_map factor_domain() const;
4047 inline isl::union_map factor_range() const;
4048 inline isl::union_map fixed_power(isl::val exp) const;
4049 inline isl::union_map fixed_power(long exp) const;
4050 inline void foreach_map(const std::function<void(isl::map)> &fn) const;
4051 static inline isl::union_map from(isl::multi_union_pw_aff mupa);
4052 static inline isl::union_map from(isl::union_pw_multi_aff upma);
4053 static inline isl::union_map from_domain(isl::union_set uset);
4054 static inline isl::union_map from_domain_and_range(isl::union_set domain, isl::union_set range);
4055 static inline isl::union_map from_range(isl::union_set uset);
4056 inline isl::union_map gist(isl::union_map context) const;
4057 inline isl::union_map gist_domain(isl::union_set uset) const;
4058 inline isl::union_map gist_params(isl::set set) const;
4059 inline isl::union_map gist_range(isl::union_set uset) const;
4060 inline isl::union_map intersect(isl::union_map umap2) const;
4061 inline isl::union_map intersect_domain(isl::space space) const;
4062 inline isl::union_map intersect_domain(isl::union_set uset) const;
4063 inline isl::union_map intersect_domain_factor_domain(isl::union_map factor) const;
4064 inline isl::union_map intersect_domain_factor_range(isl::union_map factor) const;
4065 inline isl::union_map intersect_domain_wrapped_domain(isl::union_set domain) const;
4066 inline isl::union_map intersect_params(isl::set set) const;
4067 inline isl::union_map intersect_range(isl::space space) const;
4068 inline isl::union_map intersect_range(isl::union_set uset) const;
4069 inline isl::union_map intersect_range_factor_domain(isl::union_map factor) const;
4070 inline isl::union_map intersect_range_factor_range(isl::union_map factor) const;
4071 inline isl::union_map intersect_range_wrapped_domain(isl::union_set domain) const;
4072 inline bool is_bijective() const;
4073 inline bool is_disjoint(const isl::union_map &umap2) const;
4074 inline bool is_empty() const;
4075 inline bool is_equal(const isl::union_map &umap2) const;
4076 inline bool is_injective() const;
4077 inline bool is_single_valued() const;
4078 inline bool is_strict_subset(const isl::union_map &umap2) const;
4079 inline bool is_subset(const isl::union_map &umap2) const;
4080 inline bool isa_map() const;
4081 inline isl::union_map lexmax() const;
4082 inline isl::union_map lexmin() const;
4083 inline isl::map_list map_list() const;
4084 inline isl::map_list get_map_list() const;
4085 inline isl::set params() const;
4086 inline isl::union_map polyhedral_hull() const;
4087 inline isl::union_map preimage_domain(isl::multi_aff ma) const;
4088 inline isl::union_map preimage_domain(isl::multi_pw_aff mpa) const;
4089 inline isl::union_map preimage_domain(isl::pw_multi_aff pma) const;
4090 inline isl::union_map preimage_domain(isl::union_pw_multi_aff upma) const;
4091 inline isl::union_map preimage_range(isl::multi_aff ma) const;
4092 inline isl::union_map preimage_range(isl::pw_multi_aff pma) const;
4093 inline isl::union_map preimage_range(isl::union_pw_multi_aff upma) const;
4094 inline isl::union_map product(isl::union_map umap2) const;
4095 inline isl::union_map project_out_all_params() const;
4096 inline isl::union_map project_out_param(isl::id id) const;
4097 inline isl::union_map project_out_param(const std::string &id) const;
4098 inline isl::union_map project_out_param(isl::id_list list) const;
4099 inline isl::union_set range() const;
4100 inline isl::union_map range_factor_domain() const;
4101 inline isl::union_map range_factor_range() const;
4102 inline isl::union_map range_map() const;
4103 inline isl::union_map range_product(isl::union_map umap2) const;
4104 inline isl::union_map range_reverse() const;
4105 inline isl::union_map reverse() const;
4106 inline isl::space space() const;
4107 inline isl::space get_space() const;
4108 inline isl::union_map subtract(isl::union_map umap2) const;
4109 inline isl::union_map subtract_domain(isl::union_set dom) const;
4110 inline isl::union_map subtract_range(isl::union_set dom) const;
4111 inline isl::union_map uncurry() const;
4112 inline isl::union_map unite(isl::union_map umap2) const;
4113 inline isl::union_map universe() const;
4114 inline isl::union_set wrap() const;
4115 inline isl::union_map zip() const;
4118 // declarations for isl::union_pw_aff
4119 inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
4120 inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
4122 class union_pw_aff {
4123 friend inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
4124 friend inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
4126 protected:
4127 isl_union_pw_aff *ptr = nullptr;
4129 inline explicit union_pw_aff(__isl_take isl_union_pw_aff *ptr);
4131 public:
4132 inline /* implicit */ union_pw_aff();
4133 inline /* implicit */ union_pw_aff(const union_pw_aff &obj);
4134 inline /* implicit */ union_pw_aff(isl::aff aff);
4135 inline /* implicit */ union_pw_aff(isl::pw_aff pa);
4136 inline explicit union_pw_aff(isl::ctx ctx, const std::string &str);
4137 inline union_pw_aff &operator=(union_pw_aff obj);
4138 inline ~union_pw_aff();
4139 inline __isl_give isl_union_pw_aff *copy() const &;
4140 inline __isl_give isl_union_pw_aff *copy() && = delete;
4141 inline __isl_keep isl_union_pw_aff *get() const;
4142 inline __isl_give isl_union_pw_aff *release();
4143 inline bool is_null() const;
4144 inline isl::ctx ctx() const;
4146 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
4147 inline isl::union_pw_aff add(isl::union_pw_aff upa2) const;
4148 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
4149 inline isl::union_pw_aff add(const isl::aff &upa2) const;
4150 inline isl::union_pw_aff add(const isl::pw_aff &upa2) const;
4151 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
4152 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4153 inline isl::pw_multi_aff as_pw_multi_aff() const;
4154 inline isl::union_map as_union_map() const;
4155 inline isl::union_pw_aff at(int pos) const;
4156 inline isl::union_set bind(const isl::multi_id &tuple) const;
4157 inline isl::union_set bind(isl::id id) const;
4158 inline isl::union_set bind(const std::string &id) const;
4159 inline isl::union_pw_aff coalesce() const;
4160 inline isl::union_set domain() const;
4161 inline isl::union_pw_aff drop_unused_params() const;
4162 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
4163 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
4164 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
4165 inline isl::union_pw_aff gist(isl::union_set context) const;
4166 inline isl::multi_union_pw_aff gist_params(const isl::set &context) const;
4167 inline bool has_range_tuple_id() const;
4168 inline isl::union_pw_aff intersect_domain(isl::space space) const;
4169 inline isl::union_pw_aff intersect_domain(isl::union_set uset) const;
4170 inline isl::union_pw_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
4171 inline isl::union_pw_aff intersect_domain_wrapped_range(isl::union_set uset) const;
4172 inline isl::union_pw_aff intersect_params(isl::set set) const;
4173 inline bool involves_locals() const;
4174 inline bool involves_nan() const;
4175 inline bool isa_pw_multi_aff() const;
4176 inline isl::union_pw_aff_list list() const;
4177 inline isl::multi_union_pw_aff neg() const;
4178 inline bool plain_is_empty() const;
4179 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
4180 inline bool plain_is_equal(const isl::union_pw_aff &upa2) const;
4181 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
4182 inline bool plain_is_equal(const isl::aff &upa2) const;
4183 inline bool plain_is_equal(const isl::pw_aff &upa2) const;
4184 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
4185 inline isl::union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
4186 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
4187 inline isl::union_pw_multi_aff range_factor_domain() const;
4188 inline isl::union_pw_multi_aff range_factor_range() const;
4189 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
4190 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
4191 inline isl::id range_tuple_id() const;
4192 inline isl::multi_union_pw_aff reset_range_tuple_id() const;
4193 inline isl::multi_union_pw_aff scale(const isl::multi_val &mv) const;
4194 inline isl::multi_union_pw_aff scale(const isl::val &v) const;
4195 inline isl::multi_union_pw_aff scale(long v) const;
4196 inline isl::multi_union_pw_aff scale_down(const isl::multi_val &mv) const;
4197 inline isl::multi_union_pw_aff scale_down(const isl::val &v) const;
4198 inline isl::multi_union_pw_aff scale_down(long v) const;
4199 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
4200 inline isl::multi_union_pw_aff set_range_tuple(const isl::id &id) const;
4201 inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
4202 inline unsigned size() const;
4203 inline isl::space space() const;
4204 inline isl::space get_space() const;
4205 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
4206 inline isl::union_pw_aff sub(isl::union_pw_aff upa2) const;
4207 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
4208 inline isl::union_pw_aff sub(const isl::aff &upa2) const;
4209 inline isl::union_pw_aff sub(const isl::pw_aff &upa2) const;
4210 inline isl::union_pw_aff subtract_domain(isl::space space) const;
4211 inline isl::union_pw_aff subtract_domain(isl::union_set uset) const;
4212 inline isl::union_pw_aff_list to_list() const;
4213 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
4214 inline isl::union_pw_aff union_add(isl::union_pw_aff upa2) const;
4215 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
4216 inline isl::union_pw_aff union_add(const isl::aff &upa2) const;
4217 inline isl::union_pw_aff union_add(const isl::pw_aff &upa2) const;
4220 // declarations for isl::union_pw_aff_list
4221 inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4222 inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4224 class union_pw_aff_list {
4225 friend inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4226 friend inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4228 protected:
4229 isl_union_pw_aff_list *ptr = nullptr;
4231 inline explicit union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr);
4233 public:
4234 inline /* implicit */ union_pw_aff_list();
4235 inline /* implicit */ union_pw_aff_list(const union_pw_aff_list &obj);
4236 inline explicit union_pw_aff_list(isl::ctx ctx, int n);
4237 inline explicit union_pw_aff_list(isl::union_pw_aff el);
4238 inline explicit union_pw_aff_list(isl::ctx ctx, const std::string &str);
4239 inline union_pw_aff_list &operator=(union_pw_aff_list obj);
4240 inline ~union_pw_aff_list();
4241 inline __isl_give isl_union_pw_aff_list *copy() const &;
4242 inline __isl_give isl_union_pw_aff_list *copy() && = delete;
4243 inline __isl_keep isl_union_pw_aff_list *get() const;
4244 inline __isl_give isl_union_pw_aff_list *release();
4245 inline bool is_null() const;
4246 inline isl::ctx ctx() const;
4248 inline isl::union_pw_aff_list add(isl::union_pw_aff el) const;
4249 inline isl::union_pw_aff at(int index) const;
4250 inline isl::union_pw_aff get_at(int index) const;
4251 inline isl::union_pw_aff_list clear() const;
4252 inline isl::union_pw_aff_list concat(isl::union_pw_aff_list list2) const;
4253 inline isl::union_pw_aff_list drop(unsigned int first, unsigned int n) const;
4254 inline void foreach(const std::function<void(isl::union_pw_aff)> &fn) const;
4255 inline void foreach_scc(const std::function<bool(isl::union_pw_aff, isl::union_pw_aff)> &follows, const std::function<void(isl::union_pw_aff_list)> &fn) const;
4256 inline isl::union_pw_aff_list insert(unsigned int pos, isl::union_pw_aff el) const;
4257 inline isl::union_pw_aff_list set_at(int index, isl::union_pw_aff el) const;
4258 inline unsigned size() const;
4261 // declarations for isl::union_pw_multi_aff
4262 inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4263 inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4265 class union_pw_multi_aff {
4266 friend inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4267 friend inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4269 protected:
4270 isl_union_pw_multi_aff *ptr = nullptr;
4272 inline explicit union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr);
4274 public:
4275 inline /* implicit */ union_pw_multi_aff();
4276 inline /* implicit */ union_pw_multi_aff(const union_pw_multi_aff &obj);
4277 inline /* implicit */ union_pw_multi_aff(isl::multi_aff ma);
4278 inline /* implicit */ union_pw_multi_aff(isl::pw_multi_aff pma);
4279 inline /* implicit */ union_pw_multi_aff(isl::union_pw_aff upa);
4280 inline explicit union_pw_multi_aff(isl::ctx ctx, const std::string &str);
4281 inline union_pw_multi_aff &operator=(union_pw_multi_aff obj);
4282 inline ~union_pw_multi_aff();
4283 inline __isl_give isl_union_pw_multi_aff *copy() const &;
4284 inline __isl_give isl_union_pw_multi_aff *copy() && = delete;
4285 inline __isl_keep isl_union_pw_multi_aff *get() const;
4286 inline __isl_give isl_union_pw_multi_aff *release();
4287 inline bool is_null() const;
4288 inline isl::ctx ctx() const;
4290 inline isl::union_pw_multi_aff add(isl::union_pw_multi_aff upma2) const;
4291 inline isl::union_pw_multi_aff apply(isl::union_pw_multi_aff upma2) const;
4292 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4293 inline isl::pw_multi_aff as_pw_multi_aff() const;
4294 inline isl::union_map as_union_map() const;
4295 inline isl::union_pw_multi_aff coalesce() const;
4296 inline isl::union_set domain() const;
4297 inline isl::union_pw_multi_aff drop_unused_params() const;
4298 static inline isl::union_pw_multi_aff empty(isl::ctx ctx);
4299 inline isl::pw_multi_aff extract_pw_multi_aff(isl::space space) const;
4300 inline isl::union_pw_multi_aff flat_range_product(isl::union_pw_multi_aff upma2) const;
4301 inline isl::union_pw_multi_aff gist(isl::union_set context) const;
4302 inline isl::union_pw_multi_aff intersect_domain(isl::space space) const;
4303 inline isl::union_pw_multi_aff intersect_domain(isl::union_set uset) const;
4304 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
4305 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(isl::union_set uset) const;
4306 inline isl::union_pw_multi_aff intersect_params(isl::set set) const;
4307 inline bool involves_locals() const;
4308 inline bool isa_pw_multi_aff() const;
4309 inline bool plain_is_empty() const;
4310 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
4311 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const;
4312 inline isl::union_pw_multi_aff pullback(isl::union_pw_multi_aff upma2) const;
4313 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
4314 inline isl::pw_multi_aff_list get_pw_multi_aff_list() const;
4315 inline isl::union_pw_multi_aff range_factor_domain() const;
4316 inline isl::union_pw_multi_aff range_factor_range() const;
4317 inline isl::union_pw_multi_aff range_product(isl::union_pw_multi_aff upma2) const;
4318 inline isl::space space() const;
4319 inline isl::space get_space() const;
4320 inline isl::union_pw_multi_aff sub(isl::union_pw_multi_aff upma2) const;
4321 inline isl::union_pw_multi_aff subtract_domain(isl::space space) const;
4322 inline isl::union_pw_multi_aff subtract_domain(isl::union_set uset) const;
4323 inline isl::union_pw_multi_aff union_add(isl::union_pw_multi_aff upma2) const;
4326 // declarations for isl::union_set
4327 inline union_set manage(__isl_take isl_union_set *ptr);
4328 inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4330 class union_set {
4331 friend inline union_set manage(__isl_take isl_union_set *ptr);
4332 friend inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4334 protected:
4335 isl_union_set *ptr = nullptr;
4337 inline explicit union_set(__isl_take isl_union_set *ptr);
4339 public:
4340 inline /* implicit */ union_set();
4341 inline /* implicit */ union_set(const union_set &obj);
4342 inline /* implicit */ union_set(isl::basic_set bset);
4343 inline /* implicit */ union_set(isl::point pnt);
4344 inline /* implicit */ union_set(isl::set set);
4345 inline explicit union_set(isl::ctx ctx, const std::string &str);
4346 inline union_set &operator=(union_set obj);
4347 inline ~union_set();
4348 inline __isl_give isl_union_set *copy() const &;
4349 inline __isl_give isl_union_set *copy() && = delete;
4350 inline __isl_keep isl_union_set *get() const;
4351 inline __isl_give isl_union_set *release();
4352 inline bool is_null() const;
4353 inline isl::ctx ctx() const;
4355 inline isl::union_set affine_hull() const;
4356 inline isl::union_set apply(isl::union_map umap) const;
4357 inline isl::set as_set() const;
4358 inline isl::union_set coalesce() const;
4359 inline isl::union_set compute_divs() const;
4360 inline isl::union_set detect_equalities() const;
4361 inline isl::union_set drop_unused_params() const;
4362 static inline isl::union_set empty(isl::ctx ctx);
4363 inline bool every_set(const std::function<bool(isl::set)> &test) const;
4364 inline isl::set extract_set(isl::space space) const;
4365 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
4366 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
4367 inline isl::union_set gist(isl::union_set context) const;
4368 inline isl::union_set gist_params(isl::set set) const;
4369 inline isl::union_map identity() const;
4370 inline isl::union_set intersect(isl::union_set uset2) const;
4371 inline isl::union_set intersect_params(isl::set set) const;
4372 inline bool is_disjoint(const isl::union_set &uset2) const;
4373 inline bool is_empty() const;
4374 inline bool is_equal(const isl::union_set &uset2) const;
4375 inline bool is_strict_subset(const isl::union_set &uset2) const;
4376 inline bool is_subset(const isl::union_set &uset2) const;
4377 inline bool isa_set() const;
4378 inline isl::union_set lexmax() const;
4379 inline isl::union_set lexmin() const;
4380 inline isl::set params() const;
4381 inline isl::union_set polyhedral_hull() const;
4382 inline isl::union_set preimage(isl::multi_aff ma) const;
4383 inline isl::union_set preimage(isl::pw_multi_aff pma) const;
4384 inline isl::union_set preimage(isl::union_pw_multi_aff upma) const;
4385 inline isl::union_set project_out_all_params() const;
4386 inline isl::point sample_point() const;
4387 inline isl::set_list set_list() const;
4388 inline isl::set_list get_set_list() const;
4389 inline isl::space space() const;
4390 inline isl::space get_space() const;
4391 inline isl::union_set subtract(isl::union_set uset2) const;
4392 inline isl::union_set_list to_list() const;
4393 inline isl::union_set unite(isl::union_set uset2) const;
4394 inline isl::union_set universe() const;
4395 inline isl::union_map unwrap() const;
4398 // declarations for isl::union_set_list
4399 inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4400 inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4402 class union_set_list {
4403 friend inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4404 friend inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4406 protected:
4407 isl_union_set_list *ptr = nullptr;
4409 inline explicit union_set_list(__isl_take isl_union_set_list *ptr);
4411 public:
4412 inline /* implicit */ union_set_list();
4413 inline /* implicit */ union_set_list(const union_set_list &obj);
4414 inline explicit union_set_list(isl::ctx ctx, int n);
4415 inline explicit union_set_list(isl::union_set el);
4416 inline explicit union_set_list(isl::ctx ctx, const std::string &str);
4417 inline union_set_list &operator=(union_set_list obj);
4418 inline ~union_set_list();
4419 inline __isl_give isl_union_set_list *copy() const &;
4420 inline __isl_give isl_union_set_list *copy() && = delete;
4421 inline __isl_keep isl_union_set_list *get() const;
4422 inline __isl_give isl_union_set_list *release();
4423 inline bool is_null() const;
4424 inline isl::ctx ctx() const;
4426 inline isl::union_set_list add(isl::union_set el) const;
4427 inline isl::union_set at(int index) const;
4428 inline isl::union_set get_at(int index) const;
4429 inline isl::union_set_list clear() const;
4430 inline isl::union_set_list concat(isl::union_set_list list2) const;
4431 inline isl::union_set_list drop(unsigned int first, unsigned int n) const;
4432 inline void foreach(const std::function<void(isl::union_set)> &fn) const;
4433 inline void foreach_scc(const std::function<bool(isl::union_set, isl::union_set)> &follows, const std::function<void(isl::union_set_list)> &fn) const;
4434 inline isl::union_set_list insert(unsigned int pos, isl::union_set el) const;
4435 inline isl::union_set_list set_at(int index, isl::union_set el) const;
4436 inline unsigned size() const;
4439 // declarations for isl::val
4440 inline val manage(__isl_take isl_val *ptr);
4441 inline val manage_copy(__isl_keep isl_val *ptr);
4443 class val {
4444 friend inline val manage(__isl_take isl_val *ptr);
4445 friend inline val manage_copy(__isl_keep isl_val *ptr);
4447 protected:
4448 isl_val *ptr = nullptr;
4450 inline explicit val(__isl_take isl_val *ptr);
4452 public:
4453 inline /* implicit */ val();
4454 inline /* implicit */ val(const val &obj);
4455 inline explicit val(isl::ctx ctx, long i);
4456 inline explicit val(isl::ctx ctx, const std::string &str);
4457 inline val &operator=(val obj);
4458 inline ~val();
4459 inline __isl_give isl_val *copy() const &;
4460 inline __isl_give isl_val *copy() && = delete;
4461 inline __isl_keep isl_val *get() const;
4462 inline __isl_give isl_val *release();
4463 inline bool is_null() const;
4464 inline isl::ctx ctx() const;
4466 inline isl::val abs() const;
4467 inline bool abs_eq(const isl::val &v2) const;
4468 inline bool abs_eq(long v2) const;
4469 inline isl::val add(isl::val v2) const;
4470 inline isl::val add(long v2) const;
4471 inline isl::val ceil() const;
4472 inline int cmp_si(long i) const;
4473 inline long den_si() const;
4474 inline long get_den_si() const;
4475 inline isl::val div(isl::val v2) const;
4476 inline isl::val div(long v2) const;
4477 inline bool eq(const isl::val &v2) const;
4478 inline bool eq(long v2) const;
4479 inline isl::val floor() const;
4480 inline isl::val gcd(isl::val v2) const;
4481 inline isl::val gcd(long v2) const;
4482 inline bool ge(const isl::val &v2) const;
4483 inline bool ge(long v2) const;
4484 inline bool gt(const isl::val &v2) const;
4485 inline bool gt(long v2) const;
4486 static inline isl::val infty(isl::ctx ctx);
4487 inline isl::val inv() const;
4488 inline bool is_divisible_by(const isl::val &v2) const;
4489 inline bool is_divisible_by(long v2) const;
4490 inline bool is_infty() const;
4491 inline bool is_int() const;
4492 inline bool is_nan() const;
4493 inline bool is_neg() const;
4494 inline bool is_neginfty() const;
4495 inline bool is_negone() const;
4496 inline bool is_nonneg() const;
4497 inline bool is_nonpos() const;
4498 inline bool is_one() const;
4499 inline bool is_pos() const;
4500 inline bool is_rat() const;
4501 inline bool is_zero() const;
4502 inline bool le(const isl::val &v2) const;
4503 inline bool le(long v2) const;
4504 inline bool lt(const isl::val &v2) const;
4505 inline bool lt(long v2) const;
4506 inline isl::val max(isl::val v2) const;
4507 inline isl::val max(long v2) const;
4508 inline isl::val min(isl::val v2) const;
4509 inline isl::val min(long v2) const;
4510 inline isl::val mod(isl::val v2) const;
4511 inline isl::val mod(long v2) const;
4512 inline isl::val mul(isl::val v2) const;
4513 inline isl::val mul(long v2) const;
4514 static inline isl::val nan(isl::ctx ctx);
4515 inline bool ne(const isl::val &v2) const;
4516 inline bool ne(long v2) const;
4517 inline isl::val neg() const;
4518 static inline isl::val neginfty(isl::ctx ctx);
4519 static inline isl::val negone(isl::ctx ctx);
4520 inline long num_si() const;
4521 inline long get_num_si() const;
4522 static inline isl::val one(isl::ctx ctx);
4523 inline isl::val pow2() const;
4524 inline int sgn() const;
4525 inline isl::val sub(isl::val v2) const;
4526 inline isl::val sub(long v2) const;
4527 inline isl::val_list to_list() const;
4528 inline isl::val trunc() const;
4529 static inline isl::val zero(isl::ctx ctx);
4532 // declarations for isl::val_list
4533 inline val_list manage(__isl_take isl_val_list *ptr);
4534 inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4536 class val_list {
4537 friend inline val_list manage(__isl_take isl_val_list *ptr);
4538 friend inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4540 protected:
4541 isl_val_list *ptr = nullptr;
4543 inline explicit val_list(__isl_take isl_val_list *ptr);
4545 public:
4546 inline /* implicit */ val_list();
4547 inline /* implicit */ val_list(const val_list &obj);
4548 inline explicit val_list(isl::ctx ctx, int n);
4549 inline explicit val_list(isl::val el);
4550 inline explicit val_list(isl::ctx ctx, const std::string &str);
4551 inline val_list &operator=(val_list obj);
4552 inline ~val_list();
4553 inline __isl_give isl_val_list *copy() const &;
4554 inline __isl_give isl_val_list *copy() && = delete;
4555 inline __isl_keep isl_val_list *get() const;
4556 inline __isl_give isl_val_list *release();
4557 inline bool is_null() const;
4558 inline isl::ctx ctx() const;
4560 inline isl::val_list add(isl::val el) const;
4561 inline isl::val_list add(long el) const;
4562 inline isl::val at(int index) const;
4563 inline isl::val get_at(int index) const;
4564 inline isl::val_list clear() const;
4565 inline isl::val_list concat(isl::val_list list2) const;
4566 inline isl::val_list drop(unsigned int first, unsigned int n) const;
4567 inline void foreach(const std::function<void(isl::val)> &fn) const;
4568 inline void foreach_scc(const std::function<bool(isl::val, isl::val)> &follows, const std::function<void(isl::val_list)> &fn) const;
4569 inline isl::val_list insert(unsigned int pos, isl::val el) const;
4570 inline isl::val_list insert(unsigned int pos, long el) const;
4571 inline isl::val_list set_at(int index, isl::val el) const;
4572 inline isl::val_list set_at(int index, long el) const;
4573 inline unsigned size() const;
4576 // implementations for isl::aff
4577 aff manage(__isl_take isl_aff *ptr) {
4578 if (!ptr)
4579 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4580 return aff(ptr);
4582 aff manage_copy(__isl_keep isl_aff *ptr) {
4583 if (!ptr)
4584 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4585 auto saved_ctx = isl_aff_get_ctx(ptr);
4586 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4587 ptr = isl_aff_copy(ptr);
4588 if (!ptr)
4589 exception::throw_last_error(saved_ctx);
4590 return aff(ptr);
4593 aff::aff(__isl_take isl_aff *ptr)
4594 : ptr(ptr) {}
4596 aff::aff()
4597 : ptr(nullptr) {}
4599 aff::aff(const aff &obj)
4600 : ptr(nullptr)
4602 if (!obj.ptr)
4603 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4604 auto saved_ctx = isl_aff_get_ctx(obj.ptr);
4605 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4606 ptr = obj.copy();
4607 if (!ptr)
4608 exception::throw_last_error(saved_ctx);
4611 aff::aff(isl::ctx ctx, const std::string &str)
4613 auto saved_ctx = ctx;
4614 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4615 auto res = isl_aff_read_from_str(ctx.release(), str.c_str());
4616 if (!res)
4617 exception::throw_last_error(saved_ctx);
4618 ptr = res;
4621 aff &aff::operator=(aff obj) {
4622 std::swap(this->ptr, obj.ptr);
4623 return *this;
4626 aff::~aff() {
4627 if (ptr)
4628 isl_aff_free(ptr);
4631 __isl_give isl_aff *aff::copy() const & {
4632 return isl_aff_copy(ptr);
4635 __isl_keep isl_aff *aff::get() const {
4636 return ptr;
4639 __isl_give isl_aff *aff::release() {
4640 isl_aff *tmp = ptr;
4641 ptr = nullptr;
4642 return tmp;
4645 bool aff::is_null() const {
4646 return ptr == nullptr;
4649 isl::ctx aff::ctx() const {
4650 return isl::ctx(isl_aff_get_ctx(ptr));
4653 isl::aff aff::add(isl::aff aff2) const
4655 if (!ptr || aff2.is_null())
4656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4657 auto saved_ctx = ctx();
4658 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4659 auto res = isl_aff_add(copy(), aff2.release());
4660 if (!res)
4661 exception::throw_last_error(saved_ctx);
4662 return manage(res);
4665 isl::multi_aff aff::add(const isl::multi_aff &multi2) const
4667 if (!ptr)
4668 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4669 return isl::multi_aff(*this).add(multi2);
4672 isl::multi_pw_aff aff::add(const isl::multi_pw_aff &multi2) const
4674 if (!ptr)
4675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4676 return isl::pw_aff(*this).add(multi2);
4679 isl::multi_union_pw_aff aff::add(const isl::multi_union_pw_aff &multi2) const
4681 if (!ptr)
4682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4683 return isl::pw_aff(*this).add(multi2);
4686 isl::pw_aff aff::add(const isl::pw_aff &pwaff2) const
4688 if (!ptr)
4689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4690 return isl::pw_aff(*this).add(pwaff2);
4693 isl::pw_multi_aff aff::add(const isl::pw_multi_aff &pma2) const
4695 if (!ptr)
4696 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4697 return isl::pw_aff(*this).add(pma2);
4700 isl::union_pw_aff aff::add(const isl::union_pw_aff &upa2) const
4702 if (!ptr)
4703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4704 return isl::pw_aff(*this).add(upa2);
4707 isl::union_pw_multi_aff aff::add(const isl::union_pw_multi_aff &upma2) const
4709 if (!ptr)
4710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4711 return isl::pw_aff(*this).add(upma2);
4714 isl::aff aff::add_constant(isl::val v) const
4716 if (!ptr || v.is_null())
4717 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4718 auto saved_ctx = ctx();
4719 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4720 auto res = isl_aff_add_constant_val(copy(), v.release());
4721 if (!res)
4722 exception::throw_last_error(saved_ctx);
4723 return manage(res);
4726 isl::aff aff::add_constant(long v) const
4728 if (!ptr)
4729 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4730 return this->add_constant(isl::val(ctx(), v));
4733 isl::multi_aff aff::add_constant(const isl::multi_val &mv) const
4735 if (!ptr)
4736 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4737 return isl::multi_aff(*this).add_constant(mv);
4740 isl::union_pw_multi_aff aff::apply(const isl::union_pw_multi_aff &upma2) const
4742 if (!ptr)
4743 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4744 return isl::pw_aff(*this).apply(upma2);
4747 isl::aff aff::as_aff() const
4749 if (!ptr)
4750 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4751 return isl::pw_aff(*this).as_aff();
4754 isl::map aff::as_map() const
4756 if (!ptr)
4757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4758 return isl::pw_aff(*this).as_map();
4761 isl::multi_aff aff::as_multi_aff() const
4763 if (!ptr)
4764 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4765 return isl::pw_aff(*this).as_multi_aff();
4768 isl::multi_union_pw_aff aff::as_multi_union_pw_aff() const
4770 if (!ptr)
4771 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4772 return isl::pw_aff(*this).as_multi_union_pw_aff();
4775 isl::pw_multi_aff aff::as_pw_multi_aff() const
4777 if (!ptr)
4778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4779 return isl::pw_aff(*this).as_pw_multi_aff();
4782 isl::set aff::as_set() const
4784 if (!ptr)
4785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4786 return isl::multi_aff(*this).as_set();
4789 isl::union_map aff::as_union_map() const
4791 if (!ptr)
4792 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4793 return isl::pw_aff(*this).as_union_map();
4796 isl::aff aff::at(int pos) const
4798 if (!ptr)
4799 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4800 return isl::multi_aff(*this).at(pos);
4803 isl::basic_set aff::bind(isl::id id) const
4805 if (!ptr || id.is_null())
4806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4807 auto saved_ctx = ctx();
4808 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4809 auto res = isl_aff_bind_id(copy(), id.release());
4810 if (!res)
4811 exception::throw_last_error(saved_ctx);
4812 return manage(res);
4815 isl::basic_set aff::bind(const std::string &id) const
4817 if (!ptr)
4818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4819 return this->bind(isl::id(ctx(), id));
4822 isl::basic_set aff::bind(const isl::multi_id &tuple) const
4824 if (!ptr)
4825 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4826 return isl::multi_aff(*this).bind(tuple);
4829 isl::pw_aff aff::bind_domain(const isl::multi_id &tuple) const
4831 if (!ptr)
4832 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4833 return isl::pw_aff(*this).bind_domain(tuple);
4836 isl::pw_aff aff::bind_domain_wrapped_domain(const isl::multi_id &tuple) const
4838 if (!ptr)
4839 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4840 return isl::pw_aff(*this).bind_domain_wrapped_domain(tuple);
4843 isl::aff aff::ceil() const
4845 if (!ptr)
4846 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4847 auto saved_ctx = ctx();
4848 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4849 auto res = isl_aff_ceil(copy());
4850 if (!res)
4851 exception::throw_last_error(saved_ctx);
4852 return manage(res);
4855 isl::pw_aff aff::coalesce() const
4857 if (!ptr)
4858 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4859 return isl::pw_aff(*this).coalesce();
4862 isl::pw_aff aff::cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const
4864 if (!ptr)
4865 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4866 return isl::pw_aff(*this).cond(pwaff_true, pwaff_false);
4869 isl::multi_val aff::constant_multi_val() const
4871 if (!ptr)
4872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4873 return isl::multi_aff(*this).constant_multi_val();
4876 isl::val aff::constant_val() const
4878 if (!ptr)
4879 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4880 auto saved_ctx = ctx();
4881 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4882 auto res = isl_aff_get_constant_val(get());
4883 if (!res)
4884 exception::throw_last_error(saved_ctx);
4885 return manage(res);
4888 isl::val aff::get_constant_val() const
4890 return constant_val();
4893 isl::aff aff::div(isl::aff aff2) const
4895 if (!ptr || aff2.is_null())
4896 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4897 auto saved_ctx = ctx();
4898 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4899 auto res = isl_aff_div(copy(), aff2.release());
4900 if (!res)
4901 exception::throw_last_error(saved_ctx);
4902 return manage(res);
4905 isl::pw_aff aff::div(const isl::pw_aff &pa2) const
4907 if (!ptr)
4908 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4909 return isl::pw_aff(*this).div(pa2);
4912 isl::set aff::domain() const
4914 if (!ptr)
4915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4916 return isl::pw_aff(*this).domain();
4919 isl::aff aff::domain_reverse() const
4921 if (!ptr)
4922 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4923 auto saved_ctx = ctx();
4924 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4925 auto res = isl_aff_domain_reverse(copy());
4926 if (!res)
4927 exception::throw_last_error(saved_ctx);
4928 return manage(res);
4931 isl::pw_aff aff::drop_unused_params() const
4933 if (!ptr)
4934 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4935 return isl::pw_aff(*this).drop_unused_params();
4938 isl::set aff::eq_set(isl::aff aff2) const
4940 if (!ptr || aff2.is_null())
4941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4942 auto saved_ctx = ctx();
4943 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4944 auto res = isl_aff_eq_set(copy(), aff2.release());
4945 if (!res)
4946 exception::throw_last_error(saved_ctx);
4947 return manage(res);
4950 isl::set aff::eq_set(const isl::pw_aff &pwaff2) const
4952 if (!ptr)
4953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4954 return isl::pw_aff(*this).eq_set(pwaff2);
4957 isl::val aff::eval(isl::point pnt) const
4959 if (!ptr || pnt.is_null())
4960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4961 auto saved_ctx = ctx();
4962 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4963 auto res = isl_aff_eval(copy(), pnt.release());
4964 if (!res)
4965 exception::throw_last_error(saved_ctx);
4966 return manage(res);
4969 isl::pw_multi_aff aff::extract_pw_multi_aff(const isl::space &space) const
4971 if (!ptr)
4972 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4973 return isl::pw_aff(*this).extract_pw_multi_aff(space);
4976 isl::multi_aff aff::flat_range_product(const isl::multi_aff &multi2) const
4978 if (!ptr)
4979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4980 return isl::multi_aff(*this).flat_range_product(multi2);
4983 isl::multi_pw_aff aff::flat_range_product(const isl::multi_pw_aff &multi2) const
4985 if (!ptr)
4986 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4987 return isl::pw_aff(*this).flat_range_product(multi2);
4990 isl::multi_union_pw_aff aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
4992 if (!ptr)
4993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4994 return isl::pw_aff(*this).flat_range_product(multi2);
4997 isl::pw_multi_aff aff::flat_range_product(const isl::pw_multi_aff &pma2) const
4999 if (!ptr)
5000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5001 return isl::pw_aff(*this).flat_range_product(pma2);
5004 isl::union_pw_multi_aff aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
5006 if (!ptr)
5007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5008 return isl::pw_aff(*this).flat_range_product(upma2);
5011 isl::aff aff::floor() const
5013 if (!ptr)
5014 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5015 auto saved_ctx = ctx();
5016 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5017 auto res = isl_aff_floor(copy());
5018 if (!res)
5019 exception::throw_last_error(saved_ctx);
5020 return manage(res);
5023 void aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
5025 if (!ptr)
5026 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5027 return isl::pw_aff(*this).foreach_piece(fn);
5030 isl::set aff::ge_set(isl::aff aff2) const
5032 if (!ptr || aff2.is_null())
5033 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5034 auto saved_ctx = ctx();
5035 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5036 auto res = isl_aff_ge_set(copy(), aff2.release());
5037 if (!res)
5038 exception::throw_last_error(saved_ctx);
5039 return manage(res);
5042 isl::set aff::ge_set(const isl::pw_aff &pwaff2) const
5044 if (!ptr)
5045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5046 return isl::pw_aff(*this).ge_set(pwaff2);
5049 isl::aff aff::gist(isl::set context) const
5051 if (!ptr || context.is_null())
5052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5053 auto saved_ctx = ctx();
5054 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5055 auto res = isl_aff_gist(copy(), context.release());
5056 if (!res)
5057 exception::throw_last_error(saved_ctx);
5058 return manage(res);
5061 isl::union_pw_aff aff::gist(const isl::union_set &context) const
5063 if (!ptr)
5064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5065 return isl::pw_aff(*this).gist(context);
5068 isl::aff aff::gist(const isl::basic_set &context) const
5070 if (!ptr)
5071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5072 return this->gist(isl::set(context));
5075 isl::aff aff::gist(const isl::point &context) const
5077 if (!ptr)
5078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5079 return this->gist(isl::set(context));
5082 isl::aff aff::gist_params(isl::set context) const
5084 if (!ptr || context.is_null())
5085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5086 auto saved_ctx = ctx();
5087 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5088 auto res = isl_aff_gist_params(copy(), context.release());
5089 if (!res)
5090 exception::throw_last_error(saved_ctx);
5091 return manage(res);
5094 isl::set aff::gt_set(isl::aff aff2) const
5096 if (!ptr || aff2.is_null())
5097 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5098 auto saved_ctx = ctx();
5099 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5100 auto res = isl_aff_gt_set(copy(), aff2.release());
5101 if (!res)
5102 exception::throw_last_error(saved_ctx);
5103 return manage(res);
5106 isl::set aff::gt_set(const isl::pw_aff &pwaff2) const
5108 if (!ptr)
5109 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5110 return isl::pw_aff(*this).gt_set(pwaff2);
5113 bool aff::has_range_tuple_id() const
5115 if (!ptr)
5116 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5117 return isl::multi_aff(*this).has_range_tuple_id();
5120 isl::multi_aff aff::identity() const
5122 if (!ptr)
5123 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5124 return isl::multi_aff(*this).identity();
5127 isl::pw_aff aff::insert_domain(const isl::space &domain) const
5129 if (!ptr)
5130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5131 return isl::pw_aff(*this).insert_domain(domain);
5134 isl::pw_aff aff::intersect_domain(const isl::set &set) const
5136 if (!ptr)
5137 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5138 return isl::pw_aff(*this).intersect_domain(set);
5141 isl::union_pw_aff aff::intersect_domain(const isl::space &space) const
5143 if (!ptr)
5144 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5145 return isl::pw_aff(*this).intersect_domain(space);
5148 isl::union_pw_aff aff::intersect_domain(const isl::union_set &uset) const
5150 if (!ptr)
5151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5152 return isl::pw_aff(*this).intersect_domain(uset);
5155 isl::union_pw_aff aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
5157 if (!ptr)
5158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5159 return isl::pw_aff(*this).intersect_domain_wrapped_domain(uset);
5162 isl::union_pw_aff aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
5164 if (!ptr)
5165 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5166 return isl::pw_aff(*this).intersect_domain_wrapped_range(uset);
5169 isl::pw_aff aff::intersect_params(const isl::set &set) const
5171 if (!ptr)
5172 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5173 return isl::pw_aff(*this).intersect_params(set);
5176 bool aff::involves_locals() const
5178 if (!ptr)
5179 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5180 return isl::multi_aff(*this).involves_locals();
5183 bool aff::involves_nan() const
5185 if (!ptr)
5186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5187 return isl::multi_aff(*this).involves_nan();
5190 bool aff::involves_param(const isl::id &id) const
5192 if (!ptr)
5193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5194 return isl::pw_aff(*this).involves_param(id);
5197 bool aff::involves_param(const std::string &id) const
5199 if (!ptr)
5200 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5201 return this->involves_param(isl::id(ctx(), id));
5204 bool aff::involves_param(const isl::id_list &list) const
5206 if (!ptr)
5207 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5208 return isl::pw_aff(*this).involves_param(list);
5211 bool aff::is_cst() const
5213 if (!ptr)
5214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5215 auto saved_ctx = ctx();
5216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5217 auto res = isl_aff_is_cst(get());
5218 if (res < 0)
5219 exception::throw_last_error(saved_ctx);
5220 return res;
5223 bool aff::isa_aff() const
5225 if (!ptr)
5226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5227 return isl::pw_aff(*this).isa_aff();
5230 bool aff::isa_multi_aff() const
5232 if (!ptr)
5233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5234 return isl::pw_aff(*this).isa_multi_aff();
5237 bool aff::isa_pw_multi_aff() const
5239 if (!ptr)
5240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5241 return isl::pw_aff(*this).isa_pw_multi_aff();
5244 isl::set aff::le_set(isl::aff aff2) const
5246 if (!ptr || aff2.is_null())
5247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5248 auto saved_ctx = ctx();
5249 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5250 auto res = isl_aff_le_set(copy(), aff2.release());
5251 if (!res)
5252 exception::throw_last_error(saved_ctx);
5253 return manage(res);
5256 isl::set aff::le_set(const isl::pw_aff &pwaff2) const
5258 if (!ptr)
5259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5260 return isl::pw_aff(*this).le_set(pwaff2);
5263 isl::aff_list aff::list() const
5265 if (!ptr)
5266 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5267 return isl::multi_aff(*this).list();
5270 isl::set aff::lt_set(isl::aff aff2) const
5272 if (!ptr || aff2.is_null())
5273 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5274 auto saved_ctx = ctx();
5275 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5276 auto res = isl_aff_lt_set(copy(), aff2.release());
5277 if (!res)
5278 exception::throw_last_error(saved_ctx);
5279 return manage(res);
5282 isl::set aff::lt_set(const isl::pw_aff &pwaff2) const
5284 if (!ptr)
5285 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5286 return isl::pw_aff(*this).lt_set(pwaff2);
5289 isl::multi_pw_aff aff::max(const isl::multi_pw_aff &multi2) const
5291 if (!ptr)
5292 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5293 return isl::pw_aff(*this).max(multi2);
5296 isl::pw_aff aff::max(const isl::pw_aff &pwaff2) const
5298 if (!ptr)
5299 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5300 return isl::pw_aff(*this).max(pwaff2);
5303 isl::multi_val aff::max_multi_val() const
5305 if (!ptr)
5306 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5307 return isl::pw_aff(*this).max_multi_val();
5310 isl::val aff::max_val() const
5312 if (!ptr)
5313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5314 return isl::pw_aff(*this).max_val();
5317 isl::multi_pw_aff aff::min(const isl::multi_pw_aff &multi2) const
5319 if (!ptr)
5320 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5321 return isl::pw_aff(*this).min(multi2);
5324 isl::pw_aff aff::min(const isl::pw_aff &pwaff2) const
5326 if (!ptr)
5327 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5328 return isl::pw_aff(*this).min(pwaff2);
5331 isl::multi_val aff::min_multi_val() const
5333 if (!ptr)
5334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5335 return isl::pw_aff(*this).min_multi_val();
5338 isl::val aff::min_val() const
5340 if (!ptr)
5341 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5342 return isl::pw_aff(*this).min_val();
5345 isl::aff aff::mod(isl::val mod) const
5347 if (!ptr || mod.is_null())
5348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5349 auto saved_ctx = ctx();
5350 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5351 auto res = isl_aff_mod_val(copy(), mod.release());
5352 if (!res)
5353 exception::throw_last_error(saved_ctx);
5354 return manage(res);
5357 isl::aff aff::mod(long mod) const
5359 if (!ptr)
5360 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5361 return this->mod(isl::val(ctx(), mod));
5364 isl::aff aff::mul(isl::aff aff2) const
5366 if (!ptr || aff2.is_null())
5367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5368 auto saved_ctx = ctx();
5369 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5370 auto res = isl_aff_mul(copy(), aff2.release());
5371 if (!res)
5372 exception::throw_last_error(saved_ctx);
5373 return manage(res);
5376 isl::pw_aff aff::mul(const isl::pw_aff &pwaff2) const
5378 if (!ptr)
5379 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5380 return isl::pw_aff(*this).mul(pwaff2);
5383 unsigned aff::n_piece() const
5385 if (!ptr)
5386 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5387 return isl::pw_aff(*this).n_piece();
5390 isl::set aff::ne_set(isl::aff aff2) const
5392 if (!ptr || aff2.is_null())
5393 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5394 auto saved_ctx = ctx();
5395 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5396 auto res = isl_aff_ne_set(copy(), aff2.release());
5397 if (!res)
5398 exception::throw_last_error(saved_ctx);
5399 return manage(res);
5402 isl::set aff::ne_set(const isl::pw_aff &pwaff2) const
5404 if (!ptr)
5405 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5406 return isl::pw_aff(*this).ne_set(pwaff2);
5409 isl::aff aff::neg() const
5411 if (!ptr)
5412 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5413 auto saved_ctx = ctx();
5414 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5415 auto res = isl_aff_neg(copy());
5416 if (!res)
5417 exception::throw_last_error(saved_ctx);
5418 return manage(res);
5421 isl::set aff::params() const
5423 if (!ptr)
5424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5425 return isl::pw_aff(*this).params();
5428 bool aff::plain_is_empty() const
5430 if (!ptr)
5431 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5432 return isl::pw_aff(*this).plain_is_empty();
5435 bool aff::plain_is_equal(const isl::aff &aff2) const
5437 if (!ptr || aff2.is_null())
5438 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5439 auto saved_ctx = ctx();
5440 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5441 auto res = isl_aff_plain_is_equal(get(), aff2.get());
5442 if (res < 0)
5443 exception::throw_last_error(saved_ctx);
5444 return res;
5447 bool aff::plain_is_equal(const isl::multi_aff &multi2) const
5449 if (!ptr)
5450 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5451 return isl::multi_aff(*this).plain_is_equal(multi2);
5454 bool aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
5456 if (!ptr)
5457 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5458 return isl::pw_aff(*this).plain_is_equal(multi2);
5461 bool aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
5463 if (!ptr)
5464 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5465 return isl::pw_aff(*this).plain_is_equal(multi2);
5468 bool aff::plain_is_equal(const isl::pw_aff &pwaff2) const
5470 if (!ptr)
5471 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5472 return isl::pw_aff(*this).plain_is_equal(pwaff2);
5475 bool aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
5477 if (!ptr)
5478 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5479 return isl::pw_aff(*this).plain_is_equal(pma2);
5482 bool aff::plain_is_equal(const isl::union_pw_aff &upa2) const
5484 if (!ptr)
5485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5486 return isl::pw_aff(*this).plain_is_equal(upa2);
5489 bool aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
5491 if (!ptr)
5492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5493 return isl::pw_aff(*this).plain_is_equal(upma2);
5496 isl::pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
5498 if (!ptr)
5499 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5500 return isl::pw_aff(*this).preimage_domain_wrapped_domain(pma2);
5503 isl::union_pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
5505 if (!ptr)
5506 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5507 return isl::pw_aff(*this).preimage_domain_wrapped_domain(upma2);
5510 isl::multi_aff aff::product(const isl::multi_aff &multi2) const
5512 if (!ptr)
5513 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5514 return isl::multi_aff(*this).product(multi2);
5517 isl::multi_pw_aff aff::product(const isl::multi_pw_aff &multi2) const
5519 if (!ptr)
5520 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5521 return isl::pw_aff(*this).product(multi2);
5524 isl::pw_multi_aff aff::product(const isl::pw_multi_aff &pma2) const
5526 if (!ptr)
5527 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5528 return isl::pw_aff(*this).product(pma2);
5531 isl::aff aff::pullback(isl::multi_aff ma) const
5533 if (!ptr || ma.is_null())
5534 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5535 auto saved_ctx = ctx();
5536 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5537 auto res = isl_aff_pullback_multi_aff(copy(), ma.release());
5538 if (!res)
5539 exception::throw_last_error(saved_ctx);
5540 return manage(res);
5543 isl::pw_aff aff::pullback(const isl::multi_pw_aff &mpa) const
5545 if (!ptr)
5546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5547 return isl::pw_aff(*this).pullback(mpa);
5550 isl::pw_aff aff::pullback(const isl::pw_multi_aff &pma) const
5552 if (!ptr)
5553 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5554 return isl::pw_aff(*this).pullback(pma);
5557 isl::union_pw_aff aff::pullback(const isl::union_pw_multi_aff &upma) const
5559 if (!ptr)
5560 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5561 return isl::pw_aff(*this).pullback(upma);
5564 isl::aff aff::pullback(const isl::aff &ma) const
5566 if (!ptr)
5567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5568 return this->pullback(isl::multi_aff(ma));
5571 isl::pw_multi_aff_list aff::pw_multi_aff_list() const
5573 if (!ptr)
5574 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5575 return isl::pw_aff(*this).pw_multi_aff_list();
5578 isl::pw_multi_aff aff::range_factor_domain() const
5580 if (!ptr)
5581 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5582 return isl::pw_aff(*this).range_factor_domain();
5585 isl::pw_multi_aff aff::range_factor_range() const
5587 if (!ptr)
5588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5589 return isl::pw_aff(*this).range_factor_range();
5592 isl::multi_aff aff::range_product(const isl::multi_aff &multi2) const
5594 if (!ptr)
5595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5596 return isl::multi_aff(*this).range_product(multi2);
5599 isl::multi_pw_aff aff::range_product(const isl::multi_pw_aff &multi2) const
5601 if (!ptr)
5602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5603 return isl::pw_aff(*this).range_product(multi2);
5606 isl::multi_union_pw_aff aff::range_product(const isl::multi_union_pw_aff &multi2) const
5608 if (!ptr)
5609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5610 return isl::pw_aff(*this).range_product(multi2);
5613 isl::pw_multi_aff aff::range_product(const isl::pw_multi_aff &pma2) const
5615 if (!ptr)
5616 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5617 return isl::pw_aff(*this).range_product(pma2);
5620 isl::union_pw_multi_aff aff::range_product(const isl::union_pw_multi_aff &upma2) const
5622 if (!ptr)
5623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5624 return isl::pw_aff(*this).range_product(upma2);
5627 isl::id aff::range_tuple_id() const
5629 if (!ptr)
5630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5631 return isl::multi_aff(*this).range_tuple_id();
5634 isl::multi_aff aff::reset_range_tuple_id() const
5636 if (!ptr)
5637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5638 return isl::multi_aff(*this).reset_range_tuple_id();
5641 isl::aff aff::scale(isl::val v) const
5643 if (!ptr || v.is_null())
5644 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5645 auto saved_ctx = ctx();
5646 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5647 auto res = isl_aff_scale_val(copy(), v.release());
5648 if (!res)
5649 exception::throw_last_error(saved_ctx);
5650 return manage(res);
5653 isl::aff aff::scale(long v) const
5655 if (!ptr)
5656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5657 return this->scale(isl::val(ctx(), v));
5660 isl::multi_aff aff::scale(const isl::multi_val &mv) const
5662 if (!ptr)
5663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5664 return isl::multi_aff(*this).scale(mv);
5667 isl::aff aff::scale_down(isl::val v) const
5669 if (!ptr || v.is_null())
5670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5671 auto saved_ctx = ctx();
5672 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5673 auto res = isl_aff_scale_down_val(copy(), v.release());
5674 if (!res)
5675 exception::throw_last_error(saved_ctx);
5676 return manage(res);
5679 isl::aff aff::scale_down(long v) const
5681 if (!ptr)
5682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5683 return this->scale_down(isl::val(ctx(), v));
5686 isl::multi_aff aff::scale_down(const isl::multi_val &mv) const
5688 if (!ptr)
5689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5690 return isl::multi_aff(*this).scale_down(mv);
5693 isl::multi_aff aff::set_at(int pos, const isl::aff &el) const
5695 if (!ptr)
5696 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5697 return isl::multi_aff(*this).set_at(pos, el);
5700 isl::multi_pw_aff aff::set_at(int pos, const isl::pw_aff &el) const
5702 if (!ptr)
5703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5704 return isl::pw_aff(*this).set_at(pos, el);
5707 isl::multi_union_pw_aff aff::set_at(int pos, const isl::union_pw_aff &el) const
5709 if (!ptr)
5710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5711 return isl::pw_aff(*this).set_at(pos, el);
5714 isl::multi_aff aff::set_range_tuple(const isl::id &id) const
5716 if (!ptr)
5717 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5718 return isl::multi_aff(*this).set_range_tuple(id);
5721 isl::multi_aff aff::set_range_tuple(const std::string &id) const
5723 if (!ptr)
5724 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5725 return this->set_range_tuple(isl::id(ctx(), id));
5728 unsigned aff::size() const
5730 if (!ptr)
5731 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5732 return isl::multi_aff(*this).size();
5735 isl::space aff::space() const
5737 if (!ptr)
5738 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5739 return isl::pw_aff(*this).space();
5742 isl::aff aff::sub(isl::aff aff2) const
5744 if (!ptr || aff2.is_null())
5745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5746 auto saved_ctx = ctx();
5747 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5748 auto res = isl_aff_sub(copy(), aff2.release());
5749 if (!res)
5750 exception::throw_last_error(saved_ctx);
5751 return manage(res);
5754 isl::multi_aff aff::sub(const isl::multi_aff &multi2) const
5756 if (!ptr)
5757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5758 return isl::multi_aff(*this).sub(multi2);
5761 isl::multi_pw_aff aff::sub(const isl::multi_pw_aff &multi2) const
5763 if (!ptr)
5764 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5765 return isl::pw_aff(*this).sub(multi2);
5768 isl::multi_union_pw_aff aff::sub(const isl::multi_union_pw_aff &multi2) const
5770 if (!ptr)
5771 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5772 return isl::pw_aff(*this).sub(multi2);
5775 isl::pw_aff aff::sub(const isl::pw_aff &pwaff2) const
5777 if (!ptr)
5778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5779 return isl::pw_aff(*this).sub(pwaff2);
5782 isl::pw_multi_aff aff::sub(const isl::pw_multi_aff &pma2) const
5784 if (!ptr)
5785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5786 return isl::pw_aff(*this).sub(pma2);
5789 isl::union_pw_aff aff::sub(const isl::union_pw_aff &upa2) const
5791 if (!ptr)
5792 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5793 return isl::pw_aff(*this).sub(upa2);
5796 isl::union_pw_multi_aff aff::sub(const isl::union_pw_multi_aff &upma2) const
5798 if (!ptr)
5799 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5800 return isl::pw_aff(*this).sub(upma2);
5803 isl::pw_aff aff::subtract_domain(const isl::set &set) const
5805 if (!ptr)
5806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5807 return isl::pw_aff(*this).subtract_domain(set);
5810 isl::union_pw_aff aff::subtract_domain(const isl::space &space) const
5812 if (!ptr)
5813 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5814 return isl::pw_aff(*this).subtract_domain(space);
5817 isl::union_pw_aff aff::subtract_domain(const isl::union_set &uset) const
5819 if (!ptr)
5820 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5821 return isl::pw_aff(*this).subtract_domain(uset);
5824 isl::pw_aff aff::tdiv_q(const isl::pw_aff &pa2) const
5826 if (!ptr)
5827 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5828 return isl::pw_aff(*this).tdiv_q(pa2);
5831 isl::pw_aff aff::tdiv_r(const isl::pw_aff &pa2) const
5833 if (!ptr)
5834 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5835 return isl::pw_aff(*this).tdiv_r(pa2);
5838 isl::aff_list aff::to_list() const
5840 if (!ptr)
5841 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5842 auto saved_ctx = ctx();
5843 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5844 auto res = isl_aff_to_list(copy());
5845 if (!res)
5846 exception::throw_last_error(saved_ctx);
5847 return manage(res);
5850 isl::multi_pw_aff aff::to_multi_pw_aff() const
5852 if (!ptr)
5853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5854 return isl::multi_aff(*this).to_multi_pw_aff();
5857 isl::multi_union_pw_aff aff::to_multi_union_pw_aff() const
5859 if (!ptr)
5860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5861 return isl::multi_aff(*this).to_multi_union_pw_aff();
5864 isl::pw_multi_aff aff::to_pw_multi_aff() const
5866 if (!ptr)
5867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5868 return isl::multi_aff(*this).to_pw_multi_aff();
5871 isl::union_pw_aff aff::to_union_pw_aff() const
5873 if (!ptr)
5874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5875 return isl::pw_aff(*this).to_union_pw_aff();
5878 isl::union_pw_multi_aff aff::to_union_pw_multi_aff() const
5880 if (!ptr)
5881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5882 return isl::pw_aff(*this).to_union_pw_multi_aff();
5885 isl::aff aff::unbind_params_insert_domain(isl::multi_id domain) const
5887 if (!ptr || domain.is_null())
5888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5889 auto saved_ctx = ctx();
5890 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5891 auto res = isl_aff_unbind_params_insert_domain(copy(), domain.release());
5892 if (!res)
5893 exception::throw_last_error(saved_ctx);
5894 return manage(res);
5897 isl::multi_pw_aff aff::union_add(const isl::multi_pw_aff &mpa2) const
5899 if (!ptr)
5900 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5901 return isl::pw_aff(*this).union_add(mpa2);
5904 isl::multi_union_pw_aff aff::union_add(const isl::multi_union_pw_aff &mupa2) const
5906 if (!ptr)
5907 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5908 return isl::pw_aff(*this).union_add(mupa2);
5911 isl::pw_aff aff::union_add(const isl::pw_aff &pwaff2) const
5913 if (!ptr)
5914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5915 return isl::pw_aff(*this).union_add(pwaff2);
5918 isl::pw_multi_aff aff::union_add(const isl::pw_multi_aff &pma2) const
5920 if (!ptr)
5921 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5922 return isl::pw_aff(*this).union_add(pma2);
5925 isl::union_pw_aff aff::union_add(const isl::union_pw_aff &upa2) const
5927 if (!ptr)
5928 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5929 return isl::pw_aff(*this).union_add(upa2);
5932 isl::union_pw_multi_aff aff::union_add(const isl::union_pw_multi_aff &upma2) const
5934 if (!ptr)
5935 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5936 return isl::pw_aff(*this).union_add(upma2);
5939 isl::aff aff::zero_on_domain(isl::space space)
5941 if (space.is_null())
5942 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5943 auto saved_ctx = space.ctx();
5944 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5945 auto res = isl_aff_zero_on_domain_space(space.release());
5946 if (!res)
5947 exception::throw_last_error(saved_ctx);
5948 return manage(res);
5951 inline std::ostream &operator<<(std::ostream &os, const aff &obj)
5953 if (!obj.get())
5954 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5955 auto saved_ctx = isl_aff_get_ctx(obj.get());
5956 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5957 char *str = isl_aff_to_str(obj.get());
5958 if (!str)
5959 exception::throw_last_error(saved_ctx);
5960 os << str;
5961 free(str);
5962 return os;
5965 // implementations for isl::aff_list
5966 aff_list manage(__isl_take isl_aff_list *ptr) {
5967 if (!ptr)
5968 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5969 return aff_list(ptr);
5971 aff_list manage_copy(__isl_keep isl_aff_list *ptr) {
5972 if (!ptr)
5973 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5974 auto saved_ctx = isl_aff_list_get_ctx(ptr);
5975 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5976 ptr = isl_aff_list_copy(ptr);
5977 if (!ptr)
5978 exception::throw_last_error(saved_ctx);
5979 return aff_list(ptr);
5982 aff_list::aff_list(__isl_take isl_aff_list *ptr)
5983 : ptr(ptr) {}
5985 aff_list::aff_list()
5986 : ptr(nullptr) {}
5988 aff_list::aff_list(const aff_list &obj)
5989 : ptr(nullptr)
5991 if (!obj.ptr)
5992 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5993 auto saved_ctx = isl_aff_list_get_ctx(obj.ptr);
5994 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5995 ptr = obj.copy();
5996 if (!ptr)
5997 exception::throw_last_error(saved_ctx);
6000 aff_list::aff_list(isl::ctx ctx, int n)
6002 auto saved_ctx = ctx;
6003 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6004 auto res = isl_aff_list_alloc(ctx.release(), n);
6005 if (!res)
6006 exception::throw_last_error(saved_ctx);
6007 ptr = res;
6010 aff_list::aff_list(isl::aff el)
6012 if (el.is_null())
6013 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6014 auto saved_ctx = el.ctx();
6015 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6016 auto res = isl_aff_list_from_aff(el.release());
6017 if (!res)
6018 exception::throw_last_error(saved_ctx);
6019 ptr = res;
6022 aff_list::aff_list(isl::ctx ctx, const std::string &str)
6024 auto saved_ctx = ctx;
6025 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6026 auto res = isl_aff_list_read_from_str(ctx.release(), str.c_str());
6027 if (!res)
6028 exception::throw_last_error(saved_ctx);
6029 ptr = res;
6032 aff_list &aff_list::operator=(aff_list obj) {
6033 std::swap(this->ptr, obj.ptr);
6034 return *this;
6037 aff_list::~aff_list() {
6038 if (ptr)
6039 isl_aff_list_free(ptr);
6042 __isl_give isl_aff_list *aff_list::copy() const & {
6043 return isl_aff_list_copy(ptr);
6046 __isl_keep isl_aff_list *aff_list::get() const {
6047 return ptr;
6050 __isl_give isl_aff_list *aff_list::release() {
6051 isl_aff_list *tmp = ptr;
6052 ptr = nullptr;
6053 return tmp;
6056 bool aff_list::is_null() const {
6057 return ptr == nullptr;
6060 isl::ctx aff_list::ctx() const {
6061 return isl::ctx(isl_aff_list_get_ctx(ptr));
6064 isl::aff_list aff_list::add(isl::aff el) const
6066 if (!ptr || el.is_null())
6067 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6068 auto saved_ctx = ctx();
6069 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6070 auto res = isl_aff_list_add(copy(), el.release());
6071 if (!res)
6072 exception::throw_last_error(saved_ctx);
6073 return manage(res);
6076 isl::aff aff_list::at(int index) const
6078 if (!ptr)
6079 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6080 auto saved_ctx = ctx();
6081 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6082 auto res = isl_aff_list_get_at(get(), index);
6083 if (!res)
6084 exception::throw_last_error(saved_ctx);
6085 return manage(res);
6088 isl::aff aff_list::get_at(int index) const
6090 return at(index);
6093 isl::aff_list aff_list::clear() const
6095 if (!ptr)
6096 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6097 auto saved_ctx = ctx();
6098 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6099 auto res = isl_aff_list_clear(copy());
6100 if (!res)
6101 exception::throw_last_error(saved_ctx);
6102 return manage(res);
6105 isl::aff_list aff_list::concat(isl::aff_list list2) const
6107 if (!ptr || list2.is_null())
6108 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6109 auto saved_ctx = ctx();
6110 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6111 auto res = isl_aff_list_concat(copy(), list2.release());
6112 if (!res)
6113 exception::throw_last_error(saved_ctx);
6114 return manage(res);
6117 isl::aff_list aff_list::drop(unsigned int first, unsigned int n) const
6119 if (!ptr)
6120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6121 auto saved_ctx = ctx();
6122 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6123 auto res = isl_aff_list_drop(copy(), first, n);
6124 if (!res)
6125 exception::throw_last_error(saved_ctx);
6126 return manage(res);
6129 void aff_list::foreach(const std::function<void(isl::aff)> &fn) const
6131 if (!ptr)
6132 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6133 auto saved_ctx = ctx();
6134 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6135 struct fn_data {
6136 std::function<void(isl::aff)> func;
6137 std::exception_ptr eptr;
6138 } fn_data = { fn };
6139 auto fn_lambda = [](isl_aff *arg_0, void *arg_1) -> isl_stat {
6140 auto *data = static_cast<struct fn_data *>(arg_1);
6141 ISL_CPP_TRY {
6142 (data->func)(manage(arg_0));
6143 return isl_stat_ok;
6144 } ISL_CPP_CATCH_ALL {
6145 data->eptr = std::current_exception();
6146 return isl_stat_error;
6149 auto res = isl_aff_list_foreach(get(), fn_lambda, &fn_data);
6150 if (fn_data.eptr)
6151 std::rethrow_exception(fn_data.eptr);
6152 if (res < 0)
6153 exception::throw_last_error(saved_ctx);
6154 return;
6157 void aff_list::foreach_scc(const std::function<bool(isl::aff, isl::aff)> &follows, const std::function<void(isl::aff_list)> &fn) const
6159 if (!ptr)
6160 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6161 auto saved_ctx = ctx();
6162 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6163 struct follows_data {
6164 std::function<bool(isl::aff, isl::aff)> func;
6165 std::exception_ptr eptr;
6166 } follows_data = { follows };
6167 auto follows_lambda = [](isl_aff *arg_0, isl_aff *arg_1, void *arg_2) -> isl_bool {
6168 auto *data = static_cast<struct follows_data *>(arg_2);
6169 ISL_CPP_TRY {
6170 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
6171 return ret ? isl_bool_true : isl_bool_false;
6172 } ISL_CPP_CATCH_ALL {
6173 data->eptr = std::current_exception();
6174 return isl_bool_error;
6177 struct fn_data {
6178 std::function<void(isl::aff_list)> func;
6179 std::exception_ptr eptr;
6180 } fn_data = { fn };
6181 auto fn_lambda = [](isl_aff_list *arg_0, void *arg_1) -> isl_stat {
6182 auto *data = static_cast<struct fn_data *>(arg_1);
6183 ISL_CPP_TRY {
6184 (data->func)(manage(arg_0));
6185 return isl_stat_ok;
6186 } ISL_CPP_CATCH_ALL {
6187 data->eptr = std::current_exception();
6188 return isl_stat_error;
6191 auto res = isl_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
6192 if (follows_data.eptr)
6193 std::rethrow_exception(follows_data.eptr);
6194 if (fn_data.eptr)
6195 std::rethrow_exception(fn_data.eptr);
6196 if (res < 0)
6197 exception::throw_last_error(saved_ctx);
6198 return;
6201 isl::aff_list aff_list::insert(unsigned int pos, isl::aff el) const
6203 if (!ptr || el.is_null())
6204 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6205 auto saved_ctx = ctx();
6206 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6207 auto res = isl_aff_list_insert(copy(), pos, el.release());
6208 if (!res)
6209 exception::throw_last_error(saved_ctx);
6210 return manage(res);
6213 isl::aff_list aff_list::set_at(int index, isl::aff el) const
6215 if (!ptr || el.is_null())
6216 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6217 auto saved_ctx = ctx();
6218 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6219 auto res = isl_aff_list_set_at(copy(), index, el.release());
6220 if (!res)
6221 exception::throw_last_error(saved_ctx);
6222 return manage(res);
6225 unsigned aff_list::size() const
6227 if (!ptr)
6228 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6229 auto saved_ctx = ctx();
6230 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6231 auto res = isl_aff_list_size(get());
6232 if (res < 0)
6233 exception::throw_last_error(saved_ctx);
6234 return res;
6237 inline std::ostream &operator<<(std::ostream &os, const aff_list &obj)
6239 if (!obj.get())
6240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6241 auto saved_ctx = isl_aff_list_get_ctx(obj.get());
6242 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6243 char *str = isl_aff_list_to_str(obj.get());
6244 if (!str)
6245 exception::throw_last_error(saved_ctx);
6246 os << str;
6247 free(str);
6248 return os;
6251 // implementations for isl::ast_build
6252 ast_build manage(__isl_take isl_ast_build *ptr) {
6253 if (!ptr)
6254 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6255 return ast_build(ptr);
6257 ast_build manage_copy(__isl_keep isl_ast_build *ptr) {
6258 if (!ptr)
6259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6260 auto saved_ctx = isl_ast_build_get_ctx(ptr);
6261 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6262 ptr = isl_ast_build_copy(ptr);
6263 if (!ptr)
6264 exception::throw_last_error(saved_ctx);
6265 return ast_build(ptr);
6268 ast_build::ast_build(__isl_take isl_ast_build *ptr)
6269 : ptr(ptr) {}
6271 ast_build::ast_build()
6272 : ptr(nullptr) {}
6274 ast_build::ast_build(const ast_build &obj)
6275 : ptr(nullptr)
6277 if (!obj.ptr)
6278 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6279 auto saved_ctx = isl_ast_build_get_ctx(obj.ptr);
6280 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6281 ptr = obj.copy();
6282 copy_callbacks(obj);
6283 if (!ptr)
6284 exception::throw_last_error(saved_ctx);
6287 ast_build::ast_build(isl::ctx ctx)
6289 auto saved_ctx = ctx;
6290 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6291 auto res = isl_ast_build_alloc(ctx.release());
6292 if (!res)
6293 exception::throw_last_error(saved_ctx);
6294 ptr = res;
6297 ast_build &ast_build::operator=(ast_build obj) {
6298 std::swap(this->ptr, obj.ptr);
6299 copy_callbacks(obj);
6300 return *this;
6303 ast_build::~ast_build() {
6304 if (ptr)
6305 isl_ast_build_free(ptr);
6308 __isl_give isl_ast_build *ast_build::copy() const & {
6309 return isl_ast_build_copy(ptr);
6312 __isl_keep isl_ast_build *ast_build::get() const {
6313 return ptr;
6316 __isl_give isl_ast_build *ast_build::release() {
6317 if (at_each_domain_data)
6318 exception::throw_invalid("cannot release object with persistent callbacks", __FILE__, __LINE__);
6319 isl_ast_build *tmp = ptr;
6320 ptr = nullptr;
6321 return tmp;
6324 bool ast_build::is_null() const {
6325 return ptr == nullptr;
6328 isl::ctx ast_build::ctx() const {
6329 return isl::ctx(isl_ast_build_get_ctx(ptr));
6332 ast_build &ast_build::copy_callbacks(const ast_build &obj)
6334 at_each_domain_data = obj.at_each_domain_data;
6335 return *this;
6338 isl_ast_node *ast_build::at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2)
6340 auto *data = static_cast<struct at_each_domain_data *>(arg_2);
6341 ISL_CPP_TRY {
6342 auto ret = (data->func)(manage(arg_0), manage_copy(arg_1));
6343 return ret.release();
6344 } ISL_CPP_CATCH_ALL {
6345 data->eptr = std::current_exception();
6346 return NULL;
6350 void ast_build::set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn)
6352 if (!ptr)
6353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6354 auto saved_ctx = isl_ast_build_get_ctx(ptr);
6355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6356 at_each_domain_data = std::make_shared<struct at_each_domain_data>();
6357 at_each_domain_data->func = fn;
6358 ptr = isl_ast_build_set_at_each_domain(ptr, &at_each_domain, at_each_domain_data.get());
6359 if (!ptr)
6360 exception::throw_last_error(saved_ctx);
6363 isl::ast_build ast_build::set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const
6365 auto copy = *this;
6366 copy.set_at_each_domain_data(fn);
6367 return copy;
6370 isl::ast_expr ast_build::access_from(isl::multi_pw_aff mpa) const
6372 if (!ptr || mpa.is_null())
6373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6374 auto saved_ctx = ctx();
6375 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6376 auto res = isl_ast_build_access_from_multi_pw_aff(get(), mpa.release());
6377 if (at_each_domain_data && at_each_domain_data->eptr) {
6378 std::exception_ptr eptr = at_each_domain_data->eptr;
6379 at_each_domain_data->eptr = nullptr;
6380 std::rethrow_exception(eptr);
6382 if (!res)
6383 exception::throw_last_error(saved_ctx);
6384 return manage(res);
6387 isl::ast_expr ast_build::access_from(isl::pw_multi_aff pma) const
6389 if (!ptr || pma.is_null())
6390 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6391 auto saved_ctx = ctx();
6392 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6393 auto res = isl_ast_build_access_from_pw_multi_aff(get(), pma.release());
6394 if (at_each_domain_data && at_each_domain_data->eptr) {
6395 std::exception_ptr eptr = at_each_domain_data->eptr;
6396 at_each_domain_data->eptr = nullptr;
6397 std::rethrow_exception(eptr);
6399 if (!res)
6400 exception::throw_last_error(saved_ctx);
6401 return manage(res);
6404 isl::ast_expr ast_build::call_from(isl::multi_pw_aff mpa) const
6406 if (!ptr || mpa.is_null())
6407 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6408 auto saved_ctx = ctx();
6409 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6410 auto res = isl_ast_build_call_from_multi_pw_aff(get(), mpa.release());
6411 if (at_each_domain_data && at_each_domain_data->eptr) {
6412 std::exception_ptr eptr = at_each_domain_data->eptr;
6413 at_each_domain_data->eptr = nullptr;
6414 std::rethrow_exception(eptr);
6416 if (!res)
6417 exception::throw_last_error(saved_ctx);
6418 return manage(res);
6421 isl::ast_expr ast_build::call_from(isl::pw_multi_aff pma) const
6423 if (!ptr || pma.is_null())
6424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6425 auto saved_ctx = ctx();
6426 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6427 auto res = isl_ast_build_call_from_pw_multi_aff(get(), pma.release());
6428 if (at_each_domain_data && at_each_domain_data->eptr) {
6429 std::exception_ptr eptr = at_each_domain_data->eptr;
6430 at_each_domain_data->eptr = nullptr;
6431 std::rethrow_exception(eptr);
6433 if (!res)
6434 exception::throw_last_error(saved_ctx);
6435 return manage(res);
6438 isl::ast_expr ast_build::expr_from(isl::pw_aff pa) const
6440 if (!ptr || pa.is_null())
6441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6442 auto saved_ctx = ctx();
6443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6444 auto res = isl_ast_build_expr_from_pw_aff(get(), pa.release());
6445 if (at_each_domain_data && at_each_domain_data->eptr) {
6446 std::exception_ptr eptr = at_each_domain_data->eptr;
6447 at_each_domain_data->eptr = nullptr;
6448 std::rethrow_exception(eptr);
6450 if (!res)
6451 exception::throw_last_error(saved_ctx);
6452 return manage(res);
6455 isl::ast_expr ast_build::expr_from(isl::set set) const
6457 if (!ptr || set.is_null())
6458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6459 auto saved_ctx = ctx();
6460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6461 auto res = isl_ast_build_expr_from_set(get(), set.release());
6462 if (at_each_domain_data && at_each_domain_data->eptr) {
6463 std::exception_ptr eptr = at_each_domain_data->eptr;
6464 at_each_domain_data->eptr = nullptr;
6465 std::rethrow_exception(eptr);
6467 if (!res)
6468 exception::throw_last_error(saved_ctx);
6469 return manage(res);
6472 isl::ast_build ast_build::from_context(isl::set set)
6474 if (set.is_null())
6475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6476 auto saved_ctx = set.ctx();
6477 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6478 auto res = isl_ast_build_from_context(set.release());
6479 if (!res)
6480 exception::throw_last_error(saved_ctx);
6481 return manage(res);
6484 isl::ast_node ast_build::node_from(isl::schedule schedule) const
6486 if (!ptr || schedule.is_null())
6487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6488 auto saved_ctx = ctx();
6489 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6490 auto res = isl_ast_build_node_from_schedule(get(), schedule.release());
6491 if (at_each_domain_data && at_each_domain_data->eptr) {
6492 std::exception_ptr eptr = at_each_domain_data->eptr;
6493 at_each_domain_data->eptr = nullptr;
6494 std::rethrow_exception(eptr);
6496 if (!res)
6497 exception::throw_last_error(saved_ctx);
6498 return manage(res);
6501 isl::ast_node ast_build::node_from_schedule_map(isl::union_map schedule) const
6503 if (!ptr || schedule.is_null())
6504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6505 auto saved_ctx = ctx();
6506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6507 auto res = isl_ast_build_node_from_schedule_map(get(), schedule.release());
6508 if (at_each_domain_data && at_each_domain_data->eptr) {
6509 std::exception_ptr eptr = at_each_domain_data->eptr;
6510 at_each_domain_data->eptr = nullptr;
6511 std::rethrow_exception(eptr);
6513 if (!res)
6514 exception::throw_last_error(saved_ctx);
6515 return manage(res);
6518 isl::union_map ast_build::schedule() const
6520 if (!ptr)
6521 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6522 auto saved_ctx = ctx();
6523 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6524 auto res = isl_ast_build_get_schedule(get());
6525 if (at_each_domain_data && at_each_domain_data->eptr) {
6526 std::exception_ptr eptr = at_each_domain_data->eptr;
6527 at_each_domain_data->eptr = nullptr;
6528 std::rethrow_exception(eptr);
6530 if (!res)
6531 exception::throw_last_error(saved_ctx);
6532 return manage(res);
6535 isl::union_map ast_build::get_schedule() const
6537 return schedule();
6540 // implementations for isl::ast_expr
6541 ast_expr manage(__isl_take isl_ast_expr *ptr) {
6542 if (!ptr)
6543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6544 return ast_expr(ptr);
6546 ast_expr manage_copy(__isl_keep isl_ast_expr *ptr) {
6547 if (!ptr)
6548 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6549 auto saved_ctx = isl_ast_expr_get_ctx(ptr);
6550 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6551 ptr = isl_ast_expr_copy(ptr);
6552 if (!ptr)
6553 exception::throw_last_error(saved_ctx);
6554 return ast_expr(ptr);
6557 ast_expr::ast_expr(__isl_take isl_ast_expr *ptr)
6558 : ptr(ptr) {}
6560 ast_expr::ast_expr()
6561 : ptr(nullptr) {}
6563 ast_expr::ast_expr(const ast_expr &obj)
6564 : ptr(nullptr)
6566 if (!obj.ptr)
6567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6568 auto saved_ctx = isl_ast_expr_get_ctx(obj.ptr);
6569 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6570 ptr = obj.copy();
6571 if (!ptr)
6572 exception::throw_last_error(saved_ctx);
6575 ast_expr &ast_expr::operator=(ast_expr obj) {
6576 std::swap(this->ptr, obj.ptr);
6577 return *this;
6580 ast_expr::~ast_expr() {
6581 if (ptr)
6582 isl_ast_expr_free(ptr);
6585 __isl_give isl_ast_expr *ast_expr::copy() const & {
6586 return isl_ast_expr_copy(ptr);
6589 __isl_keep isl_ast_expr *ast_expr::get() const {
6590 return ptr;
6593 __isl_give isl_ast_expr *ast_expr::release() {
6594 isl_ast_expr *tmp = ptr;
6595 ptr = nullptr;
6596 return tmp;
6599 bool ast_expr::is_null() const {
6600 return ptr == nullptr;
6603 template <typename T, typename>
6604 bool ast_expr::isa_type(T subtype) const
6606 if (is_null())
6607 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6608 return isl_ast_expr_get_type(get()) == subtype;
6610 template <class T>
6611 bool ast_expr::isa() const
6613 return isa_type<decltype(T::type)>(T::type);
6615 template <class T>
6616 T ast_expr::as() const
6618 if (!isa<T>())
6619 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6620 return T(copy());
6623 isl::ctx ast_expr::ctx() const {
6624 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6627 std::string ast_expr::to_C_str() const
6629 if (!ptr)
6630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6631 auto saved_ctx = ctx();
6632 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6633 auto res = isl_ast_expr_to_C_str(get());
6634 std::string tmp(res);
6635 free(res);
6636 return tmp;
6639 inline std::ostream &operator<<(std::ostream &os, const ast_expr &obj)
6641 if (!obj.get())
6642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6643 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6644 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6645 char *str = isl_ast_expr_to_str(obj.get());
6646 if (!str)
6647 exception::throw_last_error(saved_ctx);
6648 os << str;
6649 free(str);
6650 return os;
6653 // implementations for isl::ast_expr_id
6654 ast_expr_id::ast_expr_id(__isl_take isl_ast_expr *ptr)
6655 : ast_expr(ptr) {}
6657 ast_expr_id::ast_expr_id()
6658 : ast_expr() {}
6660 ast_expr_id::ast_expr_id(const ast_expr_id &obj)
6661 : ast_expr(obj)
6665 ast_expr_id &ast_expr_id::operator=(ast_expr_id obj) {
6666 std::swap(this->ptr, obj.ptr);
6667 return *this;
6670 isl::ctx ast_expr_id::ctx() const {
6671 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6674 isl::id ast_expr_id::id() const
6676 if (!ptr)
6677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6678 auto saved_ctx = ctx();
6679 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6680 auto res = isl_ast_expr_id_get_id(get());
6681 if (!res)
6682 exception::throw_last_error(saved_ctx);
6683 return manage(res);
6686 isl::id ast_expr_id::get_id() const
6688 return id();
6691 inline std::ostream &operator<<(std::ostream &os, const ast_expr_id &obj)
6693 if (!obj.get())
6694 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6695 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6696 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6697 char *str = isl_ast_expr_to_str(obj.get());
6698 if (!str)
6699 exception::throw_last_error(saved_ctx);
6700 os << str;
6701 free(str);
6702 return os;
6705 // implementations for isl::ast_expr_int
6706 ast_expr_int::ast_expr_int(__isl_take isl_ast_expr *ptr)
6707 : ast_expr(ptr) {}
6709 ast_expr_int::ast_expr_int()
6710 : ast_expr() {}
6712 ast_expr_int::ast_expr_int(const ast_expr_int &obj)
6713 : ast_expr(obj)
6717 ast_expr_int &ast_expr_int::operator=(ast_expr_int obj) {
6718 std::swap(this->ptr, obj.ptr);
6719 return *this;
6722 isl::ctx ast_expr_int::ctx() const {
6723 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6726 isl::val ast_expr_int::val() const
6728 if (!ptr)
6729 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6730 auto saved_ctx = ctx();
6731 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6732 auto res = isl_ast_expr_int_get_val(get());
6733 if (!res)
6734 exception::throw_last_error(saved_ctx);
6735 return manage(res);
6738 isl::val ast_expr_int::get_val() const
6740 return val();
6743 inline std::ostream &operator<<(std::ostream &os, const ast_expr_int &obj)
6745 if (!obj.get())
6746 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6747 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6748 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6749 char *str = isl_ast_expr_to_str(obj.get());
6750 if (!str)
6751 exception::throw_last_error(saved_ctx);
6752 os << str;
6753 free(str);
6754 return os;
6757 // implementations for isl::ast_expr_op
6758 ast_expr_op::ast_expr_op(__isl_take isl_ast_expr *ptr)
6759 : ast_expr(ptr) {}
6761 ast_expr_op::ast_expr_op()
6762 : ast_expr() {}
6764 ast_expr_op::ast_expr_op(const ast_expr_op &obj)
6765 : ast_expr(obj)
6769 ast_expr_op &ast_expr_op::operator=(ast_expr_op obj) {
6770 std::swap(this->ptr, obj.ptr);
6771 return *this;
6774 template <typename T, typename>
6775 bool ast_expr_op::isa_type(T subtype) const
6777 if (is_null())
6778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6779 return isl_ast_expr_op_get_type(get()) == subtype;
6781 template <class T>
6782 bool ast_expr_op::isa() const
6784 return isa_type<decltype(T::type)>(T::type);
6786 template <class T>
6787 T ast_expr_op::as() const
6789 if (!isa<T>())
6790 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6791 return T(copy());
6794 isl::ctx ast_expr_op::ctx() const {
6795 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6798 isl::ast_expr ast_expr_op::arg(int pos) const
6800 if (!ptr)
6801 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6802 auto saved_ctx = ctx();
6803 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6804 auto res = isl_ast_expr_op_get_arg(get(), pos);
6805 if (!res)
6806 exception::throw_last_error(saved_ctx);
6807 return manage(res);
6810 isl::ast_expr ast_expr_op::get_arg(int pos) const
6812 return arg(pos);
6815 unsigned ast_expr_op::n_arg() const
6817 if (!ptr)
6818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6819 auto saved_ctx = ctx();
6820 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6821 auto res = isl_ast_expr_op_get_n_arg(get());
6822 if (res < 0)
6823 exception::throw_last_error(saved_ctx);
6824 return res;
6827 unsigned ast_expr_op::get_n_arg() const
6829 return n_arg();
6832 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op &obj)
6834 if (!obj.get())
6835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6836 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6838 char *str = isl_ast_expr_to_str(obj.get());
6839 if (!str)
6840 exception::throw_last_error(saved_ctx);
6841 os << str;
6842 free(str);
6843 return os;
6846 // implementations for isl::ast_expr_op_access
6847 ast_expr_op_access::ast_expr_op_access(__isl_take isl_ast_expr *ptr)
6848 : ast_expr_op(ptr) {}
6850 ast_expr_op_access::ast_expr_op_access()
6851 : ast_expr_op() {}
6853 ast_expr_op_access::ast_expr_op_access(const ast_expr_op_access &obj)
6854 : ast_expr_op(obj)
6858 ast_expr_op_access &ast_expr_op_access::operator=(ast_expr_op_access obj) {
6859 std::swap(this->ptr, obj.ptr);
6860 return *this;
6863 isl::ctx ast_expr_op_access::ctx() const {
6864 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6867 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_access &obj)
6869 if (!obj.get())
6870 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6871 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6872 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6873 char *str = isl_ast_expr_to_str(obj.get());
6874 if (!str)
6875 exception::throw_last_error(saved_ctx);
6876 os << str;
6877 free(str);
6878 return os;
6881 // implementations for isl::ast_expr_op_add
6882 ast_expr_op_add::ast_expr_op_add(__isl_take isl_ast_expr *ptr)
6883 : ast_expr_op(ptr) {}
6885 ast_expr_op_add::ast_expr_op_add()
6886 : ast_expr_op() {}
6888 ast_expr_op_add::ast_expr_op_add(const ast_expr_op_add &obj)
6889 : ast_expr_op(obj)
6893 ast_expr_op_add &ast_expr_op_add::operator=(ast_expr_op_add obj) {
6894 std::swap(this->ptr, obj.ptr);
6895 return *this;
6898 isl::ctx ast_expr_op_add::ctx() const {
6899 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6902 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_add &obj)
6904 if (!obj.get())
6905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6906 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6907 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6908 char *str = isl_ast_expr_to_str(obj.get());
6909 if (!str)
6910 exception::throw_last_error(saved_ctx);
6911 os << str;
6912 free(str);
6913 return os;
6916 // implementations for isl::ast_expr_op_address_of
6917 ast_expr_op_address_of::ast_expr_op_address_of(__isl_take isl_ast_expr *ptr)
6918 : ast_expr_op(ptr) {}
6920 ast_expr_op_address_of::ast_expr_op_address_of()
6921 : ast_expr_op() {}
6923 ast_expr_op_address_of::ast_expr_op_address_of(const ast_expr_op_address_of &obj)
6924 : ast_expr_op(obj)
6928 ast_expr_op_address_of &ast_expr_op_address_of::operator=(ast_expr_op_address_of obj) {
6929 std::swap(this->ptr, obj.ptr);
6930 return *this;
6933 isl::ctx ast_expr_op_address_of::ctx() const {
6934 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6937 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_address_of &obj)
6939 if (!obj.get())
6940 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6941 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6942 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6943 char *str = isl_ast_expr_to_str(obj.get());
6944 if (!str)
6945 exception::throw_last_error(saved_ctx);
6946 os << str;
6947 free(str);
6948 return os;
6951 // implementations for isl::ast_expr_op_and
6952 ast_expr_op_and::ast_expr_op_and(__isl_take isl_ast_expr *ptr)
6953 : ast_expr_op(ptr) {}
6955 ast_expr_op_and::ast_expr_op_and()
6956 : ast_expr_op() {}
6958 ast_expr_op_and::ast_expr_op_and(const ast_expr_op_and &obj)
6959 : ast_expr_op(obj)
6963 ast_expr_op_and &ast_expr_op_and::operator=(ast_expr_op_and obj) {
6964 std::swap(this->ptr, obj.ptr);
6965 return *this;
6968 isl::ctx ast_expr_op_and::ctx() const {
6969 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6972 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and &obj)
6974 if (!obj.get())
6975 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6976 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6977 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6978 char *str = isl_ast_expr_to_str(obj.get());
6979 if (!str)
6980 exception::throw_last_error(saved_ctx);
6981 os << str;
6982 free(str);
6983 return os;
6986 // implementations for isl::ast_expr_op_and_then
6987 ast_expr_op_and_then::ast_expr_op_and_then(__isl_take isl_ast_expr *ptr)
6988 : ast_expr_op(ptr) {}
6990 ast_expr_op_and_then::ast_expr_op_and_then()
6991 : ast_expr_op() {}
6993 ast_expr_op_and_then::ast_expr_op_and_then(const ast_expr_op_and_then &obj)
6994 : ast_expr_op(obj)
6998 ast_expr_op_and_then &ast_expr_op_and_then::operator=(ast_expr_op_and_then obj) {
6999 std::swap(this->ptr, obj.ptr);
7000 return *this;
7003 isl::ctx ast_expr_op_and_then::ctx() const {
7004 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7007 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and_then &obj)
7009 if (!obj.get())
7010 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7011 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7012 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7013 char *str = isl_ast_expr_to_str(obj.get());
7014 if (!str)
7015 exception::throw_last_error(saved_ctx);
7016 os << str;
7017 free(str);
7018 return os;
7021 // implementations for isl::ast_expr_op_call
7022 ast_expr_op_call::ast_expr_op_call(__isl_take isl_ast_expr *ptr)
7023 : ast_expr_op(ptr) {}
7025 ast_expr_op_call::ast_expr_op_call()
7026 : ast_expr_op() {}
7028 ast_expr_op_call::ast_expr_op_call(const ast_expr_op_call &obj)
7029 : ast_expr_op(obj)
7033 ast_expr_op_call &ast_expr_op_call::operator=(ast_expr_op_call obj) {
7034 std::swap(this->ptr, obj.ptr);
7035 return *this;
7038 isl::ctx ast_expr_op_call::ctx() const {
7039 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7042 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_call &obj)
7044 if (!obj.get())
7045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7046 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7047 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7048 char *str = isl_ast_expr_to_str(obj.get());
7049 if (!str)
7050 exception::throw_last_error(saved_ctx);
7051 os << str;
7052 free(str);
7053 return os;
7056 // implementations for isl::ast_expr_op_cond
7057 ast_expr_op_cond::ast_expr_op_cond(__isl_take isl_ast_expr *ptr)
7058 : ast_expr_op(ptr) {}
7060 ast_expr_op_cond::ast_expr_op_cond()
7061 : ast_expr_op() {}
7063 ast_expr_op_cond::ast_expr_op_cond(const ast_expr_op_cond &obj)
7064 : ast_expr_op(obj)
7068 ast_expr_op_cond &ast_expr_op_cond::operator=(ast_expr_op_cond obj) {
7069 std::swap(this->ptr, obj.ptr);
7070 return *this;
7073 isl::ctx ast_expr_op_cond::ctx() const {
7074 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7077 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_cond &obj)
7079 if (!obj.get())
7080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7081 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7082 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7083 char *str = isl_ast_expr_to_str(obj.get());
7084 if (!str)
7085 exception::throw_last_error(saved_ctx);
7086 os << str;
7087 free(str);
7088 return os;
7091 // implementations for isl::ast_expr_op_div
7092 ast_expr_op_div::ast_expr_op_div(__isl_take isl_ast_expr *ptr)
7093 : ast_expr_op(ptr) {}
7095 ast_expr_op_div::ast_expr_op_div()
7096 : ast_expr_op() {}
7098 ast_expr_op_div::ast_expr_op_div(const ast_expr_op_div &obj)
7099 : ast_expr_op(obj)
7103 ast_expr_op_div &ast_expr_op_div::operator=(ast_expr_op_div obj) {
7104 std::swap(this->ptr, obj.ptr);
7105 return *this;
7108 isl::ctx ast_expr_op_div::ctx() const {
7109 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7112 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_div &obj)
7114 if (!obj.get())
7115 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7116 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7117 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7118 char *str = isl_ast_expr_to_str(obj.get());
7119 if (!str)
7120 exception::throw_last_error(saved_ctx);
7121 os << str;
7122 free(str);
7123 return os;
7126 // implementations for isl::ast_expr_op_eq
7127 ast_expr_op_eq::ast_expr_op_eq(__isl_take isl_ast_expr *ptr)
7128 : ast_expr_op(ptr) {}
7130 ast_expr_op_eq::ast_expr_op_eq()
7131 : ast_expr_op() {}
7133 ast_expr_op_eq::ast_expr_op_eq(const ast_expr_op_eq &obj)
7134 : ast_expr_op(obj)
7138 ast_expr_op_eq &ast_expr_op_eq::operator=(ast_expr_op_eq obj) {
7139 std::swap(this->ptr, obj.ptr);
7140 return *this;
7143 isl::ctx ast_expr_op_eq::ctx() const {
7144 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7147 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_eq &obj)
7149 if (!obj.get())
7150 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7151 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7152 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7153 char *str = isl_ast_expr_to_str(obj.get());
7154 if (!str)
7155 exception::throw_last_error(saved_ctx);
7156 os << str;
7157 free(str);
7158 return os;
7161 // implementations for isl::ast_expr_op_fdiv_q
7162 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr)
7163 : ast_expr_op(ptr) {}
7165 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q()
7166 : ast_expr_op() {}
7168 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj)
7169 : ast_expr_op(obj)
7173 ast_expr_op_fdiv_q &ast_expr_op_fdiv_q::operator=(ast_expr_op_fdiv_q obj) {
7174 std::swap(this->ptr, obj.ptr);
7175 return *this;
7178 isl::ctx ast_expr_op_fdiv_q::ctx() const {
7179 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7182 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_fdiv_q &obj)
7184 if (!obj.get())
7185 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7186 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7187 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7188 char *str = isl_ast_expr_to_str(obj.get());
7189 if (!str)
7190 exception::throw_last_error(saved_ctx);
7191 os << str;
7192 free(str);
7193 return os;
7196 // implementations for isl::ast_expr_op_ge
7197 ast_expr_op_ge::ast_expr_op_ge(__isl_take isl_ast_expr *ptr)
7198 : ast_expr_op(ptr) {}
7200 ast_expr_op_ge::ast_expr_op_ge()
7201 : ast_expr_op() {}
7203 ast_expr_op_ge::ast_expr_op_ge(const ast_expr_op_ge &obj)
7204 : ast_expr_op(obj)
7208 ast_expr_op_ge &ast_expr_op_ge::operator=(ast_expr_op_ge obj) {
7209 std::swap(this->ptr, obj.ptr);
7210 return *this;
7213 isl::ctx ast_expr_op_ge::ctx() const {
7214 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7217 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_ge &obj)
7219 if (!obj.get())
7220 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7221 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7222 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7223 char *str = isl_ast_expr_to_str(obj.get());
7224 if (!str)
7225 exception::throw_last_error(saved_ctx);
7226 os << str;
7227 free(str);
7228 return os;
7231 // implementations for isl::ast_expr_op_gt
7232 ast_expr_op_gt::ast_expr_op_gt(__isl_take isl_ast_expr *ptr)
7233 : ast_expr_op(ptr) {}
7235 ast_expr_op_gt::ast_expr_op_gt()
7236 : ast_expr_op() {}
7238 ast_expr_op_gt::ast_expr_op_gt(const ast_expr_op_gt &obj)
7239 : ast_expr_op(obj)
7243 ast_expr_op_gt &ast_expr_op_gt::operator=(ast_expr_op_gt obj) {
7244 std::swap(this->ptr, obj.ptr);
7245 return *this;
7248 isl::ctx ast_expr_op_gt::ctx() const {
7249 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7252 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_gt &obj)
7254 if (!obj.get())
7255 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7256 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7257 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7258 char *str = isl_ast_expr_to_str(obj.get());
7259 if (!str)
7260 exception::throw_last_error(saved_ctx);
7261 os << str;
7262 free(str);
7263 return os;
7266 // implementations for isl::ast_expr_op_le
7267 ast_expr_op_le::ast_expr_op_le(__isl_take isl_ast_expr *ptr)
7268 : ast_expr_op(ptr) {}
7270 ast_expr_op_le::ast_expr_op_le()
7271 : ast_expr_op() {}
7273 ast_expr_op_le::ast_expr_op_le(const ast_expr_op_le &obj)
7274 : ast_expr_op(obj)
7278 ast_expr_op_le &ast_expr_op_le::operator=(ast_expr_op_le obj) {
7279 std::swap(this->ptr, obj.ptr);
7280 return *this;
7283 isl::ctx ast_expr_op_le::ctx() const {
7284 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7287 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_le &obj)
7289 if (!obj.get())
7290 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7291 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7292 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7293 char *str = isl_ast_expr_to_str(obj.get());
7294 if (!str)
7295 exception::throw_last_error(saved_ctx);
7296 os << str;
7297 free(str);
7298 return os;
7301 // implementations for isl::ast_expr_op_lt
7302 ast_expr_op_lt::ast_expr_op_lt(__isl_take isl_ast_expr *ptr)
7303 : ast_expr_op(ptr) {}
7305 ast_expr_op_lt::ast_expr_op_lt()
7306 : ast_expr_op() {}
7308 ast_expr_op_lt::ast_expr_op_lt(const ast_expr_op_lt &obj)
7309 : ast_expr_op(obj)
7313 ast_expr_op_lt &ast_expr_op_lt::operator=(ast_expr_op_lt obj) {
7314 std::swap(this->ptr, obj.ptr);
7315 return *this;
7318 isl::ctx ast_expr_op_lt::ctx() const {
7319 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7322 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_lt &obj)
7324 if (!obj.get())
7325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7326 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7327 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7328 char *str = isl_ast_expr_to_str(obj.get());
7329 if (!str)
7330 exception::throw_last_error(saved_ctx);
7331 os << str;
7332 free(str);
7333 return os;
7336 // implementations for isl::ast_expr_op_max
7337 ast_expr_op_max::ast_expr_op_max(__isl_take isl_ast_expr *ptr)
7338 : ast_expr_op(ptr) {}
7340 ast_expr_op_max::ast_expr_op_max()
7341 : ast_expr_op() {}
7343 ast_expr_op_max::ast_expr_op_max(const ast_expr_op_max &obj)
7344 : ast_expr_op(obj)
7348 ast_expr_op_max &ast_expr_op_max::operator=(ast_expr_op_max obj) {
7349 std::swap(this->ptr, obj.ptr);
7350 return *this;
7353 isl::ctx ast_expr_op_max::ctx() const {
7354 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7357 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_max &obj)
7359 if (!obj.get())
7360 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7361 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7362 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7363 char *str = isl_ast_expr_to_str(obj.get());
7364 if (!str)
7365 exception::throw_last_error(saved_ctx);
7366 os << str;
7367 free(str);
7368 return os;
7371 // implementations for isl::ast_expr_op_member
7372 ast_expr_op_member::ast_expr_op_member(__isl_take isl_ast_expr *ptr)
7373 : ast_expr_op(ptr) {}
7375 ast_expr_op_member::ast_expr_op_member()
7376 : ast_expr_op() {}
7378 ast_expr_op_member::ast_expr_op_member(const ast_expr_op_member &obj)
7379 : ast_expr_op(obj)
7383 ast_expr_op_member &ast_expr_op_member::operator=(ast_expr_op_member obj) {
7384 std::swap(this->ptr, obj.ptr);
7385 return *this;
7388 isl::ctx ast_expr_op_member::ctx() const {
7389 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7392 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_member &obj)
7394 if (!obj.get())
7395 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7396 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7397 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7398 char *str = isl_ast_expr_to_str(obj.get());
7399 if (!str)
7400 exception::throw_last_error(saved_ctx);
7401 os << str;
7402 free(str);
7403 return os;
7406 // implementations for isl::ast_expr_op_min
7407 ast_expr_op_min::ast_expr_op_min(__isl_take isl_ast_expr *ptr)
7408 : ast_expr_op(ptr) {}
7410 ast_expr_op_min::ast_expr_op_min()
7411 : ast_expr_op() {}
7413 ast_expr_op_min::ast_expr_op_min(const ast_expr_op_min &obj)
7414 : ast_expr_op(obj)
7418 ast_expr_op_min &ast_expr_op_min::operator=(ast_expr_op_min obj) {
7419 std::swap(this->ptr, obj.ptr);
7420 return *this;
7423 isl::ctx ast_expr_op_min::ctx() const {
7424 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7427 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_min &obj)
7429 if (!obj.get())
7430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7431 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7432 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7433 char *str = isl_ast_expr_to_str(obj.get());
7434 if (!str)
7435 exception::throw_last_error(saved_ctx);
7436 os << str;
7437 free(str);
7438 return os;
7441 // implementations for isl::ast_expr_op_minus
7442 ast_expr_op_minus::ast_expr_op_minus(__isl_take isl_ast_expr *ptr)
7443 : ast_expr_op(ptr) {}
7445 ast_expr_op_minus::ast_expr_op_minus()
7446 : ast_expr_op() {}
7448 ast_expr_op_minus::ast_expr_op_minus(const ast_expr_op_minus &obj)
7449 : ast_expr_op(obj)
7453 ast_expr_op_minus &ast_expr_op_minus::operator=(ast_expr_op_minus obj) {
7454 std::swap(this->ptr, obj.ptr);
7455 return *this;
7458 isl::ctx ast_expr_op_minus::ctx() const {
7459 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7462 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_minus &obj)
7464 if (!obj.get())
7465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7466 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7467 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7468 char *str = isl_ast_expr_to_str(obj.get());
7469 if (!str)
7470 exception::throw_last_error(saved_ctx);
7471 os << str;
7472 free(str);
7473 return os;
7476 // implementations for isl::ast_expr_op_mul
7477 ast_expr_op_mul::ast_expr_op_mul(__isl_take isl_ast_expr *ptr)
7478 : ast_expr_op(ptr) {}
7480 ast_expr_op_mul::ast_expr_op_mul()
7481 : ast_expr_op() {}
7483 ast_expr_op_mul::ast_expr_op_mul(const ast_expr_op_mul &obj)
7484 : ast_expr_op(obj)
7488 ast_expr_op_mul &ast_expr_op_mul::operator=(ast_expr_op_mul obj) {
7489 std::swap(this->ptr, obj.ptr);
7490 return *this;
7493 isl::ctx ast_expr_op_mul::ctx() const {
7494 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7497 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_mul &obj)
7499 if (!obj.get())
7500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7501 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7503 char *str = isl_ast_expr_to_str(obj.get());
7504 if (!str)
7505 exception::throw_last_error(saved_ctx);
7506 os << str;
7507 free(str);
7508 return os;
7511 // implementations for isl::ast_expr_op_or
7512 ast_expr_op_or::ast_expr_op_or(__isl_take isl_ast_expr *ptr)
7513 : ast_expr_op(ptr) {}
7515 ast_expr_op_or::ast_expr_op_or()
7516 : ast_expr_op() {}
7518 ast_expr_op_or::ast_expr_op_or(const ast_expr_op_or &obj)
7519 : ast_expr_op(obj)
7523 ast_expr_op_or &ast_expr_op_or::operator=(ast_expr_op_or obj) {
7524 std::swap(this->ptr, obj.ptr);
7525 return *this;
7528 isl::ctx ast_expr_op_or::ctx() const {
7529 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7532 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or &obj)
7534 if (!obj.get())
7535 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7536 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7537 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7538 char *str = isl_ast_expr_to_str(obj.get());
7539 if (!str)
7540 exception::throw_last_error(saved_ctx);
7541 os << str;
7542 free(str);
7543 return os;
7546 // implementations for isl::ast_expr_op_or_else
7547 ast_expr_op_or_else::ast_expr_op_or_else(__isl_take isl_ast_expr *ptr)
7548 : ast_expr_op(ptr) {}
7550 ast_expr_op_or_else::ast_expr_op_or_else()
7551 : ast_expr_op() {}
7553 ast_expr_op_or_else::ast_expr_op_or_else(const ast_expr_op_or_else &obj)
7554 : ast_expr_op(obj)
7558 ast_expr_op_or_else &ast_expr_op_or_else::operator=(ast_expr_op_or_else obj) {
7559 std::swap(this->ptr, obj.ptr);
7560 return *this;
7563 isl::ctx ast_expr_op_or_else::ctx() const {
7564 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7567 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or_else &obj)
7569 if (!obj.get())
7570 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7571 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7572 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7573 char *str = isl_ast_expr_to_str(obj.get());
7574 if (!str)
7575 exception::throw_last_error(saved_ctx);
7576 os << str;
7577 free(str);
7578 return os;
7581 // implementations for isl::ast_expr_op_pdiv_q
7582 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr)
7583 : ast_expr_op(ptr) {}
7585 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q()
7586 : ast_expr_op() {}
7588 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj)
7589 : ast_expr_op(obj)
7593 ast_expr_op_pdiv_q &ast_expr_op_pdiv_q::operator=(ast_expr_op_pdiv_q obj) {
7594 std::swap(this->ptr, obj.ptr);
7595 return *this;
7598 isl::ctx ast_expr_op_pdiv_q::ctx() const {
7599 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7602 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_q &obj)
7604 if (!obj.get())
7605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7606 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7607 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7608 char *str = isl_ast_expr_to_str(obj.get());
7609 if (!str)
7610 exception::throw_last_error(saved_ctx);
7611 os << str;
7612 free(str);
7613 return os;
7616 // implementations for isl::ast_expr_op_pdiv_r
7617 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr)
7618 : ast_expr_op(ptr) {}
7620 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r()
7621 : ast_expr_op() {}
7623 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj)
7624 : ast_expr_op(obj)
7628 ast_expr_op_pdiv_r &ast_expr_op_pdiv_r::operator=(ast_expr_op_pdiv_r obj) {
7629 std::swap(this->ptr, obj.ptr);
7630 return *this;
7633 isl::ctx ast_expr_op_pdiv_r::ctx() const {
7634 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7637 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_r &obj)
7639 if (!obj.get())
7640 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7641 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7642 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7643 char *str = isl_ast_expr_to_str(obj.get());
7644 if (!str)
7645 exception::throw_last_error(saved_ctx);
7646 os << str;
7647 free(str);
7648 return os;
7651 // implementations for isl::ast_expr_op_select
7652 ast_expr_op_select::ast_expr_op_select(__isl_take isl_ast_expr *ptr)
7653 : ast_expr_op(ptr) {}
7655 ast_expr_op_select::ast_expr_op_select()
7656 : ast_expr_op() {}
7658 ast_expr_op_select::ast_expr_op_select(const ast_expr_op_select &obj)
7659 : ast_expr_op(obj)
7663 ast_expr_op_select &ast_expr_op_select::operator=(ast_expr_op_select obj) {
7664 std::swap(this->ptr, obj.ptr);
7665 return *this;
7668 isl::ctx ast_expr_op_select::ctx() const {
7669 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7672 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_select &obj)
7674 if (!obj.get())
7675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7676 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7677 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7678 char *str = isl_ast_expr_to_str(obj.get());
7679 if (!str)
7680 exception::throw_last_error(saved_ctx);
7681 os << str;
7682 free(str);
7683 return os;
7686 // implementations for isl::ast_expr_op_sub
7687 ast_expr_op_sub::ast_expr_op_sub(__isl_take isl_ast_expr *ptr)
7688 : ast_expr_op(ptr) {}
7690 ast_expr_op_sub::ast_expr_op_sub()
7691 : ast_expr_op() {}
7693 ast_expr_op_sub::ast_expr_op_sub(const ast_expr_op_sub &obj)
7694 : ast_expr_op(obj)
7698 ast_expr_op_sub &ast_expr_op_sub::operator=(ast_expr_op_sub obj) {
7699 std::swap(this->ptr, obj.ptr);
7700 return *this;
7703 isl::ctx ast_expr_op_sub::ctx() const {
7704 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7707 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_sub &obj)
7709 if (!obj.get())
7710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7711 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7712 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7713 char *str = isl_ast_expr_to_str(obj.get());
7714 if (!str)
7715 exception::throw_last_error(saved_ctx);
7716 os << str;
7717 free(str);
7718 return os;
7721 // implementations for isl::ast_expr_op_zdiv_r
7722 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr)
7723 : ast_expr_op(ptr) {}
7725 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r()
7726 : ast_expr_op() {}
7728 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj)
7729 : ast_expr_op(obj)
7733 ast_expr_op_zdiv_r &ast_expr_op_zdiv_r::operator=(ast_expr_op_zdiv_r obj) {
7734 std::swap(this->ptr, obj.ptr);
7735 return *this;
7738 isl::ctx ast_expr_op_zdiv_r::ctx() const {
7739 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7742 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_zdiv_r &obj)
7744 if (!obj.get())
7745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7746 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7747 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7748 char *str = isl_ast_expr_to_str(obj.get());
7749 if (!str)
7750 exception::throw_last_error(saved_ctx);
7751 os << str;
7752 free(str);
7753 return os;
7756 // implementations for isl::ast_node
7757 ast_node manage(__isl_take isl_ast_node *ptr) {
7758 if (!ptr)
7759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7760 return ast_node(ptr);
7762 ast_node manage_copy(__isl_keep isl_ast_node *ptr) {
7763 if (!ptr)
7764 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7765 auto saved_ctx = isl_ast_node_get_ctx(ptr);
7766 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7767 ptr = isl_ast_node_copy(ptr);
7768 if (!ptr)
7769 exception::throw_last_error(saved_ctx);
7770 return ast_node(ptr);
7773 ast_node::ast_node(__isl_take isl_ast_node *ptr)
7774 : ptr(ptr) {}
7776 ast_node::ast_node()
7777 : ptr(nullptr) {}
7779 ast_node::ast_node(const ast_node &obj)
7780 : ptr(nullptr)
7782 if (!obj.ptr)
7783 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7784 auto saved_ctx = isl_ast_node_get_ctx(obj.ptr);
7785 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7786 ptr = obj.copy();
7787 if (!ptr)
7788 exception::throw_last_error(saved_ctx);
7791 ast_node &ast_node::operator=(ast_node obj) {
7792 std::swap(this->ptr, obj.ptr);
7793 return *this;
7796 ast_node::~ast_node() {
7797 if (ptr)
7798 isl_ast_node_free(ptr);
7801 __isl_give isl_ast_node *ast_node::copy() const & {
7802 return isl_ast_node_copy(ptr);
7805 __isl_keep isl_ast_node *ast_node::get() const {
7806 return ptr;
7809 __isl_give isl_ast_node *ast_node::release() {
7810 isl_ast_node *tmp = ptr;
7811 ptr = nullptr;
7812 return tmp;
7815 bool ast_node::is_null() const {
7816 return ptr == nullptr;
7819 template <typename T, typename>
7820 bool ast_node::isa_type(T subtype) const
7822 if (is_null())
7823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7824 return isl_ast_node_get_type(get()) == subtype;
7826 template <class T>
7827 bool ast_node::isa() const
7829 return isa_type<decltype(T::type)>(T::type);
7831 template <class T>
7832 T ast_node::as() const
7834 if (!isa<T>())
7835 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
7836 return T(copy());
7839 isl::ctx ast_node::ctx() const {
7840 return isl::ctx(isl_ast_node_get_ctx(ptr));
7843 isl::ast_node ast_node::map_descendant_bottom_up(const std::function<isl::ast_node(isl::ast_node)> &fn) const
7845 if (!ptr)
7846 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7847 auto saved_ctx = ctx();
7848 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7849 struct fn_data {
7850 std::function<isl::ast_node(isl::ast_node)> func;
7851 std::exception_ptr eptr;
7852 } fn_data = { fn };
7853 auto fn_lambda = [](isl_ast_node *arg_0, void *arg_1) -> isl_ast_node * {
7854 auto *data = static_cast<struct fn_data *>(arg_1);
7855 ISL_CPP_TRY {
7856 auto ret = (data->func)(manage(arg_0));
7857 return ret.release();
7858 } ISL_CPP_CATCH_ALL {
7859 data->eptr = std::current_exception();
7860 return NULL;
7863 auto res = isl_ast_node_map_descendant_bottom_up(copy(), fn_lambda, &fn_data);
7864 if (fn_data.eptr)
7865 std::rethrow_exception(fn_data.eptr);
7866 if (!res)
7867 exception::throw_last_error(saved_ctx);
7868 return manage(res);
7871 std::string ast_node::to_C_str() const
7873 if (!ptr)
7874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7875 auto saved_ctx = ctx();
7876 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7877 auto res = isl_ast_node_to_C_str(get());
7878 std::string tmp(res);
7879 free(res);
7880 return tmp;
7883 isl::ast_node_list ast_node::to_list() const
7885 if (!ptr)
7886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7887 auto saved_ctx = ctx();
7888 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7889 auto res = isl_ast_node_to_list(copy());
7890 if (!res)
7891 exception::throw_last_error(saved_ctx);
7892 return manage(res);
7895 inline std::ostream &operator<<(std::ostream &os, const ast_node &obj)
7897 if (!obj.get())
7898 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7899 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7900 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7901 char *str = isl_ast_node_to_str(obj.get());
7902 if (!str)
7903 exception::throw_last_error(saved_ctx);
7904 os << str;
7905 free(str);
7906 return os;
7909 // implementations for isl::ast_node_block
7910 ast_node_block::ast_node_block(__isl_take isl_ast_node *ptr)
7911 : ast_node(ptr) {}
7913 ast_node_block::ast_node_block()
7914 : ast_node() {}
7916 ast_node_block::ast_node_block(const ast_node_block &obj)
7917 : ast_node(obj)
7921 ast_node_block::ast_node_block(isl::ast_node_list list)
7923 if (list.is_null())
7924 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7925 auto saved_ctx = list.ctx();
7926 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7927 auto res = isl_ast_node_block_from_children(list.release());
7928 if (!res)
7929 exception::throw_last_error(saved_ctx);
7930 ptr = res;
7933 ast_node_block &ast_node_block::operator=(ast_node_block obj) {
7934 std::swap(this->ptr, obj.ptr);
7935 return *this;
7938 isl::ctx ast_node_block::ctx() const {
7939 return isl::ctx(isl_ast_node_get_ctx(ptr));
7942 isl::ast_node_list ast_node_block::children() const
7944 if (!ptr)
7945 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7946 auto saved_ctx = ctx();
7947 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7948 auto res = isl_ast_node_block_get_children(get());
7949 if (!res)
7950 exception::throw_last_error(saved_ctx);
7951 return manage(res);
7954 isl::ast_node_list ast_node_block::get_children() const
7956 return children();
7959 inline std::ostream &operator<<(std::ostream &os, const ast_node_block &obj)
7961 if (!obj.get())
7962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7963 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7964 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7965 char *str = isl_ast_node_to_str(obj.get());
7966 if (!str)
7967 exception::throw_last_error(saved_ctx);
7968 os << str;
7969 free(str);
7970 return os;
7973 // implementations for isl::ast_node_for
7974 ast_node_for::ast_node_for(__isl_take isl_ast_node *ptr)
7975 : ast_node(ptr) {}
7977 ast_node_for::ast_node_for()
7978 : ast_node() {}
7980 ast_node_for::ast_node_for(const ast_node_for &obj)
7981 : ast_node(obj)
7985 ast_node_for &ast_node_for::operator=(ast_node_for obj) {
7986 std::swap(this->ptr, obj.ptr);
7987 return *this;
7990 isl::ctx ast_node_for::ctx() const {
7991 return isl::ctx(isl_ast_node_get_ctx(ptr));
7994 isl::ast_node ast_node_for::body() const
7996 if (!ptr)
7997 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7998 auto saved_ctx = ctx();
7999 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8000 auto res = isl_ast_node_for_get_body(get());
8001 if (!res)
8002 exception::throw_last_error(saved_ctx);
8003 return manage(res);
8006 isl::ast_node ast_node_for::get_body() const
8008 return body();
8011 isl::ast_expr ast_node_for::cond() const
8013 if (!ptr)
8014 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8015 auto saved_ctx = ctx();
8016 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8017 auto res = isl_ast_node_for_get_cond(get());
8018 if (!res)
8019 exception::throw_last_error(saved_ctx);
8020 return manage(res);
8023 isl::ast_expr ast_node_for::get_cond() const
8025 return cond();
8028 isl::ast_expr ast_node_for::inc() const
8030 if (!ptr)
8031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8032 auto saved_ctx = ctx();
8033 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8034 auto res = isl_ast_node_for_get_inc(get());
8035 if (!res)
8036 exception::throw_last_error(saved_ctx);
8037 return manage(res);
8040 isl::ast_expr ast_node_for::get_inc() const
8042 return inc();
8045 isl::ast_expr ast_node_for::init() const
8047 if (!ptr)
8048 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8049 auto saved_ctx = ctx();
8050 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8051 auto res = isl_ast_node_for_get_init(get());
8052 if (!res)
8053 exception::throw_last_error(saved_ctx);
8054 return manage(res);
8057 isl::ast_expr ast_node_for::get_init() const
8059 return init();
8062 bool ast_node_for::is_degenerate() const
8064 if (!ptr)
8065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8066 auto saved_ctx = ctx();
8067 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8068 auto res = isl_ast_node_for_is_degenerate(get());
8069 if (res < 0)
8070 exception::throw_last_error(saved_ctx);
8071 return res;
8074 isl::ast_expr ast_node_for::iterator() const
8076 if (!ptr)
8077 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8078 auto saved_ctx = ctx();
8079 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8080 auto res = isl_ast_node_for_get_iterator(get());
8081 if (!res)
8082 exception::throw_last_error(saved_ctx);
8083 return manage(res);
8086 isl::ast_expr ast_node_for::get_iterator() const
8088 return iterator();
8091 inline std::ostream &operator<<(std::ostream &os, const ast_node_for &obj)
8093 if (!obj.get())
8094 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8095 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8096 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8097 char *str = isl_ast_node_to_str(obj.get());
8098 if (!str)
8099 exception::throw_last_error(saved_ctx);
8100 os << str;
8101 free(str);
8102 return os;
8105 // implementations for isl::ast_node_if
8106 ast_node_if::ast_node_if(__isl_take isl_ast_node *ptr)
8107 : ast_node(ptr) {}
8109 ast_node_if::ast_node_if()
8110 : ast_node() {}
8112 ast_node_if::ast_node_if(const ast_node_if &obj)
8113 : ast_node(obj)
8117 ast_node_if &ast_node_if::operator=(ast_node_if obj) {
8118 std::swap(this->ptr, obj.ptr);
8119 return *this;
8122 isl::ctx ast_node_if::ctx() const {
8123 return isl::ctx(isl_ast_node_get_ctx(ptr));
8126 isl::ast_expr ast_node_if::cond() const
8128 if (!ptr)
8129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8130 auto saved_ctx = ctx();
8131 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8132 auto res = isl_ast_node_if_get_cond(get());
8133 if (!res)
8134 exception::throw_last_error(saved_ctx);
8135 return manage(res);
8138 isl::ast_expr ast_node_if::get_cond() const
8140 return cond();
8143 isl::ast_node ast_node_if::else_node() const
8145 if (!ptr)
8146 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8147 auto saved_ctx = ctx();
8148 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8149 auto res = isl_ast_node_if_get_else_node(get());
8150 if (!res)
8151 exception::throw_last_error(saved_ctx);
8152 return manage(res);
8155 isl::ast_node ast_node_if::get_else_node() const
8157 return else_node();
8160 bool ast_node_if::has_else_node() const
8162 if (!ptr)
8163 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8164 auto saved_ctx = ctx();
8165 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8166 auto res = isl_ast_node_if_has_else_node(get());
8167 if (res < 0)
8168 exception::throw_last_error(saved_ctx);
8169 return res;
8172 isl::ast_node ast_node_if::then_node() const
8174 if (!ptr)
8175 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8176 auto saved_ctx = ctx();
8177 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8178 auto res = isl_ast_node_if_get_then_node(get());
8179 if (!res)
8180 exception::throw_last_error(saved_ctx);
8181 return manage(res);
8184 isl::ast_node ast_node_if::get_then_node() const
8186 return then_node();
8189 inline std::ostream &operator<<(std::ostream &os, const ast_node_if &obj)
8191 if (!obj.get())
8192 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8193 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8194 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8195 char *str = isl_ast_node_to_str(obj.get());
8196 if (!str)
8197 exception::throw_last_error(saved_ctx);
8198 os << str;
8199 free(str);
8200 return os;
8203 // implementations for isl::ast_node_list
8204 ast_node_list manage(__isl_take isl_ast_node_list *ptr) {
8205 if (!ptr)
8206 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8207 return ast_node_list(ptr);
8209 ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr) {
8210 if (!ptr)
8211 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8212 auto saved_ctx = isl_ast_node_list_get_ctx(ptr);
8213 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8214 ptr = isl_ast_node_list_copy(ptr);
8215 if (!ptr)
8216 exception::throw_last_error(saved_ctx);
8217 return ast_node_list(ptr);
8220 ast_node_list::ast_node_list(__isl_take isl_ast_node_list *ptr)
8221 : ptr(ptr) {}
8223 ast_node_list::ast_node_list()
8224 : ptr(nullptr) {}
8226 ast_node_list::ast_node_list(const ast_node_list &obj)
8227 : ptr(nullptr)
8229 if (!obj.ptr)
8230 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8231 auto saved_ctx = isl_ast_node_list_get_ctx(obj.ptr);
8232 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8233 ptr = obj.copy();
8234 if (!ptr)
8235 exception::throw_last_error(saved_ctx);
8238 ast_node_list::ast_node_list(isl::ctx ctx, int n)
8240 auto saved_ctx = ctx;
8241 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8242 auto res = isl_ast_node_list_alloc(ctx.release(), n);
8243 if (!res)
8244 exception::throw_last_error(saved_ctx);
8245 ptr = res;
8248 ast_node_list::ast_node_list(isl::ast_node el)
8250 if (el.is_null())
8251 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8252 auto saved_ctx = el.ctx();
8253 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8254 auto res = isl_ast_node_list_from_ast_node(el.release());
8255 if (!res)
8256 exception::throw_last_error(saved_ctx);
8257 ptr = res;
8260 ast_node_list &ast_node_list::operator=(ast_node_list obj) {
8261 std::swap(this->ptr, obj.ptr);
8262 return *this;
8265 ast_node_list::~ast_node_list() {
8266 if (ptr)
8267 isl_ast_node_list_free(ptr);
8270 __isl_give isl_ast_node_list *ast_node_list::copy() const & {
8271 return isl_ast_node_list_copy(ptr);
8274 __isl_keep isl_ast_node_list *ast_node_list::get() const {
8275 return ptr;
8278 __isl_give isl_ast_node_list *ast_node_list::release() {
8279 isl_ast_node_list *tmp = ptr;
8280 ptr = nullptr;
8281 return tmp;
8284 bool ast_node_list::is_null() const {
8285 return ptr == nullptr;
8288 isl::ctx ast_node_list::ctx() const {
8289 return isl::ctx(isl_ast_node_list_get_ctx(ptr));
8292 isl::ast_node_list ast_node_list::add(isl::ast_node el) const
8294 if (!ptr || el.is_null())
8295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8296 auto saved_ctx = ctx();
8297 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8298 auto res = isl_ast_node_list_add(copy(), el.release());
8299 if (!res)
8300 exception::throw_last_error(saved_ctx);
8301 return manage(res);
8304 isl::ast_node ast_node_list::at(int index) const
8306 if (!ptr)
8307 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8308 auto saved_ctx = ctx();
8309 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8310 auto res = isl_ast_node_list_get_at(get(), index);
8311 if (!res)
8312 exception::throw_last_error(saved_ctx);
8313 return manage(res);
8316 isl::ast_node ast_node_list::get_at(int index) const
8318 return at(index);
8321 isl::ast_node_list ast_node_list::clear() const
8323 if (!ptr)
8324 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8325 auto saved_ctx = ctx();
8326 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8327 auto res = isl_ast_node_list_clear(copy());
8328 if (!res)
8329 exception::throw_last_error(saved_ctx);
8330 return manage(res);
8333 isl::ast_node_list ast_node_list::concat(isl::ast_node_list list2) const
8335 if (!ptr || list2.is_null())
8336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8337 auto saved_ctx = ctx();
8338 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8339 auto res = isl_ast_node_list_concat(copy(), list2.release());
8340 if (!res)
8341 exception::throw_last_error(saved_ctx);
8342 return manage(res);
8345 isl::ast_node_list ast_node_list::drop(unsigned int first, unsigned int n) const
8347 if (!ptr)
8348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8349 auto saved_ctx = ctx();
8350 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8351 auto res = isl_ast_node_list_drop(copy(), first, n);
8352 if (!res)
8353 exception::throw_last_error(saved_ctx);
8354 return manage(res);
8357 void ast_node_list::foreach(const std::function<void(isl::ast_node)> &fn) const
8359 if (!ptr)
8360 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8361 auto saved_ctx = ctx();
8362 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8363 struct fn_data {
8364 std::function<void(isl::ast_node)> func;
8365 std::exception_ptr eptr;
8366 } fn_data = { fn };
8367 auto fn_lambda = [](isl_ast_node *arg_0, void *arg_1) -> isl_stat {
8368 auto *data = static_cast<struct fn_data *>(arg_1);
8369 ISL_CPP_TRY {
8370 (data->func)(manage(arg_0));
8371 return isl_stat_ok;
8372 } ISL_CPP_CATCH_ALL {
8373 data->eptr = std::current_exception();
8374 return isl_stat_error;
8377 auto res = isl_ast_node_list_foreach(get(), fn_lambda, &fn_data);
8378 if (fn_data.eptr)
8379 std::rethrow_exception(fn_data.eptr);
8380 if (res < 0)
8381 exception::throw_last_error(saved_ctx);
8382 return;
8385 void ast_node_list::foreach_scc(const std::function<bool(isl::ast_node, isl::ast_node)> &follows, const std::function<void(isl::ast_node_list)> &fn) const
8387 if (!ptr)
8388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8389 auto saved_ctx = ctx();
8390 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8391 struct follows_data {
8392 std::function<bool(isl::ast_node, isl::ast_node)> func;
8393 std::exception_ptr eptr;
8394 } follows_data = { follows };
8395 auto follows_lambda = [](isl_ast_node *arg_0, isl_ast_node *arg_1, void *arg_2) -> isl_bool {
8396 auto *data = static_cast<struct follows_data *>(arg_2);
8397 ISL_CPP_TRY {
8398 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
8399 return ret ? isl_bool_true : isl_bool_false;
8400 } ISL_CPP_CATCH_ALL {
8401 data->eptr = std::current_exception();
8402 return isl_bool_error;
8405 struct fn_data {
8406 std::function<void(isl::ast_node_list)> func;
8407 std::exception_ptr eptr;
8408 } fn_data = { fn };
8409 auto fn_lambda = [](isl_ast_node_list *arg_0, void *arg_1) -> isl_stat {
8410 auto *data = static_cast<struct fn_data *>(arg_1);
8411 ISL_CPP_TRY {
8412 (data->func)(manage(arg_0));
8413 return isl_stat_ok;
8414 } ISL_CPP_CATCH_ALL {
8415 data->eptr = std::current_exception();
8416 return isl_stat_error;
8419 auto res = isl_ast_node_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
8420 if (follows_data.eptr)
8421 std::rethrow_exception(follows_data.eptr);
8422 if (fn_data.eptr)
8423 std::rethrow_exception(fn_data.eptr);
8424 if (res < 0)
8425 exception::throw_last_error(saved_ctx);
8426 return;
8429 isl::ast_node_list ast_node_list::insert(unsigned int pos, isl::ast_node el) const
8431 if (!ptr || el.is_null())
8432 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8433 auto saved_ctx = ctx();
8434 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8435 auto res = isl_ast_node_list_insert(copy(), pos, el.release());
8436 if (!res)
8437 exception::throw_last_error(saved_ctx);
8438 return manage(res);
8441 isl::ast_node_list ast_node_list::set_at(int index, isl::ast_node el) const
8443 if (!ptr || el.is_null())
8444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8445 auto saved_ctx = ctx();
8446 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8447 auto res = isl_ast_node_list_set_at(copy(), index, el.release());
8448 if (!res)
8449 exception::throw_last_error(saved_ctx);
8450 return manage(res);
8453 unsigned ast_node_list::size() const
8455 if (!ptr)
8456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8457 auto saved_ctx = ctx();
8458 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8459 auto res = isl_ast_node_list_size(get());
8460 if (res < 0)
8461 exception::throw_last_error(saved_ctx);
8462 return res;
8465 inline std::ostream &operator<<(std::ostream &os, const ast_node_list &obj)
8467 if (!obj.get())
8468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8469 auto saved_ctx = isl_ast_node_list_get_ctx(obj.get());
8470 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8471 char *str = isl_ast_node_list_to_str(obj.get());
8472 if (!str)
8473 exception::throw_last_error(saved_ctx);
8474 os << str;
8475 free(str);
8476 return os;
8479 // implementations for isl::ast_node_mark
8480 ast_node_mark::ast_node_mark(__isl_take isl_ast_node *ptr)
8481 : ast_node(ptr) {}
8483 ast_node_mark::ast_node_mark()
8484 : ast_node() {}
8486 ast_node_mark::ast_node_mark(const ast_node_mark &obj)
8487 : ast_node(obj)
8491 ast_node_mark &ast_node_mark::operator=(ast_node_mark obj) {
8492 std::swap(this->ptr, obj.ptr);
8493 return *this;
8496 isl::ctx ast_node_mark::ctx() const {
8497 return isl::ctx(isl_ast_node_get_ctx(ptr));
8500 isl::id ast_node_mark::id() const
8502 if (!ptr)
8503 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8504 auto saved_ctx = ctx();
8505 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8506 auto res = isl_ast_node_mark_get_id(get());
8507 if (!res)
8508 exception::throw_last_error(saved_ctx);
8509 return manage(res);
8512 isl::id ast_node_mark::get_id() const
8514 return id();
8517 isl::ast_node ast_node_mark::node() const
8519 if (!ptr)
8520 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8521 auto saved_ctx = ctx();
8522 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8523 auto res = isl_ast_node_mark_get_node(get());
8524 if (!res)
8525 exception::throw_last_error(saved_ctx);
8526 return manage(res);
8529 isl::ast_node ast_node_mark::get_node() const
8531 return node();
8534 inline std::ostream &operator<<(std::ostream &os, const ast_node_mark &obj)
8536 if (!obj.get())
8537 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8538 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8539 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8540 char *str = isl_ast_node_to_str(obj.get());
8541 if (!str)
8542 exception::throw_last_error(saved_ctx);
8543 os << str;
8544 free(str);
8545 return os;
8548 // implementations for isl::ast_node_user
8549 ast_node_user::ast_node_user(__isl_take isl_ast_node *ptr)
8550 : ast_node(ptr) {}
8552 ast_node_user::ast_node_user()
8553 : ast_node() {}
8555 ast_node_user::ast_node_user(const ast_node_user &obj)
8556 : ast_node(obj)
8560 ast_node_user::ast_node_user(isl::ast_expr expr)
8562 if (expr.is_null())
8563 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8564 auto saved_ctx = expr.ctx();
8565 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8566 auto res = isl_ast_node_user_from_expr(expr.release());
8567 if (!res)
8568 exception::throw_last_error(saved_ctx);
8569 ptr = res;
8572 ast_node_user &ast_node_user::operator=(ast_node_user obj) {
8573 std::swap(this->ptr, obj.ptr);
8574 return *this;
8577 isl::ctx ast_node_user::ctx() const {
8578 return isl::ctx(isl_ast_node_get_ctx(ptr));
8581 isl::ast_expr ast_node_user::expr() const
8583 if (!ptr)
8584 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8585 auto saved_ctx = ctx();
8586 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8587 auto res = isl_ast_node_user_get_expr(get());
8588 if (!res)
8589 exception::throw_last_error(saved_ctx);
8590 return manage(res);
8593 isl::ast_expr ast_node_user::get_expr() const
8595 return expr();
8598 inline std::ostream &operator<<(std::ostream &os, const ast_node_user &obj)
8600 if (!obj.get())
8601 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8602 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8603 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8604 char *str = isl_ast_node_to_str(obj.get());
8605 if (!str)
8606 exception::throw_last_error(saved_ctx);
8607 os << str;
8608 free(str);
8609 return os;
8612 // implementations for isl::basic_map
8613 basic_map manage(__isl_take isl_basic_map *ptr) {
8614 if (!ptr)
8615 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8616 return basic_map(ptr);
8618 basic_map manage_copy(__isl_keep isl_basic_map *ptr) {
8619 if (!ptr)
8620 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8621 auto saved_ctx = isl_basic_map_get_ctx(ptr);
8622 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8623 ptr = isl_basic_map_copy(ptr);
8624 if (!ptr)
8625 exception::throw_last_error(saved_ctx);
8626 return basic_map(ptr);
8629 basic_map::basic_map(__isl_take isl_basic_map *ptr)
8630 : ptr(ptr) {}
8632 basic_map::basic_map()
8633 : ptr(nullptr) {}
8635 basic_map::basic_map(const basic_map &obj)
8636 : ptr(nullptr)
8638 if (!obj.ptr)
8639 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8640 auto saved_ctx = isl_basic_map_get_ctx(obj.ptr);
8641 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8642 ptr = obj.copy();
8643 if (!ptr)
8644 exception::throw_last_error(saved_ctx);
8647 basic_map::basic_map(isl::ctx ctx, const std::string &str)
8649 auto saved_ctx = ctx;
8650 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8651 auto res = isl_basic_map_read_from_str(ctx.release(), str.c_str());
8652 if (!res)
8653 exception::throw_last_error(saved_ctx);
8654 ptr = res;
8657 basic_map &basic_map::operator=(basic_map obj) {
8658 std::swap(this->ptr, obj.ptr);
8659 return *this;
8662 basic_map::~basic_map() {
8663 if (ptr)
8664 isl_basic_map_free(ptr);
8667 __isl_give isl_basic_map *basic_map::copy() const & {
8668 return isl_basic_map_copy(ptr);
8671 __isl_keep isl_basic_map *basic_map::get() const {
8672 return ptr;
8675 __isl_give isl_basic_map *basic_map::release() {
8676 isl_basic_map *tmp = ptr;
8677 ptr = nullptr;
8678 return tmp;
8681 bool basic_map::is_null() const {
8682 return ptr == nullptr;
8685 isl::ctx basic_map::ctx() const {
8686 return isl::ctx(isl_basic_map_get_ctx(ptr));
8689 isl::basic_map basic_map::affine_hull() const
8691 if (!ptr)
8692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8693 auto saved_ctx = ctx();
8694 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8695 auto res = isl_basic_map_affine_hull(copy());
8696 if (!res)
8697 exception::throw_last_error(saved_ctx);
8698 return manage(res);
8701 isl::basic_map basic_map::apply_domain(isl::basic_map bmap2) const
8703 if (!ptr || bmap2.is_null())
8704 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8705 auto saved_ctx = ctx();
8706 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8707 auto res = isl_basic_map_apply_domain(copy(), bmap2.release());
8708 if (!res)
8709 exception::throw_last_error(saved_ctx);
8710 return manage(res);
8713 isl::map basic_map::apply_domain(const isl::map &map2) const
8715 if (!ptr)
8716 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8717 return isl::map(*this).apply_domain(map2);
8720 isl::union_map basic_map::apply_domain(const isl::union_map &umap2) const
8722 if (!ptr)
8723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8724 return isl::map(*this).apply_domain(umap2);
8727 isl::basic_map basic_map::apply_range(isl::basic_map bmap2) const
8729 if (!ptr || bmap2.is_null())
8730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8731 auto saved_ctx = ctx();
8732 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8733 auto res = isl_basic_map_apply_range(copy(), bmap2.release());
8734 if (!res)
8735 exception::throw_last_error(saved_ctx);
8736 return manage(res);
8739 isl::map basic_map::apply_range(const isl::map &map2) const
8741 if (!ptr)
8742 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8743 return isl::map(*this).apply_range(map2);
8746 isl::union_map basic_map::apply_range(const isl::union_map &umap2) const
8748 if (!ptr)
8749 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8750 return isl::map(*this).apply_range(umap2);
8753 isl::map basic_map::as_map() const
8755 if (!ptr)
8756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8757 return isl::map(*this).as_map();
8760 isl::multi_union_pw_aff basic_map::as_multi_union_pw_aff() const
8762 if (!ptr)
8763 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8764 return isl::map(*this).as_multi_union_pw_aff();
8767 isl::pw_multi_aff basic_map::as_pw_multi_aff() const
8769 if (!ptr)
8770 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8771 return isl::map(*this).as_pw_multi_aff();
8774 isl::union_pw_multi_aff basic_map::as_union_pw_multi_aff() const
8776 if (!ptr)
8777 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8778 return isl::map(*this).as_union_pw_multi_aff();
8781 isl::set basic_map::bind_domain(const isl::multi_id &tuple) const
8783 if (!ptr)
8784 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8785 return isl::map(*this).bind_domain(tuple);
8788 isl::set basic_map::bind_range(const isl::multi_id &tuple) const
8790 if (!ptr)
8791 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8792 return isl::map(*this).bind_range(tuple);
8795 isl::map basic_map::coalesce() const
8797 if (!ptr)
8798 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8799 return isl::map(*this).coalesce();
8802 isl::map basic_map::complement() const
8804 if (!ptr)
8805 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8806 return isl::map(*this).complement();
8809 isl::union_map basic_map::compute_divs() const
8811 if (!ptr)
8812 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8813 return isl::map(*this).compute_divs();
8816 isl::map basic_map::curry() const
8818 if (!ptr)
8819 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8820 return isl::map(*this).curry();
8823 isl::basic_set basic_map::deltas() const
8825 if (!ptr)
8826 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8827 auto saved_ctx = ctx();
8828 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8829 auto res = isl_basic_map_deltas(copy());
8830 if (!res)
8831 exception::throw_last_error(saved_ctx);
8832 return manage(res);
8835 isl::basic_map basic_map::detect_equalities() const
8837 if (!ptr)
8838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8839 auto saved_ctx = ctx();
8840 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8841 auto res = isl_basic_map_detect_equalities(copy());
8842 if (!res)
8843 exception::throw_last_error(saved_ctx);
8844 return manage(res);
8847 isl::set basic_map::domain() const
8849 if (!ptr)
8850 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8851 return isl::map(*this).domain();
8854 isl::map basic_map::domain_factor_domain() const
8856 if (!ptr)
8857 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8858 return isl::map(*this).domain_factor_domain();
8861 isl::map basic_map::domain_factor_range() const
8863 if (!ptr)
8864 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8865 return isl::map(*this).domain_factor_range();
8868 isl::union_map basic_map::domain_map() const
8870 if (!ptr)
8871 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8872 return isl::map(*this).domain_map();
8875 isl::union_pw_multi_aff basic_map::domain_map_union_pw_multi_aff() const
8877 if (!ptr)
8878 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8879 return isl::map(*this).domain_map_union_pw_multi_aff();
8882 isl::map basic_map::domain_product(const isl::map &map2) const
8884 if (!ptr)
8885 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8886 return isl::map(*this).domain_product(map2);
8889 isl::union_map basic_map::domain_product(const isl::union_map &umap2) const
8891 if (!ptr)
8892 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8893 return isl::map(*this).domain_product(umap2);
8896 isl::map basic_map::domain_reverse() const
8898 if (!ptr)
8899 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8900 return isl::map(*this).domain_reverse();
8903 unsigned basic_map::domain_tuple_dim() const
8905 if (!ptr)
8906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8907 return isl::map(*this).domain_tuple_dim();
8910 isl::id basic_map::domain_tuple_id() const
8912 if (!ptr)
8913 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8914 return isl::map(*this).domain_tuple_id();
8917 isl::map basic_map::drop_unused_params() const
8919 if (!ptr)
8920 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8921 return isl::map(*this).drop_unused_params();
8924 isl::map basic_map::eq_at(const isl::multi_pw_aff &mpa) const
8926 if (!ptr)
8927 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8928 return isl::map(*this).eq_at(mpa);
8931 isl::union_map basic_map::eq_at(const isl::multi_union_pw_aff &mupa) const
8933 if (!ptr)
8934 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8935 return isl::map(*this).eq_at(mupa);
8938 bool basic_map::every_map(const std::function<bool(isl::map)> &test) const
8940 if (!ptr)
8941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8942 return isl::map(*this).every_map(test);
8945 isl::map basic_map::extract_map(const isl::space &space) const
8947 if (!ptr)
8948 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8949 return isl::map(*this).extract_map(space);
8952 isl::map basic_map::factor_domain() const
8954 if (!ptr)
8955 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8956 return isl::map(*this).factor_domain();
8959 isl::map basic_map::factor_range() const
8961 if (!ptr)
8962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8963 return isl::map(*this).factor_range();
8966 isl::map basic_map::fixed_power(const isl::val &exp) const
8968 if (!ptr)
8969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8970 return isl::map(*this).fixed_power(exp);
8973 isl::map basic_map::fixed_power(long exp) const
8975 if (!ptr)
8976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8977 return this->fixed_power(isl::val(ctx(), exp));
8980 isl::basic_map basic_map::flatten() const
8982 if (!ptr)
8983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8984 auto saved_ctx = ctx();
8985 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8986 auto res = isl_basic_map_flatten(copy());
8987 if (!res)
8988 exception::throw_last_error(saved_ctx);
8989 return manage(res);
8992 isl::basic_map basic_map::flatten_domain() const
8994 if (!ptr)
8995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8996 auto saved_ctx = ctx();
8997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8998 auto res = isl_basic_map_flatten_domain(copy());
8999 if (!res)
9000 exception::throw_last_error(saved_ctx);
9001 return manage(res);
9004 isl::basic_map basic_map::flatten_range() const
9006 if (!ptr)
9007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9008 auto saved_ctx = ctx();
9009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9010 auto res = isl_basic_map_flatten_range(copy());
9011 if (!res)
9012 exception::throw_last_error(saved_ctx);
9013 return manage(res);
9016 void basic_map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
9018 if (!ptr)
9019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9020 return isl::map(*this).foreach_basic_map(fn);
9023 void basic_map::foreach_map(const std::function<void(isl::map)> &fn) const
9025 if (!ptr)
9026 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9027 return isl::map(*this).foreach_map(fn);
9030 isl::basic_map basic_map::gist(isl::basic_map context) const
9032 if (!ptr || context.is_null())
9033 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9034 auto saved_ctx = ctx();
9035 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9036 auto res = isl_basic_map_gist(copy(), context.release());
9037 if (!res)
9038 exception::throw_last_error(saved_ctx);
9039 return manage(res);
9042 isl::map basic_map::gist(const isl::map &context) const
9044 if (!ptr)
9045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9046 return isl::map(*this).gist(context);
9049 isl::union_map basic_map::gist(const isl::union_map &context) const
9051 if (!ptr)
9052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9053 return isl::map(*this).gist(context);
9056 isl::map basic_map::gist_domain(const isl::set &context) const
9058 if (!ptr)
9059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9060 return isl::map(*this).gist_domain(context);
9063 isl::union_map basic_map::gist_domain(const isl::union_set &uset) const
9065 if (!ptr)
9066 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9067 return isl::map(*this).gist_domain(uset);
9070 isl::map basic_map::gist_params(const isl::set &context) const
9072 if (!ptr)
9073 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9074 return isl::map(*this).gist_params(context);
9077 isl::union_map basic_map::gist_range(const isl::union_set &uset) const
9079 if (!ptr)
9080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9081 return isl::map(*this).gist_range(uset);
9084 bool basic_map::has_domain_tuple_id() const
9086 if (!ptr)
9087 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9088 return isl::map(*this).has_domain_tuple_id();
9091 bool basic_map::has_range_tuple_id() const
9093 if (!ptr)
9094 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9095 return isl::map(*this).has_range_tuple_id();
9098 isl::basic_map basic_map::intersect(isl::basic_map bmap2) const
9100 if (!ptr || bmap2.is_null())
9101 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9102 auto saved_ctx = ctx();
9103 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9104 auto res = isl_basic_map_intersect(copy(), bmap2.release());
9105 if (!res)
9106 exception::throw_last_error(saved_ctx);
9107 return manage(res);
9110 isl::map basic_map::intersect(const isl::map &map2) const
9112 if (!ptr)
9113 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9114 return isl::map(*this).intersect(map2);
9117 isl::union_map basic_map::intersect(const isl::union_map &umap2) const
9119 if (!ptr)
9120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9121 return isl::map(*this).intersect(umap2);
9124 isl::basic_map basic_map::intersect_domain(isl::basic_set bset) const
9126 if (!ptr || bset.is_null())
9127 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9128 auto saved_ctx = ctx();
9129 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9130 auto res = isl_basic_map_intersect_domain(copy(), bset.release());
9131 if (!res)
9132 exception::throw_last_error(saved_ctx);
9133 return manage(res);
9136 isl::map basic_map::intersect_domain(const isl::set &set) const
9138 if (!ptr)
9139 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9140 return isl::map(*this).intersect_domain(set);
9143 isl::union_map basic_map::intersect_domain(const isl::space &space) const
9145 if (!ptr)
9146 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9147 return isl::map(*this).intersect_domain(space);
9150 isl::union_map basic_map::intersect_domain(const isl::union_set &uset) const
9152 if (!ptr)
9153 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9154 return isl::map(*this).intersect_domain(uset);
9157 isl::basic_map basic_map::intersect_domain(const isl::point &bset) const
9159 if (!ptr)
9160 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9161 return this->intersect_domain(isl::basic_set(bset));
9164 isl::map basic_map::intersect_domain_factor_domain(const isl::map &factor) const
9166 if (!ptr)
9167 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9168 return isl::map(*this).intersect_domain_factor_domain(factor);
9171 isl::union_map basic_map::intersect_domain_factor_domain(const isl::union_map &factor) const
9173 if (!ptr)
9174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9175 return isl::map(*this).intersect_domain_factor_domain(factor);
9178 isl::map basic_map::intersect_domain_factor_range(const isl::map &factor) const
9180 if (!ptr)
9181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9182 return isl::map(*this).intersect_domain_factor_range(factor);
9185 isl::union_map basic_map::intersect_domain_factor_range(const isl::union_map &factor) const
9187 if (!ptr)
9188 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9189 return isl::map(*this).intersect_domain_factor_range(factor);
9192 isl::map basic_map::intersect_domain_wrapped_domain(const isl::set &domain) const
9194 if (!ptr)
9195 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9196 return isl::map(*this).intersect_domain_wrapped_domain(domain);
9199 isl::union_map basic_map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
9201 if (!ptr)
9202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9203 return isl::map(*this).intersect_domain_wrapped_domain(domain);
9206 isl::basic_map basic_map::intersect_params(isl::basic_set bset) const
9208 if (!ptr || bset.is_null())
9209 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9210 auto saved_ctx = ctx();
9211 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9212 auto res = isl_basic_map_intersect_params(copy(), bset.release());
9213 if (!res)
9214 exception::throw_last_error(saved_ctx);
9215 return manage(res);
9218 isl::map basic_map::intersect_params(const isl::set &params) const
9220 if (!ptr)
9221 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9222 return isl::map(*this).intersect_params(params);
9225 isl::basic_map basic_map::intersect_params(const isl::point &bset) const
9227 if (!ptr)
9228 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9229 return this->intersect_params(isl::basic_set(bset));
9232 isl::basic_map basic_map::intersect_range(isl::basic_set bset) const
9234 if (!ptr || bset.is_null())
9235 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9236 auto saved_ctx = ctx();
9237 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9238 auto res = isl_basic_map_intersect_range(copy(), bset.release());
9239 if (!res)
9240 exception::throw_last_error(saved_ctx);
9241 return manage(res);
9244 isl::map basic_map::intersect_range(const isl::set &set) const
9246 if (!ptr)
9247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9248 return isl::map(*this).intersect_range(set);
9251 isl::union_map basic_map::intersect_range(const isl::space &space) const
9253 if (!ptr)
9254 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9255 return isl::map(*this).intersect_range(space);
9258 isl::union_map basic_map::intersect_range(const isl::union_set &uset) const
9260 if (!ptr)
9261 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9262 return isl::map(*this).intersect_range(uset);
9265 isl::basic_map basic_map::intersect_range(const isl::point &bset) const
9267 if (!ptr)
9268 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9269 return this->intersect_range(isl::basic_set(bset));
9272 isl::map basic_map::intersect_range_factor_domain(const isl::map &factor) const
9274 if (!ptr)
9275 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9276 return isl::map(*this).intersect_range_factor_domain(factor);
9279 isl::union_map basic_map::intersect_range_factor_domain(const isl::union_map &factor) const
9281 if (!ptr)
9282 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9283 return isl::map(*this).intersect_range_factor_domain(factor);
9286 isl::map basic_map::intersect_range_factor_range(const isl::map &factor) const
9288 if (!ptr)
9289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9290 return isl::map(*this).intersect_range_factor_range(factor);
9293 isl::union_map basic_map::intersect_range_factor_range(const isl::union_map &factor) const
9295 if (!ptr)
9296 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9297 return isl::map(*this).intersect_range_factor_range(factor);
9300 isl::map basic_map::intersect_range_wrapped_domain(const isl::set &domain) const
9302 if (!ptr)
9303 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9304 return isl::map(*this).intersect_range_wrapped_domain(domain);
9307 isl::union_map basic_map::intersect_range_wrapped_domain(const isl::union_set &domain) const
9309 if (!ptr)
9310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9311 return isl::map(*this).intersect_range_wrapped_domain(domain);
9314 bool basic_map::is_bijective() const
9316 if (!ptr)
9317 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9318 return isl::map(*this).is_bijective();
9321 bool basic_map::is_disjoint(const isl::map &map2) const
9323 if (!ptr)
9324 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9325 return isl::map(*this).is_disjoint(map2);
9328 bool basic_map::is_disjoint(const isl::union_map &umap2) const
9330 if (!ptr)
9331 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9332 return isl::map(*this).is_disjoint(umap2);
9335 bool basic_map::is_empty() const
9337 if (!ptr)
9338 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9339 auto saved_ctx = ctx();
9340 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9341 auto res = isl_basic_map_is_empty(get());
9342 if (res < 0)
9343 exception::throw_last_error(saved_ctx);
9344 return res;
9347 bool basic_map::is_equal(const isl::basic_map &bmap2) const
9349 if (!ptr || bmap2.is_null())
9350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9351 auto saved_ctx = ctx();
9352 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9353 auto res = isl_basic_map_is_equal(get(), bmap2.get());
9354 if (res < 0)
9355 exception::throw_last_error(saved_ctx);
9356 return res;
9359 bool basic_map::is_equal(const isl::map &map2) const
9361 if (!ptr)
9362 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9363 return isl::map(*this).is_equal(map2);
9366 bool basic_map::is_equal(const isl::union_map &umap2) const
9368 if (!ptr)
9369 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9370 return isl::map(*this).is_equal(umap2);
9373 bool basic_map::is_injective() const
9375 if (!ptr)
9376 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9377 return isl::map(*this).is_injective();
9380 bool basic_map::is_single_valued() const
9382 if (!ptr)
9383 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9384 return isl::map(*this).is_single_valued();
9387 bool basic_map::is_strict_subset(const isl::map &map2) const
9389 if (!ptr)
9390 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9391 return isl::map(*this).is_strict_subset(map2);
9394 bool basic_map::is_strict_subset(const isl::union_map &umap2) const
9396 if (!ptr)
9397 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9398 return isl::map(*this).is_strict_subset(umap2);
9401 bool basic_map::is_subset(const isl::basic_map &bmap2) const
9403 if (!ptr || bmap2.is_null())
9404 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9405 auto saved_ctx = ctx();
9406 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9407 auto res = isl_basic_map_is_subset(get(), bmap2.get());
9408 if (res < 0)
9409 exception::throw_last_error(saved_ctx);
9410 return res;
9413 bool basic_map::is_subset(const isl::map &map2) const
9415 if (!ptr)
9416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9417 return isl::map(*this).is_subset(map2);
9420 bool basic_map::is_subset(const isl::union_map &umap2) const
9422 if (!ptr)
9423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9424 return isl::map(*this).is_subset(umap2);
9427 bool basic_map::isa_map() const
9429 if (!ptr)
9430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9431 return isl::map(*this).isa_map();
9434 isl::map basic_map::lex_ge_at(const isl::multi_pw_aff &mpa) const
9436 if (!ptr)
9437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9438 return isl::map(*this).lex_ge_at(mpa);
9441 isl::map basic_map::lex_gt_at(const isl::multi_pw_aff &mpa) const
9443 if (!ptr)
9444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9445 return isl::map(*this).lex_gt_at(mpa);
9448 isl::map basic_map::lex_le_at(const isl::multi_pw_aff &mpa) const
9450 if (!ptr)
9451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9452 return isl::map(*this).lex_le_at(mpa);
9455 isl::map basic_map::lex_lt_at(const isl::multi_pw_aff &mpa) const
9457 if (!ptr)
9458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9459 return isl::map(*this).lex_lt_at(mpa);
9462 isl::map basic_map::lexmax() const
9464 if (!ptr)
9465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9466 auto saved_ctx = ctx();
9467 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9468 auto res = isl_basic_map_lexmax(copy());
9469 if (!res)
9470 exception::throw_last_error(saved_ctx);
9471 return manage(res);
9474 isl::pw_multi_aff basic_map::lexmax_pw_multi_aff() const
9476 if (!ptr)
9477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9478 return isl::map(*this).lexmax_pw_multi_aff();
9481 isl::map basic_map::lexmin() const
9483 if (!ptr)
9484 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9485 auto saved_ctx = ctx();
9486 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9487 auto res = isl_basic_map_lexmin(copy());
9488 if (!res)
9489 exception::throw_last_error(saved_ctx);
9490 return manage(res);
9493 isl::pw_multi_aff basic_map::lexmin_pw_multi_aff() const
9495 if (!ptr)
9496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9497 return isl::map(*this).lexmin_pw_multi_aff();
9500 isl::map basic_map::lower_bound(const isl::multi_pw_aff &lower) const
9502 if (!ptr)
9503 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9504 return isl::map(*this).lower_bound(lower);
9507 isl::map_list basic_map::map_list() const
9509 if (!ptr)
9510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9511 return isl::map(*this).map_list();
9514 isl::multi_pw_aff basic_map::max_multi_pw_aff() const
9516 if (!ptr)
9517 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9518 return isl::map(*this).max_multi_pw_aff();
9521 isl::multi_pw_aff basic_map::min_multi_pw_aff() const
9523 if (!ptr)
9524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9525 return isl::map(*this).min_multi_pw_aff();
9528 unsigned basic_map::n_basic_map() const
9530 if (!ptr)
9531 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9532 return isl::map(*this).n_basic_map();
9535 isl::set basic_map::params() const
9537 if (!ptr)
9538 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9539 return isl::map(*this).params();
9542 isl::basic_map basic_map::polyhedral_hull() const
9544 if (!ptr)
9545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9546 return isl::map(*this).polyhedral_hull();
9549 isl::map basic_map::preimage_domain(const isl::multi_aff &ma) const
9551 if (!ptr)
9552 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9553 return isl::map(*this).preimage_domain(ma);
9556 isl::map basic_map::preimage_domain(const isl::multi_pw_aff &mpa) const
9558 if (!ptr)
9559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9560 return isl::map(*this).preimage_domain(mpa);
9563 isl::map basic_map::preimage_domain(const isl::pw_multi_aff &pma) const
9565 if (!ptr)
9566 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9567 return isl::map(*this).preimage_domain(pma);
9570 isl::union_map basic_map::preimage_domain(const isl::union_pw_multi_aff &upma) const
9572 if (!ptr)
9573 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9574 return isl::map(*this).preimage_domain(upma);
9577 isl::map basic_map::preimage_range(const isl::multi_aff &ma) const
9579 if (!ptr)
9580 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9581 return isl::map(*this).preimage_range(ma);
9584 isl::map basic_map::preimage_range(const isl::pw_multi_aff &pma) const
9586 if (!ptr)
9587 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9588 return isl::map(*this).preimage_range(pma);
9591 isl::union_map basic_map::preimage_range(const isl::union_pw_multi_aff &upma) const
9593 if (!ptr)
9594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9595 return isl::map(*this).preimage_range(upma);
9598 isl::map basic_map::product(const isl::map &map2) const
9600 if (!ptr)
9601 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9602 return isl::map(*this).product(map2);
9605 isl::union_map basic_map::product(const isl::union_map &umap2) const
9607 if (!ptr)
9608 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9609 return isl::map(*this).product(umap2);
9612 isl::map basic_map::project_out_all_params() const
9614 if (!ptr)
9615 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9616 return isl::map(*this).project_out_all_params();
9619 isl::map basic_map::project_out_param(const isl::id &id) const
9621 if (!ptr)
9622 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9623 return isl::map(*this).project_out_param(id);
9626 isl::map basic_map::project_out_param(const std::string &id) const
9628 if (!ptr)
9629 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9630 return this->project_out_param(isl::id(ctx(), id));
9633 isl::map basic_map::project_out_param(const isl::id_list &list) const
9635 if (!ptr)
9636 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9637 return isl::map(*this).project_out_param(list);
9640 isl::set basic_map::range() const
9642 if (!ptr)
9643 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9644 return isl::map(*this).range();
9647 isl::map basic_map::range_factor_domain() const
9649 if (!ptr)
9650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9651 return isl::map(*this).range_factor_domain();
9654 isl::map basic_map::range_factor_range() const
9656 if (!ptr)
9657 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9658 return isl::map(*this).range_factor_range();
9661 isl::fixed_box basic_map::range_lattice_tile() const
9663 if (!ptr)
9664 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9665 return isl::map(*this).range_lattice_tile();
9668 isl::union_map basic_map::range_map() const
9670 if (!ptr)
9671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9672 return isl::map(*this).range_map();
9675 isl::map basic_map::range_product(const isl::map &map2) const
9677 if (!ptr)
9678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9679 return isl::map(*this).range_product(map2);
9682 isl::union_map basic_map::range_product(const isl::union_map &umap2) const
9684 if (!ptr)
9685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9686 return isl::map(*this).range_product(umap2);
9689 isl::map basic_map::range_reverse() const
9691 if (!ptr)
9692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9693 return isl::map(*this).range_reverse();
9696 isl::fixed_box basic_map::range_simple_fixed_box_hull() const
9698 if (!ptr)
9699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9700 return isl::map(*this).range_simple_fixed_box_hull();
9703 unsigned basic_map::range_tuple_dim() const
9705 if (!ptr)
9706 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9707 return isl::map(*this).range_tuple_dim();
9710 isl::id basic_map::range_tuple_id() const
9712 if (!ptr)
9713 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9714 return isl::map(*this).range_tuple_id();
9717 isl::basic_map basic_map::reverse() const
9719 if (!ptr)
9720 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9721 auto saved_ctx = ctx();
9722 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9723 auto res = isl_basic_map_reverse(copy());
9724 if (!res)
9725 exception::throw_last_error(saved_ctx);
9726 return manage(res);
9729 isl::basic_map basic_map::sample() const
9731 if (!ptr)
9732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9733 auto saved_ctx = ctx();
9734 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9735 auto res = isl_basic_map_sample(copy());
9736 if (!res)
9737 exception::throw_last_error(saved_ctx);
9738 return manage(res);
9741 isl::map basic_map::set_domain_tuple(const isl::id &id) const
9743 if (!ptr)
9744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9745 return isl::map(*this).set_domain_tuple(id);
9748 isl::map basic_map::set_domain_tuple(const std::string &id) const
9750 if (!ptr)
9751 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9752 return this->set_domain_tuple(isl::id(ctx(), id));
9755 isl::map basic_map::set_range_tuple(const isl::id &id) const
9757 if (!ptr)
9758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9759 return isl::map(*this).set_range_tuple(id);
9762 isl::map basic_map::set_range_tuple(const std::string &id) const
9764 if (!ptr)
9765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9766 return this->set_range_tuple(isl::id(ctx(), id));
9769 isl::space basic_map::space() const
9771 if (!ptr)
9772 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9773 return isl::map(*this).space();
9776 isl::map basic_map::subtract(const isl::map &map2) const
9778 if (!ptr)
9779 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9780 return isl::map(*this).subtract(map2);
9783 isl::union_map basic_map::subtract(const isl::union_map &umap2) const
9785 if (!ptr)
9786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9787 return isl::map(*this).subtract(umap2);
9790 isl::union_map basic_map::subtract_domain(const isl::union_set &dom) const
9792 if (!ptr)
9793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9794 return isl::map(*this).subtract_domain(dom);
9797 isl::union_map basic_map::subtract_range(const isl::union_set &dom) const
9799 if (!ptr)
9800 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9801 return isl::map(*this).subtract_range(dom);
9804 isl::map_list basic_map::to_list() const
9806 if (!ptr)
9807 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9808 return isl::map(*this).to_list();
9811 isl::union_map basic_map::to_union_map() const
9813 if (!ptr)
9814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9815 return isl::map(*this).to_union_map();
9818 isl::map basic_map::uncurry() const
9820 if (!ptr)
9821 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9822 return isl::map(*this).uncurry();
9825 isl::map basic_map::unite(isl::basic_map bmap2) const
9827 if (!ptr || bmap2.is_null())
9828 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9829 auto saved_ctx = ctx();
9830 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9831 auto res = isl_basic_map_union(copy(), bmap2.release());
9832 if (!res)
9833 exception::throw_last_error(saved_ctx);
9834 return manage(res);
9837 isl::map basic_map::unite(const isl::map &map2) const
9839 if (!ptr)
9840 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9841 return isl::map(*this).unite(map2);
9844 isl::union_map basic_map::unite(const isl::union_map &umap2) const
9846 if (!ptr)
9847 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9848 return isl::map(*this).unite(umap2);
9851 isl::basic_map basic_map::unshifted_simple_hull() const
9853 if (!ptr)
9854 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9855 return isl::map(*this).unshifted_simple_hull();
9858 isl::map basic_map::upper_bound(const isl::multi_pw_aff &upper) const
9860 if (!ptr)
9861 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9862 return isl::map(*this).upper_bound(upper);
9865 isl::set basic_map::wrap() const
9867 if (!ptr)
9868 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9869 return isl::map(*this).wrap();
9872 isl::map basic_map::zip() const
9874 if (!ptr)
9875 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9876 return isl::map(*this).zip();
9879 inline std::ostream &operator<<(std::ostream &os, const basic_map &obj)
9881 if (!obj.get())
9882 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9883 auto saved_ctx = isl_basic_map_get_ctx(obj.get());
9884 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9885 char *str = isl_basic_map_to_str(obj.get());
9886 if (!str)
9887 exception::throw_last_error(saved_ctx);
9888 os << str;
9889 free(str);
9890 return os;
9893 // implementations for isl::basic_set
9894 basic_set manage(__isl_take isl_basic_set *ptr) {
9895 if (!ptr)
9896 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9897 return basic_set(ptr);
9899 basic_set manage_copy(__isl_keep isl_basic_set *ptr) {
9900 if (!ptr)
9901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9902 auto saved_ctx = isl_basic_set_get_ctx(ptr);
9903 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9904 ptr = isl_basic_set_copy(ptr);
9905 if (!ptr)
9906 exception::throw_last_error(saved_ctx);
9907 return basic_set(ptr);
9910 basic_set::basic_set(__isl_take isl_basic_set *ptr)
9911 : ptr(ptr) {}
9913 basic_set::basic_set()
9914 : ptr(nullptr) {}
9916 basic_set::basic_set(const basic_set &obj)
9917 : ptr(nullptr)
9919 if (!obj.ptr)
9920 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9921 auto saved_ctx = isl_basic_set_get_ctx(obj.ptr);
9922 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9923 ptr = obj.copy();
9924 if (!ptr)
9925 exception::throw_last_error(saved_ctx);
9928 basic_set::basic_set(isl::point pnt)
9930 if (pnt.is_null())
9931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9932 auto saved_ctx = pnt.ctx();
9933 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9934 auto res = isl_basic_set_from_point(pnt.release());
9935 if (!res)
9936 exception::throw_last_error(saved_ctx);
9937 ptr = res;
9940 basic_set::basic_set(isl::ctx ctx, const std::string &str)
9942 auto saved_ctx = ctx;
9943 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9944 auto res = isl_basic_set_read_from_str(ctx.release(), str.c_str());
9945 if (!res)
9946 exception::throw_last_error(saved_ctx);
9947 ptr = res;
9950 basic_set &basic_set::operator=(basic_set obj) {
9951 std::swap(this->ptr, obj.ptr);
9952 return *this;
9955 basic_set::~basic_set() {
9956 if (ptr)
9957 isl_basic_set_free(ptr);
9960 __isl_give isl_basic_set *basic_set::copy() const & {
9961 return isl_basic_set_copy(ptr);
9964 __isl_keep isl_basic_set *basic_set::get() const {
9965 return ptr;
9968 __isl_give isl_basic_set *basic_set::release() {
9969 isl_basic_set *tmp = ptr;
9970 ptr = nullptr;
9971 return tmp;
9974 bool basic_set::is_null() const {
9975 return ptr == nullptr;
9978 isl::ctx basic_set::ctx() const {
9979 return isl::ctx(isl_basic_set_get_ctx(ptr));
9982 isl::basic_set basic_set::affine_hull() const
9984 if (!ptr)
9985 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9986 auto saved_ctx = ctx();
9987 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9988 auto res = isl_basic_set_affine_hull(copy());
9989 if (!res)
9990 exception::throw_last_error(saved_ctx);
9991 return manage(res);
9994 isl::basic_set basic_set::apply(isl::basic_map bmap) const
9996 if (!ptr || bmap.is_null())
9997 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9998 auto saved_ctx = ctx();
9999 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10000 auto res = isl_basic_set_apply(copy(), bmap.release());
10001 if (!res)
10002 exception::throw_last_error(saved_ctx);
10003 return manage(res);
10006 isl::set basic_set::apply(const isl::map &map) const
10008 if (!ptr)
10009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10010 return isl::set(*this).apply(map);
10013 isl::union_set basic_set::apply(const isl::union_map &umap) const
10015 if (!ptr)
10016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10017 return isl::set(*this).apply(umap);
10020 isl::pw_multi_aff basic_set::as_pw_multi_aff() const
10022 if (!ptr)
10023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10024 return isl::set(*this).as_pw_multi_aff();
10027 isl::set basic_set::as_set() const
10029 if (!ptr)
10030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10031 return isl::set(*this).as_set();
10034 isl::set basic_set::bind(const isl::multi_id &tuple) const
10036 if (!ptr)
10037 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10038 return isl::set(*this).bind(tuple);
10041 isl::set basic_set::coalesce() const
10043 if (!ptr)
10044 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10045 return isl::set(*this).coalesce();
10048 isl::set basic_set::complement() const
10050 if (!ptr)
10051 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10052 return isl::set(*this).complement();
10055 isl::union_set basic_set::compute_divs() const
10057 if (!ptr)
10058 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10059 return isl::set(*this).compute_divs();
10062 isl::basic_set basic_set::detect_equalities() const
10064 if (!ptr)
10065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10066 auto saved_ctx = ctx();
10067 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10068 auto res = isl_basic_set_detect_equalities(copy());
10069 if (!res)
10070 exception::throw_last_error(saved_ctx);
10071 return manage(res);
10074 isl::val basic_set::dim_max_val(int pos) const
10076 if (!ptr)
10077 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10078 auto saved_ctx = ctx();
10079 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10080 auto res = isl_basic_set_dim_max_val(copy(), pos);
10081 if (!res)
10082 exception::throw_last_error(saved_ctx);
10083 return manage(res);
10086 isl::val basic_set::dim_min_val(int pos) const
10088 if (!ptr)
10089 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10090 return isl::set(*this).dim_min_val(pos);
10093 isl::set basic_set::drop_unused_params() const
10095 if (!ptr)
10096 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10097 return isl::set(*this).drop_unused_params();
10100 bool basic_set::every_set(const std::function<bool(isl::set)> &test) const
10102 if (!ptr)
10103 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10104 return isl::set(*this).every_set(test);
10107 isl::set basic_set::extract_set(const isl::space &space) const
10109 if (!ptr)
10110 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10111 return isl::set(*this).extract_set(space);
10114 isl::basic_set basic_set::flatten() const
10116 if (!ptr)
10117 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10118 auto saved_ctx = ctx();
10119 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10120 auto res = isl_basic_set_flatten(copy());
10121 if (!res)
10122 exception::throw_last_error(saved_ctx);
10123 return manage(res);
10126 void basic_set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
10128 if (!ptr)
10129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10130 return isl::set(*this).foreach_basic_set(fn);
10133 void basic_set::foreach_point(const std::function<void(isl::point)> &fn) const
10135 if (!ptr)
10136 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10137 return isl::set(*this).foreach_point(fn);
10140 void basic_set::foreach_set(const std::function<void(isl::set)> &fn) const
10142 if (!ptr)
10143 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10144 return isl::set(*this).foreach_set(fn);
10147 isl::basic_set basic_set::gist(isl::basic_set context) const
10149 if (!ptr || context.is_null())
10150 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10151 auto saved_ctx = ctx();
10152 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10153 auto res = isl_basic_set_gist(copy(), context.release());
10154 if (!res)
10155 exception::throw_last_error(saved_ctx);
10156 return manage(res);
10159 isl::set basic_set::gist(const isl::set &context) const
10161 if (!ptr)
10162 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10163 return isl::set(*this).gist(context);
10166 isl::union_set basic_set::gist(const isl::union_set &context) const
10168 if (!ptr)
10169 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10170 return isl::set(*this).gist(context);
10173 isl::basic_set basic_set::gist(const isl::point &context) const
10175 if (!ptr)
10176 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10177 return this->gist(isl::basic_set(context));
10180 isl::set basic_set::gist_params(const isl::set &context) const
10182 if (!ptr)
10183 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10184 return isl::set(*this).gist_params(context);
10187 isl::map basic_set::identity() const
10189 if (!ptr)
10190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10191 return isl::set(*this).identity();
10194 isl::pw_aff basic_set::indicator_function() const
10196 if (!ptr)
10197 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10198 return isl::set(*this).indicator_function();
10201 isl::map basic_set::insert_domain(const isl::space &domain) const
10203 if (!ptr)
10204 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10205 return isl::set(*this).insert_domain(domain);
10208 isl::basic_set basic_set::intersect(isl::basic_set bset2) const
10210 if (!ptr || bset2.is_null())
10211 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10212 auto saved_ctx = ctx();
10213 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10214 auto res = isl_basic_set_intersect(copy(), bset2.release());
10215 if (!res)
10216 exception::throw_last_error(saved_ctx);
10217 return manage(res);
10220 isl::set basic_set::intersect(const isl::set &set2) const
10222 if (!ptr)
10223 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10224 return isl::set(*this).intersect(set2);
10227 isl::union_set basic_set::intersect(const isl::union_set &uset2) const
10229 if (!ptr)
10230 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10231 return isl::set(*this).intersect(uset2);
10234 isl::basic_set basic_set::intersect(const isl::point &bset2) const
10236 if (!ptr)
10237 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10238 return this->intersect(isl::basic_set(bset2));
10241 isl::basic_set basic_set::intersect_params(isl::basic_set bset2) const
10243 if (!ptr || bset2.is_null())
10244 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10245 auto saved_ctx = ctx();
10246 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10247 auto res = isl_basic_set_intersect_params(copy(), bset2.release());
10248 if (!res)
10249 exception::throw_last_error(saved_ctx);
10250 return manage(res);
10253 isl::set basic_set::intersect_params(const isl::set &params) const
10255 if (!ptr)
10256 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10257 return isl::set(*this).intersect_params(params);
10260 isl::basic_set basic_set::intersect_params(const isl::point &bset2) const
10262 if (!ptr)
10263 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10264 return this->intersect_params(isl::basic_set(bset2));
10267 bool basic_set::involves_locals() const
10269 if (!ptr)
10270 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10271 return isl::set(*this).involves_locals();
10274 bool basic_set::is_disjoint(const isl::set &set2) const
10276 if (!ptr)
10277 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10278 return isl::set(*this).is_disjoint(set2);
10281 bool basic_set::is_disjoint(const isl::union_set &uset2) const
10283 if (!ptr)
10284 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10285 return isl::set(*this).is_disjoint(uset2);
10288 bool basic_set::is_empty() const
10290 if (!ptr)
10291 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10292 auto saved_ctx = ctx();
10293 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10294 auto res = isl_basic_set_is_empty(get());
10295 if (res < 0)
10296 exception::throw_last_error(saved_ctx);
10297 return res;
10300 bool basic_set::is_equal(const isl::basic_set &bset2) const
10302 if (!ptr || bset2.is_null())
10303 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10304 auto saved_ctx = ctx();
10305 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10306 auto res = isl_basic_set_is_equal(get(), bset2.get());
10307 if (res < 0)
10308 exception::throw_last_error(saved_ctx);
10309 return res;
10312 bool basic_set::is_equal(const isl::set &set2) const
10314 if (!ptr)
10315 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10316 return isl::set(*this).is_equal(set2);
10319 bool basic_set::is_equal(const isl::union_set &uset2) const
10321 if (!ptr)
10322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10323 return isl::set(*this).is_equal(uset2);
10326 bool basic_set::is_equal(const isl::point &bset2) const
10328 if (!ptr)
10329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10330 return this->is_equal(isl::basic_set(bset2));
10333 bool basic_set::is_singleton() const
10335 if (!ptr)
10336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10337 return isl::set(*this).is_singleton();
10340 bool basic_set::is_strict_subset(const isl::set &set2) const
10342 if (!ptr)
10343 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10344 return isl::set(*this).is_strict_subset(set2);
10347 bool basic_set::is_strict_subset(const isl::union_set &uset2) const
10349 if (!ptr)
10350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10351 return isl::set(*this).is_strict_subset(uset2);
10354 bool basic_set::is_subset(const isl::basic_set &bset2) const
10356 if (!ptr || bset2.is_null())
10357 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10358 auto saved_ctx = ctx();
10359 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10360 auto res = isl_basic_set_is_subset(get(), bset2.get());
10361 if (res < 0)
10362 exception::throw_last_error(saved_ctx);
10363 return res;
10366 bool basic_set::is_subset(const isl::set &set2) const
10368 if (!ptr)
10369 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10370 return isl::set(*this).is_subset(set2);
10373 bool basic_set::is_subset(const isl::union_set &uset2) const
10375 if (!ptr)
10376 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10377 return isl::set(*this).is_subset(uset2);
10380 bool basic_set::is_subset(const isl::point &bset2) const
10382 if (!ptr)
10383 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10384 return this->is_subset(isl::basic_set(bset2));
10387 bool basic_set::is_wrapping() const
10389 if (!ptr)
10390 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10391 auto saved_ctx = ctx();
10392 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10393 auto res = isl_basic_set_is_wrapping(get());
10394 if (res < 0)
10395 exception::throw_last_error(saved_ctx);
10396 return res;
10399 bool basic_set::isa_set() const
10401 if (!ptr)
10402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10403 return isl::set(*this).isa_set();
10406 isl::fixed_box basic_set::lattice_tile() const
10408 if (!ptr)
10409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10410 return isl::set(*this).lattice_tile();
10413 isl::set basic_set::lexmax() const
10415 if (!ptr)
10416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10417 auto saved_ctx = ctx();
10418 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10419 auto res = isl_basic_set_lexmax(copy());
10420 if (!res)
10421 exception::throw_last_error(saved_ctx);
10422 return manage(res);
10425 isl::pw_multi_aff basic_set::lexmax_pw_multi_aff() const
10427 if (!ptr)
10428 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10429 return isl::set(*this).lexmax_pw_multi_aff();
10432 isl::set basic_set::lexmin() const
10434 if (!ptr)
10435 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10436 auto saved_ctx = ctx();
10437 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10438 auto res = isl_basic_set_lexmin(copy());
10439 if (!res)
10440 exception::throw_last_error(saved_ctx);
10441 return manage(res);
10444 isl::pw_multi_aff basic_set::lexmin_pw_multi_aff() const
10446 if (!ptr)
10447 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10448 return isl::set(*this).lexmin_pw_multi_aff();
10451 isl::set basic_set::lower_bound(const isl::multi_pw_aff &lower) const
10453 if (!ptr)
10454 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10455 return isl::set(*this).lower_bound(lower);
10458 isl::set basic_set::lower_bound(const isl::multi_val &lower) const
10460 if (!ptr)
10461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10462 return isl::set(*this).lower_bound(lower);
10465 isl::multi_pw_aff basic_set::max_multi_pw_aff() const
10467 if (!ptr)
10468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10469 return isl::set(*this).max_multi_pw_aff();
10472 isl::val basic_set::max_val(const isl::aff &obj) const
10474 if (!ptr)
10475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10476 return isl::set(*this).max_val(obj);
10479 isl::multi_pw_aff basic_set::min_multi_pw_aff() const
10481 if (!ptr)
10482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10483 return isl::set(*this).min_multi_pw_aff();
10486 isl::val basic_set::min_val(const isl::aff &obj) const
10488 if (!ptr)
10489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10490 return isl::set(*this).min_val(obj);
10493 unsigned basic_set::n_basic_set() const
10495 if (!ptr)
10496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10497 return isl::set(*this).n_basic_set();
10500 isl::pw_aff basic_set::param_pw_aff_on_domain(const isl::id &id) const
10502 if (!ptr)
10503 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10504 return isl::set(*this).param_pw_aff_on_domain(id);
10507 isl::pw_aff basic_set::param_pw_aff_on_domain(const std::string &id) const
10509 if (!ptr)
10510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10511 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
10514 isl::basic_set basic_set::params() const
10516 if (!ptr)
10517 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10518 auto saved_ctx = ctx();
10519 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10520 auto res = isl_basic_set_params(copy());
10521 if (!res)
10522 exception::throw_last_error(saved_ctx);
10523 return manage(res);
10526 isl::multi_val basic_set::plain_multi_val_if_fixed() const
10528 if (!ptr)
10529 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10530 return isl::set(*this).plain_multi_val_if_fixed();
10533 isl::basic_set basic_set::polyhedral_hull() const
10535 if (!ptr)
10536 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10537 return isl::set(*this).polyhedral_hull();
10540 isl::set basic_set::preimage(const isl::multi_aff &ma) const
10542 if (!ptr)
10543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10544 return isl::set(*this).preimage(ma);
10547 isl::set basic_set::preimage(const isl::multi_pw_aff &mpa) const
10549 if (!ptr)
10550 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10551 return isl::set(*this).preimage(mpa);
10554 isl::set basic_set::preimage(const isl::pw_multi_aff &pma) const
10556 if (!ptr)
10557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10558 return isl::set(*this).preimage(pma);
10561 isl::union_set basic_set::preimage(const isl::union_pw_multi_aff &upma) const
10563 if (!ptr)
10564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10565 return isl::set(*this).preimage(upma);
10568 isl::set basic_set::product(const isl::set &set2) const
10570 if (!ptr)
10571 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10572 return isl::set(*this).product(set2);
10575 isl::set basic_set::project_out_all_params() const
10577 if (!ptr)
10578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10579 return isl::set(*this).project_out_all_params();
10582 isl::set basic_set::project_out_param(const isl::id &id) const
10584 if (!ptr)
10585 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10586 return isl::set(*this).project_out_param(id);
10589 isl::set basic_set::project_out_param(const std::string &id) const
10591 if (!ptr)
10592 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10593 return this->project_out_param(isl::id(ctx(), id));
10596 isl::set basic_set::project_out_param(const isl::id_list &list) const
10598 if (!ptr)
10599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10600 return isl::set(*this).project_out_param(list);
10603 isl::pw_aff basic_set::pw_aff_on_domain(const isl::val &v) const
10605 if (!ptr)
10606 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10607 return isl::set(*this).pw_aff_on_domain(v);
10610 isl::pw_aff basic_set::pw_aff_on_domain(long v) const
10612 if (!ptr)
10613 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10614 return this->pw_aff_on_domain(isl::val(ctx(), v));
10617 isl::pw_multi_aff basic_set::pw_multi_aff_on_domain(const isl::multi_val &mv) const
10619 if (!ptr)
10620 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10621 return isl::set(*this).pw_multi_aff_on_domain(mv);
10624 isl::basic_set basic_set::sample() const
10626 if (!ptr)
10627 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10628 auto saved_ctx = ctx();
10629 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10630 auto res = isl_basic_set_sample(copy());
10631 if (!res)
10632 exception::throw_last_error(saved_ctx);
10633 return manage(res);
10636 isl::point basic_set::sample_point() const
10638 if (!ptr)
10639 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10640 auto saved_ctx = ctx();
10641 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10642 auto res = isl_basic_set_sample_point(copy());
10643 if (!res)
10644 exception::throw_last_error(saved_ctx);
10645 return manage(res);
10648 isl::set_list basic_set::set_list() const
10650 if (!ptr)
10651 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10652 return isl::set(*this).set_list();
10655 isl::fixed_box basic_set::simple_fixed_box_hull() const
10657 if (!ptr)
10658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10659 return isl::set(*this).simple_fixed_box_hull();
10662 isl::space basic_set::space() const
10664 if (!ptr)
10665 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10666 return isl::set(*this).space();
10669 isl::val basic_set::stride(int pos) const
10671 if (!ptr)
10672 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10673 return isl::set(*this).stride(pos);
10676 isl::set basic_set::subtract(const isl::set &set2) const
10678 if (!ptr)
10679 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10680 return isl::set(*this).subtract(set2);
10683 isl::union_set basic_set::subtract(const isl::union_set &uset2) const
10685 if (!ptr)
10686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10687 return isl::set(*this).subtract(uset2);
10690 isl::set_list basic_set::to_list() const
10692 if (!ptr)
10693 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10694 return isl::set(*this).to_list();
10697 isl::set basic_set::to_set() const
10699 if (!ptr)
10700 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10701 auto saved_ctx = ctx();
10702 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10703 auto res = isl_basic_set_to_set(copy());
10704 if (!res)
10705 exception::throw_last_error(saved_ctx);
10706 return manage(res);
10709 isl::union_set basic_set::to_union_set() const
10711 if (!ptr)
10712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10713 return isl::set(*this).to_union_set();
10716 isl::map basic_set::translation() const
10718 if (!ptr)
10719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10720 return isl::set(*this).translation();
10723 unsigned basic_set::tuple_dim() const
10725 if (!ptr)
10726 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10727 return isl::set(*this).tuple_dim();
10730 isl::set basic_set::unbind_params(const isl::multi_id &tuple) const
10732 if (!ptr)
10733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10734 return isl::set(*this).unbind_params(tuple);
10737 isl::map basic_set::unbind_params_insert_domain(const isl::multi_id &domain) const
10739 if (!ptr)
10740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10741 return isl::set(*this).unbind_params_insert_domain(domain);
10744 isl::set basic_set::unite(isl::basic_set bset2) const
10746 if (!ptr || bset2.is_null())
10747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10748 auto saved_ctx = ctx();
10749 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10750 auto res = isl_basic_set_union(copy(), bset2.release());
10751 if (!res)
10752 exception::throw_last_error(saved_ctx);
10753 return manage(res);
10756 isl::set basic_set::unite(const isl::set &set2) const
10758 if (!ptr)
10759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10760 return isl::set(*this).unite(set2);
10763 isl::union_set basic_set::unite(const isl::union_set &uset2) const
10765 if (!ptr)
10766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10767 return isl::set(*this).unite(uset2);
10770 isl::set basic_set::unite(const isl::point &bset2) const
10772 if (!ptr)
10773 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10774 return this->unite(isl::basic_set(bset2));
10777 isl::basic_set basic_set::unshifted_simple_hull() const
10779 if (!ptr)
10780 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10781 return isl::set(*this).unshifted_simple_hull();
10784 isl::map basic_set::unwrap() const
10786 if (!ptr)
10787 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10788 return isl::set(*this).unwrap();
10791 isl::set basic_set::upper_bound(const isl::multi_pw_aff &upper) const
10793 if (!ptr)
10794 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10795 return isl::set(*this).upper_bound(upper);
10798 isl::set basic_set::upper_bound(const isl::multi_val &upper) const
10800 if (!ptr)
10801 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10802 return isl::set(*this).upper_bound(upper);
10805 isl::set basic_set::wrapped_reverse() const
10807 if (!ptr)
10808 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10809 return isl::set(*this).wrapped_reverse();
10812 inline std::ostream &operator<<(std::ostream &os, const basic_set &obj)
10814 if (!obj.get())
10815 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10816 auto saved_ctx = isl_basic_set_get_ctx(obj.get());
10817 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10818 char *str = isl_basic_set_to_str(obj.get());
10819 if (!str)
10820 exception::throw_last_error(saved_ctx);
10821 os << str;
10822 free(str);
10823 return os;
10826 // implementations for isl::fixed_box
10827 fixed_box manage(__isl_take isl_fixed_box *ptr) {
10828 if (!ptr)
10829 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10830 return fixed_box(ptr);
10832 fixed_box manage_copy(__isl_keep isl_fixed_box *ptr) {
10833 if (!ptr)
10834 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10835 auto saved_ctx = isl_fixed_box_get_ctx(ptr);
10836 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10837 ptr = isl_fixed_box_copy(ptr);
10838 if (!ptr)
10839 exception::throw_last_error(saved_ctx);
10840 return fixed_box(ptr);
10843 fixed_box::fixed_box(__isl_take isl_fixed_box *ptr)
10844 : ptr(ptr) {}
10846 fixed_box::fixed_box()
10847 : ptr(nullptr) {}
10849 fixed_box::fixed_box(const fixed_box &obj)
10850 : ptr(nullptr)
10852 if (!obj.ptr)
10853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10854 auto saved_ctx = isl_fixed_box_get_ctx(obj.ptr);
10855 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10856 ptr = obj.copy();
10857 if (!ptr)
10858 exception::throw_last_error(saved_ctx);
10861 fixed_box::fixed_box(isl::ctx ctx, const std::string &str)
10863 auto saved_ctx = ctx;
10864 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10865 auto res = isl_fixed_box_read_from_str(ctx.release(), str.c_str());
10866 if (!res)
10867 exception::throw_last_error(saved_ctx);
10868 ptr = res;
10871 fixed_box &fixed_box::operator=(fixed_box obj) {
10872 std::swap(this->ptr, obj.ptr);
10873 return *this;
10876 fixed_box::~fixed_box() {
10877 if (ptr)
10878 isl_fixed_box_free(ptr);
10881 __isl_give isl_fixed_box *fixed_box::copy() const & {
10882 return isl_fixed_box_copy(ptr);
10885 __isl_keep isl_fixed_box *fixed_box::get() const {
10886 return ptr;
10889 __isl_give isl_fixed_box *fixed_box::release() {
10890 isl_fixed_box *tmp = ptr;
10891 ptr = nullptr;
10892 return tmp;
10895 bool fixed_box::is_null() const {
10896 return ptr == nullptr;
10899 isl::ctx fixed_box::ctx() const {
10900 return isl::ctx(isl_fixed_box_get_ctx(ptr));
10903 bool fixed_box::is_valid() const
10905 if (!ptr)
10906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10907 auto saved_ctx = ctx();
10908 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10909 auto res = isl_fixed_box_is_valid(get());
10910 if (res < 0)
10911 exception::throw_last_error(saved_ctx);
10912 return res;
10915 isl::multi_aff fixed_box::offset() const
10917 if (!ptr)
10918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10919 auto saved_ctx = ctx();
10920 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10921 auto res = isl_fixed_box_get_offset(get());
10922 if (!res)
10923 exception::throw_last_error(saved_ctx);
10924 return manage(res);
10927 isl::multi_aff fixed_box::get_offset() const
10929 return offset();
10932 isl::multi_val fixed_box::size() const
10934 if (!ptr)
10935 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10936 auto saved_ctx = ctx();
10937 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10938 auto res = isl_fixed_box_get_size(get());
10939 if (!res)
10940 exception::throw_last_error(saved_ctx);
10941 return manage(res);
10944 isl::multi_val fixed_box::get_size() const
10946 return size();
10949 isl::space fixed_box::space() const
10951 if (!ptr)
10952 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10953 auto saved_ctx = ctx();
10954 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10955 auto res = isl_fixed_box_get_space(get());
10956 if (!res)
10957 exception::throw_last_error(saved_ctx);
10958 return manage(res);
10961 isl::space fixed_box::get_space() const
10963 return space();
10966 inline std::ostream &operator<<(std::ostream &os, const fixed_box &obj)
10968 if (!obj.get())
10969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10970 auto saved_ctx = isl_fixed_box_get_ctx(obj.get());
10971 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10972 char *str = isl_fixed_box_to_str(obj.get());
10973 if (!str)
10974 exception::throw_last_error(saved_ctx);
10975 os << str;
10976 free(str);
10977 return os;
10980 // implementations for isl::id
10981 id manage(__isl_take isl_id *ptr) {
10982 if (!ptr)
10983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10984 return id(ptr);
10986 id manage_copy(__isl_keep isl_id *ptr) {
10987 if (!ptr)
10988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10989 auto saved_ctx = isl_id_get_ctx(ptr);
10990 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10991 ptr = isl_id_copy(ptr);
10992 if (!ptr)
10993 exception::throw_last_error(saved_ctx);
10994 return id(ptr);
10997 id::id(__isl_take isl_id *ptr)
10998 : ptr(ptr) {}
11000 id::id()
11001 : ptr(nullptr) {}
11003 id::id(const id &obj)
11004 : ptr(nullptr)
11006 if (!obj.ptr)
11007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11008 auto saved_ctx = isl_id_get_ctx(obj.ptr);
11009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11010 ptr = obj.copy();
11011 if (!ptr)
11012 exception::throw_last_error(saved_ctx);
11015 id::id(isl::ctx ctx, const std::string &str)
11017 auto saved_ctx = ctx;
11018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11019 auto res = isl_id_read_from_str(ctx.release(), str.c_str());
11020 if (!res)
11021 exception::throw_last_error(saved_ctx);
11022 ptr = res;
11025 id &id::operator=(id obj) {
11026 std::swap(this->ptr, obj.ptr);
11027 return *this;
11030 id::~id() {
11031 if (ptr)
11032 isl_id_free(ptr);
11035 __isl_give isl_id *id::copy() const & {
11036 return isl_id_copy(ptr);
11039 __isl_keep isl_id *id::get() const {
11040 return ptr;
11043 __isl_give isl_id *id::release() {
11044 isl_id *tmp = ptr;
11045 ptr = nullptr;
11046 return tmp;
11049 bool id::is_null() const {
11050 return ptr == nullptr;
11053 isl::ctx id::ctx() const {
11054 return isl::ctx(isl_id_get_ctx(ptr));
11057 std::string id::name() const
11059 if (!ptr)
11060 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11061 auto saved_ctx = ctx();
11062 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11063 auto res = isl_id_get_name(get());
11064 std::string tmp(res);
11065 return tmp;
11068 std::string id::get_name() const
11070 return name();
11073 isl::id_list id::to_list() const
11075 if (!ptr)
11076 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11077 auto saved_ctx = ctx();
11078 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11079 auto res = isl_id_to_list(copy());
11080 if (!res)
11081 exception::throw_last_error(saved_ctx);
11082 return manage(res);
11085 #if __cplusplus >= 201703L
11086 id::id(isl::ctx ctx, const std::string &str, const std::any &any)
11088 auto saved_ctx = ctx;
11089 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11090 std::any *p = new std::any(any);
11091 auto res = isl_id_alloc(ctx.get(), str.c_str(), p);
11092 res = isl_id_set_free_user(res, &ctx::free_user);
11093 if (!res) {
11094 delete p;
11095 exception::throw_last_error(saved_ctx);
11097 ptr = res;
11100 template <class T>
11101 std::optional<T> id::try_user() const
11103 if (!ptr)
11104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11105 std::any *p = (std::any *) isl_id_get_user(ptr);
11106 if (!p)
11107 return std::nullopt;
11108 if (isl_id_get_free_user(ptr) != &ctx::free_user)
11109 return std::nullopt;
11110 T *res = std::any_cast<T>(p);
11111 if (!res)
11112 return std::nullopt;
11113 return *res;
11116 template <class T>
11117 T id::user() const
11119 if (!ptr)
11120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11121 std::any *p = (std::any *) isl_id_get_user(ptr);
11122 if (!p)
11123 exception::throw_invalid("no user pointer", __FILE__, __LINE__);
11124 if (isl_id_get_free_user(ptr) != &ctx::free_user)
11125 exception::throw_invalid("user pointer not attached by C++ interface", __FILE__, __LINE__);
11126 T *res = std::any_cast<T>(p);
11127 if (!res)
11128 exception::throw_invalid("user pointer not of given type", __FILE__, __LINE__);
11129 return *res;
11131 #endif
11133 inline std::ostream &operator<<(std::ostream &os, const id &obj)
11135 if (!obj.get())
11136 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11137 auto saved_ctx = isl_id_get_ctx(obj.get());
11138 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11139 char *str = isl_id_to_str(obj.get());
11140 if (!str)
11141 exception::throw_last_error(saved_ctx);
11142 os << str;
11143 free(str);
11144 return os;
11147 // implementations for isl::id_list
11148 id_list manage(__isl_take isl_id_list *ptr) {
11149 if (!ptr)
11150 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11151 return id_list(ptr);
11153 id_list manage_copy(__isl_keep isl_id_list *ptr) {
11154 if (!ptr)
11155 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11156 auto saved_ctx = isl_id_list_get_ctx(ptr);
11157 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11158 ptr = isl_id_list_copy(ptr);
11159 if (!ptr)
11160 exception::throw_last_error(saved_ctx);
11161 return id_list(ptr);
11164 id_list::id_list(__isl_take isl_id_list *ptr)
11165 : ptr(ptr) {}
11167 id_list::id_list()
11168 : ptr(nullptr) {}
11170 id_list::id_list(const id_list &obj)
11171 : ptr(nullptr)
11173 if (!obj.ptr)
11174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11175 auto saved_ctx = isl_id_list_get_ctx(obj.ptr);
11176 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11177 ptr = obj.copy();
11178 if (!ptr)
11179 exception::throw_last_error(saved_ctx);
11182 id_list::id_list(isl::ctx ctx, int n)
11184 auto saved_ctx = ctx;
11185 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11186 auto res = isl_id_list_alloc(ctx.release(), n);
11187 if (!res)
11188 exception::throw_last_error(saved_ctx);
11189 ptr = res;
11192 id_list::id_list(isl::id el)
11194 if (el.is_null())
11195 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11196 auto saved_ctx = el.ctx();
11197 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11198 auto res = isl_id_list_from_id(el.release());
11199 if (!res)
11200 exception::throw_last_error(saved_ctx);
11201 ptr = res;
11204 id_list::id_list(isl::ctx ctx, const std::string &str)
11206 auto saved_ctx = ctx;
11207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11208 auto res = isl_id_list_read_from_str(ctx.release(), str.c_str());
11209 if (!res)
11210 exception::throw_last_error(saved_ctx);
11211 ptr = res;
11214 id_list &id_list::operator=(id_list obj) {
11215 std::swap(this->ptr, obj.ptr);
11216 return *this;
11219 id_list::~id_list() {
11220 if (ptr)
11221 isl_id_list_free(ptr);
11224 __isl_give isl_id_list *id_list::copy() const & {
11225 return isl_id_list_copy(ptr);
11228 __isl_keep isl_id_list *id_list::get() const {
11229 return ptr;
11232 __isl_give isl_id_list *id_list::release() {
11233 isl_id_list *tmp = ptr;
11234 ptr = nullptr;
11235 return tmp;
11238 bool id_list::is_null() const {
11239 return ptr == nullptr;
11242 isl::ctx id_list::ctx() const {
11243 return isl::ctx(isl_id_list_get_ctx(ptr));
11246 isl::id_list id_list::add(isl::id el) const
11248 if (!ptr || el.is_null())
11249 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11250 auto saved_ctx = ctx();
11251 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11252 auto res = isl_id_list_add(copy(), el.release());
11253 if (!res)
11254 exception::throw_last_error(saved_ctx);
11255 return manage(res);
11258 isl::id_list id_list::add(const std::string &el) const
11260 if (!ptr)
11261 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11262 return this->add(isl::id(ctx(), el));
11265 isl::id id_list::at(int index) const
11267 if (!ptr)
11268 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11269 auto saved_ctx = ctx();
11270 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11271 auto res = isl_id_list_get_at(get(), index);
11272 if (!res)
11273 exception::throw_last_error(saved_ctx);
11274 return manage(res);
11277 isl::id id_list::get_at(int index) const
11279 return at(index);
11282 isl::id_list id_list::clear() const
11284 if (!ptr)
11285 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11286 auto saved_ctx = ctx();
11287 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11288 auto res = isl_id_list_clear(copy());
11289 if (!res)
11290 exception::throw_last_error(saved_ctx);
11291 return manage(res);
11294 isl::id_list id_list::concat(isl::id_list list2) const
11296 if (!ptr || list2.is_null())
11297 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11298 auto saved_ctx = ctx();
11299 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11300 auto res = isl_id_list_concat(copy(), list2.release());
11301 if (!res)
11302 exception::throw_last_error(saved_ctx);
11303 return manage(res);
11306 isl::id_list id_list::drop(unsigned int first, unsigned int n) const
11308 if (!ptr)
11309 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11310 auto saved_ctx = ctx();
11311 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11312 auto res = isl_id_list_drop(copy(), first, n);
11313 if (!res)
11314 exception::throw_last_error(saved_ctx);
11315 return manage(res);
11318 void id_list::foreach(const std::function<void(isl::id)> &fn) const
11320 if (!ptr)
11321 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11322 auto saved_ctx = ctx();
11323 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11324 struct fn_data {
11325 std::function<void(isl::id)> func;
11326 std::exception_ptr eptr;
11327 } fn_data = { fn };
11328 auto fn_lambda = [](isl_id *arg_0, void *arg_1) -> isl_stat {
11329 auto *data = static_cast<struct fn_data *>(arg_1);
11330 ISL_CPP_TRY {
11331 (data->func)(manage(arg_0));
11332 return isl_stat_ok;
11333 } ISL_CPP_CATCH_ALL {
11334 data->eptr = std::current_exception();
11335 return isl_stat_error;
11338 auto res = isl_id_list_foreach(get(), fn_lambda, &fn_data);
11339 if (fn_data.eptr)
11340 std::rethrow_exception(fn_data.eptr);
11341 if (res < 0)
11342 exception::throw_last_error(saved_ctx);
11343 return;
11346 void id_list::foreach_scc(const std::function<bool(isl::id, isl::id)> &follows, const std::function<void(isl::id_list)> &fn) const
11348 if (!ptr)
11349 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11350 auto saved_ctx = ctx();
11351 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11352 struct follows_data {
11353 std::function<bool(isl::id, isl::id)> func;
11354 std::exception_ptr eptr;
11355 } follows_data = { follows };
11356 auto follows_lambda = [](isl_id *arg_0, isl_id *arg_1, void *arg_2) -> isl_bool {
11357 auto *data = static_cast<struct follows_data *>(arg_2);
11358 ISL_CPP_TRY {
11359 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
11360 return ret ? isl_bool_true : isl_bool_false;
11361 } ISL_CPP_CATCH_ALL {
11362 data->eptr = std::current_exception();
11363 return isl_bool_error;
11366 struct fn_data {
11367 std::function<void(isl::id_list)> func;
11368 std::exception_ptr eptr;
11369 } fn_data = { fn };
11370 auto fn_lambda = [](isl_id_list *arg_0, void *arg_1) -> isl_stat {
11371 auto *data = static_cast<struct fn_data *>(arg_1);
11372 ISL_CPP_TRY {
11373 (data->func)(manage(arg_0));
11374 return isl_stat_ok;
11375 } ISL_CPP_CATCH_ALL {
11376 data->eptr = std::current_exception();
11377 return isl_stat_error;
11380 auto res = isl_id_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
11381 if (follows_data.eptr)
11382 std::rethrow_exception(follows_data.eptr);
11383 if (fn_data.eptr)
11384 std::rethrow_exception(fn_data.eptr);
11385 if (res < 0)
11386 exception::throw_last_error(saved_ctx);
11387 return;
11390 isl::id_list id_list::insert(unsigned int pos, isl::id el) const
11392 if (!ptr || el.is_null())
11393 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11394 auto saved_ctx = ctx();
11395 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11396 auto res = isl_id_list_insert(copy(), pos, el.release());
11397 if (!res)
11398 exception::throw_last_error(saved_ctx);
11399 return manage(res);
11402 isl::id_list id_list::insert(unsigned int pos, const std::string &el) const
11404 if (!ptr)
11405 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11406 return this->insert(pos, isl::id(ctx(), el));
11409 isl::id_list id_list::set_at(int index, isl::id el) const
11411 if (!ptr || el.is_null())
11412 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11413 auto saved_ctx = ctx();
11414 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11415 auto res = isl_id_list_set_at(copy(), index, el.release());
11416 if (!res)
11417 exception::throw_last_error(saved_ctx);
11418 return manage(res);
11421 isl::id_list id_list::set_at(int index, const std::string &el) const
11423 if (!ptr)
11424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11425 return this->set_at(index, isl::id(ctx(), el));
11428 unsigned id_list::size() const
11430 if (!ptr)
11431 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11432 auto saved_ctx = ctx();
11433 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11434 auto res = isl_id_list_size(get());
11435 if (res < 0)
11436 exception::throw_last_error(saved_ctx);
11437 return res;
11440 inline std::ostream &operator<<(std::ostream &os, const id_list &obj)
11442 if (!obj.get())
11443 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11444 auto saved_ctx = isl_id_list_get_ctx(obj.get());
11445 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11446 char *str = isl_id_list_to_str(obj.get());
11447 if (!str)
11448 exception::throw_last_error(saved_ctx);
11449 os << str;
11450 free(str);
11451 return os;
11454 // implementations for isl::id_to_ast_expr
11455 id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr) {
11456 if (!ptr)
11457 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11458 return id_to_ast_expr(ptr);
11460 id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr) {
11461 if (!ptr)
11462 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11463 auto saved_ctx = isl_id_to_ast_expr_get_ctx(ptr);
11464 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11465 ptr = isl_id_to_ast_expr_copy(ptr);
11466 if (!ptr)
11467 exception::throw_last_error(saved_ctx);
11468 return id_to_ast_expr(ptr);
11471 id_to_ast_expr::id_to_ast_expr(__isl_take isl_id_to_ast_expr *ptr)
11472 : ptr(ptr) {}
11474 id_to_ast_expr::id_to_ast_expr()
11475 : ptr(nullptr) {}
11477 id_to_ast_expr::id_to_ast_expr(const id_to_ast_expr &obj)
11478 : ptr(nullptr)
11480 if (!obj.ptr)
11481 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11482 auto saved_ctx = isl_id_to_ast_expr_get_ctx(obj.ptr);
11483 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11484 ptr = obj.copy();
11485 if (!ptr)
11486 exception::throw_last_error(saved_ctx);
11489 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, int min_size)
11491 auto saved_ctx = ctx;
11492 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11493 auto res = isl_id_to_ast_expr_alloc(ctx.release(), min_size);
11494 if (!res)
11495 exception::throw_last_error(saved_ctx);
11496 ptr = res;
11499 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, const std::string &str)
11501 auto saved_ctx = ctx;
11502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11503 auto res = isl_id_to_ast_expr_read_from_str(ctx.release(), str.c_str());
11504 if (!res)
11505 exception::throw_last_error(saved_ctx);
11506 ptr = res;
11509 id_to_ast_expr &id_to_ast_expr::operator=(id_to_ast_expr obj) {
11510 std::swap(this->ptr, obj.ptr);
11511 return *this;
11514 id_to_ast_expr::~id_to_ast_expr() {
11515 if (ptr)
11516 isl_id_to_ast_expr_free(ptr);
11519 __isl_give isl_id_to_ast_expr *id_to_ast_expr::copy() const & {
11520 return isl_id_to_ast_expr_copy(ptr);
11523 __isl_keep isl_id_to_ast_expr *id_to_ast_expr::get() const {
11524 return ptr;
11527 __isl_give isl_id_to_ast_expr *id_to_ast_expr::release() {
11528 isl_id_to_ast_expr *tmp = ptr;
11529 ptr = nullptr;
11530 return tmp;
11533 bool id_to_ast_expr::is_null() const {
11534 return ptr == nullptr;
11537 isl::ctx id_to_ast_expr::ctx() const {
11538 return isl::ctx(isl_id_to_ast_expr_get_ctx(ptr));
11541 bool id_to_ast_expr::is_equal(const isl::id_to_ast_expr &hmap2) const
11543 if (!ptr || hmap2.is_null())
11544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11545 auto saved_ctx = ctx();
11546 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11547 auto res = isl_id_to_ast_expr_is_equal(get(), hmap2.get());
11548 if (res < 0)
11549 exception::throw_last_error(saved_ctx);
11550 return res;
11553 isl::id_to_ast_expr id_to_ast_expr::set(isl::id key, isl::ast_expr val) const
11555 if (!ptr || key.is_null() || val.is_null())
11556 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11557 auto saved_ctx = ctx();
11558 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11559 auto res = isl_id_to_ast_expr_set(copy(), key.release(), val.release());
11560 if (!res)
11561 exception::throw_last_error(saved_ctx);
11562 return manage(res);
11565 isl::id_to_ast_expr id_to_ast_expr::set(const std::string &key, const isl::ast_expr &val) const
11567 if (!ptr)
11568 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11569 return this->set(isl::id(ctx(), key), val);
11572 inline std::ostream &operator<<(std::ostream &os, const id_to_ast_expr &obj)
11574 if (!obj.get())
11575 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11576 auto saved_ctx = isl_id_to_ast_expr_get_ctx(obj.get());
11577 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11578 char *str = isl_id_to_ast_expr_to_str(obj.get());
11579 if (!str)
11580 exception::throw_last_error(saved_ctx);
11581 os << str;
11582 free(str);
11583 return os;
11586 // implementations for isl::id_to_id
11587 id_to_id manage(__isl_take isl_id_to_id *ptr) {
11588 if (!ptr)
11589 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11590 return id_to_id(ptr);
11592 id_to_id manage_copy(__isl_keep isl_id_to_id *ptr) {
11593 if (!ptr)
11594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11595 auto saved_ctx = isl_id_to_id_get_ctx(ptr);
11596 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11597 ptr = isl_id_to_id_copy(ptr);
11598 if (!ptr)
11599 exception::throw_last_error(saved_ctx);
11600 return id_to_id(ptr);
11603 id_to_id::id_to_id(__isl_take isl_id_to_id *ptr)
11604 : ptr(ptr) {}
11606 id_to_id::id_to_id()
11607 : ptr(nullptr) {}
11609 id_to_id::id_to_id(const id_to_id &obj)
11610 : ptr(nullptr)
11612 if (!obj.ptr)
11613 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11614 auto saved_ctx = isl_id_to_id_get_ctx(obj.ptr);
11615 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11616 ptr = obj.copy();
11617 if (!ptr)
11618 exception::throw_last_error(saved_ctx);
11621 id_to_id::id_to_id(isl::ctx ctx, int min_size)
11623 auto saved_ctx = ctx;
11624 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11625 auto res = isl_id_to_id_alloc(ctx.release(), min_size);
11626 if (!res)
11627 exception::throw_last_error(saved_ctx);
11628 ptr = res;
11631 id_to_id::id_to_id(isl::ctx ctx, const std::string &str)
11633 auto saved_ctx = ctx;
11634 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11635 auto res = isl_id_to_id_read_from_str(ctx.release(), str.c_str());
11636 if (!res)
11637 exception::throw_last_error(saved_ctx);
11638 ptr = res;
11641 id_to_id &id_to_id::operator=(id_to_id obj) {
11642 std::swap(this->ptr, obj.ptr);
11643 return *this;
11646 id_to_id::~id_to_id() {
11647 if (ptr)
11648 isl_id_to_id_free(ptr);
11651 __isl_give isl_id_to_id *id_to_id::copy() const & {
11652 return isl_id_to_id_copy(ptr);
11655 __isl_keep isl_id_to_id *id_to_id::get() const {
11656 return ptr;
11659 __isl_give isl_id_to_id *id_to_id::release() {
11660 isl_id_to_id *tmp = ptr;
11661 ptr = nullptr;
11662 return tmp;
11665 bool id_to_id::is_null() const {
11666 return ptr == nullptr;
11669 isl::ctx id_to_id::ctx() const {
11670 return isl::ctx(isl_id_to_id_get_ctx(ptr));
11673 bool id_to_id::is_equal(const isl::id_to_id &hmap2) const
11675 if (!ptr || hmap2.is_null())
11676 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11677 auto saved_ctx = ctx();
11678 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11679 auto res = isl_id_to_id_is_equal(get(), hmap2.get());
11680 if (res < 0)
11681 exception::throw_last_error(saved_ctx);
11682 return res;
11685 isl::id_to_id id_to_id::set(isl::id key, isl::id val) const
11687 if (!ptr || key.is_null() || val.is_null())
11688 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11689 auto saved_ctx = ctx();
11690 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11691 auto res = isl_id_to_id_set(copy(), key.release(), val.release());
11692 if (!res)
11693 exception::throw_last_error(saved_ctx);
11694 return manage(res);
11697 isl::id_to_id id_to_id::set(const isl::id &key, const std::string &val) const
11699 if (!ptr)
11700 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11701 return this->set(key, isl::id(ctx(), val));
11704 isl::id_to_id id_to_id::set(const std::string &key, const isl::id &val) const
11706 if (!ptr)
11707 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11708 return this->set(isl::id(ctx(), key), val);
11711 isl::id_to_id id_to_id::set(const std::string &key, const std::string &val) const
11713 if (!ptr)
11714 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11715 return this->set(isl::id(ctx(), key), isl::id(ctx(), val));
11718 inline std::ostream &operator<<(std::ostream &os, const id_to_id &obj)
11720 if (!obj.get())
11721 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11722 auto saved_ctx = isl_id_to_id_get_ctx(obj.get());
11723 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11724 char *str = isl_id_to_id_to_str(obj.get());
11725 if (!str)
11726 exception::throw_last_error(saved_ctx);
11727 os << str;
11728 free(str);
11729 return os;
11732 // implementations for isl::map
11733 map manage(__isl_take isl_map *ptr) {
11734 if (!ptr)
11735 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11736 return map(ptr);
11738 map manage_copy(__isl_keep isl_map *ptr) {
11739 if (!ptr)
11740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11741 auto saved_ctx = isl_map_get_ctx(ptr);
11742 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11743 ptr = isl_map_copy(ptr);
11744 if (!ptr)
11745 exception::throw_last_error(saved_ctx);
11746 return map(ptr);
11749 map::map(__isl_take isl_map *ptr)
11750 : ptr(ptr) {}
11752 map::map()
11753 : ptr(nullptr) {}
11755 map::map(const map &obj)
11756 : ptr(nullptr)
11758 if (!obj.ptr)
11759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11760 auto saved_ctx = isl_map_get_ctx(obj.ptr);
11761 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11762 ptr = obj.copy();
11763 if (!ptr)
11764 exception::throw_last_error(saved_ctx);
11767 map::map(isl::basic_map bmap)
11769 if (bmap.is_null())
11770 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11771 auto saved_ctx = bmap.ctx();
11772 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11773 auto res = isl_map_from_basic_map(bmap.release());
11774 if (!res)
11775 exception::throw_last_error(saved_ctx);
11776 ptr = res;
11779 map::map(isl::ctx ctx, const std::string &str)
11781 auto saved_ctx = ctx;
11782 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11783 auto res = isl_map_read_from_str(ctx.release(), str.c_str());
11784 if (!res)
11785 exception::throw_last_error(saved_ctx);
11786 ptr = res;
11789 map &map::operator=(map obj) {
11790 std::swap(this->ptr, obj.ptr);
11791 return *this;
11794 map::~map() {
11795 if (ptr)
11796 isl_map_free(ptr);
11799 __isl_give isl_map *map::copy() const & {
11800 return isl_map_copy(ptr);
11803 __isl_keep isl_map *map::get() const {
11804 return ptr;
11807 __isl_give isl_map *map::release() {
11808 isl_map *tmp = ptr;
11809 ptr = nullptr;
11810 return tmp;
11813 bool map::is_null() const {
11814 return ptr == nullptr;
11817 isl::ctx map::ctx() const {
11818 return isl::ctx(isl_map_get_ctx(ptr));
11821 isl::basic_map map::affine_hull() const
11823 if (!ptr)
11824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11825 auto saved_ctx = ctx();
11826 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11827 auto res = isl_map_affine_hull(copy());
11828 if (!res)
11829 exception::throw_last_error(saved_ctx);
11830 return manage(res);
11833 isl::map map::apply_domain(isl::map map2) const
11835 if (!ptr || map2.is_null())
11836 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11837 auto saved_ctx = ctx();
11838 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11839 auto res = isl_map_apply_domain(copy(), map2.release());
11840 if (!res)
11841 exception::throw_last_error(saved_ctx);
11842 return manage(res);
11845 isl::union_map map::apply_domain(const isl::union_map &umap2) const
11847 if (!ptr)
11848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11849 return isl::union_map(*this).apply_domain(umap2);
11852 isl::map map::apply_domain(const isl::basic_map &map2) const
11854 if (!ptr)
11855 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11856 return this->apply_domain(isl::map(map2));
11859 isl::map map::apply_range(isl::map map2) const
11861 if (!ptr || map2.is_null())
11862 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11863 auto saved_ctx = ctx();
11864 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11865 auto res = isl_map_apply_range(copy(), map2.release());
11866 if (!res)
11867 exception::throw_last_error(saved_ctx);
11868 return manage(res);
11871 isl::union_map map::apply_range(const isl::union_map &umap2) const
11873 if (!ptr)
11874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11875 return isl::union_map(*this).apply_range(umap2);
11878 isl::map map::apply_range(const isl::basic_map &map2) const
11880 if (!ptr)
11881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11882 return this->apply_range(isl::map(map2));
11885 isl::map map::as_map() const
11887 if (!ptr)
11888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11889 return isl::union_map(*this).as_map();
11892 isl::multi_union_pw_aff map::as_multi_union_pw_aff() const
11894 if (!ptr)
11895 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11896 return isl::union_map(*this).as_multi_union_pw_aff();
11899 isl::pw_multi_aff map::as_pw_multi_aff() const
11901 if (!ptr)
11902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11903 auto saved_ctx = ctx();
11904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11905 auto res = isl_map_as_pw_multi_aff(copy());
11906 if (!res)
11907 exception::throw_last_error(saved_ctx);
11908 return manage(res);
11911 isl::union_pw_multi_aff map::as_union_pw_multi_aff() const
11913 if (!ptr)
11914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11915 return isl::union_map(*this).as_union_pw_multi_aff();
11918 isl::set map::bind_domain(isl::multi_id tuple) const
11920 if (!ptr || tuple.is_null())
11921 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11922 auto saved_ctx = ctx();
11923 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11924 auto res = isl_map_bind_domain(copy(), tuple.release());
11925 if (!res)
11926 exception::throw_last_error(saved_ctx);
11927 return manage(res);
11930 isl::set map::bind_range(isl::multi_id tuple) const
11932 if (!ptr || tuple.is_null())
11933 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11934 auto saved_ctx = ctx();
11935 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11936 auto res = isl_map_bind_range(copy(), tuple.release());
11937 if (!res)
11938 exception::throw_last_error(saved_ctx);
11939 return manage(res);
11942 isl::map map::coalesce() const
11944 if (!ptr)
11945 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11946 auto saved_ctx = ctx();
11947 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11948 auto res = isl_map_coalesce(copy());
11949 if (!res)
11950 exception::throw_last_error(saved_ctx);
11951 return manage(res);
11954 isl::map map::complement() const
11956 if (!ptr)
11957 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11958 auto saved_ctx = ctx();
11959 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11960 auto res = isl_map_complement(copy());
11961 if (!res)
11962 exception::throw_last_error(saved_ctx);
11963 return manage(res);
11966 isl::union_map map::compute_divs() const
11968 if (!ptr)
11969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11970 return isl::union_map(*this).compute_divs();
11973 isl::map map::curry() const
11975 if (!ptr)
11976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11977 auto saved_ctx = ctx();
11978 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11979 auto res = isl_map_curry(copy());
11980 if (!res)
11981 exception::throw_last_error(saved_ctx);
11982 return manage(res);
11985 isl::set map::deltas() const
11987 if (!ptr)
11988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11989 auto saved_ctx = ctx();
11990 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11991 auto res = isl_map_deltas(copy());
11992 if (!res)
11993 exception::throw_last_error(saved_ctx);
11994 return manage(res);
11997 isl::map map::detect_equalities() const
11999 if (!ptr)
12000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12001 auto saved_ctx = ctx();
12002 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12003 auto res = isl_map_detect_equalities(copy());
12004 if (!res)
12005 exception::throw_last_error(saved_ctx);
12006 return manage(res);
12009 isl::set map::domain() const
12011 if (!ptr)
12012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12013 auto saved_ctx = ctx();
12014 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12015 auto res = isl_map_domain(copy());
12016 if (!res)
12017 exception::throw_last_error(saved_ctx);
12018 return manage(res);
12021 isl::map map::domain_factor_domain() const
12023 if (!ptr)
12024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12025 auto saved_ctx = ctx();
12026 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12027 auto res = isl_map_domain_factor_domain(copy());
12028 if (!res)
12029 exception::throw_last_error(saved_ctx);
12030 return manage(res);
12033 isl::map map::domain_factor_range() const
12035 if (!ptr)
12036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12037 auto saved_ctx = ctx();
12038 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12039 auto res = isl_map_domain_factor_range(copy());
12040 if (!res)
12041 exception::throw_last_error(saved_ctx);
12042 return manage(res);
12045 isl::union_map map::domain_map() const
12047 if (!ptr)
12048 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12049 return isl::union_map(*this).domain_map();
12052 isl::union_pw_multi_aff map::domain_map_union_pw_multi_aff() const
12054 if (!ptr)
12055 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12056 return isl::union_map(*this).domain_map_union_pw_multi_aff();
12059 isl::map map::domain_product(isl::map map2) const
12061 if (!ptr || map2.is_null())
12062 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12063 auto saved_ctx = ctx();
12064 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12065 auto res = isl_map_domain_product(copy(), map2.release());
12066 if (!res)
12067 exception::throw_last_error(saved_ctx);
12068 return manage(res);
12071 isl::union_map map::domain_product(const isl::union_map &umap2) const
12073 if (!ptr)
12074 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12075 return isl::union_map(*this).domain_product(umap2);
12078 isl::map map::domain_product(const isl::basic_map &map2) const
12080 if (!ptr)
12081 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12082 return this->domain_product(isl::map(map2));
12085 isl::map map::domain_reverse() const
12087 if (!ptr)
12088 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12089 auto saved_ctx = ctx();
12090 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12091 auto res = isl_map_domain_reverse(copy());
12092 if (!res)
12093 exception::throw_last_error(saved_ctx);
12094 return manage(res);
12097 unsigned map::domain_tuple_dim() const
12099 if (!ptr)
12100 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12101 auto saved_ctx = ctx();
12102 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12103 auto res = isl_map_domain_tuple_dim(get());
12104 if (res < 0)
12105 exception::throw_last_error(saved_ctx);
12106 return res;
12109 isl::id map::domain_tuple_id() const
12111 if (!ptr)
12112 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12113 auto saved_ctx = ctx();
12114 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12115 auto res = isl_map_get_domain_tuple_id(get());
12116 if (!res)
12117 exception::throw_last_error(saved_ctx);
12118 return manage(res);
12121 isl::id map::get_domain_tuple_id() const
12123 return domain_tuple_id();
12126 isl::map map::drop_unused_params() const
12128 if (!ptr)
12129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12130 auto saved_ctx = ctx();
12131 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12132 auto res = isl_map_drop_unused_params(copy());
12133 if (!res)
12134 exception::throw_last_error(saved_ctx);
12135 return manage(res);
12138 isl::map map::empty(isl::space space)
12140 if (space.is_null())
12141 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12142 auto saved_ctx = space.ctx();
12143 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12144 auto res = isl_map_empty(space.release());
12145 if (!res)
12146 exception::throw_last_error(saved_ctx);
12147 return manage(res);
12150 isl::map map::eq_at(isl::multi_pw_aff mpa) const
12152 if (!ptr || mpa.is_null())
12153 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12154 auto saved_ctx = ctx();
12155 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12156 auto res = isl_map_eq_at_multi_pw_aff(copy(), mpa.release());
12157 if (!res)
12158 exception::throw_last_error(saved_ctx);
12159 return manage(res);
12162 isl::union_map map::eq_at(const isl::multi_union_pw_aff &mupa) const
12164 if (!ptr)
12165 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12166 return isl::union_map(*this).eq_at(mupa);
12169 isl::map map::eq_at(const isl::aff &mpa) const
12171 if (!ptr)
12172 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12173 return this->eq_at(isl::multi_pw_aff(mpa));
12176 isl::map map::eq_at(const isl::multi_aff &mpa) const
12178 if (!ptr)
12179 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12180 return this->eq_at(isl::multi_pw_aff(mpa));
12183 isl::map map::eq_at(const isl::pw_aff &mpa) const
12185 if (!ptr)
12186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12187 return this->eq_at(isl::multi_pw_aff(mpa));
12190 isl::map map::eq_at(const isl::pw_multi_aff &mpa) const
12192 if (!ptr)
12193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12194 return this->eq_at(isl::multi_pw_aff(mpa));
12197 bool map::every_map(const std::function<bool(isl::map)> &test) const
12199 if (!ptr)
12200 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12201 return isl::union_map(*this).every_map(test);
12204 isl::map map::extract_map(const isl::space &space) const
12206 if (!ptr)
12207 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12208 return isl::union_map(*this).extract_map(space);
12211 isl::map map::factor_domain() const
12213 if (!ptr)
12214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12215 auto saved_ctx = ctx();
12216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12217 auto res = isl_map_factor_domain(copy());
12218 if (!res)
12219 exception::throw_last_error(saved_ctx);
12220 return manage(res);
12223 isl::map map::factor_range() const
12225 if (!ptr)
12226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12227 auto saved_ctx = ctx();
12228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12229 auto res = isl_map_factor_range(copy());
12230 if (!res)
12231 exception::throw_last_error(saved_ctx);
12232 return manage(res);
12235 isl::map map::fixed_power(isl::val exp) const
12237 if (!ptr || exp.is_null())
12238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12239 auto saved_ctx = ctx();
12240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12241 auto res = isl_map_fixed_power_val(copy(), exp.release());
12242 if (!res)
12243 exception::throw_last_error(saved_ctx);
12244 return manage(res);
12247 isl::map map::fixed_power(long exp) const
12249 if (!ptr)
12250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12251 return this->fixed_power(isl::val(ctx(), exp));
12254 isl::map map::flatten() const
12256 if (!ptr)
12257 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12258 auto saved_ctx = ctx();
12259 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12260 auto res = isl_map_flatten(copy());
12261 if (!res)
12262 exception::throw_last_error(saved_ctx);
12263 return manage(res);
12266 isl::map map::flatten_domain() const
12268 if (!ptr)
12269 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12270 auto saved_ctx = ctx();
12271 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12272 auto res = isl_map_flatten_domain(copy());
12273 if (!res)
12274 exception::throw_last_error(saved_ctx);
12275 return manage(res);
12278 isl::map map::flatten_range() const
12280 if (!ptr)
12281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12282 auto saved_ctx = ctx();
12283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12284 auto res = isl_map_flatten_range(copy());
12285 if (!res)
12286 exception::throw_last_error(saved_ctx);
12287 return manage(res);
12290 void map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
12292 if (!ptr)
12293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12294 auto saved_ctx = ctx();
12295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12296 struct fn_data {
12297 std::function<void(isl::basic_map)> func;
12298 std::exception_ptr eptr;
12299 } fn_data = { fn };
12300 auto fn_lambda = [](isl_basic_map *arg_0, void *arg_1) -> isl_stat {
12301 auto *data = static_cast<struct fn_data *>(arg_1);
12302 ISL_CPP_TRY {
12303 (data->func)(manage(arg_0));
12304 return isl_stat_ok;
12305 } ISL_CPP_CATCH_ALL {
12306 data->eptr = std::current_exception();
12307 return isl_stat_error;
12310 auto res = isl_map_foreach_basic_map(get(), fn_lambda, &fn_data);
12311 if (fn_data.eptr)
12312 std::rethrow_exception(fn_data.eptr);
12313 if (res < 0)
12314 exception::throw_last_error(saved_ctx);
12315 return;
12318 void map::foreach_map(const std::function<void(isl::map)> &fn) const
12320 if (!ptr)
12321 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12322 return isl::union_map(*this).foreach_map(fn);
12325 isl::map map::gist(isl::map context) const
12327 if (!ptr || context.is_null())
12328 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12329 auto saved_ctx = ctx();
12330 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12331 auto res = isl_map_gist(copy(), context.release());
12332 if (!res)
12333 exception::throw_last_error(saved_ctx);
12334 return manage(res);
12337 isl::union_map map::gist(const isl::union_map &context) const
12339 if (!ptr)
12340 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12341 return isl::union_map(*this).gist(context);
12344 isl::map map::gist(const isl::basic_map &context) const
12346 if (!ptr)
12347 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12348 return this->gist(isl::map(context));
12351 isl::map map::gist_domain(isl::set context) const
12353 if (!ptr || context.is_null())
12354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12355 auto saved_ctx = ctx();
12356 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12357 auto res = isl_map_gist_domain(copy(), context.release());
12358 if (!res)
12359 exception::throw_last_error(saved_ctx);
12360 return manage(res);
12363 isl::union_map map::gist_domain(const isl::union_set &uset) const
12365 if (!ptr)
12366 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12367 return isl::union_map(*this).gist_domain(uset);
12370 isl::map map::gist_domain(const isl::basic_set &context) const
12372 if (!ptr)
12373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12374 return this->gist_domain(isl::set(context));
12377 isl::map map::gist_domain(const isl::point &context) const
12379 if (!ptr)
12380 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12381 return this->gist_domain(isl::set(context));
12384 isl::map map::gist_params(isl::set context) const
12386 if (!ptr || context.is_null())
12387 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12388 auto saved_ctx = ctx();
12389 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12390 auto res = isl_map_gist_params(copy(), context.release());
12391 if (!res)
12392 exception::throw_last_error(saved_ctx);
12393 return manage(res);
12396 isl::union_map map::gist_range(const isl::union_set &uset) const
12398 if (!ptr)
12399 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12400 return isl::union_map(*this).gist_range(uset);
12403 bool map::has_domain_tuple_id() const
12405 if (!ptr)
12406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12407 auto saved_ctx = ctx();
12408 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12409 auto res = isl_map_has_domain_tuple_id(get());
12410 if (res < 0)
12411 exception::throw_last_error(saved_ctx);
12412 return res;
12415 bool map::has_range_tuple_id() const
12417 if (!ptr)
12418 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12419 auto saved_ctx = ctx();
12420 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12421 auto res = isl_map_has_range_tuple_id(get());
12422 if (res < 0)
12423 exception::throw_last_error(saved_ctx);
12424 return res;
12427 isl::map map::intersect(isl::map map2) const
12429 if (!ptr || map2.is_null())
12430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12431 auto saved_ctx = ctx();
12432 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12433 auto res = isl_map_intersect(copy(), map2.release());
12434 if (!res)
12435 exception::throw_last_error(saved_ctx);
12436 return manage(res);
12439 isl::union_map map::intersect(const isl::union_map &umap2) const
12441 if (!ptr)
12442 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12443 return isl::union_map(*this).intersect(umap2);
12446 isl::map map::intersect(const isl::basic_map &map2) const
12448 if (!ptr)
12449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12450 return this->intersect(isl::map(map2));
12453 isl::map map::intersect_domain(isl::set set) const
12455 if (!ptr || set.is_null())
12456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12457 auto saved_ctx = ctx();
12458 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12459 auto res = isl_map_intersect_domain(copy(), set.release());
12460 if (!res)
12461 exception::throw_last_error(saved_ctx);
12462 return manage(res);
12465 isl::union_map map::intersect_domain(const isl::space &space) const
12467 if (!ptr)
12468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12469 return isl::union_map(*this).intersect_domain(space);
12472 isl::union_map map::intersect_domain(const isl::union_set &uset) const
12474 if (!ptr)
12475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12476 return isl::union_map(*this).intersect_domain(uset);
12479 isl::map map::intersect_domain(const isl::basic_set &set) const
12481 if (!ptr)
12482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12483 return this->intersect_domain(isl::set(set));
12486 isl::map map::intersect_domain(const isl::point &set) const
12488 if (!ptr)
12489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12490 return this->intersect_domain(isl::set(set));
12493 isl::map map::intersect_domain_factor_domain(isl::map factor) const
12495 if (!ptr || factor.is_null())
12496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12497 auto saved_ctx = ctx();
12498 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12499 auto res = isl_map_intersect_domain_factor_domain(copy(), factor.release());
12500 if (!res)
12501 exception::throw_last_error(saved_ctx);
12502 return manage(res);
12505 isl::union_map map::intersect_domain_factor_domain(const isl::union_map &factor) const
12507 if (!ptr)
12508 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12509 return isl::union_map(*this).intersect_domain_factor_domain(factor);
12512 isl::map map::intersect_domain_factor_domain(const isl::basic_map &factor) const
12514 if (!ptr)
12515 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12516 return this->intersect_domain_factor_domain(isl::map(factor));
12519 isl::map map::intersect_domain_factor_range(isl::map factor) const
12521 if (!ptr || factor.is_null())
12522 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12523 auto saved_ctx = ctx();
12524 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12525 auto res = isl_map_intersect_domain_factor_range(copy(), factor.release());
12526 if (!res)
12527 exception::throw_last_error(saved_ctx);
12528 return manage(res);
12531 isl::union_map map::intersect_domain_factor_range(const isl::union_map &factor) const
12533 if (!ptr)
12534 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12535 return isl::union_map(*this).intersect_domain_factor_range(factor);
12538 isl::map map::intersect_domain_factor_range(const isl::basic_map &factor) const
12540 if (!ptr)
12541 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12542 return this->intersect_domain_factor_range(isl::map(factor));
12545 isl::map map::intersect_domain_wrapped_domain(isl::set domain) const
12547 if (!ptr || domain.is_null())
12548 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12549 auto saved_ctx = ctx();
12550 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12551 auto res = isl_map_intersect_domain_wrapped_domain(copy(), domain.release());
12552 if (!res)
12553 exception::throw_last_error(saved_ctx);
12554 return manage(res);
12557 isl::union_map map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
12559 if (!ptr)
12560 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12561 return isl::union_map(*this).intersect_domain_wrapped_domain(domain);
12564 isl::map map::intersect_domain_wrapped_domain(const isl::basic_set &domain) const
12566 if (!ptr)
12567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12568 return this->intersect_domain_wrapped_domain(isl::set(domain));
12571 isl::map map::intersect_domain_wrapped_domain(const isl::point &domain) const
12573 if (!ptr)
12574 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12575 return this->intersect_domain_wrapped_domain(isl::set(domain));
12578 isl::map map::intersect_params(isl::set params) const
12580 if (!ptr || params.is_null())
12581 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12582 auto saved_ctx = ctx();
12583 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12584 auto res = isl_map_intersect_params(copy(), params.release());
12585 if (!res)
12586 exception::throw_last_error(saved_ctx);
12587 return manage(res);
12590 isl::map map::intersect_range(isl::set set) const
12592 if (!ptr || set.is_null())
12593 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12594 auto saved_ctx = ctx();
12595 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12596 auto res = isl_map_intersect_range(copy(), set.release());
12597 if (!res)
12598 exception::throw_last_error(saved_ctx);
12599 return manage(res);
12602 isl::union_map map::intersect_range(const isl::space &space) const
12604 if (!ptr)
12605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12606 return isl::union_map(*this).intersect_range(space);
12609 isl::union_map map::intersect_range(const isl::union_set &uset) const
12611 if (!ptr)
12612 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12613 return isl::union_map(*this).intersect_range(uset);
12616 isl::map map::intersect_range(const isl::basic_set &set) const
12618 if (!ptr)
12619 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12620 return this->intersect_range(isl::set(set));
12623 isl::map map::intersect_range(const isl::point &set) const
12625 if (!ptr)
12626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12627 return this->intersect_range(isl::set(set));
12630 isl::map map::intersect_range_factor_domain(isl::map factor) const
12632 if (!ptr || factor.is_null())
12633 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12634 auto saved_ctx = ctx();
12635 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12636 auto res = isl_map_intersect_range_factor_domain(copy(), factor.release());
12637 if (!res)
12638 exception::throw_last_error(saved_ctx);
12639 return manage(res);
12642 isl::union_map map::intersect_range_factor_domain(const isl::union_map &factor) const
12644 if (!ptr)
12645 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12646 return isl::union_map(*this).intersect_range_factor_domain(factor);
12649 isl::map map::intersect_range_factor_domain(const isl::basic_map &factor) const
12651 if (!ptr)
12652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12653 return this->intersect_range_factor_domain(isl::map(factor));
12656 isl::map map::intersect_range_factor_range(isl::map factor) const
12658 if (!ptr || factor.is_null())
12659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12660 auto saved_ctx = ctx();
12661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12662 auto res = isl_map_intersect_range_factor_range(copy(), factor.release());
12663 if (!res)
12664 exception::throw_last_error(saved_ctx);
12665 return manage(res);
12668 isl::union_map map::intersect_range_factor_range(const isl::union_map &factor) const
12670 if (!ptr)
12671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12672 return isl::union_map(*this).intersect_range_factor_range(factor);
12675 isl::map map::intersect_range_factor_range(const isl::basic_map &factor) const
12677 if (!ptr)
12678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12679 return this->intersect_range_factor_range(isl::map(factor));
12682 isl::map map::intersect_range_wrapped_domain(isl::set domain) const
12684 if (!ptr || domain.is_null())
12685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12686 auto saved_ctx = ctx();
12687 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12688 auto res = isl_map_intersect_range_wrapped_domain(copy(), domain.release());
12689 if (!res)
12690 exception::throw_last_error(saved_ctx);
12691 return manage(res);
12694 isl::union_map map::intersect_range_wrapped_domain(const isl::union_set &domain) const
12696 if (!ptr)
12697 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12698 return isl::union_map(*this).intersect_range_wrapped_domain(domain);
12701 isl::map map::intersect_range_wrapped_domain(const isl::basic_set &domain) const
12703 if (!ptr)
12704 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12705 return this->intersect_range_wrapped_domain(isl::set(domain));
12708 isl::map map::intersect_range_wrapped_domain(const isl::point &domain) const
12710 if (!ptr)
12711 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12712 return this->intersect_range_wrapped_domain(isl::set(domain));
12715 bool map::is_bijective() const
12717 if (!ptr)
12718 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12719 auto saved_ctx = ctx();
12720 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12721 auto res = isl_map_is_bijective(get());
12722 if (res < 0)
12723 exception::throw_last_error(saved_ctx);
12724 return res;
12727 bool map::is_disjoint(const isl::map &map2) const
12729 if (!ptr || map2.is_null())
12730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12731 auto saved_ctx = ctx();
12732 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12733 auto res = isl_map_is_disjoint(get(), map2.get());
12734 if (res < 0)
12735 exception::throw_last_error(saved_ctx);
12736 return res;
12739 bool map::is_disjoint(const isl::union_map &umap2) const
12741 if (!ptr)
12742 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12743 return isl::union_map(*this).is_disjoint(umap2);
12746 bool map::is_disjoint(const isl::basic_map &map2) const
12748 if (!ptr)
12749 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12750 return this->is_disjoint(isl::map(map2));
12753 bool map::is_empty() const
12755 if (!ptr)
12756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12757 auto saved_ctx = ctx();
12758 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12759 auto res = isl_map_is_empty(get());
12760 if (res < 0)
12761 exception::throw_last_error(saved_ctx);
12762 return res;
12765 bool map::is_equal(const isl::map &map2) const
12767 if (!ptr || map2.is_null())
12768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12769 auto saved_ctx = ctx();
12770 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12771 auto res = isl_map_is_equal(get(), map2.get());
12772 if (res < 0)
12773 exception::throw_last_error(saved_ctx);
12774 return res;
12777 bool map::is_equal(const isl::union_map &umap2) const
12779 if (!ptr)
12780 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12781 return isl::union_map(*this).is_equal(umap2);
12784 bool map::is_equal(const isl::basic_map &map2) const
12786 if (!ptr)
12787 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12788 return this->is_equal(isl::map(map2));
12791 bool map::is_injective() const
12793 if (!ptr)
12794 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12795 auto saved_ctx = ctx();
12796 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12797 auto res = isl_map_is_injective(get());
12798 if (res < 0)
12799 exception::throw_last_error(saved_ctx);
12800 return res;
12803 bool map::is_single_valued() const
12805 if (!ptr)
12806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12807 auto saved_ctx = ctx();
12808 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12809 auto res = isl_map_is_single_valued(get());
12810 if (res < 0)
12811 exception::throw_last_error(saved_ctx);
12812 return res;
12815 bool map::is_strict_subset(const isl::map &map2) const
12817 if (!ptr || map2.is_null())
12818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12819 auto saved_ctx = ctx();
12820 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12821 auto res = isl_map_is_strict_subset(get(), map2.get());
12822 if (res < 0)
12823 exception::throw_last_error(saved_ctx);
12824 return res;
12827 bool map::is_strict_subset(const isl::union_map &umap2) const
12829 if (!ptr)
12830 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12831 return isl::union_map(*this).is_strict_subset(umap2);
12834 bool map::is_strict_subset(const isl::basic_map &map2) const
12836 if (!ptr)
12837 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12838 return this->is_strict_subset(isl::map(map2));
12841 bool map::is_subset(const isl::map &map2) const
12843 if (!ptr || map2.is_null())
12844 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12845 auto saved_ctx = ctx();
12846 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12847 auto res = isl_map_is_subset(get(), map2.get());
12848 if (res < 0)
12849 exception::throw_last_error(saved_ctx);
12850 return res;
12853 bool map::is_subset(const isl::union_map &umap2) const
12855 if (!ptr)
12856 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12857 return isl::union_map(*this).is_subset(umap2);
12860 bool map::is_subset(const isl::basic_map &map2) const
12862 if (!ptr)
12863 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12864 return this->is_subset(isl::map(map2));
12867 bool map::isa_map() const
12869 if (!ptr)
12870 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12871 return isl::union_map(*this).isa_map();
12874 isl::map map::lex_ge_at(isl::multi_pw_aff mpa) const
12876 if (!ptr || mpa.is_null())
12877 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12878 auto saved_ctx = ctx();
12879 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12880 auto res = isl_map_lex_ge_at_multi_pw_aff(copy(), mpa.release());
12881 if (!res)
12882 exception::throw_last_error(saved_ctx);
12883 return manage(res);
12886 isl::map map::lex_gt_at(isl::multi_pw_aff mpa) const
12888 if (!ptr || mpa.is_null())
12889 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12890 auto saved_ctx = ctx();
12891 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12892 auto res = isl_map_lex_gt_at_multi_pw_aff(copy(), mpa.release());
12893 if (!res)
12894 exception::throw_last_error(saved_ctx);
12895 return manage(res);
12898 isl::map map::lex_le_at(isl::multi_pw_aff mpa) const
12900 if (!ptr || mpa.is_null())
12901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12902 auto saved_ctx = ctx();
12903 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12904 auto res = isl_map_lex_le_at_multi_pw_aff(copy(), mpa.release());
12905 if (!res)
12906 exception::throw_last_error(saved_ctx);
12907 return manage(res);
12910 isl::map map::lex_lt_at(isl::multi_pw_aff mpa) const
12912 if (!ptr || mpa.is_null())
12913 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12914 auto saved_ctx = ctx();
12915 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12916 auto res = isl_map_lex_lt_at_multi_pw_aff(copy(), mpa.release());
12917 if (!res)
12918 exception::throw_last_error(saved_ctx);
12919 return manage(res);
12922 isl::map map::lexmax() const
12924 if (!ptr)
12925 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12926 auto saved_ctx = ctx();
12927 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12928 auto res = isl_map_lexmax(copy());
12929 if (!res)
12930 exception::throw_last_error(saved_ctx);
12931 return manage(res);
12934 isl::pw_multi_aff map::lexmax_pw_multi_aff() const
12936 if (!ptr)
12937 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12938 auto saved_ctx = ctx();
12939 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12940 auto res = isl_map_lexmax_pw_multi_aff(copy());
12941 if (!res)
12942 exception::throw_last_error(saved_ctx);
12943 return manage(res);
12946 isl::map map::lexmin() const
12948 if (!ptr)
12949 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12950 auto saved_ctx = ctx();
12951 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12952 auto res = isl_map_lexmin(copy());
12953 if (!res)
12954 exception::throw_last_error(saved_ctx);
12955 return manage(res);
12958 isl::pw_multi_aff map::lexmin_pw_multi_aff() const
12960 if (!ptr)
12961 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12962 auto saved_ctx = ctx();
12963 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12964 auto res = isl_map_lexmin_pw_multi_aff(copy());
12965 if (!res)
12966 exception::throw_last_error(saved_ctx);
12967 return manage(res);
12970 isl::map map::lower_bound(isl::multi_pw_aff lower) const
12972 if (!ptr || lower.is_null())
12973 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12974 auto saved_ctx = ctx();
12975 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12976 auto res = isl_map_lower_bound_multi_pw_aff(copy(), lower.release());
12977 if (!res)
12978 exception::throw_last_error(saved_ctx);
12979 return manage(res);
12982 isl::map_list map::map_list() const
12984 if (!ptr)
12985 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12986 return isl::union_map(*this).map_list();
12989 isl::multi_pw_aff map::max_multi_pw_aff() const
12991 if (!ptr)
12992 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12993 auto saved_ctx = ctx();
12994 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12995 auto res = isl_map_max_multi_pw_aff(copy());
12996 if (!res)
12997 exception::throw_last_error(saved_ctx);
12998 return manage(res);
13001 isl::multi_pw_aff map::min_multi_pw_aff() const
13003 if (!ptr)
13004 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13005 auto saved_ctx = ctx();
13006 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13007 auto res = isl_map_min_multi_pw_aff(copy());
13008 if (!res)
13009 exception::throw_last_error(saved_ctx);
13010 return manage(res);
13013 unsigned map::n_basic_map() const
13015 if (!ptr)
13016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13017 auto saved_ctx = ctx();
13018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13019 auto res = isl_map_n_basic_map(get());
13020 if (res < 0)
13021 exception::throw_last_error(saved_ctx);
13022 return res;
13025 isl::set map::params() const
13027 if (!ptr)
13028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13029 auto saved_ctx = ctx();
13030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13031 auto res = isl_map_params(copy());
13032 if (!res)
13033 exception::throw_last_error(saved_ctx);
13034 return manage(res);
13037 isl::basic_map map::polyhedral_hull() const
13039 if (!ptr)
13040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13041 auto saved_ctx = ctx();
13042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13043 auto res = isl_map_polyhedral_hull(copy());
13044 if (!res)
13045 exception::throw_last_error(saved_ctx);
13046 return manage(res);
13049 isl::map map::preimage_domain(isl::multi_aff ma) const
13051 if (!ptr || ma.is_null())
13052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13053 auto saved_ctx = ctx();
13054 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13055 auto res = isl_map_preimage_domain_multi_aff(copy(), ma.release());
13056 if (!res)
13057 exception::throw_last_error(saved_ctx);
13058 return manage(res);
13061 isl::map map::preimage_domain(isl::multi_pw_aff mpa) const
13063 if (!ptr || mpa.is_null())
13064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13065 auto saved_ctx = ctx();
13066 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13067 auto res = isl_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
13068 if (!res)
13069 exception::throw_last_error(saved_ctx);
13070 return manage(res);
13073 isl::map map::preimage_domain(isl::pw_multi_aff pma) const
13075 if (!ptr || pma.is_null())
13076 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13077 auto saved_ctx = ctx();
13078 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13079 auto res = isl_map_preimage_domain_pw_multi_aff(copy(), pma.release());
13080 if (!res)
13081 exception::throw_last_error(saved_ctx);
13082 return manage(res);
13085 isl::union_map map::preimage_domain(const isl::union_pw_multi_aff &upma) const
13087 if (!ptr)
13088 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13089 return isl::union_map(*this).preimage_domain(upma);
13092 isl::map map::preimage_range(isl::multi_aff ma) const
13094 if (!ptr || ma.is_null())
13095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13096 auto saved_ctx = ctx();
13097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13098 auto res = isl_map_preimage_range_multi_aff(copy(), ma.release());
13099 if (!res)
13100 exception::throw_last_error(saved_ctx);
13101 return manage(res);
13104 isl::map map::preimage_range(isl::pw_multi_aff pma) const
13106 if (!ptr || pma.is_null())
13107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13108 auto saved_ctx = ctx();
13109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13110 auto res = isl_map_preimage_range_pw_multi_aff(copy(), pma.release());
13111 if (!res)
13112 exception::throw_last_error(saved_ctx);
13113 return manage(res);
13116 isl::union_map map::preimage_range(const isl::union_pw_multi_aff &upma) const
13118 if (!ptr)
13119 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13120 return isl::union_map(*this).preimage_range(upma);
13123 isl::map map::product(isl::map map2) const
13125 if (!ptr || map2.is_null())
13126 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13127 auto saved_ctx = ctx();
13128 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13129 auto res = isl_map_product(copy(), map2.release());
13130 if (!res)
13131 exception::throw_last_error(saved_ctx);
13132 return manage(res);
13135 isl::union_map map::product(const isl::union_map &umap2) const
13137 if (!ptr)
13138 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13139 return isl::union_map(*this).product(umap2);
13142 isl::map map::product(const isl::basic_map &map2) const
13144 if (!ptr)
13145 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13146 return this->product(isl::map(map2));
13149 isl::map map::project_out_all_params() const
13151 if (!ptr)
13152 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13153 auto saved_ctx = ctx();
13154 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13155 auto res = isl_map_project_out_all_params(copy());
13156 if (!res)
13157 exception::throw_last_error(saved_ctx);
13158 return manage(res);
13161 isl::map map::project_out_param(isl::id id) const
13163 if (!ptr || id.is_null())
13164 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13165 auto saved_ctx = ctx();
13166 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13167 auto res = isl_map_project_out_param_id(copy(), id.release());
13168 if (!res)
13169 exception::throw_last_error(saved_ctx);
13170 return manage(res);
13173 isl::map map::project_out_param(const std::string &id) const
13175 if (!ptr)
13176 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13177 return this->project_out_param(isl::id(ctx(), id));
13180 isl::map map::project_out_param(isl::id_list list) const
13182 if (!ptr || list.is_null())
13183 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13184 auto saved_ctx = ctx();
13185 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13186 auto res = isl_map_project_out_param_id_list(copy(), list.release());
13187 if (!res)
13188 exception::throw_last_error(saved_ctx);
13189 return manage(res);
13192 isl::set map::range() const
13194 if (!ptr)
13195 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13196 auto saved_ctx = ctx();
13197 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13198 auto res = isl_map_range(copy());
13199 if (!res)
13200 exception::throw_last_error(saved_ctx);
13201 return manage(res);
13204 isl::map map::range_factor_domain() const
13206 if (!ptr)
13207 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13208 auto saved_ctx = ctx();
13209 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13210 auto res = isl_map_range_factor_domain(copy());
13211 if (!res)
13212 exception::throw_last_error(saved_ctx);
13213 return manage(res);
13216 isl::map map::range_factor_range() const
13218 if (!ptr)
13219 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13220 auto saved_ctx = ctx();
13221 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13222 auto res = isl_map_range_factor_range(copy());
13223 if (!res)
13224 exception::throw_last_error(saved_ctx);
13225 return manage(res);
13228 isl::fixed_box map::range_lattice_tile() const
13230 if (!ptr)
13231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13232 auto saved_ctx = ctx();
13233 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13234 auto res = isl_map_get_range_lattice_tile(get());
13235 if (!res)
13236 exception::throw_last_error(saved_ctx);
13237 return manage(res);
13240 isl::fixed_box map::get_range_lattice_tile() const
13242 return range_lattice_tile();
13245 isl::union_map map::range_map() const
13247 if (!ptr)
13248 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13249 return isl::union_map(*this).range_map();
13252 isl::map map::range_product(isl::map map2) const
13254 if (!ptr || map2.is_null())
13255 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13256 auto saved_ctx = ctx();
13257 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13258 auto res = isl_map_range_product(copy(), map2.release());
13259 if (!res)
13260 exception::throw_last_error(saved_ctx);
13261 return manage(res);
13264 isl::union_map map::range_product(const isl::union_map &umap2) const
13266 if (!ptr)
13267 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13268 return isl::union_map(*this).range_product(umap2);
13271 isl::map map::range_product(const isl::basic_map &map2) const
13273 if (!ptr)
13274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13275 return this->range_product(isl::map(map2));
13278 isl::map map::range_reverse() const
13280 if (!ptr)
13281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13282 auto saved_ctx = ctx();
13283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13284 auto res = isl_map_range_reverse(copy());
13285 if (!res)
13286 exception::throw_last_error(saved_ctx);
13287 return manage(res);
13290 isl::fixed_box map::range_simple_fixed_box_hull() const
13292 if (!ptr)
13293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13294 auto saved_ctx = ctx();
13295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13296 auto res = isl_map_get_range_simple_fixed_box_hull(get());
13297 if (!res)
13298 exception::throw_last_error(saved_ctx);
13299 return manage(res);
13302 isl::fixed_box map::get_range_simple_fixed_box_hull() const
13304 return range_simple_fixed_box_hull();
13307 unsigned map::range_tuple_dim() const
13309 if (!ptr)
13310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13311 auto saved_ctx = ctx();
13312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13313 auto res = isl_map_range_tuple_dim(get());
13314 if (res < 0)
13315 exception::throw_last_error(saved_ctx);
13316 return res;
13319 isl::id map::range_tuple_id() const
13321 if (!ptr)
13322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13323 auto saved_ctx = ctx();
13324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13325 auto res = isl_map_get_range_tuple_id(get());
13326 if (!res)
13327 exception::throw_last_error(saved_ctx);
13328 return manage(res);
13331 isl::id map::get_range_tuple_id() const
13333 return range_tuple_id();
13336 isl::map map::reverse() const
13338 if (!ptr)
13339 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13340 auto saved_ctx = ctx();
13341 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13342 auto res = isl_map_reverse(copy());
13343 if (!res)
13344 exception::throw_last_error(saved_ctx);
13345 return manage(res);
13348 isl::basic_map map::sample() const
13350 if (!ptr)
13351 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13352 auto saved_ctx = ctx();
13353 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13354 auto res = isl_map_sample(copy());
13355 if (!res)
13356 exception::throw_last_error(saved_ctx);
13357 return manage(res);
13360 isl::map map::set_domain_tuple(isl::id id) const
13362 if (!ptr || id.is_null())
13363 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13364 auto saved_ctx = ctx();
13365 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13366 auto res = isl_map_set_domain_tuple_id(copy(), id.release());
13367 if (!res)
13368 exception::throw_last_error(saved_ctx);
13369 return manage(res);
13372 isl::map map::set_domain_tuple(const std::string &id) const
13374 if (!ptr)
13375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13376 return this->set_domain_tuple(isl::id(ctx(), id));
13379 isl::map map::set_range_tuple(isl::id id) const
13381 if (!ptr || id.is_null())
13382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13383 auto saved_ctx = ctx();
13384 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13385 auto res = isl_map_set_range_tuple_id(copy(), id.release());
13386 if (!res)
13387 exception::throw_last_error(saved_ctx);
13388 return manage(res);
13391 isl::map map::set_range_tuple(const std::string &id) const
13393 if (!ptr)
13394 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13395 return this->set_range_tuple(isl::id(ctx(), id));
13398 isl::space map::space() const
13400 if (!ptr)
13401 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13402 auto saved_ctx = ctx();
13403 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13404 auto res = isl_map_get_space(get());
13405 if (!res)
13406 exception::throw_last_error(saved_ctx);
13407 return manage(res);
13410 isl::space map::get_space() const
13412 return space();
13415 isl::map map::subtract(isl::map map2) const
13417 if (!ptr || map2.is_null())
13418 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13419 auto saved_ctx = ctx();
13420 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13421 auto res = isl_map_subtract(copy(), map2.release());
13422 if (!res)
13423 exception::throw_last_error(saved_ctx);
13424 return manage(res);
13427 isl::union_map map::subtract(const isl::union_map &umap2) const
13429 if (!ptr)
13430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13431 return isl::union_map(*this).subtract(umap2);
13434 isl::map map::subtract(const isl::basic_map &map2) const
13436 if (!ptr)
13437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13438 return this->subtract(isl::map(map2));
13441 isl::union_map map::subtract_domain(const isl::union_set &dom) const
13443 if (!ptr)
13444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13445 return isl::union_map(*this).subtract_domain(dom);
13448 isl::union_map map::subtract_range(const isl::union_set &dom) const
13450 if (!ptr)
13451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13452 return isl::union_map(*this).subtract_range(dom);
13455 isl::map_list map::to_list() const
13457 if (!ptr)
13458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13459 auto saved_ctx = ctx();
13460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13461 auto res = isl_map_to_list(copy());
13462 if (!res)
13463 exception::throw_last_error(saved_ctx);
13464 return manage(res);
13467 isl::union_map map::to_union_map() const
13469 if (!ptr)
13470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13471 auto saved_ctx = ctx();
13472 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13473 auto res = isl_map_to_union_map(copy());
13474 if (!res)
13475 exception::throw_last_error(saved_ctx);
13476 return manage(res);
13479 isl::map map::uncurry() const
13481 if (!ptr)
13482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13483 auto saved_ctx = ctx();
13484 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13485 auto res = isl_map_uncurry(copy());
13486 if (!res)
13487 exception::throw_last_error(saved_ctx);
13488 return manage(res);
13491 isl::map map::unite(isl::map map2) const
13493 if (!ptr || map2.is_null())
13494 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13495 auto saved_ctx = ctx();
13496 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13497 auto res = isl_map_union(copy(), map2.release());
13498 if (!res)
13499 exception::throw_last_error(saved_ctx);
13500 return manage(res);
13503 isl::union_map map::unite(const isl::union_map &umap2) const
13505 if (!ptr)
13506 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13507 return isl::union_map(*this).unite(umap2);
13510 isl::map map::unite(const isl::basic_map &map2) const
13512 if (!ptr)
13513 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13514 return this->unite(isl::map(map2));
13517 isl::map map::universe(isl::space space)
13519 if (space.is_null())
13520 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13521 auto saved_ctx = space.ctx();
13522 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13523 auto res = isl_map_universe(space.release());
13524 if (!res)
13525 exception::throw_last_error(saved_ctx);
13526 return manage(res);
13529 isl::basic_map map::unshifted_simple_hull() const
13531 if (!ptr)
13532 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13533 auto saved_ctx = ctx();
13534 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13535 auto res = isl_map_unshifted_simple_hull(copy());
13536 if (!res)
13537 exception::throw_last_error(saved_ctx);
13538 return manage(res);
13541 isl::map map::upper_bound(isl::multi_pw_aff upper) const
13543 if (!ptr || upper.is_null())
13544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13545 auto saved_ctx = ctx();
13546 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13547 auto res = isl_map_upper_bound_multi_pw_aff(copy(), upper.release());
13548 if (!res)
13549 exception::throw_last_error(saved_ctx);
13550 return manage(res);
13553 isl::set map::wrap() const
13555 if (!ptr)
13556 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13557 auto saved_ctx = ctx();
13558 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13559 auto res = isl_map_wrap(copy());
13560 if (!res)
13561 exception::throw_last_error(saved_ctx);
13562 return manage(res);
13565 isl::map map::zip() const
13567 if (!ptr)
13568 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13569 auto saved_ctx = ctx();
13570 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13571 auto res = isl_map_zip(copy());
13572 if (!res)
13573 exception::throw_last_error(saved_ctx);
13574 return manage(res);
13577 inline std::ostream &operator<<(std::ostream &os, const map &obj)
13579 if (!obj.get())
13580 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13581 auto saved_ctx = isl_map_get_ctx(obj.get());
13582 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13583 char *str = isl_map_to_str(obj.get());
13584 if (!str)
13585 exception::throw_last_error(saved_ctx);
13586 os << str;
13587 free(str);
13588 return os;
13591 // implementations for isl::map_list
13592 map_list manage(__isl_take isl_map_list *ptr) {
13593 if (!ptr)
13594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13595 return map_list(ptr);
13597 map_list manage_copy(__isl_keep isl_map_list *ptr) {
13598 if (!ptr)
13599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13600 auto saved_ctx = isl_map_list_get_ctx(ptr);
13601 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13602 ptr = isl_map_list_copy(ptr);
13603 if (!ptr)
13604 exception::throw_last_error(saved_ctx);
13605 return map_list(ptr);
13608 map_list::map_list(__isl_take isl_map_list *ptr)
13609 : ptr(ptr) {}
13611 map_list::map_list()
13612 : ptr(nullptr) {}
13614 map_list::map_list(const map_list &obj)
13615 : ptr(nullptr)
13617 if (!obj.ptr)
13618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13619 auto saved_ctx = isl_map_list_get_ctx(obj.ptr);
13620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13621 ptr = obj.copy();
13622 if (!ptr)
13623 exception::throw_last_error(saved_ctx);
13626 map_list::map_list(isl::ctx ctx, int n)
13628 auto saved_ctx = ctx;
13629 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13630 auto res = isl_map_list_alloc(ctx.release(), n);
13631 if (!res)
13632 exception::throw_last_error(saved_ctx);
13633 ptr = res;
13636 map_list::map_list(isl::map el)
13638 if (el.is_null())
13639 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13640 auto saved_ctx = el.ctx();
13641 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13642 auto res = isl_map_list_from_map(el.release());
13643 if (!res)
13644 exception::throw_last_error(saved_ctx);
13645 ptr = res;
13648 map_list::map_list(isl::ctx ctx, const std::string &str)
13650 auto saved_ctx = ctx;
13651 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13652 auto res = isl_map_list_read_from_str(ctx.release(), str.c_str());
13653 if (!res)
13654 exception::throw_last_error(saved_ctx);
13655 ptr = res;
13658 map_list &map_list::operator=(map_list obj) {
13659 std::swap(this->ptr, obj.ptr);
13660 return *this;
13663 map_list::~map_list() {
13664 if (ptr)
13665 isl_map_list_free(ptr);
13668 __isl_give isl_map_list *map_list::copy() const & {
13669 return isl_map_list_copy(ptr);
13672 __isl_keep isl_map_list *map_list::get() const {
13673 return ptr;
13676 __isl_give isl_map_list *map_list::release() {
13677 isl_map_list *tmp = ptr;
13678 ptr = nullptr;
13679 return tmp;
13682 bool map_list::is_null() const {
13683 return ptr == nullptr;
13686 isl::ctx map_list::ctx() const {
13687 return isl::ctx(isl_map_list_get_ctx(ptr));
13690 isl::map_list map_list::add(isl::map el) const
13692 if (!ptr || el.is_null())
13693 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13694 auto saved_ctx = ctx();
13695 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13696 auto res = isl_map_list_add(copy(), el.release());
13697 if (!res)
13698 exception::throw_last_error(saved_ctx);
13699 return manage(res);
13702 isl::map map_list::at(int index) const
13704 if (!ptr)
13705 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13706 auto saved_ctx = ctx();
13707 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13708 auto res = isl_map_list_get_at(get(), index);
13709 if (!res)
13710 exception::throw_last_error(saved_ctx);
13711 return manage(res);
13714 isl::map map_list::get_at(int index) const
13716 return at(index);
13719 isl::map_list map_list::clear() const
13721 if (!ptr)
13722 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13723 auto saved_ctx = ctx();
13724 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13725 auto res = isl_map_list_clear(copy());
13726 if (!res)
13727 exception::throw_last_error(saved_ctx);
13728 return manage(res);
13731 isl::map_list map_list::concat(isl::map_list list2) const
13733 if (!ptr || list2.is_null())
13734 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13735 auto saved_ctx = ctx();
13736 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13737 auto res = isl_map_list_concat(copy(), list2.release());
13738 if (!res)
13739 exception::throw_last_error(saved_ctx);
13740 return manage(res);
13743 isl::map_list map_list::drop(unsigned int first, unsigned int n) const
13745 if (!ptr)
13746 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13747 auto saved_ctx = ctx();
13748 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13749 auto res = isl_map_list_drop(copy(), first, n);
13750 if (!res)
13751 exception::throw_last_error(saved_ctx);
13752 return manage(res);
13755 void map_list::foreach(const std::function<void(isl::map)> &fn) const
13757 if (!ptr)
13758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13759 auto saved_ctx = ctx();
13760 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13761 struct fn_data {
13762 std::function<void(isl::map)> func;
13763 std::exception_ptr eptr;
13764 } fn_data = { fn };
13765 auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
13766 auto *data = static_cast<struct fn_data *>(arg_1);
13767 ISL_CPP_TRY {
13768 (data->func)(manage(arg_0));
13769 return isl_stat_ok;
13770 } ISL_CPP_CATCH_ALL {
13771 data->eptr = std::current_exception();
13772 return isl_stat_error;
13775 auto res = isl_map_list_foreach(get(), fn_lambda, &fn_data);
13776 if (fn_data.eptr)
13777 std::rethrow_exception(fn_data.eptr);
13778 if (res < 0)
13779 exception::throw_last_error(saved_ctx);
13780 return;
13783 void map_list::foreach_scc(const std::function<bool(isl::map, isl::map)> &follows, const std::function<void(isl::map_list)> &fn) const
13785 if (!ptr)
13786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13787 auto saved_ctx = ctx();
13788 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13789 struct follows_data {
13790 std::function<bool(isl::map, isl::map)> func;
13791 std::exception_ptr eptr;
13792 } follows_data = { follows };
13793 auto follows_lambda = [](isl_map *arg_0, isl_map *arg_1, void *arg_2) -> isl_bool {
13794 auto *data = static_cast<struct follows_data *>(arg_2);
13795 ISL_CPP_TRY {
13796 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
13797 return ret ? isl_bool_true : isl_bool_false;
13798 } ISL_CPP_CATCH_ALL {
13799 data->eptr = std::current_exception();
13800 return isl_bool_error;
13803 struct fn_data {
13804 std::function<void(isl::map_list)> func;
13805 std::exception_ptr eptr;
13806 } fn_data = { fn };
13807 auto fn_lambda = [](isl_map_list *arg_0, void *arg_1) -> isl_stat {
13808 auto *data = static_cast<struct fn_data *>(arg_1);
13809 ISL_CPP_TRY {
13810 (data->func)(manage(arg_0));
13811 return isl_stat_ok;
13812 } ISL_CPP_CATCH_ALL {
13813 data->eptr = std::current_exception();
13814 return isl_stat_error;
13817 auto res = isl_map_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
13818 if (follows_data.eptr)
13819 std::rethrow_exception(follows_data.eptr);
13820 if (fn_data.eptr)
13821 std::rethrow_exception(fn_data.eptr);
13822 if (res < 0)
13823 exception::throw_last_error(saved_ctx);
13824 return;
13827 isl::map_list map_list::insert(unsigned int pos, isl::map el) const
13829 if (!ptr || el.is_null())
13830 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13831 auto saved_ctx = ctx();
13832 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13833 auto res = isl_map_list_insert(copy(), pos, el.release());
13834 if (!res)
13835 exception::throw_last_error(saved_ctx);
13836 return manage(res);
13839 isl::map_list map_list::set_at(int index, isl::map el) const
13841 if (!ptr || el.is_null())
13842 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13843 auto saved_ctx = ctx();
13844 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13845 auto res = isl_map_list_set_at(copy(), index, el.release());
13846 if (!res)
13847 exception::throw_last_error(saved_ctx);
13848 return manage(res);
13851 unsigned map_list::size() const
13853 if (!ptr)
13854 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13855 auto saved_ctx = ctx();
13856 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13857 auto res = isl_map_list_size(get());
13858 if (res < 0)
13859 exception::throw_last_error(saved_ctx);
13860 return res;
13863 inline std::ostream &operator<<(std::ostream &os, const map_list &obj)
13865 if (!obj.get())
13866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13867 auto saved_ctx = isl_map_list_get_ctx(obj.get());
13868 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13869 char *str = isl_map_list_to_str(obj.get());
13870 if (!str)
13871 exception::throw_last_error(saved_ctx);
13872 os << str;
13873 free(str);
13874 return os;
13877 // implementations for isl::multi_aff
13878 multi_aff manage(__isl_take isl_multi_aff *ptr) {
13879 if (!ptr)
13880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13881 return multi_aff(ptr);
13883 multi_aff manage_copy(__isl_keep isl_multi_aff *ptr) {
13884 if (!ptr)
13885 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13886 auto saved_ctx = isl_multi_aff_get_ctx(ptr);
13887 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13888 ptr = isl_multi_aff_copy(ptr);
13889 if (!ptr)
13890 exception::throw_last_error(saved_ctx);
13891 return multi_aff(ptr);
13894 multi_aff::multi_aff(__isl_take isl_multi_aff *ptr)
13895 : ptr(ptr) {}
13897 multi_aff::multi_aff()
13898 : ptr(nullptr) {}
13900 multi_aff::multi_aff(const multi_aff &obj)
13901 : ptr(nullptr)
13903 if (!obj.ptr)
13904 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13905 auto saved_ctx = isl_multi_aff_get_ctx(obj.ptr);
13906 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13907 ptr = obj.copy();
13908 if (!ptr)
13909 exception::throw_last_error(saved_ctx);
13912 multi_aff::multi_aff(isl::aff aff)
13914 if (aff.is_null())
13915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13916 auto saved_ctx = aff.ctx();
13917 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13918 auto res = isl_multi_aff_from_aff(aff.release());
13919 if (!res)
13920 exception::throw_last_error(saved_ctx);
13921 ptr = res;
13924 multi_aff::multi_aff(isl::space space, isl::aff_list list)
13926 if (space.is_null() || list.is_null())
13927 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13928 auto saved_ctx = space.ctx();
13929 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13930 auto res = isl_multi_aff_from_aff_list(space.release(), list.release());
13931 if (!res)
13932 exception::throw_last_error(saved_ctx);
13933 ptr = res;
13936 multi_aff::multi_aff(isl::ctx ctx, const std::string &str)
13938 auto saved_ctx = ctx;
13939 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13940 auto res = isl_multi_aff_read_from_str(ctx.release(), str.c_str());
13941 if (!res)
13942 exception::throw_last_error(saved_ctx);
13943 ptr = res;
13946 multi_aff &multi_aff::operator=(multi_aff obj) {
13947 std::swap(this->ptr, obj.ptr);
13948 return *this;
13951 multi_aff::~multi_aff() {
13952 if (ptr)
13953 isl_multi_aff_free(ptr);
13956 __isl_give isl_multi_aff *multi_aff::copy() const & {
13957 return isl_multi_aff_copy(ptr);
13960 __isl_keep isl_multi_aff *multi_aff::get() const {
13961 return ptr;
13964 __isl_give isl_multi_aff *multi_aff::release() {
13965 isl_multi_aff *tmp = ptr;
13966 ptr = nullptr;
13967 return tmp;
13970 bool multi_aff::is_null() const {
13971 return ptr == nullptr;
13974 isl::ctx multi_aff::ctx() const {
13975 return isl::ctx(isl_multi_aff_get_ctx(ptr));
13978 isl::multi_aff multi_aff::add(isl::multi_aff multi2) const
13980 if (!ptr || multi2.is_null())
13981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13982 auto saved_ctx = ctx();
13983 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13984 auto res = isl_multi_aff_add(copy(), multi2.release());
13985 if (!res)
13986 exception::throw_last_error(saved_ctx);
13987 return manage(res);
13990 isl::multi_pw_aff multi_aff::add(const isl::multi_pw_aff &multi2) const
13992 if (!ptr)
13993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13994 return isl::pw_multi_aff(*this).add(multi2);
13997 isl::multi_union_pw_aff multi_aff::add(const isl::multi_union_pw_aff &multi2) const
13999 if (!ptr)
14000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14001 return isl::pw_multi_aff(*this).add(multi2);
14004 isl::pw_multi_aff multi_aff::add(const isl::pw_multi_aff &pma2) const
14006 if (!ptr)
14007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14008 return isl::pw_multi_aff(*this).add(pma2);
14011 isl::union_pw_multi_aff multi_aff::add(const isl::union_pw_multi_aff &upma2) const
14013 if (!ptr)
14014 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14015 return isl::pw_multi_aff(*this).add(upma2);
14018 isl::multi_aff multi_aff::add(const isl::aff &multi2) const
14020 if (!ptr)
14021 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14022 return this->add(isl::multi_aff(multi2));
14025 isl::multi_aff multi_aff::add_constant(isl::multi_val mv) const
14027 if (!ptr || mv.is_null())
14028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14029 auto saved_ctx = ctx();
14030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14031 auto res = isl_multi_aff_add_constant_multi_val(copy(), mv.release());
14032 if (!res)
14033 exception::throw_last_error(saved_ctx);
14034 return manage(res);
14037 isl::multi_aff multi_aff::add_constant(isl::val v) const
14039 if (!ptr || v.is_null())
14040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14041 auto saved_ctx = ctx();
14042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14043 auto res = isl_multi_aff_add_constant_val(copy(), v.release());
14044 if (!res)
14045 exception::throw_last_error(saved_ctx);
14046 return manage(res);
14049 isl::multi_aff multi_aff::add_constant(long v) const
14051 if (!ptr)
14052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14053 return this->add_constant(isl::val(ctx(), v));
14056 isl::union_pw_multi_aff multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
14058 if (!ptr)
14059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14060 return isl::pw_multi_aff(*this).apply(upma2);
14063 isl::map multi_aff::as_map() const
14065 if (!ptr)
14066 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14067 auto saved_ctx = ctx();
14068 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14069 auto res = isl_multi_aff_as_map(copy());
14070 if (!res)
14071 exception::throw_last_error(saved_ctx);
14072 return manage(res);
14075 isl::multi_aff multi_aff::as_multi_aff() const
14077 if (!ptr)
14078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14079 return isl::pw_multi_aff(*this).as_multi_aff();
14082 isl::multi_union_pw_aff multi_aff::as_multi_union_pw_aff() const
14084 if (!ptr)
14085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14086 return isl::pw_multi_aff(*this).as_multi_union_pw_aff();
14089 isl::pw_multi_aff multi_aff::as_pw_multi_aff() const
14091 if (!ptr)
14092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14093 return isl::pw_multi_aff(*this).as_pw_multi_aff();
14096 isl::set multi_aff::as_set() const
14098 if (!ptr)
14099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14100 auto saved_ctx = ctx();
14101 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14102 auto res = isl_multi_aff_as_set(copy());
14103 if (!res)
14104 exception::throw_last_error(saved_ctx);
14105 return manage(res);
14108 isl::union_map multi_aff::as_union_map() const
14110 if (!ptr)
14111 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14112 return isl::pw_multi_aff(*this).as_union_map();
14115 isl::aff multi_aff::at(int pos) const
14117 if (!ptr)
14118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14119 auto saved_ctx = ctx();
14120 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14121 auto res = isl_multi_aff_get_at(get(), pos);
14122 if (!res)
14123 exception::throw_last_error(saved_ctx);
14124 return manage(res);
14127 isl::aff multi_aff::get_at(int pos) const
14129 return at(pos);
14132 isl::basic_set multi_aff::bind(isl::multi_id tuple) const
14134 if (!ptr || tuple.is_null())
14135 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14136 auto saved_ctx = ctx();
14137 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14138 auto res = isl_multi_aff_bind(copy(), tuple.release());
14139 if (!res)
14140 exception::throw_last_error(saved_ctx);
14141 return manage(res);
14144 isl::multi_aff multi_aff::bind_domain(isl::multi_id tuple) const
14146 if (!ptr || tuple.is_null())
14147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14148 auto saved_ctx = ctx();
14149 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14150 auto res = isl_multi_aff_bind_domain(copy(), tuple.release());
14151 if (!res)
14152 exception::throw_last_error(saved_ctx);
14153 return manage(res);
14156 isl::multi_aff multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
14158 if (!ptr || tuple.is_null())
14159 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14160 auto saved_ctx = ctx();
14161 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14162 auto res = isl_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
14163 if (!res)
14164 exception::throw_last_error(saved_ctx);
14165 return manage(res);
14168 isl::pw_multi_aff multi_aff::coalesce() const
14170 if (!ptr)
14171 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14172 return isl::pw_multi_aff(*this).coalesce();
14175 isl::multi_val multi_aff::constant_multi_val() const
14177 if (!ptr)
14178 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14179 auto saved_ctx = ctx();
14180 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14181 auto res = isl_multi_aff_get_constant_multi_val(get());
14182 if (!res)
14183 exception::throw_last_error(saved_ctx);
14184 return manage(res);
14187 isl::multi_val multi_aff::get_constant_multi_val() const
14189 return constant_multi_val();
14192 isl::set multi_aff::domain() const
14194 if (!ptr)
14195 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14196 return isl::pw_multi_aff(*this).domain();
14199 isl::multi_aff multi_aff::domain_map(isl::space space)
14201 if (space.is_null())
14202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14203 auto saved_ctx = space.ctx();
14204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14205 auto res = isl_multi_aff_domain_map(space.release());
14206 if (!res)
14207 exception::throw_last_error(saved_ctx);
14208 return manage(res);
14211 isl::multi_aff multi_aff::domain_reverse() const
14213 if (!ptr)
14214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14215 auto saved_ctx = ctx();
14216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14217 auto res = isl_multi_aff_domain_reverse(copy());
14218 if (!res)
14219 exception::throw_last_error(saved_ctx);
14220 return manage(res);
14223 isl::pw_multi_aff multi_aff::drop_unused_params() const
14225 if (!ptr)
14226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14227 return isl::pw_multi_aff(*this).drop_unused_params();
14230 isl::pw_multi_aff multi_aff::extract_pw_multi_aff(const isl::space &space) const
14232 if (!ptr)
14233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14234 return isl::pw_multi_aff(*this).extract_pw_multi_aff(space);
14237 isl::multi_aff multi_aff::flat_range_product(isl::multi_aff multi2) const
14239 if (!ptr || multi2.is_null())
14240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14241 auto saved_ctx = ctx();
14242 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14243 auto res = isl_multi_aff_flat_range_product(copy(), multi2.release());
14244 if (!res)
14245 exception::throw_last_error(saved_ctx);
14246 return manage(res);
14249 isl::multi_pw_aff multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
14251 if (!ptr)
14252 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14253 return isl::pw_multi_aff(*this).flat_range_product(multi2);
14256 isl::multi_union_pw_aff multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
14258 if (!ptr)
14259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14260 return isl::pw_multi_aff(*this).flat_range_product(multi2);
14263 isl::pw_multi_aff multi_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
14265 if (!ptr)
14266 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14267 return isl::pw_multi_aff(*this).flat_range_product(pma2);
14270 isl::union_pw_multi_aff multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
14272 if (!ptr)
14273 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14274 return isl::pw_multi_aff(*this).flat_range_product(upma2);
14277 isl::multi_aff multi_aff::flat_range_product(const isl::aff &multi2) const
14279 if (!ptr)
14280 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14281 return this->flat_range_product(isl::multi_aff(multi2));
14284 isl::multi_aff multi_aff::floor() const
14286 if (!ptr)
14287 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14288 auto saved_ctx = ctx();
14289 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14290 auto res = isl_multi_aff_floor(copy());
14291 if (!res)
14292 exception::throw_last_error(saved_ctx);
14293 return manage(res);
14296 void multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
14298 if (!ptr)
14299 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14300 return isl::pw_multi_aff(*this).foreach_piece(fn);
14303 isl::multi_aff multi_aff::gist(isl::set context) const
14305 if (!ptr || context.is_null())
14306 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14307 auto saved_ctx = ctx();
14308 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14309 auto res = isl_multi_aff_gist(copy(), context.release());
14310 if (!res)
14311 exception::throw_last_error(saved_ctx);
14312 return manage(res);
14315 isl::union_pw_multi_aff multi_aff::gist(const isl::union_set &context) const
14317 if (!ptr)
14318 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14319 return isl::pw_multi_aff(*this).gist(context);
14322 isl::multi_aff multi_aff::gist(const isl::basic_set &context) const
14324 if (!ptr)
14325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14326 return this->gist(isl::set(context));
14329 isl::multi_aff multi_aff::gist(const isl::point &context) const
14331 if (!ptr)
14332 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14333 return this->gist(isl::set(context));
14336 isl::multi_aff multi_aff::gist_params(isl::set context) const
14338 if (!ptr || context.is_null())
14339 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14340 auto saved_ctx = ctx();
14341 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14342 auto res = isl_multi_aff_gist_params(copy(), context.release());
14343 if (!res)
14344 exception::throw_last_error(saved_ctx);
14345 return manage(res);
14348 bool multi_aff::has_range_tuple_id() const
14350 if (!ptr)
14351 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14352 auto saved_ctx = ctx();
14353 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14354 auto res = isl_multi_aff_has_range_tuple_id(get());
14355 if (res < 0)
14356 exception::throw_last_error(saved_ctx);
14357 return res;
14360 isl::multi_aff multi_aff::identity() const
14362 if (!ptr)
14363 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14364 auto saved_ctx = ctx();
14365 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14366 auto res = isl_multi_aff_identity_multi_aff(copy());
14367 if (!res)
14368 exception::throw_last_error(saved_ctx);
14369 return manage(res);
14372 isl::multi_aff multi_aff::identity_on_domain(isl::space space)
14374 if (space.is_null())
14375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14376 auto saved_ctx = space.ctx();
14377 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14378 auto res = isl_multi_aff_identity_on_domain_space(space.release());
14379 if (!res)
14380 exception::throw_last_error(saved_ctx);
14381 return manage(res);
14384 isl::multi_aff multi_aff::insert_domain(isl::space domain) const
14386 if (!ptr || domain.is_null())
14387 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14388 auto saved_ctx = ctx();
14389 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14390 auto res = isl_multi_aff_insert_domain(copy(), domain.release());
14391 if (!res)
14392 exception::throw_last_error(saved_ctx);
14393 return manage(res);
14396 isl::pw_multi_aff multi_aff::intersect_domain(const isl::set &set) const
14398 if (!ptr)
14399 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14400 return isl::pw_multi_aff(*this).intersect_domain(set);
14403 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::space &space) const
14405 if (!ptr)
14406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14407 return isl::pw_multi_aff(*this).intersect_domain(space);
14410 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::union_set &uset) const
14412 if (!ptr)
14413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14414 return isl::pw_multi_aff(*this).intersect_domain(uset);
14417 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
14419 if (!ptr)
14420 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14421 return isl::pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
14424 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
14426 if (!ptr)
14427 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14428 return isl::pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
14431 isl::pw_multi_aff multi_aff::intersect_params(const isl::set &set) const
14433 if (!ptr)
14434 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14435 return isl::pw_multi_aff(*this).intersect_params(set);
14438 bool multi_aff::involves_locals() const
14440 if (!ptr)
14441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14442 auto saved_ctx = ctx();
14443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14444 auto res = isl_multi_aff_involves_locals(get());
14445 if (res < 0)
14446 exception::throw_last_error(saved_ctx);
14447 return res;
14450 bool multi_aff::involves_nan() const
14452 if (!ptr)
14453 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14454 auto saved_ctx = ctx();
14455 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14456 auto res = isl_multi_aff_involves_nan(get());
14457 if (res < 0)
14458 exception::throw_last_error(saved_ctx);
14459 return res;
14462 bool multi_aff::involves_param(const isl::id &id) const
14464 if (!ptr)
14465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14466 return isl::pw_multi_aff(*this).involves_param(id);
14469 bool multi_aff::involves_param(const std::string &id) const
14471 if (!ptr)
14472 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14473 return this->involves_param(isl::id(ctx(), id));
14476 bool multi_aff::involves_param(const isl::id_list &list) const
14478 if (!ptr)
14479 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14480 return isl::pw_multi_aff(*this).involves_param(list);
14483 bool multi_aff::isa_multi_aff() const
14485 if (!ptr)
14486 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14487 return isl::pw_multi_aff(*this).isa_multi_aff();
14490 bool multi_aff::isa_pw_multi_aff() const
14492 if (!ptr)
14493 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14494 return isl::pw_multi_aff(*this).isa_pw_multi_aff();
14497 isl::aff_list multi_aff::list() const
14499 if (!ptr)
14500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14501 auto saved_ctx = ctx();
14502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14503 auto res = isl_multi_aff_get_list(get());
14504 if (!res)
14505 exception::throw_last_error(saved_ctx);
14506 return manage(res);
14509 isl::aff_list multi_aff::get_list() const
14511 return list();
14514 isl::multi_pw_aff multi_aff::max(const isl::multi_pw_aff &multi2) const
14516 if (!ptr)
14517 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14518 return isl::pw_multi_aff(*this).max(multi2);
14521 isl::multi_val multi_aff::max_multi_val() const
14523 if (!ptr)
14524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14525 return isl::pw_multi_aff(*this).max_multi_val();
14528 isl::multi_pw_aff multi_aff::min(const isl::multi_pw_aff &multi2) const
14530 if (!ptr)
14531 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14532 return isl::pw_multi_aff(*this).min(multi2);
14535 isl::multi_val multi_aff::min_multi_val() const
14537 if (!ptr)
14538 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14539 return isl::pw_multi_aff(*this).min_multi_val();
14542 isl::multi_aff multi_aff::multi_val_on_domain(isl::space space, isl::multi_val mv)
14544 if (space.is_null() || mv.is_null())
14545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14546 auto saved_ctx = space.ctx();
14547 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14548 auto res = isl_multi_aff_multi_val_on_domain_space(space.release(), mv.release());
14549 if (!res)
14550 exception::throw_last_error(saved_ctx);
14551 return manage(res);
14554 unsigned multi_aff::n_piece() const
14556 if (!ptr)
14557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14558 return isl::pw_multi_aff(*this).n_piece();
14561 isl::multi_aff multi_aff::neg() const
14563 if (!ptr)
14564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14565 auto saved_ctx = ctx();
14566 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14567 auto res = isl_multi_aff_neg(copy());
14568 if (!res)
14569 exception::throw_last_error(saved_ctx);
14570 return manage(res);
14573 bool multi_aff::plain_is_empty() const
14575 if (!ptr)
14576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14577 return isl::pw_multi_aff(*this).plain_is_empty();
14580 bool multi_aff::plain_is_equal(const isl::multi_aff &multi2) const
14582 if (!ptr || multi2.is_null())
14583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14584 auto saved_ctx = ctx();
14585 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14586 auto res = isl_multi_aff_plain_is_equal(get(), multi2.get());
14587 if (res < 0)
14588 exception::throw_last_error(saved_ctx);
14589 return res;
14592 bool multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
14594 if (!ptr)
14595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14596 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14599 bool multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
14601 if (!ptr)
14602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14603 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14606 bool multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
14608 if (!ptr)
14609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14610 return isl::pw_multi_aff(*this).plain_is_equal(pma2);
14613 bool multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
14615 if (!ptr)
14616 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14617 return isl::pw_multi_aff(*this).plain_is_equal(upma2);
14620 bool multi_aff::plain_is_equal(const isl::aff &multi2) const
14622 if (!ptr)
14623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14624 return this->plain_is_equal(isl::multi_aff(multi2));
14627 isl::pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
14629 if (!ptr)
14630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14631 return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
14634 isl::union_pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
14636 if (!ptr)
14637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14638 return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
14641 isl::multi_aff multi_aff::product(isl::multi_aff multi2) const
14643 if (!ptr || multi2.is_null())
14644 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14645 auto saved_ctx = ctx();
14646 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14647 auto res = isl_multi_aff_product(copy(), multi2.release());
14648 if (!res)
14649 exception::throw_last_error(saved_ctx);
14650 return manage(res);
14653 isl::multi_pw_aff multi_aff::product(const isl::multi_pw_aff &multi2) const
14655 if (!ptr)
14656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14657 return isl::pw_multi_aff(*this).product(multi2);
14660 isl::pw_multi_aff multi_aff::product(const isl::pw_multi_aff &pma2) const
14662 if (!ptr)
14663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14664 return isl::pw_multi_aff(*this).product(pma2);
14667 isl::multi_aff multi_aff::product(const isl::aff &multi2) const
14669 if (!ptr)
14670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14671 return this->product(isl::multi_aff(multi2));
14674 isl::multi_aff multi_aff::pullback(isl::multi_aff ma2) const
14676 if (!ptr || ma2.is_null())
14677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14678 auto saved_ctx = ctx();
14679 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14680 auto res = isl_multi_aff_pullback_multi_aff(copy(), ma2.release());
14681 if (!res)
14682 exception::throw_last_error(saved_ctx);
14683 return manage(res);
14686 isl::multi_pw_aff multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
14688 if (!ptr)
14689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14690 return isl::pw_multi_aff(*this).pullback(mpa2);
14693 isl::pw_multi_aff multi_aff::pullback(const isl::pw_multi_aff &pma2) const
14695 if (!ptr)
14696 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14697 return isl::pw_multi_aff(*this).pullback(pma2);
14700 isl::union_pw_multi_aff multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
14702 if (!ptr)
14703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14704 return isl::pw_multi_aff(*this).pullback(upma2);
14707 isl::multi_aff multi_aff::pullback(const isl::aff &ma2) const
14709 if (!ptr)
14710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14711 return this->pullback(isl::multi_aff(ma2));
14714 isl::pw_multi_aff_list multi_aff::pw_multi_aff_list() const
14716 if (!ptr)
14717 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14718 return isl::pw_multi_aff(*this).pw_multi_aff_list();
14721 isl::pw_multi_aff multi_aff::range_factor_domain() const
14723 if (!ptr)
14724 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14725 return isl::pw_multi_aff(*this).range_factor_domain();
14728 isl::pw_multi_aff multi_aff::range_factor_range() const
14730 if (!ptr)
14731 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14732 return isl::pw_multi_aff(*this).range_factor_range();
14735 isl::multi_aff multi_aff::range_map(isl::space space)
14737 if (space.is_null())
14738 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14739 auto saved_ctx = space.ctx();
14740 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14741 auto res = isl_multi_aff_range_map(space.release());
14742 if (!res)
14743 exception::throw_last_error(saved_ctx);
14744 return manage(res);
14747 isl::multi_aff multi_aff::range_product(isl::multi_aff multi2) const
14749 if (!ptr || multi2.is_null())
14750 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14751 auto saved_ctx = ctx();
14752 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14753 auto res = isl_multi_aff_range_product(copy(), multi2.release());
14754 if (!res)
14755 exception::throw_last_error(saved_ctx);
14756 return manage(res);
14759 isl::multi_pw_aff multi_aff::range_product(const isl::multi_pw_aff &multi2) const
14761 if (!ptr)
14762 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14763 return isl::pw_multi_aff(*this).range_product(multi2);
14766 isl::multi_union_pw_aff multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
14768 if (!ptr)
14769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14770 return isl::pw_multi_aff(*this).range_product(multi2);
14773 isl::pw_multi_aff multi_aff::range_product(const isl::pw_multi_aff &pma2) const
14775 if (!ptr)
14776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14777 return isl::pw_multi_aff(*this).range_product(pma2);
14780 isl::union_pw_multi_aff multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
14782 if (!ptr)
14783 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14784 return isl::pw_multi_aff(*this).range_product(upma2);
14787 isl::multi_aff multi_aff::range_product(const isl::aff &multi2) const
14789 if (!ptr)
14790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14791 return this->range_product(isl::multi_aff(multi2));
14794 isl::id multi_aff::range_tuple_id() const
14796 if (!ptr)
14797 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14798 auto saved_ctx = ctx();
14799 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14800 auto res = isl_multi_aff_get_range_tuple_id(get());
14801 if (!res)
14802 exception::throw_last_error(saved_ctx);
14803 return manage(res);
14806 isl::id multi_aff::get_range_tuple_id() const
14808 return range_tuple_id();
14811 isl::multi_aff multi_aff::reset_range_tuple_id() const
14813 if (!ptr)
14814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14815 auto saved_ctx = ctx();
14816 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14817 auto res = isl_multi_aff_reset_range_tuple_id(copy());
14818 if (!res)
14819 exception::throw_last_error(saved_ctx);
14820 return manage(res);
14823 isl::multi_aff multi_aff::scale(isl::multi_val mv) const
14825 if (!ptr || mv.is_null())
14826 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14827 auto saved_ctx = ctx();
14828 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14829 auto res = isl_multi_aff_scale_multi_val(copy(), mv.release());
14830 if (!res)
14831 exception::throw_last_error(saved_ctx);
14832 return manage(res);
14835 isl::multi_aff multi_aff::scale(isl::val v) const
14837 if (!ptr || v.is_null())
14838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14839 auto saved_ctx = ctx();
14840 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14841 auto res = isl_multi_aff_scale_val(copy(), v.release());
14842 if (!res)
14843 exception::throw_last_error(saved_ctx);
14844 return manage(res);
14847 isl::multi_aff multi_aff::scale(long v) const
14849 if (!ptr)
14850 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14851 return this->scale(isl::val(ctx(), v));
14854 isl::multi_aff multi_aff::scale_down(isl::multi_val mv) const
14856 if (!ptr || mv.is_null())
14857 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14858 auto saved_ctx = ctx();
14859 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14860 auto res = isl_multi_aff_scale_down_multi_val(copy(), mv.release());
14861 if (!res)
14862 exception::throw_last_error(saved_ctx);
14863 return manage(res);
14866 isl::multi_aff multi_aff::scale_down(isl::val v) const
14868 if (!ptr || v.is_null())
14869 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14870 auto saved_ctx = ctx();
14871 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14872 auto res = isl_multi_aff_scale_down_val(copy(), v.release());
14873 if (!res)
14874 exception::throw_last_error(saved_ctx);
14875 return manage(res);
14878 isl::multi_aff multi_aff::scale_down(long v) const
14880 if (!ptr)
14881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14882 return this->scale_down(isl::val(ctx(), v));
14885 isl::multi_aff multi_aff::set_at(int pos, isl::aff el) const
14887 if (!ptr || el.is_null())
14888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14889 auto saved_ctx = ctx();
14890 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14891 auto res = isl_multi_aff_set_at(copy(), pos, el.release());
14892 if (!res)
14893 exception::throw_last_error(saved_ctx);
14894 return manage(res);
14897 isl::multi_pw_aff multi_aff::set_at(int pos, const isl::pw_aff &el) const
14899 if (!ptr)
14900 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14901 return isl::pw_multi_aff(*this).set_at(pos, el);
14904 isl::multi_union_pw_aff multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
14906 if (!ptr)
14907 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14908 return isl::pw_multi_aff(*this).set_at(pos, el);
14911 isl::multi_aff multi_aff::set_range_tuple(isl::id id) const
14913 if (!ptr || id.is_null())
14914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14915 auto saved_ctx = ctx();
14916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14917 auto res = isl_multi_aff_set_range_tuple_id(copy(), id.release());
14918 if (!res)
14919 exception::throw_last_error(saved_ctx);
14920 return manage(res);
14923 isl::multi_aff multi_aff::set_range_tuple(const std::string &id) const
14925 if (!ptr)
14926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14927 return this->set_range_tuple(isl::id(ctx(), id));
14930 unsigned multi_aff::size() const
14932 if (!ptr)
14933 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14934 auto saved_ctx = ctx();
14935 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14936 auto res = isl_multi_aff_size(get());
14937 if (res < 0)
14938 exception::throw_last_error(saved_ctx);
14939 return res;
14942 isl::space multi_aff::space() const
14944 if (!ptr)
14945 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14946 auto saved_ctx = ctx();
14947 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14948 auto res = isl_multi_aff_get_space(get());
14949 if (!res)
14950 exception::throw_last_error(saved_ctx);
14951 return manage(res);
14954 isl::space multi_aff::get_space() const
14956 return space();
14959 isl::multi_aff multi_aff::sub(isl::multi_aff multi2) const
14961 if (!ptr || multi2.is_null())
14962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14963 auto saved_ctx = ctx();
14964 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14965 auto res = isl_multi_aff_sub(copy(), multi2.release());
14966 if (!res)
14967 exception::throw_last_error(saved_ctx);
14968 return manage(res);
14971 isl::multi_pw_aff multi_aff::sub(const isl::multi_pw_aff &multi2) const
14973 if (!ptr)
14974 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14975 return isl::pw_multi_aff(*this).sub(multi2);
14978 isl::multi_union_pw_aff multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
14980 if (!ptr)
14981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14982 return isl::pw_multi_aff(*this).sub(multi2);
14985 isl::pw_multi_aff multi_aff::sub(const isl::pw_multi_aff &pma2) const
14987 if (!ptr)
14988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14989 return isl::pw_multi_aff(*this).sub(pma2);
14992 isl::union_pw_multi_aff multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
14994 if (!ptr)
14995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14996 return isl::pw_multi_aff(*this).sub(upma2);
14999 isl::multi_aff multi_aff::sub(const isl::aff &multi2) const
15001 if (!ptr)
15002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15003 return this->sub(isl::multi_aff(multi2));
15006 isl::pw_multi_aff multi_aff::subtract_domain(const isl::set &set) const
15008 if (!ptr)
15009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15010 return isl::pw_multi_aff(*this).subtract_domain(set);
15013 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::space &space) const
15015 if (!ptr)
15016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15017 return isl::pw_multi_aff(*this).subtract_domain(space);
15020 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::union_set &uset) const
15022 if (!ptr)
15023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15024 return isl::pw_multi_aff(*this).subtract_domain(uset);
15027 isl::pw_multi_aff_list multi_aff::to_list() const
15029 if (!ptr)
15030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15031 return isl::pw_multi_aff(*this).to_list();
15034 isl::multi_pw_aff multi_aff::to_multi_pw_aff() const
15036 if (!ptr)
15037 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15038 auto saved_ctx = ctx();
15039 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15040 auto res = isl_multi_aff_to_multi_pw_aff(copy());
15041 if (!res)
15042 exception::throw_last_error(saved_ctx);
15043 return manage(res);
15046 isl::multi_union_pw_aff multi_aff::to_multi_union_pw_aff() const
15048 if (!ptr)
15049 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15050 auto saved_ctx = ctx();
15051 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15052 auto res = isl_multi_aff_to_multi_union_pw_aff(copy());
15053 if (!res)
15054 exception::throw_last_error(saved_ctx);
15055 return manage(res);
15058 isl::pw_multi_aff multi_aff::to_pw_multi_aff() const
15060 if (!ptr)
15061 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15062 auto saved_ctx = ctx();
15063 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15064 auto res = isl_multi_aff_to_pw_multi_aff(copy());
15065 if (!res)
15066 exception::throw_last_error(saved_ctx);
15067 return manage(res);
15070 isl::union_pw_multi_aff multi_aff::to_union_pw_multi_aff() const
15072 if (!ptr)
15073 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15074 return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
15077 isl::multi_aff multi_aff::unbind_params_insert_domain(isl::multi_id domain) const
15079 if (!ptr || domain.is_null())
15080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15081 auto saved_ctx = ctx();
15082 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15083 auto res = isl_multi_aff_unbind_params_insert_domain(copy(), domain.release());
15084 if (!res)
15085 exception::throw_last_error(saved_ctx);
15086 return manage(res);
15089 isl::multi_pw_aff multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
15091 if (!ptr)
15092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15093 return isl::pw_multi_aff(*this).union_add(mpa2);
15096 isl::multi_union_pw_aff multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
15098 if (!ptr)
15099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15100 return isl::pw_multi_aff(*this).union_add(mupa2);
15103 isl::pw_multi_aff multi_aff::union_add(const isl::pw_multi_aff &pma2) const
15105 if (!ptr)
15106 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15107 return isl::pw_multi_aff(*this).union_add(pma2);
15110 isl::union_pw_multi_aff multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
15112 if (!ptr)
15113 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15114 return isl::pw_multi_aff(*this).union_add(upma2);
15117 isl::multi_aff multi_aff::zero(isl::space space)
15119 if (space.is_null())
15120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15121 auto saved_ctx = space.ctx();
15122 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15123 auto res = isl_multi_aff_zero(space.release());
15124 if (!res)
15125 exception::throw_last_error(saved_ctx);
15126 return manage(res);
15129 inline std::ostream &operator<<(std::ostream &os, const multi_aff &obj)
15131 if (!obj.get())
15132 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15133 auto saved_ctx = isl_multi_aff_get_ctx(obj.get());
15134 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15135 char *str = isl_multi_aff_to_str(obj.get());
15136 if (!str)
15137 exception::throw_last_error(saved_ctx);
15138 os << str;
15139 free(str);
15140 return os;
15143 // implementations for isl::multi_id
15144 multi_id manage(__isl_take isl_multi_id *ptr) {
15145 if (!ptr)
15146 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15147 return multi_id(ptr);
15149 multi_id manage_copy(__isl_keep isl_multi_id *ptr) {
15150 if (!ptr)
15151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15152 auto saved_ctx = isl_multi_id_get_ctx(ptr);
15153 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15154 ptr = isl_multi_id_copy(ptr);
15155 if (!ptr)
15156 exception::throw_last_error(saved_ctx);
15157 return multi_id(ptr);
15160 multi_id::multi_id(__isl_take isl_multi_id *ptr)
15161 : ptr(ptr) {}
15163 multi_id::multi_id()
15164 : ptr(nullptr) {}
15166 multi_id::multi_id(const multi_id &obj)
15167 : ptr(nullptr)
15169 if (!obj.ptr)
15170 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15171 auto saved_ctx = isl_multi_id_get_ctx(obj.ptr);
15172 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15173 ptr = obj.copy();
15174 if (!ptr)
15175 exception::throw_last_error(saved_ctx);
15178 multi_id::multi_id(isl::space space, isl::id_list list)
15180 if (space.is_null() || list.is_null())
15181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15182 auto saved_ctx = space.ctx();
15183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15184 auto res = isl_multi_id_from_id_list(space.release(), list.release());
15185 if (!res)
15186 exception::throw_last_error(saved_ctx);
15187 ptr = res;
15190 multi_id::multi_id(isl::ctx ctx, const std::string &str)
15192 auto saved_ctx = ctx;
15193 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15194 auto res = isl_multi_id_read_from_str(ctx.release(), str.c_str());
15195 if (!res)
15196 exception::throw_last_error(saved_ctx);
15197 ptr = res;
15200 multi_id &multi_id::operator=(multi_id obj) {
15201 std::swap(this->ptr, obj.ptr);
15202 return *this;
15205 multi_id::~multi_id() {
15206 if (ptr)
15207 isl_multi_id_free(ptr);
15210 __isl_give isl_multi_id *multi_id::copy() const & {
15211 return isl_multi_id_copy(ptr);
15214 __isl_keep isl_multi_id *multi_id::get() const {
15215 return ptr;
15218 __isl_give isl_multi_id *multi_id::release() {
15219 isl_multi_id *tmp = ptr;
15220 ptr = nullptr;
15221 return tmp;
15224 bool multi_id::is_null() const {
15225 return ptr == nullptr;
15228 isl::ctx multi_id::ctx() const {
15229 return isl::ctx(isl_multi_id_get_ctx(ptr));
15232 isl::id multi_id::at(int pos) const
15234 if (!ptr)
15235 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15236 auto saved_ctx = ctx();
15237 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15238 auto res = isl_multi_id_get_at(get(), pos);
15239 if (!res)
15240 exception::throw_last_error(saved_ctx);
15241 return manage(res);
15244 isl::id multi_id::get_at(int pos) const
15246 return at(pos);
15249 isl::multi_id multi_id::flat_range_product(isl::multi_id multi2) const
15251 if (!ptr || multi2.is_null())
15252 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15253 auto saved_ctx = ctx();
15254 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15255 auto res = isl_multi_id_flat_range_product(copy(), multi2.release());
15256 if (!res)
15257 exception::throw_last_error(saved_ctx);
15258 return manage(res);
15261 isl::id_list multi_id::list() const
15263 if (!ptr)
15264 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15265 auto saved_ctx = ctx();
15266 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15267 auto res = isl_multi_id_get_list(get());
15268 if (!res)
15269 exception::throw_last_error(saved_ctx);
15270 return manage(res);
15273 isl::id_list multi_id::get_list() const
15275 return list();
15278 bool multi_id::plain_is_equal(const isl::multi_id &multi2) const
15280 if (!ptr || multi2.is_null())
15281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15282 auto saved_ctx = ctx();
15283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15284 auto res = isl_multi_id_plain_is_equal(get(), multi2.get());
15285 if (res < 0)
15286 exception::throw_last_error(saved_ctx);
15287 return res;
15290 isl::multi_id multi_id::range_product(isl::multi_id multi2) const
15292 if (!ptr || multi2.is_null())
15293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15294 auto saved_ctx = ctx();
15295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15296 auto res = isl_multi_id_range_product(copy(), multi2.release());
15297 if (!res)
15298 exception::throw_last_error(saved_ctx);
15299 return manage(res);
15302 isl::multi_id multi_id::set_at(int pos, isl::id el) const
15304 if (!ptr || el.is_null())
15305 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15306 auto saved_ctx = ctx();
15307 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15308 auto res = isl_multi_id_set_at(copy(), pos, el.release());
15309 if (!res)
15310 exception::throw_last_error(saved_ctx);
15311 return manage(res);
15314 isl::multi_id multi_id::set_at(int pos, const std::string &el) const
15316 if (!ptr)
15317 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15318 return this->set_at(pos, isl::id(ctx(), el));
15321 unsigned multi_id::size() const
15323 if (!ptr)
15324 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15325 auto saved_ctx = ctx();
15326 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15327 auto res = isl_multi_id_size(get());
15328 if (res < 0)
15329 exception::throw_last_error(saved_ctx);
15330 return res;
15333 isl::space multi_id::space() const
15335 if (!ptr)
15336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15337 auto saved_ctx = ctx();
15338 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15339 auto res = isl_multi_id_get_space(get());
15340 if (!res)
15341 exception::throw_last_error(saved_ctx);
15342 return manage(res);
15345 isl::space multi_id::get_space() const
15347 return space();
15350 inline std::ostream &operator<<(std::ostream &os, const multi_id &obj)
15352 if (!obj.get())
15353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15354 auto saved_ctx = isl_multi_id_get_ctx(obj.get());
15355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15356 char *str = isl_multi_id_to_str(obj.get());
15357 if (!str)
15358 exception::throw_last_error(saved_ctx);
15359 os << str;
15360 free(str);
15361 return os;
15364 // implementations for isl::multi_pw_aff
15365 multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr) {
15366 if (!ptr)
15367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15368 return multi_pw_aff(ptr);
15370 multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr) {
15371 if (!ptr)
15372 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15373 auto saved_ctx = isl_multi_pw_aff_get_ctx(ptr);
15374 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15375 ptr = isl_multi_pw_aff_copy(ptr);
15376 if (!ptr)
15377 exception::throw_last_error(saved_ctx);
15378 return multi_pw_aff(ptr);
15381 multi_pw_aff::multi_pw_aff(__isl_take isl_multi_pw_aff *ptr)
15382 : ptr(ptr) {}
15384 multi_pw_aff::multi_pw_aff()
15385 : ptr(nullptr) {}
15387 multi_pw_aff::multi_pw_aff(const multi_pw_aff &obj)
15388 : ptr(nullptr)
15390 if (!obj.ptr)
15391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15392 auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.ptr);
15393 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15394 ptr = obj.copy();
15395 if (!ptr)
15396 exception::throw_last_error(saved_ctx);
15399 multi_pw_aff::multi_pw_aff(isl::aff aff)
15401 if (aff.is_null())
15402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15403 auto saved_ctx = aff.ctx();
15404 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15405 auto res = isl_multi_pw_aff_from_aff(aff.release());
15406 if (!res)
15407 exception::throw_last_error(saved_ctx);
15408 ptr = res;
15411 multi_pw_aff::multi_pw_aff(isl::multi_aff ma)
15413 if (ma.is_null())
15414 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15415 auto saved_ctx = ma.ctx();
15416 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15417 auto res = isl_multi_pw_aff_from_multi_aff(ma.release());
15418 if (!res)
15419 exception::throw_last_error(saved_ctx);
15420 ptr = res;
15423 multi_pw_aff::multi_pw_aff(isl::pw_aff pa)
15425 if (pa.is_null())
15426 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15427 auto saved_ctx = pa.ctx();
15428 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15429 auto res = isl_multi_pw_aff_from_pw_aff(pa.release());
15430 if (!res)
15431 exception::throw_last_error(saved_ctx);
15432 ptr = res;
15435 multi_pw_aff::multi_pw_aff(isl::space space, isl::pw_aff_list list)
15437 if (space.is_null() || list.is_null())
15438 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15439 auto saved_ctx = space.ctx();
15440 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15441 auto res = isl_multi_pw_aff_from_pw_aff_list(space.release(), list.release());
15442 if (!res)
15443 exception::throw_last_error(saved_ctx);
15444 ptr = res;
15447 multi_pw_aff::multi_pw_aff(isl::pw_multi_aff pma)
15449 if (pma.is_null())
15450 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15451 auto saved_ctx = pma.ctx();
15452 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15453 auto res = isl_multi_pw_aff_from_pw_multi_aff(pma.release());
15454 if (!res)
15455 exception::throw_last_error(saved_ctx);
15456 ptr = res;
15459 multi_pw_aff::multi_pw_aff(isl::ctx ctx, const std::string &str)
15461 auto saved_ctx = ctx;
15462 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15463 auto res = isl_multi_pw_aff_read_from_str(ctx.release(), str.c_str());
15464 if (!res)
15465 exception::throw_last_error(saved_ctx);
15466 ptr = res;
15469 multi_pw_aff &multi_pw_aff::operator=(multi_pw_aff obj) {
15470 std::swap(this->ptr, obj.ptr);
15471 return *this;
15474 multi_pw_aff::~multi_pw_aff() {
15475 if (ptr)
15476 isl_multi_pw_aff_free(ptr);
15479 __isl_give isl_multi_pw_aff *multi_pw_aff::copy() const & {
15480 return isl_multi_pw_aff_copy(ptr);
15483 __isl_keep isl_multi_pw_aff *multi_pw_aff::get() const {
15484 return ptr;
15487 __isl_give isl_multi_pw_aff *multi_pw_aff::release() {
15488 isl_multi_pw_aff *tmp = ptr;
15489 ptr = nullptr;
15490 return tmp;
15493 bool multi_pw_aff::is_null() const {
15494 return ptr == nullptr;
15497 isl::ctx multi_pw_aff::ctx() const {
15498 return isl::ctx(isl_multi_pw_aff_get_ctx(ptr));
15501 isl::multi_pw_aff multi_pw_aff::add(isl::multi_pw_aff multi2) const
15503 if (!ptr || multi2.is_null())
15504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15505 auto saved_ctx = ctx();
15506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15507 auto res = isl_multi_pw_aff_add(copy(), multi2.release());
15508 if (!res)
15509 exception::throw_last_error(saved_ctx);
15510 return manage(res);
15513 isl::multi_union_pw_aff multi_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
15515 if (!ptr)
15516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15517 return isl::multi_union_pw_aff(*this).add(multi2);
15520 isl::multi_pw_aff multi_pw_aff::add(const isl::aff &multi2) const
15522 if (!ptr)
15523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15524 return this->add(isl::multi_pw_aff(multi2));
15527 isl::multi_pw_aff multi_pw_aff::add(const isl::multi_aff &multi2) const
15529 if (!ptr)
15530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15531 return this->add(isl::multi_pw_aff(multi2));
15534 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_aff &multi2) const
15536 if (!ptr)
15537 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15538 return this->add(isl::multi_pw_aff(multi2));
15541 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_multi_aff &multi2) const
15543 if (!ptr)
15544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15545 return this->add(isl::multi_pw_aff(multi2));
15548 isl::multi_pw_aff multi_pw_aff::add_constant(isl::multi_val mv) const
15550 if (!ptr || mv.is_null())
15551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15552 auto saved_ctx = ctx();
15553 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15554 auto res = isl_multi_pw_aff_add_constant_multi_val(copy(), mv.release());
15555 if (!res)
15556 exception::throw_last_error(saved_ctx);
15557 return manage(res);
15560 isl::multi_pw_aff multi_pw_aff::add_constant(isl::val v) const
15562 if (!ptr || v.is_null())
15563 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15564 auto saved_ctx = ctx();
15565 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15566 auto res = isl_multi_pw_aff_add_constant_val(copy(), v.release());
15567 if (!res)
15568 exception::throw_last_error(saved_ctx);
15569 return manage(res);
15572 isl::multi_pw_aff multi_pw_aff::add_constant(long v) const
15574 if (!ptr)
15575 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15576 return this->add_constant(isl::val(ctx(), v));
15579 isl::map multi_pw_aff::as_map() const
15581 if (!ptr)
15582 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15583 auto saved_ctx = ctx();
15584 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15585 auto res = isl_multi_pw_aff_as_map(copy());
15586 if (!res)
15587 exception::throw_last_error(saved_ctx);
15588 return manage(res);
15591 isl::multi_aff multi_pw_aff::as_multi_aff() const
15593 if (!ptr)
15594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15595 auto saved_ctx = ctx();
15596 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15597 auto res = isl_multi_pw_aff_as_multi_aff(copy());
15598 if (!res)
15599 exception::throw_last_error(saved_ctx);
15600 return manage(res);
15603 isl::set multi_pw_aff::as_set() const
15605 if (!ptr)
15606 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15607 auto saved_ctx = ctx();
15608 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15609 auto res = isl_multi_pw_aff_as_set(copy());
15610 if (!res)
15611 exception::throw_last_error(saved_ctx);
15612 return manage(res);
15615 isl::pw_aff multi_pw_aff::at(int pos) const
15617 if (!ptr)
15618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15619 auto saved_ctx = ctx();
15620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15621 auto res = isl_multi_pw_aff_get_at(get(), pos);
15622 if (!res)
15623 exception::throw_last_error(saved_ctx);
15624 return manage(res);
15627 isl::pw_aff multi_pw_aff::get_at(int pos) const
15629 return at(pos);
15632 isl::set multi_pw_aff::bind(isl::multi_id tuple) const
15634 if (!ptr || tuple.is_null())
15635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15636 auto saved_ctx = ctx();
15637 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15638 auto res = isl_multi_pw_aff_bind(copy(), tuple.release());
15639 if (!res)
15640 exception::throw_last_error(saved_ctx);
15641 return manage(res);
15644 isl::multi_pw_aff multi_pw_aff::bind_domain(isl::multi_id tuple) const
15646 if (!ptr || tuple.is_null())
15647 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15648 auto saved_ctx = ctx();
15649 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15650 auto res = isl_multi_pw_aff_bind_domain(copy(), tuple.release());
15651 if (!res)
15652 exception::throw_last_error(saved_ctx);
15653 return manage(res);
15656 isl::multi_pw_aff multi_pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
15658 if (!ptr || tuple.is_null())
15659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15660 auto saved_ctx = ctx();
15661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15662 auto res = isl_multi_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
15663 if (!res)
15664 exception::throw_last_error(saved_ctx);
15665 return manage(res);
15668 isl::multi_pw_aff multi_pw_aff::coalesce() const
15670 if (!ptr)
15671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15672 auto saved_ctx = ctx();
15673 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15674 auto res = isl_multi_pw_aff_coalesce(copy());
15675 if (!res)
15676 exception::throw_last_error(saved_ctx);
15677 return manage(res);
15680 isl::set multi_pw_aff::domain() const
15682 if (!ptr)
15683 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15684 auto saved_ctx = ctx();
15685 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15686 auto res = isl_multi_pw_aff_domain(copy());
15687 if (!res)
15688 exception::throw_last_error(saved_ctx);
15689 return manage(res);
15692 isl::multi_pw_aff multi_pw_aff::domain_reverse() const
15694 if (!ptr)
15695 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15696 auto saved_ctx = ctx();
15697 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15698 auto res = isl_multi_pw_aff_domain_reverse(copy());
15699 if (!res)
15700 exception::throw_last_error(saved_ctx);
15701 return manage(res);
15704 isl::multi_pw_aff multi_pw_aff::flat_range_product(isl::multi_pw_aff multi2) const
15706 if (!ptr || multi2.is_null())
15707 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15708 auto saved_ctx = ctx();
15709 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15710 auto res = isl_multi_pw_aff_flat_range_product(copy(), multi2.release());
15711 if (!res)
15712 exception::throw_last_error(saved_ctx);
15713 return manage(res);
15716 isl::multi_union_pw_aff multi_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
15718 if (!ptr)
15719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15720 return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
15723 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::aff &multi2) const
15725 if (!ptr)
15726 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15727 return this->flat_range_product(isl::multi_pw_aff(multi2));
15730 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::multi_aff &multi2) const
15732 if (!ptr)
15733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15734 return this->flat_range_product(isl::multi_pw_aff(multi2));
15737 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_aff &multi2) const
15739 if (!ptr)
15740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15741 return this->flat_range_product(isl::multi_pw_aff(multi2));
15744 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_multi_aff &multi2) const
15746 if (!ptr)
15747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15748 return this->flat_range_product(isl::multi_pw_aff(multi2));
15751 isl::multi_pw_aff multi_pw_aff::gist(isl::set set) const
15753 if (!ptr || set.is_null())
15754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15755 auto saved_ctx = ctx();
15756 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15757 auto res = isl_multi_pw_aff_gist(copy(), set.release());
15758 if (!res)
15759 exception::throw_last_error(saved_ctx);
15760 return manage(res);
15763 isl::multi_union_pw_aff multi_pw_aff::gist(const isl::union_set &context) const
15765 if (!ptr)
15766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15767 return isl::multi_union_pw_aff(*this).gist(context);
15770 isl::multi_pw_aff multi_pw_aff::gist(const isl::basic_set &set) const
15772 if (!ptr)
15773 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15774 return this->gist(isl::set(set));
15777 isl::multi_pw_aff multi_pw_aff::gist(const isl::point &set) const
15779 if (!ptr)
15780 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15781 return this->gist(isl::set(set));
15784 isl::multi_pw_aff multi_pw_aff::gist_params(isl::set set) const
15786 if (!ptr || set.is_null())
15787 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15788 auto saved_ctx = ctx();
15789 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15790 auto res = isl_multi_pw_aff_gist_params(copy(), set.release());
15791 if (!res)
15792 exception::throw_last_error(saved_ctx);
15793 return manage(res);
15796 bool multi_pw_aff::has_range_tuple_id() const
15798 if (!ptr)
15799 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15800 auto saved_ctx = ctx();
15801 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15802 auto res = isl_multi_pw_aff_has_range_tuple_id(get());
15803 if (res < 0)
15804 exception::throw_last_error(saved_ctx);
15805 return res;
15808 isl::multi_pw_aff multi_pw_aff::identity() const
15810 if (!ptr)
15811 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15812 auto saved_ctx = ctx();
15813 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15814 auto res = isl_multi_pw_aff_identity_multi_pw_aff(copy());
15815 if (!res)
15816 exception::throw_last_error(saved_ctx);
15817 return manage(res);
15820 isl::multi_pw_aff multi_pw_aff::identity_on_domain(isl::space space)
15822 if (space.is_null())
15823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15824 auto saved_ctx = space.ctx();
15825 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15826 auto res = isl_multi_pw_aff_identity_on_domain_space(space.release());
15827 if (!res)
15828 exception::throw_last_error(saved_ctx);
15829 return manage(res);
15832 isl::multi_pw_aff multi_pw_aff::insert_domain(isl::space domain) const
15834 if (!ptr || domain.is_null())
15835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15836 auto saved_ctx = ctx();
15837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15838 auto res = isl_multi_pw_aff_insert_domain(copy(), domain.release());
15839 if (!res)
15840 exception::throw_last_error(saved_ctx);
15841 return manage(res);
15844 isl::multi_pw_aff multi_pw_aff::intersect_domain(isl::set domain) const
15846 if (!ptr || domain.is_null())
15847 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15848 auto saved_ctx = ctx();
15849 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15850 auto res = isl_multi_pw_aff_intersect_domain(copy(), domain.release());
15851 if (!res)
15852 exception::throw_last_error(saved_ctx);
15853 return manage(res);
15856 isl::multi_union_pw_aff multi_pw_aff::intersect_domain(const isl::union_set &uset) const
15858 if (!ptr)
15859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15860 return isl::multi_union_pw_aff(*this).intersect_domain(uset);
15863 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::basic_set &domain) const
15865 if (!ptr)
15866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15867 return this->intersect_domain(isl::set(domain));
15870 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::point &domain) const
15872 if (!ptr)
15873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15874 return this->intersect_domain(isl::set(domain));
15877 isl::multi_pw_aff multi_pw_aff::intersect_params(isl::set set) const
15879 if (!ptr || set.is_null())
15880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15881 auto saved_ctx = ctx();
15882 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15883 auto res = isl_multi_pw_aff_intersect_params(copy(), set.release());
15884 if (!res)
15885 exception::throw_last_error(saved_ctx);
15886 return manage(res);
15889 bool multi_pw_aff::involves_nan() const
15891 if (!ptr)
15892 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15893 auto saved_ctx = ctx();
15894 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15895 auto res = isl_multi_pw_aff_involves_nan(get());
15896 if (res < 0)
15897 exception::throw_last_error(saved_ctx);
15898 return res;
15901 bool multi_pw_aff::involves_param(const isl::id &id) const
15903 if (!ptr || id.is_null())
15904 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15905 auto saved_ctx = ctx();
15906 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15907 auto res = isl_multi_pw_aff_involves_param_id(get(), id.get());
15908 if (res < 0)
15909 exception::throw_last_error(saved_ctx);
15910 return res;
15913 bool multi_pw_aff::involves_param(const std::string &id) const
15915 if (!ptr)
15916 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15917 return this->involves_param(isl::id(ctx(), id));
15920 bool multi_pw_aff::involves_param(const isl::id_list &list) const
15922 if (!ptr || list.is_null())
15923 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15924 auto saved_ctx = ctx();
15925 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15926 auto res = isl_multi_pw_aff_involves_param_id_list(get(), list.get());
15927 if (res < 0)
15928 exception::throw_last_error(saved_ctx);
15929 return res;
15932 bool multi_pw_aff::isa_multi_aff() const
15934 if (!ptr)
15935 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15936 auto saved_ctx = ctx();
15937 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15938 auto res = isl_multi_pw_aff_isa_multi_aff(get());
15939 if (res < 0)
15940 exception::throw_last_error(saved_ctx);
15941 return res;
15944 isl::pw_aff_list multi_pw_aff::list() const
15946 if (!ptr)
15947 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15948 auto saved_ctx = ctx();
15949 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15950 auto res = isl_multi_pw_aff_get_list(get());
15951 if (!res)
15952 exception::throw_last_error(saved_ctx);
15953 return manage(res);
15956 isl::pw_aff_list multi_pw_aff::get_list() const
15958 return list();
15961 isl::multi_pw_aff multi_pw_aff::max(isl::multi_pw_aff multi2) const
15963 if (!ptr || multi2.is_null())
15964 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15965 auto saved_ctx = ctx();
15966 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15967 auto res = isl_multi_pw_aff_max(copy(), multi2.release());
15968 if (!res)
15969 exception::throw_last_error(saved_ctx);
15970 return manage(res);
15973 isl::multi_val multi_pw_aff::max_multi_val() const
15975 if (!ptr)
15976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15977 auto saved_ctx = ctx();
15978 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15979 auto res = isl_multi_pw_aff_max_multi_val(copy());
15980 if (!res)
15981 exception::throw_last_error(saved_ctx);
15982 return manage(res);
15985 isl::multi_pw_aff multi_pw_aff::min(isl::multi_pw_aff multi2) const
15987 if (!ptr || multi2.is_null())
15988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15989 auto saved_ctx = ctx();
15990 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15991 auto res = isl_multi_pw_aff_min(copy(), multi2.release());
15992 if (!res)
15993 exception::throw_last_error(saved_ctx);
15994 return manage(res);
15997 isl::multi_val multi_pw_aff::min_multi_val() const
15999 if (!ptr)
16000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16001 auto saved_ctx = ctx();
16002 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16003 auto res = isl_multi_pw_aff_min_multi_val(copy());
16004 if (!res)
16005 exception::throw_last_error(saved_ctx);
16006 return manage(res);
16009 isl::multi_pw_aff multi_pw_aff::neg() const
16011 if (!ptr)
16012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16013 auto saved_ctx = ctx();
16014 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16015 auto res = isl_multi_pw_aff_neg(copy());
16016 if (!res)
16017 exception::throw_last_error(saved_ctx);
16018 return manage(res);
16021 bool multi_pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
16023 if (!ptr || multi2.is_null())
16024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16025 auto saved_ctx = ctx();
16026 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16027 auto res = isl_multi_pw_aff_plain_is_equal(get(), multi2.get());
16028 if (res < 0)
16029 exception::throw_last_error(saved_ctx);
16030 return res;
16033 bool multi_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16035 if (!ptr)
16036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16037 return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
16040 bool multi_pw_aff::plain_is_equal(const isl::aff &multi2) const
16042 if (!ptr)
16043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16044 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16047 bool multi_pw_aff::plain_is_equal(const isl::multi_aff &multi2) const
16049 if (!ptr)
16050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16051 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16054 bool multi_pw_aff::plain_is_equal(const isl::pw_aff &multi2) const
16056 if (!ptr)
16057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16058 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16061 bool multi_pw_aff::plain_is_equal(const isl::pw_multi_aff &multi2) const
16063 if (!ptr)
16064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16065 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16068 isl::multi_pw_aff multi_pw_aff::product(isl::multi_pw_aff multi2) const
16070 if (!ptr || multi2.is_null())
16071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16072 auto saved_ctx = ctx();
16073 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16074 auto res = isl_multi_pw_aff_product(copy(), multi2.release());
16075 if (!res)
16076 exception::throw_last_error(saved_ctx);
16077 return manage(res);
16080 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_aff ma) const
16082 if (!ptr || ma.is_null())
16083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16084 auto saved_ctx = ctx();
16085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16086 auto res = isl_multi_pw_aff_pullback_multi_aff(copy(), ma.release());
16087 if (!res)
16088 exception::throw_last_error(saved_ctx);
16089 return manage(res);
16092 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_pw_aff mpa2) const
16094 if (!ptr || mpa2.is_null())
16095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16096 auto saved_ctx = ctx();
16097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16098 auto res = isl_multi_pw_aff_pullback_multi_pw_aff(copy(), mpa2.release());
16099 if (!res)
16100 exception::throw_last_error(saved_ctx);
16101 return manage(res);
16104 isl::multi_pw_aff multi_pw_aff::pullback(isl::pw_multi_aff pma) const
16106 if (!ptr || pma.is_null())
16107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16108 auto saved_ctx = ctx();
16109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16110 auto res = isl_multi_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
16111 if (!res)
16112 exception::throw_last_error(saved_ctx);
16113 return manage(res);
16116 isl::multi_union_pw_aff multi_pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
16118 if (!ptr)
16119 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16120 return isl::multi_union_pw_aff(*this).pullback(upma);
16123 isl::multi_pw_aff multi_pw_aff::range_product(isl::multi_pw_aff multi2) const
16125 if (!ptr || multi2.is_null())
16126 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16127 auto saved_ctx = ctx();
16128 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16129 auto res = isl_multi_pw_aff_range_product(copy(), multi2.release());
16130 if (!res)
16131 exception::throw_last_error(saved_ctx);
16132 return manage(res);
16135 isl::multi_union_pw_aff multi_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
16137 if (!ptr)
16138 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16139 return isl::multi_union_pw_aff(*this).range_product(multi2);
16142 isl::multi_pw_aff multi_pw_aff::range_product(const isl::aff &multi2) const
16144 if (!ptr)
16145 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16146 return this->range_product(isl::multi_pw_aff(multi2));
16149 isl::multi_pw_aff multi_pw_aff::range_product(const isl::multi_aff &multi2) const
16151 if (!ptr)
16152 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16153 return this->range_product(isl::multi_pw_aff(multi2));
16156 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_aff &multi2) const
16158 if (!ptr)
16159 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16160 return this->range_product(isl::multi_pw_aff(multi2));
16163 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_multi_aff &multi2) const
16165 if (!ptr)
16166 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16167 return this->range_product(isl::multi_pw_aff(multi2));
16170 isl::id multi_pw_aff::range_tuple_id() const
16172 if (!ptr)
16173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16174 auto saved_ctx = ctx();
16175 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16176 auto res = isl_multi_pw_aff_get_range_tuple_id(get());
16177 if (!res)
16178 exception::throw_last_error(saved_ctx);
16179 return manage(res);
16182 isl::id multi_pw_aff::get_range_tuple_id() const
16184 return range_tuple_id();
16187 isl::multi_pw_aff multi_pw_aff::reset_range_tuple_id() const
16189 if (!ptr)
16190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16191 auto saved_ctx = ctx();
16192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16193 auto res = isl_multi_pw_aff_reset_range_tuple_id(copy());
16194 if (!res)
16195 exception::throw_last_error(saved_ctx);
16196 return manage(res);
16199 isl::multi_pw_aff multi_pw_aff::scale(isl::multi_val mv) const
16201 if (!ptr || mv.is_null())
16202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16203 auto saved_ctx = ctx();
16204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16205 auto res = isl_multi_pw_aff_scale_multi_val(copy(), mv.release());
16206 if (!res)
16207 exception::throw_last_error(saved_ctx);
16208 return manage(res);
16211 isl::multi_pw_aff multi_pw_aff::scale(isl::val v) const
16213 if (!ptr || v.is_null())
16214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16215 auto saved_ctx = ctx();
16216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16217 auto res = isl_multi_pw_aff_scale_val(copy(), v.release());
16218 if (!res)
16219 exception::throw_last_error(saved_ctx);
16220 return manage(res);
16223 isl::multi_pw_aff multi_pw_aff::scale(long v) const
16225 if (!ptr)
16226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16227 return this->scale(isl::val(ctx(), v));
16230 isl::multi_pw_aff multi_pw_aff::scale_down(isl::multi_val mv) const
16232 if (!ptr || mv.is_null())
16233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16234 auto saved_ctx = ctx();
16235 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16236 auto res = isl_multi_pw_aff_scale_down_multi_val(copy(), mv.release());
16237 if (!res)
16238 exception::throw_last_error(saved_ctx);
16239 return manage(res);
16242 isl::multi_pw_aff multi_pw_aff::scale_down(isl::val v) const
16244 if (!ptr || v.is_null())
16245 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16246 auto saved_ctx = ctx();
16247 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16248 auto res = isl_multi_pw_aff_scale_down_val(copy(), v.release());
16249 if (!res)
16250 exception::throw_last_error(saved_ctx);
16251 return manage(res);
16254 isl::multi_pw_aff multi_pw_aff::scale_down(long v) const
16256 if (!ptr)
16257 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16258 return this->scale_down(isl::val(ctx(), v));
16261 isl::multi_pw_aff multi_pw_aff::set_at(int pos, isl::pw_aff el) const
16263 if (!ptr || el.is_null())
16264 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16265 auto saved_ctx = ctx();
16266 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16267 auto res = isl_multi_pw_aff_set_at(copy(), pos, el.release());
16268 if (!res)
16269 exception::throw_last_error(saved_ctx);
16270 return manage(res);
16273 isl::multi_union_pw_aff multi_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
16275 if (!ptr)
16276 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16277 return isl::multi_union_pw_aff(*this).set_at(pos, el);
16280 isl::multi_pw_aff multi_pw_aff::set_range_tuple(isl::id id) const
16282 if (!ptr || id.is_null())
16283 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16284 auto saved_ctx = ctx();
16285 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16286 auto res = isl_multi_pw_aff_set_range_tuple_id(copy(), id.release());
16287 if (!res)
16288 exception::throw_last_error(saved_ctx);
16289 return manage(res);
16292 isl::multi_pw_aff multi_pw_aff::set_range_tuple(const std::string &id) const
16294 if (!ptr)
16295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16296 return this->set_range_tuple(isl::id(ctx(), id));
16299 unsigned multi_pw_aff::size() const
16301 if (!ptr)
16302 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16303 auto saved_ctx = ctx();
16304 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16305 auto res = isl_multi_pw_aff_size(get());
16306 if (res < 0)
16307 exception::throw_last_error(saved_ctx);
16308 return res;
16311 isl::space multi_pw_aff::space() const
16313 if (!ptr)
16314 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16315 auto saved_ctx = ctx();
16316 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16317 auto res = isl_multi_pw_aff_get_space(get());
16318 if (!res)
16319 exception::throw_last_error(saved_ctx);
16320 return manage(res);
16323 isl::space multi_pw_aff::get_space() const
16325 return space();
16328 isl::multi_pw_aff multi_pw_aff::sub(isl::multi_pw_aff multi2) const
16330 if (!ptr || multi2.is_null())
16331 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16332 auto saved_ctx = ctx();
16333 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16334 auto res = isl_multi_pw_aff_sub(copy(), multi2.release());
16335 if (!res)
16336 exception::throw_last_error(saved_ctx);
16337 return manage(res);
16340 isl::multi_union_pw_aff multi_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
16342 if (!ptr)
16343 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16344 return isl::multi_union_pw_aff(*this).sub(multi2);
16347 isl::multi_pw_aff multi_pw_aff::sub(const isl::aff &multi2) const
16349 if (!ptr)
16350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16351 return this->sub(isl::multi_pw_aff(multi2));
16354 isl::multi_pw_aff multi_pw_aff::sub(const isl::multi_aff &multi2) const
16356 if (!ptr)
16357 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16358 return this->sub(isl::multi_pw_aff(multi2));
16361 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_aff &multi2) const
16363 if (!ptr)
16364 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16365 return this->sub(isl::multi_pw_aff(multi2));
16368 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_multi_aff &multi2) const
16370 if (!ptr)
16371 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16372 return this->sub(isl::multi_pw_aff(multi2));
16375 isl::multi_pw_aff multi_pw_aff::unbind_params_insert_domain(isl::multi_id domain) const
16377 if (!ptr || domain.is_null())
16378 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16379 auto saved_ctx = ctx();
16380 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16381 auto res = isl_multi_pw_aff_unbind_params_insert_domain(copy(), domain.release());
16382 if (!res)
16383 exception::throw_last_error(saved_ctx);
16384 return manage(res);
16387 isl::multi_pw_aff multi_pw_aff::union_add(isl::multi_pw_aff mpa2) const
16389 if (!ptr || mpa2.is_null())
16390 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16391 auto saved_ctx = ctx();
16392 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16393 auto res = isl_multi_pw_aff_union_add(copy(), mpa2.release());
16394 if (!res)
16395 exception::throw_last_error(saved_ctx);
16396 return manage(res);
16399 isl::multi_union_pw_aff multi_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
16401 if (!ptr)
16402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16403 return isl::multi_union_pw_aff(*this).union_add(mupa2);
16406 isl::multi_pw_aff multi_pw_aff::union_add(const isl::aff &mpa2) const
16408 if (!ptr)
16409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16410 return this->union_add(isl::multi_pw_aff(mpa2));
16413 isl::multi_pw_aff multi_pw_aff::union_add(const isl::multi_aff &mpa2) const
16415 if (!ptr)
16416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16417 return this->union_add(isl::multi_pw_aff(mpa2));
16420 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_aff &mpa2) const
16422 if (!ptr)
16423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16424 return this->union_add(isl::multi_pw_aff(mpa2));
16427 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_multi_aff &mpa2) const
16429 if (!ptr)
16430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16431 return this->union_add(isl::multi_pw_aff(mpa2));
16434 isl::multi_pw_aff multi_pw_aff::zero(isl::space space)
16436 if (space.is_null())
16437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16438 auto saved_ctx = space.ctx();
16439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16440 auto res = isl_multi_pw_aff_zero(space.release());
16441 if (!res)
16442 exception::throw_last_error(saved_ctx);
16443 return manage(res);
16446 inline std::ostream &operator<<(std::ostream &os, const multi_pw_aff &obj)
16448 if (!obj.get())
16449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16450 auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.get());
16451 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16452 char *str = isl_multi_pw_aff_to_str(obj.get());
16453 if (!str)
16454 exception::throw_last_error(saved_ctx);
16455 os << str;
16456 free(str);
16457 return os;
16460 // implementations for isl::multi_union_pw_aff
16461 multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr) {
16462 if (!ptr)
16463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16464 return multi_union_pw_aff(ptr);
16466 multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr) {
16467 if (!ptr)
16468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16469 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(ptr);
16470 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16471 ptr = isl_multi_union_pw_aff_copy(ptr);
16472 if (!ptr)
16473 exception::throw_last_error(saved_ctx);
16474 return multi_union_pw_aff(ptr);
16477 multi_union_pw_aff::multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr)
16478 : ptr(ptr) {}
16480 multi_union_pw_aff::multi_union_pw_aff()
16481 : ptr(nullptr) {}
16483 multi_union_pw_aff::multi_union_pw_aff(const multi_union_pw_aff &obj)
16484 : ptr(nullptr)
16486 if (!obj.ptr)
16487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16488 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.ptr);
16489 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16490 ptr = obj.copy();
16491 if (!ptr)
16492 exception::throw_last_error(saved_ctx);
16495 multi_union_pw_aff::multi_union_pw_aff(isl::multi_pw_aff mpa)
16497 if (mpa.is_null())
16498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16499 auto saved_ctx = mpa.ctx();
16500 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16501 auto res = isl_multi_union_pw_aff_from_multi_pw_aff(mpa.release());
16502 if (!res)
16503 exception::throw_last_error(saved_ctx);
16504 ptr = res;
16507 multi_union_pw_aff::multi_union_pw_aff(isl::union_pw_aff upa)
16509 if (upa.is_null())
16510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16511 auto saved_ctx = upa.ctx();
16512 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16513 auto res = isl_multi_union_pw_aff_from_union_pw_aff(upa.release());
16514 if (!res)
16515 exception::throw_last_error(saved_ctx);
16516 ptr = res;
16519 multi_union_pw_aff::multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list)
16521 if (space.is_null() || list.is_null())
16522 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16523 auto saved_ctx = space.ctx();
16524 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16525 auto res = isl_multi_union_pw_aff_from_union_pw_aff_list(space.release(), list.release());
16526 if (!res)
16527 exception::throw_last_error(saved_ctx);
16528 ptr = res;
16531 multi_union_pw_aff::multi_union_pw_aff(isl::ctx ctx, const std::string &str)
16533 auto saved_ctx = ctx;
16534 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16535 auto res = isl_multi_union_pw_aff_read_from_str(ctx.release(), str.c_str());
16536 if (!res)
16537 exception::throw_last_error(saved_ctx);
16538 ptr = res;
16541 multi_union_pw_aff &multi_union_pw_aff::operator=(multi_union_pw_aff obj) {
16542 std::swap(this->ptr, obj.ptr);
16543 return *this;
16546 multi_union_pw_aff::~multi_union_pw_aff() {
16547 if (ptr)
16548 isl_multi_union_pw_aff_free(ptr);
16551 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::copy() const & {
16552 return isl_multi_union_pw_aff_copy(ptr);
16555 __isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::get() const {
16556 return ptr;
16559 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::release() {
16560 isl_multi_union_pw_aff *tmp = ptr;
16561 ptr = nullptr;
16562 return tmp;
16565 bool multi_union_pw_aff::is_null() const {
16566 return ptr == nullptr;
16569 isl::ctx multi_union_pw_aff::ctx() const {
16570 return isl::ctx(isl_multi_union_pw_aff_get_ctx(ptr));
16573 isl::multi_union_pw_aff multi_union_pw_aff::add(isl::multi_union_pw_aff multi2) const
16575 if (!ptr || multi2.is_null())
16576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16577 auto saved_ctx = ctx();
16578 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16579 auto res = isl_multi_union_pw_aff_add(copy(), multi2.release());
16580 if (!res)
16581 exception::throw_last_error(saved_ctx);
16582 return manage(res);
16585 isl::union_pw_aff multi_union_pw_aff::at(int pos) const
16587 if (!ptr)
16588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16589 auto saved_ctx = ctx();
16590 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16591 auto res = isl_multi_union_pw_aff_get_at(get(), pos);
16592 if (!res)
16593 exception::throw_last_error(saved_ctx);
16594 return manage(res);
16597 isl::union_pw_aff multi_union_pw_aff::get_at(int pos) const
16599 return at(pos);
16602 isl::union_set multi_union_pw_aff::bind(isl::multi_id tuple) const
16604 if (!ptr || tuple.is_null())
16605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16606 auto saved_ctx = ctx();
16607 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16608 auto res = isl_multi_union_pw_aff_bind(copy(), tuple.release());
16609 if (!res)
16610 exception::throw_last_error(saved_ctx);
16611 return manage(res);
16614 isl::multi_union_pw_aff multi_union_pw_aff::coalesce() const
16616 if (!ptr)
16617 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16618 auto saved_ctx = ctx();
16619 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16620 auto res = isl_multi_union_pw_aff_coalesce(copy());
16621 if (!res)
16622 exception::throw_last_error(saved_ctx);
16623 return manage(res);
16626 isl::union_set multi_union_pw_aff::domain() const
16628 if (!ptr)
16629 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16630 auto saved_ctx = ctx();
16631 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16632 auto res = isl_multi_union_pw_aff_domain(copy());
16633 if (!res)
16634 exception::throw_last_error(saved_ctx);
16635 return manage(res);
16638 isl::multi_union_pw_aff multi_union_pw_aff::flat_range_product(isl::multi_union_pw_aff multi2) const
16640 if (!ptr || multi2.is_null())
16641 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16642 auto saved_ctx = ctx();
16643 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16644 auto res = isl_multi_union_pw_aff_flat_range_product(copy(), multi2.release());
16645 if (!res)
16646 exception::throw_last_error(saved_ctx);
16647 return manage(res);
16650 isl::multi_union_pw_aff multi_union_pw_aff::gist(isl::union_set context) const
16652 if (!ptr || context.is_null())
16653 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16654 auto saved_ctx = ctx();
16655 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16656 auto res = isl_multi_union_pw_aff_gist(copy(), context.release());
16657 if (!res)
16658 exception::throw_last_error(saved_ctx);
16659 return manage(res);
16662 isl::multi_union_pw_aff multi_union_pw_aff::gist_params(isl::set context) const
16664 if (!ptr || context.is_null())
16665 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16666 auto saved_ctx = ctx();
16667 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16668 auto res = isl_multi_union_pw_aff_gist_params(copy(), context.release());
16669 if (!res)
16670 exception::throw_last_error(saved_ctx);
16671 return manage(res);
16674 bool multi_union_pw_aff::has_range_tuple_id() const
16676 if (!ptr)
16677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16678 auto saved_ctx = ctx();
16679 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16680 auto res = isl_multi_union_pw_aff_has_range_tuple_id(get());
16681 if (res < 0)
16682 exception::throw_last_error(saved_ctx);
16683 return res;
16686 isl::multi_union_pw_aff multi_union_pw_aff::intersect_domain(isl::union_set uset) const
16688 if (!ptr || uset.is_null())
16689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16690 auto saved_ctx = ctx();
16691 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16692 auto res = isl_multi_union_pw_aff_intersect_domain(copy(), uset.release());
16693 if (!res)
16694 exception::throw_last_error(saved_ctx);
16695 return manage(res);
16698 isl::multi_union_pw_aff multi_union_pw_aff::intersect_params(isl::set params) const
16700 if (!ptr || params.is_null())
16701 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16702 auto saved_ctx = ctx();
16703 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16704 auto res = isl_multi_union_pw_aff_intersect_params(copy(), params.release());
16705 if (!res)
16706 exception::throw_last_error(saved_ctx);
16707 return manage(res);
16710 bool multi_union_pw_aff::involves_nan() const
16712 if (!ptr)
16713 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16714 auto saved_ctx = ctx();
16715 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16716 auto res = isl_multi_union_pw_aff_involves_nan(get());
16717 if (res < 0)
16718 exception::throw_last_error(saved_ctx);
16719 return res;
16722 isl::union_pw_aff_list multi_union_pw_aff::list() const
16724 if (!ptr)
16725 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16726 auto saved_ctx = ctx();
16727 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16728 auto res = isl_multi_union_pw_aff_get_list(get());
16729 if (!res)
16730 exception::throw_last_error(saved_ctx);
16731 return manage(res);
16734 isl::union_pw_aff_list multi_union_pw_aff::get_list() const
16736 return list();
16739 isl::multi_union_pw_aff multi_union_pw_aff::neg() const
16741 if (!ptr)
16742 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16743 auto saved_ctx = ctx();
16744 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16745 auto res = isl_multi_union_pw_aff_neg(copy());
16746 if (!res)
16747 exception::throw_last_error(saved_ctx);
16748 return manage(res);
16751 bool multi_union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16753 if (!ptr || multi2.is_null())
16754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16755 auto saved_ctx = ctx();
16756 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16757 auto res = isl_multi_union_pw_aff_plain_is_equal(get(), multi2.get());
16758 if (res < 0)
16759 exception::throw_last_error(saved_ctx);
16760 return res;
16763 isl::multi_union_pw_aff multi_union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
16765 if (!ptr || upma.is_null())
16766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16767 auto saved_ctx = ctx();
16768 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16769 auto res = isl_multi_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
16770 if (!res)
16771 exception::throw_last_error(saved_ctx);
16772 return manage(res);
16775 isl::multi_union_pw_aff multi_union_pw_aff::range_product(isl::multi_union_pw_aff multi2) const
16777 if (!ptr || multi2.is_null())
16778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16779 auto saved_ctx = ctx();
16780 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16781 auto res = isl_multi_union_pw_aff_range_product(copy(), multi2.release());
16782 if (!res)
16783 exception::throw_last_error(saved_ctx);
16784 return manage(res);
16787 isl::id multi_union_pw_aff::range_tuple_id() const
16789 if (!ptr)
16790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16791 auto saved_ctx = ctx();
16792 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16793 auto res = isl_multi_union_pw_aff_get_range_tuple_id(get());
16794 if (!res)
16795 exception::throw_last_error(saved_ctx);
16796 return manage(res);
16799 isl::id multi_union_pw_aff::get_range_tuple_id() const
16801 return range_tuple_id();
16804 isl::multi_union_pw_aff multi_union_pw_aff::reset_range_tuple_id() const
16806 if (!ptr)
16807 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16808 auto saved_ctx = ctx();
16809 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16810 auto res = isl_multi_union_pw_aff_reset_range_tuple_id(copy());
16811 if (!res)
16812 exception::throw_last_error(saved_ctx);
16813 return manage(res);
16816 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::multi_val mv) const
16818 if (!ptr || mv.is_null())
16819 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16820 auto saved_ctx = ctx();
16821 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16822 auto res = isl_multi_union_pw_aff_scale_multi_val(copy(), mv.release());
16823 if (!res)
16824 exception::throw_last_error(saved_ctx);
16825 return manage(res);
16828 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::val v) const
16830 if (!ptr || v.is_null())
16831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16832 auto saved_ctx = ctx();
16833 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16834 auto res = isl_multi_union_pw_aff_scale_val(copy(), v.release());
16835 if (!res)
16836 exception::throw_last_error(saved_ctx);
16837 return manage(res);
16840 isl::multi_union_pw_aff multi_union_pw_aff::scale(long v) const
16842 if (!ptr)
16843 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16844 return this->scale(isl::val(ctx(), v));
16847 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::multi_val mv) const
16849 if (!ptr || mv.is_null())
16850 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16851 auto saved_ctx = ctx();
16852 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16853 auto res = isl_multi_union_pw_aff_scale_down_multi_val(copy(), mv.release());
16854 if (!res)
16855 exception::throw_last_error(saved_ctx);
16856 return manage(res);
16859 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::val v) const
16861 if (!ptr || v.is_null())
16862 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16863 auto saved_ctx = ctx();
16864 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16865 auto res = isl_multi_union_pw_aff_scale_down_val(copy(), v.release());
16866 if (!res)
16867 exception::throw_last_error(saved_ctx);
16868 return manage(res);
16871 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(long v) const
16873 if (!ptr)
16874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16875 return this->scale_down(isl::val(ctx(), v));
16878 isl::multi_union_pw_aff multi_union_pw_aff::set_at(int pos, isl::union_pw_aff el) const
16880 if (!ptr || el.is_null())
16881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16882 auto saved_ctx = ctx();
16883 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16884 auto res = isl_multi_union_pw_aff_set_at(copy(), pos, el.release());
16885 if (!res)
16886 exception::throw_last_error(saved_ctx);
16887 return manage(res);
16890 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(isl::id id) const
16892 if (!ptr || id.is_null())
16893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16894 auto saved_ctx = ctx();
16895 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16896 auto res = isl_multi_union_pw_aff_set_range_tuple_id(copy(), id.release());
16897 if (!res)
16898 exception::throw_last_error(saved_ctx);
16899 return manage(res);
16902 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(const std::string &id) const
16904 if (!ptr)
16905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16906 return this->set_range_tuple(isl::id(ctx(), id));
16909 unsigned multi_union_pw_aff::size() const
16911 if (!ptr)
16912 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16913 auto saved_ctx = ctx();
16914 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16915 auto res = isl_multi_union_pw_aff_size(get());
16916 if (res < 0)
16917 exception::throw_last_error(saved_ctx);
16918 return res;
16921 isl::space multi_union_pw_aff::space() const
16923 if (!ptr)
16924 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16925 auto saved_ctx = ctx();
16926 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16927 auto res = isl_multi_union_pw_aff_get_space(get());
16928 if (!res)
16929 exception::throw_last_error(saved_ctx);
16930 return manage(res);
16933 isl::space multi_union_pw_aff::get_space() const
16935 return space();
16938 isl::multi_union_pw_aff multi_union_pw_aff::sub(isl::multi_union_pw_aff multi2) const
16940 if (!ptr || multi2.is_null())
16941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16942 auto saved_ctx = ctx();
16943 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16944 auto res = isl_multi_union_pw_aff_sub(copy(), multi2.release());
16945 if (!res)
16946 exception::throw_last_error(saved_ctx);
16947 return manage(res);
16950 isl::multi_union_pw_aff multi_union_pw_aff::union_add(isl::multi_union_pw_aff mupa2) const
16952 if (!ptr || mupa2.is_null())
16953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16954 auto saved_ctx = ctx();
16955 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16956 auto res = isl_multi_union_pw_aff_union_add(copy(), mupa2.release());
16957 if (!res)
16958 exception::throw_last_error(saved_ctx);
16959 return manage(res);
16962 isl::multi_union_pw_aff multi_union_pw_aff::zero(isl::space space)
16964 if (space.is_null())
16965 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16966 auto saved_ctx = space.ctx();
16967 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16968 auto res = isl_multi_union_pw_aff_zero(space.release());
16969 if (!res)
16970 exception::throw_last_error(saved_ctx);
16971 return manage(res);
16974 inline std::ostream &operator<<(std::ostream &os, const multi_union_pw_aff &obj)
16976 if (!obj.get())
16977 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16978 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.get());
16979 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16980 char *str = isl_multi_union_pw_aff_to_str(obj.get());
16981 if (!str)
16982 exception::throw_last_error(saved_ctx);
16983 os << str;
16984 free(str);
16985 return os;
16988 // implementations for isl::multi_val
16989 multi_val manage(__isl_take isl_multi_val *ptr) {
16990 if (!ptr)
16991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16992 return multi_val(ptr);
16994 multi_val manage_copy(__isl_keep isl_multi_val *ptr) {
16995 if (!ptr)
16996 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16997 auto saved_ctx = isl_multi_val_get_ctx(ptr);
16998 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16999 ptr = isl_multi_val_copy(ptr);
17000 if (!ptr)
17001 exception::throw_last_error(saved_ctx);
17002 return multi_val(ptr);
17005 multi_val::multi_val(__isl_take isl_multi_val *ptr)
17006 : ptr(ptr) {}
17008 multi_val::multi_val()
17009 : ptr(nullptr) {}
17011 multi_val::multi_val(const multi_val &obj)
17012 : ptr(nullptr)
17014 if (!obj.ptr)
17015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17016 auto saved_ctx = isl_multi_val_get_ctx(obj.ptr);
17017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17018 ptr = obj.copy();
17019 if (!ptr)
17020 exception::throw_last_error(saved_ctx);
17023 multi_val::multi_val(isl::space space, isl::val_list list)
17025 if (space.is_null() || list.is_null())
17026 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17027 auto saved_ctx = space.ctx();
17028 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17029 auto res = isl_multi_val_from_val_list(space.release(), list.release());
17030 if (!res)
17031 exception::throw_last_error(saved_ctx);
17032 ptr = res;
17035 multi_val::multi_val(isl::ctx ctx, const std::string &str)
17037 auto saved_ctx = ctx;
17038 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17039 auto res = isl_multi_val_read_from_str(ctx.release(), str.c_str());
17040 if (!res)
17041 exception::throw_last_error(saved_ctx);
17042 ptr = res;
17045 multi_val &multi_val::operator=(multi_val obj) {
17046 std::swap(this->ptr, obj.ptr);
17047 return *this;
17050 multi_val::~multi_val() {
17051 if (ptr)
17052 isl_multi_val_free(ptr);
17055 __isl_give isl_multi_val *multi_val::copy() const & {
17056 return isl_multi_val_copy(ptr);
17059 __isl_keep isl_multi_val *multi_val::get() const {
17060 return ptr;
17063 __isl_give isl_multi_val *multi_val::release() {
17064 isl_multi_val *tmp = ptr;
17065 ptr = nullptr;
17066 return tmp;
17069 bool multi_val::is_null() const {
17070 return ptr == nullptr;
17073 isl::ctx multi_val::ctx() const {
17074 return isl::ctx(isl_multi_val_get_ctx(ptr));
17077 isl::multi_val multi_val::add(isl::multi_val multi2) const
17079 if (!ptr || multi2.is_null())
17080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17081 auto saved_ctx = ctx();
17082 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17083 auto res = isl_multi_val_add(copy(), multi2.release());
17084 if (!res)
17085 exception::throw_last_error(saved_ctx);
17086 return manage(res);
17089 isl::multi_val multi_val::add(isl::val v) const
17091 if (!ptr || v.is_null())
17092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17093 auto saved_ctx = ctx();
17094 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17095 auto res = isl_multi_val_add_val(copy(), v.release());
17096 if (!res)
17097 exception::throw_last_error(saved_ctx);
17098 return manage(res);
17101 isl::multi_val multi_val::add(long v) const
17103 if (!ptr)
17104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17105 return this->add(isl::val(ctx(), v));
17108 isl::val multi_val::at(int pos) const
17110 if (!ptr)
17111 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17112 auto saved_ctx = ctx();
17113 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17114 auto res = isl_multi_val_get_at(get(), pos);
17115 if (!res)
17116 exception::throw_last_error(saved_ctx);
17117 return manage(res);
17120 isl::val multi_val::get_at(int pos) const
17122 return at(pos);
17125 isl::multi_val multi_val::flat_range_product(isl::multi_val multi2) const
17127 if (!ptr || multi2.is_null())
17128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17129 auto saved_ctx = ctx();
17130 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17131 auto res = isl_multi_val_flat_range_product(copy(), multi2.release());
17132 if (!res)
17133 exception::throw_last_error(saved_ctx);
17134 return manage(res);
17137 bool multi_val::has_range_tuple_id() const
17139 if (!ptr)
17140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17141 auto saved_ctx = ctx();
17142 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17143 auto res = isl_multi_val_has_range_tuple_id(get());
17144 if (res < 0)
17145 exception::throw_last_error(saved_ctx);
17146 return res;
17149 bool multi_val::involves_nan() const
17151 if (!ptr)
17152 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17153 auto saved_ctx = ctx();
17154 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17155 auto res = isl_multi_val_involves_nan(get());
17156 if (res < 0)
17157 exception::throw_last_error(saved_ctx);
17158 return res;
17161 isl::val_list multi_val::list() const
17163 if (!ptr)
17164 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17165 auto saved_ctx = ctx();
17166 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17167 auto res = isl_multi_val_get_list(get());
17168 if (!res)
17169 exception::throw_last_error(saved_ctx);
17170 return manage(res);
17173 isl::val_list multi_val::get_list() const
17175 return list();
17178 isl::multi_val multi_val::max(isl::multi_val multi2) const
17180 if (!ptr || multi2.is_null())
17181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17182 auto saved_ctx = ctx();
17183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17184 auto res = isl_multi_val_max(copy(), multi2.release());
17185 if (!res)
17186 exception::throw_last_error(saved_ctx);
17187 return manage(res);
17190 isl::multi_val multi_val::min(isl::multi_val multi2) const
17192 if (!ptr || multi2.is_null())
17193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17194 auto saved_ctx = ctx();
17195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17196 auto res = isl_multi_val_min(copy(), multi2.release());
17197 if (!res)
17198 exception::throw_last_error(saved_ctx);
17199 return manage(res);
17202 isl::multi_val multi_val::neg() const
17204 if (!ptr)
17205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17206 auto saved_ctx = ctx();
17207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17208 auto res = isl_multi_val_neg(copy());
17209 if (!res)
17210 exception::throw_last_error(saved_ctx);
17211 return manage(res);
17214 bool multi_val::plain_is_equal(const isl::multi_val &multi2) const
17216 if (!ptr || multi2.is_null())
17217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17218 auto saved_ctx = ctx();
17219 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17220 auto res = isl_multi_val_plain_is_equal(get(), multi2.get());
17221 if (res < 0)
17222 exception::throw_last_error(saved_ctx);
17223 return res;
17226 isl::multi_val multi_val::product(isl::multi_val multi2) const
17228 if (!ptr || multi2.is_null())
17229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17230 auto saved_ctx = ctx();
17231 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17232 auto res = isl_multi_val_product(copy(), multi2.release());
17233 if (!res)
17234 exception::throw_last_error(saved_ctx);
17235 return manage(res);
17238 isl::multi_val multi_val::range_product(isl::multi_val multi2) const
17240 if (!ptr || multi2.is_null())
17241 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17242 auto saved_ctx = ctx();
17243 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17244 auto res = isl_multi_val_range_product(copy(), multi2.release());
17245 if (!res)
17246 exception::throw_last_error(saved_ctx);
17247 return manage(res);
17250 isl::id multi_val::range_tuple_id() const
17252 if (!ptr)
17253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17254 auto saved_ctx = ctx();
17255 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17256 auto res = isl_multi_val_get_range_tuple_id(get());
17257 if (!res)
17258 exception::throw_last_error(saved_ctx);
17259 return manage(res);
17262 isl::id multi_val::get_range_tuple_id() const
17264 return range_tuple_id();
17267 isl::multi_val multi_val::reset_range_tuple_id() const
17269 if (!ptr)
17270 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17271 auto saved_ctx = ctx();
17272 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17273 auto res = isl_multi_val_reset_range_tuple_id(copy());
17274 if (!res)
17275 exception::throw_last_error(saved_ctx);
17276 return manage(res);
17279 isl::multi_val multi_val::scale(isl::multi_val mv) const
17281 if (!ptr || mv.is_null())
17282 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17283 auto saved_ctx = ctx();
17284 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17285 auto res = isl_multi_val_scale_multi_val(copy(), mv.release());
17286 if (!res)
17287 exception::throw_last_error(saved_ctx);
17288 return manage(res);
17291 isl::multi_val multi_val::scale(isl::val v) const
17293 if (!ptr || v.is_null())
17294 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17295 auto saved_ctx = ctx();
17296 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17297 auto res = isl_multi_val_scale_val(copy(), v.release());
17298 if (!res)
17299 exception::throw_last_error(saved_ctx);
17300 return manage(res);
17303 isl::multi_val multi_val::scale(long v) const
17305 if (!ptr)
17306 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17307 return this->scale(isl::val(ctx(), v));
17310 isl::multi_val multi_val::scale_down(isl::multi_val mv) const
17312 if (!ptr || mv.is_null())
17313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17314 auto saved_ctx = ctx();
17315 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17316 auto res = isl_multi_val_scale_down_multi_val(copy(), mv.release());
17317 if (!res)
17318 exception::throw_last_error(saved_ctx);
17319 return manage(res);
17322 isl::multi_val multi_val::scale_down(isl::val v) const
17324 if (!ptr || v.is_null())
17325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17326 auto saved_ctx = ctx();
17327 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17328 auto res = isl_multi_val_scale_down_val(copy(), v.release());
17329 if (!res)
17330 exception::throw_last_error(saved_ctx);
17331 return manage(res);
17334 isl::multi_val multi_val::scale_down(long v) const
17336 if (!ptr)
17337 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17338 return this->scale_down(isl::val(ctx(), v));
17341 isl::multi_val multi_val::set_at(int pos, isl::val el) const
17343 if (!ptr || el.is_null())
17344 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17345 auto saved_ctx = ctx();
17346 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17347 auto res = isl_multi_val_set_at(copy(), pos, el.release());
17348 if (!res)
17349 exception::throw_last_error(saved_ctx);
17350 return manage(res);
17353 isl::multi_val multi_val::set_at(int pos, long el) const
17355 if (!ptr)
17356 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17357 return this->set_at(pos, isl::val(ctx(), el));
17360 isl::multi_val multi_val::set_range_tuple(isl::id id) const
17362 if (!ptr || id.is_null())
17363 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17364 auto saved_ctx = ctx();
17365 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17366 auto res = isl_multi_val_set_range_tuple_id(copy(), id.release());
17367 if (!res)
17368 exception::throw_last_error(saved_ctx);
17369 return manage(res);
17372 isl::multi_val multi_val::set_range_tuple(const std::string &id) const
17374 if (!ptr)
17375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17376 return this->set_range_tuple(isl::id(ctx(), id));
17379 unsigned multi_val::size() const
17381 if (!ptr)
17382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17383 auto saved_ctx = ctx();
17384 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17385 auto res = isl_multi_val_size(get());
17386 if (res < 0)
17387 exception::throw_last_error(saved_ctx);
17388 return res;
17391 isl::space multi_val::space() const
17393 if (!ptr)
17394 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17395 auto saved_ctx = ctx();
17396 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17397 auto res = isl_multi_val_get_space(get());
17398 if (!res)
17399 exception::throw_last_error(saved_ctx);
17400 return manage(res);
17403 isl::space multi_val::get_space() const
17405 return space();
17408 isl::multi_val multi_val::sub(isl::multi_val multi2) const
17410 if (!ptr || multi2.is_null())
17411 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17412 auto saved_ctx = ctx();
17413 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17414 auto res = isl_multi_val_sub(copy(), multi2.release());
17415 if (!res)
17416 exception::throw_last_error(saved_ctx);
17417 return manage(res);
17420 isl::multi_val multi_val::zero(isl::space space)
17422 if (space.is_null())
17423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17424 auto saved_ctx = space.ctx();
17425 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17426 auto res = isl_multi_val_zero(space.release());
17427 if (!res)
17428 exception::throw_last_error(saved_ctx);
17429 return manage(res);
17432 inline std::ostream &operator<<(std::ostream &os, const multi_val &obj)
17434 if (!obj.get())
17435 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17436 auto saved_ctx = isl_multi_val_get_ctx(obj.get());
17437 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17438 char *str = isl_multi_val_to_str(obj.get());
17439 if (!str)
17440 exception::throw_last_error(saved_ctx);
17441 os << str;
17442 free(str);
17443 return os;
17446 // implementations for isl::point
17447 point manage(__isl_take isl_point *ptr) {
17448 if (!ptr)
17449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17450 return point(ptr);
17452 point manage_copy(__isl_keep isl_point *ptr) {
17453 if (!ptr)
17454 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17455 auto saved_ctx = isl_point_get_ctx(ptr);
17456 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17457 ptr = isl_point_copy(ptr);
17458 if (!ptr)
17459 exception::throw_last_error(saved_ctx);
17460 return point(ptr);
17463 point::point(__isl_take isl_point *ptr)
17464 : ptr(ptr) {}
17466 point::point()
17467 : ptr(nullptr) {}
17469 point::point(const point &obj)
17470 : ptr(nullptr)
17472 if (!obj.ptr)
17473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17474 auto saved_ctx = isl_point_get_ctx(obj.ptr);
17475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17476 ptr = obj.copy();
17477 if (!ptr)
17478 exception::throw_last_error(saved_ctx);
17481 point &point::operator=(point obj) {
17482 std::swap(this->ptr, obj.ptr);
17483 return *this;
17486 point::~point() {
17487 if (ptr)
17488 isl_point_free(ptr);
17491 __isl_give isl_point *point::copy() const & {
17492 return isl_point_copy(ptr);
17495 __isl_keep isl_point *point::get() const {
17496 return ptr;
17499 __isl_give isl_point *point::release() {
17500 isl_point *tmp = ptr;
17501 ptr = nullptr;
17502 return tmp;
17505 bool point::is_null() const {
17506 return ptr == nullptr;
17509 isl::ctx point::ctx() const {
17510 return isl::ctx(isl_point_get_ctx(ptr));
17513 isl::basic_set point::affine_hull() const
17515 if (!ptr)
17516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17517 return isl::basic_set(*this).affine_hull();
17520 isl::basic_set point::apply(const isl::basic_map &bmap) const
17522 if (!ptr)
17523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17524 return isl::basic_set(*this).apply(bmap);
17527 isl::set point::apply(const isl::map &map) const
17529 if (!ptr)
17530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17531 return isl::basic_set(*this).apply(map);
17534 isl::union_set point::apply(const isl::union_map &umap) const
17536 if (!ptr)
17537 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17538 return isl::basic_set(*this).apply(umap);
17541 isl::pw_multi_aff point::as_pw_multi_aff() const
17543 if (!ptr)
17544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17545 return isl::basic_set(*this).as_pw_multi_aff();
17548 isl::set point::as_set() const
17550 if (!ptr)
17551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17552 return isl::basic_set(*this).as_set();
17555 isl::set point::bind(const isl::multi_id &tuple) const
17557 if (!ptr)
17558 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17559 return isl::basic_set(*this).bind(tuple);
17562 isl::set point::coalesce() const
17564 if (!ptr)
17565 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17566 return isl::basic_set(*this).coalesce();
17569 isl::set point::complement() const
17571 if (!ptr)
17572 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17573 return isl::basic_set(*this).complement();
17576 isl::union_set point::compute_divs() const
17578 if (!ptr)
17579 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17580 return isl::basic_set(*this).compute_divs();
17583 isl::basic_set point::detect_equalities() const
17585 if (!ptr)
17586 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17587 return isl::basic_set(*this).detect_equalities();
17590 isl::val point::dim_max_val(int pos) const
17592 if (!ptr)
17593 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17594 return isl::basic_set(*this).dim_max_val(pos);
17597 isl::val point::dim_min_val(int pos) const
17599 if (!ptr)
17600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17601 return isl::basic_set(*this).dim_min_val(pos);
17604 isl::set point::drop_unused_params() const
17606 if (!ptr)
17607 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17608 return isl::basic_set(*this).drop_unused_params();
17611 bool point::every_set(const std::function<bool(isl::set)> &test) const
17613 if (!ptr)
17614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17615 return isl::basic_set(*this).every_set(test);
17618 isl::set point::extract_set(const isl::space &space) const
17620 if (!ptr)
17621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17622 return isl::basic_set(*this).extract_set(space);
17625 isl::basic_set point::flatten() const
17627 if (!ptr)
17628 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17629 return isl::basic_set(*this).flatten();
17632 void point::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
17634 if (!ptr)
17635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17636 return isl::basic_set(*this).foreach_basic_set(fn);
17639 void point::foreach_point(const std::function<void(isl::point)> &fn) const
17641 if (!ptr)
17642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17643 return isl::basic_set(*this).foreach_point(fn);
17646 void point::foreach_set(const std::function<void(isl::set)> &fn) const
17648 if (!ptr)
17649 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17650 return isl::basic_set(*this).foreach_set(fn);
17653 isl::basic_set point::gist(const isl::basic_set &context) const
17655 if (!ptr)
17656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17657 return isl::basic_set(*this).gist(context);
17660 isl::set point::gist(const isl::set &context) const
17662 if (!ptr)
17663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17664 return isl::basic_set(*this).gist(context);
17667 isl::union_set point::gist(const isl::union_set &context) const
17669 if (!ptr)
17670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17671 return isl::basic_set(*this).gist(context);
17674 isl::set point::gist_params(const isl::set &context) const
17676 if (!ptr)
17677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17678 return isl::basic_set(*this).gist_params(context);
17681 isl::map point::identity() const
17683 if (!ptr)
17684 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17685 return isl::basic_set(*this).identity();
17688 isl::pw_aff point::indicator_function() const
17690 if (!ptr)
17691 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17692 return isl::basic_set(*this).indicator_function();
17695 isl::map point::insert_domain(const isl::space &domain) const
17697 if (!ptr)
17698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17699 return isl::basic_set(*this).insert_domain(domain);
17702 isl::basic_set point::intersect(const isl::basic_set &bset2) const
17704 if (!ptr)
17705 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17706 return isl::basic_set(*this).intersect(bset2);
17709 isl::set point::intersect(const isl::set &set2) const
17711 if (!ptr)
17712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17713 return isl::basic_set(*this).intersect(set2);
17716 isl::union_set point::intersect(const isl::union_set &uset2) const
17718 if (!ptr)
17719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17720 return isl::basic_set(*this).intersect(uset2);
17723 isl::basic_set point::intersect_params(const isl::basic_set &bset2) const
17725 if (!ptr)
17726 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17727 return isl::basic_set(*this).intersect_params(bset2);
17730 isl::set point::intersect_params(const isl::set &params) const
17732 if (!ptr)
17733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17734 return isl::basic_set(*this).intersect_params(params);
17737 bool point::involves_locals() const
17739 if (!ptr)
17740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17741 return isl::basic_set(*this).involves_locals();
17744 bool point::is_disjoint(const isl::set &set2) const
17746 if (!ptr)
17747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17748 return isl::basic_set(*this).is_disjoint(set2);
17751 bool point::is_disjoint(const isl::union_set &uset2) const
17753 if (!ptr)
17754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17755 return isl::basic_set(*this).is_disjoint(uset2);
17758 bool point::is_empty() const
17760 if (!ptr)
17761 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17762 return isl::basic_set(*this).is_empty();
17765 bool point::is_equal(const isl::basic_set &bset2) const
17767 if (!ptr)
17768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17769 return isl::basic_set(*this).is_equal(bset2);
17772 bool point::is_equal(const isl::set &set2) const
17774 if (!ptr)
17775 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17776 return isl::basic_set(*this).is_equal(set2);
17779 bool point::is_equal(const isl::union_set &uset2) const
17781 if (!ptr)
17782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17783 return isl::basic_set(*this).is_equal(uset2);
17786 bool point::is_singleton() const
17788 if (!ptr)
17789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17790 return isl::basic_set(*this).is_singleton();
17793 bool point::is_strict_subset(const isl::set &set2) const
17795 if (!ptr)
17796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17797 return isl::basic_set(*this).is_strict_subset(set2);
17800 bool point::is_strict_subset(const isl::union_set &uset2) const
17802 if (!ptr)
17803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17804 return isl::basic_set(*this).is_strict_subset(uset2);
17807 bool point::is_subset(const isl::basic_set &bset2) const
17809 if (!ptr)
17810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17811 return isl::basic_set(*this).is_subset(bset2);
17814 bool point::is_subset(const isl::set &set2) const
17816 if (!ptr)
17817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17818 return isl::basic_set(*this).is_subset(set2);
17821 bool point::is_subset(const isl::union_set &uset2) const
17823 if (!ptr)
17824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17825 return isl::basic_set(*this).is_subset(uset2);
17828 bool point::is_wrapping() const
17830 if (!ptr)
17831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17832 return isl::basic_set(*this).is_wrapping();
17835 bool point::isa_set() const
17837 if (!ptr)
17838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17839 return isl::basic_set(*this).isa_set();
17842 isl::fixed_box point::lattice_tile() const
17844 if (!ptr)
17845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17846 return isl::basic_set(*this).lattice_tile();
17849 isl::set point::lexmax() const
17851 if (!ptr)
17852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17853 return isl::basic_set(*this).lexmax();
17856 isl::pw_multi_aff point::lexmax_pw_multi_aff() const
17858 if (!ptr)
17859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17860 return isl::basic_set(*this).lexmax_pw_multi_aff();
17863 isl::set point::lexmin() const
17865 if (!ptr)
17866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17867 return isl::basic_set(*this).lexmin();
17870 isl::pw_multi_aff point::lexmin_pw_multi_aff() const
17872 if (!ptr)
17873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17874 return isl::basic_set(*this).lexmin_pw_multi_aff();
17877 isl::set point::lower_bound(const isl::multi_pw_aff &lower) const
17879 if (!ptr)
17880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17881 return isl::basic_set(*this).lower_bound(lower);
17884 isl::set point::lower_bound(const isl::multi_val &lower) const
17886 if (!ptr)
17887 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17888 return isl::basic_set(*this).lower_bound(lower);
17891 isl::multi_pw_aff point::max_multi_pw_aff() const
17893 if (!ptr)
17894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17895 return isl::basic_set(*this).max_multi_pw_aff();
17898 isl::val point::max_val(const isl::aff &obj) const
17900 if (!ptr)
17901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17902 return isl::basic_set(*this).max_val(obj);
17905 isl::multi_pw_aff point::min_multi_pw_aff() const
17907 if (!ptr)
17908 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17909 return isl::basic_set(*this).min_multi_pw_aff();
17912 isl::val point::min_val(const isl::aff &obj) const
17914 if (!ptr)
17915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17916 return isl::basic_set(*this).min_val(obj);
17919 isl::multi_val point::multi_val() const
17921 if (!ptr)
17922 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17923 auto saved_ctx = ctx();
17924 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17925 auto res = isl_point_get_multi_val(get());
17926 if (!res)
17927 exception::throw_last_error(saved_ctx);
17928 return manage(res);
17931 isl::multi_val point::get_multi_val() const
17933 return multi_val();
17936 unsigned point::n_basic_set() const
17938 if (!ptr)
17939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17940 return isl::basic_set(*this).n_basic_set();
17943 isl::pw_aff point::param_pw_aff_on_domain(const isl::id &id) const
17945 if (!ptr)
17946 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17947 return isl::basic_set(*this).param_pw_aff_on_domain(id);
17950 isl::pw_aff point::param_pw_aff_on_domain(const std::string &id) const
17952 if (!ptr)
17953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17954 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
17957 isl::basic_set point::params() const
17959 if (!ptr)
17960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17961 return isl::basic_set(*this).params();
17964 isl::multi_val point::plain_multi_val_if_fixed() const
17966 if (!ptr)
17967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17968 return isl::basic_set(*this).plain_multi_val_if_fixed();
17971 isl::basic_set point::polyhedral_hull() const
17973 if (!ptr)
17974 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17975 return isl::basic_set(*this).polyhedral_hull();
17978 isl::set point::preimage(const isl::multi_aff &ma) const
17980 if (!ptr)
17981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17982 return isl::basic_set(*this).preimage(ma);
17985 isl::set point::preimage(const isl::multi_pw_aff &mpa) const
17987 if (!ptr)
17988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17989 return isl::basic_set(*this).preimage(mpa);
17992 isl::set point::preimage(const isl::pw_multi_aff &pma) const
17994 if (!ptr)
17995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17996 return isl::basic_set(*this).preimage(pma);
17999 isl::union_set point::preimage(const isl::union_pw_multi_aff &upma) const
18001 if (!ptr)
18002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18003 return isl::basic_set(*this).preimage(upma);
18006 isl::set point::product(const isl::set &set2) const
18008 if (!ptr)
18009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18010 return isl::basic_set(*this).product(set2);
18013 isl::set point::project_out_all_params() const
18015 if (!ptr)
18016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18017 return isl::basic_set(*this).project_out_all_params();
18020 isl::set point::project_out_param(const isl::id &id) const
18022 if (!ptr)
18023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18024 return isl::basic_set(*this).project_out_param(id);
18027 isl::set point::project_out_param(const std::string &id) const
18029 if (!ptr)
18030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18031 return this->project_out_param(isl::id(ctx(), id));
18034 isl::set point::project_out_param(const isl::id_list &list) const
18036 if (!ptr)
18037 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18038 return isl::basic_set(*this).project_out_param(list);
18041 isl::pw_aff point::pw_aff_on_domain(const isl::val &v) const
18043 if (!ptr)
18044 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18045 return isl::basic_set(*this).pw_aff_on_domain(v);
18048 isl::pw_aff point::pw_aff_on_domain(long v) const
18050 if (!ptr)
18051 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18052 return this->pw_aff_on_domain(isl::val(ctx(), v));
18055 isl::pw_multi_aff point::pw_multi_aff_on_domain(const isl::multi_val &mv) const
18057 if (!ptr)
18058 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18059 return isl::basic_set(*this).pw_multi_aff_on_domain(mv);
18062 isl::basic_set point::sample() const
18064 if (!ptr)
18065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18066 return isl::basic_set(*this).sample();
18069 isl::point point::sample_point() const
18071 if (!ptr)
18072 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18073 return isl::basic_set(*this).sample_point();
18076 isl::set_list point::set_list() const
18078 if (!ptr)
18079 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18080 return isl::basic_set(*this).set_list();
18083 isl::fixed_box point::simple_fixed_box_hull() const
18085 if (!ptr)
18086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18087 return isl::basic_set(*this).simple_fixed_box_hull();
18090 isl::space point::space() const
18092 if (!ptr)
18093 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18094 return isl::basic_set(*this).space();
18097 isl::val point::stride(int pos) const
18099 if (!ptr)
18100 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18101 return isl::basic_set(*this).stride(pos);
18104 isl::set point::subtract(const isl::set &set2) const
18106 if (!ptr)
18107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18108 return isl::basic_set(*this).subtract(set2);
18111 isl::union_set point::subtract(const isl::union_set &uset2) const
18113 if (!ptr)
18114 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18115 return isl::basic_set(*this).subtract(uset2);
18118 isl::set_list point::to_list() const
18120 if (!ptr)
18121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18122 return isl::basic_set(*this).to_list();
18125 isl::set point::to_set() const
18127 if (!ptr)
18128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18129 auto saved_ctx = ctx();
18130 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18131 auto res = isl_point_to_set(copy());
18132 if (!res)
18133 exception::throw_last_error(saved_ctx);
18134 return manage(res);
18137 isl::union_set point::to_union_set() const
18139 if (!ptr)
18140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18141 return isl::basic_set(*this).to_union_set();
18144 isl::map point::translation() const
18146 if (!ptr)
18147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18148 return isl::basic_set(*this).translation();
18151 unsigned point::tuple_dim() const
18153 if (!ptr)
18154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18155 return isl::basic_set(*this).tuple_dim();
18158 isl::set point::unbind_params(const isl::multi_id &tuple) const
18160 if (!ptr)
18161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18162 return isl::basic_set(*this).unbind_params(tuple);
18165 isl::map point::unbind_params_insert_domain(const isl::multi_id &domain) const
18167 if (!ptr)
18168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18169 return isl::basic_set(*this).unbind_params_insert_domain(domain);
18172 isl::set point::unite(const isl::basic_set &bset2) const
18174 if (!ptr)
18175 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18176 return isl::basic_set(*this).unite(bset2);
18179 isl::set point::unite(const isl::set &set2) const
18181 if (!ptr)
18182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18183 return isl::basic_set(*this).unite(set2);
18186 isl::union_set point::unite(const isl::union_set &uset2) const
18188 if (!ptr)
18189 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18190 return isl::basic_set(*this).unite(uset2);
18193 isl::basic_set point::unshifted_simple_hull() const
18195 if (!ptr)
18196 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18197 return isl::basic_set(*this).unshifted_simple_hull();
18200 isl::map point::unwrap() const
18202 if (!ptr)
18203 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18204 return isl::basic_set(*this).unwrap();
18207 isl::set point::upper_bound(const isl::multi_pw_aff &upper) const
18209 if (!ptr)
18210 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18211 return isl::basic_set(*this).upper_bound(upper);
18214 isl::set point::upper_bound(const isl::multi_val &upper) const
18216 if (!ptr)
18217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18218 return isl::basic_set(*this).upper_bound(upper);
18221 isl::set point::wrapped_reverse() const
18223 if (!ptr)
18224 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18225 return isl::basic_set(*this).wrapped_reverse();
18228 inline std::ostream &operator<<(std::ostream &os, const point &obj)
18230 if (!obj.get())
18231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18232 auto saved_ctx = isl_point_get_ctx(obj.get());
18233 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18234 char *str = isl_point_to_str(obj.get());
18235 if (!str)
18236 exception::throw_last_error(saved_ctx);
18237 os << str;
18238 free(str);
18239 return os;
18242 // implementations for isl::pw_aff
18243 pw_aff manage(__isl_take isl_pw_aff *ptr) {
18244 if (!ptr)
18245 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18246 return pw_aff(ptr);
18248 pw_aff manage_copy(__isl_keep isl_pw_aff *ptr) {
18249 if (!ptr)
18250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18251 auto saved_ctx = isl_pw_aff_get_ctx(ptr);
18252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18253 ptr = isl_pw_aff_copy(ptr);
18254 if (!ptr)
18255 exception::throw_last_error(saved_ctx);
18256 return pw_aff(ptr);
18259 pw_aff::pw_aff(__isl_take isl_pw_aff *ptr)
18260 : ptr(ptr) {}
18262 pw_aff::pw_aff()
18263 : ptr(nullptr) {}
18265 pw_aff::pw_aff(const pw_aff &obj)
18266 : ptr(nullptr)
18268 if (!obj.ptr)
18269 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18270 auto saved_ctx = isl_pw_aff_get_ctx(obj.ptr);
18271 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18272 ptr = obj.copy();
18273 if (!ptr)
18274 exception::throw_last_error(saved_ctx);
18277 pw_aff::pw_aff(isl::aff aff)
18279 if (aff.is_null())
18280 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18281 auto saved_ctx = aff.ctx();
18282 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18283 auto res = isl_pw_aff_from_aff(aff.release());
18284 if (!res)
18285 exception::throw_last_error(saved_ctx);
18286 ptr = res;
18289 pw_aff::pw_aff(isl::ctx ctx, const std::string &str)
18291 auto saved_ctx = ctx;
18292 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18293 auto res = isl_pw_aff_read_from_str(ctx.release(), str.c_str());
18294 if (!res)
18295 exception::throw_last_error(saved_ctx);
18296 ptr = res;
18299 pw_aff &pw_aff::operator=(pw_aff obj) {
18300 std::swap(this->ptr, obj.ptr);
18301 return *this;
18304 pw_aff::~pw_aff() {
18305 if (ptr)
18306 isl_pw_aff_free(ptr);
18309 __isl_give isl_pw_aff *pw_aff::copy() const & {
18310 return isl_pw_aff_copy(ptr);
18313 __isl_keep isl_pw_aff *pw_aff::get() const {
18314 return ptr;
18317 __isl_give isl_pw_aff *pw_aff::release() {
18318 isl_pw_aff *tmp = ptr;
18319 ptr = nullptr;
18320 return tmp;
18323 bool pw_aff::is_null() const {
18324 return ptr == nullptr;
18327 isl::ctx pw_aff::ctx() const {
18328 return isl::ctx(isl_pw_aff_get_ctx(ptr));
18331 isl::multi_pw_aff pw_aff::add(const isl::multi_pw_aff &multi2) const
18333 if (!ptr)
18334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18335 return isl::pw_multi_aff(*this).add(multi2);
18338 isl::multi_union_pw_aff pw_aff::add(const isl::multi_union_pw_aff &multi2) const
18340 if (!ptr)
18341 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18342 return isl::union_pw_aff(*this).add(multi2);
18345 isl::pw_aff pw_aff::add(isl::pw_aff pwaff2) const
18347 if (!ptr || pwaff2.is_null())
18348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18349 auto saved_ctx = ctx();
18350 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18351 auto res = isl_pw_aff_add(copy(), pwaff2.release());
18352 if (!res)
18353 exception::throw_last_error(saved_ctx);
18354 return manage(res);
18357 isl::pw_multi_aff pw_aff::add(const isl::pw_multi_aff &pma2) const
18359 if (!ptr)
18360 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18361 return isl::pw_multi_aff(*this).add(pma2);
18364 isl::union_pw_aff pw_aff::add(const isl::union_pw_aff &upa2) const
18366 if (!ptr)
18367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18368 return isl::union_pw_aff(*this).add(upa2);
18371 isl::union_pw_multi_aff pw_aff::add(const isl::union_pw_multi_aff &upma2) const
18373 if (!ptr)
18374 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18375 return isl::union_pw_aff(*this).add(upma2);
18378 isl::pw_aff pw_aff::add(const isl::aff &pwaff2) const
18380 if (!ptr)
18381 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18382 return this->add(isl::pw_aff(pwaff2));
18385 isl::pw_aff pw_aff::add_constant(isl::val v) const
18387 if (!ptr || v.is_null())
18388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18389 auto saved_ctx = ctx();
18390 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18391 auto res = isl_pw_aff_add_constant_val(copy(), v.release());
18392 if (!res)
18393 exception::throw_last_error(saved_ctx);
18394 return manage(res);
18397 isl::pw_aff pw_aff::add_constant(long v) const
18399 if (!ptr)
18400 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18401 return this->add_constant(isl::val(ctx(), v));
18404 isl::pw_multi_aff pw_aff::add_constant(const isl::multi_val &mv) const
18406 if (!ptr)
18407 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18408 return isl::pw_multi_aff(*this).add_constant(mv);
18411 isl::union_pw_multi_aff pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
18413 if (!ptr)
18414 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18415 return isl::union_pw_aff(*this).apply(upma2);
18418 isl::aff pw_aff::as_aff() const
18420 if (!ptr)
18421 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18422 auto saved_ctx = ctx();
18423 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18424 auto res = isl_pw_aff_as_aff(copy());
18425 if (!res)
18426 exception::throw_last_error(saved_ctx);
18427 return manage(res);
18430 isl::map pw_aff::as_map() const
18432 if (!ptr)
18433 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18434 auto saved_ctx = ctx();
18435 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18436 auto res = isl_pw_aff_as_map(copy());
18437 if (!res)
18438 exception::throw_last_error(saved_ctx);
18439 return manage(res);
18442 isl::multi_aff pw_aff::as_multi_aff() const
18444 if (!ptr)
18445 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18446 return isl::pw_multi_aff(*this).as_multi_aff();
18449 isl::multi_union_pw_aff pw_aff::as_multi_union_pw_aff() const
18451 if (!ptr)
18452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18453 return isl::union_pw_aff(*this).as_multi_union_pw_aff();
18456 isl::pw_multi_aff pw_aff::as_pw_multi_aff() const
18458 if (!ptr)
18459 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18460 return isl::union_pw_aff(*this).as_pw_multi_aff();
18463 isl::set pw_aff::as_set() const
18465 if (!ptr)
18466 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18467 return isl::pw_multi_aff(*this).as_set();
18470 isl::union_map pw_aff::as_union_map() const
18472 if (!ptr)
18473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18474 return isl::union_pw_aff(*this).as_union_map();
18477 isl::pw_aff pw_aff::at(int pos) const
18479 if (!ptr)
18480 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18481 return isl::pw_multi_aff(*this).at(pos);
18484 isl::set pw_aff::bind(const isl::multi_id &tuple) const
18486 if (!ptr)
18487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18488 return isl::multi_pw_aff(*this).bind(tuple);
18491 isl::set pw_aff::bind(isl::id id) const
18493 if (!ptr || id.is_null())
18494 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18495 auto saved_ctx = ctx();
18496 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18497 auto res = isl_pw_aff_bind_id(copy(), id.release());
18498 if (!res)
18499 exception::throw_last_error(saved_ctx);
18500 return manage(res);
18503 isl::set pw_aff::bind(const std::string &id) const
18505 if (!ptr)
18506 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18507 return this->bind(isl::id(ctx(), id));
18510 isl::pw_aff pw_aff::bind_domain(isl::multi_id tuple) const
18512 if (!ptr || tuple.is_null())
18513 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18514 auto saved_ctx = ctx();
18515 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18516 auto res = isl_pw_aff_bind_domain(copy(), tuple.release());
18517 if (!res)
18518 exception::throw_last_error(saved_ctx);
18519 return manage(res);
18522 isl::pw_aff pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
18524 if (!ptr || tuple.is_null())
18525 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18526 auto saved_ctx = ctx();
18527 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18528 auto res = isl_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
18529 if (!res)
18530 exception::throw_last_error(saved_ctx);
18531 return manage(res);
18534 isl::pw_aff pw_aff::ceil() const
18536 if (!ptr)
18537 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18538 auto saved_ctx = ctx();
18539 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18540 auto res = isl_pw_aff_ceil(copy());
18541 if (!res)
18542 exception::throw_last_error(saved_ctx);
18543 return manage(res);
18546 isl::pw_aff pw_aff::coalesce() const
18548 if (!ptr)
18549 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18550 auto saved_ctx = ctx();
18551 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18552 auto res = isl_pw_aff_coalesce(copy());
18553 if (!res)
18554 exception::throw_last_error(saved_ctx);
18555 return manage(res);
18558 isl::pw_aff pw_aff::cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const
18560 if (!ptr || pwaff_true.is_null() || pwaff_false.is_null())
18561 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18562 auto saved_ctx = ctx();
18563 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18564 auto res = isl_pw_aff_cond(copy(), pwaff_true.release(), pwaff_false.release());
18565 if (!res)
18566 exception::throw_last_error(saved_ctx);
18567 return manage(res);
18570 isl::pw_aff pw_aff::div(isl::pw_aff pa2) const
18572 if (!ptr || pa2.is_null())
18573 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18574 auto saved_ctx = ctx();
18575 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18576 auto res = isl_pw_aff_div(copy(), pa2.release());
18577 if (!res)
18578 exception::throw_last_error(saved_ctx);
18579 return manage(res);
18582 isl::set pw_aff::domain() const
18584 if (!ptr)
18585 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18586 auto saved_ctx = ctx();
18587 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18588 auto res = isl_pw_aff_domain(copy());
18589 if (!res)
18590 exception::throw_last_error(saved_ctx);
18591 return manage(res);
18594 isl::pw_aff pw_aff::domain_reverse() const
18596 if (!ptr)
18597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18598 auto saved_ctx = ctx();
18599 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18600 auto res = isl_pw_aff_domain_reverse(copy());
18601 if (!res)
18602 exception::throw_last_error(saved_ctx);
18603 return manage(res);
18606 isl::pw_aff pw_aff::drop_unused_params() const
18608 if (!ptr)
18609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18610 auto saved_ctx = ctx();
18611 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18612 auto res = isl_pw_aff_drop_unused_params(copy());
18613 if (!res)
18614 exception::throw_last_error(saved_ctx);
18615 return manage(res);
18618 isl::set pw_aff::eq_set(isl::pw_aff pwaff2) const
18620 if (!ptr || pwaff2.is_null())
18621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18622 auto saved_ctx = ctx();
18623 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18624 auto res = isl_pw_aff_eq_set(copy(), pwaff2.release());
18625 if (!res)
18626 exception::throw_last_error(saved_ctx);
18627 return manage(res);
18630 isl::val pw_aff::eval(isl::point pnt) const
18632 if (!ptr || pnt.is_null())
18633 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18634 auto saved_ctx = ctx();
18635 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18636 auto res = isl_pw_aff_eval(copy(), pnt.release());
18637 if (!res)
18638 exception::throw_last_error(saved_ctx);
18639 return manage(res);
18642 isl::pw_multi_aff pw_aff::extract_pw_multi_aff(const isl::space &space) const
18644 if (!ptr)
18645 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18646 return isl::union_pw_aff(*this).extract_pw_multi_aff(space);
18649 isl::multi_pw_aff pw_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
18651 if (!ptr)
18652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18653 return isl::pw_multi_aff(*this).flat_range_product(multi2);
18656 isl::multi_union_pw_aff pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
18658 if (!ptr)
18659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18660 return isl::union_pw_aff(*this).flat_range_product(multi2);
18663 isl::pw_multi_aff pw_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
18665 if (!ptr)
18666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18667 return isl::pw_multi_aff(*this).flat_range_product(pma2);
18670 isl::union_pw_multi_aff pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
18672 if (!ptr)
18673 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18674 return isl::union_pw_aff(*this).flat_range_product(upma2);
18677 isl::pw_aff pw_aff::floor() const
18679 if (!ptr)
18680 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18681 auto saved_ctx = ctx();
18682 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18683 auto res = isl_pw_aff_floor(copy());
18684 if (!res)
18685 exception::throw_last_error(saved_ctx);
18686 return manage(res);
18689 void pw_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
18691 if (!ptr)
18692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18693 return isl::pw_multi_aff(*this).foreach_piece(fn);
18696 isl::set pw_aff::ge_set(isl::pw_aff pwaff2) const
18698 if (!ptr || pwaff2.is_null())
18699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18700 auto saved_ctx = ctx();
18701 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18702 auto res = isl_pw_aff_ge_set(copy(), pwaff2.release());
18703 if (!res)
18704 exception::throw_last_error(saved_ctx);
18705 return manage(res);
18708 isl::pw_aff pw_aff::gist(isl::set context) const
18710 if (!ptr || context.is_null())
18711 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18712 auto saved_ctx = ctx();
18713 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18714 auto res = isl_pw_aff_gist(copy(), context.release());
18715 if (!res)
18716 exception::throw_last_error(saved_ctx);
18717 return manage(res);
18720 isl::union_pw_aff pw_aff::gist(const isl::union_set &context) const
18722 if (!ptr)
18723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18724 return isl::union_pw_aff(*this).gist(context);
18727 isl::pw_aff pw_aff::gist(const isl::basic_set &context) const
18729 if (!ptr)
18730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18731 return this->gist(isl::set(context));
18734 isl::pw_aff pw_aff::gist(const isl::point &context) const
18736 if (!ptr)
18737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18738 return this->gist(isl::set(context));
18741 isl::pw_aff pw_aff::gist_params(isl::set context) const
18743 if (!ptr || context.is_null())
18744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18745 auto saved_ctx = ctx();
18746 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18747 auto res = isl_pw_aff_gist_params(copy(), context.release());
18748 if (!res)
18749 exception::throw_last_error(saved_ctx);
18750 return manage(res);
18753 isl::set pw_aff::gt_set(isl::pw_aff pwaff2) const
18755 if (!ptr || pwaff2.is_null())
18756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18757 auto saved_ctx = ctx();
18758 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18759 auto res = isl_pw_aff_gt_set(copy(), pwaff2.release());
18760 if (!res)
18761 exception::throw_last_error(saved_ctx);
18762 return manage(res);
18765 bool pw_aff::has_range_tuple_id() const
18767 if (!ptr)
18768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18769 return isl::pw_multi_aff(*this).has_range_tuple_id();
18772 isl::multi_pw_aff pw_aff::identity() const
18774 if (!ptr)
18775 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18776 return isl::pw_multi_aff(*this).identity();
18779 isl::pw_aff pw_aff::insert_domain(isl::space domain) const
18781 if (!ptr || domain.is_null())
18782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18783 auto saved_ctx = ctx();
18784 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18785 auto res = isl_pw_aff_insert_domain(copy(), domain.release());
18786 if (!res)
18787 exception::throw_last_error(saved_ctx);
18788 return manage(res);
18791 isl::pw_aff pw_aff::intersect_domain(isl::set set) const
18793 if (!ptr || set.is_null())
18794 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18795 auto saved_ctx = ctx();
18796 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18797 auto res = isl_pw_aff_intersect_domain(copy(), set.release());
18798 if (!res)
18799 exception::throw_last_error(saved_ctx);
18800 return manage(res);
18803 isl::union_pw_aff pw_aff::intersect_domain(const isl::space &space) const
18805 if (!ptr)
18806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18807 return isl::union_pw_aff(*this).intersect_domain(space);
18810 isl::union_pw_aff pw_aff::intersect_domain(const isl::union_set &uset) const
18812 if (!ptr)
18813 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18814 return isl::union_pw_aff(*this).intersect_domain(uset);
18817 isl::pw_aff pw_aff::intersect_domain(const isl::basic_set &set) const
18819 if (!ptr)
18820 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18821 return this->intersect_domain(isl::set(set));
18824 isl::pw_aff pw_aff::intersect_domain(const isl::point &set) const
18826 if (!ptr)
18827 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18828 return this->intersect_domain(isl::set(set));
18831 isl::union_pw_aff pw_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
18833 if (!ptr)
18834 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18835 return isl::union_pw_aff(*this).intersect_domain_wrapped_domain(uset);
18838 isl::union_pw_aff pw_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
18840 if (!ptr)
18841 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18842 return isl::union_pw_aff(*this).intersect_domain_wrapped_range(uset);
18845 isl::pw_aff pw_aff::intersect_params(isl::set set) const
18847 if (!ptr || set.is_null())
18848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18849 auto saved_ctx = ctx();
18850 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18851 auto res = isl_pw_aff_intersect_params(copy(), set.release());
18852 if (!res)
18853 exception::throw_last_error(saved_ctx);
18854 return manage(res);
18857 bool pw_aff::involves_locals() const
18859 if (!ptr)
18860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18861 return isl::pw_multi_aff(*this).involves_locals();
18864 bool pw_aff::involves_nan() const
18866 if (!ptr)
18867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18868 return isl::multi_pw_aff(*this).involves_nan();
18871 bool pw_aff::involves_param(const isl::id &id) const
18873 if (!ptr)
18874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18875 return isl::pw_multi_aff(*this).involves_param(id);
18878 bool pw_aff::involves_param(const std::string &id) const
18880 if (!ptr)
18881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18882 return this->involves_param(isl::id(ctx(), id));
18885 bool pw_aff::involves_param(const isl::id_list &list) const
18887 if (!ptr)
18888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18889 return isl::pw_multi_aff(*this).involves_param(list);
18892 bool pw_aff::isa_aff() const
18894 if (!ptr)
18895 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18896 auto saved_ctx = ctx();
18897 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18898 auto res = isl_pw_aff_isa_aff(get());
18899 if (res < 0)
18900 exception::throw_last_error(saved_ctx);
18901 return res;
18904 bool pw_aff::isa_multi_aff() const
18906 if (!ptr)
18907 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18908 return isl::pw_multi_aff(*this).isa_multi_aff();
18911 bool pw_aff::isa_pw_multi_aff() const
18913 if (!ptr)
18914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18915 return isl::union_pw_aff(*this).isa_pw_multi_aff();
18918 isl::set pw_aff::le_set(isl::pw_aff pwaff2) const
18920 if (!ptr || pwaff2.is_null())
18921 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18922 auto saved_ctx = ctx();
18923 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18924 auto res = isl_pw_aff_le_set(copy(), pwaff2.release());
18925 if (!res)
18926 exception::throw_last_error(saved_ctx);
18927 return manage(res);
18930 isl::pw_aff_list pw_aff::list() const
18932 if (!ptr)
18933 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18934 return isl::multi_pw_aff(*this).list();
18937 isl::set pw_aff::lt_set(isl::pw_aff pwaff2) const
18939 if (!ptr || pwaff2.is_null())
18940 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18941 auto saved_ctx = ctx();
18942 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18943 auto res = isl_pw_aff_lt_set(copy(), pwaff2.release());
18944 if (!res)
18945 exception::throw_last_error(saved_ctx);
18946 return manage(res);
18949 isl::multi_pw_aff pw_aff::max(const isl::multi_pw_aff &multi2) const
18951 if (!ptr)
18952 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18953 return isl::pw_multi_aff(*this).max(multi2);
18956 isl::pw_aff pw_aff::max(isl::pw_aff pwaff2) const
18958 if (!ptr || pwaff2.is_null())
18959 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18960 auto saved_ctx = ctx();
18961 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18962 auto res = isl_pw_aff_max(copy(), pwaff2.release());
18963 if (!res)
18964 exception::throw_last_error(saved_ctx);
18965 return manage(res);
18968 isl::pw_aff pw_aff::max(const isl::aff &pwaff2) const
18970 if (!ptr)
18971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18972 return this->max(isl::pw_aff(pwaff2));
18975 isl::multi_val pw_aff::max_multi_val() const
18977 if (!ptr)
18978 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18979 return isl::pw_multi_aff(*this).max_multi_val();
18982 isl::val pw_aff::max_val() const
18984 if (!ptr)
18985 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18986 auto saved_ctx = ctx();
18987 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18988 auto res = isl_pw_aff_max_val(copy());
18989 if (!res)
18990 exception::throw_last_error(saved_ctx);
18991 return manage(res);
18994 isl::multi_pw_aff pw_aff::min(const isl::multi_pw_aff &multi2) const
18996 if (!ptr)
18997 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18998 return isl::pw_multi_aff(*this).min(multi2);
19001 isl::pw_aff pw_aff::min(isl::pw_aff pwaff2) const
19003 if (!ptr || pwaff2.is_null())
19004 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19005 auto saved_ctx = ctx();
19006 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19007 auto res = isl_pw_aff_min(copy(), pwaff2.release());
19008 if (!res)
19009 exception::throw_last_error(saved_ctx);
19010 return manage(res);
19013 isl::pw_aff pw_aff::min(const isl::aff &pwaff2) const
19015 if (!ptr)
19016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19017 return this->min(isl::pw_aff(pwaff2));
19020 isl::multi_val pw_aff::min_multi_val() const
19022 if (!ptr)
19023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19024 return isl::pw_multi_aff(*this).min_multi_val();
19027 isl::val pw_aff::min_val() const
19029 if (!ptr)
19030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19031 auto saved_ctx = ctx();
19032 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19033 auto res = isl_pw_aff_min_val(copy());
19034 if (!res)
19035 exception::throw_last_error(saved_ctx);
19036 return manage(res);
19039 isl::pw_aff pw_aff::mod(isl::val mod) const
19041 if (!ptr || mod.is_null())
19042 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19043 auto saved_ctx = ctx();
19044 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19045 auto res = isl_pw_aff_mod_val(copy(), mod.release());
19046 if (!res)
19047 exception::throw_last_error(saved_ctx);
19048 return manage(res);
19051 isl::pw_aff pw_aff::mod(long mod) const
19053 if (!ptr)
19054 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19055 return this->mod(isl::val(ctx(), mod));
19058 isl::pw_aff pw_aff::mul(isl::pw_aff pwaff2) const
19060 if (!ptr || pwaff2.is_null())
19061 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19062 auto saved_ctx = ctx();
19063 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19064 auto res = isl_pw_aff_mul(copy(), pwaff2.release());
19065 if (!res)
19066 exception::throw_last_error(saved_ctx);
19067 return manage(res);
19070 unsigned pw_aff::n_piece() const
19072 if (!ptr)
19073 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19074 return isl::pw_multi_aff(*this).n_piece();
19077 isl::set pw_aff::ne_set(isl::pw_aff pwaff2) const
19079 if (!ptr || pwaff2.is_null())
19080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19081 auto saved_ctx = ctx();
19082 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19083 auto res = isl_pw_aff_ne_set(copy(), pwaff2.release());
19084 if (!res)
19085 exception::throw_last_error(saved_ctx);
19086 return manage(res);
19089 isl::pw_aff pw_aff::neg() const
19091 if (!ptr)
19092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19093 auto saved_ctx = ctx();
19094 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19095 auto res = isl_pw_aff_neg(copy());
19096 if (!res)
19097 exception::throw_last_error(saved_ctx);
19098 return manage(res);
19101 isl::pw_aff pw_aff::param_on_domain(isl::set domain, isl::id id)
19103 if (domain.is_null() || id.is_null())
19104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19105 auto saved_ctx = domain.ctx();
19106 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19107 auto res = isl_pw_aff_param_on_domain_id(domain.release(), id.release());
19108 if (!res)
19109 exception::throw_last_error(saved_ctx);
19110 return manage(res);
19113 isl::set pw_aff::params() const
19115 if (!ptr)
19116 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19117 auto saved_ctx = ctx();
19118 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19119 auto res = isl_pw_aff_params(copy());
19120 if (!res)
19121 exception::throw_last_error(saved_ctx);
19122 return manage(res);
19125 bool pw_aff::plain_is_empty() const
19127 if (!ptr)
19128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19129 return isl::union_pw_aff(*this).plain_is_empty();
19132 bool pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
19134 if (!ptr)
19135 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19136 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
19139 bool pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
19141 if (!ptr)
19142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19143 return isl::union_pw_aff(*this).plain_is_equal(multi2);
19146 bool pw_aff::plain_is_equal(const isl::pw_aff &pwaff2) const
19148 if (!ptr || pwaff2.is_null())
19149 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19150 auto saved_ctx = ctx();
19151 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19152 auto res = isl_pw_aff_plain_is_equal(get(), pwaff2.get());
19153 if (res < 0)
19154 exception::throw_last_error(saved_ctx);
19155 return res;
19158 bool pw_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
19160 if (!ptr)
19161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19162 return isl::pw_multi_aff(*this).plain_is_equal(pma2);
19165 bool pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
19167 if (!ptr)
19168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19169 return isl::union_pw_aff(*this).plain_is_equal(upa2);
19172 bool pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
19174 if (!ptr)
19175 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19176 return isl::union_pw_aff(*this).plain_is_equal(upma2);
19179 bool pw_aff::plain_is_equal(const isl::aff &pwaff2) const
19181 if (!ptr)
19182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19183 return this->plain_is_equal(isl::pw_aff(pwaff2));
19186 isl::pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
19188 if (!ptr)
19189 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19190 return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
19193 isl::union_pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
19195 if (!ptr)
19196 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19197 return isl::union_pw_aff(*this).preimage_domain_wrapped_domain(upma2);
19200 isl::multi_pw_aff pw_aff::product(const isl::multi_pw_aff &multi2) const
19202 if (!ptr)
19203 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19204 return isl::pw_multi_aff(*this).product(multi2);
19207 isl::pw_multi_aff pw_aff::product(const isl::pw_multi_aff &pma2) const
19209 if (!ptr)
19210 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19211 return isl::pw_multi_aff(*this).product(pma2);
19214 isl::pw_aff pw_aff::pullback(isl::multi_aff ma) const
19216 if (!ptr || ma.is_null())
19217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19218 auto saved_ctx = ctx();
19219 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19220 auto res = isl_pw_aff_pullback_multi_aff(copy(), ma.release());
19221 if (!res)
19222 exception::throw_last_error(saved_ctx);
19223 return manage(res);
19226 isl::pw_aff pw_aff::pullback(isl::multi_pw_aff mpa) const
19228 if (!ptr || mpa.is_null())
19229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19230 auto saved_ctx = ctx();
19231 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19232 auto res = isl_pw_aff_pullback_multi_pw_aff(copy(), mpa.release());
19233 if (!res)
19234 exception::throw_last_error(saved_ctx);
19235 return manage(res);
19238 isl::pw_aff pw_aff::pullback(isl::pw_multi_aff pma) const
19240 if (!ptr || pma.is_null())
19241 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19242 auto saved_ctx = ctx();
19243 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19244 auto res = isl_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
19245 if (!res)
19246 exception::throw_last_error(saved_ctx);
19247 return manage(res);
19250 isl::union_pw_aff pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
19252 if (!ptr)
19253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19254 return isl::union_pw_aff(*this).pullback(upma);
19257 isl::pw_multi_aff_list pw_aff::pw_multi_aff_list() const
19259 if (!ptr)
19260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19261 return isl::union_pw_aff(*this).pw_multi_aff_list();
19264 isl::pw_multi_aff pw_aff::range_factor_domain() const
19266 if (!ptr)
19267 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19268 return isl::pw_multi_aff(*this).range_factor_domain();
19271 isl::pw_multi_aff pw_aff::range_factor_range() const
19273 if (!ptr)
19274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19275 return isl::pw_multi_aff(*this).range_factor_range();
19278 isl::multi_pw_aff pw_aff::range_product(const isl::multi_pw_aff &multi2) const
19280 if (!ptr)
19281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19282 return isl::pw_multi_aff(*this).range_product(multi2);
19285 isl::multi_union_pw_aff pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
19287 if (!ptr)
19288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19289 return isl::union_pw_aff(*this).range_product(multi2);
19292 isl::pw_multi_aff pw_aff::range_product(const isl::pw_multi_aff &pma2) const
19294 if (!ptr)
19295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19296 return isl::pw_multi_aff(*this).range_product(pma2);
19299 isl::union_pw_multi_aff pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
19301 if (!ptr)
19302 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19303 return isl::union_pw_aff(*this).range_product(upma2);
19306 isl::id pw_aff::range_tuple_id() const
19308 if (!ptr)
19309 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19310 return isl::pw_multi_aff(*this).range_tuple_id();
19313 isl::multi_pw_aff pw_aff::reset_range_tuple_id() const
19315 if (!ptr)
19316 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19317 return isl::multi_pw_aff(*this).reset_range_tuple_id();
19320 isl::pw_aff pw_aff::scale(isl::val v) const
19322 if (!ptr || v.is_null())
19323 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19324 auto saved_ctx = ctx();
19325 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19326 auto res = isl_pw_aff_scale_val(copy(), v.release());
19327 if (!res)
19328 exception::throw_last_error(saved_ctx);
19329 return manage(res);
19332 isl::pw_aff pw_aff::scale(long v) const
19334 if (!ptr)
19335 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19336 return this->scale(isl::val(ctx(), v));
19339 isl::pw_multi_aff pw_aff::scale(const isl::multi_val &mv) const
19341 if (!ptr)
19342 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19343 return isl::pw_multi_aff(*this).scale(mv);
19346 isl::pw_aff pw_aff::scale_down(isl::val f) const
19348 if (!ptr || f.is_null())
19349 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19350 auto saved_ctx = ctx();
19351 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19352 auto res = isl_pw_aff_scale_down_val(copy(), f.release());
19353 if (!res)
19354 exception::throw_last_error(saved_ctx);
19355 return manage(res);
19358 isl::pw_aff pw_aff::scale_down(long f) const
19360 if (!ptr)
19361 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19362 return this->scale_down(isl::val(ctx(), f));
19365 isl::pw_multi_aff pw_aff::scale_down(const isl::multi_val &mv) const
19367 if (!ptr)
19368 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19369 return isl::pw_multi_aff(*this).scale_down(mv);
19372 isl::multi_pw_aff pw_aff::set_at(int pos, const isl::pw_aff &el) const
19374 if (!ptr)
19375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19376 return isl::pw_multi_aff(*this).set_at(pos, el);
19379 isl::multi_union_pw_aff pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
19381 if (!ptr)
19382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19383 return isl::union_pw_aff(*this).set_at(pos, el);
19386 isl::pw_multi_aff pw_aff::set_range_tuple(const isl::id &id) const
19388 if (!ptr)
19389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19390 return isl::pw_multi_aff(*this).set_range_tuple(id);
19393 isl::pw_multi_aff pw_aff::set_range_tuple(const std::string &id) const
19395 if (!ptr)
19396 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19397 return this->set_range_tuple(isl::id(ctx(), id));
19400 unsigned pw_aff::size() const
19402 if (!ptr)
19403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19404 return isl::multi_pw_aff(*this).size();
19407 isl::space pw_aff::space() const
19409 if (!ptr)
19410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19411 auto saved_ctx = ctx();
19412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19413 auto res = isl_pw_aff_get_space(get());
19414 if (!res)
19415 exception::throw_last_error(saved_ctx);
19416 return manage(res);
19419 isl::space pw_aff::get_space() const
19421 return space();
19424 isl::multi_pw_aff pw_aff::sub(const isl::multi_pw_aff &multi2) const
19426 if (!ptr)
19427 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19428 return isl::pw_multi_aff(*this).sub(multi2);
19431 isl::multi_union_pw_aff pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
19433 if (!ptr)
19434 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19435 return isl::union_pw_aff(*this).sub(multi2);
19438 isl::pw_aff pw_aff::sub(isl::pw_aff pwaff2) const
19440 if (!ptr || pwaff2.is_null())
19441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19442 auto saved_ctx = ctx();
19443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19444 auto res = isl_pw_aff_sub(copy(), pwaff2.release());
19445 if (!res)
19446 exception::throw_last_error(saved_ctx);
19447 return manage(res);
19450 isl::pw_multi_aff pw_aff::sub(const isl::pw_multi_aff &pma2) const
19452 if (!ptr)
19453 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19454 return isl::pw_multi_aff(*this).sub(pma2);
19457 isl::union_pw_aff pw_aff::sub(const isl::union_pw_aff &upa2) const
19459 if (!ptr)
19460 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19461 return isl::union_pw_aff(*this).sub(upa2);
19464 isl::union_pw_multi_aff pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
19466 if (!ptr)
19467 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19468 return isl::union_pw_aff(*this).sub(upma2);
19471 isl::pw_aff pw_aff::sub(const isl::aff &pwaff2) const
19473 if (!ptr)
19474 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19475 return this->sub(isl::pw_aff(pwaff2));
19478 isl::pw_aff pw_aff::subtract_domain(isl::set set) const
19480 if (!ptr || set.is_null())
19481 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19482 auto saved_ctx = ctx();
19483 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19484 auto res = isl_pw_aff_subtract_domain(copy(), set.release());
19485 if (!res)
19486 exception::throw_last_error(saved_ctx);
19487 return manage(res);
19490 isl::union_pw_aff pw_aff::subtract_domain(const isl::space &space) const
19492 if (!ptr)
19493 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19494 return isl::union_pw_aff(*this).subtract_domain(space);
19497 isl::union_pw_aff pw_aff::subtract_domain(const isl::union_set &uset) const
19499 if (!ptr)
19500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19501 return isl::union_pw_aff(*this).subtract_domain(uset);
19504 isl::pw_aff pw_aff::subtract_domain(const isl::basic_set &set) const
19506 if (!ptr)
19507 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19508 return this->subtract_domain(isl::set(set));
19511 isl::pw_aff pw_aff::subtract_domain(const isl::point &set) const
19513 if (!ptr)
19514 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19515 return this->subtract_domain(isl::set(set));
19518 isl::pw_aff pw_aff::tdiv_q(isl::pw_aff pa2) const
19520 if (!ptr || pa2.is_null())
19521 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19522 auto saved_ctx = ctx();
19523 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19524 auto res = isl_pw_aff_tdiv_q(copy(), pa2.release());
19525 if (!res)
19526 exception::throw_last_error(saved_ctx);
19527 return manage(res);
19530 isl::pw_aff pw_aff::tdiv_r(isl::pw_aff pa2) const
19532 if (!ptr || pa2.is_null())
19533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19534 auto saved_ctx = ctx();
19535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19536 auto res = isl_pw_aff_tdiv_r(copy(), pa2.release());
19537 if (!res)
19538 exception::throw_last_error(saved_ctx);
19539 return manage(res);
19542 isl::pw_aff_list pw_aff::to_list() const
19544 if (!ptr)
19545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19546 auto saved_ctx = ctx();
19547 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19548 auto res = isl_pw_aff_to_list(copy());
19549 if (!res)
19550 exception::throw_last_error(saved_ctx);
19551 return manage(res);
19554 isl::multi_pw_aff pw_aff::to_multi_pw_aff() const
19556 if (!ptr)
19557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19558 return isl::pw_multi_aff(*this).to_multi_pw_aff();
19561 isl::union_pw_aff pw_aff::to_union_pw_aff() const
19563 if (!ptr)
19564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19565 auto saved_ctx = ctx();
19566 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19567 auto res = isl_pw_aff_to_union_pw_aff(copy());
19568 if (!res)
19569 exception::throw_last_error(saved_ctx);
19570 return manage(res);
19573 isl::union_pw_multi_aff pw_aff::to_union_pw_multi_aff() const
19575 if (!ptr)
19576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19577 return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
19580 isl::multi_pw_aff pw_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
19582 if (!ptr)
19583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19584 return isl::pw_multi_aff(*this).unbind_params_insert_domain(domain);
19587 isl::multi_pw_aff pw_aff::union_add(const isl::multi_pw_aff &mpa2) const
19589 if (!ptr)
19590 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19591 return isl::pw_multi_aff(*this).union_add(mpa2);
19594 isl::multi_union_pw_aff pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
19596 if (!ptr)
19597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19598 return isl::union_pw_aff(*this).union_add(mupa2);
19601 isl::pw_aff pw_aff::union_add(isl::pw_aff pwaff2) const
19603 if (!ptr || pwaff2.is_null())
19604 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19605 auto saved_ctx = ctx();
19606 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19607 auto res = isl_pw_aff_union_add(copy(), pwaff2.release());
19608 if (!res)
19609 exception::throw_last_error(saved_ctx);
19610 return manage(res);
19613 isl::pw_multi_aff pw_aff::union_add(const isl::pw_multi_aff &pma2) const
19615 if (!ptr)
19616 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19617 return isl::pw_multi_aff(*this).union_add(pma2);
19620 isl::union_pw_aff pw_aff::union_add(const isl::union_pw_aff &upa2) const
19622 if (!ptr)
19623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19624 return isl::union_pw_aff(*this).union_add(upa2);
19627 isl::union_pw_multi_aff pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
19629 if (!ptr)
19630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19631 return isl::union_pw_aff(*this).union_add(upma2);
19634 isl::pw_aff pw_aff::union_add(const isl::aff &pwaff2) const
19636 if (!ptr)
19637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19638 return this->union_add(isl::pw_aff(pwaff2));
19641 inline std::ostream &operator<<(std::ostream &os, const pw_aff &obj)
19643 if (!obj.get())
19644 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19645 auto saved_ctx = isl_pw_aff_get_ctx(obj.get());
19646 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19647 char *str = isl_pw_aff_to_str(obj.get());
19648 if (!str)
19649 exception::throw_last_error(saved_ctx);
19650 os << str;
19651 free(str);
19652 return os;
19655 // implementations for isl::pw_aff_list
19656 pw_aff_list manage(__isl_take isl_pw_aff_list *ptr) {
19657 if (!ptr)
19658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19659 return pw_aff_list(ptr);
19661 pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr) {
19662 if (!ptr)
19663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19664 auto saved_ctx = isl_pw_aff_list_get_ctx(ptr);
19665 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19666 ptr = isl_pw_aff_list_copy(ptr);
19667 if (!ptr)
19668 exception::throw_last_error(saved_ctx);
19669 return pw_aff_list(ptr);
19672 pw_aff_list::pw_aff_list(__isl_take isl_pw_aff_list *ptr)
19673 : ptr(ptr) {}
19675 pw_aff_list::pw_aff_list()
19676 : ptr(nullptr) {}
19678 pw_aff_list::pw_aff_list(const pw_aff_list &obj)
19679 : ptr(nullptr)
19681 if (!obj.ptr)
19682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19683 auto saved_ctx = isl_pw_aff_list_get_ctx(obj.ptr);
19684 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19685 ptr = obj.copy();
19686 if (!ptr)
19687 exception::throw_last_error(saved_ctx);
19690 pw_aff_list::pw_aff_list(isl::ctx ctx, int n)
19692 auto saved_ctx = ctx;
19693 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19694 auto res = isl_pw_aff_list_alloc(ctx.release(), n);
19695 if (!res)
19696 exception::throw_last_error(saved_ctx);
19697 ptr = res;
19700 pw_aff_list::pw_aff_list(isl::pw_aff el)
19702 if (el.is_null())
19703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19704 auto saved_ctx = el.ctx();
19705 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19706 auto res = isl_pw_aff_list_from_pw_aff(el.release());
19707 if (!res)
19708 exception::throw_last_error(saved_ctx);
19709 ptr = res;
19712 pw_aff_list::pw_aff_list(isl::ctx ctx, const std::string &str)
19714 auto saved_ctx = ctx;
19715 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19716 auto res = isl_pw_aff_list_read_from_str(ctx.release(), str.c_str());
19717 if (!res)
19718 exception::throw_last_error(saved_ctx);
19719 ptr = res;
19722 pw_aff_list &pw_aff_list::operator=(pw_aff_list obj) {
19723 std::swap(this->ptr, obj.ptr);
19724 return *this;
19727 pw_aff_list::~pw_aff_list() {
19728 if (ptr)
19729 isl_pw_aff_list_free(ptr);
19732 __isl_give isl_pw_aff_list *pw_aff_list::copy() const & {
19733 return isl_pw_aff_list_copy(ptr);
19736 __isl_keep isl_pw_aff_list *pw_aff_list::get() const {
19737 return ptr;
19740 __isl_give isl_pw_aff_list *pw_aff_list::release() {
19741 isl_pw_aff_list *tmp = ptr;
19742 ptr = nullptr;
19743 return tmp;
19746 bool pw_aff_list::is_null() const {
19747 return ptr == nullptr;
19750 isl::ctx pw_aff_list::ctx() const {
19751 return isl::ctx(isl_pw_aff_list_get_ctx(ptr));
19754 isl::pw_aff_list pw_aff_list::add(isl::pw_aff el) const
19756 if (!ptr || el.is_null())
19757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19758 auto saved_ctx = ctx();
19759 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19760 auto res = isl_pw_aff_list_add(copy(), el.release());
19761 if (!res)
19762 exception::throw_last_error(saved_ctx);
19763 return manage(res);
19766 isl::pw_aff pw_aff_list::at(int index) const
19768 if (!ptr)
19769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19770 auto saved_ctx = ctx();
19771 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19772 auto res = isl_pw_aff_list_get_at(get(), index);
19773 if (!res)
19774 exception::throw_last_error(saved_ctx);
19775 return manage(res);
19778 isl::pw_aff pw_aff_list::get_at(int index) const
19780 return at(index);
19783 isl::pw_aff_list pw_aff_list::clear() const
19785 if (!ptr)
19786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19787 auto saved_ctx = ctx();
19788 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19789 auto res = isl_pw_aff_list_clear(copy());
19790 if (!res)
19791 exception::throw_last_error(saved_ctx);
19792 return manage(res);
19795 isl::pw_aff_list pw_aff_list::concat(isl::pw_aff_list list2) const
19797 if (!ptr || list2.is_null())
19798 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19799 auto saved_ctx = ctx();
19800 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19801 auto res = isl_pw_aff_list_concat(copy(), list2.release());
19802 if (!res)
19803 exception::throw_last_error(saved_ctx);
19804 return manage(res);
19807 isl::pw_aff_list pw_aff_list::drop(unsigned int first, unsigned int n) const
19809 if (!ptr)
19810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19811 auto saved_ctx = ctx();
19812 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19813 auto res = isl_pw_aff_list_drop(copy(), first, n);
19814 if (!res)
19815 exception::throw_last_error(saved_ctx);
19816 return manage(res);
19819 void pw_aff_list::foreach(const std::function<void(isl::pw_aff)> &fn) const
19821 if (!ptr)
19822 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19823 auto saved_ctx = ctx();
19824 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19825 struct fn_data {
19826 std::function<void(isl::pw_aff)> func;
19827 std::exception_ptr eptr;
19828 } fn_data = { fn };
19829 auto fn_lambda = [](isl_pw_aff *arg_0, void *arg_1) -> isl_stat {
19830 auto *data = static_cast<struct fn_data *>(arg_1);
19831 ISL_CPP_TRY {
19832 (data->func)(manage(arg_0));
19833 return isl_stat_ok;
19834 } ISL_CPP_CATCH_ALL {
19835 data->eptr = std::current_exception();
19836 return isl_stat_error;
19839 auto res = isl_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
19840 if (fn_data.eptr)
19841 std::rethrow_exception(fn_data.eptr);
19842 if (res < 0)
19843 exception::throw_last_error(saved_ctx);
19844 return;
19847 void pw_aff_list::foreach_scc(const std::function<bool(isl::pw_aff, isl::pw_aff)> &follows, const std::function<void(isl::pw_aff_list)> &fn) const
19849 if (!ptr)
19850 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19851 auto saved_ctx = ctx();
19852 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19853 struct follows_data {
19854 std::function<bool(isl::pw_aff, isl::pw_aff)> func;
19855 std::exception_ptr eptr;
19856 } follows_data = { follows };
19857 auto follows_lambda = [](isl_pw_aff *arg_0, isl_pw_aff *arg_1, void *arg_2) -> isl_bool {
19858 auto *data = static_cast<struct follows_data *>(arg_2);
19859 ISL_CPP_TRY {
19860 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
19861 return ret ? isl_bool_true : isl_bool_false;
19862 } ISL_CPP_CATCH_ALL {
19863 data->eptr = std::current_exception();
19864 return isl_bool_error;
19867 struct fn_data {
19868 std::function<void(isl::pw_aff_list)> func;
19869 std::exception_ptr eptr;
19870 } fn_data = { fn };
19871 auto fn_lambda = [](isl_pw_aff_list *arg_0, void *arg_1) -> isl_stat {
19872 auto *data = static_cast<struct fn_data *>(arg_1);
19873 ISL_CPP_TRY {
19874 (data->func)(manage(arg_0));
19875 return isl_stat_ok;
19876 } ISL_CPP_CATCH_ALL {
19877 data->eptr = std::current_exception();
19878 return isl_stat_error;
19881 auto res = isl_pw_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
19882 if (follows_data.eptr)
19883 std::rethrow_exception(follows_data.eptr);
19884 if (fn_data.eptr)
19885 std::rethrow_exception(fn_data.eptr);
19886 if (res < 0)
19887 exception::throw_last_error(saved_ctx);
19888 return;
19891 isl::pw_aff_list pw_aff_list::insert(unsigned int pos, isl::pw_aff el) const
19893 if (!ptr || el.is_null())
19894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19895 auto saved_ctx = ctx();
19896 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19897 auto res = isl_pw_aff_list_insert(copy(), pos, el.release());
19898 if (!res)
19899 exception::throw_last_error(saved_ctx);
19900 return manage(res);
19903 isl::pw_aff_list pw_aff_list::set_at(int index, isl::pw_aff el) const
19905 if (!ptr || el.is_null())
19906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19907 auto saved_ctx = ctx();
19908 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19909 auto res = isl_pw_aff_list_set_at(copy(), index, el.release());
19910 if (!res)
19911 exception::throw_last_error(saved_ctx);
19912 return manage(res);
19915 unsigned pw_aff_list::size() const
19917 if (!ptr)
19918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19919 auto saved_ctx = ctx();
19920 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19921 auto res = isl_pw_aff_list_size(get());
19922 if (res < 0)
19923 exception::throw_last_error(saved_ctx);
19924 return res;
19927 inline std::ostream &operator<<(std::ostream &os, const pw_aff_list &obj)
19929 if (!obj.get())
19930 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19931 auto saved_ctx = isl_pw_aff_list_get_ctx(obj.get());
19932 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19933 char *str = isl_pw_aff_list_to_str(obj.get());
19934 if (!str)
19935 exception::throw_last_error(saved_ctx);
19936 os << str;
19937 free(str);
19938 return os;
19941 // implementations for isl::pw_multi_aff
19942 pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr) {
19943 if (!ptr)
19944 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19945 return pw_multi_aff(ptr);
19947 pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr) {
19948 if (!ptr)
19949 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19950 auto saved_ctx = isl_pw_multi_aff_get_ctx(ptr);
19951 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19952 ptr = isl_pw_multi_aff_copy(ptr);
19953 if (!ptr)
19954 exception::throw_last_error(saved_ctx);
19955 return pw_multi_aff(ptr);
19958 pw_multi_aff::pw_multi_aff(__isl_take isl_pw_multi_aff *ptr)
19959 : ptr(ptr) {}
19961 pw_multi_aff::pw_multi_aff()
19962 : ptr(nullptr) {}
19964 pw_multi_aff::pw_multi_aff(const pw_multi_aff &obj)
19965 : ptr(nullptr)
19967 if (!obj.ptr)
19968 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19969 auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.ptr);
19970 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19971 ptr = obj.copy();
19972 if (!ptr)
19973 exception::throw_last_error(saved_ctx);
19976 pw_multi_aff::pw_multi_aff(isl::multi_aff ma)
19978 if (ma.is_null())
19979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19980 auto saved_ctx = ma.ctx();
19981 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19982 auto res = isl_pw_multi_aff_from_multi_aff(ma.release());
19983 if (!res)
19984 exception::throw_last_error(saved_ctx);
19985 ptr = res;
19988 pw_multi_aff::pw_multi_aff(isl::pw_aff pa)
19990 if (pa.is_null())
19991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19992 auto saved_ctx = pa.ctx();
19993 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19994 auto res = isl_pw_multi_aff_from_pw_aff(pa.release());
19995 if (!res)
19996 exception::throw_last_error(saved_ctx);
19997 ptr = res;
20000 pw_multi_aff::pw_multi_aff(isl::ctx ctx, const std::string &str)
20002 auto saved_ctx = ctx;
20003 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20004 auto res = isl_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
20005 if (!res)
20006 exception::throw_last_error(saved_ctx);
20007 ptr = res;
20010 pw_multi_aff &pw_multi_aff::operator=(pw_multi_aff obj) {
20011 std::swap(this->ptr, obj.ptr);
20012 return *this;
20015 pw_multi_aff::~pw_multi_aff() {
20016 if (ptr)
20017 isl_pw_multi_aff_free(ptr);
20020 __isl_give isl_pw_multi_aff *pw_multi_aff::copy() const & {
20021 return isl_pw_multi_aff_copy(ptr);
20024 __isl_keep isl_pw_multi_aff *pw_multi_aff::get() const {
20025 return ptr;
20028 __isl_give isl_pw_multi_aff *pw_multi_aff::release() {
20029 isl_pw_multi_aff *tmp = ptr;
20030 ptr = nullptr;
20031 return tmp;
20034 bool pw_multi_aff::is_null() const {
20035 return ptr == nullptr;
20038 isl::ctx pw_multi_aff::ctx() const {
20039 return isl::ctx(isl_pw_multi_aff_get_ctx(ptr));
20042 isl::multi_pw_aff pw_multi_aff::add(const isl::multi_pw_aff &multi2) const
20044 if (!ptr)
20045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20046 return isl::multi_pw_aff(*this).add(multi2);
20049 isl::multi_union_pw_aff pw_multi_aff::add(const isl::multi_union_pw_aff &multi2) const
20051 if (!ptr)
20052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20053 return isl::multi_pw_aff(*this).add(multi2);
20056 isl::pw_multi_aff pw_multi_aff::add(isl::pw_multi_aff pma2) const
20058 if (!ptr || pma2.is_null())
20059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20060 auto saved_ctx = ctx();
20061 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20062 auto res = isl_pw_multi_aff_add(copy(), pma2.release());
20063 if (!res)
20064 exception::throw_last_error(saved_ctx);
20065 return manage(res);
20068 isl::union_pw_multi_aff pw_multi_aff::add(const isl::union_pw_multi_aff &upma2) const
20070 if (!ptr)
20071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20072 return isl::union_pw_multi_aff(*this).add(upma2);
20075 isl::pw_multi_aff pw_multi_aff::add(const isl::multi_aff &pma2) const
20077 if (!ptr)
20078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20079 return this->add(isl::pw_multi_aff(pma2));
20082 isl::pw_multi_aff pw_multi_aff::add(const isl::pw_aff &pma2) const
20084 if (!ptr)
20085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20086 return this->add(isl::pw_multi_aff(pma2));
20089 isl::pw_multi_aff pw_multi_aff::add_constant(isl::multi_val mv) const
20091 if (!ptr || mv.is_null())
20092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20093 auto saved_ctx = ctx();
20094 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20095 auto res = isl_pw_multi_aff_add_constant_multi_val(copy(), mv.release());
20096 if (!res)
20097 exception::throw_last_error(saved_ctx);
20098 return manage(res);
20101 isl::pw_multi_aff pw_multi_aff::add_constant(isl::val v) const
20103 if (!ptr || v.is_null())
20104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20105 auto saved_ctx = ctx();
20106 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20107 auto res = isl_pw_multi_aff_add_constant_val(copy(), v.release());
20108 if (!res)
20109 exception::throw_last_error(saved_ctx);
20110 return manage(res);
20113 isl::pw_multi_aff pw_multi_aff::add_constant(long v) const
20115 if (!ptr)
20116 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20117 return this->add_constant(isl::val(ctx(), v));
20120 isl::union_pw_multi_aff pw_multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
20122 if (!ptr)
20123 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20124 return isl::union_pw_multi_aff(*this).apply(upma2);
20127 isl::map pw_multi_aff::as_map() const
20129 if (!ptr)
20130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20131 auto saved_ctx = ctx();
20132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20133 auto res = isl_pw_multi_aff_as_map(copy());
20134 if (!res)
20135 exception::throw_last_error(saved_ctx);
20136 return manage(res);
20139 isl::multi_aff pw_multi_aff::as_multi_aff() const
20141 if (!ptr)
20142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20143 auto saved_ctx = ctx();
20144 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20145 auto res = isl_pw_multi_aff_as_multi_aff(copy());
20146 if (!res)
20147 exception::throw_last_error(saved_ctx);
20148 return manage(res);
20151 isl::multi_union_pw_aff pw_multi_aff::as_multi_union_pw_aff() const
20153 if (!ptr)
20154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20155 return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
20158 isl::pw_multi_aff pw_multi_aff::as_pw_multi_aff() const
20160 if (!ptr)
20161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20162 return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
20165 isl::set pw_multi_aff::as_set() const
20167 if (!ptr)
20168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20169 auto saved_ctx = ctx();
20170 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20171 auto res = isl_pw_multi_aff_as_set(copy());
20172 if (!res)
20173 exception::throw_last_error(saved_ctx);
20174 return manage(res);
20177 isl::union_map pw_multi_aff::as_union_map() const
20179 if (!ptr)
20180 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20181 return isl::union_pw_multi_aff(*this).as_union_map();
20184 isl::pw_aff pw_multi_aff::at(int pos) const
20186 if (!ptr)
20187 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20188 auto saved_ctx = ctx();
20189 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20190 auto res = isl_pw_multi_aff_get_at(get(), pos);
20191 if (!res)
20192 exception::throw_last_error(saved_ctx);
20193 return manage(res);
20196 isl::pw_aff pw_multi_aff::get_at(int pos) const
20198 return at(pos);
20201 isl::set pw_multi_aff::bind(const isl::multi_id &tuple) const
20203 if (!ptr)
20204 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20205 return isl::multi_pw_aff(*this).bind(tuple);
20208 isl::pw_multi_aff pw_multi_aff::bind_domain(isl::multi_id tuple) const
20210 if (!ptr || tuple.is_null())
20211 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20212 auto saved_ctx = ctx();
20213 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20214 auto res = isl_pw_multi_aff_bind_domain(copy(), tuple.release());
20215 if (!res)
20216 exception::throw_last_error(saved_ctx);
20217 return manage(res);
20220 isl::pw_multi_aff pw_multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
20222 if (!ptr || tuple.is_null())
20223 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20224 auto saved_ctx = ctx();
20225 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20226 auto res = isl_pw_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
20227 if (!res)
20228 exception::throw_last_error(saved_ctx);
20229 return manage(res);
20232 isl::pw_multi_aff pw_multi_aff::coalesce() const
20234 if (!ptr)
20235 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20236 auto saved_ctx = ctx();
20237 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20238 auto res = isl_pw_multi_aff_coalesce(copy());
20239 if (!res)
20240 exception::throw_last_error(saved_ctx);
20241 return manage(res);
20244 isl::set pw_multi_aff::domain() const
20246 if (!ptr)
20247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20248 auto saved_ctx = ctx();
20249 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20250 auto res = isl_pw_multi_aff_domain(copy());
20251 if (!res)
20252 exception::throw_last_error(saved_ctx);
20253 return manage(res);
20256 isl::pw_multi_aff pw_multi_aff::domain_map(isl::space space)
20258 if (space.is_null())
20259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20260 auto saved_ctx = space.ctx();
20261 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20262 auto res = isl_pw_multi_aff_domain_map(space.release());
20263 if (!res)
20264 exception::throw_last_error(saved_ctx);
20265 return manage(res);
20268 isl::pw_multi_aff pw_multi_aff::domain_reverse() const
20270 if (!ptr)
20271 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20272 auto saved_ctx = ctx();
20273 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20274 auto res = isl_pw_multi_aff_domain_reverse(copy());
20275 if (!res)
20276 exception::throw_last_error(saved_ctx);
20277 return manage(res);
20280 isl::pw_multi_aff pw_multi_aff::drop_unused_params() const
20282 if (!ptr)
20283 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20284 auto saved_ctx = ctx();
20285 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20286 auto res = isl_pw_multi_aff_drop_unused_params(copy());
20287 if (!res)
20288 exception::throw_last_error(saved_ctx);
20289 return manage(res);
20292 isl::pw_multi_aff pw_multi_aff::extract_pw_multi_aff(const isl::space &space) const
20294 if (!ptr)
20295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20296 return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
20299 isl::multi_pw_aff pw_multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
20301 if (!ptr)
20302 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20303 return isl::multi_pw_aff(*this).flat_range_product(multi2);
20306 isl::multi_union_pw_aff pw_multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
20308 if (!ptr)
20309 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20310 return isl::multi_pw_aff(*this).flat_range_product(multi2);
20313 isl::pw_multi_aff pw_multi_aff::flat_range_product(isl::pw_multi_aff pma2) const
20315 if (!ptr || pma2.is_null())
20316 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20317 auto saved_ctx = ctx();
20318 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20319 auto res = isl_pw_multi_aff_flat_range_product(copy(), pma2.release());
20320 if (!res)
20321 exception::throw_last_error(saved_ctx);
20322 return manage(res);
20325 isl::union_pw_multi_aff pw_multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
20327 if (!ptr)
20328 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20329 return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
20332 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::multi_aff &pma2) const
20334 if (!ptr)
20335 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20336 return this->flat_range_product(isl::pw_multi_aff(pma2));
20339 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::pw_aff &pma2) const
20341 if (!ptr)
20342 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20343 return this->flat_range_product(isl::pw_multi_aff(pma2));
20346 void pw_multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
20348 if (!ptr)
20349 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20350 auto saved_ctx = ctx();
20351 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20352 struct fn_data {
20353 std::function<void(isl::set, isl::multi_aff)> func;
20354 std::exception_ptr eptr;
20355 } fn_data = { fn };
20356 auto fn_lambda = [](isl_set *arg_0, isl_multi_aff *arg_1, void *arg_2) -> isl_stat {
20357 auto *data = static_cast<struct fn_data *>(arg_2);
20358 ISL_CPP_TRY {
20359 (data->func)(manage(arg_0), manage(arg_1));
20360 return isl_stat_ok;
20361 } ISL_CPP_CATCH_ALL {
20362 data->eptr = std::current_exception();
20363 return isl_stat_error;
20366 auto res = isl_pw_multi_aff_foreach_piece(get(), fn_lambda, &fn_data);
20367 if (fn_data.eptr)
20368 std::rethrow_exception(fn_data.eptr);
20369 if (res < 0)
20370 exception::throw_last_error(saved_ctx);
20371 return;
20374 isl::pw_multi_aff pw_multi_aff::gist(isl::set set) const
20376 if (!ptr || set.is_null())
20377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20378 auto saved_ctx = ctx();
20379 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20380 auto res = isl_pw_multi_aff_gist(copy(), set.release());
20381 if (!res)
20382 exception::throw_last_error(saved_ctx);
20383 return manage(res);
20386 isl::union_pw_multi_aff pw_multi_aff::gist(const isl::union_set &context) const
20388 if (!ptr)
20389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20390 return isl::union_pw_multi_aff(*this).gist(context);
20393 isl::pw_multi_aff pw_multi_aff::gist(const isl::basic_set &set) const
20395 if (!ptr)
20396 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20397 return this->gist(isl::set(set));
20400 isl::pw_multi_aff pw_multi_aff::gist(const isl::point &set) const
20402 if (!ptr)
20403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20404 return this->gist(isl::set(set));
20407 isl::pw_multi_aff pw_multi_aff::gist_params(isl::set set) const
20409 if (!ptr || set.is_null())
20410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20411 auto saved_ctx = ctx();
20412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20413 auto res = isl_pw_multi_aff_gist_params(copy(), set.release());
20414 if (!res)
20415 exception::throw_last_error(saved_ctx);
20416 return manage(res);
20419 bool pw_multi_aff::has_range_tuple_id() const
20421 if (!ptr)
20422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20423 auto saved_ctx = ctx();
20424 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20425 auto res = isl_pw_multi_aff_has_range_tuple_id(get());
20426 if (res < 0)
20427 exception::throw_last_error(saved_ctx);
20428 return res;
20431 isl::multi_pw_aff pw_multi_aff::identity() const
20433 if (!ptr)
20434 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20435 return isl::multi_pw_aff(*this).identity();
20438 isl::pw_multi_aff pw_multi_aff::identity_on_domain(isl::space space)
20440 if (space.is_null())
20441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20442 auto saved_ctx = space.ctx();
20443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20444 auto res = isl_pw_multi_aff_identity_on_domain_space(space.release());
20445 if (!res)
20446 exception::throw_last_error(saved_ctx);
20447 return manage(res);
20450 isl::pw_multi_aff pw_multi_aff::insert_domain(isl::space domain) const
20452 if (!ptr || domain.is_null())
20453 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20454 auto saved_ctx = ctx();
20455 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20456 auto res = isl_pw_multi_aff_insert_domain(copy(), domain.release());
20457 if (!res)
20458 exception::throw_last_error(saved_ctx);
20459 return manage(res);
20462 isl::pw_multi_aff pw_multi_aff::intersect_domain(isl::set set) const
20464 if (!ptr || set.is_null())
20465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20466 auto saved_ctx = ctx();
20467 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20468 auto res = isl_pw_multi_aff_intersect_domain(copy(), set.release());
20469 if (!res)
20470 exception::throw_last_error(saved_ctx);
20471 return manage(res);
20474 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::space &space) const
20476 if (!ptr)
20477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20478 return isl::union_pw_multi_aff(*this).intersect_domain(space);
20481 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::union_set &uset) const
20483 if (!ptr)
20484 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20485 return isl::union_pw_multi_aff(*this).intersect_domain(uset);
20488 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::basic_set &set) const
20490 if (!ptr)
20491 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20492 return this->intersect_domain(isl::set(set));
20495 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::point &set) const
20497 if (!ptr)
20498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20499 return this->intersect_domain(isl::set(set));
20502 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
20504 if (!ptr)
20505 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20506 return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
20509 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
20511 if (!ptr)
20512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20513 return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
20516 isl::pw_multi_aff pw_multi_aff::intersect_params(isl::set set) const
20518 if (!ptr || set.is_null())
20519 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20520 auto saved_ctx = ctx();
20521 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20522 auto res = isl_pw_multi_aff_intersect_params(copy(), set.release());
20523 if (!res)
20524 exception::throw_last_error(saved_ctx);
20525 return manage(res);
20528 bool pw_multi_aff::involves_locals() const
20530 if (!ptr)
20531 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20532 auto saved_ctx = ctx();
20533 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20534 auto res = isl_pw_multi_aff_involves_locals(get());
20535 if (res < 0)
20536 exception::throw_last_error(saved_ctx);
20537 return res;
20540 bool pw_multi_aff::involves_nan() const
20542 if (!ptr)
20543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20544 return isl::multi_pw_aff(*this).involves_nan();
20547 bool pw_multi_aff::involves_param(const isl::id &id) const
20549 if (!ptr)
20550 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20551 return isl::multi_pw_aff(*this).involves_param(id);
20554 bool pw_multi_aff::involves_param(const std::string &id) const
20556 if (!ptr)
20557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20558 return this->involves_param(isl::id(ctx(), id));
20561 bool pw_multi_aff::involves_param(const isl::id_list &list) const
20563 if (!ptr)
20564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20565 return isl::multi_pw_aff(*this).involves_param(list);
20568 bool pw_multi_aff::isa_multi_aff() const
20570 if (!ptr)
20571 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20572 auto saved_ctx = ctx();
20573 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20574 auto res = isl_pw_multi_aff_isa_multi_aff(get());
20575 if (res < 0)
20576 exception::throw_last_error(saved_ctx);
20577 return res;
20580 bool pw_multi_aff::isa_pw_multi_aff() const
20582 if (!ptr)
20583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20584 return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
20587 isl::pw_aff_list pw_multi_aff::list() const
20589 if (!ptr)
20590 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20591 return isl::multi_pw_aff(*this).list();
20594 isl::multi_pw_aff pw_multi_aff::max(const isl::multi_pw_aff &multi2) const
20596 if (!ptr)
20597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20598 return isl::multi_pw_aff(*this).max(multi2);
20601 isl::multi_val pw_multi_aff::max_multi_val() const
20603 if (!ptr)
20604 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20605 auto saved_ctx = ctx();
20606 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20607 auto res = isl_pw_multi_aff_max_multi_val(copy());
20608 if (!res)
20609 exception::throw_last_error(saved_ctx);
20610 return manage(res);
20613 isl::multi_pw_aff pw_multi_aff::min(const isl::multi_pw_aff &multi2) const
20615 if (!ptr)
20616 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20617 return isl::multi_pw_aff(*this).min(multi2);
20620 isl::multi_val pw_multi_aff::min_multi_val() const
20622 if (!ptr)
20623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20624 auto saved_ctx = ctx();
20625 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20626 auto res = isl_pw_multi_aff_min_multi_val(copy());
20627 if (!res)
20628 exception::throw_last_error(saved_ctx);
20629 return manage(res);
20632 isl::pw_multi_aff pw_multi_aff::multi_val_on_domain(isl::set domain, isl::multi_val mv)
20634 if (domain.is_null() || mv.is_null())
20635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20636 auto saved_ctx = domain.ctx();
20637 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20638 auto res = isl_pw_multi_aff_multi_val_on_domain(domain.release(), mv.release());
20639 if (!res)
20640 exception::throw_last_error(saved_ctx);
20641 return manage(res);
20644 unsigned pw_multi_aff::n_piece() const
20646 if (!ptr)
20647 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20648 auto saved_ctx = ctx();
20649 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20650 auto res = isl_pw_multi_aff_n_piece(get());
20651 if (res < 0)
20652 exception::throw_last_error(saved_ctx);
20653 return res;
20656 isl::multi_pw_aff pw_multi_aff::neg() const
20658 if (!ptr)
20659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20660 return isl::multi_pw_aff(*this).neg();
20663 bool pw_multi_aff::plain_is_empty() const
20665 if (!ptr)
20666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20667 return isl::union_pw_multi_aff(*this).plain_is_empty();
20670 bool pw_multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
20672 if (!ptr)
20673 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20674 return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20677 bool pw_multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
20679 if (!ptr)
20680 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20681 return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20684 bool pw_multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
20686 if (!ptr || pma2.is_null())
20687 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20688 auto saved_ctx = ctx();
20689 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20690 auto res = isl_pw_multi_aff_plain_is_equal(get(), pma2.get());
20691 if (res < 0)
20692 exception::throw_last_error(saved_ctx);
20693 return res;
20696 bool pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
20698 if (!ptr)
20699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20700 return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
20703 bool pw_multi_aff::plain_is_equal(const isl::multi_aff &pma2) const
20705 if (!ptr)
20706 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20707 return this->plain_is_equal(isl::pw_multi_aff(pma2));
20710 bool pw_multi_aff::plain_is_equal(const isl::pw_aff &pma2) const
20712 if (!ptr)
20713 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20714 return this->plain_is_equal(isl::pw_multi_aff(pma2));
20717 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const
20719 if (!ptr || pma2.is_null())
20720 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20721 auto saved_ctx = ctx();
20722 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20723 auto res = isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff(copy(), pma2.release());
20724 if (!res)
20725 exception::throw_last_error(saved_ctx);
20726 return manage(res);
20729 isl::union_pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
20731 if (!ptr)
20732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20733 return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
20736 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const
20738 if (!ptr)
20739 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20740 return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20743 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const
20745 if (!ptr)
20746 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20747 return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20750 isl::multi_pw_aff pw_multi_aff::product(const isl::multi_pw_aff &multi2) const
20752 if (!ptr)
20753 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20754 return isl::multi_pw_aff(*this).product(multi2);
20757 isl::pw_multi_aff pw_multi_aff::product(isl::pw_multi_aff pma2) const
20759 if (!ptr || pma2.is_null())
20760 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20761 auto saved_ctx = ctx();
20762 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20763 auto res = isl_pw_multi_aff_product(copy(), pma2.release());
20764 if (!res)
20765 exception::throw_last_error(saved_ctx);
20766 return manage(res);
20769 isl::pw_multi_aff pw_multi_aff::product(const isl::multi_aff &pma2) const
20771 if (!ptr)
20772 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20773 return this->product(isl::pw_multi_aff(pma2));
20776 isl::pw_multi_aff pw_multi_aff::product(const isl::pw_aff &pma2) const
20778 if (!ptr)
20779 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20780 return this->product(isl::pw_multi_aff(pma2));
20783 isl::multi_pw_aff pw_multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
20785 if (!ptr)
20786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20787 return isl::multi_pw_aff(*this).pullback(mpa2);
20790 isl::pw_multi_aff pw_multi_aff::pullback(isl::multi_aff ma) const
20792 if (!ptr || ma.is_null())
20793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20794 auto saved_ctx = ctx();
20795 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20796 auto res = isl_pw_multi_aff_pullback_multi_aff(copy(), ma.release());
20797 if (!res)
20798 exception::throw_last_error(saved_ctx);
20799 return manage(res);
20802 isl::pw_multi_aff pw_multi_aff::pullback(isl::pw_multi_aff pma2) const
20804 if (!ptr || pma2.is_null())
20805 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20806 auto saved_ctx = ctx();
20807 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20808 auto res = isl_pw_multi_aff_pullback_pw_multi_aff(copy(), pma2.release());
20809 if (!res)
20810 exception::throw_last_error(saved_ctx);
20811 return manage(res);
20814 isl::union_pw_multi_aff pw_multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
20816 if (!ptr)
20817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20818 return isl::union_pw_multi_aff(*this).pullback(upma2);
20821 isl::pw_multi_aff_list pw_multi_aff::pw_multi_aff_list() const
20823 if (!ptr)
20824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20825 return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
20828 isl::pw_multi_aff pw_multi_aff::range_factor_domain() const
20830 if (!ptr)
20831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20832 auto saved_ctx = ctx();
20833 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20834 auto res = isl_pw_multi_aff_range_factor_domain(copy());
20835 if (!res)
20836 exception::throw_last_error(saved_ctx);
20837 return manage(res);
20840 isl::pw_multi_aff pw_multi_aff::range_factor_range() const
20842 if (!ptr)
20843 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20844 auto saved_ctx = ctx();
20845 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20846 auto res = isl_pw_multi_aff_range_factor_range(copy());
20847 if (!res)
20848 exception::throw_last_error(saved_ctx);
20849 return manage(res);
20852 isl::pw_multi_aff pw_multi_aff::range_map(isl::space space)
20854 if (space.is_null())
20855 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20856 auto saved_ctx = space.ctx();
20857 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20858 auto res = isl_pw_multi_aff_range_map(space.release());
20859 if (!res)
20860 exception::throw_last_error(saved_ctx);
20861 return manage(res);
20864 isl::multi_pw_aff pw_multi_aff::range_product(const isl::multi_pw_aff &multi2) const
20866 if (!ptr)
20867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20868 return isl::multi_pw_aff(*this).range_product(multi2);
20871 isl::multi_union_pw_aff pw_multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
20873 if (!ptr)
20874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20875 return isl::multi_pw_aff(*this).range_product(multi2);
20878 isl::pw_multi_aff pw_multi_aff::range_product(isl::pw_multi_aff pma2) const
20880 if (!ptr || pma2.is_null())
20881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20882 auto saved_ctx = ctx();
20883 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20884 auto res = isl_pw_multi_aff_range_product(copy(), pma2.release());
20885 if (!res)
20886 exception::throw_last_error(saved_ctx);
20887 return manage(res);
20890 isl::union_pw_multi_aff pw_multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
20892 if (!ptr)
20893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20894 return isl::union_pw_multi_aff(*this).range_product(upma2);
20897 isl::pw_multi_aff pw_multi_aff::range_product(const isl::multi_aff &pma2) const
20899 if (!ptr)
20900 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20901 return this->range_product(isl::pw_multi_aff(pma2));
20904 isl::pw_multi_aff pw_multi_aff::range_product(const isl::pw_aff &pma2) const
20906 if (!ptr)
20907 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20908 return this->range_product(isl::pw_multi_aff(pma2));
20911 isl::id pw_multi_aff::range_tuple_id() const
20913 if (!ptr)
20914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20915 auto saved_ctx = ctx();
20916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20917 auto res = isl_pw_multi_aff_get_range_tuple_id(get());
20918 if (!res)
20919 exception::throw_last_error(saved_ctx);
20920 return manage(res);
20923 isl::id pw_multi_aff::get_range_tuple_id() const
20925 return range_tuple_id();
20928 isl::multi_pw_aff pw_multi_aff::reset_range_tuple_id() const
20930 if (!ptr)
20931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20932 return isl::multi_pw_aff(*this).reset_range_tuple_id();
20935 isl::pw_multi_aff pw_multi_aff::scale(isl::multi_val mv) const
20937 if (!ptr || mv.is_null())
20938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20939 auto saved_ctx = ctx();
20940 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20941 auto res = isl_pw_multi_aff_scale_multi_val(copy(), mv.release());
20942 if (!res)
20943 exception::throw_last_error(saved_ctx);
20944 return manage(res);
20947 isl::pw_multi_aff pw_multi_aff::scale(isl::val v) const
20949 if (!ptr || v.is_null())
20950 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20951 auto saved_ctx = ctx();
20952 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20953 auto res = isl_pw_multi_aff_scale_val(copy(), v.release());
20954 if (!res)
20955 exception::throw_last_error(saved_ctx);
20956 return manage(res);
20959 isl::pw_multi_aff pw_multi_aff::scale(long v) const
20961 if (!ptr)
20962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20963 return this->scale(isl::val(ctx(), v));
20966 isl::pw_multi_aff pw_multi_aff::scale_down(isl::multi_val mv) const
20968 if (!ptr || mv.is_null())
20969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20970 auto saved_ctx = ctx();
20971 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20972 auto res = isl_pw_multi_aff_scale_down_multi_val(copy(), mv.release());
20973 if (!res)
20974 exception::throw_last_error(saved_ctx);
20975 return manage(res);
20978 isl::pw_multi_aff pw_multi_aff::scale_down(isl::val v) const
20980 if (!ptr || v.is_null())
20981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20982 auto saved_ctx = ctx();
20983 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20984 auto res = isl_pw_multi_aff_scale_down_val(copy(), v.release());
20985 if (!res)
20986 exception::throw_last_error(saved_ctx);
20987 return manage(res);
20990 isl::pw_multi_aff pw_multi_aff::scale_down(long v) const
20992 if (!ptr)
20993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20994 return this->scale_down(isl::val(ctx(), v));
20997 isl::multi_pw_aff pw_multi_aff::set_at(int pos, const isl::pw_aff &el) const
20999 if (!ptr)
21000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21001 return isl::multi_pw_aff(*this).set_at(pos, el);
21004 isl::multi_union_pw_aff pw_multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
21006 if (!ptr)
21007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21008 return isl::multi_pw_aff(*this).set_at(pos, el);
21011 isl::pw_multi_aff pw_multi_aff::set_range_tuple(isl::id id) const
21013 if (!ptr || id.is_null())
21014 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21015 auto saved_ctx = ctx();
21016 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21017 auto res = isl_pw_multi_aff_set_range_tuple_id(copy(), id.release());
21018 if (!res)
21019 exception::throw_last_error(saved_ctx);
21020 return manage(res);
21023 isl::pw_multi_aff pw_multi_aff::set_range_tuple(const std::string &id) const
21025 if (!ptr)
21026 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21027 return this->set_range_tuple(isl::id(ctx(), id));
21030 unsigned pw_multi_aff::size() const
21032 if (!ptr)
21033 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21034 return isl::multi_pw_aff(*this).size();
21037 isl::space pw_multi_aff::space() const
21039 if (!ptr)
21040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21041 auto saved_ctx = ctx();
21042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21043 auto res = isl_pw_multi_aff_get_space(get());
21044 if (!res)
21045 exception::throw_last_error(saved_ctx);
21046 return manage(res);
21049 isl::space pw_multi_aff::get_space() const
21051 return space();
21054 isl::multi_pw_aff pw_multi_aff::sub(const isl::multi_pw_aff &multi2) const
21056 if (!ptr)
21057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21058 return isl::multi_pw_aff(*this).sub(multi2);
21061 isl::multi_union_pw_aff pw_multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
21063 if (!ptr)
21064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21065 return isl::multi_pw_aff(*this).sub(multi2);
21068 isl::pw_multi_aff pw_multi_aff::sub(isl::pw_multi_aff pma2) const
21070 if (!ptr || pma2.is_null())
21071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21072 auto saved_ctx = ctx();
21073 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21074 auto res = isl_pw_multi_aff_sub(copy(), pma2.release());
21075 if (!res)
21076 exception::throw_last_error(saved_ctx);
21077 return manage(res);
21080 isl::union_pw_multi_aff pw_multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
21082 if (!ptr)
21083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21084 return isl::union_pw_multi_aff(*this).sub(upma2);
21087 isl::pw_multi_aff pw_multi_aff::sub(const isl::multi_aff &pma2) const
21089 if (!ptr)
21090 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21091 return this->sub(isl::pw_multi_aff(pma2));
21094 isl::pw_multi_aff pw_multi_aff::sub(const isl::pw_aff &pma2) const
21096 if (!ptr)
21097 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21098 return this->sub(isl::pw_multi_aff(pma2));
21101 isl::pw_multi_aff pw_multi_aff::subtract_domain(isl::set set) const
21103 if (!ptr || set.is_null())
21104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21105 auto saved_ctx = ctx();
21106 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21107 auto res = isl_pw_multi_aff_subtract_domain(copy(), set.release());
21108 if (!res)
21109 exception::throw_last_error(saved_ctx);
21110 return manage(res);
21113 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::space &space) const
21115 if (!ptr)
21116 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21117 return isl::union_pw_multi_aff(*this).subtract_domain(space);
21120 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::union_set &uset) const
21122 if (!ptr)
21123 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21124 return isl::union_pw_multi_aff(*this).subtract_domain(uset);
21127 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::basic_set &set) const
21129 if (!ptr)
21130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21131 return this->subtract_domain(isl::set(set));
21134 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::point &set) const
21136 if (!ptr)
21137 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21138 return this->subtract_domain(isl::set(set));
21141 isl::pw_multi_aff_list pw_multi_aff::to_list() const
21143 if (!ptr)
21144 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21145 auto saved_ctx = ctx();
21146 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21147 auto res = isl_pw_multi_aff_to_list(copy());
21148 if (!res)
21149 exception::throw_last_error(saved_ctx);
21150 return manage(res);
21153 isl::multi_pw_aff pw_multi_aff::to_multi_pw_aff() const
21155 if (!ptr)
21156 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21157 auto saved_ctx = ctx();
21158 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21159 auto res = isl_pw_multi_aff_to_multi_pw_aff(copy());
21160 if (!res)
21161 exception::throw_last_error(saved_ctx);
21162 return manage(res);
21165 isl::union_pw_multi_aff pw_multi_aff::to_union_pw_multi_aff() const
21167 if (!ptr)
21168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21169 auto saved_ctx = ctx();
21170 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21171 auto res = isl_pw_multi_aff_to_union_pw_multi_aff(copy());
21172 if (!res)
21173 exception::throw_last_error(saved_ctx);
21174 return manage(res);
21177 isl::multi_pw_aff pw_multi_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
21179 if (!ptr)
21180 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21181 return isl::multi_pw_aff(*this).unbind_params_insert_domain(domain);
21184 isl::multi_pw_aff pw_multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
21186 if (!ptr)
21187 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21188 return isl::multi_pw_aff(*this).union_add(mpa2);
21191 isl::multi_union_pw_aff pw_multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
21193 if (!ptr)
21194 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21195 return isl::multi_pw_aff(*this).union_add(mupa2);
21198 isl::pw_multi_aff pw_multi_aff::union_add(isl::pw_multi_aff pma2) const
21200 if (!ptr || pma2.is_null())
21201 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21202 auto saved_ctx = ctx();
21203 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21204 auto res = isl_pw_multi_aff_union_add(copy(), pma2.release());
21205 if (!res)
21206 exception::throw_last_error(saved_ctx);
21207 return manage(res);
21210 isl::union_pw_multi_aff pw_multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
21212 if (!ptr)
21213 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21214 return isl::union_pw_multi_aff(*this).union_add(upma2);
21217 isl::pw_multi_aff pw_multi_aff::union_add(const isl::multi_aff &pma2) const
21219 if (!ptr)
21220 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21221 return this->union_add(isl::pw_multi_aff(pma2));
21224 isl::pw_multi_aff pw_multi_aff::union_add(const isl::pw_aff &pma2) const
21226 if (!ptr)
21227 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21228 return this->union_add(isl::pw_multi_aff(pma2));
21231 isl::pw_multi_aff pw_multi_aff::zero(isl::space space)
21233 if (space.is_null())
21234 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21235 auto saved_ctx = space.ctx();
21236 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21237 auto res = isl_pw_multi_aff_zero(space.release());
21238 if (!res)
21239 exception::throw_last_error(saved_ctx);
21240 return manage(res);
21243 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff &obj)
21245 if (!obj.get())
21246 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21247 auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.get());
21248 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21249 char *str = isl_pw_multi_aff_to_str(obj.get());
21250 if (!str)
21251 exception::throw_last_error(saved_ctx);
21252 os << str;
21253 free(str);
21254 return os;
21257 // implementations for isl::pw_multi_aff_list
21258 pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr) {
21259 if (!ptr)
21260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21261 return pw_multi_aff_list(ptr);
21263 pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr) {
21264 if (!ptr)
21265 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21266 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(ptr);
21267 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21268 ptr = isl_pw_multi_aff_list_copy(ptr);
21269 if (!ptr)
21270 exception::throw_last_error(saved_ctx);
21271 return pw_multi_aff_list(ptr);
21274 pw_multi_aff_list::pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr)
21275 : ptr(ptr) {}
21277 pw_multi_aff_list::pw_multi_aff_list()
21278 : ptr(nullptr) {}
21280 pw_multi_aff_list::pw_multi_aff_list(const pw_multi_aff_list &obj)
21281 : ptr(nullptr)
21283 if (!obj.ptr)
21284 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21285 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.ptr);
21286 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21287 ptr = obj.copy();
21288 if (!ptr)
21289 exception::throw_last_error(saved_ctx);
21292 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, int n)
21294 auto saved_ctx = ctx;
21295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21296 auto res = isl_pw_multi_aff_list_alloc(ctx.release(), n);
21297 if (!res)
21298 exception::throw_last_error(saved_ctx);
21299 ptr = res;
21302 pw_multi_aff_list::pw_multi_aff_list(isl::pw_multi_aff el)
21304 if (el.is_null())
21305 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21306 auto saved_ctx = el.ctx();
21307 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21308 auto res = isl_pw_multi_aff_list_from_pw_multi_aff(el.release());
21309 if (!res)
21310 exception::throw_last_error(saved_ctx);
21311 ptr = res;
21314 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, const std::string &str)
21316 auto saved_ctx = ctx;
21317 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21318 auto res = isl_pw_multi_aff_list_read_from_str(ctx.release(), str.c_str());
21319 if (!res)
21320 exception::throw_last_error(saved_ctx);
21321 ptr = res;
21324 pw_multi_aff_list &pw_multi_aff_list::operator=(pw_multi_aff_list obj) {
21325 std::swap(this->ptr, obj.ptr);
21326 return *this;
21329 pw_multi_aff_list::~pw_multi_aff_list() {
21330 if (ptr)
21331 isl_pw_multi_aff_list_free(ptr);
21334 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::copy() const & {
21335 return isl_pw_multi_aff_list_copy(ptr);
21338 __isl_keep isl_pw_multi_aff_list *pw_multi_aff_list::get() const {
21339 return ptr;
21342 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::release() {
21343 isl_pw_multi_aff_list *tmp = ptr;
21344 ptr = nullptr;
21345 return tmp;
21348 bool pw_multi_aff_list::is_null() const {
21349 return ptr == nullptr;
21352 isl::ctx pw_multi_aff_list::ctx() const {
21353 return isl::ctx(isl_pw_multi_aff_list_get_ctx(ptr));
21356 isl::pw_multi_aff_list pw_multi_aff_list::add(isl::pw_multi_aff el) const
21358 if (!ptr || el.is_null())
21359 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21360 auto saved_ctx = ctx();
21361 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21362 auto res = isl_pw_multi_aff_list_add(copy(), el.release());
21363 if (!res)
21364 exception::throw_last_error(saved_ctx);
21365 return manage(res);
21368 isl::pw_multi_aff pw_multi_aff_list::at(int index) const
21370 if (!ptr)
21371 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21372 auto saved_ctx = ctx();
21373 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21374 auto res = isl_pw_multi_aff_list_get_at(get(), index);
21375 if (!res)
21376 exception::throw_last_error(saved_ctx);
21377 return manage(res);
21380 isl::pw_multi_aff pw_multi_aff_list::get_at(int index) const
21382 return at(index);
21385 isl::pw_multi_aff_list pw_multi_aff_list::clear() const
21387 if (!ptr)
21388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21389 auto saved_ctx = ctx();
21390 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21391 auto res = isl_pw_multi_aff_list_clear(copy());
21392 if (!res)
21393 exception::throw_last_error(saved_ctx);
21394 return manage(res);
21397 isl::pw_multi_aff_list pw_multi_aff_list::concat(isl::pw_multi_aff_list list2) const
21399 if (!ptr || list2.is_null())
21400 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21401 auto saved_ctx = ctx();
21402 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21403 auto res = isl_pw_multi_aff_list_concat(copy(), list2.release());
21404 if (!res)
21405 exception::throw_last_error(saved_ctx);
21406 return manage(res);
21409 isl::pw_multi_aff_list pw_multi_aff_list::drop(unsigned int first, unsigned int n) const
21411 if (!ptr)
21412 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21413 auto saved_ctx = ctx();
21414 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21415 auto res = isl_pw_multi_aff_list_drop(copy(), first, n);
21416 if (!res)
21417 exception::throw_last_error(saved_ctx);
21418 return manage(res);
21421 void pw_multi_aff_list::foreach(const std::function<void(isl::pw_multi_aff)> &fn) const
21423 if (!ptr)
21424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21425 auto saved_ctx = ctx();
21426 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21427 struct fn_data {
21428 std::function<void(isl::pw_multi_aff)> func;
21429 std::exception_ptr eptr;
21430 } fn_data = { fn };
21431 auto fn_lambda = [](isl_pw_multi_aff *arg_0, void *arg_1) -> isl_stat {
21432 auto *data = static_cast<struct fn_data *>(arg_1);
21433 ISL_CPP_TRY {
21434 (data->func)(manage(arg_0));
21435 return isl_stat_ok;
21436 } ISL_CPP_CATCH_ALL {
21437 data->eptr = std::current_exception();
21438 return isl_stat_error;
21441 auto res = isl_pw_multi_aff_list_foreach(get(), fn_lambda, &fn_data);
21442 if (fn_data.eptr)
21443 std::rethrow_exception(fn_data.eptr);
21444 if (res < 0)
21445 exception::throw_last_error(saved_ctx);
21446 return;
21449 void pw_multi_aff_list::foreach_scc(const std::function<bool(isl::pw_multi_aff, isl::pw_multi_aff)> &follows, const std::function<void(isl::pw_multi_aff_list)> &fn) const
21451 if (!ptr)
21452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21453 auto saved_ctx = ctx();
21454 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21455 struct follows_data {
21456 std::function<bool(isl::pw_multi_aff, isl::pw_multi_aff)> func;
21457 std::exception_ptr eptr;
21458 } follows_data = { follows };
21459 auto follows_lambda = [](isl_pw_multi_aff *arg_0, isl_pw_multi_aff *arg_1, void *arg_2) -> isl_bool {
21460 auto *data = static_cast<struct follows_data *>(arg_2);
21461 ISL_CPP_TRY {
21462 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
21463 return ret ? isl_bool_true : isl_bool_false;
21464 } ISL_CPP_CATCH_ALL {
21465 data->eptr = std::current_exception();
21466 return isl_bool_error;
21469 struct fn_data {
21470 std::function<void(isl::pw_multi_aff_list)> func;
21471 std::exception_ptr eptr;
21472 } fn_data = { fn };
21473 auto fn_lambda = [](isl_pw_multi_aff_list *arg_0, void *arg_1) -> isl_stat {
21474 auto *data = static_cast<struct fn_data *>(arg_1);
21475 ISL_CPP_TRY {
21476 (data->func)(manage(arg_0));
21477 return isl_stat_ok;
21478 } ISL_CPP_CATCH_ALL {
21479 data->eptr = std::current_exception();
21480 return isl_stat_error;
21483 auto res = isl_pw_multi_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
21484 if (follows_data.eptr)
21485 std::rethrow_exception(follows_data.eptr);
21486 if (fn_data.eptr)
21487 std::rethrow_exception(fn_data.eptr);
21488 if (res < 0)
21489 exception::throw_last_error(saved_ctx);
21490 return;
21493 isl::pw_multi_aff_list pw_multi_aff_list::insert(unsigned int pos, isl::pw_multi_aff el) const
21495 if (!ptr || el.is_null())
21496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21497 auto saved_ctx = ctx();
21498 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21499 auto res = isl_pw_multi_aff_list_insert(copy(), pos, el.release());
21500 if (!res)
21501 exception::throw_last_error(saved_ctx);
21502 return manage(res);
21505 isl::pw_multi_aff_list pw_multi_aff_list::set_at(int index, isl::pw_multi_aff el) const
21507 if (!ptr || el.is_null())
21508 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21509 auto saved_ctx = ctx();
21510 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21511 auto res = isl_pw_multi_aff_list_set_at(copy(), index, el.release());
21512 if (!res)
21513 exception::throw_last_error(saved_ctx);
21514 return manage(res);
21517 unsigned pw_multi_aff_list::size() const
21519 if (!ptr)
21520 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21521 auto saved_ctx = ctx();
21522 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21523 auto res = isl_pw_multi_aff_list_size(get());
21524 if (res < 0)
21525 exception::throw_last_error(saved_ctx);
21526 return res;
21529 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff_list &obj)
21531 if (!obj.get())
21532 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21533 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.get());
21534 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21535 char *str = isl_pw_multi_aff_list_to_str(obj.get());
21536 if (!str)
21537 exception::throw_last_error(saved_ctx);
21538 os << str;
21539 free(str);
21540 return os;
21543 // implementations for isl::schedule
21544 schedule manage(__isl_take isl_schedule *ptr) {
21545 if (!ptr)
21546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21547 return schedule(ptr);
21549 schedule manage_copy(__isl_keep isl_schedule *ptr) {
21550 if (!ptr)
21551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21552 auto saved_ctx = isl_schedule_get_ctx(ptr);
21553 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21554 ptr = isl_schedule_copy(ptr);
21555 if (!ptr)
21556 exception::throw_last_error(saved_ctx);
21557 return schedule(ptr);
21560 schedule::schedule(__isl_take isl_schedule *ptr)
21561 : ptr(ptr) {}
21563 schedule::schedule()
21564 : ptr(nullptr) {}
21566 schedule::schedule(const schedule &obj)
21567 : ptr(nullptr)
21569 if (!obj.ptr)
21570 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21571 auto saved_ctx = isl_schedule_get_ctx(obj.ptr);
21572 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21573 ptr = obj.copy();
21574 if (!ptr)
21575 exception::throw_last_error(saved_ctx);
21578 schedule::schedule(isl::ctx ctx, const std::string &str)
21580 auto saved_ctx = ctx;
21581 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21582 auto res = isl_schedule_read_from_str(ctx.release(), str.c_str());
21583 if (!res)
21584 exception::throw_last_error(saved_ctx);
21585 ptr = res;
21588 schedule &schedule::operator=(schedule obj) {
21589 std::swap(this->ptr, obj.ptr);
21590 return *this;
21593 schedule::~schedule() {
21594 if (ptr)
21595 isl_schedule_free(ptr);
21598 __isl_give isl_schedule *schedule::copy() const & {
21599 return isl_schedule_copy(ptr);
21602 __isl_keep isl_schedule *schedule::get() const {
21603 return ptr;
21606 __isl_give isl_schedule *schedule::release() {
21607 isl_schedule *tmp = ptr;
21608 ptr = nullptr;
21609 return tmp;
21612 bool schedule::is_null() const {
21613 return ptr == nullptr;
21616 isl::ctx schedule::ctx() const {
21617 return isl::ctx(isl_schedule_get_ctx(ptr));
21620 isl::union_set schedule::domain() const
21622 if (!ptr)
21623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21624 auto saved_ctx = ctx();
21625 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21626 auto res = isl_schedule_get_domain(get());
21627 if (!res)
21628 exception::throw_last_error(saved_ctx);
21629 return manage(res);
21632 isl::union_set schedule::get_domain() const
21634 return domain();
21637 isl::schedule schedule::from_domain(isl::union_set domain)
21639 if (domain.is_null())
21640 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21641 auto saved_ctx = domain.ctx();
21642 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21643 auto res = isl_schedule_from_domain(domain.release());
21644 if (!res)
21645 exception::throw_last_error(saved_ctx);
21646 return manage(res);
21649 isl::union_map schedule::map() const
21651 if (!ptr)
21652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21653 auto saved_ctx = ctx();
21654 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21655 auto res = isl_schedule_get_map(get());
21656 if (!res)
21657 exception::throw_last_error(saved_ctx);
21658 return manage(res);
21661 isl::union_map schedule::get_map() const
21663 return map();
21666 isl::schedule schedule::pullback(isl::union_pw_multi_aff upma) const
21668 if (!ptr || upma.is_null())
21669 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21670 auto saved_ctx = ctx();
21671 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21672 auto res = isl_schedule_pullback_union_pw_multi_aff(copy(), upma.release());
21673 if (!res)
21674 exception::throw_last_error(saved_ctx);
21675 return manage(res);
21678 isl::schedule_node schedule::root() const
21680 if (!ptr)
21681 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21682 auto saved_ctx = ctx();
21683 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21684 auto res = isl_schedule_get_root(get());
21685 if (!res)
21686 exception::throw_last_error(saved_ctx);
21687 return manage(res);
21690 isl::schedule_node schedule::get_root() const
21692 return root();
21695 inline std::ostream &operator<<(std::ostream &os, const schedule &obj)
21697 if (!obj.get())
21698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21699 auto saved_ctx = isl_schedule_get_ctx(obj.get());
21700 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21701 char *str = isl_schedule_to_str(obj.get());
21702 if (!str)
21703 exception::throw_last_error(saved_ctx);
21704 os << str;
21705 free(str);
21706 return os;
21709 // implementations for isl::schedule_constraints
21710 schedule_constraints manage(__isl_take isl_schedule_constraints *ptr) {
21711 if (!ptr)
21712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21713 return schedule_constraints(ptr);
21715 schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr) {
21716 if (!ptr)
21717 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21718 auto saved_ctx = isl_schedule_constraints_get_ctx(ptr);
21719 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21720 ptr = isl_schedule_constraints_copy(ptr);
21721 if (!ptr)
21722 exception::throw_last_error(saved_ctx);
21723 return schedule_constraints(ptr);
21726 schedule_constraints::schedule_constraints(__isl_take isl_schedule_constraints *ptr)
21727 : ptr(ptr) {}
21729 schedule_constraints::schedule_constraints()
21730 : ptr(nullptr) {}
21732 schedule_constraints::schedule_constraints(const schedule_constraints &obj)
21733 : ptr(nullptr)
21735 if (!obj.ptr)
21736 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21737 auto saved_ctx = isl_schedule_constraints_get_ctx(obj.ptr);
21738 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21739 ptr = obj.copy();
21740 if (!ptr)
21741 exception::throw_last_error(saved_ctx);
21744 schedule_constraints::schedule_constraints(isl::ctx ctx, const std::string &str)
21746 auto saved_ctx = ctx;
21747 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21748 auto res = isl_schedule_constraints_read_from_str(ctx.release(), str.c_str());
21749 if (!res)
21750 exception::throw_last_error(saved_ctx);
21751 ptr = res;
21754 schedule_constraints &schedule_constraints::operator=(schedule_constraints obj) {
21755 std::swap(this->ptr, obj.ptr);
21756 return *this;
21759 schedule_constraints::~schedule_constraints() {
21760 if (ptr)
21761 isl_schedule_constraints_free(ptr);
21764 __isl_give isl_schedule_constraints *schedule_constraints::copy() const & {
21765 return isl_schedule_constraints_copy(ptr);
21768 __isl_keep isl_schedule_constraints *schedule_constraints::get() const {
21769 return ptr;
21772 __isl_give isl_schedule_constraints *schedule_constraints::release() {
21773 isl_schedule_constraints *tmp = ptr;
21774 ptr = nullptr;
21775 return tmp;
21778 bool schedule_constraints::is_null() const {
21779 return ptr == nullptr;
21782 isl::ctx schedule_constraints::ctx() const {
21783 return isl::ctx(isl_schedule_constraints_get_ctx(ptr));
21786 isl::union_map schedule_constraints::coincidence() const
21788 if (!ptr)
21789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21790 auto saved_ctx = ctx();
21791 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21792 auto res = isl_schedule_constraints_get_coincidence(get());
21793 if (!res)
21794 exception::throw_last_error(saved_ctx);
21795 return manage(res);
21798 isl::union_map schedule_constraints::get_coincidence() const
21800 return coincidence();
21803 isl::schedule schedule_constraints::compute_schedule() const
21805 if (!ptr)
21806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21807 auto saved_ctx = ctx();
21808 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21809 auto res = isl_schedule_constraints_compute_schedule(copy());
21810 if (!res)
21811 exception::throw_last_error(saved_ctx);
21812 return manage(res);
21815 isl::union_map schedule_constraints::conditional_validity() const
21817 if (!ptr)
21818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21819 auto saved_ctx = ctx();
21820 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21821 auto res = isl_schedule_constraints_get_conditional_validity(get());
21822 if (!res)
21823 exception::throw_last_error(saved_ctx);
21824 return manage(res);
21827 isl::union_map schedule_constraints::get_conditional_validity() const
21829 return conditional_validity();
21832 isl::union_map schedule_constraints::conditional_validity_condition() const
21834 if (!ptr)
21835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21836 auto saved_ctx = ctx();
21837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21838 auto res = isl_schedule_constraints_get_conditional_validity_condition(get());
21839 if (!res)
21840 exception::throw_last_error(saved_ctx);
21841 return manage(res);
21844 isl::union_map schedule_constraints::get_conditional_validity_condition() const
21846 return conditional_validity_condition();
21849 isl::set schedule_constraints::context() const
21851 if (!ptr)
21852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21853 auto saved_ctx = ctx();
21854 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21855 auto res = isl_schedule_constraints_get_context(get());
21856 if (!res)
21857 exception::throw_last_error(saved_ctx);
21858 return manage(res);
21861 isl::set schedule_constraints::get_context() const
21863 return context();
21866 isl::union_set schedule_constraints::domain() const
21868 if (!ptr)
21869 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21870 auto saved_ctx = ctx();
21871 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21872 auto res = isl_schedule_constraints_get_domain(get());
21873 if (!res)
21874 exception::throw_last_error(saved_ctx);
21875 return manage(res);
21878 isl::union_set schedule_constraints::get_domain() const
21880 return domain();
21883 isl::schedule_constraints schedule_constraints::on_domain(isl::union_set domain)
21885 if (domain.is_null())
21886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21887 auto saved_ctx = domain.ctx();
21888 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21889 auto res = isl_schedule_constraints_on_domain(domain.release());
21890 if (!res)
21891 exception::throw_last_error(saved_ctx);
21892 return manage(res);
21895 isl::union_map schedule_constraints::proximity() const
21897 if (!ptr)
21898 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21899 auto saved_ctx = ctx();
21900 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21901 auto res = isl_schedule_constraints_get_proximity(get());
21902 if (!res)
21903 exception::throw_last_error(saved_ctx);
21904 return manage(res);
21907 isl::union_map schedule_constraints::get_proximity() const
21909 return proximity();
21912 isl::schedule_constraints schedule_constraints::set_coincidence(isl::union_map coincidence) const
21914 if (!ptr || coincidence.is_null())
21915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21916 auto saved_ctx = ctx();
21917 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21918 auto res = isl_schedule_constraints_set_coincidence(copy(), coincidence.release());
21919 if (!res)
21920 exception::throw_last_error(saved_ctx);
21921 return manage(res);
21924 isl::schedule_constraints schedule_constraints::set_conditional_validity(isl::union_map condition, isl::union_map validity) const
21926 if (!ptr || condition.is_null() || validity.is_null())
21927 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21928 auto saved_ctx = ctx();
21929 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21930 auto res = isl_schedule_constraints_set_conditional_validity(copy(), condition.release(), validity.release());
21931 if (!res)
21932 exception::throw_last_error(saved_ctx);
21933 return manage(res);
21936 isl::schedule_constraints schedule_constraints::set_context(isl::set context) const
21938 if (!ptr || context.is_null())
21939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21940 auto saved_ctx = ctx();
21941 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21942 auto res = isl_schedule_constraints_set_context(copy(), context.release());
21943 if (!res)
21944 exception::throw_last_error(saved_ctx);
21945 return manage(res);
21948 isl::schedule_constraints schedule_constraints::set_proximity(isl::union_map proximity) const
21950 if (!ptr || proximity.is_null())
21951 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21952 auto saved_ctx = ctx();
21953 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21954 auto res = isl_schedule_constraints_set_proximity(copy(), proximity.release());
21955 if (!res)
21956 exception::throw_last_error(saved_ctx);
21957 return manage(res);
21960 isl::schedule_constraints schedule_constraints::set_validity(isl::union_map validity) const
21962 if (!ptr || validity.is_null())
21963 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21964 auto saved_ctx = ctx();
21965 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21966 auto res = isl_schedule_constraints_set_validity(copy(), validity.release());
21967 if (!res)
21968 exception::throw_last_error(saved_ctx);
21969 return manage(res);
21972 isl::union_map schedule_constraints::validity() const
21974 if (!ptr)
21975 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21976 auto saved_ctx = ctx();
21977 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21978 auto res = isl_schedule_constraints_get_validity(get());
21979 if (!res)
21980 exception::throw_last_error(saved_ctx);
21981 return manage(res);
21984 isl::union_map schedule_constraints::get_validity() const
21986 return validity();
21989 inline std::ostream &operator<<(std::ostream &os, const schedule_constraints &obj)
21991 if (!obj.get())
21992 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21993 auto saved_ctx = isl_schedule_constraints_get_ctx(obj.get());
21994 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21995 char *str = isl_schedule_constraints_to_str(obj.get());
21996 if (!str)
21997 exception::throw_last_error(saved_ctx);
21998 os << str;
21999 free(str);
22000 return os;
22003 // implementations for isl::schedule_node
22004 schedule_node manage(__isl_take isl_schedule_node *ptr) {
22005 if (!ptr)
22006 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22007 return schedule_node(ptr);
22009 schedule_node manage_copy(__isl_keep isl_schedule_node *ptr) {
22010 if (!ptr)
22011 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22012 auto saved_ctx = isl_schedule_node_get_ctx(ptr);
22013 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22014 ptr = isl_schedule_node_copy(ptr);
22015 if (!ptr)
22016 exception::throw_last_error(saved_ctx);
22017 return schedule_node(ptr);
22020 schedule_node::schedule_node(__isl_take isl_schedule_node *ptr)
22021 : ptr(ptr) {}
22023 schedule_node::schedule_node()
22024 : ptr(nullptr) {}
22026 schedule_node::schedule_node(const schedule_node &obj)
22027 : ptr(nullptr)
22029 if (!obj.ptr)
22030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22031 auto saved_ctx = isl_schedule_node_get_ctx(obj.ptr);
22032 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22033 ptr = obj.copy();
22034 if (!ptr)
22035 exception::throw_last_error(saved_ctx);
22038 schedule_node &schedule_node::operator=(schedule_node obj) {
22039 std::swap(this->ptr, obj.ptr);
22040 return *this;
22043 schedule_node::~schedule_node() {
22044 if (ptr)
22045 isl_schedule_node_free(ptr);
22048 __isl_give isl_schedule_node *schedule_node::copy() const & {
22049 return isl_schedule_node_copy(ptr);
22052 __isl_keep isl_schedule_node *schedule_node::get() const {
22053 return ptr;
22056 __isl_give isl_schedule_node *schedule_node::release() {
22057 isl_schedule_node *tmp = ptr;
22058 ptr = nullptr;
22059 return tmp;
22062 bool schedule_node::is_null() const {
22063 return ptr == nullptr;
22066 template <typename T, typename>
22067 bool schedule_node::isa_type(T subtype) const
22069 if (is_null())
22070 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22071 return isl_schedule_node_get_type(get()) == subtype;
22073 template <class T>
22074 bool schedule_node::isa() const
22076 return isa_type<decltype(T::type)>(T::type);
22078 template <class T>
22079 T schedule_node::as() const
22081 if (!isa<T>())
22082 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
22083 return T(copy());
22086 isl::ctx schedule_node::ctx() const {
22087 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22090 isl::schedule_node schedule_node::ancestor(int generation) const
22092 if (!ptr)
22093 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22094 auto saved_ctx = ctx();
22095 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22096 auto res = isl_schedule_node_ancestor(copy(), generation);
22097 if (!res)
22098 exception::throw_last_error(saved_ctx);
22099 return manage(res);
22102 unsigned schedule_node::ancestor_child_position(const isl::schedule_node &ancestor) const
22104 if (!ptr || ancestor.is_null())
22105 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22106 auto saved_ctx = ctx();
22107 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22108 auto res = isl_schedule_node_get_ancestor_child_position(get(), ancestor.get());
22109 if (res < 0)
22110 exception::throw_last_error(saved_ctx);
22111 return res;
22114 unsigned schedule_node::get_ancestor_child_position(const isl::schedule_node &ancestor) const
22116 return ancestor_child_position(ancestor);
22119 isl::schedule_node schedule_node::child(int pos) const
22121 if (!ptr)
22122 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22123 auto saved_ctx = ctx();
22124 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22125 auto res = isl_schedule_node_child(copy(), pos);
22126 if (!res)
22127 exception::throw_last_error(saved_ctx);
22128 return manage(res);
22131 unsigned schedule_node::child_position() const
22133 if (!ptr)
22134 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22135 auto saved_ctx = ctx();
22136 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22137 auto res = isl_schedule_node_get_child_position(get());
22138 if (res < 0)
22139 exception::throw_last_error(saved_ctx);
22140 return res;
22143 unsigned schedule_node::get_child_position() const
22145 return child_position();
22148 bool schedule_node::every_descendant(const std::function<bool(isl::schedule_node)> &test) const
22150 if (!ptr)
22151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22152 auto saved_ctx = ctx();
22153 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22154 struct test_data {
22155 std::function<bool(isl::schedule_node)> func;
22156 std::exception_ptr eptr;
22157 } test_data = { test };
22158 auto test_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
22159 auto *data = static_cast<struct test_data *>(arg_1);
22160 ISL_CPP_TRY {
22161 auto ret = (data->func)(manage_copy(arg_0));
22162 return ret ? isl_bool_true : isl_bool_false;
22163 } ISL_CPP_CATCH_ALL {
22164 data->eptr = std::current_exception();
22165 return isl_bool_error;
22168 auto res = isl_schedule_node_every_descendant(get(), test_lambda, &test_data);
22169 if (test_data.eptr)
22170 std::rethrow_exception(test_data.eptr);
22171 if (res < 0)
22172 exception::throw_last_error(saved_ctx);
22173 return res;
22176 isl::schedule_node schedule_node::first_child() const
22178 if (!ptr)
22179 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22180 auto saved_ctx = ctx();
22181 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22182 auto res = isl_schedule_node_first_child(copy());
22183 if (!res)
22184 exception::throw_last_error(saved_ctx);
22185 return manage(res);
22188 void schedule_node::foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const
22190 if (!ptr)
22191 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22192 auto saved_ctx = ctx();
22193 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22194 struct fn_data {
22195 std::function<void(isl::schedule_node)> func;
22196 std::exception_ptr eptr;
22197 } fn_data = { fn };
22198 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_stat {
22199 auto *data = static_cast<struct fn_data *>(arg_1);
22200 ISL_CPP_TRY {
22201 (data->func)(manage_copy(arg_0));
22202 return isl_stat_ok;
22203 } ISL_CPP_CATCH_ALL {
22204 data->eptr = std::current_exception();
22205 return isl_stat_error;
22208 auto res = isl_schedule_node_foreach_ancestor_top_down(get(), fn_lambda, &fn_data);
22209 if (fn_data.eptr)
22210 std::rethrow_exception(fn_data.eptr);
22211 if (res < 0)
22212 exception::throw_last_error(saved_ctx);
22213 return;
22216 void schedule_node::foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const
22218 if (!ptr)
22219 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22220 auto saved_ctx = ctx();
22221 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22222 struct fn_data {
22223 std::function<bool(isl::schedule_node)> func;
22224 std::exception_ptr eptr;
22225 } fn_data = { fn };
22226 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
22227 auto *data = static_cast<struct fn_data *>(arg_1);
22228 ISL_CPP_TRY {
22229 auto ret = (data->func)(manage_copy(arg_0));
22230 return ret ? isl_bool_true : isl_bool_false;
22231 } ISL_CPP_CATCH_ALL {
22232 data->eptr = std::current_exception();
22233 return isl_bool_error;
22236 auto res = isl_schedule_node_foreach_descendant_top_down(get(), fn_lambda, &fn_data);
22237 if (fn_data.eptr)
22238 std::rethrow_exception(fn_data.eptr);
22239 if (res < 0)
22240 exception::throw_last_error(saved_ctx);
22241 return;
22244 isl::schedule_node schedule_node::from_domain(isl::union_set domain)
22246 if (domain.is_null())
22247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22248 auto saved_ctx = domain.ctx();
22249 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22250 auto res = isl_schedule_node_from_domain(domain.release());
22251 if (!res)
22252 exception::throw_last_error(saved_ctx);
22253 return manage(res);
22256 isl::schedule_node schedule_node::from_extension(isl::union_map extension)
22258 if (extension.is_null())
22259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22260 auto saved_ctx = extension.ctx();
22261 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22262 auto res = isl_schedule_node_from_extension(extension.release());
22263 if (!res)
22264 exception::throw_last_error(saved_ctx);
22265 return manage(res);
22268 isl::schedule_node schedule_node::graft_after(isl::schedule_node graft) const
22270 if (!ptr || graft.is_null())
22271 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22272 auto saved_ctx = ctx();
22273 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22274 auto res = isl_schedule_node_graft_after(copy(), graft.release());
22275 if (!res)
22276 exception::throw_last_error(saved_ctx);
22277 return manage(res);
22280 isl::schedule_node schedule_node::graft_before(isl::schedule_node graft) const
22282 if (!ptr || graft.is_null())
22283 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22284 auto saved_ctx = ctx();
22285 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22286 auto res = isl_schedule_node_graft_before(copy(), graft.release());
22287 if (!res)
22288 exception::throw_last_error(saved_ctx);
22289 return manage(res);
22292 bool schedule_node::has_children() const
22294 if (!ptr)
22295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22296 auto saved_ctx = ctx();
22297 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22298 auto res = isl_schedule_node_has_children(get());
22299 if (res < 0)
22300 exception::throw_last_error(saved_ctx);
22301 return res;
22304 bool schedule_node::has_next_sibling() const
22306 if (!ptr)
22307 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22308 auto saved_ctx = ctx();
22309 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22310 auto res = isl_schedule_node_has_next_sibling(get());
22311 if (res < 0)
22312 exception::throw_last_error(saved_ctx);
22313 return res;
22316 bool schedule_node::has_parent() const
22318 if (!ptr)
22319 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22320 auto saved_ctx = ctx();
22321 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22322 auto res = isl_schedule_node_has_parent(get());
22323 if (res < 0)
22324 exception::throw_last_error(saved_ctx);
22325 return res;
22328 bool schedule_node::has_previous_sibling() const
22330 if (!ptr)
22331 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22332 auto saved_ctx = ctx();
22333 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22334 auto res = isl_schedule_node_has_previous_sibling(get());
22335 if (res < 0)
22336 exception::throw_last_error(saved_ctx);
22337 return res;
22340 isl::schedule_node schedule_node::insert_context(isl::set context) const
22342 if (!ptr || context.is_null())
22343 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22344 auto saved_ctx = ctx();
22345 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22346 auto res = isl_schedule_node_insert_context(copy(), context.release());
22347 if (!res)
22348 exception::throw_last_error(saved_ctx);
22349 return manage(res);
22352 isl::schedule_node schedule_node::insert_filter(isl::union_set filter) const
22354 if (!ptr || filter.is_null())
22355 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22356 auto saved_ctx = ctx();
22357 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22358 auto res = isl_schedule_node_insert_filter(copy(), filter.release());
22359 if (!res)
22360 exception::throw_last_error(saved_ctx);
22361 return manage(res);
22364 isl::schedule_node schedule_node::insert_guard(isl::set context) const
22366 if (!ptr || context.is_null())
22367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22368 auto saved_ctx = ctx();
22369 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22370 auto res = isl_schedule_node_insert_guard(copy(), context.release());
22371 if (!res)
22372 exception::throw_last_error(saved_ctx);
22373 return manage(res);
22376 isl::schedule_node schedule_node::insert_mark(isl::id mark) const
22378 if (!ptr || mark.is_null())
22379 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22380 auto saved_ctx = ctx();
22381 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22382 auto res = isl_schedule_node_insert_mark(copy(), mark.release());
22383 if (!res)
22384 exception::throw_last_error(saved_ctx);
22385 return manage(res);
22388 isl::schedule_node schedule_node::insert_mark(const std::string &mark) const
22390 if (!ptr)
22391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22392 return this->insert_mark(isl::id(ctx(), mark));
22395 isl::schedule_node schedule_node::insert_partial_schedule(isl::multi_union_pw_aff schedule) const
22397 if (!ptr || schedule.is_null())
22398 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22399 auto saved_ctx = ctx();
22400 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22401 auto res = isl_schedule_node_insert_partial_schedule(copy(), schedule.release());
22402 if (!res)
22403 exception::throw_last_error(saved_ctx);
22404 return manage(res);
22407 isl::schedule_node schedule_node::insert_sequence(isl::union_set_list filters) const
22409 if (!ptr || filters.is_null())
22410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22411 auto saved_ctx = ctx();
22412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22413 auto res = isl_schedule_node_insert_sequence(copy(), filters.release());
22414 if (!res)
22415 exception::throw_last_error(saved_ctx);
22416 return manage(res);
22419 isl::schedule_node schedule_node::insert_set(isl::union_set_list filters) const
22421 if (!ptr || filters.is_null())
22422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22423 auto saved_ctx = ctx();
22424 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22425 auto res = isl_schedule_node_insert_set(copy(), filters.release());
22426 if (!res)
22427 exception::throw_last_error(saved_ctx);
22428 return manage(res);
22431 bool schedule_node::is_equal(const isl::schedule_node &node2) const
22433 if (!ptr || node2.is_null())
22434 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22435 auto saved_ctx = ctx();
22436 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22437 auto res = isl_schedule_node_is_equal(get(), node2.get());
22438 if (res < 0)
22439 exception::throw_last_error(saved_ctx);
22440 return res;
22443 bool schedule_node::is_subtree_anchored() const
22445 if (!ptr)
22446 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22447 auto saved_ctx = ctx();
22448 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22449 auto res = isl_schedule_node_is_subtree_anchored(get());
22450 if (res < 0)
22451 exception::throw_last_error(saved_ctx);
22452 return res;
22455 isl::schedule_node schedule_node::map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const
22457 if (!ptr)
22458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22459 auto saved_ctx = ctx();
22460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22461 struct fn_data {
22462 std::function<isl::schedule_node(isl::schedule_node)> func;
22463 std::exception_ptr eptr;
22464 } fn_data = { fn };
22465 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_schedule_node * {
22466 auto *data = static_cast<struct fn_data *>(arg_1);
22467 ISL_CPP_TRY {
22468 auto ret = (data->func)(manage(arg_0));
22469 return ret.release();
22470 } ISL_CPP_CATCH_ALL {
22471 data->eptr = std::current_exception();
22472 return NULL;
22475 auto res = isl_schedule_node_map_descendant_bottom_up(copy(), fn_lambda, &fn_data);
22476 if (fn_data.eptr)
22477 std::rethrow_exception(fn_data.eptr);
22478 if (!res)
22479 exception::throw_last_error(saved_ctx);
22480 return manage(res);
22483 unsigned schedule_node::n_children() const
22485 if (!ptr)
22486 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22487 auto saved_ctx = ctx();
22488 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22489 auto res = isl_schedule_node_n_children(get());
22490 if (res < 0)
22491 exception::throw_last_error(saved_ctx);
22492 return res;
22495 isl::schedule_node schedule_node::next_sibling() const
22497 if (!ptr)
22498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22499 auto saved_ctx = ctx();
22500 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22501 auto res = isl_schedule_node_next_sibling(copy());
22502 if (!res)
22503 exception::throw_last_error(saved_ctx);
22504 return manage(res);
22507 isl::schedule_node schedule_node::order_after(isl::union_set filter) const
22509 if (!ptr || filter.is_null())
22510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22511 auto saved_ctx = ctx();
22512 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22513 auto res = isl_schedule_node_order_after(copy(), filter.release());
22514 if (!res)
22515 exception::throw_last_error(saved_ctx);
22516 return manage(res);
22519 isl::schedule_node schedule_node::order_before(isl::union_set filter) const
22521 if (!ptr || filter.is_null())
22522 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22523 auto saved_ctx = ctx();
22524 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22525 auto res = isl_schedule_node_order_before(copy(), filter.release());
22526 if (!res)
22527 exception::throw_last_error(saved_ctx);
22528 return manage(res);
22531 isl::schedule_node schedule_node::parent() const
22533 if (!ptr)
22534 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22535 auto saved_ctx = ctx();
22536 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22537 auto res = isl_schedule_node_parent(copy());
22538 if (!res)
22539 exception::throw_last_error(saved_ctx);
22540 return manage(res);
22543 isl::multi_union_pw_aff schedule_node::prefix_schedule_multi_union_pw_aff() const
22545 if (!ptr)
22546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22547 auto saved_ctx = ctx();
22548 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22549 auto res = isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(get());
22550 if (!res)
22551 exception::throw_last_error(saved_ctx);
22552 return manage(res);
22555 isl::multi_union_pw_aff schedule_node::get_prefix_schedule_multi_union_pw_aff() const
22557 return prefix_schedule_multi_union_pw_aff();
22560 isl::union_map schedule_node::prefix_schedule_union_map() const
22562 if (!ptr)
22563 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22564 auto saved_ctx = ctx();
22565 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22566 auto res = isl_schedule_node_get_prefix_schedule_union_map(get());
22567 if (!res)
22568 exception::throw_last_error(saved_ctx);
22569 return manage(res);
22572 isl::union_map schedule_node::get_prefix_schedule_union_map() const
22574 return prefix_schedule_union_map();
22577 isl::union_pw_multi_aff schedule_node::prefix_schedule_union_pw_multi_aff() const
22579 if (!ptr)
22580 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22581 auto saved_ctx = ctx();
22582 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22583 auto res = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(get());
22584 if (!res)
22585 exception::throw_last_error(saved_ctx);
22586 return manage(res);
22589 isl::union_pw_multi_aff schedule_node::get_prefix_schedule_union_pw_multi_aff() const
22591 return prefix_schedule_union_pw_multi_aff();
22594 isl::schedule_node schedule_node::previous_sibling() const
22596 if (!ptr)
22597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22598 auto saved_ctx = ctx();
22599 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22600 auto res = isl_schedule_node_previous_sibling(copy());
22601 if (!res)
22602 exception::throw_last_error(saved_ctx);
22603 return manage(res);
22606 isl::schedule_node schedule_node::root() const
22608 if (!ptr)
22609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22610 auto saved_ctx = ctx();
22611 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22612 auto res = isl_schedule_node_root(copy());
22613 if (!res)
22614 exception::throw_last_error(saved_ctx);
22615 return manage(res);
22618 isl::schedule schedule_node::schedule() const
22620 if (!ptr)
22621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22622 auto saved_ctx = ctx();
22623 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22624 auto res = isl_schedule_node_get_schedule(get());
22625 if (!res)
22626 exception::throw_last_error(saved_ctx);
22627 return manage(res);
22630 isl::schedule schedule_node::get_schedule() const
22632 return schedule();
22635 isl::schedule_node schedule_node::shared_ancestor(const isl::schedule_node &node2) const
22637 if (!ptr || node2.is_null())
22638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22639 auto saved_ctx = ctx();
22640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22641 auto res = isl_schedule_node_get_shared_ancestor(get(), node2.get());
22642 if (!res)
22643 exception::throw_last_error(saved_ctx);
22644 return manage(res);
22647 isl::schedule_node schedule_node::get_shared_ancestor(const isl::schedule_node &node2) const
22649 return shared_ancestor(node2);
22652 unsigned schedule_node::tree_depth() const
22654 if (!ptr)
22655 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22656 auto saved_ctx = ctx();
22657 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22658 auto res = isl_schedule_node_get_tree_depth(get());
22659 if (res < 0)
22660 exception::throw_last_error(saved_ctx);
22661 return res;
22664 unsigned schedule_node::get_tree_depth() const
22666 return tree_depth();
22669 inline std::ostream &operator<<(std::ostream &os, const schedule_node &obj)
22671 if (!obj.get())
22672 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22673 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
22674 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22675 char *str = isl_schedule_node_to_str(obj.get());
22676 if (!str)
22677 exception::throw_last_error(saved_ctx);
22678 os << str;
22679 free(str);
22680 return os;
22683 // implementations for isl::schedule_node_band
22684 schedule_node_band::schedule_node_band(__isl_take isl_schedule_node *ptr)
22685 : schedule_node(ptr) {}
22687 schedule_node_band::schedule_node_band()
22688 : schedule_node() {}
22690 schedule_node_band::schedule_node_band(const schedule_node_band &obj)
22691 : schedule_node(obj)
22695 schedule_node_band &schedule_node_band::operator=(schedule_node_band obj) {
22696 std::swap(this->ptr, obj.ptr);
22697 return *this;
22700 isl::ctx schedule_node_band::ctx() const {
22701 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22704 isl::union_set schedule_node_band::ast_build_options() const
22706 if (!ptr)
22707 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22708 auto saved_ctx = ctx();
22709 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22710 auto res = isl_schedule_node_band_get_ast_build_options(get());
22711 if (!res)
22712 exception::throw_last_error(saved_ctx);
22713 return manage(res);
22716 isl::union_set schedule_node_band::get_ast_build_options() const
22718 return ast_build_options();
22721 isl::set schedule_node_band::ast_isolate_option() const
22723 if (!ptr)
22724 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22725 auto saved_ctx = ctx();
22726 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22727 auto res = isl_schedule_node_band_get_ast_isolate_option(get());
22728 if (!res)
22729 exception::throw_last_error(saved_ctx);
22730 return manage(res);
22733 isl::set schedule_node_band::get_ast_isolate_option() const
22735 return ast_isolate_option();
22738 bool schedule_node_band::member_get_coincident(int pos) const
22740 if (!ptr)
22741 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22742 auto saved_ctx = ctx();
22743 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22744 auto res = isl_schedule_node_band_member_get_coincident(get(), pos);
22745 if (res < 0)
22746 exception::throw_last_error(saved_ctx);
22747 return res;
22750 schedule_node_band schedule_node_band::member_set_coincident(int pos, int coincident) const
22752 if (!ptr)
22753 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22754 auto saved_ctx = ctx();
22755 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22756 auto res = isl_schedule_node_band_member_set_coincident(copy(), pos, coincident);
22757 if (!res)
22758 exception::throw_last_error(saved_ctx);
22759 return manage(res).as<schedule_node_band>();
22762 schedule_node_band schedule_node_band::mod(isl::multi_val mv) const
22764 if (!ptr || mv.is_null())
22765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22766 auto saved_ctx = ctx();
22767 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22768 auto res = isl_schedule_node_band_mod(copy(), mv.release());
22769 if (!res)
22770 exception::throw_last_error(saved_ctx);
22771 return manage(res).as<schedule_node_band>();
22774 unsigned schedule_node_band::n_member() const
22776 if (!ptr)
22777 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22778 auto saved_ctx = ctx();
22779 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22780 auto res = isl_schedule_node_band_n_member(get());
22781 if (res < 0)
22782 exception::throw_last_error(saved_ctx);
22783 return res;
22786 isl::multi_union_pw_aff schedule_node_band::partial_schedule() const
22788 if (!ptr)
22789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22790 auto saved_ctx = ctx();
22791 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22792 auto res = isl_schedule_node_band_get_partial_schedule(get());
22793 if (!res)
22794 exception::throw_last_error(saved_ctx);
22795 return manage(res);
22798 isl::multi_union_pw_aff schedule_node_band::get_partial_schedule() const
22800 return partial_schedule();
22803 bool schedule_node_band::permutable() const
22805 if (!ptr)
22806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22807 auto saved_ctx = ctx();
22808 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22809 auto res = isl_schedule_node_band_get_permutable(get());
22810 if (res < 0)
22811 exception::throw_last_error(saved_ctx);
22812 return res;
22815 bool schedule_node_band::get_permutable() const
22817 return permutable();
22820 schedule_node_band schedule_node_band::scale(isl::multi_val mv) const
22822 if (!ptr || mv.is_null())
22823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22824 auto saved_ctx = ctx();
22825 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22826 auto res = isl_schedule_node_band_scale(copy(), mv.release());
22827 if (!res)
22828 exception::throw_last_error(saved_ctx);
22829 return manage(res).as<schedule_node_band>();
22832 schedule_node_band schedule_node_band::scale_down(isl::multi_val mv) const
22834 if (!ptr || mv.is_null())
22835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22836 auto saved_ctx = ctx();
22837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22838 auto res = isl_schedule_node_band_scale_down(copy(), mv.release());
22839 if (!res)
22840 exception::throw_last_error(saved_ctx);
22841 return manage(res).as<schedule_node_band>();
22844 schedule_node_band schedule_node_band::set_ast_build_options(isl::union_set options) const
22846 if (!ptr || options.is_null())
22847 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22848 auto saved_ctx = ctx();
22849 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22850 auto res = isl_schedule_node_band_set_ast_build_options(copy(), options.release());
22851 if (!res)
22852 exception::throw_last_error(saved_ctx);
22853 return manage(res).as<schedule_node_band>();
22856 schedule_node_band schedule_node_band::set_permutable(int permutable) const
22858 if (!ptr)
22859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22860 auto saved_ctx = ctx();
22861 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22862 auto res = isl_schedule_node_band_set_permutable(copy(), permutable);
22863 if (!res)
22864 exception::throw_last_error(saved_ctx);
22865 return manage(res).as<schedule_node_band>();
22868 schedule_node_band schedule_node_band::shift(isl::multi_union_pw_aff shift) const
22870 if (!ptr || shift.is_null())
22871 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22872 auto saved_ctx = ctx();
22873 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22874 auto res = isl_schedule_node_band_shift(copy(), shift.release());
22875 if (!res)
22876 exception::throw_last_error(saved_ctx);
22877 return manage(res).as<schedule_node_band>();
22880 schedule_node_band schedule_node_band::split(int pos) const
22882 if (!ptr)
22883 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22884 auto saved_ctx = ctx();
22885 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22886 auto res = isl_schedule_node_band_split(copy(), pos);
22887 if (!res)
22888 exception::throw_last_error(saved_ctx);
22889 return manage(res).as<schedule_node_band>();
22892 schedule_node_band schedule_node_band::tile(isl::multi_val sizes) const
22894 if (!ptr || sizes.is_null())
22895 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22896 auto saved_ctx = ctx();
22897 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22898 auto res = isl_schedule_node_band_tile(copy(), sizes.release());
22899 if (!res)
22900 exception::throw_last_error(saved_ctx);
22901 return manage(res).as<schedule_node_band>();
22904 schedule_node_band schedule_node_band::member_set_ast_loop_default(int pos) const
22906 if (!ptr)
22907 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22908 auto saved_ctx = ctx();
22909 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22910 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_default);
22911 if (!res)
22912 exception::throw_last_error(saved_ctx);
22913 return manage(res).as<schedule_node_band>();
22916 schedule_node_band schedule_node_band::member_set_ast_loop_atomic(int pos) const
22918 if (!ptr)
22919 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22920 auto saved_ctx = ctx();
22921 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22922 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_atomic);
22923 if (!res)
22924 exception::throw_last_error(saved_ctx);
22925 return manage(res).as<schedule_node_band>();
22928 schedule_node_band schedule_node_band::member_set_ast_loop_unroll(int pos) const
22930 if (!ptr)
22931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22932 auto saved_ctx = ctx();
22933 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22934 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_unroll);
22935 if (!res)
22936 exception::throw_last_error(saved_ctx);
22937 return manage(res).as<schedule_node_band>();
22940 schedule_node_band schedule_node_band::member_set_ast_loop_separate(int pos) const
22942 if (!ptr)
22943 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22944 auto saved_ctx = ctx();
22945 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22946 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_separate);
22947 if (!res)
22948 exception::throw_last_error(saved_ctx);
22949 return manage(res).as<schedule_node_band>();
22952 inline std::ostream &operator<<(std::ostream &os, const schedule_node_band &obj)
22954 if (!obj.get())
22955 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22956 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
22957 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22958 char *str = isl_schedule_node_to_str(obj.get());
22959 if (!str)
22960 exception::throw_last_error(saved_ctx);
22961 os << str;
22962 free(str);
22963 return os;
22966 // implementations for isl::schedule_node_context
22967 schedule_node_context::schedule_node_context(__isl_take isl_schedule_node *ptr)
22968 : schedule_node(ptr) {}
22970 schedule_node_context::schedule_node_context()
22971 : schedule_node() {}
22973 schedule_node_context::schedule_node_context(const schedule_node_context &obj)
22974 : schedule_node(obj)
22978 schedule_node_context &schedule_node_context::operator=(schedule_node_context obj) {
22979 std::swap(this->ptr, obj.ptr);
22980 return *this;
22983 isl::ctx schedule_node_context::ctx() const {
22984 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22987 isl::set schedule_node_context::context() const
22989 if (!ptr)
22990 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22991 auto saved_ctx = ctx();
22992 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22993 auto res = isl_schedule_node_context_get_context(get());
22994 if (!res)
22995 exception::throw_last_error(saved_ctx);
22996 return manage(res);
22999 isl::set schedule_node_context::get_context() const
23001 return context();
23004 inline std::ostream &operator<<(std::ostream &os, const schedule_node_context &obj)
23006 if (!obj.get())
23007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23008 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23010 char *str = isl_schedule_node_to_str(obj.get());
23011 if (!str)
23012 exception::throw_last_error(saved_ctx);
23013 os << str;
23014 free(str);
23015 return os;
23018 // implementations for isl::schedule_node_domain
23019 schedule_node_domain::schedule_node_domain(__isl_take isl_schedule_node *ptr)
23020 : schedule_node(ptr) {}
23022 schedule_node_domain::schedule_node_domain()
23023 : schedule_node() {}
23025 schedule_node_domain::schedule_node_domain(const schedule_node_domain &obj)
23026 : schedule_node(obj)
23030 schedule_node_domain &schedule_node_domain::operator=(schedule_node_domain obj) {
23031 std::swap(this->ptr, obj.ptr);
23032 return *this;
23035 isl::ctx schedule_node_domain::ctx() const {
23036 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23039 isl::union_set schedule_node_domain::domain() const
23041 if (!ptr)
23042 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23043 auto saved_ctx = ctx();
23044 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23045 auto res = isl_schedule_node_domain_get_domain(get());
23046 if (!res)
23047 exception::throw_last_error(saved_ctx);
23048 return manage(res);
23051 isl::union_set schedule_node_domain::get_domain() const
23053 return domain();
23056 inline std::ostream &operator<<(std::ostream &os, const schedule_node_domain &obj)
23058 if (!obj.get())
23059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23060 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23061 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23062 char *str = isl_schedule_node_to_str(obj.get());
23063 if (!str)
23064 exception::throw_last_error(saved_ctx);
23065 os << str;
23066 free(str);
23067 return os;
23070 // implementations for isl::schedule_node_expansion
23071 schedule_node_expansion::schedule_node_expansion(__isl_take isl_schedule_node *ptr)
23072 : schedule_node(ptr) {}
23074 schedule_node_expansion::schedule_node_expansion()
23075 : schedule_node() {}
23077 schedule_node_expansion::schedule_node_expansion(const schedule_node_expansion &obj)
23078 : schedule_node(obj)
23082 schedule_node_expansion &schedule_node_expansion::operator=(schedule_node_expansion obj) {
23083 std::swap(this->ptr, obj.ptr);
23084 return *this;
23087 isl::ctx schedule_node_expansion::ctx() const {
23088 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23091 isl::union_pw_multi_aff schedule_node_expansion::contraction() const
23093 if (!ptr)
23094 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23095 auto saved_ctx = ctx();
23096 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23097 auto res = isl_schedule_node_expansion_get_contraction(get());
23098 if (!res)
23099 exception::throw_last_error(saved_ctx);
23100 return manage(res);
23103 isl::union_pw_multi_aff schedule_node_expansion::get_contraction() const
23105 return contraction();
23108 isl::union_map schedule_node_expansion::expansion() const
23110 if (!ptr)
23111 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23112 auto saved_ctx = ctx();
23113 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23114 auto res = isl_schedule_node_expansion_get_expansion(get());
23115 if (!res)
23116 exception::throw_last_error(saved_ctx);
23117 return manage(res);
23120 isl::union_map schedule_node_expansion::get_expansion() const
23122 return expansion();
23125 inline std::ostream &operator<<(std::ostream &os, const schedule_node_expansion &obj)
23127 if (!obj.get())
23128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23129 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23130 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23131 char *str = isl_schedule_node_to_str(obj.get());
23132 if (!str)
23133 exception::throw_last_error(saved_ctx);
23134 os << str;
23135 free(str);
23136 return os;
23139 // implementations for isl::schedule_node_extension
23140 schedule_node_extension::schedule_node_extension(__isl_take isl_schedule_node *ptr)
23141 : schedule_node(ptr) {}
23143 schedule_node_extension::schedule_node_extension()
23144 : schedule_node() {}
23146 schedule_node_extension::schedule_node_extension(const schedule_node_extension &obj)
23147 : schedule_node(obj)
23151 schedule_node_extension &schedule_node_extension::operator=(schedule_node_extension obj) {
23152 std::swap(this->ptr, obj.ptr);
23153 return *this;
23156 isl::ctx schedule_node_extension::ctx() const {
23157 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23160 isl::union_map schedule_node_extension::extension() const
23162 if (!ptr)
23163 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23164 auto saved_ctx = ctx();
23165 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23166 auto res = isl_schedule_node_extension_get_extension(get());
23167 if (!res)
23168 exception::throw_last_error(saved_ctx);
23169 return manage(res);
23172 isl::union_map schedule_node_extension::get_extension() const
23174 return extension();
23177 inline std::ostream &operator<<(std::ostream &os, const schedule_node_extension &obj)
23179 if (!obj.get())
23180 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23181 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23182 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23183 char *str = isl_schedule_node_to_str(obj.get());
23184 if (!str)
23185 exception::throw_last_error(saved_ctx);
23186 os << str;
23187 free(str);
23188 return os;
23191 // implementations for isl::schedule_node_filter
23192 schedule_node_filter::schedule_node_filter(__isl_take isl_schedule_node *ptr)
23193 : schedule_node(ptr) {}
23195 schedule_node_filter::schedule_node_filter()
23196 : schedule_node() {}
23198 schedule_node_filter::schedule_node_filter(const schedule_node_filter &obj)
23199 : schedule_node(obj)
23203 schedule_node_filter &schedule_node_filter::operator=(schedule_node_filter obj) {
23204 std::swap(this->ptr, obj.ptr);
23205 return *this;
23208 isl::ctx schedule_node_filter::ctx() const {
23209 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23212 isl::union_set schedule_node_filter::filter() const
23214 if (!ptr)
23215 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23216 auto saved_ctx = ctx();
23217 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23218 auto res = isl_schedule_node_filter_get_filter(get());
23219 if (!res)
23220 exception::throw_last_error(saved_ctx);
23221 return manage(res);
23224 isl::union_set schedule_node_filter::get_filter() const
23226 return filter();
23229 inline std::ostream &operator<<(std::ostream &os, const schedule_node_filter &obj)
23231 if (!obj.get())
23232 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23233 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23234 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23235 char *str = isl_schedule_node_to_str(obj.get());
23236 if (!str)
23237 exception::throw_last_error(saved_ctx);
23238 os << str;
23239 free(str);
23240 return os;
23243 // implementations for isl::schedule_node_guard
23244 schedule_node_guard::schedule_node_guard(__isl_take isl_schedule_node *ptr)
23245 : schedule_node(ptr) {}
23247 schedule_node_guard::schedule_node_guard()
23248 : schedule_node() {}
23250 schedule_node_guard::schedule_node_guard(const schedule_node_guard &obj)
23251 : schedule_node(obj)
23255 schedule_node_guard &schedule_node_guard::operator=(schedule_node_guard obj) {
23256 std::swap(this->ptr, obj.ptr);
23257 return *this;
23260 isl::ctx schedule_node_guard::ctx() const {
23261 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23264 isl::set schedule_node_guard::guard() const
23266 if (!ptr)
23267 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23268 auto saved_ctx = ctx();
23269 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23270 auto res = isl_schedule_node_guard_get_guard(get());
23271 if (!res)
23272 exception::throw_last_error(saved_ctx);
23273 return manage(res);
23276 isl::set schedule_node_guard::get_guard() const
23278 return guard();
23281 inline std::ostream &operator<<(std::ostream &os, const schedule_node_guard &obj)
23283 if (!obj.get())
23284 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23285 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23286 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23287 char *str = isl_schedule_node_to_str(obj.get());
23288 if (!str)
23289 exception::throw_last_error(saved_ctx);
23290 os << str;
23291 free(str);
23292 return os;
23295 // implementations for isl::schedule_node_leaf
23296 schedule_node_leaf::schedule_node_leaf(__isl_take isl_schedule_node *ptr)
23297 : schedule_node(ptr) {}
23299 schedule_node_leaf::schedule_node_leaf()
23300 : schedule_node() {}
23302 schedule_node_leaf::schedule_node_leaf(const schedule_node_leaf &obj)
23303 : schedule_node(obj)
23307 schedule_node_leaf &schedule_node_leaf::operator=(schedule_node_leaf obj) {
23308 std::swap(this->ptr, obj.ptr);
23309 return *this;
23312 isl::ctx schedule_node_leaf::ctx() const {
23313 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23316 inline std::ostream &operator<<(std::ostream &os, const schedule_node_leaf &obj)
23318 if (!obj.get())
23319 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23320 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23321 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23322 char *str = isl_schedule_node_to_str(obj.get());
23323 if (!str)
23324 exception::throw_last_error(saved_ctx);
23325 os << str;
23326 free(str);
23327 return os;
23330 // implementations for isl::schedule_node_mark
23331 schedule_node_mark::schedule_node_mark(__isl_take isl_schedule_node *ptr)
23332 : schedule_node(ptr) {}
23334 schedule_node_mark::schedule_node_mark()
23335 : schedule_node() {}
23337 schedule_node_mark::schedule_node_mark(const schedule_node_mark &obj)
23338 : schedule_node(obj)
23342 schedule_node_mark &schedule_node_mark::operator=(schedule_node_mark obj) {
23343 std::swap(this->ptr, obj.ptr);
23344 return *this;
23347 isl::ctx schedule_node_mark::ctx() const {
23348 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23351 inline std::ostream &operator<<(std::ostream &os, const schedule_node_mark &obj)
23353 if (!obj.get())
23354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23355 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23356 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23357 char *str = isl_schedule_node_to_str(obj.get());
23358 if (!str)
23359 exception::throw_last_error(saved_ctx);
23360 os << str;
23361 free(str);
23362 return os;
23365 // implementations for isl::schedule_node_sequence
23366 schedule_node_sequence::schedule_node_sequence(__isl_take isl_schedule_node *ptr)
23367 : schedule_node(ptr) {}
23369 schedule_node_sequence::schedule_node_sequence()
23370 : schedule_node() {}
23372 schedule_node_sequence::schedule_node_sequence(const schedule_node_sequence &obj)
23373 : schedule_node(obj)
23377 schedule_node_sequence &schedule_node_sequence::operator=(schedule_node_sequence obj) {
23378 std::swap(this->ptr, obj.ptr);
23379 return *this;
23382 isl::ctx schedule_node_sequence::ctx() const {
23383 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23386 inline std::ostream &operator<<(std::ostream &os, const schedule_node_sequence &obj)
23388 if (!obj.get())
23389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23390 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23391 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23392 char *str = isl_schedule_node_to_str(obj.get());
23393 if (!str)
23394 exception::throw_last_error(saved_ctx);
23395 os << str;
23396 free(str);
23397 return os;
23400 // implementations for isl::schedule_node_set
23401 schedule_node_set::schedule_node_set(__isl_take isl_schedule_node *ptr)
23402 : schedule_node(ptr) {}
23404 schedule_node_set::schedule_node_set()
23405 : schedule_node() {}
23407 schedule_node_set::schedule_node_set(const schedule_node_set &obj)
23408 : schedule_node(obj)
23412 schedule_node_set &schedule_node_set::operator=(schedule_node_set obj) {
23413 std::swap(this->ptr, obj.ptr);
23414 return *this;
23417 isl::ctx schedule_node_set::ctx() const {
23418 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23421 inline std::ostream &operator<<(std::ostream &os, const schedule_node_set &obj)
23423 if (!obj.get())
23424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23425 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23426 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23427 char *str = isl_schedule_node_to_str(obj.get());
23428 if (!str)
23429 exception::throw_last_error(saved_ctx);
23430 os << str;
23431 free(str);
23432 return os;
23435 // implementations for isl::set
23436 set manage(__isl_take isl_set *ptr) {
23437 if (!ptr)
23438 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23439 return set(ptr);
23441 set manage_copy(__isl_keep isl_set *ptr) {
23442 if (!ptr)
23443 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23444 auto saved_ctx = isl_set_get_ctx(ptr);
23445 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23446 ptr = isl_set_copy(ptr);
23447 if (!ptr)
23448 exception::throw_last_error(saved_ctx);
23449 return set(ptr);
23452 set::set(__isl_take isl_set *ptr)
23453 : ptr(ptr) {}
23455 set::set()
23456 : ptr(nullptr) {}
23458 set::set(const set &obj)
23459 : ptr(nullptr)
23461 if (!obj.ptr)
23462 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23463 auto saved_ctx = isl_set_get_ctx(obj.ptr);
23464 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23465 ptr = obj.copy();
23466 if (!ptr)
23467 exception::throw_last_error(saved_ctx);
23470 set::set(isl::basic_set bset)
23472 if (bset.is_null())
23473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23474 auto saved_ctx = bset.ctx();
23475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23476 auto res = isl_set_from_basic_set(bset.release());
23477 if (!res)
23478 exception::throw_last_error(saved_ctx);
23479 ptr = res;
23482 set::set(isl::point pnt)
23484 if (pnt.is_null())
23485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23486 auto saved_ctx = pnt.ctx();
23487 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23488 auto res = isl_set_from_point(pnt.release());
23489 if (!res)
23490 exception::throw_last_error(saved_ctx);
23491 ptr = res;
23494 set::set(isl::ctx ctx, const std::string &str)
23496 auto saved_ctx = ctx;
23497 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23498 auto res = isl_set_read_from_str(ctx.release(), str.c_str());
23499 if (!res)
23500 exception::throw_last_error(saved_ctx);
23501 ptr = res;
23504 set &set::operator=(set obj) {
23505 std::swap(this->ptr, obj.ptr);
23506 return *this;
23509 set::~set() {
23510 if (ptr)
23511 isl_set_free(ptr);
23514 __isl_give isl_set *set::copy() const & {
23515 return isl_set_copy(ptr);
23518 __isl_keep isl_set *set::get() const {
23519 return ptr;
23522 __isl_give isl_set *set::release() {
23523 isl_set *tmp = ptr;
23524 ptr = nullptr;
23525 return tmp;
23528 bool set::is_null() const {
23529 return ptr == nullptr;
23532 isl::ctx set::ctx() const {
23533 return isl::ctx(isl_set_get_ctx(ptr));
23536 isl::basic_set set::affine_hull() const
23538 if (!ptr)
23539 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23540 auto saved_ctx = ctx();
23541 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23542 auto res = isl_set_affine_hull(copy());
23543 if (!res)
23544 exception::throw_last_error(saved_ctx);
23545 return manage(res);
23548 isl::set set::apply(isl::map map) const
23550 if (!ptr || map.is_null())
23551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23552 auto saved_ctx = ctx();
23553 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23554 auto res = isl_set_apply(copy(), map.release());
23555 if (!res)
23556 exception::throw_last_error(saved_ctx);
23557 return manage(res);
23560 isl::union_set set::apply(const isl::union_map &umap) const
23562 if (!ptr)
23563 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23564 return isl::union_set(*this).apply(umap);
23567 isl::set set::apply(const isl::basic_map &map) const
23569 if (!ptr)
23570 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23571 return this->apply(isl::map(map));
23574 isl::pw_multi_aff set::as_pw_multi_aff() const
23576 if (!ptr)
23577 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23578 auto saved_ctx = ctx();
23579 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23580 auto res = isl_set_as_pw_multi_aff(copy());
23581 if (!res)
23582 exception::throw_last_error(saved_ctx);
23583 return manage(res);
23586 isl::set set::as_set() const
23588 if (!ptr)
23589 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23590 return isl::union_set(*this).as_set();
23593 isl::set set::bind(isl::multi_id tuple) const
23595 if (!ptr || tuple.is_null())
23596 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23597 auto saved_ctx = ctx();
23598 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23599 auto res = isl_set_bind(copy(), tuple.release());
23600 if (!res)
23601 exception::throw_last_error(saved_ctx);
23602 return manage(res);
23605 isl::set set::coalesce() const
23607 if (!ptr)
23608 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23609 auto saved_ctx = ctx();
23610 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23611 auto res = isl_set_coalesce(copy());
23612 if (!res)
23613 exception::throw_last_error(saved_ctx);
23614 return manage(res);
23617 isl::set set::complement() const
23619 if (!ptr)
23620 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23621 auto saved_ctx = ctx();
23622 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23623 auto res = isl_set_complement(copy());
23624 if (!res)
23625 exception::throw_last_error(saved_ctx);
23626 return manage(res);
23629 isl::union_set set::compute_divs() const
23631 if (!ptr)
23632 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23633 return isl::union_set(*this).compute_divs();
23636 isl::set set::detect_equalities() const
23638 if (!ptr)
23639 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23640 auto saved_ctx = ctx();
23641 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23642 auto res = isl_set_detect_equalities(copy());
23643 if (!res)
23644 exception::throw_last_error(saved_ctx);
23645 return manage(res);
23648 isl::val set::dim_max_val(int pos) const
23650 if (!ptr)
23651 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23652 auto saved_ctx = ctx();
23653 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23654 auto res = isl_set_dim_max_val(copy(), pos);
23655 if (!res)
23656 exception::throw_last_error(saved_ctx);
23657 return manage(res);
23660 isl::val set::dim_min_val(int pos) const
23662 if (!ptr)
23663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23664 auto saved_ctx = ctx();
23665 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23666 auto res = isl_set_dim_min_val(copy(), pos);
23667 if (!res)
23668 exception::throw_last_error(saved_ctx);
23669 return manage(res);
23672 isl::set set::drop_unused_params() const
23674 if (!ptr)
23675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23676 auto saved_ctx = ctx();
23677 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23678 auto res = isl_set_drop_unused_params(copy());
23679 if (!res)
23680 exception::throw_last_error(saved_ctx);
23681 return manage(res);
23684 isl::set set::empty(isl::space space)
23686 if (space.is_null())
23687 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23688 auto saved_ctx = space.ctx();
23689 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23690 auto res = isl_set_empty(space.release());
23691 if (!res)
23692 exception::throw_last_error(saved_ctx);
23693 return manage(res);
23696 bool set::every_set(const std::function<bool(isl::set)> &test) const
23698 if (!ptr)
23699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23700 return isl::union_set(*this).every_set(test);
23703 isl::set set::extract_set(const isl::space &space) const
23705 if (!ptr)
23706 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23707 return isl::union_set(*this).extract_set(space);
23710 isl::set set::flatten() const
23712 if (!ptr)
23713 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23714 auto saved_ctx = ctx();
23715 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23716 auto res = isl_set_flatten(copy());
23717 if (!res)
23718 exception::throw_last_error(saved_ctx);
23719 return manage(res);
23722 void set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
23724 if (!ptr)
23725 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23726 auto saved_ctx = ctx();
23727 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23728 struct fn_data {
23729 std::function<void(isl::basic_set)> func;
23730 std::exception_ptr eptr;
23731 } fn_data = { fn };
23732 auto fn_lambda = [](isl_basic_set *arg_0, void *arg_1) -> isl_stat {
23733 auto *data = static_cast<struct fn_data *>(arg_1);
23734 ISL_CPP_TRY {
23735 (data->func)(manage(arg_0));
23736 return isl_stat_ok;
23737 } ISL_CPP_CATCH_ALL {
23738 data->eptr = std::current_exception();
23739 return isl_stat_error;
23742 auto res = isl_set_foreach_basic_set(get(), fn_lambda, &fn_data);
23743 if (fn_data.eptr)
23744 std::rethrow_exception(fn_data.eptr);
23745 if (res < 0)
23746 exception::throw_last_error(saved_ctx);
23747 return;
23750 void set::foreach_point(const std::function<void(isl::point)> &fn) const
23752 if (!ptr)
23753 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23754 auto saved_ctx = ctx();
23755 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23756 struct fn_data {
23757 std::function<void(isl::point)> func;
23758 std::exception_ptr eptr;
23759 } fn_data = { fn };
23760 auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
23761 auto *data = static_cast<struct fn_data *>(arg_1);
23762 ISL_CPP_TRY {
23763 (data->func)(manage(arg_0));
23764 return isl_stat_ok;
23765 } ISL_CPP_CATCH_ALL {
23766 data->eptr = std::current_exception();
23767 return isl_stat_error;
23770 auto res = isl_set_foreach_point(get(), fn_lambda, &fn_data);
23771 if (fn_data.eptr)
23772 std::rethrow_exception(fn_data.eptr);
23773 if (res < 0)
23774 exception::throw_last_error(saved_ctx);
23775 return;
23778 void set::foreach_set(const std::function<void(isl::set)> &fn) const
23780 if (!ptr)
23781 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23782 return isl::union_set(*this).foreach_set(fn);
23785 isl::set set::gist(isl::set context) const
23787 if (!ptr || context.is_null())
23788 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23789 auto saved_ctx = ctx();
23790 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23791 auto res = isl_set_gist(copy(), context.release());
23792 if (!res)
23793 exception::throw_last_error(saved_ctx);
23794 return manage(res);
23797 isl::union_set set::gist(const isl::union_set &context) const
23799 if (!ptr)
23800 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23801 return isl::union_set(*this).gist(context);
23804 isl::set set::gist(const isl::basic_set &context) const
23806 if (!ptr)
23807 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23808 return this->gist(isl::set(context));
23811 isl::set set::gist(const isl::point &context) const
23813 if (!ptr)
23814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23815 return this->gist(isl::set(context));
23818 isl::set set::gist_params(isl::set context) const
23820 if (!ptr || context.is_null())
23821 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23822 auto saved_ctx = ctx();
23823 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23824 auto res = isl_set_gist_params(copy(), context.release());
23825 if (!res)
23826 exception::throw_last_error(saved_ctx);
23827 return manage(res);
23830 isl::map set::identity() const
23832 if (!ptr)
23833 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23834 auto saved_ctx = ctx();
23835 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23836 auto res = isl_set_identity(copy());
23837 if (!res)
23838 exception::throw_last_error(saved_ctx);
23839 return manage(res);
23842 isl::pw_aff set::indicator_function() const
23844 if (!ptr)
23845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23846 auto saved_ctx = ctx();
23847 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23848 auto res = isl_set_indicator_function(copy());
23849 if (!res)
23850 exception::throw_last_error(saved_ctx);
23851 return manage(res);
23854 isl::map set::insert_domain(isl::space domain) const
23856 if (!ptr || domain.is_null())
23857 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23858 auto saved_ctx = ctx();
23859 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23860 auto res = isl_set_insert_domain(copy(), domain.release());
23861 if (!res)
23862 exception::throw_last_error(saved_ctx);
23863 return manage(res);
23866 isl::set set::intersect(isl::set set2) const
23868 if (!ptr || set2.is_null())
23869 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23870 auto saved_ctx = ctx();
23871 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23872 auto res = isl_set_intersect(copy(), set2.release());
23873 if (!res)
23874 exception::throw_last_error(saved_ctx);
23875 return manage(res);
23878 isl::union_set set::intersect(const isl::union_set &uset2) const
23880 if (!ptr)
23881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23882 return isl::union_set(*this).intersect(uset2);
23885 isl::set set::intersect(const isl::basic_set &set2) const
23887 if (!ptr)
23888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23889 return this->intersect(isl::set(set2));
23892 isl::set set::intersect(const isl::point &set2) const
23894 if (!ptr)
23895 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23896 return this->intersect(isl::set(set2));
23899 isl::set set::intersect_params(isl::set params) const
23901 if (!ptr || params.is_null())
23902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23903 auto saved_ctx = ctx();
23904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23905 auto res = isl_set_intersect_params(copy(), params.release());
23906 if (!res)
23907 exception::throw_last_error(saved_ctx);
23908 return manage(res);
23911 bool set::involves_locals() const
23913 if (!ptr)
23914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23915 auto saved_ctx = ctx();
23916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23917 auto res = isl_set_involves_locals(get());
23918 if (res < 0)
23919 exception::throw_last_error(saved_ctx);
23920 return res;
23923 bool set::is_disjoint(const isl::set &set2) const
23925 if (!ptr || set2.is_null())
23926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23927 auto saved_ctx = ctx();
23928 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23929 auto res = isl_set_is_disjoint(get(), set2.get());
23930 if (res < 0)
23931 exception::throw_last_error(saved_ctx);
23932 return res;
23935 bool set::is_disjoint(const isl::union_set &uset2) const
23937 if (!ptr)
23938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23939 return isl::union_set(*this).is_disjoint(uset2);
23942 bool set::is_disjoint(const isl::basic_set &set2) const
23944 if (!ptr)
23945 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23946 return this->is_disjoint(isl::set(set2));
23949 bool set::is_disjoint(const isl::point &set2) const
23951 if (!ptr)
23952 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23953 return this->is_disjoint(isl::set(set2));
23956 bool set::is_empty() const
23958 if (!ptr)
23959 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23960 auto saved_ctx = ctx();
23961 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23962 auto res = isl_set_is_empty(get());
23963 if (res < 0)
23964 exception::throw_last_error(saved_ctx);
23965 return res;
23968 bool set::is_equal(const isl::set &set2) const
23970 if (!ptr || set2.is_null())
23971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23972 auto saved_ctx = ctx();
23973 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23974 auto res = isl_set_is_equal(get(), set2.get());
23975 if (res < 0)
23976 exception::throw_last_error(saved_ctx);
23977 return res;
23980 bool set::is_equal(const isl::union_set &uset2) const
23982 if (!ptr)
23983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23984 return isl::union_set(*this).is_equal(uset2);
23987 bool set::is_equal(const isl::basic_set &set2) const
23989 if (!ptr)
23990 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23991 return this->is_equal(isl::set(set2));
23994 bool set::is_equal(const isl::point &set2) const
23996 if (!ptr)
23997 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23998 return this->is_equal(isl::set(set2));
24001 bool set::is_singleton() const
24003 if (!ptr)
24004 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24005 auto saved_ctx = ctx();
24006 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24007 auto res = isl_set_is_singleton(get());
24008 if (res < 0)
24009 exception::throw_last_error(saved_ctx);
24010 return res;
24013 bool set::is_strict_subset(const isl::set &set2) const
24015 if (!ptr || set2.is_null())
24016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24017 auto saved_ctx = ctx();
24018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24019 auto res = isl_set_is_strict_subset(get(), set2.get());
24020 if (res < 0)
24021 exception::throw_last_error(saved_ctx);
24022 return res;
24025 bool set::is_strict_subset(const isl::union_set &uset2) const
24027 if (!ptr)
24028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24029 return isl::union_set(*this).is_strict_subset(uset2);
24032 bool set::is_strict_subset(const isl::basic_set &set2) const
24034 if (!ptr)
24035 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24036 return this->is_strict_subset(isl::set(set2));
24039 bool set::is_strict_subset(const isl::point &set2) const
24041 if (!ptr)
24042 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24043 return this->is_strict_subset(isl::set(set2));
24046 bool set::is_subset(const isl::set &set2) const
24048 if (!ptr || set2.is_null())
24049 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24050 auto saved_ctx = ctx();
24051 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24052 auto res = isl_set_is_subset(get(), set2.get());
24053 if (res < 0)
24054 exception::throw_last_error(saved_ctx);
24055 return res;
24058 bool set::is_subset(const isl::union_set &uset2) const
24060 if (!ptr)
24061 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24062 return isl::union_set(*this).is_subset(uset2);
24065 bool set::is_subset(const isl::basic_set &set2) const
24067 if (!ptr)
24068 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24069 return this->is_subset(isl::set(set2));
24072 bool set::is_subset(const isl::point &set2) const
24074 if (!ptr)
24075 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24076 return this->is_subset(isl::set(set2));
24079 bool set::is_wrapping() const
24081 if (!ptr)
24082 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24083 auto saved_ctx = ctx();
24084 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24085 auto res = isl_set_is_wrapping(get());
24086 if (res < 0)
24087 exception::throw_last_error(saved_ctx);
24088 return res;
24091 bool set::isa_set() const
24093 if (!ptr)
24094 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24095 return isl::union_set(*this).isa_set();
24098 isl::fixed_box set::lattice_tile() const
24100 if (!ptr)
24101 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24102 auto saved_ctx = ctx();
24103 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24104 auto res = isl_set_get_lattice_tile(get());
24105 if (!res)
24106 exception::throw_last_error(saved_ctx);
24107 return manage(res);
24110 isl::fixed_box set::get_lattice_tile() const
24112 return lattice_tile();
24115 isl::set set::lexmax() const
24117 if (!ptr)
24118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24119 auto saved_ctx = ctx();
24120 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24121 auto res = isl_set_lexmax(copy());
24122 if (!res)
24123 exception::throw_last_error(saved_ctx);
24124 return manage(res);
24127 isl::pw_multi_aff set::lexmax_pw_multi_aff() const
24129 if (!ptr)
24130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24131 auto saved_ctx = ctx();
24132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24133 auto res = isl_set_lexmax_pw_multi_aff(copy());
24134 if (!res)
24135 exception::throw_last_error(saved_ctx);
24136 return manage(res);
24139 isl::set set::lexmin() const
24141 if (!ptr)
24142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24143 auto saved_ctx = ctx();
24144 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24145 auto res = isl_set_lexmin(copy());
24146 if (!res)
24147 exception::throw_last_error(saved_ctx);
24148 return manage(res);
24151 isl::pw_multi_aff set::lexmin_pw_multi_aff() const
24153 if (!ptr)
24154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24155 auto saved_ctx = ctx();
24156 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24157 auto res = isl_set_lexmin_pw_multi_aff(copy());
24158 if (!res)
24159 exception::throw_last_error(saved_ctx);
24160 return manage(res);
24163 isl::set set::lower_bound(isl::multi_pw_aff lower) const
24165 if (!ptr || lower.is_null())
24166 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24167 auto saved_ctx = ctx();
24168 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24169 auto res = isl_set_lower_bound_multi_pw_aff(copy(), lower.release());
24170 if (!res)
24171 exception::throw_last_error(saved_ctx);
24172 return manage(res);
24175 isl::set set::lower_bound(isl::multi_val lower) const
24177 if (!ptr || lower.is_null())
24178 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24179 auto saved_ctx = ctx();
24180 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24181 auto res = isl_set_lower_bound_multi_val(copy(), lower.release());
24182 if (!res)
24183 exception::throw_last_error(saved_ctx);
24184 return manage(res);
24187 isl::multi_pw_aff set::max_multi_pw_aff() const
24189 if (!ptr)
24190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24191 auto saved_ctx = ctx();
24192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24193 auto res = isl_set_max_multi_pw_aff(copy());
24194 if (!res)
24195 exception::throw_last_error(saved_ctx);
24196 return manage(res);
24199 isl::val set::max_val(const isl::aff &obj) const
24201 if (!ptr || obj.is_null())
24202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24203 auto saved_ctx = ctx();
24204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24205 auto res = isl_set_max_val(get(), obj.get());
24206 if (!res)
24207 exception::throw_last_error(saved_ctx);
24208 return manage(res);
24211 isl::multi_pw_aff set::min_multi_pw_aff() const
24213 if (!ptr)
24214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24215 auto saved_ctx = ctx();
24216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24217 auto res = isl_set_min_multi_pw_aff(copy());
24218 if (!res)
24219 exception::throw_last_error(saved_ctx);
24220 return manage(res);
24223 isl::val set::min_val(const isl::aff &obj) const
24225 if (!ptr || obj.is_null())
24226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24227 auto saved_ctx = ctx();
24228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24229 auto res = isl_set_min_val(get(), obj.get());
24230 if (!res)
24231 exception::throw_last_error(saved_ctx);
24232 return manage(res);
24235 unsigned set::n_basic_set() const
24237 if (!ptr)
24238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24239 auto saved_ctx = ctx();
24240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24241 auto res = isl_set_n_basic_set(get());
24242 if (res < 0)
24243 exception::throw_last_error(saved_ctx);
24244 return res;
24247 isl::pw_aff set::param_pw_aff_on_domain(isl::id id) const
24249 if (!ptr || id.is_null())
24250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24251 auto saved_ctx = ctx();
24252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24253 auto res = isl_set_param_pw_aff_on_domain_id(copy(), id.release());
24254 if (!res)
24255 exception::throw_last_error(saved_ctx);
24256 return manage(res);
24259 isl::pw_aff set::param_pw_aff_on_domain(const std::string &id) const
24261 if (!ptr)
24262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24263 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
24266 isl::set set::params() const
24268 if (!ptr)
24269 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24270 auto saved_ctx = ctx();
24271 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24272 auto res = isl_set_params(copy());
24273 if (!res)
24274 exception::throw_last_error(saved_ctx);
24275 return manage(res);
24278 isl::multi_val set::plain_multi_val_if_fixed() const
24280 if (!ptr)
24281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24282 auto saved_ctx = ctx();
24283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24284 auto res = isl_set_get_plain_multi_val_if_fixed(get());
24285 if (!res)
24286 exception::throw_last_error(saved_ctx);
24287 return manage(res);
24290 isl::multi_val set::get_plain_multi_val_if_fixed() const
24292 return plain_multi_val_if_fixed();
24295 isl::basic_set set::polyhedral_hull() const
24297 if (!ptr)
24298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24299 auto saved_ctx = ctx();
24300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24301 auto res = isl_set_polyhedral_hull(copy());
24302 if (!res)
24303 exception::throw_last_error(saved_ctx);
24304 return manage(res);
24307 isl::set set::preimage(isl::multi_aff ma) const
24309 if (!ptr || ma.is_null())
24310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24311 auto saved_ctx = ctx();
24312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24313 auto res = isl_set_preimage_multi_aff(copy(), ma.release());
24314 if (!res)
24315 exception::throw_last_error(saved_ctx);
24316 return manage(res);
24319 isl::set set::preimage(isl::multi_pw_aff mpa) const
24321 if (!ptr || mpa.is_null())
24322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24323 auto saved_ctx = ctx();
24324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24325 auto res = isl_set_preimage_multi_pw_aff(copy(), mpa.release());
24326 if (!res)
24327 exception::throw_last_error(saved_ctx);
24328 return manage(res);
24331 isl::set set::preimage(isl::pw_multi_aff pma) const
24333 if (!ptr || pma.is_null())
24334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24335 auto saved_ctx = ctx();
24336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24337 auto res = isl_set_preimage_pw_multi_aff(copy(), pma.release());
24338 if (!res)
24339 exception::throw_last_error(saved_ctx);
24340 return manage(res);
24343 isl::union_set set::preimage(const isl::union_pw_multi_aff &upma) const
24345 if (!ptr)
24346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24347 return isl::union_set(*this).preimage(upma);
24350 isl::set set::product(isl::set set2) const
24352 if (!ptr || set2.is_null())
24353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24354 auto saved_ctx = ctx();
24355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24356 auto res = isl_set_product(copy(), set2.release());
24357 if (!res)
24358 exception::throw_last_error(saved_ctx);
24359 return manage(res);
24362 isl::set set::project_out_all_params() const
24364 if (!ptr)
24365 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24366 auto saved_ctx = ctx();
24367 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24368 auto res = isl_set_project_out_all_params(copy());
24369 if (!res)
24370 exception::throw_last_error(saved_ctx);
24371 return manage(res);
24374 isl::set set::project_out_param(isl::id id) const
24376 if (!ptr || id.is_null())
24377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24378 auto saved_ctx = ctx();
24379 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24380 auto res = isl_set_project_out_param_id(copy(), id.release());
24381 if (!res)
24382 exception::throw_last_error(saved_ctx);
24383 return manage(res);
24386 isl::set set::project_out_param(const std::string &id) const
24388 if (!ptr)
24389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24390 return this->project_out_param(isl::id(ctx(), id));
24393 isl::set set::project_out_param(isl::id_list list) const
24395 if (!ptr || list.is_null())
24396 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24397 auto saved_ctx = ctx();
24398 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24399 auto res = isl_set_project_out_param_id_list(copy(), list.release());
24400 if (!res)
24401 exception::throw_last_error(saved_ctx);
24402 return manage(res);
24405 isl::pw_aff set::pw_aff_on_domain(isl::val v) const
24407 if (!ptr || v.is_null())
24408 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24409 auto saved_ctx = ctx();
24410 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24411 auto res = isl_set_pw_aff_on_domain_val(copy(), v.release());
24412 if (!res)
24413 exception::throw_last_error(saved_ctx);
24414 return manage(res);
24417 isl::pw_aff set::pw_aff_on_domain(long v) const
24419 if (!ptr)
24420 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24421 return this->pw_aff_on_domain(isl::val(ctx(), v));
24424 isl::pw_multi_aff set::pw_multi_aff_on_domain(isl::multi_val mv) const
24426 if (!ptr || mv.is_null())
24427 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24428 auto saved_ctx = ctx();
24429 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24430 auto res = isl_set_pw_multi_aff_on_domain_multi_val(copy(), mv.release());
24431 if (!res)
24432 exception::throw_last_error(saved_ctx);
24433 return manage(res);
24436 isl::basic_set set::sample() const
24438 if (!ptr)
24439 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24440 auto saved_ctx = ctx();
24441 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24442 auto res = isl_set_sample(copy());
24443 if (!res)
24444 exception::throw_last_error(saved_ctx);
24445 return manage(res);
24448 isl::point set::sample_point() const
24450 if (!ptr)
24451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24452 auto saved_ctx = ctx();
24453 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24454 auto res = isl_set_sample_point(copy());
24455 if (!res)
24456 exception::throw_last_error(saved_ctx);
24457 return manage(res);
24460 isl::set_list set::set_list() const
24462 if (!ptr)
24463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24464 return isl::union_set(*this).set_list();
24467 isl::fixed_box set::simple_fixed_box_hull() const
24469 if (!ptr)
24470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24471 auto saved_ctx = ctx();
24472 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24473 auto res = isl_set_get_simple_fixed_box_hull(get());
24474 if (!res)
24475 exception::throw_last_error(saved_ctx);
24476 return manage(res);
24479 isl::fixed_box set::get_simple_fixed_box_hull() const
24481 return simple_fixed_box_hull();
24484 isl::space set::space() const
24486 if (!ptr)
24487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24488 auto saved_ctx = ctx();
24489 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24490 auto res = isl_set_get_space(get());
24491 if (!res)
24492 exception::throw_last_error(saved_ctx);
24493 return manage(res);
24496 isl::space set::get_space() const
24498 return space();
24501 isl::val set::stride(int pos) const
24503 if (!ptr)
24504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24505 auto saved_ctx = ctx();
24506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24507 auto res = isl_set_get_stride(get(), pos);
24508 if (!res)
24509 exception::throw_last_error(saved_ctx);
24510 return manage(res);
24513 isl::val set::get_stride(int pos) const
24515 return stride(pos);
24518 isl::set set::subtract(isl::set set2) const
24520 if (!ptr || set2.is_null())
24521 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24522 auto saved_ctx = ctx();
24523 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24524 auto res = isl_set_subtract(copy(), set2.release());
24525 if (!res)
24526 exception::throw_last_error(saved_ctx);
24527 return manage(res);
24530 isl::union_set set::subtract(const isl::union_set &uset2) const
24532 if (!ptr)
24533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24534 return isl::union_set(*this).subtract(uset2);
24537 isl::set set::subtract(const isl::basic_set &set2) const
24539 if (!ptr)
24540 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24541 return this->subtract(isl::set(set2));
24544 isl::set set::subtract(const isl::point &set2) const
24546 if (!ptr)
24547 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24548 return this->subtract(isl::set(set2));
24551 isl::set_list set::to_list() const
24553 if (!ptr)
24554 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24555 auto saved_ctx = ctx();
24556 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24557 auto res = isl_set_to_list(copy());
24558 if (!res)
24559 exception::throw_last_error(saved_ctx);
24560 return manage(res);
24563 isl::union_set set::to_union_set() const
24565 if (!ptr)
24566 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24567 auto saved_ctx = ctx();
24568 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24569 auto res = isl_set_to_union_set(copy());
24570 if (!res)
24571 exception::throw_last_error(saved_ctx);
24572 return manage(res);
24575 isl::map set::translation() const
24577 if (!ptr)
24578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24579 auto saved_ctx = ctx();
24580 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24581 auto res = isl_set_translation(copy());
24582 if (!res)
24583 exception::throw_last_error(saved_ctx);
24584 return manage(res);
24587 unsigned set::tuple_dim() const
24589 if (!ptr)
24590 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24591 auto saved_ctx = ctx();
24592 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24593 auto res = isl_set_tuple_dim(get());
24594 if (res < 0)
24595 exception::throw_last_error(saved_ctx);
24596 return res;
24599 isl::set set::unbind_params(isl::multi_id tuple) const
24601 if (!ptr || tuple.is_null())
24602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24603 auto saved_ctx = ctx();
24604 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24605 auto res = isl_set_unbind_params(copy(), tuple.release());
24606 if (!res)
24607 exception::throw_last_error(saved_ctx);
24608 return manage(res);
24611 isl::map set::unbind_params_insert_domain(isl::multi_id domain) const
24613 if (!ptr || domain.is_null())
24614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24615 auto saved_ctx = ctx();
24616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24617 auto res = isl_set_unbind_params_insert_domain(copy(), domain.release());
24618 if (!res)
24619 exception::throw_last_error(saved_ctx);
24620 return manage(res);
24623 isl::set set::unite(isl::set set2) const
24625 if (!ptr || set2.is_null())
24626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24627 auto saved_ctx = ctx();
24628 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24629 auto res = isl_set_union(copy(), set2.release());
24630 if (!res)
24631 exception::throw_last_error(saved_ctx);
24632 return manage(res);
24635 isl::union_set set::unite(const isl::union_set &uset2) const
24637 if (!ptr)
24638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24639 return isl::union_set(*this).unite(uset2);
24642 isl::set set::unite(const isl::basic_set &set2) const
24644 if (!ptr)
24645 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24646 return this->unite(isl::set(set2));
24649 isl::set set::unite(const isl::point &set2) const
24651 if (!ptr)
24652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24653 return this->unite(isl::set(set2));
24656 isl::set set::universe(isl::space space)
24658 if (space.is_null())
24659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24660 auto saved_ctx = space.ctx();
24661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24662 auto res = isl_set_universe(space.release());
24663 if (!res)
24664 exception::throw_last_error(saved_ctx);
24665 return manage(res);
24668 isl::basic_set set::unshifted_simple_hull() const
24670 if (!ptr)
24671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24672 auto saved_ctx = ctx();
24673 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24674 auto res = isl_set_unshifted_simple_hull(copy());
24675 if (!res)
24676 exception::throw_last_error(saved_ctx);
24677 return manage(res);
24680 isl::map set::unwrap() const
24682 if (!ptr)
24683 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24684 auto saved_ctx = ctx();
24685 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24686 auto res = isl_set_unwrap(copy());
24687 if (!res)
24688 exception::throw_last_error(saved_ctx);
24689 return manage(res);
24692 isl::set set::upper_bound(isl::multi_pw_aff upper) const
24694 if (!ptr || upper.is_null())
24695 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24696 auto saved_ctx = ctx();
24697 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24698 auto res = isl_set_upper_bound_multi_pw_aff(copy(), upper.release());
24699 if (!res)
24700 exception::throw_last_error(saved_ctx);
24701 return manage(res);
24704 isl::set set::upper_bound(isl::multi_val upper) const
24706 if (!ptr || upper.is_null())
24707 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24708 auto saved_ctx = ctx();
24709 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24710 auto res = isl_set_upper_bound_multi_val(copy(), upper.release());
24711 if (!res)
24712 exception::throw_last_error(saved_ctx);
24713 return manage(res);
24716 isl::set set::wrapped_reverse() const
24718 if (!ptr)
24719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24720 auto saved_ctx = ctx();
24721 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24722 auto res = isl_set_wrapped_reverse(copy());
24723 if (!res)
24724 exception::throw_last_error(saved_ctx);
24725 return manage(res);
24728 inline std::ostream &operator<<(std::ostream &os, const set &obj)
24730 if (!obj.get())
24731 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24732 auto saved_ctx = isl_set_get_ctx(obj.get());
24733 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24734 char *str = isl_set_to_str(obj.get());
24735 if (!str)
24736 exception::throw_last_error(saved_ctx);
24737 os << str;
24738 free(str);
24739 return os;
24742 // implementations for isl::set_list
24743 set_list manage(__isl_take isl_set_list *ptr) {
24744 if (!ptr)
24745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24746 return set_list(ptr);
24748 set_list manage_copy(__isl_keep isl_set_list *ptr) {
24749 if (!ptr)
24750 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24751 auto saved_ctx = isl_set_list_get_ctx(ptr);
24752 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24753 ptr = isl_set_list_copy(ptr);
24754 if (!ptr)
24755 exception::throw_last_error(saved_ctx);
24756 return set_list(ptr);
24759 set_list::set_list(__isl_take isl_set_list *ptr)
24760 : ptr(ptr) {}
24762 set_list::set_list()
24763 : ptr(nullptr) {}
24765 set_list::set_list(const set_list &obj)
24766 : ptr(nullptr)
24768 if (!obj.ptr)
24769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24770 auto saved_ctx = isl_set_list_get_ctx(obj.ptr);
24771 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24772 ptr = obj.copy();
24773 if (!ptr)
24774 exception::throw_last_error(saved_ctx);
24777 set_list::set_list(isl::ctx ctx, int n)
24779 auto saved_ctx = ctx;
24780 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24781 auto res = isl_set_list_alloc(ctx.release(), n);
24782 if (!res)
24783 exception::throw_last_error(saved_ctx);
24784 ptr = res;
24787 set_list::set_list(isl::set el)
24789 if (el.is_null())
24790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24791 auto saved_ctx = el.ctx();
24792 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24793 auto res = isl_set_list_from_set(el.release());
24794 if (!res)
24795 exception::throw_last_error(saved_ctx);
24796 ptr = res;
24799 set_list::set_list(isl::ctx ctx, const std::string &str)
24801 auto saved_ctx = ctx;
24802 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24803 auto res = isl_set_list_read_from_str(ctx.release(), str.c_str());
24804 if (!res)
24805 exception::throw_last_error(saved_ctx);
24806 ptr = res;
24809 set_list &set_list::operator=(set_list obj) {
24810 std::swap(this->ptr, obj.ptr);
24811 return *this;
24814 set_list::~set_list() {
24815 if (ptr)
24816 isl_set_list_free(ptr);
24819 __isl_give isl_set_list *set_list::copy() const & {
24820 return isl_set_list_copy(ptr);
24823 __isl_keep isl_set_list *set_list::get() const {
24824 return ptr;
24827 __isl_give isl_set_list *set_list::release() {
24828 isl_set_list *tmp = ptr;
24829 ptr = nullptr;
24830 return tmp;
24833 bool set_list::is_null() const {
24834 return ptr == nullptr;
24837 isl::ctx set_list::ctx() const {
24838 return isl::ctx(isl_set_list_get_ctx(ptr));
24841 isl::set_list set_list::add(isl::set el) const
24843 if (!ptr || el.is_null())
24844 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24845 auto saved_ctx = ctx();
24846 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24847 auto res = isl_set_list_add(copy(), el.release());
24848 if (!res)
24849 exception::throw_last_error(saved_ctx);
24850 return manage(res);
24853 isl::set set_list::at(int index) const
24855 if (!ptr)
24856 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24857 auto saved_ctx = ctx();
24858 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24859 auto res = isl_set_list_get_at(get(), index);
24860 if (!res)
24861 exception::throw_last_error(saved_ctx);
24862 return manage(res);
24865 isl::set set_list::get_at(int index) const
24867 return at(index);
24870 isl::set_list set_list::clear() const
24872 if (!ptr)
24873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24874 auto saved_ctx = ctx();
24875 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24876 auto res = isl_set_list_clear(copy());
24877 if (!res)
24878 exception::throw_last_error(saved_ctx);
24879 return manage(res);
24882 isl::set_list set_list::concat(isl::set_list list2) const
24884 if (!ptr || list2.is_null())
24885 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24886 auto saved_ctx = ctx();
24887 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24888 auto res = isl_set_list_concat(copy(), list2.release());
24889 if (!res)
24890 exception::throw_last_error(saved_ctx);
24891 return manage(res);
24894 isl::set_list set_list::drop(unsigned int first, unsigned int n) const
24896 if (!ptr)
24897 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24898 auto saved_ctx = ctx();
24899 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24900 auto res = isl_set_list_drop(copy(), first, n);
24901 if (!res)
24902 exception::throw_last_error(saved_ctx);
24903 return manage(res);
24906 void set_list::foreach(const std::function<void(isl::set)> &fn) const
24908 if (!ptr)
24909 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24910 auto saved_ctx = ctx();
24911 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24912 struct fn_data {
24913 std::function<void(isl::set)> func;
24914 std::exception_ptr eptr;
24915 } fn_data = { fn };
24916 auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
24917 auto *data = static_cast<struct fn_data *>(arg_1);
24918 ISL_CPP_TRY {
24919 (data->func)(manage(arg_0));
24920 return isl_stat_ok;
24921 } ISL_CPP_CATCH_ALL {
24922 data->eptr = std::current_exception();
24923 return isl_stat_error;
24926 auto res = isl_set_list_foreach(get(), fn_lambda, &fn_data);
24927 if (fn_data.eptr)
24928 std::rethrow_exception(fn_data.eptr);
24929 if (res < 0)
24930 exception::throw_last_error(saved_ctx);
24931 return;
24934 void set_list::foreach_scc(const std::function<bool(isl::set, isl::set)> &follows, const std::function<void(isl::set_list)> &fn) const
24936 if (!ptr)
24937 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24938 auto saved_ctx = ctx();
24939 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24940 struct follows_data {
24941 std::function<bool(isl::set, isl::set)> func;
24942 std::exception_ptr eptr;
24943 } follows_data = { follows };
24944 auto follows_lambda = [](isl_set *arg_0, isl_set *arg_1, void *arg_2) -> isl_bool {
24945 auto *data = static_cast<struct follows_data *>(arg_2);
24946 ISL_CPP_TRY {
24947 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
24948 return ret ? isl_bool_true : isl_bool_false;
24949 } ISL_CPP_CATCH_ALL {
24950 data->eptr = std::current_exception();
24951 return isl_bool_error;
24954 struct fn_data {
24955 std::function<void(isl::set_list)> func;
24956 std::exception_ptr eptr;
24957 } fn_data = { fn };
24958 auto fn_lambda = [](isl_set_list *arg_0, void *arg_1) -> isl_stat {
24959 auto *data = static_cast<struct fn_data *>(arg_1);
24960 ISL_CPP_TRY {
24961 (data->func)(manage(arg_0));
24962 return isl_stat_ok;
24963 } ISL_CPP_CATCH_ALL {
24964 data->eptr = std::current_exception();
24965 return isl_stat_error;
24968 auto res = isl_set_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
24969 if (follows_data.eptr)
24970 std::rethrow_exception(follows_data.eptr);
24971 if (fn_data.eptr)
24972 std::rethrow_exception(fn_data.eptr);
24973 if (res < 0)
24974 exception::throw_last_error(saved_ctx);
24975 return;
24978 isl::set_list set_list::insert(unsigned int pos, isl::set el) const
24980 if (!ptr || el.is_null())
24981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24982 auto saved_ctx = ctx();
24983 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24984 auto res = isl_set_list_insert(copy(), pos, el.release());
24985 if (!res)
24986 exception::throw_last_error(saved_ctx);
24987 return manage(res);
24990 isl::set_list set_list::set_at(int index, isl::set el) const
24992 if (!ptr || el.is_null())
24993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24994 auto saved_ctx = ctx();
24995 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24996 auto res = isl_set_list_set_at(copy(), index, el.release());
24997 if (!res)
24998 exception::throw_last_error(saved_ctx);
24999 return manage(res);
25002 unsigned set_list::size() const
25004 if (!ptr)
25005 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25006 auto saved_ctx = ctx();
25007 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25008 auto res = isl_set_list_size(get());
25009 if (res < 0)
25010 exception::throw_last_error(saved_ctx);
25011 return res;
25014 inline std::ostream &operator<<(std::ostream &os, const set_list &obj)
25016 if (!obj.get())
25017 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25018 auto saved_ctx = isl_set_list_get_ctx(obj.get());
25019 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25020 char *str = isl_set_list_to_str(obj.get());
25021 if (!str)
25022 exception::throw_last_error(saved_ctx);
25023 os << str;
25024 free(str);
25025 return os;
25028 // implementations for isl::space
25029 space manage(__isl_take isl_space *ptr) {
25030 if (!ptr)
25031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25032 return space(ptr);
25034 space manage_copy(__isl_keep isl_space *ptr) {
25035 if (!ptr)
25036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25037 auto saved_ctx = isl_space_get_ctx(ptr);
25038 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25039 ptr = isl_space_copy(ptr);
25040 if (!ptr)
25041 exception::throw_last_error(saved_ctx);
25042 return space(ptr);
25045 space::space(__isl_take isl_space *ptr)
25046 : ptr(ptr) {}
25048 space::space()
25049 : ptr(nullptr) {}
25051 space::space(const space &obj)
25052 : ptr(nullptr)
25054 if (!obj.ptr)
25055 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25056 auto saved_ctx = isl_space_get_ctx(obj.ptr);
25057 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25058 ptr = obj.copy();
25059 if (!ptr)
25060 exception::throw_last_error(saved_ctx);
25063 space::space(isl::ctx ctx, const std::string &str)
25065 auto saved_ctx = ctx;
25066 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25067 auto res = isl_space_read_from_str(ctx.release(), str.c_str());
25068 if (!res)
25069 exception::throw_last_error(saved_ctx);
25070 ptr = res;
25073 space &space::operator=(space obj) {
25074 std::swap(this->ptr, obj.ptr);
25075 return *this;
25078 space::~space() {
25079 if (ptr)
25080 isl_space_free(ptr);
25083 __isl_give isl_space *space::copy() const & {
25084 return isl_space_copy(ptr);
25087 __isl_keep isl_space *space::get() const {
25088 return ptr;
25091 __isl_give isl_space *space::release() {
25092 isl_space *tmp = ptr;
25093 ptr = nullptr;
25094 return tmp;
25097 bool space::is_null() const {
25098 return ptr == nullptr;
25101 isl::ctx space::ctx() const {
25102 return isl::ctx(isl_space_get_ctx(ptr));
25105 isl::space space::add_named_tuple(isl::id tuple_id, unsigned int dim) const
25107 if (!ptr || tuple_id.is_null())
25108 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25109 auto saved_ctx = ctx();
25110 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25111 auto res = isl_space_add_named_tuple_id_ui(copy(), tuple_id.release(), dim);
25112 if (!res)
25113 exception::throw_last_error(saved_ctx);
25114 return manage(res);
25117 isl::space space::add_named_tuple(const std::string &tuple_id, unsigned int dim) const
25119 if (!ptr)
25120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25121 return this->add_named_tuple(isl::id(ctx(), tuple_id), dim);
25124 isl::space space::add_param(isl::id id) const
25126 if (!ptr || id.is_null())
25127 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25128 auto saved_ctx = ctx();
25129 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25130 auto res = isl_space_add_param_id(copy(), id.release());
25131 if (!res)
25132 exception::throw_last_error(saved_ctx);
25133 return manage(res);
25136 isl::space space::add_param(const std::string &id) const
25138 if (!ptr)
25139 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25140 return this->add_param(isl::id(ctx(), id));
25143 isl::space space::add_unnamed_tuple(unsigned int dim) const
25145 if (!ptr)
25146 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25147 auto saved_ctx = ctx();
25148 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25149 auto res = isl_space_add_unnamed_tuple_ui(copy(), dim);
25150 if (!res)
25151 exception::throw_last_error(saved_ctx);
25152 return manage(res);
25155 isl::space space::curry() const
25157 if (!ptr)
25158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25159 auto saved_ctx = ctx();
25160 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25161 auto res = isl_space_curry(copy());
25162 if (!res)
25163 exception::throw_last_error(saved_ctx);
25164 return manage(res);
25167 isl::space space::domain() const
25169 if (!ptr)
25170 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25171 auto saved_ctx = ctx();
25172 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25173 auto res = isl_space_domain(copy());
25174 if (!res)
25175 exception::throw_last_error(saved_ctx);
25176 return manage(res);
25179 isl::multi_aff space::domain_map_multi_aff() const
25181 if (!ptr)
25182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25183 auto saved_ctx = ctx();
25184 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25185 auto res = isl_space_domain_map_multi_aff(copy());
25186 if (!res)
25187 exception::throw_last_error(saved_ctx);
25188 return manage(res);
25191 isl::pw_multi_aff space::domain_map_pw_multi_aff() const
25193 if (!ptr)
25194 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25195 auto saved_ctx = ctx();
25196 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25197 auto res = isl_space_domain_map_pw_multi_aff(copy());
25198 if (!res)
25199 exception::throw_last_error(saved_ctx);
25200 return manage(res);
25203 isl::space space::domain_reverse() const
25205 if (!ptr)
25206 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25207 auto saved_ctx = ctx();
25208 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25209 auto res = isl_space_domain_reverse(copy());
25210 if (!res)
25211 exception::throw_last_error(saved_ctx);
25212 return manage(res);
25215 isl::id space::domain_tuple_id() const
25217 if (!ptr)
25218 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25219 auto saved_ctx = ctx();
25220 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25221 auto res = isl_space_get_domain_tuple_id(get());
25222 if (!res)
25223 exception::throw_last_error(saved_ctx);
25224 return manage(res);
25227 isl::id space::get_domain_tuple_id() const
25229 return domain_tuple_id();
25232 isl::space space::drop_all_params() const
25234 if (!ptr)
25235 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25236 auto saved_ctx = ctx();
25237 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25238 auto res = isl_space_drop_all_params(copy());
25239 if (!res)
25240 exception::throw_last_error(saved_ctx);
25241 return manage(res);
25244 isl::space space::flatten_domain() const
25246 if (!ptr)
25247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25248 auto saved_ctx = ctx();
25249 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25250 auto res = isl_space_flatten_domain(copy());
25251 if (!res)
25252 exception::throw_last_error(saved_ctx);
25253 return manage(res);
25256 isl::space space::flatten_range() const
25258 if (!ptr)
25259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25260 auto saved_ctx = ctx();
25261 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25262 auto res = isl_space_flatten_range(copy());
25263 if (!res)
25264 exception::throw_last_error(saved_ctx);
25265 return manage(res);
25268 bool space::has_domain_tuple_id() const
25270 if (!ptr)
25271 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25272 auto saved_ctx = ctx();
25273 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25274 auto res = isl_space_has_domain_tuple_id(get());
25275 if (res < 0)
25276 exception::throw_last_error(saved_ctx);
25277 return res;
25280 bool space::has_range_tuple_id() const
25282 if (!ptr)
25283 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25284 auto saved_ctx = ctx();
25285 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25286 auto res = isl_space_has_range_tuple_id(get());
25287 if (res < 0)
25288 exception::throw_last_error(saved_ctx);
25289 return res;
25292 isl::multi_aff space::identity_multi_aff_on_domain() const
25294 if (!ptr)
25295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25296 auto saved_ctx = ctx();
25297 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25298 auto res = isl_space_identity_multi_aff_on_domain(copy());
25299 if (!res)
25300 exception::throw_last_error(saved_ctx);
25301 return manage(res);
25304 isl::multi_pw_aff space::identity_multi_pw_aff_on_domain() const
25306 if (!ptr)
25307 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25308 auto saved_ctx = ctx();
25309 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25310 auto res = isl_space_identity_multi_pw_aff_on_domain(copy());
25311 if (!res)
25312 exception::throw_last_error(saved_ctx);
25313 return manage(res);
25316 isl::pw_multi_aff space::identity_pw_multi_aff_on_domain() const
25318 if (!ptr)
25319 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25320 auto saved_ctx = ctx();
25321 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25322 auto res = isl_space_identity_pw_multi_aff_on_domain(copy());
25323 if (!res)
25324 exception::throw_last_error(saved_ctx);
25325 return manage(res);
25328 bool space::is_equal(const isl::space &space2) const
25330 if (!ptr || space2.is_null())
25331 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25332 auto saved_ctx = ctx();
25333 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25334 auto res = isl_space_is_equal(get(), space2.get());
25335 if (res < 0)
25336 exception::throw_last_error(saved_ctx);
25337 return res;
25340 bool space::is_wrapping() const
25342 if (!ptr)
25343 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25344 auto saved_ctx = ctx();
25345 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25346 auto res = isl_space_is_wrapping(get());
25347 if (res < 0)
25348 exception::throw_last_error(saved_ctx);
25349 return res;
25352 isl::space space::map_from_set() const
25354 if (!ptr)
25355 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25356 auto saved_ctx = ctx();
25357 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25358 auto res = isl_space_map_from_set(copy());
25359 if (!res)
25360 exception::throw_last_error(saved_ctx);
25361 return manage(res);
25364 isl::multi_aff space::multi_aff(isl::aff_list list) const
25366 if (!ptr || list.is_null())
25367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25368 auto saved_ctx = ctx();
25369 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25370 auto res = isl_space_multi_aff(copy(), list.release());
25371 if (!res)
25372 exception::throw_last_error(saved_ctx);
25373 return manage(res);
25376 isl::multi_aff space::multi_aff_on_domain(isl::multi_val mv) const
25378 if (!ptr || mv.is_null())
25379 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25380 auto saved_ctx = ctx();
25381 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25382 auto res = isl_space_multi_aff_on_domain_multi_val(copy(), mv.release());
25383 if (!res)
25384 exception::throw_last_error(saved_ctx);
25385 return manage(res);
25388 isl::multi_id space::multi_id(isl::id_list list) const
25390 if (!ptr || list.is_null())
25391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25392 auto saved_ctx = ctx();
25393 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25394 auto res = isl_space_multi_id(copy(), list.release());
25395 if (!res)
25396 exception::throw_last_error(saved_ctx);
25397 return manage(res);
25400 isl::multi_pw_aff space::multi_pw_aff(isl::pw_aff_list list) const
25402 if (!ptr || list.is_null())
25403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25404 auto saved_ctx = ctx();
25405 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25406 auto res = isl_space_multi_pw_aff(copy(), list.release());
25407 if (!res)
25408 exception::throw_last_error(saved_ctx);
25409 return manage(res);
25412 isl::multi_union_pw_aff space::multi_union_pw_aff(isl::union_pw_aff_list list) const
25414 if (!ptr || list.is_null())
25415 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25416 auto saved_ctx = ctx();
25417 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25418 auto res = isl_space_multi_union_pw_aff(copy(), list.release());
25419 if (!res)
25420 exception::throw_last_error(saved_ctx);
25421 return manage(res);
25424 isl::multi_val space::multi_val(isl::val_list list) const
25426 if (!ptr || list.is_null())
25427 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25428 auto saved_ctx = ctx();
25429 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25430 auto res = isl_space_multi_val(copy(), list.release());
25431 if (!res)
25432 exception::throw_last_error(saved_ctx);
25433 return manage(res);
25436 isl::aff space::param_aff_on_domain(isl::id id) const
25438 if (!ptr || id.is_null())
25439 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25440 auto saved_ctx = ctx();
25441 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25442 auto res = isl_space_param_aff_on_domain_id(copy(), id.release());
25443 if (!res)
25444 exception::throw_last_error(saved_ctx);
25445 return manage(res);
25448 isl::aff space::param_aff_on_domain(const std::string &id) const
25450 if (!ptr)
25451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25452 return this->param_aff_on_domain(isl::id(ctx(), id));
25455 isl::space space::params() const
25457 if (!ptr)
25458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25459 auto saved_ctx = ctx();
25460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25461 auto res = isl_space_params(copy());
25462 if (!res)
25463 exception::throw_last_error(saved_ctx);
25464 return manage(res);
25467 isl::space space::product(isl::space right) const
25469 if (!ptr || right.is_null())
25470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25471 auto saved_ctx = ctx();
25472 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25473 auto res = isl_space_product(copy(), right.release());
25474 if (!res)
25475 exception::throw_last_error(saved_ctx);
25476 return manage(res);
25479 isl::space space::range() const
25481 if (!ptr)
25482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25483 auto saved_ctx = ctx();
25484 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25485 auto res = isl_space_range(copy());
25486 if (!res)
25487 exception::throw_last_error(saved_ctx);
25488 return manage(res);
25491 isl::multi_aff space::range_map_multi_aff() const
25493 if (!ptr)
25494 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25495 auto saved_ctx = ctx();
25496 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25497 auto res = isl_space_range_map_multi_aff(copy());
25498 if (!res)
25499 exception::throw_last_error(saved_ctx);
25500 return manage(res);
25503 isl::pw_multi_aff space::range_map_pw_multi_aff() const
25505 if (!ptr)
25506 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25507 auto saved_ctx = ctx();
25508 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25509 auto res = isl_space_range_map_pw_multi_aff(copy());
25510 if (!res)
25511 exception::throw_last_error(saved_ctx);
25512 return manage(res);
25515 isl::space space::range_reverse() const
25517 if (!ptr)
25518 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25519 auto saved_ctx = ctx();
25520 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25521 auto res = isl_space_range_reverse(copy());
25522 if (!res)
25523 exception::throw_last_error(saved_ctx);
25524 return manage(res);
25527 isl::id space::range_tuple_id() const
25529 if (!ptr)
25530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25531 auto saved_ctx = ctx();
25532 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25533 auto res = isl_space_get_range_tuple_id(get());
25534 if (!res)
25535 exception::throw_last_error(saved_ctx);
25536 return manage(res);
25539 isl::id space::get_range_tuple_id() const
25541 return range_tuple_id();
25544 isl::space space::reverse() const
25546 if (!ptr)
25547 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25548 auto saved_ctx = ctx();
25549 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25550 auto res = isl_space_reverse(copy());
25551 if (!res)
25552 exception::throw_last_error(saved_ctx);
25553 return manage(res);
25556 isl::space space::set_domain_tuple(isl::id id) const
25558 if (!ptr || id.is_null())
25559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25560 auto saved_ctx = ctx();
25561 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25562 auto res = isl_space_set_domain_tuple_id(copy(), id.release());
25563 if (!res)
25564 exception::throw_last_error(saved_ctx);
25565 return manage(res);
25568 isl::space space::set_domain_tuple(const std::string &id) const
25570 if (!ptr)
25571 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25572 return this->set_domain_tuple(isl::id(ctx(), id));
25575 isl::space space::set_range_tuple(isl::id id) const
25577 if (!ptr || id.is_null())
25578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25579 auto saved_ctx = ctx();
25580 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25581 auto res = isl_space_set_range_tuple_id(copy(), id.release());
25582 if (!res)
25583 exception::throw_last_error(saved_ctx);
25584 return manage(res);
25587 isl::space space::set_range_tuple(const std::string &id) const
25589 if (!ptr)
25590 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25591 return this->set_range_tuple(isl::id(ctx(), id));
25594 isl::space space::uncurry() const
25596 if (!ptr)
25597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25598 auto saved_ctx = ctx();
25599 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25600 auto res = isl_space_uncurry(copy());
25601 if (!res)
25602 exception::throw_last_error(saved_ctx);
25603 return manage(res);
25606 isl::space space::unit(isl::ctx ctx)
25608 auto saved_ctx = ctx;
25609 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25610 auto res = isl_space_unit(ctx.release());
25611 if (!res)
25612 exception::throw_last_error(saved_ctx);
25613 return manage(res);
25616 isl::map space::universe_map() const
25618 if (!ptr)
25619 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25620 auto saved_ctx = ctx();
25621 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25622 auto res = isl_space_universe_map(copy());
25623 if (!res)
25624 exception::throw_last_error(saved_ctx);
25625 return manage(res);
25628 isl::set space::universe_set() const
25630 if (!ptr)
25631 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25632 auto saved_ctx = ctx();
25633 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25634 auto res = isl_space_universe_set(copy());
25635 if (!res)
25636 exception::throw_last_error(saved_ctx);
25637 return manage(res);
25640 isl::space space::unwrap() const
25642 if (!ptr)
25643 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25644 auto saved_ctx = ctx();
25645 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25646 auto res = isl_space_unwrap(copy());
25647 if (!res)
25648 exception::throw_last_error(saved_ctx);
25649 return manage(res);
25652 isl::space space::wrap() const
25654 if (!ptr)
25655 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25656 auto saved_ctx = ctx();
25657 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25658 auto res = isl_space_wrap(copy());
25659 if (!res)
25660 exception::throw_last_error(saved_ctx);
25661 return manage(res);
25664 isl::space space::wrapped_reverse() const
25666 if (!ptr)
25667 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25668 auto saved_ctx = ctx();
25669 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25670 auto res = isl_space_wrapped_reverse(copy());
25671 if (!res)
25672 exception::throw_last_error(saved_ctx);
25673 return manage(res);
25676 isl::aff space::zero_aff_on_domain() const
25678 if (!ptr)
25679 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25680 auto saved_ctx = ctx();
25681 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25682 auto res = isl_space_zero_aff_on_domain(copy());
25683 if (!res)
25684 exception::throw_last_error(saved_ctx);
25685 return manage(res);
25688 isl::multi_aff space::zero_multi_aff() const
25690 if (!ptr)
25691 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25692 auto saved_ctx = ctx();
25693 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25694 auto res = isl_space_zero_multi_aff(copy());
25695 if (!res)
25696 exception::throw_last_error(saved_ctx);
25697 return manage(res);
25700 isl::multi_pw_aff space::zero_multi_pw_aff() const
25702 if (!ptr)
25703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25704 auto saved_ctx = ctx();
25705 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25706 auto res = isl_space_zero_multi_pw_aff(copy());
25707 if (!res)
25708 exception::throw_last_error(saved_ctx);
25709 return manage(res);
25712 isl::multi_union_pw_aff space::zero_multi_union_pw_aff() const
25714 if (!ptr)
25715 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25716 auto saved_ctx = ctx();
25717 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25718 auto res = isl_space_zero_multi_union_pw_aff(copy());
25719 if (!res)
25720 exception::throw_last_error(saved_ctx);
25721 return manage(res);
25724 isl::multi_val space::zero_multi_val() const
25726 if (!ptr)
25727 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25728 auto saved_ctx = ctx();
25729 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25730 auto res = isl_space_zero_multi_val(copy());
25731 if (!res)
25732 exception::throw_last_error(saved_ctx);
25733 return manage(res);
25736 inline std::ostream &operator<<(std::ostream &os, const space &obj)
25738 if (!obj.get())
25739 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25740 auto saved_ctx = isl_space_get_ctx(obj.get());
25741 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25742 char *str = isl_space_to_str(obj.get());
25743 if (!str)
25744 exception::throw_last_error(saved_ctx);
25745 os << str;
25746 free(str);
25747 return os;
25750 // implementations for isl::union_access_info
25751 union_access_info manage(__isl_take isl_union_access_info *ptr) {
25752 if (!ptr)
25753 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25754 return union_access_info(ptr);
25756 union_access_info manage_copy(__isl_keep isl_union_access_info *ptr) {
25757 if (!ptr)
25758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25759 auto saved_ctx = isl_union_access_info_get_ctx(ptr);
25760 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25761 ptr = isl_union_access_info_copy(ptr);
25762 if (!ptr)
25763 exception::throw_last_error(saved_ctx);
25764 return union_access_info(ptr);
25767 union_access_info::union_access_info(__isl_take isl_union_access_info *ptr)
25768 : ptr(ptr) {}
25770 union_access_info::union_access_info()
25771 : ptr(nullptr) {}
25773 union_access_info::union_access_info(const union_access_info &obj)
25774 : ptr(nullptr)
25776 if (!obj.ptr)
25777 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25778 auto saved_ctx = isl_union_access_info_get_ctx(obj.ptr);
25779 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25780 ptr = obj.copy();
25781 if (!ptr)
25782 exception::throw_last_error(saved_ctx);
25785 union_access_info::union_access_info(isl::union_map sink)
25787 if (sink.is_null())
25788 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25789 auto saved_ctx = sink.ctx();
25790 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25791 auto res = isl_union_access_info_from_sink(sink.release());
25792 if (!res)
25793 exception::throw_last_error(saved_ctx);
25794 ptr = res;
25797 union_access_info &union_access_info::operator=(union_access_info obj) {
25798 std::swap(this->ptr, obj.ptr);
25799 return *this;
25802 union_access_info::~union_access_info() {
25803 if (ptr)
25804 isl_union_access_info_free(ptr);
25807 __isl_give isl_union_access_info *union_access_info::copy() const & {
25808 return isl_union_access_info_copy(ptr);
25811 __isl_keep isl_union_access_info *union_access_info::get() const {
25812 return ptr;
25815 __isl_give isl_union_access_info *union_access_info::release() {
25816 isl_union_access_info *tmp = ptr;
25817 ptr = nullptr;
25818 return tmp;
25821 bool union_access_info::is_null() const {
25822 return ptr == nullptr;
25825 isl::ctx union_access_info::ctx() const {
25826 return isl::ctx(isl_union_access_info_get_ctx(ptr));
25829 isl::union_flow union_access_info::compute_flow() const
25831 if (!ptr)
25832 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25833 auto saved_ctx = ctx();
25834 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25835 auto res = isl_union_access_info_compute_flow(copy());
25836 if (!res)
25837 exception::throw_last_error(saved_ctx);
25838 return manage(res);
25841 isl::union_access_info union_access_info::set_kill(isl::union_map kill) const
25843 if (!ptr || kill.is_null())
25844 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25845 auto saved_ctx = ctx();
25846 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25847 auto res = isl_union_access_info_set_kill(copy(), kill.release());
25848 if (!res)
25849 exception::throw_last_error(saved_ctx);
25850 return manage(res);
25853 isl::union_access_info union_access_info::set_may_source(isl::union_map may_source) const
25855 if (!ptr || may_source.is_null())
25856 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25857 auto saved_ctx = ctx();
25858 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25859 auto res = isl_union_access_info_set_may_source(copy(), may_source.release());
25860 if (!res)
25861 exception::throw_last_error(saved_ctx);
25862 return manage(res);
25865 isl::union_access_info union_access_info::set_must_source(isl::union_map must_source) const
25867 if (!ptr || must_source.is_null())
25868 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25869 auto saved_ctx = ctx();
25870 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25871 auto res = isl_union_access_info_set_must_source(copy(), must_source.release());
25872 if (!res)
25873 exception::throw_last_error(saved_ctx);
25874 return manage(res);
25877 isl::union_access_info union_access_info::set_schedule(isl::schedule schedule) const
25879 if (!ptr || schedule.is_null())
25880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25881 auto saved_ctx = ctx();
25882 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25883 auto res = isl_union_access_info_set_schedule(copy(), schedule.release());
25884 if (!res)
25885 exception::throw_last_error(saved_ctx);
25886 return manage(res);
25889 isl::union_access_info union_access_info::set_schedule_map(isl::union_map schedule_map) const
25891 if (!ptr || schedule_map.is_null())
25892 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25893 auto saved_ctx = ctx();
25894 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25895 auto res = isl_union_access_info_set_schedule_map(copy(), schedule_map.release());
25896 if (!res)
25897 exception::throw_last_error(saved_ctx);
25898 return manage(res);
25901 inline std::ostream &operator<<(std::ostream &os, const union_access_info &obj)
25903 if (!obj.get())
25904 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25905 auto saved_ctx = isl_union_access_info_get_ctx(obj.get());
25906 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25907 char *str = isl_union_access_info_to_str(obj.get());
25908 if (!str)
25909 exception::throw_last_error(saved_ctx);
25910 os << str;
25911 free(str);
25912 return os;
25915 // implementations for isl::union_flow
25916 union_flow manage(__isl_take isl_union_flow *ptr) {
25917 if (!ptr)
25918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25919 return union_flow(ptr);
25921 union_flow manage_copy(__isl_keep isl_union_flow *ptr) {
25922 if (!ptr)
25923 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25924 auto saved_ctx = isl_union_flow_get_ctx(ptr);
25925 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25926 ptr = isl_union_flow_copy(ptr);
25927 if (!ptr)
25928 exception::throw_last_error(saved_ctx);
25929 return union_flow(ptr);
25932 union_flow::union_flow(__isl_take isl_union_flow *ptr)
25933 : ptr(ptr) {}
25935 union_flow::union_flow()
25936 : ptr(nullptr) {}
25938 union_flow::union_flow(const union_flow &obj)
25939 : ptr(nullptr)
25941 if (!obj.ptr)
25942 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25943 auto saved_ctx = isl_union_flow_get_ctx(obj.ptr);
25944 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25945 ptr = obj.copy();
25946 if (!ptr)
25947 exception::throw_last_error(saved_ctx);
25950 union_flow &union_flow::operator=(union_flow obj) {
25951 std::swap(this->ptr, obj.ptr);
25952 return *this;
25955 union_flow::~union_flow() {
25956 if (ptr)
25957 isl_union_flow_free(ptr);
25960 __isl_give isl_union_flow *union_flow::copy() const & {
25961 return isl_union_flow_copy(ptr);
25964 __isl_keep isl_union_flow *union_flow::get() const {
25965 return ptr;
25968 __isl_give isl_union_flow *union_flow::release() {
25969 isl_union_flow *tmp = ptr;
25970 ptr = nullptr;
25971 return tmp;
25974 bool union_flow::is_null() const {
25975 return ptr == nullptr;
25978 isl::ctx union_flow::ctx() const {
25979 return isl::ctx(isl_union_flow_get_ctx(ptr));
25982 isl::union_map union_flow::full_may_dependence() const
25984 if (!ptr)
25985 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25986 auto saved_ctx = ctx();
25987 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25988 auto res = isl_union_flow_get_full_may_dependence(get());
25989 if (!res)
25990 exception::throw_last_error(saved_ctx);
25991 return manage(res);
25994 isl::union_map union_flow::get_full_may_dependence() const
25996 return full_may_dependence();
25999 isl::union_map union_flow::full_must_dependence() const
26001 if (!ptr)
26002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26003 auto saved_ctx = ctx();
26004 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26005 auto res = isl_union_flow_get_full_must_dependence(get());
26006 if (!res)
26007 exception::throw_last_error(saved_ctx);
26008 return manage(res);
26011 isl::union_map union_flow::get_full_must_dependence() const
26013 return full_must_dependence();
26016 isl::union_map union_flow::may_dependence() const
26018 if (!ptr)
26019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26020 auto saved_ctx = ctx();
26021 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26022 auto res = isl_union_flow_get_may_dependence(get());
26023 if (!res)
26024 exception::throw_last_error(saved_ctx);
26025 return manage(res);
26028 isl::union_map union_flow::get_may_dependence() const
26030 return may_dependence();
26033 isl::union_map union_flow::may_no_source() const
26035 if (!ptr)
26036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26037 auto saved_ctx = ctx();
26038 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26039 auto res = isl_union_flow_get_may_no_source(get());
26040 if (!res)
26041 exception::throw_last_error(saved_ctx);
26042 return manage(res);
26045 isl::union_map union_flow::get_may_no_source() const
26047 return may_no_source();
26050 isl::union_map union_flow::must_dependence() const
26052 if (!ptr)
26053 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26054 auto saved_ctx = ctx();
26055 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26056 auto res = isl_union_flow_get_must_dependence(get());
26057 if (!res)
26058 exception::throw_last_error(saved_ctx);
26059 return manage(res);
26062 isl::union_map union_flow::get_must_dependence() const
26064 return must_dependence();
26067 isl::union_map union_flow::must_no_source() const
26069 if (!ptr)
26070 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26071 auto saved_ctx = ctx();
26072 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26073 auto res = isl_union_flow_get_must_no_source(get());
26074 if (!res)
26075 exception::throw_last_error(saved_ctx);
26076 return manage(res);
26079 isl::union_map union_flow::get_must_no_source() const
26081 return must_no_source();
26084 inline std::ostream &operator<<(std::ostream &os, const union_flow &obj)
26086 if (!obj.get())
26087 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26088 auto saved_ctx = isl_union_flow_get_ctx(obj.get());
26089 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26090 char *str = isl_union_flow_to_str(obj.get());
26091 if (!str)
26092 exception::throw_last_error(saved_ctx);
26093 os << str;
26094 free(str);
26095 return os;
26098 // implementations for isl::union_map
26099 union_map manage(__isl_take isl_union_map *ptr) {
26100 if (!ptr)
26101 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26102 return union_map(ptr);
26104 union_map manage_copy(__isl_keep isl_union_map *ptr) {
26105 if (!ptr)
26106 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26107 auto saved_ctx = isl_union_map_get_ctx(ptr);
26108 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26109 ptr = isl_union_map_copy(ptr);
26110 if (!ptr)
26111 exception::throw_last_error(saved_ctx);
26112 return union_map(ptr);
26115 union_map::union_map(__isl_take isl_union_map *ptr)
26116 : ptr(ptr) {}
26118 union_map::union_map()
26119 : ptr(nullptr) {}
26121 union_map::union_map(const union_map &obj)
26122 : ptr(nullptr)
26124 if (!obj.ptr)
26125 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26126 auto saved_ctx = isl_union_map_get_ctx(obj.ptr);
26127 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26128 ptr = obj.copy();
26129 if (!ptr)
26130 exception::throw_last_error(saved_ctx);
26133 union_map::union_map(isl::basic_map bmap)
26135 if (bmap.is_null())
26136 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26137 auto saved_ctx = bmap.ctx();
26138 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26139 auto res = isl_union_map_from_basic_map(bmap.release());
26140 if (!res)
26141 exception::throw_last_error(saved_ctx);
26142 ptr = res;
26145 union_map::union_map(isl::map map)
26147 if (map.is_null())
26148 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26149 auto saved_ctx = map.ctx();
26150 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26151 auto res = isl_union_map_from_map(map.release());
26152 if (!res)
26153 exception::throw_last_error(saved_ctx);
26154 ptr = res;
26157 union_map::union_map(isl::ctx ctx, const std::string &str)
26159 auto saved_ctx = ctx;
26160 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26161 auto res = isl_union_map_read_from_str(ctx.release(), str.c_str());
26162 if (!res)
26163 exception::throw_last_error(saved_ctx);
26164 ptr = res;
26167 union_map &union_map::operator=(union_map obj) {
26168 std::swap(this->ptr, obj.ptr);
26169 return *this;
26172 union_map::~union_map() {
26173 if (ptr)
26174 isl_union_map_free(ptr);
26177 __isl_give isl_union_map *union_map::copy() const & {
26178 return isl_union_map_copy(ptr);
26181 __isl_keep isl_union_map *union_map::get() const {
26182 return ptr;
26185 __isl_give isl_union_map *union_map::release() {
26186 isl_union_map *tmp = ptr;
26187 ptr = nullptr;
26188 return tmp;
26191 bool union_map::is_null() const {
26192 return ptr == nullptr;
26195 isl::ctx union_map::ctx() const {
26196 return isl::ctx(isl_union_map_get_ctx(ptr));
26199 isl::union_map union_map::affine_hull() const
26201 if (!ptr)
26202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26203 auto saved_ctx = ctx();
26204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26205 auto res = isl_union_map_affine_hull(copy());
26206 if (!res)
26207 exception::throw_last_error(saved_ctx);
26208 return manage(res);
26211 isl::union_map union_map::apply_domain(isl::union_map umap2) const
26213 if (!ptr || umap2.is_null())
26214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26215 auto saved_ctx = ctx();
26216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26217 auto res = isl_union_map_apply_domain(copy(), umap2.release());
26218 if (!res)
26219 exception::throw_last_error(saved_ctx);
26220 return manage(res);
26223 isl::union_map union_map::apply_range(isl::union_map umap2) const
26225 if (!ptr || umap2.is_null())
26226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26227 auto saved_ctx = ctx();
26228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26229 auto res = isl_union_map_apply_range(copy(), umap2.release());
26230 if (!res)
26231 exception::throw_last_error(saved_ctx);
26232 return manage(res);
26235 isl::map union_map::as_map() const
26237 if (!ptr)
26238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26239 auto saved_ctx = ctx();
26240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26241 auto res = isl_union_map_as_map(copy());
26242 if (!res)
26243 exception::throw_last_error(saved_ctx);
26244 return manage(res);
26247 isl::multi_union_pw_aff union_map::as_multi_union_pw_aff() const
26249 if (!ptr)
26250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26251 auto saved_ctx = ctx();
26252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26253 auto res = isl_union_map_as_multi_union_pw_aff(copy());
26254 if (!res)
26255 exception::throw_last_error(saved_ctx);
26256 return manage(res);
26259 isl::union_pw_multi_aff union_map::as_union_pw_multi_aff() const
26261 if (!ptr)
26262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26263 auto saved_ctx = ctx();
26264 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26265 auto res = isl_union_map_as_union_pw_multi_aff(copy());
26266 if (!res)
26267 exception::throw_last_error(saved_ctx);
26268 return manage(res);
26271 isl::union_set union_map::bind_range(isl::multi_id tuple) const
26273 if (!ptr || tuple.is_null())
26274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26275 auto saved_ctx = ctx();
26276 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26277 auto res = isl_union_map_bind_range(copy(), tuple.release());
26278 if (!res)
26279 exception::throw_last_error(saved_ctx);
26280 return manage(res);
26283 isl::union_map union_map::coalesce() const
26285 if (!ptr)
26286 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26287 auto saved_ctx = ctx();
26288 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26289 auto res = isl_union_map_coalesce(copy());
26290 if (!res)
26291 exception::throw_last_error(saved_ctx);
26292 return manage(res);
26295 isl::union_map union_map::compute_divs() const
26297 if (!ptr)
26298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26299 auto saved_ctx = ctx();
26300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26301 auto res = isl_union_map_compute_divs(copy());
26302 if (!res)
26303 exception::throw_last_error(saved_ctx);
26304 return manage(res);
26307 isl::union_map union_map::curry() const
26309 if (!ptr)
26310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26311 auto saved_ctx = ctx();
26312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26313 auto res = isl_union_map_curry(copy());
26314 if (!res)
26315 exception::throw_last_error(saved_ctx);
26316 return manage(res);
26319 isl::union_set union_map::deltas() const
26321 if (!ptr)
26322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26323 auto saved_ctx = ctx();
26324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26325 auto res = isl_union_map_deltas(copy());
26326 if (!res)
26327 exception::throw_last_error(saved_ctx);
26328 return manage(res);
26331 isl::union_map union_map::detect_equalities() const
26333 if (!ptr)
26334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26335 auto saved_ctx = ctx();
26336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26337 auto res = isl_union_map_detect_equalities(copy());
26338 if (!res)
26339 exception::throw_last_error(saved_ctx);
26340 return manage(res);
26343 isl::union_set union_map::domain() const
26345 if (!ptr)
26346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26347 auto saved_ctx = ctx();
26348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26349 auto res = isl_union_map_domain(copy());
26350 if (!res)
26351 exception::throw_last_error(saved_ctx);
26352 return manage(res);
26355 isl::union_map union_map::domain_factor_domain() const
26357 if (!ptr)
26358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26359 auto saved_ctx = ctx();
26360 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26361 auto res = isl_union_map_domain_factor_domain(copy());
26362 if (!res)
26363 exception::throw_last_error(saved_ctx);
26364 return manage(res);
26367 isl::union_map union_map::domain_factor_range() const
26369 if (!ptr)
26370 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26371 auto saved_ctx = ctx();
26372 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26373 auto res = isl_union_map_domain_factor_range(copy());
26374 if (!res)
26375 exception::throw_last_error(saved_ctx);
26376 return manage(res);
26379 isl::union_map union_map::domain_map() const
26381 if (!ptr)
26382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26383 auto saved_ctx = ctx();
26384 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26385 auto res = isl_union_map_domain_map(copy());
26386 if (!res)
26387 exception::throw_last_error(saved_ctx);
26388 return manage(res);
26391 isl::union_pw_multi_aff union_map::domain_map_union_pw_multi_aff() const
26393 if (!ptr)
26394 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26395 auto saved_ctx = ctx();
26396 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26397 auto res = isl_union_map_domain_map_union_pw_multi_aff(copy());
26398 if (!res)
26399 exception::throw_last_error(saved_ctx);
26400 return manage(res);
26403 isl::union_map union_map::domain_product(isl::union_map umap2) const
26405 if (!ptr || umap2.is_null())
26406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26407 auto saved_ctx = ctx();
26408 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26409 auto res = isl_union_map_domain_product(copy(), umap2.release());
26410 if (!res)
26411 exception::throw_last_error(saved_ctx);
26412 return manage(res);
26415 isl::union_map union_map::domain_reverse() const
26417 if (!ptr)
26418 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26419 auto saved_ctx = ctx();
26420 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26421 auto res = isl_union_map_domain_reverse(copy());
26422 if (!res)
26423 exception::throw_last_error(saved_ctx);
26424 return manage(res);
26427 isl::union_map union_map::drop_unused_params() const
26429 if (!ptr)
26430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26431 auto saved_ctx = ctx();
26432 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26433 auto res = isl_union_map_drop_unused_params(copy());
26434 if (!res)
26435 exception::throw_last_error(saved_ctx);
26436 return manage(res);
26439 isl::union_map union_map::empty(isl::ctx ctx)
26441 auto saved_ctx = ctx;
26442 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26443 auto res = isl_union_map_empty_ctx(ctx.release());
26444 if (!res)
26445 exception::throw_last_error(saved_ctx);
26446 return manage(res);
26449 isl::union_map union_map::eq_at(isl::multi_union_pw_aff mupa) const
26451 if (!ptr || mupa.is_null())
26452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26453 auto saved_ctx = ctx();
26454 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26455 auto res = isl_union_map_eq_at_multi_union_pw_aff(copy(), mupa.release());
26456 if (!res)
26457 exception::throw_last_error(saved_ctx);
26458 return manage(res);
26461 bool union_map::every_map(const std::function<bool(isl::map)> &test) const
26463 if (!ptr)
26464 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26465 auto saved_ctx = ctx();
26466 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26467 struct test_data {
26468 std::function<bool(isl::map)> func;
26469 std::exception_ptr eptr;
26470 } test_data = { test };
26471 auto test_lambda = [](isl_map *arg_0, void *arg_1) -> isl_bool {
26472 auto *data = static_cast<struct test_data *>(arg_1);
26473 ISL_CPP_TRY {
26474 auto ret = (data->func)(manage_copy(arg_0));
26475 return ret ? isl_bool_true : isl_bool_false;
26476 } ISL_CPP_CATCH_ALL {
26477 data->eptr = std::current_exception();
26478 return isl_bool_error;
26481 auto res = isl_union_map_every_map(get(), test_lambda, &test_data);
26482 if (test_data.eptr)
26483 std::rethrow_exception(test_data.eptr);
26484 if (res < 0)
26485 exception::throw_last_error(saved_ctx);
26486 return res;
26489 isl::map union_map::extract_map(isl::space space) const
26491 if (!ptr || space.is_null())
26492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26493 auto saved_ctx = ctx();
26494 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26495 auto res = isl_union_map_extract_map(get(), space.release());
26496 if (!res)
26497 exception::throw_last_error(saved_ctx);
26498 return manage(res);
26501 isl::union_map union_map::factor_domain() const
26503 if (!ptr)
26504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26505 auto saved_ctx = ctx();
26506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26507 auto res = isl_union_map_factor_domain(copy());
26508 if (!res)
26509 exception::throw_last_error(saved_ctx);
26510 return manage(res);
26513 isl::union_map union_map::factor_range() const
26515 if (!ptr)
26516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26517 auto saved_ctx = ctx();
26518 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26519 auto res = isl_union_map_factor_range(copy());
26520 if (!res)
26521 exception::throw_last_error(saved_ctx);
26522 return manage(res);
26525 isl::union_map union_map::fixed_power(isl::val exp) const
26527 if (!ptr || exp.is_null())
26528 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26529 auto saved_ctx = ctx();
26530 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26531 auto res = isl_union_map_fixed_power_val(copy(), exp.release());
26532 if (!res)
26533 exception::throw_last_error(saved_ctx);
26534 return manage(res);
26537 isl::union_map union_map::fixed_power(long exp) const
26539 if (!ptr)
26540 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26541 return this->fixed_power(isl::val(ctx(), exp));
26544 void union_map::foreach_map(const std::function<void(isl::map)> &fn) const
26546 if (!ptr)
26547 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26548 auto saved_ctx = ctx();
26549 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26550 struct fn_data {
26551 std::function<void(isl::map)> func;
26552 std::exception_ptr eptr;
26553 } fn_data = { fn };
26554 auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
26555 auto *data = static_cast<struct fn_data *>(arg_1);
26556 ISL_CPP_TRY {
26557 (data->func)(manage(arg_0));
26558 return isl_stat_ok;
26559 } ISL_CPP_CATCH_ALL {
26560 data->eptr = std::current_exception();
26561 return isl_stat_error;
26564 auto res = isl_union_map_foreach_map(get(), fn_lambda, &fn_data);
26565 if (fn_data.eptr)
26566 std::rethrow_exception(fn_data.eptr);
26567 if (res < 0)
26568 exception::throw_last_error(saved_ctx);
26569 return;
26572 isl::union_map union_map::from(isl::multi_union_pw_aff mupa)
26574 if (mupa.is_null())
26575 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26576 auto saved_ctx = mupa.ctx();
26577 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26578 auto res = isl_union_map_from_multi_union_pw_aff(mupa.release());
26579 if (!res)
26580 exception::throw_last_error(saved_ctx);
26581 return manage(res);
26584 isl::union_map union_map::from(isl::union_pw_multi_aff upma)
26586 if (upma.is_null())
26587 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26588 auto saved_ctx = upma.ctx();
26589 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26590 auto res = isl_union_map_from_union_pw_multi_aff(upma.release());
26591 if (!res)
26592 exception::throw_last_error(saved_ctx);
26593 return manage(res);
26596 isl::union_map union_map::from_domain(isl::union_set uset)
26598 if (uset.is_null())
26599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26600 auto saved_ctx = uset.ctx();
26601 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26602 auto res = isl_union_map_from_domain(uset.release());
26603 if (!res)
26604 exception::throw_last_error(saved_ctx);
26605 return manage(res);
26608 isl::union_map union_map::from_domain_and_range(isl::union_set domain, isl::union_set range)
26610 if (domain.is_null() || range.is_null())
26611 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26612 auto saved_ctx = domain.ctx();
26613 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26614 auto res = isl_union_map_from_domain_and_range(domain.release(), range.release());
26615 if (!res)
26616 exception::throw_last_error(saved_ctx);
26617 return manage(res);
26620 isl::union_map union_map::from_range(isl::union_set uset)
26622 if (uset.is_null())
26623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26624 auto saved_ctx = uset.ctx();
26625 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26626 auto res = isl_union_map_from_range(uset.release());
26627 if (!res)
26628 exception::throw_last_error(saved_ctx);
26629 return manage(res);
26632 isl::union_map union_map::gist(isl::union_map context) const
26634 if (!ptr || context.is_null())
26635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26636 auto saved_ctx = ctx();
26637 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26638 auto res = isl_union_map_gist(copy(), context.release());
26639 if (!res)
26640 exception::throw_last_error(saved_ctx);
26641 return manage(res);
26644 isl::union_map union_map::gist_domain(isl::union_set uset) const
26646 if (!ptr || uset.is_null())
26647 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26648 auto saved_ctx = ctx();
26649 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26650 auto res = isl_union_map_gist_domain(copy(), uset.release());
26651 if (!res)
26652 exception::throw_last_error(saved_ctx);
26653 return manage(res);
26656 isl::union_map union_map::gist_params(isl::set set) const
26658 if (!ptr || set.is_null())
26659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26660 auto saved_ctx = ctx();
26661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26662 auto res = isl_union_map_gist_params(copy(), set.release());
26663 if (!res)
26664 exception::throw_last_error(saved_ctx);
26665 return manage(res);
26668 isl::union_map union_map::gist_range(isl::union_set uset) const
26670 if (!ptr || uset.is_null())
26671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26672 auto saved_ctx = ctx();
26673 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26674 auto res = isl_union_map_gist_range(copy(), uset.release());
26675 if (!res)
26676 exception::throw_last_error(saved_ctx);
26677 return manage(res);
26680 isl::union_map union_map::intersect(isl::union_map umap2) const
26682 if (!ptr || umap2.is_null())
26683 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26684 auto saved_ctx = ctx();
26685 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26686 auto res = isl_union_map_intersect(copy(), umap2.release());
26687 if (!res)
26688 exception::throw_last_error(saved_ctx);
26689 return manage(res);
26692 isl::union_map union_map::intersect_domain(isl::space space) const
26694 if (!ptr || space.is_null())
26695 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26696 auto saved_ctx = ctx();
26697 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26698 auto res = isl_union_map_intersect_domain_space(copy(), space.release());
26699 if (!res)
26700 exception::throw_last_error(saved_ctx);
26701 return manage(res);
26704 isl::union_map union_map::intersect_domain(isl::union_set uset) const
26706 if (!ptr || uset.is_null())
26707 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26708 auto saved_ctx = ctx();
26709 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26710 auto res = isl_union_map_intersect_domain_union_set(copy(), uset.release());
26711 if (!res)
26712 exception::throw_last_error(saved_ctx);
26713 return manage(res);
26716 isl::union_map union_map::intersect_domain_factor_domain(isl::union_map factor) const
26718 if (!ptr || factor.is_null())
26719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26720 auto saved_ctx = ctx();
26721 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26722 auto res = isl_union_map_intersect_domain_factor_domain(copy(), factor.release());
26723 if (!res)
26724 exception::throw_last_error(saved_ctx);
26725 return manage(res);
26728 isl::union_map union_map::intersect_domain_factor_range(isl::union_map factor) const
26730 if (!ptr || factor.is_null())
26731 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26732 auto saved_ctx = ctx();
26733 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26734 auto res = isl_union_map_intersect_domain_factor_range(copy(), factor.release());
26735 if (!res)
26736 exception::throw_last_error(saved_ctx);
26737 return manage(res);
26740 isl::union_map union_map::intersect_domain_wrapped_domain(isl::union_set domain) const
26742 if (!ptr || domain.is_null())
26743 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26744 auto saved_ctx = ctx();
26745 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26746 auto res = isl_union_map_intersect_domain_wrapped_domain_union_set(copy(), domain.release());
26747 if (!res)
26748 exception::throw_last_error(saved_ctx);
26749 return manage(res);
26752 isl::union_map union_map::intersect_params(isl::set set) const
26754 if (!ptr || set.is_null())
26755 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26756 auto saved_ctx = ctx();
26757 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26758 auto res = isl_union_map_intersect_params(copy(), set.release());
26759 if (!res)
26760 exception::throw_last_error(saved_ctx);
26761 return manage(res);
26764 isl::union_map union_map::intersect_range(isl::space space) const
26766 if (!ptr || space.is_null())
26767 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26768 auto saved_ctx = ctx();
26769 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26770 auto res = isl_union_map_intersect_range_space(copy(), space.release());
26771 if (!res)
26772 exception::throw_last_error(saved_ctx);
26773 return manage(res);
26776 isl::union_map union_map::intersect_range(isl::union_set uset) const
26778 if (!ptr || uset.is_null())
26779 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26780 auto saved_ctx = ctx();
26781 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26782 auto res = isl_union_map_intersect_range_union_set(copy(), uset.release());
26783 if (!res)
26784 exception::throw_last_error(saved_ctx);
26785 return manage(res);
26788 isl::union_map union_map::intersect_range_factor_domain(isl::union_map factor) const
26790 if (!ptr || factor.is_null())
26791 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26792 auto saved_ctx = ctx();
26793 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26794 auto res = isl_union_map_intersect_range_factor_domain(copy(), factor.release());
26795 if (!res)
26796 exception::throw_last_error(saved_ctx);
26797 return manage(res);
26800 isl::union_map union_map::intersect_range_factor_range(isl::union_map factor) const
26802 if (!ptr || factor.is_null())
26803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26804 auto saved_ctx = ctx();
26805 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26806 auto res = isl_union_map_intersect_range_factor_range(copy(), factor.release());
26807 if (!res)
26808 exception::throw_last_error(saved_ctx);
26809 return manage(res);
26812 isl::union_map union_map::intersect_range_wrapped_domain(isl::union_set domain) const
26814 if (!ptr || domain.is_null())
26815 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26816 auto saved_ctx = ctx();
26817 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26818 auto res = isl_union_map_intersect_range_wrapped_domain_union_set(copy(), domain.release());
26819 if (!res)
26820 exception::throw_last_error(saved_ctx);
26821 return manage(res);
26824 bool union_map::is_bijective() const
26826 if (!ptr)
26827 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26828 auto saved_ctx = ctx();
26829 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26830 auto res = isl_union_map_is_bijective(get());
26831 if (res < 0)
26832 exception::throw_last_error(saved_ctx);
26833 return res;
26836 bool union_map::is_disjoint(const isl::union_map &umap2) const
26838 if (!ptr || umap2.is_null())
26839 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26840 auto saved_ctx = ctx();
26841 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26842 auto res = isl_union_map_is_disjoint(get(), umap2.get());
26843 if (res < 0)
26844 exception::throw_last_error(saved_ctx);
26845 return res;
26848 bool union_map::is_empty() const
26850 if (!ptr)
26851 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26852 auto saved_ctx = ctx();
26853 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26854 auto res = isl_union_map_is_empty(get());
26855 if (res < 0)
26856 exception::throw_last_error(saved_ctx);
26857 return res;
26860 bool union_map::is_equal(const isl::union_map &umap2) const
26862 if (!ptr || umap2.is_null())
26863 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26864 auto saved_ctx = ctx();
26865 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26866 auto res = isl_union_map_is_equal(get(), umap2.get());
26867 if (res < 0)
26868 exception::throw_last_error(saved_ctx);
26869 return res;
26872 bool union_map::is_injective() const
26874 if (!ptr)
26875 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26876 auto saved_ctx = ctx();
26877 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26878 auto res = isl_union_map_is_injective(get());
26879 if (res < 0)
26880 exception::throw_last_error(saved_ctx);
26881 return res;
26884 bool union_map::is_single_valued() const
26886 if (!ptr)
26887 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26888 auto saved_ctx = ctx();
26889 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26890 auto res = isl_union_map_is_single_valued(get());
26891 if (res < 0)
26892 exception::throw_last_error(saved_ctx);
26893 return res;
26896 bool union_map::is_strict_subset(const isl::union_map &umap2) const
26898 if (!ptr || umap2.is_null())
26899 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26900 auto saved_ctx = ctx();
26901 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26902 auto res = isl_union_map_is_strict_subset(get(), umap2.get());
26903 if (res < 0)
26904 exception::throw_last_error(saved_ctx);
26905 return res;
26908 bool union_map::is_subset(const isl::union_map &umap2) const
26910 if (!ptr || umap2.is_null())
26911 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26912 auto saved_ctx = ctx();
26913 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26914 auto res = isl_union_map_is_subset(get(), umap2.get());
26915 if (res < 0)
26916 exception::throw_last_error(saved_ctx);
26917 return res;
26920 bool union_map::isa_map() const
26922 if (!ptr)
26923 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26924 auto saved_ctx = ctx();
26925 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26926 auto res = isl_union_map_isa_map(get());
26927 if (res < 0)
26928 exception::throw_last_error(saved_ctx);
26929 return res;
26932 isl::union_map union_map::lexmax() const
26934 if (!ptr)
26935 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26936 auto saved_ctx = ctx();
26937 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26938 auto res = isl_union_map_lexmax(copy());
26939 if (!res)
26940 exception::throw_last_error(saved_ctx);
26941 return manage(res);
26944 isl::union_map union_map::lexmin() const
26946 if (!ptr)
26947 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26948 auto saved_ctx = ctx();
26949 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26950 auto res = isl_union_map_lexmin(copy());
26951 if (!res)
26952 exception::throw_last_error(saved_ctx);
26953 return manage(res);
26956 isl::map_list union_map::map_list() const
26958 if (!ptr)
26959 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26960 auto saved_ctx = ctx();
26961 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26962 auto res = isl_union_map_get_map_list(get());
26963 if (!res)
26964 exception::throw_last_error(saved_ctx);
26965 return manage(res);
26968 isl::map_list union_map::get_map_list() const
26970 return map_list();
26973 isl::set union_map::params() const
26975 if (!ptr)
26976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26977 auto saved_ctx = ctx();
26978 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26979 auto res = isl_union_map_params(copy());
26980 if (!res)
26981 exception::throw_last_error(saved_ctx);
26982 return manage(res);
26985 isl::union_map union_map::polyhedral_hull() const
26987 if (!ptr)
26988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26989 auto saved_ctx = ctx();
26990 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26991 auto res = isl_union_map_polyhedral_hull(copy());
26992 if (!res)
26993 exception::throw_last_error(saved_ctx);
26994 return manage(res);
26997 isl::union_map union_map::preimage_domain(isl::multi_aff ma) const
26999 if (!ptr || ma.is_null())
27000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27001 auto saved_ctx = ctx();
27002 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27003 auto res = isl_union_map_preimage_domain_multi_aff(copy(), ma.release());
27004 if (!res)
27005 exception::throw_last_error(saved_ctx);
27006 return manage(res);
27009 isl::union_map union_map::preimage_domain(isl::multi_pw_aff mpa) const
27011 if (!ptr || mpa.is_null())
27012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27013 auto saved_ctx = ctx();
27014 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27015 auto res = isl_union_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
27016 if (!res)
27017 exception::throw_last_error(saved_ctx);
27018 return manage(res);
27021 isl::union_map union_map::preimage_domain(isl::pw_multi_aff pma) const
27023 if (!ptr || pma.is_null())
27024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27025 auto saved_ctx = ctx();
27026 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27027 auto res = isl_union_map_preimage_domain_pw_multi_aff(copy(), pma.release());
27028 if (!res)
27029 exception::throw_last_error(saved_ctx);
27030 return manage(res);
27033 isl::union_map union_map::preimage_domain(isl::union_pw_multi_aff upma) const
27035 if (!ptr || upma.is_null())
27036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27037 auto saved_ctx = ctx();
27038 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27039 auto res = isl_union_map_preimage_domain_union_pw_multi_aff(copy(), upma.release());
27040 if (!res)
27041 exception::throw_last_error(saved_ctx);
27042 return manage(res);
27045 isl::union_map union_map::preimage_range(isl::multi_aff ma) const
27047 if (!ptr || ma.is_null())
27048 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27049 auto saved_ctx = ctx();
27050 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27051 auto res = isl_union_map_preimage_range_multi_aff(copy(), ma.release());
27052 if (!res)
27053 exception::throw_last_error(saved_ctx);
27054 return manage(res);
27057 isl::union_map union_map::preimage_range(isl::pw_multi_aff pma) const
27059 if (!ptr || pma.is_null())
27060 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27061 auto saved_ctx = ctx();
27062 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27063 auto res = isl_union_map_preimage_range_pw_multi_aff(copy(), pma.release());
27064 if (!res)
27065 exception::throw_last_error(saved_ctx);
27066 return manage(res);
27069 isl::union_map union_map::preimage_range(isl::union_pw_multi_aff upma) const
27071 if (!ptr || upma.is_null())
27072 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27073 auto saved_ctx = ctx();
27074 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27075 auto res = isl_union_map_preimage_range_union_pw_multi_aff(copy(), upma.release());
27076 if (!res)
27077 exception::throw_last_error(saved_ctx);
27078 return manage(res);
27081 isl::union_map union_map::product(isl::union_map umap2) const
27083 if (!ptr || umap2.is_null())
27084 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27085 auto saved_ctx = ctx();
27086 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27087 auto res = isl_union_map_product(copy(), umap2.release());
27088 if (!res)
27089 exception::throw_last_error(saved_ctx);
27090 return manage(res);
27093 isl::union_map union_map::project_out_all_params() const
27095 if (!ptr)
27096 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27097 auto saved_ctx = ctx();
27098 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27099 auto res = isl_union_map_project_out_all_params(copy());
27100 if (!res)
27101 exception::throw_last_error(saved_ctx);
27102 return manage(res);
27105 isl::union_map union_map::project_out_param(isl::id id) const
27107 if (!ptr || id.is_null())
27108 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27109 auto saved_ctx = ctx();
27110 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27111 auto res = isl_union_map_project_out_param_id(copy(), id.release());
27112 if (!res)
27113 exception::throw_last_error(saved_ctx);
27114 return manage(res);
27117 isl::union_map union_map::project_out_param(const std::string &id) const
27119 if (!ptr)
27120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27121 return this->project_out_param(isl::id(ctx(), id));
27124 isl::union_map union_map::project_out_param(isl::id_list list) const
27126 if (!ptr || list.is_null())
27127 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27128 auto saved_ctx = ctx();
27129 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27130 auto res = isl_union_map_project_out_param_id_list(copy(), list.release());
27131 if (!res)
27132 exception::throw_last_error(saved_ctx);
27133 return manage(res);
27136 isl::union_set union_map::range() const
27138 if (!ptr)
27139 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27140 auto saved_ctx = ctx();
27141 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27142 auto res = isl_union_map_range(copy());
27143 if (!res)
27144 exception::throw_last_error(saved_ctx);
27145 return manage(res);
27148 isl::union_map union_map::range_factor_domain() const
27150 if (!ptr)
27151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27152 auto saved_ctx = ctx();
27153 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27154 auto res = isl_union_map_range_factor_domain(copy());
27155 if (!res)
27156 exception::throw_last_error(saved_ctx);
27157 return manage(res);
27160 isl::union_map union_map::range_factor_range() const
27162 if (!ptr)
27163 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27164 auto saved_ctx = ctx();
27165 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27166 auto res = isl_union_map_range_factor_range(copy());
27167 if (!res)
27168 exception::throw_last_error(saved_ctx);
27169 return manage(res);
27172 isl::union_map union_map::range_map() const
27174 if (!ptr)
27175 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27176 auto saved_ctx = ctx();
27177 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27178 auto res = isl_union_map_range_map(copy());
27179 if (!res)
27180 exception::throw_last_error(saved_ctx);
27181 return manage(res);
27184 isl::union_map union_map::range_product(isl::union_map umap2) const
27186 if (!ptr || umap2.is_null())
27187 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27188 auto saved_ctx = ctx();
27189 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27190 auto res = isl_union_map_range_product(copy(), umap2.release());
27191 if (!res)
27192 exception::throw_last_error(saved_ctx);
27193 return manage(res);
27196 isl::union_map union_map::range_reverse() const
27198 if (!ptr)
27199 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27200 auto saved_ctx = ctx();
27201 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27202 auto res = isl_union_map_range_reverse(copy());
27203 if (!res)
27204 exception::throw_last_error(saved_ctx);
27205 return manage(res);
27208 isl::union_map union_map::reverse() const
27210 if (!ptr)
27211 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27212 auto saved_ctx = ctx();
27213 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27214 auto res = isl_union_map_reverse(copy());
27215 if (!res)
27216 exception::throw_last_error(saved_ctx);
27217 return manage(res);
27220 isl::space union_map::space() const
27222 if (!ptr)
27223 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27224 auto saved_ctx = ctx();
27225 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27226 auto res = isl_union_map_get_space(get());
27227 if (!res)
27228 exception::throw_last_error(saved_ctx);
27229 return manage(res);
27232 isl::space union_map::get_space() const
27234 return space();
27237 isl::union_map union_map::subtract(isl::union_map umap2) const
27239 if (!ptr || umap2.is_null())
27240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27241 auto saved_ctx = ctx();
27242 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27243 auto res = isl_union_map_subtract(copy(), umap2.release());
27244 if (!res)
27245 exception::throw_last_error(saved_ctx);
27246 return manage(res);
27249 isl::union_map union_map::subtract_domain(isl::union_set dom) const
27251 if (!ptr || dom.is_null())
27252 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27253 auto saved_ctx = ctx();
27254 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27255 auto res = isl_union_map_subtract_domain(copy(), dom.release());
27256 if (!res)
27257 exception::throw_last_error(saved_ctx);
27258 return manage(res);
27261 isl::union_map union_map::subtract_range(isl::union_set dom) const
27263 if (!ptr || dom.is_null())
27264 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27265 auto saved_ctx = ctx();
27266 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27267 auto res = isl_union_map_subtract_range(copy(), dom.release());
27268 if (!res)
27269 exception::throw_last_error(saved_ctx);
27270 return manage(res);
27273 isl::union_map union_map::uncurry() const
27275 if (!ptr)
27276 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27277 auto saved_ctx = ctx();
27278 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27279 auto res = isl_union_map_uncurry(copy());
27280 if (!res)
27281 exception::throw_last_error(saved_ctx);
27282 return manage(res);
27285 isl::union_map union_map::unite(isl::union_map umap2) const
27287 if (!ptr || umap2.is_null())
27288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27289 auto saved_ctx = ctx();
27290 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27291 auto res = isl_union_map_union(copy(), umap2.release());
27292 if (!res)
27293 exception::throw_last_error(saved_ctx);
27294 return manage(res);
27297 isl::union_map union_map::universe() const
27299 if (!ptr)
27300 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27301 auto saved_ctx = ctx();
27302 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27303 auto res = isl_union_map_universe(copy());
27304 if (!res)
27305 exception::throw_last_error(saved_ctx);
27306 return manage(res);
27309 isl::union_set union_map::wrap() const
27311 if (!ptr)
27312 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27313 auto saved_ctx = ctx();
27314 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27315 auto res = isl_union_map_wrap(copy());
27316 if (!res)
27317 exception::throw_last_error(saved_ctx);
27318 return manage(res);
27321 isl::union_map union_map::zip() const
27323 if (!ptr)
27324 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27325 auto saved_ctx = ctx();
27326 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27327 auto res = isl_union_map_zip(copy());
27328 if (!res)
27329 exception::throw_last_error(saved_ctx);
27330 return manage(res);
27333 inline std::ostream &operator<<(std::ostream &os, const union_map &obj)
27335 if (!obj.get())
27336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27337 auto saved_ctx = isl_union_map_get_ctx(obj.get());
27338 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27339 char *str = isl_union_map_to_str(obj.get());
27340 if (!str)
27341 exception::throw_last_error(saved_ctx);
27342 os << str;
27343 free(str);
27344 return os;
27347 // implementations for isl::union_pw_aff
27348 union_pw_aff manage(__isl_take isl_union_pw_aff *ptr) {
27349 if (!ptr)
27350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27351 return union_pw_aff(ptr);
27353 union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr) {
27354 if (!ptr)
27355 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27356 auto saved_ctx = isl_union_pw_aff_get_ctx(ptr);
27357 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27358 ptr = isl_union_pw_aff_copy(ptr);
27359 if (!ptr)
27360 exception::throw_last_error(saved_ctx);
27361 return union_pw_aff(ptr);
27364 union_pw_aff::union_pw_aff(__isl_take isl_union_pw_aff *ptr)
27365 : ptr(ptr) {}
27367 union_pw_aff::union_pw_aff()
27368 : ptr(nullptr) {}
27370 union_pw_aff::union_pw_aff(const union_pw_aff &obj)
27371 : ptr(nullptr)
27373 if (!obj.ptr)
27374 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27375 auto saved_ctx = isl_union_pw_aff_get_ctx(obj.ptr);
27376 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27377 ptr = obj.copy();
27378 if (!ptr)
27379 exception::throw_last_error(saved_ctx);
27382 union_pw_aff::union_pw_aff(isl::aff aff)
27384 if (aff.is_null())
27385 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27386 auto saved_ctx = aff.ctx();
27387 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27388 auto res = isl_union_pw_aff_from_aff(aff.release());
27389 if (!res)
27390 exception::throw_last_error(saved_ctx);
27391 ptr = res;
27394 union_pw_aff::union_pw_aff(isl::pw_aff pa)
27396 if (pa.is_null())
27397 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27398 auto saved_ctx = pa.ctx();
27399 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27400 auto res = isl_union_pw_aff_from_pw_aff(pa.release());
27401 if (!res)
27402 exception::throw_last_error(saved_ctx);
27403 ptr = res;
27406 union_pw_aff::union_pw_aff(isl::ctx ctx, const std::string &str)
27408 auto saved_ctx = ctx;
27409 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27410 auto res = isl_union_pw_aff_read_from_str(ctx.release(), str.c_str());
27411 if (!res)
27412 exception::throw_last_error(saved_ctx);
27413 ptr = res;
27416 union_pw_aff &union_pw_aff::operator=(union_pw_aff obj) {
27417 std::swap(this->ptr, obj.ptr);
27418 return *this;
27421 union_pw_aff::~union_pw_aff() {
27422 if (ptr)
27423 isl_union_pw_aff_free(ptr);
27426 __isl_give isl_union_pw_aff *union_pw_aff::copy() const & {
27427 return isl_union_pw_aff_copy(ptr);
27430 __isl_keep isl_union_pw_aff *union_pw_aff::get() const {
27431 return ptr;
27434 __isl_give isl_union_pw_aff *union_pw_aff::release() {
27435 isl_union_pw_aff *tmp = ptr;
27436 ptr = nullptr;
27437 return tmp;
27440 bool union_pw_aff::is_null() const {
27441 return ptr == nullptr;
27444 isl::ctx union_pw_aff::ctx() const {
27445 return isl::ctx(isl_union_pw_aff_get_ctx(ptr));
27448 isl::multi_union_pw_aff union_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
27450 if (!ptr)
27451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27452 return isl::multi_union_pw_aff(*this).add(multi2);
27455 isl::union_pw_aff union_pw_aff::add(isl::union_pw_aff upa2) const
27457 if (!ptr || upa2.is_null())
27458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27459 auto saved_ctx = ctx();
27460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27461 auto res = isl_union_pw_aff_add(copy(), upa2.release());
27462 if (!res)
27463 exception::throw_last_error(saved_ctx);
27464 return manage(res);
27467 isl::union_pw_multi_aff union_pw_aff::add(const isl::union_pw_multi_aff &upma2) const
27469 if (!ptr)
27470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27471 return isl::union_pw_multi_aff(*this).add(upma2);
27474 isl::union_pw_aff union_pw_aff::add(const isl::aff &upa2) const
27476 if (!ptr)
27477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27478 return this->add(isl::union_pw_aff(upa2));
27481 isl::union_pw_aff union_pw_aff::add(const isl::pw_aff &upa2) const
27483 if (!ptr)
27484 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27485 return this->add(isl::union_pw_aff(upa2));
27488 isl::union_pw_multi_aff union_pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
27490 if (!ptr)
27491 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27492 return isl::union_pw_multi_aff(*this).apply(upma2);
27495 isl::multi_union_pw_aff union_pw_aff::as_multi_union_pw_aff() const
27497 if (!ptr)
27498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27499 return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
27502 isl::pw_multi_aff union_pw_aff::as_pw_multi_aff() const
27504 if (!ptr)
27505 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27506 return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
27509 isl::union_map union_pw_aff::as_union_map() const
27511 if (!ptr)
27512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27513 return isl::union_pw_multi_aff(*this).as_union_map();
27516 isl::union_pw_aff union_pw_aff::at(int pos) const
27518 if (!ptr)
27519 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27520 return isl::multi_union_pw_aff(*this).at(pos);
27523 isl::union_set union_pw_aff::bind(const isl::multi_id &tuple) const
27525 if (!ptr)
27526 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27527 return isl::multi_union_pw_aff(*this).bind(tuple);
27530 isl::union_set union_pw_aff::bind(isl::id id) const
27532 if (!ptr || id.is_null())
27533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27534 auto saved_ctx = ctx();
27535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27536 auto res = isl_union_pw_aff_bind_id(copy(), id.release());
27537 if (!res)
27538 exception::throw_last_error(saved_ctx);
27539 return manage(res);
27542 isl::union_set union_pw_aff::bind(const std::string &id) const
27544 if (!ptr)
27545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27546 return this->bind(isl::id(ctx(), id));
27549 isl::union_pw_aff union_pw_aff::coalesce() const
27551 if (!ptr)
27552 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27553 auto saved_ctx = ctx();
27554 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27555 auto res = isl_union_pw_aff_coalesce(copy());
27556 if (!res)
27557 exception::throw_last_error(saved_ctx);
27558 return manage(res);
27561 isl::union_set union_pw_aff::domain() const
27563 if (!ptr)
27564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27565 auto saved_ctx = ctx();
27566 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27567 auto res = isl_union_pw_aff_domain(copy());
27568 if (!res)
27569 exception::throw_last_error(saved_ctx);
27570 return manage(res);
27573 isl::union_pw_aff union_pw_aff::drop_unused_params() const
27575 if (!ptr)
27576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27577 auto saved_ctx = ctx();
27578 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27579 auto res = isl_union_pw_aff_drop_unused_params(copy());
27580 if (!res)
27581 exception::throw_last_error(saved_ctx);
27582 return manage(res);
27585 isl::pw_multi_aff union_pw_aff::extract_pw_multi_aff(const isl::space &space) const
27587 if (!ptr)
27588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27589 return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
27592 isl::multi_union_pw_aff union_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
27594 if (!ptr)
27595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27596 return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
27599 isl::union_pw_multi_aff union_pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
27601 if (!ptr)
27602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27603 return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
27606 isl::union_pw_aff union_pw_aff::gist(isl::union_set context) const
27608 if (!ptr || context.is_null())
27609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27610 auto saved_ctx = ctx();
27611 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27612 auto res = isl_union_pw_aff_gist(copy(), context.release());
27613 if (!res)
27614 exception::throw_last_error(saved_ctx);
27615 return manage(res);
27618 isl::multi_union_pw_aff union_pw_aff::gist_params(const isl::set &context) const
27620 if (!ptr)
27621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27622 return isl::multi_union_pw_aff(*this).gist_params(context);
27625 bool union_pw_aff::has_range_tuple_id() const
27627 if (!ptr)
27628 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27629 return isl::multi_union_pw_aff(*this).has_range_tuple_id();
27632 isl::union_pw_aff union_pw_aff::intersect_domain(isl::space space) const
27634 if (!ptr || space.is_null())
27635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27636 auto saved_ctx = ctx();
27637 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27638 auto res = isl_union_pw_aff_intersect_domain_space(copy(), space.release());
27639 if (!res)
27640 exception::throw_last_error(saved_ctx);
27641 return manage(res);
27644 isl::union_pw_aff union_pw_aff::intersect_domain(isl::union_set uset) const
27646 if (!ptr || uset.is_null())
27647 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27648 auto saved_ctx = ctx();
27649 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27650 auto res = isl_union_pw_aff_intersect_domain_union_set(copy(), uset.release());
27651 if (!res)
27652 exception::throw_last_error(saved_ctx);
27653 return manage(res);
27656 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
27658 if (!ptr || uset.is_null())
27659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27660 auto saved_ctx = ctx();
27661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27662 auto res = isl_union_pw_aff_intersect_domain_wrapped_domain(copy(), uset.release());
27663 if (!res)
27664 exception::throw_last_error(saved_ctx);
27665 return manage(res);
27668 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_range(isl::union_set uset) const
27670 if (!ptr || uset.is_null())
27671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27672 auto saved_ctx = ctx();
27673 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27674 auto res = isl_union_pw_aff_intersect_domain_wrapped_range(copy(), uset.release());
27675 if (!res)
27676 exception::throw_last_error(saved_ctx);
27677 return manage(res);
27680 isl::union_pw_aff union_pw_aff::intersect_params(isl::set set) const
27682 if (!ptr || set.is_null())
27683 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27684 auto saved_ctx = ctx();
27685 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27686 auto res = isl_union_pw_aff_intersect_params(copy(), set.release());
27687 if (!res)
27688 exception::throw_last_error(saved_ctx);
27689 return manage(res);
27692 bool union_pw_aff::involves_locals() const
27694 if (!ptr)
27695 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27696 return isl::union_pw_multi_aff(*this).involves_locals();
27699 bool union_pw_aff::involves_nan() const
27701 if (!ptr)
27702 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27703 return isl::multi_union_pw_aff(*this).involves_nan();
27706 bool union_pw_aff::isa_pw_multi_aff() const
27708 if (!ptr)
27709 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27710 return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
27713 isl::union_pw_aff_list union_pw_aff::list() const
27715 if (!ptr)
27716 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27717 return isl::multi_union_pw_aff(*this).list();
27720 isl::multi_union_pw_aff union_pw_aff::neg() const
27722 if (!ptr)
27723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27724 return isl::multi_union_pw_aff(*this).neg();
27727 bool union_pw_aff::plain_is_empty() const
27729 if (!ptr)
27730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27731 return isl::union_pw_multi_aff(*this).plain_is_empty();
27734 bool union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
27736 if (!ptr)
27737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27738 return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
27741 bool union_pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
27743 if (!ptr || upa2.is_null())
27744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27745 auto saved_ctx = ctx();
27746 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27747 auto res = isl_union_pw_aff_plain_is_equal(get(), upa2.get());
27748 if (res < 0)
27749 exception::throw_last_error(saved_ctx);
27750 return res;
27753 bool union_pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
27755 if (!ptr)
27756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27757 return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
27760 bool union_pw_aff::plain_is_equal(const isl::aff &upa2) const
27762 if (!ptr)
27763 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27764 return this->plain_is_equal(isl::union_pw_aff(upa2));
27767 bool union_pw_aff::plain_is_equal(const isl::pw_aff &upa2) const
27769 if (!ptr)
27770 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27771 return this->plain_is_equal(isl::union_pw_aff(upa2));
27774 isl::union_pw_multi_aff union_pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
27776 if (!ptr)
27777 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27778 return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
27781 isl::union_pw_aff union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
27783 if (!ptr || upma.is_null())
27784 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27785 auto saved_ctx = ctx();
27786 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27787 auto res = isl_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
27788 if (!res)
27789 exception::throw_last_error(saved_ctx);
27790 return manage(res);
27793 isl::pw_multi_aff_list union_pw_aff::pw_multi_aff_list() const
27795 if (!ptr)
27796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27797 return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
27800 isl::union_pw_multi_aff union_pw_aff::range_factor_domain() const
27802 if (!ptr)
27803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27804 return isl::union_pw_multi_aff(*this).range_factor_domain();
27807 isl::union_pw_multi_aff union_pw_aff::range_factor_range() const
27809 if (!ptr)
27810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27811 return isl::union_pw_multi_aff(*this).range_factor_range();
27814 isl::multi_union_pw_aff union_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
27816 if (!ptr)
27817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27818 return isl::multi_union_pw_aff(*this).range_product(multi2);
27821 isl::union_pw_multi_aff union_pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
27823 if (!ptr)
27824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27825 return isl::union_pw_multi_aff(*this).range_product(upma2);
27828 isl::id union_pw_aff::range_tuple_id() const
27830 if (!ptr)
27831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27832 return isl::multi_union_pw_aff(*this).range_tuple_id();
27835 isl::multi_union_pw_aff union_pw_aff::reset_range_tuple_id() const
27837 if (!ptr)
27838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27839 return isl::multi_union_pw_aff(*this).reset_range_tuple_id();
27842 isl::multi_union_pw_aff union_pw_aff::scale(const isl::multi_val &mv) const
27844 if (!ptr)
27845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27846 return isl::multi_union_pw_aff(*this).scale(mv);
27849 isl::multi_union_pw_aff union_pw_aff::scale(const isl::val &v) const
27851 if (!ptr)
27852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27853 return isl::multi_union_pw_aff(*this).scale(v);
27856 isl::multi_union_pw_aff union_pw_aff::scale(long v) const
27858 if (!ptr)
27859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27860 return this->scale(isl::val(ctx(), v));
27863 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::multi_val &mv) const
27865 if (!ptr)
27866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27867 return isl::multi_union_pw_aff(*this).scale_down(mv);
27870 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::val &v) const
27872 if (!ptr)
27873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27874 return isl::multi_union_pw_aff(*this).scale_down(v);
27877 isl::multi_union_pw_aff union_pw_aff::scale_down(long v) const
27879 if (!ptr)
27880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27881 return this->scale_down(isl::val(ctx(), v));
27884 isl::multi_union_pw_aff union_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
27886 if (!ptr)
27887 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27888 return isl::multi_union_pw_aff(*this).set_at(pos, el);
27891 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const isl::id &id) const
27893 if (!ptr)
27894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27895 return isl::multi_union_pw_aff(*this).set_range_tuple(id);
27898 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const std::string &id) const
27900 if (!ptr)
27901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27902 return this->set_range_tuple(isl::id(ctx(), id));
27905 unsigned union_pw_aff::size() const
27907 if (!ptr)
27908 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27909 return isl::multi_union_pw_aff(*this).size();
27912 isl::space union_pw_aff::space() const
27914 if (!ptr)
27915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27916 auto saved_ctx = ctx();
27917 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27918 auto res = isl_union_pw_aff_get_space(get());
27919 if (!res)
27920 exception::throw_last_error(saved_ctx);
27921 return manage(res);
27924 isl::space union_pw_aff::get_space() const
27926 return space();
27929 isl::multi_union_pw_aff union_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
27931 if (!ptr)
27932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27933 return isl::multi_union_pw_aff(*this).sub(multi2);
27936 isl::union_pw_aff union_pw_aff::sub(isl::union_pw_aff upa2) const
27938 if (!ptr || upa2.is_null())
27939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27940 auto saved_ctx = ctx();
27941 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27942 auto res = isl_union_pw_aff_sub(copy(), upa2.release());
27943 if (!res)
27944 exception::throw_last_error(saved_ctx);
27945 return manage(res);
27948 isl::union_pw_multi_aff union_pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
27950 if (!ptr)
27951 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27952 return isl::union_pw_multi_aff(*this).sub(upma2);
27955 isl::union_pw_aff union_pw_aff::sub(const isl::aff &upa2) const
27957 if (!ptr)
27958 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27959 return this->sub(isl::union_pw_aff(upa2));
27962 isl::union_pw_aff union_pw_aff::sub(const isl::pw_aff &upa2) const
27964 if (!ptr)
27965 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27966 return this->sub(isl::union_pw_aff(upa2));
27969 isl::union_pw_aff union_pw_aff::subtract_domain(isl::space space) const
27971 if (!ptr || space.is_null())
27972 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27973 auto saved_ctx = ctx();
27974 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27975 auto res = isl_union_pw_aff_subtract_domain_space(copy(), space.release());
27976 if (!res)
27977 exception::throw_last_error(saved_ctx);
27978 return manage(res);
27981 isl::union_pw_aff union_pw_aff::subtract_domain(isl::union_set uset) const
27983 if (!ptr || uset.is_null())
27984 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27985 auto saved_ctx = ctx();
27986 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27987 auto res = isl_union_pw_aff_subtract_domain_union_set(copy(), uset.release());
27988 if (!res)
27989 exception::throw_last_error(saved_ctx);
27990 return manage(res);
27993 isl::union_pw_aff_list union_pw_aff::to_list() const
27995 if (!ptr)
27996 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27997 auto saved_ctx = ctx();
27998 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27999 auto res = isl_union_pw_aff_to_list(copy());
28000 if (!res)
28001 exception::throw_last_error(saved_ctx);
28002 return manage(res);
28005 isl::multi_union_pw_aff union_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
28007 if (!ptr)
28008 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28009 return isl::multi_union_pw_aff(*this).union_add(mupa2);
28012 isl::union_pw_aff union_pw_aff::union_add(isl::union_pw_aff upa2) const
28014 if (!ptr || upa2.is_null())
28015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28016 auto saved_ctx = ctx();
28017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28018 auto res = isl_union_pw_aff_union_add(copy(), upa2.release());
28019 if (!res)
28020 exception::throw_last_error(saved_ctx);
28021 return manage(res);
28024 isl::union_pw_multi_aff union_pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
28026 if (!ptr)
28027 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28028 return isl::union_pw_multi_aff(*this).union_add(upma2);
28031 isl::union_pw_aff union_pw_aff::union_add(const isl::aff &upa2) const
28033 if (!ptr)
28034 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28035 return this->union_add(isl::union_pw_aff(upa2));
28038 isl::union_pw_aff union_pw_aff::union_add(const isl::pw_aff &upa2) const
28040 if (!ptr)
28041 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28042 return this->union_add(isl::union_pw_aff(upa2));
28045 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff &obj)
28047 if (!obj.get())
28048 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28049 auto saved_ctx = isl_union_pw_aff_get_ctx(obj.get());
28050 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28051 char *str = isl_union_pw_aff_to_str(obj.get());
28052 if (!str)
28053 exception::throw_last_error(saved_ctx);
28054 os << str;
28055 free(str);
28056 return os;
28059 // implementations for isl::union_pw_aff_list
28060 union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr) {
28061 if (!ptr)
28062 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28063 return union_pw_aff_list(ptr);
28065 union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr) {
28066 if (!ptr)
28067 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28068 auto saved_ctx = isl_union_pw_aff_list_get_ctx(ptr);
28069 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28070 ptr = isl_union_pw_aff_list_copy(ptr);
28071 if (!ptr)
28072 exception::throw_last_error(saved_ctx);
28073 return union_pw_aff_list(ptr);
28076 union_pw_aff_list::union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr)
28077 : ptr(ptr) {}
28079 union_pw_aff_list::union_pw_aff_list()
28080 : ptr(nullptr) {}
28082 union_pw_aff_list::union_pw_aff_list(const union_pw_aff_list &obj)
28083 : ptr(nullptr)
28085 if (!obj.ptr)
28086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28087 auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.ptr);
28088 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28089 ptr = obj.copy();
28090 if (!ptr)
28091 exception::throw_last_error(saved_ctx);
28094 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, int n)
28096 auto saved_ctx = ctx;
28097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28098 auto res = isl_union_pw_aff_list_alloc(ctx.release(), n);
28099 if (!res)
28100 exception::throw_last_error(saved_ctx);
28101 ptr = res;
28104 union_pw_aff_list::union_pw_aff_list(isl::union_pw_aff el)
28106 if (el.is_null())
28107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28108 auto saved_ctx = el.ctx();
28109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28110 auto res = isl_union_pw_aff_list_from_union_pw_aff(el.release());
28111 if (!res)
28112 exception::throw_last_error(saved_ctx);
28113 ptr = res;
28116 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, const std::string &str)
28118 auto saved_ctx = ctx;
28119 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28120 auto res = isl_union_pw_aff_list_read_from_str(ctx.release(), str.c_str());
28121 if (!res)
28122 exception::throw_last_error(saved_ctx);
28123 ptr = res;
28126 union_pw_aff_list &union_pw_aff_list::operator=(union_pw_aff_list obj) {
28127 std::swap(this->ptr, obj.ptr);
28128 return *this;
28131 union_pw_aff_list::~union_pw_aff_list() {
28132 if (ptr)
28133 isl_union_pw_aff_list_free(ptr);
28136 __isl_give isl_union_pw_aff_list *union_pw_aff_list::copy() const & {
28137 return isl_union_pw_aff_list_copy(ptr);
28140 __isl_keep isl_union_pw_aff_list *union_pw_aff_list::get() const {
28141 return ptr;
28144 __isl_give isl_union_pw_aff_list *union_pw_aff_list::release() {
28145 isl_union_pw_aff_list *tmp = ptr;
28146 ptr = nullptr;
28147 return tmp;
28150 bool union_pw_aff_list::is_null() const {
28151 return ptr == nullptr;
28154 isl::ctx union_pw_aff_list::ctx() const {
28155 return isl::ctx(isl_union_pw_aff_list_get_ctx(ptr));
28158 isl::union_pw_aff_list union_pw_aff_list::add(isl::union_pw_aff el) const
28160 if (!ptr || el.is_null())
28161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28162 auto saved_ctx = ctx();
28163 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28164 auto res = isl_union_pw_aff_list_add(copy(), el.release());
28165 if (!res)
28166 exception::throw_last_error(saved_ctx);
28167 return manage(res);
28170 isl::union_pw_aff union_pw_aff_list::at(int index) const
28172 if (!ptr)
28173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28174 auto saved_ctx = ctx();
28175 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28176 auto res = isl_union_pw_aff_list_get_at(get(), index);
28177 if (!res)
28178 exception::throw_last_error(saved_ctx);
28179 return manage(res);
28182 isl::union_pw_aff union_pw_aff_list::get_at(int index) const
28184 return at(index);
28187 isl::union_pw_aff_list union_pw_aff_list::clear() const
28189 if (!ptr)
28190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28191 auto saved_ctx = ctx();
28192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28193 auto res = isl_union_pw_aff_list_clear(copy());
28194 if (!res)
28195 exception::throw_last_error(saved_ctx);
28196 return manage(res);
28199 isl::union_pw_aff_list union_pw_aff_list::concat(isl::union_pw_aff_list list2) const
28201 if (!ptr || list2.is_null())
28202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28203 auto saved_ctx = ctx();
28204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28205 auto res = isl_union_pw_aff_list_concat(copy(), list2.release());
28206 if (!res)
28207 exception::throw_last_error(saved_ctx);
28208 return manage(res);
28211 isl::union_pw_aff_list union_pw_aff_list::drop(unsigned int first, unsigned int n) const
28213 if (!ptr)
28214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28215 auto saved_ctx = ctx();
28216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28217 auto res = isl_union_pw_aff_list_drop(copy(), first, n);
28218 if (!res)
28219 exception::throw_last_error(saved_ctx);
28220 return manage(res);
28223 void union_pw_aff_list::foreach(const std::function<void(isl::union_pw_aff)> &fn) const
28225 if (!ptr)
28226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28227 auto saved_ctx = ctx();
28228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28229 struct fn_data {
28230 std::function<void(isl::union_pw_aff)> func;
28231 std::exception_ptr eptr;
28232 } fn_data = { fn };
28233 auto fn_lambda = [](isl_union_pw_aff *arg_0, void *arg_1) -> isl_stat {
28234 auto *data = static_cast<struct fn_data *>(arg_1);
28235 ISL_CPP_TRY {
28236 (data->func)(manage(arg_0));
28237 return isl_stat_ok;
28238 } ISL_CPP_CATCH_ALL {
28239 data->eptr = std::current_exception();
28240 return isl_stat_error;
28243 auto res = isl_union_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
28244 if (fn_data.eptr)
28245 std::rethrow_exception(fn_data.eptr);
28246 if (res < 0)
28247 exception::throw_last_error(saved_ctx);
28248 return;
28251 void union_pw_aff_list::foreach_scc(const std::function<bool(isl::union_pw_aff, isl::union_pw_aff)> &follows, const std::function<void(isl::union_pw_aff_list)> &fn) const
28253 if (!ptr)
28254 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28255 auto saved_ctx = ctx();
28256 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28257 struct follows_data {
28258 std::function<bool(isl::union_pw_aff, isl::union_pw_aff)> func;
28259 std::exception_ptr eptr;
28260 } follows_data = { follows };
28261 auto follows_lambda = [](isl_union_pw_aff *arg_0, isl_union_pw_aff *arg_1, void *arg_2) -> isl_bool {
28262 auto *data = static_cast<struct follows_data *>(arg_2);
28263 ISL_CPP_TRY {
28264 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
28265 return ret ? isl_bool_true : isl_bool_false;
28266 } ISL_CPP_CATCH_ALL {
28267 data->eptr = std::current_exception();
28268 return isl_bool_error;
28271 struct fn_data {
28272 std::function<void(isl::union_pw_aff_list)> func;
28273 std::exception_ptr eptr;
28274 } fn_data = { fn };
28275 auto fn_lambda = [](isl_union_pw_aff_list *arg_0, void *arg_1) -> isl_stat {
28276 auto *data = static_cast<struct fn_data *>(arg_1);
28277 ISL_CPP_TRY {
28278 (data->func)(manage(arg_0));
28279 return isl_stat_ok;
28280 } ISL_CPP_CATCH_ALL {
28281 data->eptr = std::current_exception();
28282 return isl_stat_error;
28285 auto res = isl_union_pw_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
28286 if (follows_data.eptr)
28287 std::rethrow_exception(follows_data.eptr);
28288 if (fn_data.eptr)
28289 std::rethrow_exception(fn_data.eptr);
28290 if (res < 0)
28291 exception::throw_last_error(saved_ctx);
28292 return;
28295 isl::union_pw_aff_list union_pw_aff_list::insert(unsigned int pos, isl::union_pw_aff el) const
28297 if (!ptr || el.is_null())
28298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28299 auto saved_ctx = ctx();
28300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28301 auto res = isl_union_pw_aff_list_insert(copy(), pos, el.release());
28302 if (!res)
28303 exception::throw_last_error(saved_ctx);
28304 return manage(res);
28307 isl::union_pw_aff_list union_pw_aff_list::set_at(int index, isl::union_pw_aff el) const
28309 if (!ptr || el.is_null())
28310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28311 auto saved_ctx = ctx();
28312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28313 auto res = isl_union_pw_aff_list_set_at(copy(), index, el.release());
28314 if (!res)
28315 exception::throw_last_error(saved_ctx);
28316 return manage(res);
28319 unsigned union_pw_aff_list::size() const
28321 if (!ptr)
28322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28323 auto saved_ctx = ctx();
28324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28325 auto res = isl_union_pw_aff_list_size(get());
28326 if (res < 0)
28327 exception::throw_last_error(saved_ctx);
28328 return res;
28331 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff_list &obj)
28333 if (!obj.get())
28334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28335 auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.get());
28336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28337 char *str = isl_union_pw_aff_list_to_str(obj.get());
28338 if (!str)
28339 exception::throw_last_error(saved_ctx);
28340 os << str;
28341 free(str);
28342 return os;
28345 // implementations for isl::union_pw_multi_aff
28346 union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr) {
28347 if (!ptr)
28348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28349 return union_pw_multi_aff(ptr);
28351 union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr) {
28352 if (!ptr)
28353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28354 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(ptr);
28355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28356 ptr = isl_union_pw_multi_aff_copy(ptr);
28357 if (!ptr)
28358 exception::throw_last_error(saved_ctx);
28359 return union_pw_multi_aff(ptr);
28362 union_pw_multi_aff::union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr)
28363 : ptr(ptr) {}
28365 union_pw_multi_aff::union_pw_multi_aff()
28366 : ptr(nullptr) {}
28368 union_pw_multi_aff::union_pw_multi_aff(const union_pw_multi_aff &obj)
28369 : ptr(nullptr)
28371 if (!obj.ptr)
28372 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28373 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.ptr);
28374 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28375 ptr = obj.copy();
28376 if (!ptr)
28377 exception::throw_last_error(saved_ctx);
28380 union_pw_multi_aff::union_pw_multi_aff(isl::multi_aff ma)
28382 if (ma.is_null())
28383 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28384 auto saved_ctx = ma.ctx();
28385 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28386 auto res = isl_union_pw_multi_aff_from_multi_aff(ma.release());
28387 if (!res)
28388 exception::throw_last_error(saved_ctx);
28389 ptr = res;
28392 union_pw_multi_aff::union_pw_multi_aff(isl::pw_multi_aff pma)
28394 if (pma.is_null())
28395 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28396 auto saved_ctx = pma.ctx();
28397 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28398 auto res = isl_union_pw_multi_aff_from_pw_multi_aff(pma.release());
28399 if (!res)
28400 exception::throw_last_error(saved_ctx);
28401 ptr = res;
28404 union_pw_multi_aff::union_pw_multi_aff(isl::union_pw_aff upa)
28406 if (upa.is_null())
28407 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28408 auto saved_ctx = upa.ctx();
28409 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28410 auto res = isl_union_pw_multi_aff_from_union_pw_aff(upa.release());
28411 if (!res)
28412 exception::throw_last_error(saved_ctx);
28413 ptr = res;
28416 union_pw_multi_aff::union_pw_multi_aff(isl::ctx ctx, const std::string &str)
28418 auto saved_ctx = ctx;
28419 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28420 auto res = isl_union_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
28421 if (!res)
28422 exception::throw_last_error(saved_ctx);
28423 ptr = res;
28426 union_pw_multi_aff &union_pw_multi_aff::operator=(union_pw_multi_aff obj) {
28427 std::swap(this->ptr, obj.ptr);
28428 return *this;
28431 union_pw_multi_aff::~union_pw_multi_aff() {
28432 if (ptr)
28433 isl_union_pw_multi_aff_free(ptr);
28436 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::copy() const & {
28437 return isl_union_pw_multi_aff_copy(ptr);
28440 __isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::get() const {
28441 return ptr;
28444 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::release() {
28445 isl_union_pw_multi_aff *tmp = ptr;
28446 ptr = nullptr;
28447 return tmp;
28450 bool union_pw_multi_aff::is_null() const {
28451 return ptr == nullptr;
28454 isl::ctx union_pw_multi_aff::ctx() const {
28455 return isl::ctx(isl_union_pw_multi_aff_get_ctx(ptr));
28458 isl::union_pw_multi_aff union_pw_multi_aff::add(isl::union_pw_multi_aff upma2) const
28460 if (!ptr || upma2.is_null())
28461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28462 auto saved_ctx = ctx();
28463 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28464 auto res = isl_union_pw_multi_aff_add(copy(), upma2.release());
28465 if (!res)
28466 exception::throw_last_error(saved_ctx);
28467 return manage(res);
28470 isl::union_pw_multi_aff union_pw_multi_aff::apply(isl::union_pw_multi_aff upma2) const
28472 if (!ptr || upma2.is_null())
28473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28474 auto saved_ctx = ctx();
28475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28476 auto res = isl_union_pw_multi_aff_apply_union_pw_multi_aff(copy(), upma2.release());
28477 if (!res)
28478 exception::throw_last_error(saved_ctx);
28479 return manage(res);
28482 isl::multi_union_pw_aff union_pw_multi_aff::as_multi_union_pw_aff() const
28484 if (!ptr)
28485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28486 auto saved_ctx = ctx();
28487 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28488 auto res = isl_union_pw_multi_aff_as_multi_union_pw_aff(copy());
28489 if (!res)
28490 exception::throw_last_error(saved_ctx);
28491 return manage(res);
28494 isl::pw_multi_aff union_pw_multi_aff::as_pw_multi_aff() const
28496 if (!ptr)
28497 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28498 auto saved_ctx = ctx();
28499 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28500 auto res = isl_union_pw_multi_aff_as_pw_multi_aff(copy());
28501 if (!res)
28502 exception::throw_last_error(saved_ctx);
28503 return manage(res);
28506 isl::union_map union_pw_multi_aff::as_union_map() const
28508 if (!ptr)
28509 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28510 auto saved_ctx = ctx();
28511 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28512 auto res = isl_union_pw_multi_aff_as_union_map(copy());
28513 if (!res)
28514 exception::throw_last_error(saved_ctx);
28515 return manage(res);
28518 isl::union_pw_multi_aff union_pw_multi_aff::coalesce() const
28520 if (!ptr)
28521 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28522 auto saved_ctx = ctx();
28523 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28524 auto res = isl_union_pw_multi_aff_coalesce(copy());
28525 if (!res)
28526 exception::throw_last_error(saved_ctx);
28527 return manage(res);
28530 isl::union_set union_pw_multi_aff::domain() const
28532 if (!ptr)
28533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28534 auto saved_ctx = ctx();
28535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28536 auto res = isl_union_pw_multi_aff_domain(copy());
28537 if (!res)
28538 exception::throw_last_error(saved_ctx);
28539 return manage(res);
28542 isl::union_pw_multi_aff union_pw_multi_aff::drop_unused_params() const
28544 if (!ptr)
28545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28546 auto saved_ctx = ctx();
28547 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28548 auto res = isl_union_pw_multi_aff_drop_unused_params(copy());
28549 if (!res)
28550 exception::throw_last_error(saved_ctx);
28551 return manage(res);
28554 isl::union_pw_multi_aff union_pw_multi_aff::empty(isl::ctx ctx)
28556 auto saved_ctx = ctx;
28557 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28558 auto res = isl_union_pw_multi_aff_empty_ctx(ctx.release());
28559 if (!res)
28560 exception::throw_last_error(saved_ctx);
28561 return manage(res);
28564 isl::pw_multi_aff union_pw_multi_aff::extract_pw_multi_aff(isl::space space) const
28566 if (!ptr || space.is_null())
28567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28568 auto saved_ctx = ctx();
28569 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28570 auto res = isl_union_pw_multi_aff_extract_pw_multi_aff(get(), space.release());
28571 if (!res)
28572 exception::throw_last_error(saved_ctx);
28573 return manage(res);
28576 isl::union_pw_multi_aff union_pw_multi_aff::flat_range_product(isl::union_pw_multi_aff upma2) const
28578 if (!ptr || upma2.is_null())
28579 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28580 auto saved_ctx = ctx();
28581 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28582 auto res = isl_union_pw_multi_aff_flat_range_product(copy(), upma2.release());
28583 if (!res)
28584 exception::throw_last_error(saved_ctx);
28585 return manage(res);
28588 isl::union_pw_multi_aff union_pw_multi_aff::gist(isl::union_set context) const
28590 if (!ptr || context.is_null())
28591 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28592 auto saved_ctx = ctx();
28593 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28594 auto res = isl_union_pw_multi_aff_gist(copy(), context.release());
28595 if (!res)
28596 exception::throw_last_error(saved_ctx);
28597 return manage(res);
28600 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::space space) const
28602 if (!ptr || space.is_null())
28603 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28604 auto saved_ctx = ctx();
28605 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28606 auto res = isl_union_pw_multi_aff_intersect_domain_space(copy(), space.release());
28607 if (!res)
28608 exception::throw_last_error(saved_ctx);
28609 return manage(res);
28612 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::union_set uset) const
28614 if (!ptr || uset.is_null())
28615 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28616 auto saved_ctx = ctx();
28617 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28618 auto res = isl_union_pw_multi_aff_intersect_domain_union_set(copy(), uset.release());
28619 if (!res)
28620 exception::throw_last_error(saved_ctx);
28621 return manage(res);
28624 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
28626 if (!ptr || uset.is_null())
28627 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28628 auto saved_ctx = ctx();
28629 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28630 auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_domain(copy(), uset.release());
28631 if (!res)
28632 exception::throw_last_error(saved_ctx);
28633 return manage(res);
28636 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_range(isl::union_set uset) const
28638 if (!ptr || uset.is_null())
28639 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28640 auto saved_ctx = ctx();
28641 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28642 auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_range(copy(), uset.release());
28643 if (!res)
28644 exception::throw_last_error(saved_ctx);
28645 return manage(res);
28648 isl::union_pw_multi_aff union_pw_multi_aff::intersect_params(isl::set set) const
28650 if (!ptr || set.is_null())
28651 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28652 auto saved_ctx = ctx();
28653 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28654 auto res = isl_union_pw_multi_aff_intersect_params(copy(), set.release());
28655 if (!res)
28656 exception::throw_last_error(saved_ctx);
28657 return manage(res);
28660 bool union_pw_multi_aff::involves_locals() const
28662 if (!ptr)
28663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28664 auto saved_ctx = ctx();
28665 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28666 auto res = isl_union_pw_multi_aff_involves_locals(get());
28667 if (res < 0)
28668 exception::throw_last_error(saved_ctx);
28669 return res;
28672 bool union_pw_multi_aff::isa_pw_multi_aff() const
28674 if (!ptr)
28675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28676 auto saved_ctx = ctx();
28677 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28678 auto res = isl_union_pw_multi_aff_isa_pw_multi_aff(get());
28679 if (res < 0)
28680 exception::throw_last_error(saved_ctx);
28681 return res;
28684 bool union_pw_multi_aff::plain_is_empty() const
28686 if (!ptr)
28687 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28688 auto saved_ctx = ctx();
28689 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28690 auto res = isl_union_pw_multi_aff_plain_is_empty(get());
28691 if (res < 0)
28692 exception::throw_last_error(saved_ctx);
28693 return res;
28696 bool union_pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
28698 if (!ptr || upma2.is_null())
28699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28700 auto saved_ctx = ctx();
28701 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28702 auto res = isl_union_pw_multi_aff_plain_is_equal(get(), upma2.get());
28703 if (res < 0)
28704 exception::throw_last_error(saved_ctx);
28705 return res;
28708 isl::union_pw_multi_aff union_pw_multi_aff::preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const
28710 if (!ptr || upma2.is_null())
28711 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28712 auto saved_ctx = ctx();
28713 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28714 auto res = isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff(copy(), upma2.release());
28715 if (!res)
28716 exception::throw_last_error(saved_ctx);
28717 return manage(res);
28720 isl::union_pw_multi_aff union_pw_multi_aff::pullback(isl::union_pw_multi_aff upma2) const
28722 if (!ptr || upma2.is_null())
28723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28724 auto saved_ctx = ctx();
28725 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28726 auto res = isl_union_pw_multi_aff_pullback_union_pw_multi_aff(copy(), upma2.release());
28727 if (!res)
28728 exception::throw_last_error(saved_ctx);
28729 return manage(res);
28732 isl::pw_multi_aff_list union_pw_multi_aff::pw_multi_aff_list() const
28734 if (!ptr)
28735 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28736 auto saved_ctx = ctx();
28737 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28738 auto res = isl_union_pw_multi_aff_get_pw_multi_aff_list(get());
28739 if (!res)
28740 exception::throw_last_error(saved_ctx);
28741 return manage(res);
28744 isl::pw_multi_aff_list union_pw_multi_aff::get_pw_multi_aff_list() const
28746 return pw_multi_aff_list();
28749 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_domain() const
28751 if (!ptr)
28752 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28753 auto saved_ctx = ctx();
28754 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28755 auto res = isl_union_pw_multi_aff_range_factor_domain(copy());
28756 if (!res)
28757 exception::throw_last_error(saved_ctx);
28758 return manage(res);
28761 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_range() const
28763 if (!ptr)
28764 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28765 auto saved_ctx = ctx();
28766 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28767 auto res = isl_union_pw_multi_aff_range_factor_range(copy());
28768 if (!res)
28769 exception::throw_last_error(saved_ctx);
28770 return manage(res);
28773 isl::union_pw_multi_aff union_pw_multi_aff::range_product(isl::union_pw_multi_aff upma2) const
28775 if (!ptr || upma2.is_null())
28776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28777 auto saved_ctx = ctx();
28778 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28779 auto res = isl_union_pw_multi_aff_range_product(copy(), upma2.release());
28780 if (!res)
28781 exception::throw_last_error(saved_ctx);
28782 return manage(res);
28785 isl::space union_pw_multi_aff::space() const
28787 if (!ptr)
28788 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28789 auto saved_ctx = ctx();
28790 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28791 auto res = isl_union_pw_multi_aff_get_space(get());
28792 if (!res)
28793 exception::throw_last_error(saved_ctx);
28794 return manage(res);
28797 isl::space union_pw_multi_aff::get_space() const
28799 return space();
28802 isl::union_pw_multi_aff union_pw_multi_aff::sub(isl::union_pw_multi_aff upma2) const
28804 if (!ptr || upma2.is_null())
28805 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28806 auto saved_ctx = ctx();
28807 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28808 auto res = isl_union_pw_multi_aff_sub(copy(), upma2.release());
28809 if (!res)
28810 exception::throw_last_error(saved_ctx);
28811 return manage(res);
28814 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::space space) const
28816 if (!ptr || space.is_null())
28817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28818 auto saved_ctx = ctx();
28819 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28820 auto res = isl_union_pw_multi_aff_subtract_domain_space(copy(), space.release());
28821 if (!res)
28822 exception::throw_last_error(saved_ctx);
28823 return manage(res);
28826 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::union_set uset) const
28828 if (!ptr || uset.is_null())
28829 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28830 auto saved_ctx = ctx();
28831 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28832 auto res = isl_union_pw_multi_aff_subtract_domain_union_set(copy(), uset.release());
28833 if (!res)
28834 exception::throw_last_error(saved_ctx);
28835 return manage(res);
28838 isl::union_pw_multi_aff union_pw_multi_aff::union_add(isl::union_pw_multi_aff upma2) const
28840 if (!ptr || upma2.is_null())
28841 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28842 auto saved_ctx = ctx();
28843 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28844 auto res = isl_union_pw_multi_aff_union_add(copy(), upma2.release());
28845 if (!res)
28846 exception::throw_last_error(saved_ctx);
28847 return manage(res);
28850 inline std::ostream &operator<<(std::ostream &os, const union_pw_multi_aff &obj)
28852 if (!obj.get())
28853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28854 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.get());
28855 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28856 char *str = isl_union_pw_multi_aff_to_str(obj.get());
28857 if (!str)
28858 exception::throw_last_error(saved_ctx);
28859 os << str;
28860 free(str);
28861 return os;
28864 // implementations for isl::union_set
28865 union_set manage(__isl_take isl_union_set *ptr) {
28866 if (!ptr)
28867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28868 return union_set(ptr);
28870 union_set manage_copy(__isl_keep isl_union_set *ptr) {
28871 if (!ptr)
28872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28873 auto saved_ctx = isl_union_set_get_ctx(ptr);
28874 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28875 ptr = isl_union_set_copy(ptr);
28876 if (!ptr)
28877 exception::throw_last_error(saved_ctx);
28878 return union_set(ptr);
28881 union_set::union_set(__isl_take isl_union_set *ptr)
28882 : ptr(ptr) {}
28884 union_set::union_set()
28885 : ptr(nullptr) {}
28887 union_set::union_set(const union_set &obj)
28888 : ptr(nullptr)
28890 if (!obj.ptr)
28891 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28892 auto saved_ctx = isl_union_set_get_ctx(obj.ptr);
28893 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28894 ptr = obj.copy();
28895 if (!ptr)
28896 exception::throw_last_error(saved_ctx);
28899 union_set::union_set(isl::basic_set bset)
28901 if (bset.is_null())
28902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28903 auto saved_ctx = bset.ctx();
28904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28905 auto res = isl_union_set_from_basic_set(bset.release());
28906 if (!res)
28907 exception::throw_last_error(saved_ctx);
28908 ptr = res;
28911 union_set::union_set(isl::point pnt)
28913 if (pnt.is_null())
28914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28915 auto saved_ctx = pnt.ctx();
28916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28917 auto res = isl_union_set_from_point(pnt.release());
28918 if (!res)
28919 exception::throw_last_error(saved_ctx);
28920 ptr = res;
28923 union_set::union_set(isl::set set)
28925 if (set.is_null())
28926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28927 auto saved_ctx = set.ctx();
28928 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28929 auto res = isl_union_set_from_set(set.release());
28930 if (!res)
28931 exception::throw_last_error(saved_ctx);
28932 ptr = res;
28935 union_set::union_set(isl::ctx ctx, const std::string &str)
28937 auto saved_ctx = ctx;
28938 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28939 auto res = isl_union_set_read_from_str(ctx.release(), str.c_str());
28940 if (!res)
28941 exception::throw_last_error(saved_ctx);
28942 ptr = res;
28945 union_set &union_set::operator=(union_set obj) {
28946 std::swap(this->ptr, obj.ptr);
28947 return *this;
28950 union_set::~union_set() {
28951 if (ptr)
28952 isl_union_set_free(ptr);
28955 __isl_give isl_union_set *union_set::copy() const & {
28956 return isl_union_set_copy(ptr);
28959 __isl_keep isl_union_set *union_set::get() const {
28960 return ptr;
28963 __isl_give isl_union_set *union_set::release() {
28964 isl_union_set *tmp = ptr;
28965 ptr = nullptr;
28966 return tmp;
28969 bool union_set::is_null() const {
28970 return ptr == nullptr;
28973 isl::ctx union_set::ctx() const {
28974 return isl::ctx(isl_union_set_get_ctx(ptr));
28977 isl::union_set union_set::affine_hull() const
28979 if (!ptr)
28980 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28981 auto saved_ctx = ctx();
28982 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28983 auto res = isl_union_set_affine_hull(copy());
28984 if (!res)
28985 exception::throw_last_error(saved_ctx);
28986 return manage(res);
28989 isl::union_set union_set::apply(isl::union_map umap) const
28991 if (!ptr || umap.is_null())
28992 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28993 auto saved_ctx = ctx();
28994 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28995 auto res = isl_union_set_apply(copy(), umap.release());
28996 if (!res)
28997 exception::throw_last_error(saved_ctx);
28998 return manage(res);
29001 isl::set union_set::as_set() const
29003 if (!ptr)
29004 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29005 auto saved_ctx = ctx();
29006 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29007 auto res = isl_union_set_as_set(copy());
29008 if (!res)
29009 exception::throw_last_error(saved_ctx);
29010 return manage(res);
29013 isl::union_set union_set::coalesce() const
29015 if (!ptr)
29016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29017 auto saved_ctx = ctx();
29018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29019 auto res = isl_union_set_coalesce(copy());
29020 if (!res)
29021 exception::throw_last_error(saved_ctx);
29022 return manage(res);
29025 isl::union_set union_set::compute_divs() const
29027 if (!ptr)
29028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29029 auto saved_ctx = ctx();
29030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29031 auto res = isl_union_set_compute_divs(copy());
29032 if (!res)
29033 exception::throw_last_error(saved_ctx);
29034 return manage(res);
29037 isl::union_set union_set::detect_equalities() const
29039 if (!ptr)
29040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29041 auto saved_ctx = ctx();
29042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29043 auto res = isl_union_set_detect_equalities(copy());
29044 if (!res)
29045 exception::throw_last_error(saved_ctx);
29046 return manage(res);
29049 isl::union_set union_set::drop_unused_params() const
29051 if (!ptr)
29052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29053 auto saved_ctx = ctx();
29054 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29055 auto res = isl_union_set_drop_unused_params(copy());
29056 if (!res)
29057 exception::throw_last_error(saved_ctx);
29058 return manage(res);
29061 isl::union_set union_set::empty(isl::ctx ctx)
29063 auto saved_ctx = ctx;
29064 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29065 auto res = isl_union_set_empty_ctx(ctx.release());
29066 if (!res)
29067 exception::throw_last_error(saved_ctx);
29068 return manage(res);
29071 bool union_set::every_set(const std::function<bool(isl::set)> &test) const
29073 if (!ptr)
29074 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29075 auto saved_ctx = ctx();
29076 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29077 struct test_data {
29078 std::function<bool(isl::set)> func;
29079 std::exception_ptr eptr;
29080 } test_data = { test };
29081 auto test_lambda = [](isl_set *arg_0, void *arg_1) -> isl_bool {
29082 auto *data = static_cast<struct test_data *>(arg_1);
29083 ISL_CPP_TRY {
29084 auto ret = (data->func)(manage_copy(arg_0));
29085 return ret ? isl_bool_true : isl_bool_false;
29086 } ISL_CPP_CATCH_ALL {
29087 data->eptr = std::current_exception();
29088 return isl_bool_error;
29091 auto res = isl_union_set_every_set(get(), test_lambda, &test_data);
29092 if (test_data.eptr)
29093 std::rethrow_exception(test_data.eptr);
29094 if (res < 0)
29095 exception::throw_last_error(saved_ctx);
29096 return res;
29099 isl::set union_set::extract_set(isl::space space) const
29101 if (!ptr || space.is_null())
29102 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29103 auto saved_ctx = ctx();
29104 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29105 auto res = isl_union_set_extract_set(get(), space.release());
29106 if (!res)
29107 exception::throw_last_error(saved_ctx);
29108 return manage(res);
29111 void union_set::foreach_point(const std::function<void(isl::point)> &fn) const
29113 if (!ptr)
29114 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29115 auto saved_ctx = ctx();
29116 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29117 struct fn_data {
29118 std::function<void(isl::point)> func;
29119 std::exception_ptr eptr;
29120 } fn_data = { fn };
29121 auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
29122 auto *data = static_cast<struct fn_data *>(arg_1);
29123 ISL_CPP_TRY {
29124 (data->func)(manage(arg_0));
29125 return isl_stat_ok;
29126 } ISL_CPP_CATCH_ALL {
29127 data->eptr = std::current_exception();
29128 return isl_stat_error;
29131 auto res = isl_union_set_foreach_point(get(), fn_lambda, &fn_data);
29132 if (fn_data.eptr)
29133 std::rethrow_exception(fn_data.eptr);
29134 if (res < 0)
29135 exception::throw_last_error(saved_ctx);
29136 return;
29139 void union_set::foreach_set(const std::function<void(isl::set)> &fn) const
29141 if (!ptr)
29142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29143 auto saved_ctx = ctx();
29144 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29145 struct fn_data {
29146 std::function<void(isl::set)> func;
29147 std::exception_ptr eptr;
29148 } fn_data = { fn };
29149 auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
29150 auto *data = static_cast<struct fn_data *>(arg_1);
29151 ISL_CPP_TRY {
29152 (data->func)(manage(arg_0));
29153 return isl_stat_ok;
29154 } ISL_CPP_CATCH_ALL {
29155 data->eptr = std::current_exception();
29156 return isl_stat_error;
29159 auto res = isl_union_set_foreach_set(get(), fn_lambda, &fn_data);
29160 if (fn_data.eptr)
29161 std::rethrow_exception(fn_data.eptr);
29162 if (res < 0)
29163 exception::throw_last_error(saved_ctx);
29164 return;
29167 isl::union_set union_set::gist(isl::union_set context) const
29169 if (!ptr || context.is_null())
29170 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29171 auto saved_ctx = ctx();
29172 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29173 auto res = isl_union_set_gist(copy(), context.release());
29174 if (!res)
29175 exception::throw_last_error(saved_ctx);
29176 return manage(res);
29179 isl::union_set union_set::gist_params(isl::set set) const
29181 if (!ptr || set.is_null())
29182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29183 auto saved_ctx = ctx();
29184 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29185 auto res = isl_union_set_gist_params(copy(), set.release());
29186 if (!res)
29187 exception::throw_last_error(saved_ctx);
29188 return manage(res);
29191 isl::union_map union_set::identity() const
29193 if (!ptr)
29194 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29195 auto saved_ctx = ctx();
29196 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29197 auto res = isl_union_set_identity(copy());
29198 if (!res)
29199 exception::throw_last_error(saved_ctx);
29200 return manage(res);
29203 isl::union_set union_set::intersect(isl::union_set uset2) const
29205 if (!ptr || uset2.is_null())
29206 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29207 auto saved_ctx = ctx();
29208 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29209 auto res = isl_union_set_intersect(copy(), uset2.release());
29210 if (!res)
29211 exception::throw_last_error(saved_ctx);
29212 return manage(res);
29215 isl::union_set union_set::intersect_params(isl::set set) const
29217 if (!ptr || set.is_null())
29218 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29219 auto saved_ctx = ctx();
29220 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29221 auto res = isl_union_set_intersect_params(copy(), set.release());
29222 if (!res)
29223 exception::throw_last_error(saved_ctx);
29224 return manage(res);
29227 bool union_set::is_disjoint(const isl::union_set &uset2) const
29229 if (!ptr || uset2.is_null())
29230 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29231 auto saved_ctx = ctx();
29232 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29233 auto res = isl_union_set_is_disjoint(get(), uset2.get());
29234 if (res < 0)
29235 exception::throw_last_error(saved_ctx);
29236 return res;
29239 bool union_set::is_empty() const
29241 if (!ptr)
29242 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29243 auto saved_ctx = ctx();
29244 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29245 auto res = isl_union_set_is_empty(get());
29246 if (res < 0)
29247 exception::throw_last_error(saved_ctx);
29248 return res;
29251 bool union_set::is_equal(const isl::union_set &uset2) const
29253 if (!ptr || uset2.is_null())
29254 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29255 auto saved_ctx = ctx();
29256 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29257 auto res = isl_union_set_is_equal(get(), uset2.get());
29258 if (res < 0)
29259 exception::throw_last_error(saved_ctx);
29260 return res;
29263 bool union_set::is_strict_subset(const isl::union_set &uset2) const
29265 if (!ptr || uset2.is_null())
29266 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29267 auto saved_ctx = ctx();
29268 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29269 auto res = isl_union_set_is_strict_subset(get(), uset2.get());
29270 if (res < 0)
29271 exception::throw_last_error(saved_ctx);
29272 return res;
29275 bool union_set::is_subset(const isl::union_set &uset2) const
29277 if (!ptr || uset2.is_null())
29278 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29279 auto saved_ctx = ctx();
29280 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29281 auto res = isl_union_set_is_subset(get(), uset2.get());
29282 if (res < 0)
29283 exception::throw_last_error(saved_ctx);
29284 return res;
29287 bool union_set::isa_set() const
29289 if (!ptr)
29290 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29291 auto saved_ctx = ctx();
29292 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29293 auto res = isl_union_set_isa_set(get());
29294 if (res < 0)
29295 exception::throw_last_error(saved_ctx);
29296 return res;
29299 isl::union_set union_set::lexmax() const
29301 if (!ptr)
29302 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29303 auto saved_ctx = ctx();
29304 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29305 auto res = isl_union_set_lexmax(copy());
29306 if (!res)
29307 exception::throw_last_error(saved_ctx);
29308 return manage(res);
29311 isl::union_set union_set::lexmin() const
29313 if (!ptr)
29314 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29315 auto saved_ctx = ctx();
29316 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29317 auto res = isl_union_set_lexmin(copy());
29318 if (!res)
29319 exception::throw_last_error(saved_ctx);
29320 return manage(res);
29323 isl::set union_set::params() const
29325 if (!ptr)
29326 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29327 auto saved_ctx = ctx();
29328 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29329 auto res = isl_union_set_params(copy());
29330 if (!res)
29331 exception::throw_last_error(saved_ctx);
29332 return manage(res);
29335 isl::union_set union_set::polyhedral_hull() const
29337 if (!ptr)
29338 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29339 auto saved_ctx = ctx();
29340 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29341 auto res = isl_union_set_polyhedral_hull(copy());
29342 if (!res)
29343 exception::throw_last_error(saved_ctx);
29344 return manage(res);
29347 isl::union_set union_set::preimage(isl::multi_aff ma) const
29349 if (!ptr || ma.is_null())
29350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29351 auto saved_ctx = ctx();
29352 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29353 auto res = isl_union_set_preimage_multi_aff(copy(), ma.release());
29354 if (!res)
29355 exception::throw_last_error(saved_ctx);
29356 return manage(res);
29359 isl::union_set union_set::preimage(isl::pw_multi_aff pma) const
29361 if (!ptr || pma.is_null())
29362 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29363 auto saved_ctx = ctx();
29364 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29365 auto res = isl_union_set_preimage_pw_multi_aff(copy(), pma.release());
29366 if (!res)
29367 exception::throw_last_error(saved_ctx);
29368 return manage(res);
29371 isl::union_set union_set::preimage(isl::union_pw_multi_aff upma) const
29373 if (!ptr || upma.is_null())
29374 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29375 auto saved_ctx = ctx();
29376 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29377 auto res = isl_union_set_preimage_union_pw_multi_aff(copy(), upma.release());
29378 if (!res)
29379 exception::throw_last_error(saved_ctx);
29380 return manage(res);
29383 isl::union_set union_set::project_out_all_params() const
29385 if (!ptr)
29386 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29387 auto saved_ctx = ctx();
29388 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29389 auto res = isl_union_set_project_out_all_params(copy());
29390 if (!res)
29391 exception::throw_last_error(saved_ctx);
29392 return manage(res);
29395 isl::point union_set::sample_point() const
29397 if (!ptr)
29398 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29399 auto saved_ctx = ctx();
29400 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29401 auto res = isl_union_set_sample_point(copy());
29402 if (!res)
29403 exception::throw_last_error(saved_ctx);
29404 return manage(res);
29407 isl::set_list union_set::set_list() const
29409 if (!ptr)
29410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29411 auto saved_ctx = ctx();
29412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29413 auto res = isl_union_set_get_set_list(get());
29414 if (!res)
29415 exception::throw_last_error(saved_ctx);
29416 return manage(res);
29419 isl::set_list union_set::get_set_list() const
29421 return set_list();
29424 isl::space union_set::space() const
29426 if (!ptr)
29427 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29428 auto saved_ctx = ctx();
29429 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29430 auto res = isl_union_set_get_space(get());
29431 if (!res)
29432 exception::throw_last_error(saved_ctx);
29433 return manage(res);
29436 isl::space union_set::get_space() const
29438 return space();
29441 isl::union_set union_set::subtract(isl::union_set uset2) const
29443 if (!ptr || uset2.is_null())
29444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29445 auto saved_ctx = ctx();
29446 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29447 auto res = isl_union_set_subtract(copy(), uset2.release());
29448 if (!res)
29449 exception::throw_last_error(saved_ctx);
29450 return manage(res);
29453 isl::union_set_list union_set::to_list() const
29455 if (!ptr)
29456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29457 auto saved_ctx = ctx();
29458 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29459 auto res = isl_union_set_to_list(copy());
29460 if (!res)
29461 exception::throw_last_error(saved_ctx);
29462 return manage(res);
29465 isl::union_set union_set::unite(isl::union_set uset2) const
29467 if (!ptr || uset2.is_null())
29468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29469 auto saved_ctx = ctx();
29470 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29471 auto res = isl_union_set_union(copy(), uset2.release());
29472 if (!res)
29473 exception::throw_last_error(saved_ctx);
29474 return manage(res);
29477 isl::union_set union_set::universe() const
29479 if (!ptr)
29480 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29481 auto saved_ctx = ctx();
29482 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29483 auto res = isl_union_set_universe(copy());
29484 if (!res)
29485 exception::throw_last_error(saved_ctx);
29486 return manage(res);
29489 isl::union_map union_set::unwrap() const
29491 if (!ptr)
29492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29493 auto saved_ctx = ctx();
29494 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29495 auto res = isl_union_set_unwrap(copy());
29496 if (!res)
29497 exception::throw_last_error(saved_ctx);
29498 return manage(res);
29501 inline std::ostream &operator<<(std::ostream &os, const union_set &obj)
29503 if (!obj.get())
29504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29505 auto saved_ctx = isl_union_set_get_ctx(obj.get());
29506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29507 char *str = isl_union_set_to_str(obj.get());
29508 if (!str)
29509 exception::throw_last_error(saved_ctx);
29510 os << str;
29511 free(str);
29512 return os;
29515 // implementations for isl::union_set_list
29516 union_set_list manage(__isl_take isl_union_set_list *ptr) {
29517 if (!ptr)
29518 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29519 return union_set_list(ptr);
29521 union_set_list manage_copy(__isl_keep isl_union_set_list *ptr) {
29522 if (!ptr)
29523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29524 auto saved_ctx = isl_union_set_list_get_ctx(ptr);
29525 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29526 ptr = isl_union_set_list_copy(ptr);
29527 if (!ptr)
29528 exception::throw_last_error(saved_ctx);
29529 return union_set_list(ptr);
29532 union_set_list::union_set_list(__isl_take isl_union_set_list *ptr)
29533 : ptr(ptr) {}
29535 union_set_list::union_set_list()
29536 : ptr(nullptr) {}
29538 union_set_list::union_set_list(const union_set_list &obj)
29539 : ptr(nullptr)
29541 if (!obj.ptr)
29542 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29543 auto saved_ctx = isl_union_set_list_get_ctx(obj.ptr);
29544 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29545 ptr = obj.copy();
29546 if (!ptr)
29547 exception::throw_last_error(saved_ctx);
29550 union_set_list::union_set_list(isl::ctx ctx, int n)
29552 auto saved_ctx = ctx;
29553 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29554 auto res = isl_union_set_list_alloc(ctx.release(), n);
29555 if (!res)
29556 exception::throw_last_error(saved_ctx);
29557 ptr = res;
29560 union_set_list::union_set_list(isl::union_set el)
29562 if (el.is_null())
29563 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29564 auto saved_ctx = el.ctx();
29565 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29566 auto res = isl_union_set_list_from_union_set(el.release());
29567 if (!res)
29568 exception::throw_last_error(saved_ctx);
29569 ptr = res;
29572 union_set_list::union_set_list(isl::ctx ctx, const std::string &str)
29574 auto saved_ctx = ctx;
29575 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29576 auto res = isl_union_set_list_read_from_str(ctx.release(), str.c_str());
29577 if (!res)
29578 exception::throw_last_error(saved_ctx);
29579 ptr = res;
29582 union_set_list &union_set_list::operator=(union_set_list obj) {
29583 std::swap(this->ptr, obj.ptr);
29584 return *this;
29587 union_set_list::~union_set_list() {
29588 if (ptr)
29589 isl_union_set_list_free(ptr);
29592 __isl_give isl_union_set_list *union_set_list::copy() const & {
29593 return isl_union_set_list_copy(ptr);
29596 __isl_keep isl_union_set_list *union_set_list::get() const {
29597 return ptr;
29600 __isl_give isl_union_set_list *union_set_list::release() {
29601 isl_union_set_list *tmp = ptr;
29602 ptr = nullptr;
29603 return tmp;
29606 bool union_set_list::is_null() const {
29607 return ptr == nullptr;
29610 isl::ctx union_set_list::ctx() const {
29611 return isl::ctx(isl_union_set_list_get_ctx(ptr));
29614 isl::union_set_list union_set_list::add(isl::union_set el) const
29616 if (!ptr || el.is_null())
29617 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29618 auto saved_ctx = ctx();
29619 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29620 auto res = isl_union_set_list_add(copy(), el.release());
29621 if (!res)
29622 exception::throw_last_error(saved_ctx);
29623 return manage(res);
29626 isl::union_set union_set_list::at(int index) const
29628 if (!ptr)
29629 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29630 auto saved_ctx = ctx();
29631 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29632 auto res = isl_union_set_list_get_at(get(), index);
29633 if (!res)
29634 exception::throw_last_error(saved_ctx);
29635 return manage(res);
29638 isl::union_set union_set_list::get_at(int index) const
29640 return at(index);
29643 isl::union_set_list union_set_list::clear() const
29645 if (!ptr)
29646 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29647 auto saved_ctx = ctx();
29648 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29649 auto res = isl_union_set_list_clear(copy());
29650 if (!res)
29651 exception::throw_last_error(saved_ctx);
29652 return manage(res);
29655 isl::union_set_list union_set_list::concat(isl::union_set_list list2) const
29657 if (!ptr || list2.is_null())
29658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29659 auto saved_ctx = ctx();
29660 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29661 auto res = isl_union_set_list_concat(copy(), list2.release());
29662 if (!res)
29663 exception::throw_last_error(saved_ctx);
29664 return manage(res);
29667 isl::union_set_list union_set_list::drop(unsigned int first, unsigned int n) const
29669 if (!ptr)
29670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29671 auto saved_ctx = ctx();
29672 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29673 auto res = isl_union_set_list_drop(copy(), first, n);
29674 if (!res)
29675 exception::throw_last_error(saved_ctx);
29676 return manage(res);
29679 void union_set_list::foreach(const std::function<void(isl::union_set)> &fn) const
29681 if (!ptr)
29682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29683 auto saved_ctx = ctx();
29684 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29685 struct fn_data {
29686 std::function<void(isl::union_set)> func;
29687 std::exception_ptr eptr;
29688 } fn_data = { fn };
29689 auto fn_lambda = [](isl_union_set *arg_0, void *arg_1) -> isl_stat {
29690 auto *data = static_cast<struct fn_data *>(arg_1);
29691 ISL_CPP_TRY {
29692 (data->func)(manage(arg_0));
29693 return isl_stat_ok;
29694 } ISL_CPP_CATCH_ALL {
29695 data->eptr = std::current_exception();
29696 return isl_stat_error;
29699 auto res = isl_union_set_list_foreach(get(), fn_lambda, &fn_data);
29700 if (fn_data.eptr)
29701 std::rethrow_exception(fn_data.eptr);
29702 if (res < 0)
29703 exception::throw_last_error(saved_ctx);
29704 return;
29707 void union_set_list::foreach_scc(const std::function<bool(isl::union_set, isl::union_set)> &follows, const std::function<void(isl::union_set_list)> &fn) const
29709 if (!ptr)
29710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29711 auto saved_ctx = ctx();
29712 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29713 struct follows_data {
29714 std::function<bool(isl::union_set, isl::union_set)> func;
29715 std::exception_ptr eptr;
29716 } follows_data = { follows };
29717 auto follows_lambda = [](isl_union_set *arg_0, isl_union_set *arg_1, void *arg_2) -> isl_bool {
29718 auto *data = static_cast<struct follows_data *>(arg_2);
29719 ISL_CPP_TRY {
29720 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
29721 return ret ? isl_bool_true : isl_bool_false;
29722 } ISL_CPP_CATCH_ALL {
29723 data->eptr = std::current_exception();
29724 return isl_bool_error;
29727 struct fn_data {
29728 std::function<void(isl::union_set_list)> func;
29729 std::exception_ptr eptr;
29730 } fn_data = { fn };
29731 auto fn_lambda = [](isl_union_set_list *arg_0, void *arg_1) -> isl_stat {
29732 auto *data = static_cast<struct fn_data *>(arg_1);
29733 ISL_CPP_TRY {
29734 (data->func)(manage(arg_0));
29735 return isl_stat_ok;
29736 } ISL_CPP_CATCH_ALL {
29737 data->eptr = std::current_exception();
29738 return isl_stat_error;
29741 auto res = isl_union_set_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
29742 if (follows_data.eptr)
29743 std::rethrow_exception(follows_data.eptr);
29744 if (fn_data.eptr)
29745 std::rethrow_exception(fn_data.eptr);
29746 if (res < 0)
29747 exception::throw_last_error(saved_ctx);
29748 return;
29751 isl::union_set_list union_set_list::insert(unsigned int pos, isl::union_set el) const
29753 if (!ptr || el.is_null())
29754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29755 auto saved_ctx = ctx();
29756 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29757 auto res = isl_union_set_list_insert(copy(), pos, el.release());
29758 if (!res)
29759 exception::throw_last_error(saved_ctx);
29760 return manage(res);
29763 isl::union_set_list union_set_list::set_at(int index, isl::union_set el) const
29765 if (!ptr || el.is_null())
29766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29767 auto saved_ctx = ctx();
29768 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29769 auto res = isl_union_set_list_set_at(copy(), index, el.release());
29770 if (!res)
29771 exception::throw_last_error(saved_ctx);
29772 return manage(res);
29775 unsigned union_set_list::size() const
29777 if (!ptr)
29778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29779 auto saved_ctx = ctx();
29780 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29781 auto res = isl_union_set_list_size(get());
29782 if (res < 0)
29783 exception::throw_last_error(saved_ctx);
29784 return res;
29787 inline std::ostream &operator<<(std::ostream &os, const union_set_list &obj)
29789 if (!obj.get())
29790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29791 auto saved_ctx = isl_union_set_list_get_ctx(obj.get());
29792 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29793 char *str = isl_union_set_list_to_str(obj.get());
29794 if (!str)
29795 exception::throw_last_error(saved_ctx);
29796 os << str;
29797 free(str);
29798 return os;
29801 // implementations for isl::val
29802 val manage(__isl_take isl_val *ptr) {
29803 if (!ptr)
29804 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29805 return val(ptr);
29807 val manage_copy(__isl_keep isl_val *ptr) {
29808 if (!ptr)
29809 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29810 auto saved_ctx = isl_val_get_ctx(ptr);
29811 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29812 ptr = isl_val_copy(ptr);
29813 if (!ptr)
29814 exception::throw_last_error(saved_ctx);
29815 return val(ptr);
29818 val::val(__isl_take isl_val *ptr)
29819 : ptr(ptr) {}
29821 val::val()
29822 : ptr(nullptr) {}
29824 val::val(const val &obj)
29825 : ptr(nullptr)
29827 if (!obj.ptr)
29828 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29829 auto saved_ctx = isl_val_get_ctx(obj.ptr);
29830 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29831 ptr = obj.copy();
29832 if (!ptr)
29833 exception::throw_last_error(saved_ctx);
29836 val::val(isl::ctx ctx, long i)
29838 auto saved_ctx = ctx;
29839 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29840 auto res = isl_val_int_from_si(ctx.release(), i);
29841 if (!res)
29842 exception::throw_last_error(saved_ctx);
29843 ptr = res;
29846 val::val(isl::ctx ctx, const std::string &str)
29848 auto saved_ctx = ctx;
29849 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29850 auto res = isl_val_read_from_str(ctx.release(), str.c_str());
29851 if (!res)
29852 exception::throw_last_error(saved_ctx);
29853 ptr = res;
29856 val &val::operator=(val obj) {
29857 std::swap(this->ptr, obj.ptr);
29858 return *this;
29861 val::~val() {
29862 if (ptr)
29863 isl_val_free(ptr);
29866 __isl_give isl_val *val::copy() const & {
29867 return isl_val_copy(ptr);
29870 __isl_keep isl_val *val::get() const {
29871 return ptr;
29874 __isl_give isl_val *val::release() {
29875 isl_val *tmp = ptr;
29876 ptr = nullptr;
29877 return tmp;
29880 bool val::is_null() const {
29881 return ptr == nullptr;
29884 isl::ctx val::ctx() const {
29885 return isl::ctx(isl_val_get_ctx(ptr));
29888 isl::val val::abs() const
29890 if (!ptr)
29891 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29892 auto saved_ctx = ctx();
29893 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29894 auto res = isl_val_abs(copy());
29895 if (!res)
29896 exception::throw_last_error(saved_ctx);
29897 return manage(res);
29900 bool val::abs_eq(const isl::val &v2) const
29902 if (!ptr || v2.is_null())
29903 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29904 auto saved_ctx = ctx();
29905 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29906 auto res = isl_val_abs_eq(get(), v2.get());
29907 if (res < 0)
29908 exception::throw_last_error(saved_ctx);
29909 return res;
29912 bool val::abs_eq(long v2) const
29914 if (!ptr)
29915 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29916 return this->abs_eq(isl::val(ctx(), v2));
29919 isl::val val::add(isl::val v2) const
29921 if (!ptr || v2.is_null())
29922 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29923 auto saved_ctx = ctx();
29924 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29925 auto res = isl_val_add(copy(), v2.release());
29926 if (!res)
29927 exception::throw_last_error(saved_ctx);
29928 return manage(res);
29931 isl::val val::add(long v2) const
29933 if (!ptr)
29934 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29935 return this->add(isl::val(ctx(), v2));
29938 isl::val val::ceil() const
29940 if (!ptr)
29941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29942 auto saved_ctx = ctx();
29943 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29944 auto res = isl_val_ceil(copy());
29945 if (!res)
29946 exception::throw_last_error(saved_ctx);
29947 return manage(res);
29950 int val::cmp_si(long i) const
29952 if (!ptr)
29953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29954 auto saved_ctx = ctx();
29955 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29956 auto res = isl_val_cmp_si(get(), i);
29957 return res;
29960 long val::den_si() const
29962 if (!ptr)
29963 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29964 auto saved_ctx = ctx();
29965 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29966 auto res = isl_val_get_den_si(get());
29967 return res;
29970 long val::get_den_si() const
29972 return den_si();
29975 isl::val val::div(isl::val v2) const
29977 if (!ptr || v2.is_null())
29978 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29979 auto saved_ctx = ctx();
29980 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29981 auto res = isl_val_div(copy(), v2.release());
29982 if (!res)
29983 exception::throw_last_error(saved_ctx);
29984 return manage(res);
29987 isl::val val::div(long v2) const
29989 if (!ptr)
29990 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29991 return this->div(isl::val(ctx(), v2));
29994 bool val::eq(const isl::val &v2) const
29996 if (!ptr || v2.is_null())
29997 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29998 auto saved_ctx = ctx();
29999 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30000 auto res = isl_val_eq(get(), v2.get());
30001 if (res < 0)
30002 exception::throw_last_error(saved_ctx);
30003 return res;
30006 bool val::eq(long v2) const
30008 if (!ptr)
30009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30010 return this->eq(isl::val(ctx(), v2));
30013 isl::val val::floor() const
30015 if (!ptr)
30016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30017 auto saved_ctx = ctx();
30018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30019 auto res = isl_val_floor(copy());
30020 if (!res)
30021 exception::throw_last_error(saved_ctx);
30022 return manage(res);
30025 isl::val val::gcd(isl::val v2) const
30027 if (!ptr || v2.is_null())
30028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30029 auto saved_ctx = ctx();
30030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30031 auto res = isl_val_gcd(copy(), v2.release());
30032 if (!res)
30033 exception::throw_last_error(saved_ctx);
30034 return manage(res);
30037 isl::val val::gcd(long v2) const
30039 if (!ptr)
30040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30041 return this->gcd(isl::val(ctx(), v2));
30044 bool val::ge(const isl::val &v2) const
30046 if (!ptr || v2.is_null())
30047 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30048 auto saved_ctx = ctx();
30049 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30050 auto res = isl_val_ge(get(), v2.get());
30051 if (res < 0)
30052 exception::throw_last_error(saved_ctx);
30053 return res;
30056 bool val::ge(long v2) const
30058 if (!ptr)
30059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30060 return this->ge(isl::val(ctx(), v2));
30063 bool val::gt(const isl::val &v2) const
30065 if (!ptr || v2.is_null())
30066 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30067 auto saved_ctx = ctx();
30068 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30069 auto res = isl_val_gt(get(), v2.get());
30070 if (res < 0)
30071 exception::throw_last_error(saved_ctx);
30072 return res;
30075 bool val::gt(long v2) const
30077 if (!ptr)
30078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30079 return this->gt(isl::val(ctx(), v2));
30082 isl::val val::infty(isl::ctx ctx)
30084 auto saved_ctx = ctx;
30085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30086 auto res = isl_val_infty(ctx.release());
30087 if (!res)
30088 exception::throw_last_error(saved_ctx);
30089 return manage(res);
30092 isl::val val::inv() const
30094 if (!ptr)
30095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30096 auto saved_ctx = ctx();
30097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30098 auto res = isl_val_inv(copy());
30099 if (!res)
30100 exception::throw_last_error(saved_ctx);
30101 return manage(res);
30104 bool val::is_divisible_by(const isl::val &v2) const
30106 if (!ptr || v2.is_null())
30107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30108 auto saved_ctx = ctx();
30109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30110 auto res = isl_val_is_divisible_by(get(), v2.get());
30111 if (res < 0)
30112 exception::throw_last_error(saved_ctx);
30113 return res;
30116 bool val::is_divisible_by(long v2) const
30118 if (!ptr)
30119 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30120 return this->is_divisible_by(isl::val(ctx(), v2));
30123 bool val::is_infty() const
30125 if (!ptr)
30126 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30127 auto saved_ctx = ctx();
30128 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30129 auto res = isl_val_is_infty(get());
30130 if (res < 0)
30131 exception::throw_last_error(saved_ctx);
30132 return res;
30135 bool val::is_int() const
30137 if (!ptr)
30138 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30139 auto saved_ctx = ctx();
30140 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30141 auto res = isl_val_is_int(get());
30142 if (res < 0)
30143 exception::throw_last_error(saved_ctx);
30144 return res;
30147 bool val::is_nan() const
30149 if (!ptr)
30150 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30151 auto saved_ctx = ctx();
30152 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30153 auto res = isl_val_is_nan(get());
30154 if (res < 0)
30155 exception::throw_last_error(saved_ctx);
30156 return res;
30159 bool val::is_neg() const
30161 if (!ptr)
30162 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30163 auto saved_ctx = ctx();
30164 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30165 auto res = isl_val_is_neg(get());
30166 if (res < 0)
30167 exception::throw_last_error(saved_ctx);
30168 return res;
30171 bool val::is_neginfty() const
30173 if (!ptr)
30174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30175 auto saved_ctx = ctx();
30176 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30177 auto res = isl_val_is_neginfty(get());
30178 if (res < 0)
30179 exception::throw_last_error(saved_ctx);
30180 return res;
30183 bool val::is_negone() const
30185 if (!ptr)
30186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30187 auto saved_ctx = ctx();
30188 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30189 auto res = isl_val_is_negone(get());
30190 if (res < 0)
30191 exception::throw_last_error(saved_ctx);
30192 return res;
30195 bool val::is_nonneg() const
30197 if (!ptr)
30198 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30199 auto saved_ctx = ctx();
30200 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30201 auto res = isl_val_is_nonneg(get());
30202 if (res < 0)
30203 exception::throw_last_error(saved_ctx);
30204 return res;
30207 bool val::is_nonpos() const
30209 if (!ptr)
30210 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30211 auto saved_ctx = ctx();
30212 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30213 auto res = isl_val_is_nonpos(get());
30214 if (res < 0)
30215 exception::throw_last_error(saved_ctx);
30216 return res;
30219 bool val::is_one() const
30221 if (!ptr)
30222 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30223 auto saved_ctx = ctx();
30224 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30225 auto res = isl_val_is_one(get());
30226 if (res < 0)
30227 exception::throw_last_error(saved_ctx);
30228 return res;
30231 bool val::is_pos() const
30233 if (!ptr)
30234 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30235 auto saved_ctx = ctx();
30236 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30237 auto res = isl_val_is_pos(get());
30238 if (res < 0)
30239 exception::throw_last_error(saved_ctx);
30240 return res;
30243 bool val::is_rat() const
30245 if (!ptr)
30246 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30247 auto saved_ctx = ctx();
30248 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30249 auto res = isl_val_is_rat(get());
30250 if (res < 0)
30251 exception::throw_last_error(saved_ctx);
30252 return res;
30255 bool val::is_zero() const
30257 if (!ptr)
30258 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30259 auto saved_ctx = ctx();
30260 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30261 auto res = isl_val_is_zero(get());
30262 if (res < 0)
30263 exception::throw_last_error(saved_ctx);
30264 return res;
30267 bool val::le(const isl::val &v2) const
30269 if (!ptr || v2.is_null())
30270 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30271 auto saved_ctx = ctx();
30272 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30273 auto res = isl_val_le(get(), v2.get());
30274 if (res < 0)
30275 exception::throw_last_error(saved_ctx);
30276 return res;
30279 bool val::le(long v2) const
30281 if (!ptr)
30282 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30283 return this->le(isl::val(ctx(), v2));
30286 bool val::lt(const isl::val &v2) const
30288 if (!ptr || v2.is_null())
30289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30290 auto saved_ctx = ctx();
30291 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30292 auto res = isl_val_lt(get(), v2.get());
30293 if (res < 0)
30294 exception::throw_last_error(saved_ctx);
30295 return res;
30298 bool val::lt(long v2) const
30300 if (!ptr)
30301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30302 return this->lt(isl::val(ctx(), v2));
30305 isl::val val::max(isl::val v2) const
30307 if (!ptr || v2.is_null())
30308 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30309 auto saved_ctx = ctx();
30310 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30311 auto res = isl_val_max(copy(), v2.release());
30312 if (!res)
30313 exception::throw_last_error(saved_ctx);
30314 return manage(res);
30317 isl::val val::max(long v2) const
30319 if (!ptr)
30320 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30321 return this->max(isl::val(ctx(), v2));
30324 isl::val val::min(isl::val v2) const
30326 if (!ptr || v2.is_null())
30327 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30328 auto saved_ctx = ctx();
30329 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30330 auto res = isl_val_min(copy(), v2.release());
30331 if (!res)
30332 exception::throw_last_error(saved_ctx);
30333 return manage(res);
30336 isl::val val::min(long v2) const
30338 if (!ptr)
30339 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30340 return this->min(isl::val(ctx(), v2));
30343 isl::val val::mod(isl::val v2) const
30345 if (!ptr || v2.is_null())
30346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30347 auto saved_ctx = ctx();
30348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30349 auto res = isl_val_mod(copy(), v2.release());
30350 if (!res)
30351 exception::throw_last_error(saved_ctx);
30352 return manage(res);
30355 isl::val val::mod(long v2) const
30357 if (!ptr)
30358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30359 return this->mod(isl::val(ctx(), v2));
30362 isl::val val::mul(isl::val v2) const
30364 if (!ptr || v2.is_null())
30365 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30366 auto saved_ctx = ctx();
30367 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30368 auto res = isl_val_mul(copy(), v2.release());
30369 if (!res)
30370 exception::throw_last_error(saved_ctx);
30371 return manage(res);
30374 isl::val val::mul(long v2) const
30376 if (!ptr)
30377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30378 return this->mul(isl::val(ctx(), v2));
30381 isl::val val::nan(isl::ctx ctx)
30383 auto saved_ctx = ctx;
30384 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30385 auto res = isl_val_nan(ctx.release());
30386 if (!res)
30387 exception::throw_last_error(saved_ctx);
30388 return manage(res);
30391 bool val::ne(const isl::val &v2) const
30393 if (!ptr || v2.is_null())
30394 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30395 auto saved_ctx = ctx();
30396 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30397 auto res = isl_val_ne(get(), v2.get());
30398 if (res < 0)
30399 exception::throw_last_error(saved_ctx);
30400 return res;
30403 bool val::ne(long v2) const
30405 if (!ptr)
30406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30407 return this->ne(isl::val(ctx(), v2));
30410 isl::val val::neg() const
30412 if (!ptr)
30413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30414 auto saved_ctx = ctx();
30415 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30416 auto res = isl_val_neg(copy());
30417 if (!res)
30418 exception::throw_last_error(saved_ctx);
30419 return manage(res);
30422 isl::val val::neginfty(isl::ctx ctx)
30424 auto saved_ctx = ctx;
30425 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30426 auto res = isl_val_neginfty(ctx.release());
30427 if (!res)
30428 exception::throw_last_error(saved_ctx);
30429 return manage(res);
30432 isl::val val::negone(isl::ctx ctx)
30434 auto saved_ctx = ctx;
30435 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30436 auto res = isl_val_negone(ctx.release());
30437 if (!res)
30438 exception::throw_last_error(saved_ctx);
30439 return manage(res);
30442 long val::num_si() const
30444 if (!ptr)
30445 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30446 auto saved_ctx = ctx();
30447 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30448 auto res = isl_val_get_num_si(get());
30449 return res;
30452 long val::get_num_si() const
30454 return num_si();
30457 isl::val val::one(isl::ctx ctx)
30459 auto saved_ctx = ctx;
30460 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30461 auto res = isl_val_one(ctx.release());
30462 if (!res)
30463 exception::throw_last_error(saved_ctx);
30464 return manage(res);
30467 isl::val val::pow2() const
30469 if (!ptr)
30470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30471 auto saved_ctx = ctx();
30472 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30473 auto res = isl_val_pow2(copy());
30474 if (!res)
30475 exception::throw_last_error(saved_ctx);
30476 return manage(res);
30479 int val::sgn() const
30481 if (!ptr)
30482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30483 auto saved_ctx = ctx();
30484 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30485 auto res = isl_val_sgn(get());
30486 return res;
30489 isl::val val::sub(isl::val v2) const
30491 if (!ptr || v2.is_null())
30492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30493 auto saved_ctx = ctx();
30494 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30495 auto res = isl_val_sub(copy(), v2.release());
30496 if (!res)
30497 exception::throw_last_error(saved_ctx);
30498 return manage(res);
30501 isl::val val::sub(long v2) const
30503 if (!ptr)
30504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30505 return this->sub(isl::val(ctx(), v2));
30508 isl::val_list val::to_list() const
30510 if (!ptr)
30511 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30512 auto saved_ctx = ctx();
30513 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30514 auto res = isl_val_to_list(copy());
30515 if (!res)
30516 exception::throw_last_error(saved_ctx);
30517 return manage(res);
30520 isl::val val::trunc() const
30522 if (!ptr)
30523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30524 auto saved_ctx = ctx();
30525 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30526 auto res = isl_val_trunc(copy());
30527 if (!res)
30528 exception::throw_last_error(saved_ctx);
30529 return manage(res);
30532 isl::val val::zero(isl::ctx ctx)
30534 auto saved_ctx = ctx;
30535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30536 auto res = isl_val_zero(ctx.release());
30537 if (!res)
30538 exception::throw_last_error(saved_ctx);
30539 return manage(res);
30542 inline std::ostream &operator<<(std::ostream &os, const val &obj)
30544 if (!obj.get())
30545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30546 auto saved_ctx = isl_val_get_ctx(obj.get());
30547 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30548 char *str = isl_val_to_str(obj.get());
30549 if (!str)
30550 exception::throw_last_error(saved_ctx);
30551 os << str;
30552 free(str);
30553 return os;
30556 // implementations for isl::val_list
30557 val_list manage(__isl_take isl_val_list *ptr) {
30558 if (!ptr)
30559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30560 return val_list(ptr);
30562 val_list manage_copy(__isl_keep isl_val_list *ptr) {
30563 if (!ptr)
30564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30565 auto saved_ctx = isl_val_list_get_ctx(ptr);
30566 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30567 ptr = isl_val_list_copy(ptr);
30568 if (!ptr)
30569 exception::throw_last_error(saved_ctx);
30570 return val_list(ptr);
30573 val_list::val_list(__isl_take isl_val_list *ptr)
30574 : ptr(ptr) {}
30576 val_list::val_list()
30577 : ptr(nullptr) {}
30579 val_list::val_list(const val_list &obj)
30580 : ptr(nullptr)
30582 if (!obj.ptr)
30583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30584 auto saved_ctx = isl_val_list_get_ctx(obj.ptr);
30585 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30586 ptr = obj.copy();
30587 if (!ptr)
30588 exception::throw_last_error(saved_ctx);
30591 val_list::val_list(isl::ctx ctx, int n)
30593 auto saved_ctx = ctx;
30594 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30595 auto res = isl_val_list_alloc(ctx.release(), n);
30596 if (!res)
30597 exception::throw_last_error(saved_ctx);
30598 ptr = res;
30601 val_list::val_list(isl::val el)
30603 if (el.is_null())
30604 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30605 auto saved_ctx = el.ctx();
30606 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30607 auto res = isl_val_list_from_val(el.release());
30608 if (!res)
30609 exception::throw_last_error(saved_ctx);
30610 ptr = res;
30613 val_list::val_list(isl::ctx ctx, const std::string &str)
30615 auto saved_ctx = ctx;
30616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30617 auto res = isl_val_list_read_from_str(ctx.release(), str.c_str());
30618 if (!res)
30619 exception::throw_last_error(saved_ctx);
30620 ptr = res;
30623 val_list &val_list::operator=(val_list obj) {
30624 std::swap(this->ptr, obj.ptr);
30625 return *this;
30628 val_list::~val_list() {
30629 if (ptr)
30630 isl_val_list_free(ptr);
30633 __isl_give isl_val_list *val_list::copy() const & {
30634 return isl_val_list_copy(ptr);
30637 __isl_keep isl_val_list *val_list::get() const {
30638 return ptr;
30641 __isl_give isl_val_list *val_list::release() {
30642 isl_val_list *tmp = ptr;
30643 ptr = nullptr;
30644 return tmp;
30647 bool val_list::is_null() const {
30648 return ptr == nullptr;
30651 isl::ctx val_list::ctx() const {
30652 return isl::ctx(isl_val_list_get_ctx(ptr));
30655 isl::val_list val_list::add(isl::val el) const
30657 if (!ptr || el.is_null())
30658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30659 auto saved_ctx = ctx();
30660 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30661 auto res = isl_val_list_add(copy(), el.release());
30662 if (!res)
30663 exception::throw_last_error(saved_ctx);
30664 return manage(res);
30667 isl::val_list val_list::add(long el) const
30669 if (!ptr)
30670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30671 return this->add(isl::val(ctx(), el));
30674 isl::val val_list::at(int index) const
30676 if (!ptr)
30677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30678 auto saved_ctx = ctx();
30679 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30680 auto res = isl_val_list_get_at(get(), index);
30681 if (!res)
30682 exception::throw_last_error(saved_ctx);
30683 return manage(res);
30686 isl::val val_list::get_at(int index) const
30688 return at(index);
30691 isl::val_list val_list::clear() const
30693 if (!ptr)
30694 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30695 auto saved_ctx = ctx();
30696 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30697 auto res = isl_val_list_clear(copy());
30698 if (!res)
30699 exception::throw_last_error(saved_ctx);
30700 return manage(res);
30703 isl::val_list val_list::concat(isl::val_list list2) const
30705 if (!ptr || list2.is_null())
30706 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30707 auto saved_ctx = ctx();
30708 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30709 auto res = isl_val_list_concat(copy(), list2.release());
30710 if (!res)
30711 exception::throw_last_error(saved_ctx);
30712 return manage(res);
30715 isl::val_list val_list::drop(unsigned int first, unsigned int n) const
30717 if (!ptr)
30718 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30719 auto saved_ctx = ctx();
30720 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30721 auto res = isl_val_list_drop(copy(), first, n);
30722 if (!res)
30723 exception::throw_last_error(saved_ctx);
30724 return manage(res);
30727 void val_list::foreach(const std::function<void(isl::val)> &fn) const
30729 if (!ptr)
30730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30731 auto saved_ctx = ctx();
30732 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30733 struct fn_data {
30734 std::function<void(isl::val)> func;
30735 std::exception_ptr eptr;
30736 } fn_data = { fn };
30737 auto fn_lambda = [](isl_val *arg_0, void *arg_1) -> isl_stat {
30738 auto *data = static_cast<struct fn_data *>(arg_1);
30739 ISL_CPP_TRY {
30740 (data->func)(manage(arg_0));
30741 return isl_stat_ok;
30742 } ISL_CPP_CATCH_ALL {
30743 data->eptr = std::current_exception();
30744 return isl_stat_error;
30747 auto res = isl_val_list_foreach(get(), fn_lambda, &fn_data);
30748 if (fn_data.eptr)
30749 std::rethrow_exception(fn_data.eptr);
30750 if (res < 0)
30751 exception::throw_last_error(saved_ctx);
30752 return;
30755 void val_list::foreach_scc(const std::function<bool(isl::val, isl::val)> &follows, const std::function<void(isl::val_list)> &fn) const
30757 if (!ptr)
30758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30759 auto saved_ctx = ctx();
30760 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30761 struct follows_data {
30762 std::function<bool(isl::val, isl::val)> func;
30763 std::exception_ptr eptr;
30764 } follows_data = { follows };
30765 auto follows_lambda = [](isl_val *arg_0, isl_val *arg_1, void *arg_2) -> isl_bool {
30766 auto *data = static_cast<struct follows_data *>(arg_2);
30767 ISL_CPP_TRY {
30768 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
30769 return ret ? isl_bool_true : isl_bool_false;
30770 } ISL_CPP_CATCH_ALL {
30771 data->eptr = std::current_exception();
30772 return isl_bool_error;
30775 struct fn_data {
30776 std::function<void(isl::val_list)> func;
30777 std::exception_ptr eptr;
30778 } fn_data = { fn };
30779 auto fn_lambda = [](isl_val_list *arg_0, void *arg_1) -> isl_stat {
30780 auto *data = static_cast<struct fn_data *>(arg_1);
30781 ISL_CPP_TRY {
30782 (data->func)(manage(arg_0));
30783 return isl_stat_ok;
30784 } ISL_CPP_CATCH_ALL {
30785 data->eptr = std::current_exception();
30786 return isl_stat_error;
30789 auto res = isl_val_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
30790 if (follows_data.eptr)
30791 std::rethrow_exception(follows_data.eptr);
30792 if (fn_data.eptr)
30793 std::rethrow_exception(fn_data.eptr);
30794 if (res < 0)
30795 exception::throw_last_error(saved_ctx);
30796 return;
30799 isl::val_list val_list::insert(unsigned int pos, isl::val el) const
30801 if (!ptr || el.is_null())
30802 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30803 auto saved_ctx = ctx();
30804 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30805 auto res = isl_val_list_insert(copy(), pos, el.release());
30806 if (!res)
30807 exception::throw_last_error(saved_ctx);
30808 return manage(res);
30811 isl::val_list val_list::insert(unsigned int pos, long el) const
30813 if (!ptr)
30814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30815 return this->insert(pos, isl::val(ctx(), el));
30818 isl::val_list val_list::set_at(int index, isl::val el) const
30820 if (!ptr || el.is_null())
30821 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30822 auto saved_ctx = ctx();
30823 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30824 auto res = isl_val_list_set_at(copy(), index, el.release());
30825 if (!res)
30826 exception::throw_last_error(saved_ctx);
30827 return manage(res);
30830 isl::val_list val_list::set_at(int index, long el) const
30832 if (!ptr)
30833 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30834 return this->set_at(index, isl::val(ctx(), el));
30837 unsigned val_list::size() const
30839 if (!ptr)
30840 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30841 auto saved_ctx = ctx();
30842 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30843 auto res = isl_val_list_size(get());
30844 if (res < 0)
30845 exception::throw_last_error(saved_ctx);
30846 return res;
30849 inline std::ostream &operator<<(std::ostream &os, const val_list &obj)
30851 if (!obj.get())
30852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30853 auto saved_ctx = isl_val_list_get_ctx(obj.get());
30854 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30855 char *str = isl_val_list_to_str(obj.get());
30856 if (!str)
30857 exception::throw_last_error(saved_ctx);
30858 os << str;
30859 free(str);
30860 return os;
30862 } // namespace isl
30864 #endif /* ISL_CPP */