cpp/cpp.h.top: mark exception::what override
[isl.git] / include / isl / cpp.h
blob9831111549fd0a9f8b66bfffcd0f1d9a3a5fed00
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::map intersect_params(const isl::set &params) const;
1558 inline isl::basic_map intersect_range(isl::basic_set bset) const;
1559 inline isl::map intersect_range(const isl::set &set) const;
1560 inline isl::union_map intersect_range(const isl::space &space) const;
1561 inline isl::union_map intersect_range(const isl::union_set &uset) const;
1562 inline isl::basic_map intersect_range(const isl::point &bset) const;
1563 inline isl::map intersect_range_factor_domain(const isl::map &factor) const;
1564 inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
1565 inline isl::map intersect_range_factor_range(const isl::map &factor) const;
1566 inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
1567 inline isl::map intersect_range_wrapped_domain(const isl::set &domain) const;
1568 inline isl::union_map intersect_range_wrapped_domain(const isl::union_set &domain) const;
1569 inline bool is_bijective() const;
1570 inline bool is_disjoint(const isl::map &map2) const;
1571 inline bool is_disjoint(const isl::union_map &umap2) const;
1572 inline bool is_empty() const;
1573 inline bool is_equal(const isl::basic_map &bmap2) const;
1574 inline bool is_equal(const isl::map &map2) const;
1575 inline bool is_equal(const isl::union_map &umap2) const;
1576 inline bool is_injective() const;
1577 inline bool is_single_valued() const;
1578 inline bool is_strict_subset(const isl::map &map2) const;
1579 inline bool is_strict_subset(const isl::union_map &umap2) const;
1580 inline bool is_subset(const isl::basic_map &bmap2) const;
1581 inline bool is_subset(const isl::map &map2) const;
1582 inline bool is_subset(const isl::union_map &umap2) const;
1583 inline bool isa_map() const;
1584 inline isl::map lex_ge_at(const isl::multi_pw_aff &mpa) const;
1585 inline isl::map lex_gt_at(const isl::multi_pw_aff &mpa) const;
1586 inline isl::map lex_le_at(const isl::multi_pw_aff &mpa) const;
1587 inline isl::map lex_lt_at(const isl::multi_pw_aff &mpa) const;
1588 inline isl::map lexmax() const;
1589 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1590 inline isl::map lexmin() const;
1591 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1592 inline isl::map lower_bound(const isl::multi_pw_aff &lower) const;
1593 inline isl::map_list map_list() const;
1594 inline isl::multi_pw_aff max_multi_pw_aff() const;
1595 inline isl::multi_pw_aff min_multi_pw_aff() const;
1596 inline unsigned n_basic_map() const;
1597 inline isl::set params() const;
1598 inline isl::basic_map polyhedral_hull() const;
1599 inline isl::map preimage_domain(const isl::multi_aff &ma) const;
1600 inline isl::map preimage_domain(const isl::multi_pw_aff &mpa) const;
1601 inline isl::map preimage_domain(const isl::pw_multi_aff &pma) const;
1602 inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
1603 inline isl::map preimage_range(const isl::multi_aff &ma) const;
1604 inline isl::map preimage_range(const isl::pw_multi_aff &pma) const;
1605 inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
1606 inline isl::map product(const isl::map &map2) const;
1607 inline isl::union_map product(const isl::union_map &umap2) const;
1608 inline isl::map project_out_all_params() const;
1609 inline isl::map project_out_param(const isl::id &id) const;
1610 inline isl::map project_out_param(const std::string &id) const;
1611 inline isl::map project_out_param(const isl::id_list &list) const;
1612 inline isl::set range() const;
1613 inline isl::map range_factor_domain() const;
1614 inline isl::map range_factor_range() const;
1615 inline isl::fixed_box range_lattice_tile() const;
1616 inline isl::union_map range_map() const;
1617 inline isl::map range_product(const isl::map &map2) const;
1618 inline isl::union_map range_product(const isl::union_map &umap2) const;
1619 inline isl::map range_reverse() const;
1620 inline isl::fixed_box range_simple_fixed_box_hull() const;
1621 inline unsigned range_tuple_dim() const;
1622 inline isl::id range_tuple_id() const;
1623 inline isl::basic_map reverse() const;
1624 inline isl::basic_map sample() const;
1625 inline isl::map set_domain_tuple(const isl::id &id) const;
1626 inline isl::map set_domain_tuple(const std::string &id) const;
1627 inline isl::map set_range_tuple(const isl::id &id) const;
1628 inline isl::map set_range_tuple(const std::string &id) const;
1629 inline isl::space space() const;
1630 inline isl::map subtract(const isl::map &map2) const;
1631 inline isl::union_map subtract(const isl::union_map &umap2) const;
1632 inline isl::union_map subtract_domain(const isl::union_set &dom) const;
1633 inline isl::union_map subtract_range(const isl::union_set &dom) const;
1634 inline isl::map_list to_list() const;
1635 inline isl::union_map to_union_map() const;
1636 inline isl::map uncurry() const;
1637 inline isl::map unite(isl::basic_map bmap2) const;
1638 inline isl::map unite(const isl::map &map2) const;
1639 inline isl::union_map unite(const isl::union_map &umap2) const;
1640 inline isl::basic_map unshifted_simple_hull() const;
1641 inline isl::map upper_bound(const isl::multi_pw_aff &upper) const;
1642 inline isl::set wrap() const;
1643 inline isl::map zip() const;
1646 // declarations for isl::basic_set
1647 inline basic_set manage(__isl_take isl_basic_set *ptr);
1648 inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1650 class basic_set {
1651 friend inline basic_set manage(__isl_take isl_basic_set *ptr);
1652 friend inline basic_set manage_copy(__isl_keep isl_basic_set *ptr);
1654 protected:
1655 isl_basic_set *ptr = nullptr;
1657 inline explicit basic_set(__isl_take isl_basic_set *ptr);
1659 public:
1660 inline /* implicit */ basic_set();
1661 inline /* implicit */ basic_set(const basic_set &obj);
1662 inline /* implicit */ basic_set(isl::point pnt);
1663 inline explicit basic_set(isl::ctx ctx, const std::string &str);
1664 inline basic_set &operator=(basic_set obj);
1665 inline ~basic_set();
1666 inline __isl_give isl_basic_set *copy() const &;
1667 inline __isl_give isl_basic_set *copy() && = delete;
1668 inline __isl_keep isl_basic_set *get() const;
1669 inline __isl_give isl_basic_set *release();
1670 inline bool is_null() const;
1671 inline isl::ctx ctx() const;
1673 inline isl::basic_set affine_hull() const;
1674 inline isl::basic_set apply(isl::basic_map bmap) const;
1675 inline isl::set apply(const isl::map &map) const;
1676 inline isl::union_set apply(const isl::union_map &umap) const;
1677 inline isl::pw_multi_aff as_pw_multi_aff() const;
1678 inline isl::set as_set() const;
1679 inline isl::set bind(const isl::multi_id &tuple) const;
1680 inline isl::set coalesce() const;
1681 inline isl::set complement() const;
1682 inline isl::union_set compute_divs() const;
1683 inline isl::basic_set detect_equalities() const;
1684 inline isl::val dim_max_val(int pos) const;
1685 inline isl::val dim_min_val(int pos) const;
1686 inline isl::set drop_unused_params() const;
1687 inline bool every_set(const std::function<bool(isl::set)> &test) const;
1688 inline isl::set extract_set(const isl::space &space) const;
1689 inline isl::basic_set flatten() const;
1690 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
1691 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
1692 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
1693 inline isl::basic_set gist(isl::basic_set context) const;
1694 inline isl::set gist(const isl::set &context) const;
1695 inline isl::union_set gist(const isl::union_set &context) const;
1696 inline isl::basic_set gist(const isl::point &context) const;
1697 inline isl::set gist_params(const isl::set &context) const;
1698 inline isl::map identity() const;
1699 inline isl::pw_aff indicator_function() const;
1700 inline isl::map insert_domain(const isl::space &domain) const;
1701 inline isl::basic_set intersect(isl::basic_set bset2) const;
1702 inline isl::set intersect(const isl::set &set2) const;
1703 inline isl::union_set intersect(const isl::union_set &uset2) const;
1704 inline isl::basic_set intersect(const isl::point &bset2) const;
1705 inline isl::basic_set intersect_params(isl::basic_set bset2) const;
1706 inline isl::set intersect_params(const isl::set &params) const;
1707 inline isl::basic_set intersect_params(const isl::point &bset2) const;
1708 inline bool involves_locals() const;
1709 inline bool is_disjoint(const isl::set &set2) const;
1710 inline bool is_disjoint(const isl::union_set &uset2) const;
1711 inline bool is_empty() const;
1712 inline bool is_equal(const isl::basic_set &bset2) const;
1713 inline bool is_equal(const isl::set &set2) const;
1714 inline bool is_equal(const isl::union_set &uset2) const;
1715 inline bool is_equal(const isl::point &bset2) const;
1716 inline bool is_singleton() const;
1717 inline bool is_strict_subset(const isl::set &set2) const;
1718 inline bool is_strict_subset(const isl::union_set &uset2) const;
1719 inline bool is_subset(const isl::basic_set &bset2) const;
1720 inline bool is_subset(const isl::set &set2) const;
1721 inline bool is_subset(const isl::union_set &uset2) const;
1722 inline bool is_subset(const isl::point &bset2) const;
1723 inline bool is_wrapping() const;
1724 inline bool isa_set() const;
1725 inline isl::fixed_box lattice_tile() const;
1726 inline isl::set lexmax() const;
1727 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
1728 inline isl::set lexmin() const;
1729 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
1730 inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
1731 inline isl::set lower_bound(const isl::multi_val &lower) const;
1732 inline isl::multi_pw_aff max_multi_pw_aff() const;
1733 inline isl::val max_val(const isl::aff &obj) const;
1734 inline isl::multi_pw_aff min_multi_pw_aff() const;
1735 inline isl::val min_val(const isl::aff &obj) const;
1736 inline unsigned n_basic_set() const;
1737 inline isl::pw_aff param_pw_aff_on_domain(const isl::id &id) const;
1738 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
1739 inline isl::basic_set params() const;
1740 inline isl::multi_val plain_multi_val_if_fixed() const;
1741 inline isl::basic_set polyhedral_hull() const;
1742 inline isl::set preimage(const isl::multi_aff &ma) const;
1743 inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
1744 inline isl::set preimage(const isl::pw_multi_aff &pma) const;
1745 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
1746 inline isl::set product(const isl::set &set2) const;
1747 inline isl::set project_out_all_params() const;
1748 inline isl::set project_out_param(const isl::id &id) const;
1749 inline isl::set project_out_param(const std::string &id) const;
1750 inline isl::set project_out_param(const isl::id_list &list) const;
1751 inline isl::pw_aff pw_aff_on_domain(const isl::val &v) const;
1752 inline isl::pw_aff pw_aff_on_domain(long v) const;
1753 inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
1754 inline isl::basic_set sample() const;
1755 inline isl::point sample_point() const;
1756 inline isl::set_list set_list() const;
1757 inline isl::fixed_box simple_fixed_box_hull() const;
1758 inline isl::space space() const;
1759 inline isl::val stride(int pos) const;
1760 inline isl::set subtract(const isl::set &set2) const;
1761 inline isl::union_set subtract(const isl::union_set &uset2) const;
1762 inline isl::set_list to_list() const;
1763 inline isl::set to_set() const;
1764 inline isl::union_set to_union_set() const;
1765 inline isl::map translation() const;
1766 inline unsigned tuple_dim() const;
1767 inline isl::set unbind_params(const isl::multi_id &tuple) const;
1768 inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
1769 inline isl::set unite(isl::basic_set bset2) const;
1770 inline isl::set unite(const isl::set &set2) const;
1771 inline isl::union_set unite(const isl::union_set &uset2) const;
1772 inline isl::set unite(const isl::point &bset2) const;
1773 inline isl::basic_set unshifted_simple_hull() const;
1774 inline isl::map unwrap() const;
1775 inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
1776 inline isl::set upper_bound(const isl::multi_val &upper) const;
1777 inline isl::set wrapped_reverse() const;
1780 // declarations for isl::fixed_box
1781 inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1782 inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1784 class fixed_box {
1785 friend inline fixed_box manage(__isl_take isl_fixed_box *ptr);
1786 friend inline fixed_box manage_copy(__isl_keep isl_fixed_box *ptr);
1788 protected:
1789 isl_fixed_box *ptr = nullptr;
1791 inline explicit fixed_box(__isl_take isl_fixed_box *ptr);
1793 public:
1794 inline /* implicit */ fixed_box();
1795 inline /* implicit */ fixed_box(const fixed_box &obj);
1796 inline explicit fixed_box(isl::ctx ctx, const std::string &str);
1797 inline fixed_box &operator=(fixed_box obj);
1798 inline ~fixed_box();
1799 inline __isl_give isl_fixed_box *copy() const &;
1800 inline __isl_give isl_fixed_box *copy() && = delete;
1801 inline __isl_keep isl_fixed_box *get() const;
1802 inline __isl_give isl_fixed_box *release();
1803 inline bool is_null() const;
1804 inline isl::ctx ctx() const;
1806 inline bool is_valid() const;
1807 inline isl::multi_aff offset() const;
1808 inline isl::multi_aff get_offset() const;
1809 inline isl::multi_val size() const;
1810 inline isl::multi_val get_size() const;
1811 inline isl::space space() const;
1812 inline isl::space get_space() const;
1815 // declarations for isl::id
1816 inline id manage(__isl_take isl_id *ptr);
1817 inline id manage_copy(__isl_keep isl_id *ptr);
1819 class id {
1820 friend inline id manage(__isl_take isl_id *ptr);
1821 friend inline id manage_copy(__isl_keep isl_id *ptr);
1823 protected:
1824 isl_id *ptr = nullptr;
1826 inline explicit id(__isl_take isl_id *ptr);
1828 public:
1829 inline /* implicit */ id();
1830 inline /* implicit */ id(const id &obj);
1831 inline explicit id(isl::ctx ctx, const std::string &str);
1832 inline id &operator=(id obj);
1833 inline ~id();
1834 inline __isl_give isl_id *copy() const &;
1835 inline __isl_give isl_id *copy() && = delete;
1836 inline __isl_keep isl_id *get() const;
1837 inline __isl_give isl_id *release();
1838 inline bool is_null() const;
1839 inline isl::ctx ctx() const;
1841 inline std::string name() const;
1842 inline std::string get_name() const;
1843 inline isl::id_list to_list() const;
1845 #if __cplusplus >= 201703L
1846 inline explicit id(isl::ctx ctx, const std::string &str, const std::any &any);
1847 template <class T>
1848 std::optional<T> try_user() const;
1849 template <class T>
1850 T user() const;
1851 #endif
1854 // declarations for isl::id_list
1855 inline id_list manage(__isl_take isl_id_list *ptr);
1856 inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1858 class id_list {
1859 friend inline id_list manage(__isl_take isl_id_list *ptr);
1860 friend inline id_list manage_copy(__isl_keep isl_id_list *ptr);
1862 protected:
1863 isl_id_list *ptr = nullptr;
1865 inline explicit id_list(__isl_take isl_id_list *ptr);
1867 public:
1868 inline /* implicit */ id_list();
1869 inline /* implicit */ id_list(const id_list &obj);
1870 inline explicit id_list(isl::ctx ctx, int n);
1871 inline explicit id_list(isl::id el);
1872 inline explicit id_list(isl::ctx ctx, const std::string &str);
1873 inline id_list &operator=(id_list obj);
1874 inline ~id_list();
1875 inline __isl_give isl_id_list *copy() const &;
1876 inline __isl_give isl_id_list *copy() && = delete;
1877 inline __isl_keep isl_id_list *get() const;
1878 inline __isl_give isl_id_list *release();
1879 inline bool is_null() const;
1880 inline isl::ctx ctx() const;
1882 inline isl::id_list add(isl::id el) const;
1883 inline isl::id_list add(const std::string &el) const;
1884 inline isl::id at(int index) const;
1885 inline isl::id get_at(int index) const;
1886 inline isl::id_list clear() const;
1887 inline isl::id_list concat(isl::id_list list2) const;
1888 inline isl::id_list drop(unsigned int first, unsigned int n) const;
1889 inline void foreach(const std::function<void(isl::id)> &fn) const;
1890 inline void foreach_scc(const std::function<bool(isl::id, isl::id)> &follows, const std::function<void(isl::id_list)> &fn) const;
1891 inline isl::id_list insert(unsigned int pos, isl::id el) const;
1892 inline isl::id_list insert(unsigned int pos, const std::string &el) const;
1893 inline isl::id_list set_at(int index, isl::id el) const;
1894 inline isl::id_list set_at(int index, const std::string &el) const;
1895 inline unsigned size() const;
1898 // declarations for isl::id_to_ast_expr
1899 inline id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr);
1900 inline id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr);
1902 class id_to_ast_expr {
1903 friend inline id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr);
1904 friend inline id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr);
1906 protected:
1907 isl_id_to_ast_expr *ptr = nullptr;
1909 inline explicit id_to_ast_expr(__isl_take isl_id_to_ast_expr *ptr);
1911 public:
1912 inline /* implicit */ id_to_ast_expr();
1913 inline /* implicit */ id_to_ast_expr(const id_to_ast_expr &obj);
1914 inline explicit id_to_ast_expr(isl::ctx ctx, int min_size);
1915 inline explicit id_to_ast_expr(isl::ctx ctx, const std::string &str);
1916 inline id_to_ast_expr &operator=(id_to_ast_expr obj);
1917 inline ~id_to_ast_expr();
1918 inline __isl_give isl_id_to_ast_expr *copy() const &;
1919 inline __isl_give isl_id_to_ast_expr *copy() && = delete;
1920 inline __isl_keep isl_id_to_ast_expr *get() const;
1921 inline __isl_give isl_id_to_ast_expr *release();
1922 inline bool is_null() const;
1923 inline isl::ctx ctx() const;
1925 inline bool is_equal(const isl::id_to_ast_expr &hmap2) const;
1926 inline isl::id_to_ast_expr set(isl::id key, isl::ast_expr val) const;
1927 inline isl::id_to_ast_expr set(const std::string &key, const isl::ast_expr &val) const;
1930 // declarations for isl::id_to_id
1931 inline id_to_id manage(__isl_take isl_id_to_id *ptr);
1932 inline id_to_id manage_copy(__isl_keep isl_id_to_id *ptr);
1934 class id_to_id {
1935 friend inline id_to_id manage(__isl_take isl_id_to_id *ptr);
1936 friend inline id_to_id manage_copy(__isl_keep isl_id_to_id *ptr);
1938 protected:
1939 isl_id_to_id *ptr = nullptr;
1941 inline explicit id_to_id(__isl_take isl_id_to_id *ptr);
1943 public:
1944 inline /* implicit */ id_to_id();
1945 inline /* implicit */ id_to_id(const id_to_id &obj);
1946 inline explicit id_to_id(isl::ctx ctx, int min_size);
1947 inline explicit id_to_id(isl::ctx ctx, const std::string &str);
1948 inline id_to_id &operator=(id_to_id obj);
1949 inline ~id_to_id();
1950 inline __isl_give isl_id_to_id *copy() const &;
1951 inline __isl_give isl_id_to_id *copy() && = delete;
1952 inline __isl_keep isl_id_to_id *get() const;
1953 inline __isl_give isl_id_to_id *release();
1954 inline bool is_null() const;
1955 inline isl::ctx ctx() const;
1957 inline bool is_equal(const isl::id_to_id &hmap2) const;
1958 inline isl::id_to_id set(isl::id key, isl::id val) const;
1959 inline isl::id_to_id set(const isl::id &key, const std::string &val) const;
1960 inline isl::id_to_id set(const std::string &key, const isl::id &val) const;
1961 inline isl::id_to_id set(const std::string &key, const std::string &val) const;
1964 // declarations for isl::map
1965 inline map manage(__isl_take isl_map *ptr);
1966 inline map manage_copy(__isl_keep isl_map *ptr);
1968 class map {
1969 friend inline map manage(__isl_take isl_map *ptr);
1970 friend inline map manage_copy(__isl_keep isl_map *ptr);
1972 protected:
1973 isl_map *ptr = nullptr;
1975 inline explicit map(__isl_take isl_map *ptr);
1977 public:
1978 inline /* implicit */ map();
1979 inline /* implicit */ map(const map &obj);
1980 inline /* implicit */ map(isl::basic_map bmap);
1981 inline explicit map(isl::ctx ctx, const std::string &str);
1982 inline map &operator=(map obj);
1983 inline ~map();
1984 inline __isl_give isl_map *copy() const &;
1985 inline __isl_give isl_map *copy() && = delete;
1986 inline __isl_keep isl_map *get() const;
1987 inline __isl_give isl_map *release();
1988 inline bool is_null() const;
1989 inline isl::ctx ctx() const;
1991 inline isl::basic_map affine_hull() const;
1992 inline isl::map apply_domain(isl::map map2) const;
1993 inline isl::union_map apply_domain(const isl::union_map &umap2) const;
1994 inline isl::map apply_domain(const isl::basic_map &map2) const;
1995 inline isl::map apply_range(isl::map map2) const;
1996 inline isl::union_map apply_range(const isl::union_map &umap2) const;
1997 inline isl::map apply_range(const isl::basic_map &map2) const;
1998 inline isl::map as_map() const;
1999 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2000 inline isl::pw_multi_aff as_pw_multi_aff() const;
2001 inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
2002 inline isl::set bind_domain(isl::multi_id tuple) const;
2003 inline isl::set bind_range(isl::multi_id tuple) const;
2004 inline isl::map coalesce() const;
2005 inline isl::map complement() const;
2006 inline isl::union_map compute_divs() const;
2007 inline isl::map curry() const;
2008 inline isl::set deltas() const;
2009 inline isl::map detect_equalities() const;
2010 inline isl::set domain() const;
2011 inline isl::map domain_factor_domain() const;
2012 inline isl::map domain_factor_range() const;
2013 inline isl::union_map domain_map() const;
2014 inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
2015 inline isl::map domain_product(isl::map map2) const;
2016 inline isl::union_map domain_product(const isl::union_map &umap2) const;
2017 inline isl::map domain_product(const isl::basic_map &map2) const;
2018 inline isl::map domain_reverse() const;
2019 inline unsigned domain_tuple_dim() const;
2020 inline isl::id domain_tuple_id() const;
2021 inline isl::id get_domain_tuple_id() const;
2022 inline isl::map drop_unused_params() const;
2023 static inline isl::map empty(isl::space space);
2024 inline isl::map eq_at(isl::multi_pw_aff mpa) const;
2025 inline isl::union_map eq_at(const isl::multi_union_pw_aff &mupa) const;
2026 inline isl::map eq_at(const isl::aff &mpa) const;
2027 inline isl::map eq_at(const isl::multi_aff &mpa) const;
2028 inline isl::map eq_at(const isl::pw_aff &mpa) const;
2029 inline isl::map eq_at(const isl::pw_multi_aff &mpa) const;
2030 inline bool every_map(const std::function<bool(isl::map)> &test) const;
2031 inline isl::map extract_map(const isl::space &space) const;
2032 inline isl::map factor_domain() const;
2033 inline isl::map factor_range() const;
2034 inline isl::map fixed_power(isl::val exp) const;
2035 inline isl::map fixed_power(long exp) const;
2036 inline isl::map flatten() const;
2037 inline isl::map flatten_domain() const;
2038 inline isl::map flatten_range() const;
2039 inline void foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const;
2040 inline void foreach_map(const std::function<void(isl::map)> &fn) const;
2041 inline isl::map gist(isl::map context) const;
2042 inline isl::union_map gist(const isl::union_map &context) const;
2043 inline isl::map gist(const isl::basic_map &context) const;
2044 inline isl::map gist_domain(isl::set context) const;
2045 inline isl::union_map gist_domain(const isl::union_set &uset) const;
2046 inline isl::map gist_domain(const isl::basic_set &context) const;
2047 inline isl::map gist_domain(const isl::point &context) const;
2048 inline isl::map gist_params(isl::set context) const;
2049 inline isl::union_map gist_range(const isl::union_set &uset) const;
2050 inline bool has_domain_tuple_id() const;
2051 inline bool has_range_tuple_id() const;
2052 inline isl::map intersect(isl::map map2) const;
2053 inline isl::union_map intersect(const isl::union_map &umap2) const;
2054 inline isl::map intersect(const isl::basic_map &map2) const;
2055 inline isl::map intersect_domain(isl::set set) const;
2056 inline isl::union_map intersect_domain(const isl::space &space) const;
2057 inline isl::union_map intersect_domain(const isl::union_set &uset) const;
2058 inline isl::map intersect_domain(const isl::basic_set &set) const;
2059 inline isl::map intersect_domain(const isl::point &set) const;
2060 inline isl::map intersect_domain_factor_domain(isl::map factor) const;
2061 inline isl::union_map intersect_domain_factor_domain(const isl::union_map &factor) const;
2062 inline isl::map intersect_domain_factor_domain(const isl::basic_map &factor) const;
2063 inline isl::map intersect_domain_factor_range(isl::map factor) const;
2064 inline isl::union_map intersect_domain_factor_range(const isl::union_map &factor) const;
2065 inline isl::map intersect_domain_factor_range(const isl::basic_map &factor) const;
2066 inline isl::map intersect_domain_wrapped_domain(isl::set domain) const;
2067 inline isl::union_map intersect_domain_wrapped_domain(const isl::union_set &domain) const;
2068 inline isl::map intersect_domain_wrapped_domain(const isl::basic_set &domain) const;
2069 inline isl::map intersect_domain_wrapped_domain(const isl::point &domain) const;
2070 inline isl::map intersect_params(isl::set params) const;
2071 inline isl::map intersect_range(isl::set set) const;
2072 inline isl::union_map intersect_range(const isl::space &space) const;
2073 inline isl::union_map intersect_range(const isl::union_set &uset) const;
2074 inline isl::map intersect_range(const isl::basic_set &set) const;
2075 inline isl::map intersect_range(const isl::point &set) const;
2076 inline isl::map intersect_range_factor_domain(isl::map factor) const;
2077 inline isl::union_map intersect_range_factor_domain(const isl::union_map &factor) const;
2078 inline isl::map intersect_range_factor_domain(const isl::basic_map &factor) const;
2079 inline isl::map intersect_range_factor_range(isl::map factor) const;
2080 inline isl::union_map intersect_range_factor_range(const isl::union_map &factor) const;
2081 inline isl::map intersect_range_factor_range(const isl::basic_map &factor) const;
2082 inline isl::map intersect_range_wrapped_domain(isl::set domain) const;
2083 inline isl::union_map intersect_range_wrapped_domain(const isl::union_set &domain) const;
2084 inline isl::map intersect_range_wrapped_domain(const isl::basic_set &domain) const;
2085 inline isl::map intersect_range_wrapped_domain(const isl::point &domain) const;
2086 inline bool is_bijective() const;
2087 inline bool is_disjoint(const isl::map &map2) const;
2088 inline bool is_disjoint(const isl::union_map &umap2) const;
2089 inline bool is_disjoint(const isl::basic_map &map2) const;
2090 inline bool is_empty() const;
2091 inline bool is_equal(const isl::map &map2) const;
2092 inline bool is_equal(const isl::union_map &umap2) const;
2093 inline bool is_equal(const isl::basic_map &map2) const;
2094 inline bool is_injective() const;
2095 inline bool is_single_valued() const;
2096 inline bool is_strict_subset(const isl::map &map2) const;
2097 inline bool is_strict_subset(const isl::union_map &umap2) const;
2098 inline bool is_strict_subset(const isl::basic_map &map2) const;
2099 inline bool is_subset(const isl::map &map2) const;
2100 inline bool is_subset(const isl::union_map &umap2) const;
2101 inline bool is_subset(const isl::basic_map &map2) const;
2102 inline bool isa_map() const;
2103 inline isl::map lex_ge_at(isl::multi_pw_aff mpa) const;
2104 inline isl::map lex_gt_at(isl::multi_pw_aff mpa) const;
2105 inline isl::map lex_le_at(isl::multi_pw_aff mpa) const;
2106 inline isl::map lex_lt_at(isl::multi_pw_aff mpa) const;
2107 inline isl::map lexmax() const;
2108 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
2109 inline isl::map lexmin() const;
2110 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
2111 inline isl::map lower_bound(isl::multi_pw_aff lower) const;
2112 inline isl::map_list map_list() const;
2113 inline isl::multi_pw_aff max_multi_pw_aff() const;
2114 inline isl::multi_pw_aff min_multi_pw_aff() const;
2115 inline unsigned n_basic_map() const;
2116 inline isl::set params() const;
2117 inline isl::basic_map polyhedral_hull() const;
2118 inline isl::map preimage_domain(isl::multi_aff ma) const;
2119 inline isl::map preimage_domain(isl::multi_pw_aff mpa) const;
2120 inline isl::map preimage_domain(isl::pw_multi_aff pma) const;
2121 inline isl::union_map preimage_domain(const isl::union_pw_multi_aff &upma) const;
2122 inline isl::map preimage_range(isl::multi_aff ma) const;
2123 inline isl::map preimage_range(isl::pw_multi_aff pma) const;
2124 inline isl::union_map preimage_range(const isl::union_pw_multi_aff &upma) const;
2125 inline isl::map product(isl::map map2) const;
2126 inline isl::union_map product(const isl::union_map &umap2) const;
2127 inline isl::map product(const isl::basic_map &map2) const;
2128 inline isl::map project_out_all_params() const;
2129 inline isl::map project_out_param(isl::id id) const;
2130 inline isl::map project_out_param(const std::string &id) const;
2131 inline isl::map project_out_param(isl::id_list list) const;
2132 inline isl::set range() const;
2133 inline isl::map range_factor_domain() const;
2134 inline isl::map range_factor_range() const;
2135 inline isl::fixed_box range_lattice_tile() const;
2136 inline isl::fixed_box get_range_lattice_tile() const;
2137 inline isl::union_map range_map() const;
2138 inline isl::map range_product(isl::map map2) const;
2139 inline isl::union_map range_product(const isl::union_map &umap2) const;
2140 inline isl::map range_product(const isl::basic_map &map2) const;
2141 inline isl::map range_reverse() const;
2142 inline isl::fixed_box range_simple_fixed_box_hull() const;
2143 inline isl::fixed_box get_range_simple_fixed_box_hull() const;
2144 inline unsigned range_tuple_dim() const;
2145 inline isl::id range_tuple_id() const;
2146 inline isl::id get_range_tuple_id() const;
2147 inline isl::map reverse() const;
2148 inline isl::basic_map sample() const;
2149 inline isl::map set_domain_tuple(isl::id id) const;
2150 inline isl::map set_domain_tuple(const std::string &id) const;
2151 inline isl::map set_range_tuple(isl::id id) const;
2152 inline isl::map set_range_tuple(const std::string &id) const;
2153 inline isl::space space() const;
2154 inline isl::space get_space() const;
2155 inline isl::map subtract(isl::map map2) const;
2156 inline isl::union_map subtract(const isl::union_map &umap2) const;
2157 inline isl::map subtract(const isl::basic_map &map2) const;
2158 inline isl::union_map subtract_domain(const isl::union_set &dom) const;
2159 inline isl::union_map subtract_range(const isl::union_set &dom) const;
2160 inline isl::map_list to_list() const;
2161 inline isl::union_map to_union_map() const;
2162 inline isl::map uncurry() const;
2163 inline isl::map unite(isl::map map2) const;
2164 inline isl::union_map unite(const isl::union_map &umap2) const;
2165 inline isl::map unite(const isl::basic_map &map2) const;
2166 static inline isl::map universe(isl::space space);
2167 inline isl::basic_map unshifted_simple_hull() const;
2168 inline isl::map upper_bound(isl::multi_pw_aff upper) const;
2169 inline isl::set wrap() const;
2170 inline isl::map zip() const;
2173 // declarations for isl::map_list
2174 inline map_list manage(__isl_take isl_map_list *ptr);
2175 inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2177 class map_list {
2178 friend inline map_list manage(__isl_take isl_map_list *ptr);
2179 friend inline map_list manage_copy(__isl_keep isl_map_list *ptr);
2181 protected:
2182 isl_map_list *ptr = nullptr;
2184 inline explicit map_list(__isl_take isl_map_list *ptr);
2186 public:
2187 inline /* implicit */ map_list();
2188 inline /* implicit */ map_list(const map_list &obj);
2189 inline explicit map_list(isl::ctx ctx, int n);
2190 inline explicit map_list(isl::map el);
2191 inline explicit map_list(isl::ctx ctx, const std::string &str);
2192 inline map_list &operator=(map_list obj);
2193 inline ~map_list();
2194 inline __isl_give isl_map_list *copy() const &;
2195 inline __isl_give isl_map_list *copy() && = delete;
2196 inline __isl_keep isl_map_list *get() const;
2197 inline __isl_give isl_map_list *release();
2198 inline bool is_null() const;
2199 inline isl::ctx ctx() const;
2201 inline isl::map_list add(isl::map el) const;
2202 inline isl::map at(int index) const;
2203 inline isl::map get_at(int index) const;
2204 inline isl::map_list clear() const;
2205 inline isl::map_list concat(isl::map_list list2) const;
2206 inline isl::map_list drop(unsigned int first, unsigned int n) const;
2207 inline void foreach(const std::function<void(isl::map)> &fn) const;
2208 inline void foreach_scc(const std::function<bool(isl::map, isl::map)> &follows, const std::function<void(isl::map_list)> &fn) const;
2209 inline isl::map_list insert(unsigned int pos, isl::map el) const;
2210 inline isl::map_list set_at(int index, isl::map el) const;
2211 inline unsigned size() const;
2214 // declarations for isl::multi_aff
2215 inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2216 inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2218 class multi_aff {
2219 friend inline multi_aff manage(__isl_take isl_multi_aff *ptr);
2220 friend inline multi_aff manage_copy(__isl_keep isl_multi_aff *ptr);
2222 protected:
2223 isl_multi_aff *ptr = nullptr;
2225 inline explicit multi_aff(__isl_take isl_multi_aff *ptr);
2227 public:
2228 inline /* implicit */ multi_aff();
2229 inline /* implicit */ multi_aff(const multi_aff &obj);
2230 inline /* implicit */ multi_aff(isl::aff aff);
2231 inline explicit multi_aff(isl::space space, isl::aff_list list);
2232 inline explicit multi_aff(isl::ctx ctx, const std::string &str);
2233 inline multi_aff &operator=(multi_aff obj);
2234 inline ~multi_aff();
2235 inline __isl_give isl_multi_aff *copy() const &;
2236 inline __isl_give isl_multi_aff *copy() && = delete;
2237 inline __isl_keep isl_multi_aff *get() const;
2238 inline __isl_give isl_multi_aff *release();
2239 inline bool is_null() const;
2240 inline isl::ctx ctx() const;
2242 inline isl::multi_aff add(isl::multi_aff multi2) const;
2243 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2244 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2245 inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2246 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2247 inline isl::multi_aff add(const isl::aff &multi2) const;
2248 inline isl::multi_aff add_constant(isl::multi_val mv) const;
2249 inline isl::multi_aff add_constant(isl::val v) const;
2250 inline isl::multi_aff add_constant(long v) const;
2251 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2252 inline isl::map as_map() const;
2253 inline isl::multi_aff as_multi_aff() const;
2254 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2255 inline isl::pw_multi_aff as_pw_multi_aff() const;
2256 inline isl::set as_set() const;
2257 inline isl::union_map as_union_map() const;
2258 inline isl::aff at(int pos) const;
2259 inline isl::aff get_at(int pos) const;
2260 inline isl::basic_set bind(isl::multi_id tuple) const;
2261 inline isl::multi_aff bind_domain(isl::multi_id tuple) const;
2262 inline isl::multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2263 inline isl::pw_multi_aff coalesce() const;
2264 inline isl::multi_val constant_multi_val() const;
2265 inline isl::multi_val get_constant_multi_val() const;
2266 inline isl::set domain() const;
2267 static inline isl::multi_aff domain_map(isl::space space);
2268 inline isl::multi_aff domain_reverse() const;
2269 inline isl::pw_multi_aff drop_unused_params() const;
2270 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2271 inline isl::multi_aff flat_range_product(isl::multi_aff multi2) const;
2272 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2273 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2274 inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2275 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2276 inline isl::multi_aff flat_range_product(const isl::aff &multi2) const;
2277 inline isl::multi_aff floor() const;
2278 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2279 inline isl::multi_aff gist(isl::set context) const;
2280 inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
2281 inline isl::multi_aff gist(const isl::basic_set &context) const;
2282 inline isl::multi_aff gist(const isl::point &context) const;
2283 inline isl::multi_aff gist_params(isl::set context) const;
2284 inline bool has_range_tuple_id() const;
2285 inline isl::multi_aff identity() const;
2286 static inline isl::multi_aff identity_on_domain(isl::space space);
2287 inline isl::multi_aff insert_domain(isl::space domain) const;
2288 inline isl::pw_multi_aff intersect_domain(const isl::set &set) const;
2289 inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
2290 inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
2291 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2292 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2293 inline isl::pw_multi_aff intersect_params(const isl::set &set) const;
2294 inline bool involves_locals() const;
2295 inline bool involves_nan() const;
2296 inline bool involves_param(const isl::id &id) const;
2297 inline bool involves_param(const std::string &id) const;
2298 inline bool involves_param(const isl::id_list &list) const;
2299 inline bool isa_multi_aff() const;
2300 inline bool isa_pw_multi_aff() const;
2301 inline isl::aff_list list() const;
2302 inline isl::aff_list get_list() const;
2303 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2304 inline isl::multi_val max_multi_val() const;
2305 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2306 inline isl::multi_val min_multi_val() const;
2307 static inline isl::multi_aff multi_val_on_domain(isl::space space, isl::multi_val mv);
2308 inline unsigned n_piece() const;
2309 inline isl::multi_aff neg() const;
2310 inline bool plain_is_empty() const;
2311 inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2312 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2313 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2314 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
2315 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
2316 inline bool plain_is_equal(const isl::aff &multi2) const;
2317 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2318 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2319 inline isl::multi_aff product(isl::multi_aff multi2) const;
2320 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2321 inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2322 inline isl::multi_aff product(const isl::aff &multi2) const;
2323 inline isl::multi_aff pullback(isl::multi_aff ma2) const;
2324 inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
2325 inline isl::pw_multi_aff pullback(const isl::pw_multi_aff &pma2) const;
2326 inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
2327 inline isl::multi_aff pullback(const isl::aff &ma2) const;
2328 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2329 inline isl::pw_multi_aff range_factor_domain() const;
2330 inline isl::pw_multi_aff range_factor_range() const;
2331 static inline isl::multi_aff range_map(isl::space space);
2332 inline isl::multi_aff range_product(isl::multi_aff multi2) const;
2333 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2334 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2335 inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2336 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2337 inline isl::multi_aff range_product(const isl::aff &multi2) const;
2338 inline isl::id range_tuple_id() const;
2339 inline isl::id get_range_tuple_id() const;
2340 inline isl::multi_aff reset_range_tuple_id() const;
2341 inline isl::multi_aff scale(isl::multi_val mv) const;
2342 inline isl::multi_aff scale(isl::val v) const;
2343 inline isl::multi_aff scale(long v) const;
2344 inline isl::multi_aff scale_down(isl::multi_val mv) const;
2345 inline isl::multi_aff scale_down(isl::val v) const;
2346 inline isl::multi_aff scale_down(long v) const;
2347 inline isl::multi_aff set_at(int pos, isl::aff el) const;
2348 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2349 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2350 inline isl::multi_aff set_range_tuple(isl::id id) const;
2351 inline isl::multi_aff set_range_tuple(const std::string &id) const;
2352 inline unsigned size() const;
2353 inline isl::space space() const;
2354 inline isl::space get_space() const;
2355 inline isl::multi_aff sub(isl::multi_aff multi2) const;
2356 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2357 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2358 inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2359 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2360 inline isl::multi_aff sub(const isl::aff &multi2) const;
2361 inline isl::pw_multi_aff subtract_domain(const isl::set &set) const;
2362 inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
2363 inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
2364 inline isl::pw_multi_aff_list to_list() const;
2365 inline isl::multi_pw_aff to_multi_pw_aff() const;
2366 inline isl::multi_union_pw_aff to_multi_union_pw_aff() const;
2367 inline isl::pw_multi_aff to_pw_multi_aff() const;
2368 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2369 inline isl::multi_aff unbind_params_insert_domain(isl::multi_id domain) const;
2370 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2371 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2372 inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2373 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2374 static inline isl::multi_aff zero(isl::space space);
2377 // declarations for isl::multi_id
2378 inline multi_id manage(__isl_take isl_multi_id *ptr);
2379 inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2381 class multi_id {
2382 friend inline multi_id manage(__isl_take isl_multi_id *ptr);
2383 friend inline multi_id manage_copy(__isl_keep isl_multi_id *ptr);
2385 protected:
2386 isl_multi_id *ptr = nullptr;
2388 inline explicit multi_id(__isl_take isl_multi_id *ptr);
2390 public:
2391 inline /* implicit */ multi_id();
2392 inline /* implicit */ multi_id(const multi_id &obj);
2393 inline explicit multi_id(isl::space space, isl::id_list list);
2394 inline explicit multi_id(isl::ctx ctx, const std::string &str);
2395 inline multi_id &operator=(multi_id obj);
2396 inline ~multi_id();
2397 inline __isl_give isl_multi_id *copy() const &;
2398 inline __isl_give isl_multi_id *copy() && = delete;
2399 inline __isl_keep isl_multi_id *get() const;
2400 inline __isl_give isl_multi_id *release();
2401 inline bool is_null() const;
2402 inline isl::ctx ctx() const;
2404 inline isl::id at(int pos) const;
2405 inline isl::id get_at(int pos) const;
2406 inline isl::multi_id flat_range_product(isl::multi_id multi2) const;
2407 inline isl::id_list list() const;
2408 inline isl::id_list get_list() const;
2409 inline bool plain_is_equal(const isl::multi_id &multi2) const;
2410 inline isl::multi_id range_product(isl::multi_id multi2) const;
2411 inline isl::multi_id set_at(int pos, isl::id el) const;
2412 inline isl::multi_id set_at(int pos, const std::string &el) const;
2413 inline unsigned size() const;
2414 inline isl::space space() const;
2415 inline isl::space get_space() const;
2418 // declarations for isl::multi_pw_aff
2419 inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2420 inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2422 class multi_pw_aff {
2423 friend inline multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr);
2424 friend inline multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr);
2426 protected:
2427 isl_multi_pw_aff *ptr = nullptr;
2429 inline explicit multi_pw_aff(__isl_take isl_multi_pw_aff *ptr);
2431 public:
2432 inline /* implicit */ multi_pw_aff();
2433 inline /* implicit */ multi_pw_aff(const multi_pw_aff &obj);
2434 inline /* implicit */ multi_pw_aff(isl::aff aff);
2435 inline /* implicit */ multi_pw_aff(isl::multi_aff ma);
2436 inline /* implicit */ multi_pw_aff(isl::pw_aff pa);
2437 inline explicit multi_pw_aff(isl::space space, isl::pw_aff_list list);
2438 inline /* implicit */ multi_pw_aff(isl::pw_multi_aff pma);
2439 inline explicit multi_pw_aff(isl::ctx ctx, const std::string &str);
2440 inline multi_pw_aff &operator=(multi_pw_aff obj);
2441 inline ~multi_pw_aff();
2442 inline __isl_give isl_multi_pw_aff *copy() const &;
2443 inline __isl_give isl_multi_pw_aff *copy() && = delete;
2444 inline __isl_keep isl_multi_pw_aff *get() const;
2445 inline __isl_give isl_multi_pw_aff *release();
2446 inline bool is_null() const;
2447 inline isl::ctx ctx() const;
2449 inline isl::multi_pw_aff add(isl::multi_pw_aff multi2) const;
2450 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2451 inline isl::multi_pw_aff add(const isl::aff &multi2) const;
2452 inline isl::multi_pw_aff add(const isl::multi_aff &multi2) const;
2453 inline isl::multi_pw_aff add(const isl::pw_aff &multi2) const;
2454 inline isl::multi_pw_aff add(const isl::pw_multi_aff &multi2) const;
2455 inline isl::multi_pw_aff add_constant(isl::multi_val mv) const;
2456 inline isl::multi_pw_aff add_constant(isl::val v) const;
2457 inline isl::multi_pw_aff add_constant(long v) const;
2458 inline isl::map as_map() const;
2459 inline isl::multi_aff as_multi_aff() const;
2460 inline isl::set as_set() const;
2461 inline isl::pw_aff at(int pos) const;
2462 inline isl::pw_aff get_at(int pos) const;
2463 inline isl::set bind(isl::multi_id tuple) const;
2464 inline isl::multi_pw_aff bind_domain(isl::multi_id tuple) const;
2465 inline isl::multi_pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2466 inline isl::multi_pw_aff coalesce() const;
2467 inline isl::set domain() const;
2468 inline isl::multi_pw_aff domain_reverse() const;
2469 inline isl::multi_pw_aff flat_range_product(isl::multi_pw_aff multi2) const;
2470 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2471 inline isl::multi_pw_aff flat_range_product(const isl::aff &multi2) const;
2472 inline isl::multi_pw_aff flat_range_product(const isl::multi_aff &multi2) const;
2473 inline isl::multi_pw_aff flat_range_product(const isl::pw_aff &multi2) const;
2474 inline isl::multi_pw_aff flat_range_product(const isl::pw_multi_aff &multi2) const;
2475 inline isl::multi_pw_aff gist(isl::set set) const;
2476 inline isl::multi_union_pw_aff gist(const isl::union_set &context) const;
2477 inline isl::multi_pw_aff gist(const isl::basic_set &set) const;
2478 inline isl::multi_pw_aff gist(const isl::point &set) const;
2479 inline isl::multi_pw_aff gist_params(isl::set set) const;
2480 inline bool has_range_tuple_id() const;
2481 inline isl::multi_pw_aff identity() const;
2482 static inline isl::multi_pw_aff identity_on_domain(isl::space space);
2483 inline isl::multi_pw_aff insert_domain(isl::space domain) const;
2484 inline isl::multi_pw_aff intersect_domain(isl::set domain) const;
2485 inline isl::multi_union_pw_aff intersect_domain(const isl::union_set &uset) const;
2486 inline isl::multi_pw_aff intersect_domain(const isl::basic_set &domain) const;
2487 inline isl::multi_pw_aff intersect_domain(const isl::point &domain) const;
2488 inline isl::multi_pw_aff intersect_params(isl::set set) const;
2489 inline bool involves_nan() const;
2490 inline bool involves_param(const isl::id &id) const;
2491 inline bool involves_param(const std::string &id) const;
2492 inline bool involves_param(const isl::id_list &list) const;
2493 inline bool isa_multi_aff() const;
2494 inline isl::pw_aff_list list() const;
2495 inline isl::pw_aff_list get_list() const;
2496 inline isl::multi_pw_aff max(isl::multi_pw_aff multi2) const;
2497 inline isl::multi_val max_multi_val() const;
2498 inline isl::multi_pw_aff min(isl::multi_pw_aff multi2) const;
2499 inline isl::multi_val min_multi_val() const;
2500 inline isl::multi_pw_aff neg() const;
2501 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2502 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2503 inline bool plain_is_equal(const isl::aff &multi2) const;
2504 inline bool plain_is_equal(const isl::multi_aff &multi2) const;
2505 inline bool plain_is_equal(const isl::pw_aff &multi2) const;
2506 inline bool plain_is_equal(const isl::pw_multi_aff &multi2) const;
2507 inline isl::multi_pw_aff product(isl::multi_pw_aff multi2) const;
2508 inline isl::multi_pw_aff pullback(isl::multi_aff ma) const;
2509 inline isl::multi_pw_aff pullback(isl::multi_pw_aff mpa2) const;
2510 inline isl::multi_pw_aff pullback(isl::pw_multi_aff pma) const;
2511 inline isl::multi_union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2512 inline isl::multi_pw_aff range_product(isl::multi_pw_aff multi2) const;
2513 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2514 inline isl::multi_pw_aff range_product(const isl::aff &multi2) const;
2515 inline isl::multi_pw_aff range_product(const isl::multi_aff &multi2) const;
2516 inline isl::multi_pw_aff range_product(const isl::pw_aff &multi2) const;
2517 inline isl::multi_pw_aff range_product(const isl::pw_multi_aff &multi2) const;
2518 inline isl::id range_tuple_id() const;
2519 inline isl::id get_range_tuple_id() const;
2520 inline isl::multi_pw_aff reset_range_tuple_id() const;
2521 inline isl::multi_pw_aff scale(isl::multi_val mv) const;
2522 inline isl::multi_pw_aff scale(isl::val v) const;
2523 inline isl::multi_pw_aff scale(long v) const;
2524 inline isl::multi_pw_aff scale_down(isl::multi_val mv) const;
2525 inline isl::multi_pw_aff scale_down(isl::val v) const;
2526 inline isl::multi_pw_aff scale_down(long v) const;
2527 inline isl::multi_pw_aff set_at(int pos, isl::pw_aff el) const;
2528 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2529 inline isl::multi_pw_aff set_range_tuple(isl::id id) const;
2530 inline isl::multi_pw_aff set_range_tuple(const std::string &id) const;
2531 inline unsigned size() const;
2532 inline isl::space space() const;
2533 inline isl::space get_space() const;
2534 inline isl::multi_pw_aff sub(isl::multi_pw_aff multi2) const;
2535 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2536 inline isl::multi_pw_aff sub(const isl::aff &multi2) const;
2537 inline isl::multi_pw_aff sub(const isl::multi_aff &multi2) const;
2538 inline isl::multi_pw_aff sub(const isl::pw_aff &multi2) const;
2539 inline isl::multi_pw_aff sub(const isl::pw_multi_aff &multi2) const;
2540 inline isl::multi_pw_aff unbind_params_insert_domain(isl::multi_id domain) const;
2541 inline isl::multi_pw_aff union_add(isl::multi_pw_aff mpa2) const;
2542 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2543 inline isl::multi_pw_aff union_add(const isl::aff &mpa2) const;
2544 inline isl::multi_pw_aff union_add(const isl::multi_aff &mpa2) const;
2545 inline isl::multi_pw_aff union_add(const isl::pw_aff &mpa2) const;
2546 inline isl::multi_pw_aff union_add(const isl::pw_multi_aff &mpa2) const;
2547 static inline isl::multi_pw_aff zero(isl::space space);
2550 // declarations for isl::multi_union_pw_aff
2551 inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2552 inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2554 class multi_union_pw_aff {
2555 friend inline multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr);
2556 friend inline multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr);
2558 protected:
2559 isl_multi_union_pw_aff *ptr = nullptr;
2561 inline explicit multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr);
2563 public:
2564 inline /* implicit */ multi_union_pw_aff();
2565 inline /* implicit */ multi_union_pw_aff(const multi_union_pw_aff &obj);
2566 inline /* implicit */ multi_union_pw_aff(isl::multi_pw_aff mpa);
2567 inline /* implicit */ multi_union_pw_aff(isl::union_pw_aff upa);
2568 inline explicit multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list);
2569 inline explicit multi_union_pw_aff(isl::ctx ctx, const std::string &str);
2570 inline multi_union_pw_aff &operator=(multi_union_pw_aff obj);
2571 inline ~multi_union_pw_aff();
2572 inline __isl_give isl_multi_union_pw_aff *copy() const &;
2573 inline __isl_give isl_multi_union_pw_aff *copy() && = delete;
2574 inline __isl_keep isl_multi_union_pw_aff *get() const;
2575 inline __isl_give isl_multi_union_pw_aff *release();
2576 inline bool is_null() const;
2577 inline isl::ctx ctx() const;
2579 inline isl::multi_union_pw_aff add(isl::multi_union_pw_aff multi2) const;
2580 inline isl::union_pw_aff at(int pos) const;
2581 inline isl::union_pw_aff get_at(int pos) const;
2582 inline isl::union_set bind(isl::multi_id tuple) const;
2583 inline isl::multi_union_pw_aff coalesce() const;
2584 inline isl::union_set domain() const;
2585 inline isl::multi_union_pw_aff flat_range_product(isl::multi_union_pw_aff multi2) const;
2586 inline isl::multi_union_pw_aff gist(isl::union_set context) const;
2587 inline isl::multi_union_pw_aff gist_params(isl::set context) const;
2588 inline bool has_range_tuple_id() const;
2589 inline isl::multi_union_pw_aff intersect_domain(isl::union_set uset) const;
2590 inline isl::multi_union_pw_aff intersect_params(isl::set params) const;
2591 inline bool involves_nan() const;
2592 inline isl::union_pw_aff_list list() const;
2593 inline isl::union_pw_aff_list get_list() const;
2594 inline isl::multi_union_pw_aff neg() const;
2595 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2596 inline isl::multi_union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
2597 inline isl::multi_union_pw_aff range_product(isl::multi_union_pw_aff multi2) const;
2598 inline isl::id range_tuple_id() const;
2599 inline isl::id get_range_tuple_id() const;
2600 inline isl::multi_union_pw_aff reset_range_tuple_id() const;
2601 inline isl::multi_union_pw_aff scale(isl::multi_val mv) const;
2602 inline isl::multi_union_pw_aff scale(isl::val v) const;
2603 inline isl::multi_union_pw_aff scale(long v) const;
2604 inline isl::multi_union_pw_aff scale_down(isl::multi_val mv) const;
2605 inline isl::multi_union_pw_aff scale_down(isl::val v) const;
2606 inline isl::multi_union_pw_aff scale_down(long v) const;
2607 inline isl::multi_union_pw_aff set_at(int pos, isl::union_pw_aff el) const;
2608 inline isl::multi_union_pw_aff set_range_tuple(isl::id id) const;
2609 inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
2610 inline unsigned size() const;
2611 inline isl::space space() const;
2612 inline isl::space get_space() const;
2613 inline isl::multi_union_pw_aff sub(isl::multi_union_pw_aff multi2) const;
2614 inline isl::multi_union_pw_aff union_add(isl::multi_union_pw_aff mupa2) const;
2615 static inline isl::multi_union_pw_aff zero(isl::space space);
2618 // declarations for isl::multi_val
2619 inline multi_val manage(__isl_take isl_multi_val *ptr);
2620 inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2622 class multi_val {
2623 friend inline multi_val manage(__isl_take isl_multi_val *ptr);
2624 friend inline multi_val manage_copy(__isl_keep isl_multi_val *ptr);
2626 protected:
2627 isl_multi_val *ptr = nullptr;
2629 inline explicit multi_val(__isl_take isl_multi_val *ptr);
2631 public:
2632 inline /* implicit */ multi_val();
2633 inline /* implicit */ multi_val(const multi_val &obj);
2634 inline explicit multi_val(isl::space space, isl::val_list list);
2635 inline explicit multi_val(isl::ctx ctx, const std::string &str);
2636 inline multi_val &operator=(multi_val obj);
2637 inline ~multi_val();
2638 inline __isl_give isl_multi_val *copy() const &;
2639 inline __isl_give isl_multi_val *copy() && = delete;
2640 inline __isl_keep isl_multi_val *get() const;
2641 inline __isl_give isl_multi_val *release();
2642 inline bool is_null() const;
2643 inline isl::ctx ctx() const;
2645 inline isl::multi_val add(isl::multi_val multi2) const;
2646 inline isl::multi_val add(isl::val v) const;
2647 inline isl::multi_val add(long v) const;
2648 inline isl::val at(int pos) const;
2649 inline isl::val get_at(int pos) const;
2650 inline isl::multi_val flat_range_product(isl::multi_val multi2) const;
2651 inline bool has_range_tuple_id() const;
2652 inline bool involves_nan() const;
2653 inline isl::val_list list() const;
2654 inline isl::val_list get_list() const;
2655 inline isl::multi_val max(isl::multi_val multi2) const;
2656 inline isl::multi_val min(isl::multi_val multi2) const;
2657 inline isl::multi_val neg() const;
2658 inline bool plain_is_equal(const isl::multi_val &multi2) const;
2659 inline isl::multi_val product(isl::multi_val multi2) const;
2660 inline isl::multi_val range_product(isl::multi_val multi2) const;
2661 inline isl::id range_tuple_id() const;
2662 inline isl::id get_range_tuple_id() const;
2663 inline isl::multi_val reset_range_tuple_id() const;
2664 inline isl::multi_val scale(isl::multi_val mv) const;
2665 inline isl::multi_val scale(isl::val v) const;
2666 inline isl::multi_val scale(long v) const;
2667 inline isl::multi_val scale_down(isl::multi_val mv) const;
2668 inline isl::multi_val scale_down(isl::val v) const;
2669 inline isl::multi_val scale_down(long v) const;
2670 inline isl::multi_val set_at(int pos, isl::val el) const;
2671 inline isl::multi_val set_at(int pos, long el) const;
2672 inline isl::multi_val set_range_tuple(isl::id id) const;
2673 inline isl::multi_val set_range_tuple(const std::string &id) const;
2674 inline unsigned size() const;
2675 inline isl::space space() const;
2676 inline isl::space get_space() const;
2677 inline isl::multi_val sub(isl::multi_val multi2) const;
2678 static inline isl::multi_val zero(isl::space space);
2681 // declarations for isl::point
2682 inline point manage(__isl_take isl_point *ptr);
2683 inline point manage_copy(__isl_keep isl_point *ptr);
2685 class point {
2686 friend inline point manage(__isl_take isl_point *ptr);
2687 friend inline point manage_copy(__isl_keep isl_point *ptr);
2689 protected:
2690 isl_point *ptr = nullptr;
2692 inline explicit point(__isl_take isl_point *ptr);
2694 public:
2695 inline /* implicit */ point();
2696 inline /* implicit */ point(const point &obj);
2697 inline point &operator=(point obj);
2698 inline ~point();
2699 inline __isl_give isl_point *copy() const &;
2700 inline __isl_give isl_point *copy() && = delete;
2701 inline __isl_keep isl_point *get() const;
2702 inline __isl_give isl_point *release();
2703 inline bool is_null() const;
2704 inline isl::ctx ctx() const;
2706 inline isl::basic_set affine_hull() const;
2707 inline isl::basic_set apply(const isl::basic_map &bmap) const;
2708 inline isl::set apply(const isl::map &map) const;
2709 inline isl::union_set apply(const isl::union_map &umap) const;
2710 inline isl::pw_multi_aff as_pw_multi_aff() const;
2711 inline isl::set as_set() const;
2712 inline isl::set bind(const isl::multi_id &tuple) const;
2713 inline isl::set coalesce() const;
2714 inline isl::set complement() const;
2715 inline isl::union_set compute_divs() const;
2716 inline isl::basic_set detect_equalities() const;
2717 inline isl::val dim_max_val(int pos) const;
2718 inline isl::val dim_min_val(int pos) const;
2719 inline isl::set drop_unused_params() const;
2720 inline bool every_set(const std::function<bool(isl::set)> &test) const;
2721 inline isl::set extract_set(const isl::space &space) const;
2722 inline isl::basic_set flatten() const;
2723 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
2724 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
2725 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
2726 inline isl::basic_set gist(const isl::basic_set &context) const;
2727 inline isl::set gist(const isl::set &context) const;
2728 inline isl::union_set gist(const isl::union_set &context) const;
2729 inline isl::set gist_params(const isl::set &context) const;
2730 inline isl::map identity() const;
2731 inline isl::pw_aff indicator_function() const;
2732 inline isl::map insert_domain(const isl::space &domain) const;
2733 inline isl::basic_set intersect(const isl::basic_set &bset2) const;
2734 inline isl::set intersect(const isl::set &set2) const;
2735 inline isl::union_set intersect(const isl::union_set &uset2) const;
2736 inline isl::basic_set intersect_params(const isl::basic_set &bset2) const;
2737 inline isl::set intersect_params(const isl::set &params) const;
2738 inline bool involves_locals() const;
2739 inline bool is_disjoint(const isl::set &set2) const;
2740 inline bool is_disjoint(const isl::union_set &uset2) const;
2741 inline bool is_empty() const;
2742 inline bool is_equal(const isl::basic_set &bset2) const;
2743 inline bool is_equal(const isl::set &set2) const;
2744 inline bool is_equal(const isl::union_set &uset2) const;
2745 inline bool is_singleton() const;
2746 inline bool is_strict_subset(const isl::set &set2) const;
2747 inline bool is_strict_subset(const isl::union_set &uset2) const;
2748 inline bool is_subset(const isl::basic_set &bset2) const;
2749 inline bool is_subset(const isl::set &set2) const;
2750 inline bool is_subset(const isl::union_set &uset2) const;
2751 inline bool is_wrapping() const;
2752 inline bool isa_set() const;
2753 inline isl::fixed_box lattice_tile() const;
2754 inline isl::set lexmax() const;
2755 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
2756 inline isl::set lexmin() const;
2757 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
2758 inline isl::set lower_bound(const isl::multi_pw_aff &lower) const;
2759 inline isl::set lower_bound(const isl::multi_val &lower) const;
2760 inline isl::multi_pw_aff max_multi_pw_aff() const;
2761 inline isl::val max_val(const isl::aff &obj) const;
2762 inline isl::multi_pw_aff min_multi_pw_aff() const;
2763 inline isl::val min_val(const isl::aff &obj) const;
2764 inline isl::multi_val multi_val() const;
2765 inline isl::multi_val get_multi_val() const;
2766 inline unsigned n_basic_set() const;
2767 inline isl::pw_aff param_pw_aff_on_domain(const isl::id &id) const;
2768 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
2769 inline isl::basic_set params() const;
2770 inline isl::multi_val plain_multi_val_if_fixed() const;
2771 inline isl::basic_set polyhedral_hull() const;
2772 inline isl::set preimage(const isl::multi_aff &ma) const;
2773 inline isl::set preimage(const isl::multi_pw_aff &mpa) const;
2774 inline isl::set preimage(const isl::pw_multi_aff &pma) const;
2775 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
2776 inline isl::set product(const isl::set &set2) const;
2777 inline isl::set project_out_all_params() const;
2778 inline isl::set project_out_param(const isl::id &id) const;
2779 inline isl::set project_out_param(const std::string &id) const;
2780 inline isl::set project_out_param(const isl::id_list &list) const;
2781 inline isl::pw_aff pw_aff_on_domain(const isl::val &v) const;
2782 inline isl::pw_aff pw_aff_on_domain(long v) const;
2783 inline isl::pw_multi_aff pw_multi_aff_on_domain(const isl::multi_val &mv) const;
2784 inline isl::basic_set sample() const;
2785 inline isl::point sample_point() const;
2786 inline isl::set_list set_list() const;
2787 inline isl::fixed_box simple_fixed_box_hull() const;
2788 inline isl::space space() const;
2789 inline isl::val stride(int pos) const;
2790 inline isl::set subtract(const isl::set &set2) const;
2791 inline isl::union_set subtract(const isl::union_set &uset2) const;
2792 inline isl::set_list to_list() const;
2793 inline isl::set to_set() const;
2794 inline isl::union_set to_union_set() const;
2795 inline isl::map translation() const;
2796 inline unsigned tuple_dim() const;
2797 inline isl::set unbind_params(const isl::multi_id &tuple) const;
2798 inline isl::map unbind_params_insert_domain(const isl::multi_id &domain) const;
2799 inline isl::set unite(const isl::basic_set &bset2) const;
2800 inline isl::set unite(const isl::set &set2) const;
2801 inline isl::union_set unite(const isl::union_set &uset2) const;
2802 inline isl::basic_set unshifted_simple_hull() const;
2803 inline isl::map unwrap() const;
2804 inline isl::set upper_bound(const isl::multi_pw_aff &upper) const;
2805 inline isl::set upper_bound(const isl::multi_val &upper) const;
2806 inline isl::set wrapped_reverse() const;
2809 // declarations for isl::pw_aff
2810 inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2811 inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2813 class pw_aff {
2814 friend inline pw_aff manage(__isl_take isl_pw_aff *ptr);
2815 friend inline pw_aff manage_copy(__isl_keep isl_pw_aff *ptr);
2817 protected:
2818 isl_pw_aff *ptr = nullptr;
2820 inline explicit pw_aff(__isl_take isl_pw_aff *ptr);
2822 public:
2823 inline /* implicit */ pw_aff();
2824 inline /* implicit */ pw_aff(const pw_aff &obj);
2825 inline /* implicit */ pw_aff(isl::aff aff);
2826 inline explicit pw_aff(isl::ctx ctx, const std::string &str);
2827 inline pw_aff &operator=(pw_aff obj);
2828 inline ~pw_aff();
2829 inline __isl_give isl_pw_aff *copy() const &;
2830 inline __isl_give isl_pw_aff *copy() && = delete;
2831 inline __isl_keep isl_pw_aff *get() const;
2832 inline __isl_give isl_pw_aff *release();
2833 inline bool is_null() const;
2834 inline isl::ctx ctx() const;
2836 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
2837 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
2838 inline isl::pw_aff add(isl::pw_aff pwaff2) const;
2839 inline isl::pw_multi_aff add(const isl::pw_multi_aff &pma2) const;
2840 inline isl::union_pw_aff add(const isl::union_pw_aff &upa2) const;
2841 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
2842 inline isl::pw_aff add(const isl::aff &pwaff2) const;
2843 inline isl::pw_aff add_constant(isl::val v) const;
2844 inline isl::pw_aff add_constant(long v) const;
2845 inline isl::pw_multi_aff add_constant(const isl::multi_val &mv) const;
2846 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
2847 inline isl::aff as_aff() const;
2848 inline isl::map as_map() const;
2849 inline isl::multi_aff as_multi_aff() const;
2850 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
2851 inline isl::pw_multi_aff as_pw_multi_aff() const;
2852 inline isl::set as_set() const;
2853 inline isl::union_map as_union_map() const;
2854 inline isl::pw_aff at(int pos) const;
2855 inline isl::set bind(const isl::multi_id &tuple) const;
2856 inline isl::set bind(isl::id id) const;
2857 inline isl::set bind(const std::string &id) const;
2858 inline isl::pw_aff bind_domain(isl::multi_id tuple) const;
2859 inline isl::pw_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
2860 inline isl::pw_aff ceil() const;
2861 inline isl::pw_aff coalesce() const;
2862 inline isl::pw_aff cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const;
2863 inline isl::pw_aff div(isl::pw_aff pa2) const;
2864 inline isl::set domain() const;
2865 inline isl::pw_aff domain_reverse() const;
2866 inline isl::pw_aff drop_unused_params() const;
2867 inline isl::set eq_set(isl::pw_aff pwaff2) const;
2868 inline isl::val eval(isl::point pnt) const;
2869 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
2870 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
2871 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
2872 inline isl::pw_multi_aff flat_range_product(const isl::pw_multi_aff &pma2) const;
2873 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
2874 inline isl::pw_aff floor() const;
2875 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
2876 inline isl::set ge_set(isl::pw_aff pwaff2) const;
2877 inline isl::pw_aff gist(isl::set context) const;
2878 inline isl::union_pw_aff gist(const isl::union_set &context) const;
2879 inline isl::pw_aff gist(const isl::basic_set &context) const;
2880 inline isl::pw_aff gist(const isl::point &context) const;
2881 inline isl::pw_aff gist_params(isl::set context) const;
2882 inline isl::set gt_set(isl::pw_aff pwaff2) const;
2883 inline bool has_range_tuple_id() const;
2884 inline isl::multi_pw_aff identity() const;
2885 inline isl::pw_aff insert_domain(isl::space domain) const;
2886 inline isl::pw_aff intersect_domain(isl::set set) const;
2887 inline isl::union_pw_aff intersect_domain(const isl::space &space) const;
2888 inline isl::union_pw_aff intersect_domain(const isl::union_set &uset) const;
2889 inline isl::pw_aff intersect_domain(const isl::basic_set &set) const;
2890 inline isl::pw_aff intersect_domain(const isl::point &set) const;
2891 inline isl::union_pw_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
2892 inline isl::union_pw_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
2893 inline isl::pw_aff intersect_params(isl::set set) const;
2894 inline bool involves_locals() const;
2895 inline bool involves_nan() const;
2896 inline bool involves_param(const isl::id &id) const;
2897 inline bool involves_param(const std::string &id) const;
2898 inline bool involves_param(const isl::id_list &list) const;
2899 inline bool isa_aff() const;
2900 inline bool isa_multi_aff() const;
2901 inline bool isa_pw_multi_aff() const;
2902 inline isl::set le_set(isl::pw_aff pwaff2) const;
2903 inline isl::pw_aff_list list() const;
2904 inline isl::set lt_set(isl::pw_aff pwaff2) const;
2905 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
2906 inline isl::pw_aff max(isl::pw_aff pwaff2) const;
2907 inline isl::pw_aff max(const isl::aff &pwaff2) const;
2908 inline isl::multi_val max_multi_val() const;
2909 inline isl::val max_val() const;
2910 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
2911 inline isl::pw_aff min(isl::pw_aff pwaff2) const;
2912 inline isl::pw_aff min(const isl::aff &pwaff2) const;
2913 inline isl::multi_val min_multi_val() const;
2914 inline isl::val min_val() const;
2915 inline isl::pw_aff mod(isl::val mod) const;
2916 inline isl::pw_aff mod(long mod) const;
2917 inline isl::pw_aff mul(isl::pw_aff pwaff2) const;
2918 inline unsigned n_piece() const;
2919 inline isl::set ne_set(isl::pw_aff pwaff2) const;
2920 inline isl::pw_aff neg() const;
2921 static inline isl::pw_aff param_on_domain(isl::set domain, isl::id id);
2922 inline isl::set params() const;
2923 inline bool plain_is_empty() const;
2924 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
2925 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
2926 inline bool plain_is_equal(const isl::pw_aff &pwaff2) const;
2927 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
2928 inline bool plain_is_equal(const isl::union_pw_aff &upa2) const;
2929 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
2930 inline bool plain_is_equal(const isl::aff &pwaff2) const;
2931 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const;
2932 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
2933 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
2934 inline isl::pw_multi_aff product(const isl::pw_multi_aff &pma2) const;
2935 inline isl::pw_aff pullback(isl::multi_aff ma) const;
2936 inline isl::pw_aff pullback(isl::multi_pw_aff mpa) const;
2937 inline isl::pw_aff pullback(isl::pw_multi_aff pma) const;
2938 inline isl::union_pw_aff pullback(const isl::union_pw_multi_aff &upma) const;
2939 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
2940 inline isl::pw_multi_aff range_factor_domain() const;
2941 inline isl::pw_multi_aff range_factor_range() const;
2942 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
2943 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
2944 inline isl::pw_multi_aff range_product(const isl::pw_multi_aff &pma2) const;
2945 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
2946 inline isl::id range_tuple_id() const;
2947 inline isl::multi_pw_aff reset_range_tuple_id() const;
2948 inline isl::pw_aff scale(isl::val v) const;
2949 inline isl::pw_aff scale(long v) const;
2950 inline isl::pw_multi_aff scale(const isl::multi_val &mv) const;
2951 inline isl::pw_aff scale_down(isl::val f) const;
2952 inline isl::pw_aff scale_down(long f) const;
2953 inline isl::pw_multi_aff scale_down(const isl::multi_val &mv) const;
2954 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
2955 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
2956 inline isl::pw_multi_aff set_range_tuple(const isl::id &id) const;
2957 inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
2958 inline unsigned size() const;
2959 inline isl::space space() const;
2960 inline isl::space get_space() const;
2961 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
2962 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
2963 inline isl::pw_aff sub(isl::pw_aff pwaff2) const;
2964 inline isl::pw_multi_aff sub(const isl::pw_multi_aff &pma2) const;
2965 inline isl::union_pw_aff sub(const isl::union_pw_aff &upa2) const;
2966 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
2967 inline isl::pw_aff sub(const isl::aff &pwaff2) const;
2968 inline isl::pw_aff subtract_domain(isl::set set) const;
2969 inline isl::union_pw_aff subtract_domain(const isl::space &space) const;
2970 inline isl::union_pw_aff subtract_domain(const isl::union_set &uset) const;
2971 inline isl::pw_aff subtract_domain(const isl::basic_set &set) const;
2972 inline isl::pw_aff subtract_domain(const isl::point &set) const;
2973 inline isl::pw_aff tdiv_q(isl::pw_aff pa2) const;
2974 inline isl::pw_aff tdiv_r(isl::pw_aff pa2) const;
2975 inline isl::pw_aff_list to_list() const;
2976 inline isl::multi_pw_aff to_multi_pw_aff() const;
2977 inline isl::union_pw_aff to_union_pw_aff() const;
2978 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
2979 inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
2980 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
2981 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
2982 inline isl::pw_aff union_add(isl::pw_aff pwaff2) const;
2983 inline isl::pw_multi_aff union_add(const isl::pw_multi_aff &pma2) const;
2984 inline isl::union_pw_aff union_add(const isl::union_pw_aff &upa2) const;
2985 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
2986 inline isl::pw_aff union_add(const isl::aff &pwaff2) const;
2989 // declarations for isl::pw_aff_list
2990 inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2991 inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2993 class pw_aff_list {
2994 friend inline pw_aff_list manage(__isl_take isl_pw_aff_list *ptr);
2995 friend inline pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr);
2997 protected:
2998 isl_pw_aff_list *ptr = nullptr;
3000 inline explicit pw_aff_list(__isl_take isl_pw_aff_list *ptr);
3002 public:
3003 inline /* implicit */ pw_aff_list();
3004 inline /* implicit */ pw_aff_list(const pw_aff_list &obj);
3005 inline explicit pw_aff_list(isl::ctx ctx, int n);
3006 inline explicit pw_aff_list(isl::pw_aff el);
3007 inline explicit pw_aff_list(isl::ctx ctx, const std::string &str);
3008 inline pw_aff_list &operator=(pw_aff_list obj);
3009 inline ~pw_aff_list();
3010 inline __isl_give isl_pw_aff_list *copy() const &;
3011 inline __isl_give isl_pw_aff_list *copy() && = delete;
3012 inline __isl_keep isl_pw_aff_list *get() const;
3013 inline __isl_give isl_pw_aff_list *release();
3014 inline bool is_null() const;
3015 inline isl::ctx ctx() const;
3017 inline isl::pw_aff_list add(isl::pw_aff el) const;
3018 inline isl::pw_aff at(int index) const;
3019 inline isl::pw_aff get_at(int index) const;
3020 inline isl::pw_aff_list clear() const;
3021 inline isl::pw_aff_list concat(isl::pw_aff_list list2) const;
3022 inline isl::pw_aff_list drop(unsigned int first, unsigned int n) const;
3023 inline void foreach(const std::function<void(isl::pw_aff)> &fn) const;
3024 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;
3025 inline isl::pw_aff_list insert(unsigned int pos, isl::pw_aff el) const;
3026 inline isl::pw_aff_list set_at(int index, isl::pw_aff el) const;
3027 inline unsigned size() const;
3030 // declarations for isl::pw_multi_aff
3031 inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
3032 inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
3034 class pw_multi_aff {
3035 friend inline pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr);
3036 friend inline pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr);
3038 protected:
3039 isl_pw_multi_aff *ptr = nullptr;
3041 inline explicit pw_multi_aff(__isl_take isl_pw_multi_aff *ptr);
3043 public:
3044 inline /* implicit */ pw_multi_aff();
3045 inline /* implicit */ pw_multi_aff(const pw_multi_aff &obj);
3046 inline /* implicit */ pw_multi_aff(isl::multi_aff ma);
3047 inline /* implicit */ pw_multi_aff(isl::pw_aff pa);
3048 inline explicit pw_multi_aff(isl::ctx ctx, const std::string &str);
3049 inline pw_multi_aff &operator=(pw_multi_aff obj);
3050 inline ~pw_multi_aff();
3051 inline __isl_give isl_pw_multi_aff *copy() const &;
3052 inline __isl_give isl_pw_multi_aff *copy() && = delete;
3053 inline __isl_keep isl_pw_multi_aff *get() const;
3054 inline __isl_give isl_pw_multi_aff *release();
3055 inline bool is_null() const;
3056 inline isl::ctx ctx() const;
3058 inline isl::multi_pw_aff add(const isl::multi_pw_aff &multi2) const;
3059 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
3060 inline isl::pw_multi_aff add(isl::pw_multi_aff pma2) const;
3061 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
3062 inline isl::pw_multi_aff add(const isl::multi_aff &pma2) const;
3063 inline isl::pw_multi_aff add(const isl::pw_aff &pma2) const;
3064 inline isl::pw_multi_aff add_constant(isl::multi_val mv) const;
3065 inline isl::pw_multi_aff add_constant(isl::val v) const;
3066 inline isl::pw_multi_aff add_constant(long v) const;
3067 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
3068 inline isl::map as_map() const;
3069 inline isl::multi_aff as_multi_aff() const;
3070 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
3071 inline isl::pw_multi_aff as_pw_multi_aff() const;
3072 inline isl::set as_set() const;
3073 inline isl::union_map as_union_map() const;
3074 inline isl::pw_aff at(int pos) const;
3075 inline isl::pw_aff get_at(int pos) const;
3076 inline isl::set bind(const isl::multi_id &tuple) const;
3077 inline isl::pw_multi_aff bind_domain(isl::multi_id tuple) const;
3078 inline isl::pw_multi_aff bind_domain_wrapped_domain(isl::multi_id tuple) const;
3079 inline isl::pw_multi_aff coalesce() const;
3080 inline isl::set domain() const;
3081 static inline isl::pw_multi_aff domain_map(isl::space space);
3082 inline isl::pw_multi_aff domain_reverse() const;
3083 inline isl::pw_multi_aff drop_unused_params() const;
3084 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
3085 inline isl::multi_pw_aff flat_range_product(const isl::multi_pw_aff &multi2) const;
3086 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
3087 inline isl::pw_multi_aff flat_range_product(isl::pw_multi_aff pma2) const;
3088 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
3089 inline isl::pw_multi_aff flat_range_product(const isl::multi_aff &pma2) const;
3090 inline isl::pw_multi_aff flat_range_product(const isl::pw_aff &pma2) const;
3091 inline void foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const;
3092 inline isl::pw_multi_aff gist(isl::set set) const;
3093 inline isl::union_pw_multi_aff gist(const isl::union_set &context) const;
3094 inline isl::pw_multi_aff gist(const isl::basic_set &set) const;
3095 inline isl::pw_multi_aff gist(const isl::point &set) const;
3096 inline isl::pw_multi_aff gist_params(isl::set set) const;
3097 inline bool has_range_tuple_id() const;
3098 inline isl::multi_pw_aff identity() const;
3099 static inline isl::pw_multi_aff identity_on_domain(isl::space space);
3100 inline isl::pw_multi_aff insert_domain(isl::space domain) const;
3101 inline isl::pw_multi_aff intersect_domain(isl::set set) const;
3102 inline isl::union_pw_multi_aff intersect_domain(const isl::space &space) const;
3103 inline isl::union_pw_multi_aff intersect_domain(const isl::union_set &uset) const;
3104 inline isl::pw_multi_aff intersect_domain(const isl::basic_set &set) const;
3105 inline isl::pw_multi_aff intersect_domain(const isl::point &set) const;
3106 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(const isl::union_set &uset) const;
3107 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(const isl::union_set &uset) const;
3108 inline isl::pw_multi_aff intersect_params(isl::set set) const;
3109 inline bool involves_locals() const;
3110 inline bool involves_nan() const;
3111 inline bool involves_param(const isl::id &id) const;
3112 inline bool involves_param(const std::string &id) const;
3113 inline bool involves_param(const isl::id_list &list) const;
3114 inline bool isa_multi_aff() const;
3115 inline bool isa_pw_multi_aff() const;
3116 inline isl::pw_aff_list list() const;
3117 inline isl::multi_pw_aff max(const isl::multi_pw_aff &multi2) const;
3118 inline isl::multi_val max_multi_val() const;
3119 inline isl::multi_pw_aff min(const isl::multi_pw_aff &multi2) const;
3120 inline isl::multi_val min_multi_val() const;
3121 static inline isl::pw_multi_aff multi_val_on_domain(isl::set domain, isl::multi_val mv);
3122 inline unsigned n_piece() const;
3123 inline isl::multi_pw_aff neg() const;
3124 inline bool plain_is_empty() const;
3125 inline bool plain_is_equal(const isl::multi_pw_aff &multi2) const;
3126 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
3127 inline bool plain_is_equal(const isl::pw_multi_aff &pma2) const;
3128 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
3129 inline bool plain_is_equal(const isl::multi_aff &pma2) const;
3130 inline bool plain_is_equal(const isl::pw_aff &pma2) const;
3131 inline isl::pw_multi_aff preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const;
3132 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
3133 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const;
3134 inline isl::pw_multi_aff preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const;
3135 inline isl::multi_pw_aff product(const isl::multi_pw_aff &multi2) const;
3136 inline isl::pw_multi_aff product(isl::pw_multi_aff pma2) const;
3137 inline isl::pw_multi_aff product(const isl::multi_aff &pma2) const;
3138 inline isl::pw_multi_aff product(const isl::pw_aff &pma2) const;
3139 inline isl::multi_pw_aff pullback(const isl::multi_pw_aff &mpa2) const;
3140 inline isl::pw_multi_aff pullback(isl::multi_aff ma) const;
3141 inline isl::pw_multi_aff pullback(isl::pw_multi_aff pma2) const;
3142 inline isl::union_pw_multi_aff pullback(const isl::union_pw_multi_aff &upma2) const;
3143 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
3144 inline isl::pw_multi_aff range_factor_domain() const;
3145 inline isl::pw_multi_aff range_factor_range() const;
3146 static inline isl::pw_multi_aff range_map(isl::space space);
3147 inline isl::multi_pw_aff range_product(const isl::multi_pw_aff &multi2) const;
3148 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
3149 inline isl::pw_multi_aff range_product(isl::pw_multi_aff pma2) const;
3150 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
3151 inline isl::pw_multi_aff range_product(const isl::multi_aff &pma2) const;
3152 inline isl::pw_multi_aff range_product(const isl::pw_aff &pma2) const;
3153 inline isl::id range_tuple_id() const;
3154 inline isl::id get_range_tuple_id() const;
3155 inline isl::multi_pw_aff reset_range_tuple_id() const;
3156 inline isl::pw_multi_aff scale(isl::multi_val mv) const;
3157 inline isl::pw_multi_aff scale(isl::val v) const;
3158 inline isl::pw_multi_aff scale(long v) const;
3159 inline isl::pw_multi_aff scale_down(isl::multi_val mv) const;
3160 inline isl::pw_multi_aff scale_down(isl::val v) const;
3161 inline isl::pw_multi_aff scale_down(long v) const;
3162 inline isl::multi_pw_aff set_at(int pos, const isl::pw_aff &el) const;
3163 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
3164 inline isl::pw_multi_aff set_range_tuple(isl::id id) const;
3165 inline isl::pw_multi_aff set_range_tuple(const std::string &id) const;
3166 inline unsigned size() const;
3167 inline isl::space space() const;
3168 inline isl::space get_space() const;
3169 inline isl::multi_pw_aff sub(const isl::multi_pw_aff &multi2) const;
3170 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
3171 inline isl::pw_multi_aff sub(isl::pw_multi_aff pma2) const;
3172 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
3173 inline isl::pw_multi_aff sub(const isl::multi_aff &pma2) const;
3174 inline isl::pw_multi_aff sub(const isl::pw_aff &pma2) const;
3175 inline isl::pw_multi_aff subtract_domain(isl::set set) const;
3176 inline isl::union_pw_multi_aff subtract_domain(const isl::space &space) const;
3177 inline isl::union_pw_multi_aff subtract_domain(const isl::union_set &uset) const;
3178 inline isl::pw_multi_aff subtract_domain(const isl::basic_set &set) const;
3179 inline isl::pw_multi_aff subtract_domain(const isl::point &set) const;
3180 inline isl::pw_multi_aff_list to_list() const;
3181 inline isl::multi_pw_aff to_multi_pw_aff() const;
3182 inline isl::union_pw_multi_aff to_union_pw_multi_aff() const;
3183 inline isl::multi_pw_aff unbind_params_insert_domain(const isl::multi_id &domain) const;
3184 inline isl::multi_pw_aff union_add(const isl::multi_pw_aff &mpa2) const;
3185 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
3186 inline isl::pw_multi_aff union_add(isl::pw_multi_aff pma2) const;
3187 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
3188 inline isl::pw_multi_aff union_add(const isl::multi_aff &pma2) const;
3189 inline isl::pw_multi_aff union_add(const isl::pw_aff &pma2) const;
3190 static inline isl::pw_multi_aff zero(isl::space space);
3193 // declarations for isl::pw_multi_aff_list
3194 inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3195 inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3197 class pw_multi_aff_list {
3198 friend inline pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr);
3199 friend inline pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr);
3201 protected:
3202 isl_pw_multi_aff_list *ptr = nullptr;
3204 inline explicit pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr);
3206 public:
3207 inline /* implicit */ pw_multi_aff_list();
3208 inline /* implicit */ pw_multi_aff_list(const pw_multi_aff_list &obj);
3209 inline explicit pw_multi_aff_list(isl::ctx ctx, int n);
3210 inline explicit pw_multi_aff_list(isl::pw_multi_aff el);
3211 inline explicit pw_multi_aff_list(isl::ctx ctx, const std::string &str);
3212 inline pw_multi_aff_list &operator=(pw_multi_aff_list obj);
3213 inline ~pw_multi_aff_list();
3214 inline __isl_give isl_pw_multi_aff_list *copy() const &;
3215 inline __isl_give isl_pw_multi_aff_list *copy() && = delete;
3216 inline __isl_keep isl_pw_multi_aff_list *get() const;
3217 inline __isl_give isl_pw_multi_aff_list *release();
3218 inline bool is_null() const;
3219 inline isl::ctx ctx() const;
3221 inline isl::pw_multi_aff_list add(isl::pw_multi_aff el) const;
3222 inline isl::pw_multi_aff at(int index) const;
3223 inline isl::pw_multi_aff get_at(int index) const;
3224 inline isl::pw_multi_aff_list clear() const;
3225 inline isl::pw_multi_aff_list concat(isl::pw_multi_aff_list list2) const;
3226 inline isl::pw_multi_aff_list drop(unsigned int first, unsigned int n) const;
3227 inline void foreach(const std::function<void(isl::pw_multi_aff)> &fn) const;
3228 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;
3229 inline isl::pw_multi_aff_list insert(unsigned int pos, isl::pw_multi_aff el) const;
3230 inline isl::pw_multi_aff_list set_at(int index, isl::pw_multi_aff el) const;
3231 inline unsigned size() const;
3234 // declarations for isl::schedule
3235 inline schedule manage(__isl_take isl_schedule *ptr);
3236 inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3238 class schedule {
3239 friend inline schedule manage(__isl_take isl_schedule *ptr);
3240 friend inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3242 protected:
3243 isl_schedule *ptr = nullptr;
3245 inline explicit schedule(__isl_take isl_schedule *ptr);
3247 public:
3248 inline /* implicit */ schedule();
3249 inline /* implicit */ schedule(const schedule &obj);
3250 inline explicit schedule(isl::ctx ctx, const std::string &str);
3251 inline schedule &operator=(schedule obj);
3252 inline ~schedule();
3253 inline __isl_give isl_schedule *copy() const &;
3254 inline __isl_give isl_schedule *copy() && = delete;
3255 inline __isl_keep isl_schedule *get() const;
3256 inline __isl_give isl_schedule *release();
3257 inline bool is_null() const;
3258 inline isl::ctx ctx() const;
3260 inline isl::union_set domain() const;
3261 inline isl::union_set get_domain() const;
3262 static inline isl::schedule from_domain(isl::union_set domain);
3263 inline isl::union_map map() const;
3264 inline isl::union_map get_map() const;
3265 inline isl::schedule pullback(isl::union_pw_multi_aff upma) const;
3266 inline isl::schedule_node root() const;
3267 inline isl::schedule_node get_root() const;
3270 // declarations for isl::schedule_constraints
3271 inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3272 inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3274 class schedule_constraints {
3275 friend inline schedule_constraints manage(__isl_take isl_schedule_constraints *ptr);
3276 friend inline schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr);
3278 protected:
3279 isl_schedule_constraints *ptr = nullptr;
3281 inline explicit schedule_constraints(__isl_take isl_schedule_constraints *ptr);
3283 public:
3284 inline /* implicit */ schedule_constraints();
3285 inline /* implicit */ schedule_constraints(const schedule_constraints &obj);
3286 inline explicit schedule_constraints(isl::ctx ctx, const std::string &str);
3287 inline schedule_constraints &operator=(schedule_constraints obj);
3288 inline ~schedule_constraints();
3289 inline __isl_give isl_schedule_constraints *copy() const &;
3290 inline __isl_give isl_schedule_constraints *copy() && = delete;
3291 inline __isl_keep isl_schedule_constraints *get() const;
3292 inline __isl_give isl_schedule_constraints *release();
3293 inline bool is_null() const;
3294 inline isl::ctx ctx() const;
3296 inline isl::union_map coincidence() const;
3297 inline isl::union_map get_coincidence() const;
3298 inline isl::schedule compute_schedule() const;
3299 inline isl::union_map conditional_validity() const;
3300 inline isl::union_map get_conditional_validity() const;
3301 inline isl::union_map conditional_validity_condition() const;
3302 inline isl::union_map get_conditional_validity_condition() const;
3303 inline isl::set context() const;
3304 inline isl::set get_context() const;
3305 inline isl::union_set domain() const;
3306 inline isl::union_set get_domain() const;
3307 static inline isl::schedule_constraints on_domain(isl::union_set domain);
3308 inline isl::union_map proximity() const;
3309 inline isl::union_map get_proximity() const;
3310 inline isl::schedule_constraints set_coincidence(isl::union_map coincidence) const;
3311 inline isl::schedule_constraints set_conditional_validity(isl::union_map condition, isl::union_map validity) const;
3312 inline isl::schedule_constraints set_context(isl::set context) const;
3313 inline isl::schedule_constraints set_proximity(isl::union_map proximity) const;
3314 inline isl::schedule_constraints set_validity(isl::union_map validity) const;
3315 inline isl::union_map validity() const;
3316 inline isl::union_map get_validity() const;
3319 // declarations for isl::schedule_node
3320 inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3321 inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3323 class schedule_node {
3324 friend inline schedule_node manage(__isl_take isl_schedule_node *ptr);
3325 friend inline schedule_node manage_copy(__isl_keep isl_schedule_node *ptr);
3327 protected:
3328 isl_schedule_node *ptr = nullptr;
3330 inline explicit schedule_node(__isl_take isl_schedule_node *ptr);
3332 public:
3333 inline /* implicit */ schedule_node();
3334 inline /* implicit */ schedule_node(const schedule_node &obj);
3335 inline schedule_node &operator=(schedule_node obj);
3336 inline ~schedule_node();
3337 inline __isl_give isl_schedule_node *copy() const &;
3338 inline __isl_give isl_schedule_node *copy() && = delete;
3339 inline __isl_keep isl_schedule_node *get() const;
3340 inline __isl_give isl_schedule_node *release();
3341 inline bool is_null() const;
3342 private:
3343 template <typename T,
3344 typename = typename std::enable_if<std::is_same<
3345 const decltype(isl_schedule_node_get_type(NULL)),
3346 const T>::value>::type>
3347 inline bool isa_type(T subtype) const;
3348 public:
3349 template <class T> inline bool isa() const;
3350 template <class T> inline T as() const;
3351 inline isl::ctx ctx() const;
3353 inline isl::schedule_node ancestor(int generation) const;
3354 inline unsigned ancestor_child_position(const isl::schedule_node &ancestor) const;
3355 inline unsigned get_ancestor_child_position(const isl::schedule_node &ancestor) const;
3356 inline isl::schedule_node child(int pos) const;
3357 inline unsigned child_position() const;
3358 inline unsigned get_child_position() const;
3359 inline bool every_descendant(const std::function<bool(isl::schedule_node)> &test) const;
3360 inline isl::schedule_node first_child() const;
3361 inline void foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const;
3362 inline void foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const;
3363 static inline isl::schedule_node from_domain(isl::union_set domain);
3364 static inline isl::schedule_node from_extension(isl::union_map extension);
3365 inline isl::schedule_node graft_after(isl::schedule_node graft) const;
3366 inline isl::schedule_node graft_before(isl::schedule_node graft) const;
3367 inline bool has_children() const;
3368 inline bool has_next_sibling() const;
3369 inline bool has_parent() const;
3370 inline bool has_previous_sibling() const;
3371 inline isl::schedule_node insert_context(isl::set context) const;
3372 inline isl::schedule_node insert_filter(isl::union_set filter) const;
3373 inline isl::schedule_node insert_guard(isl::set context) const;
3374 inline isl::schedule_node insert_mark(isl::id mark) const;
3375 inline isl::schedule_node insert_mark(const std::string &mark) const;
3376 inline isl::schedule_node insert_partial_schedule(isl::multi_union_pw_aff schedule) const;
3377 inline isl::schedule_node insert_sequence(isl::union_set_list filters) const;
3378 inline isl::schedule_node insert_set(isl::union_set_list filters) const;
3379 inline bool is_equal(const isl::schedule_node &node2) const;
3380 inline bool is_subtree_anchored() const;
3381 inline isl::schedule_node map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const;
3382 inline unsigned n_children() const;
3383 inline isl::schedule_node next_sibling() const;
3384 inline isl::schedule_node order_after(isl::union_set filter) const;
3385 inline isl::schedule_node order_before(isl::union_set filter) const;
3386 inline isl::schedule_node parent() const;
3387 inline isl::multi_union_pw_aff prefix_schedule_multi_union_pw_aff() const;
3388 inline isl::multi_union_pw_aff get_prefix_schedule_multi_union_pw_aff() const;
3389 inline isl::union_map prefix_schedule_union_map() const;
3390 inline isl::union_map get_prefix_schedule_union_map() const;
3391 inline isl::union_pw_multi_aff prefix_schedule_union_pw_multi_aff() const;
3392 inline isl::union_pw_multi_aff get_prefix_schedule_union_pw_multi_aff() const;
3393 inline isl::schedule_node previous_sibling() const;
3394 inline isl::schedule_node root() const;
3395 inline isl::schedule schedule() const;
3396 inline isl::schedule get_schedule() const;
3397 inline isl::schedule_node shared_ancestor(const isl::schedule_node &node2) const;
3398 inline isl::schedule_node get_shared_ancestor(const isl::schedule_node &node2) const;
3399 inline unsigned tree_depth() const;
3400 inline unsigned get_tree_depth() const;
3403 // declarations for isl::schedule_node_band
3405 class schedule_node_band : public schedule_node {
3406 template <class T>
3407 friend bool schedule_node::isa() const;
3408 friend schedule_node_band schedule_node::as<schedule_node_band>() const;
3409 static const auto type = isl_schedule_node_band;
3411 protected:
3412 inline explicit schedule_node_band(__isl_take isl_schedule_node *ptr);
3414 public:
3415 inline /* implicit */ schedule_node_band();
3416 inline /* implicit */ schedule_node_band(const schedule_node_band &obj);
3417 inline schedule_node_band &operator=(schedule_node_band obj);
3418 inline isl::ctx ctx() const;
3420 inline isl::union_set ast_build_options() const;
3421 inline isl::union_set get_ast_build_options() const;
3422 inline isl::set ast_isolate_option() const;
3423 inline isl::set get_ast_isolate_option() const;
3424 inline bool member_get_coincident(int pos) const;
3425 inline schedule_node_band member_set_coincident(int pos, int coincident) const;
3426 inline schedule_node_band mod(isl::multi_val mv) const;
3427 inline unsigned n_member() const;
3428 inline isl::multi_union_pw_aff partial_schedule() const;
3429 inline isl::multi_union_pw_aff get_partial_schedule() const;
3430 inline bool permutable() const;
3431 inline bool get_permutable() const;
3432 inline schedule_node_band scale(isl::multi_val mv) const;
3433 inline schedule_node_band scale_down(isl::multi_val mv) const;
3434 inline schedule_node_band set_ast_build_options(isl::union_set options) const;
3435 inline schedule_node_band set_permutable(int permutable) const;
3436 inline schedule_node_band shift(isl::multi_union_pw_aff shift) const;
3437 inline schedule_node_band split(int pos) const;
3438 inline schedule_node_band tile(isl::multi_val sizes) const;
3439 inline schedule_node_band member_set_ast_loop_default(int pos) const;
3440 inline schedule_node_band member_set_ast_loop_atomic(int pos) const;
3441 inline schedule_node_band member_set_ast_loop_unroll(int pos) const;
3442 inline schedule_node_band member_set_ast_loop_separate(int pos) const;
3445 // declarations for isl::schedule_node_context
3447 class schedule_node_context : public schedule_node {
3448 template <class T>
3449 friend bool schedule_node::isa() const;
3450 friend schedule_node_context schedule_node::as<schedule_node_context>() const;
3451 static const auto type = isl_schedule_node_context;
3453 protected:
3454 inline explicit schedule_node_context(__isl_take isl_schedule_node *ptr);
3456 public:
3457 inline /* implicit */ schedule_node_context();
3458 inline /* implicit */ schedule_node_context(const schedule_node_context &obj);
3459 inline schedule_node_context &operator=(schedule_node_context obj);
3460 inline isl::ctx ctx() const;
3462 inline isl::set context() const;
3463 inline isl::set get_context() const;
3466 // declarations for isl::schedule_node_domain
3468 class schedule_node_domain : public schedule_node {
3469 template <class T>
3470 friend bool schedule_node::isa() const;
3471 friend schedule_node_domain schedule_node::as<schedule_node_domain>() const;
3472 static const auto type = isl_schedule_node_domain;
3474 protected:
3475 inline explicit schedule_node_domain(__isl_take isl_schedule_node *ptr);
3477 public:
3478 inline /* implicit */ schedule_node_domain();
3479 inline /* implicit */ schedule_node_domain(const schedule_node_domain &obj);
3480 inline schedule_node_domain &operator=(schedule_node_domain obj);
3481 inline isl::ctx ctx() const;
3483 inline isl::union_set domain() const;
3484 inline isl::union_set get_domain() const;
3487 // declarations for isl::schedule_node_expansion
3489 class schedule_node_expansion : public schedule_node {
3490 template <class T>
3491 friend bool schedule_node::isa() const;
3492 friend schedule_node_expansion schedule_node::as<schedule_node_expansion>() const;
3493 static const auto type = isl_schedule_node_expansion;
3495 protected:
3496 inline explicit schedule_node_expansion(__isl_take isl_schedule_node *ptr);
3498 public:
3499 inline /* implicit */ schedule_node_expansion();
3500 inline /* implicit */ schedule_node_expansion(const schedule_node_expansion &obj);
3501 inline schedule_node_expansion &operator=(schedule_node_expansion obj);
3502 inline isl::ctx ctx() const;
3504 inline isl::union_pw_multi_aff contraction() const;
3505 inline isl::union_pw_multi_aff get_contraction() const;
3506 inline isl::union_map expansion() const;
3507 inline isl::union_map get_expansion() const;
3510 // declarations for isl::schedule_node_extension
3512 class schedule_node_extension : public schedule_node {
3513 template <class T>
3514 friend bool schedule_node::isa() const;
3515 friend schedule_node_extension schedule_node::as<schedule_node_extension>() const;
3516 static const auto type = isl_schedule_node_extension;
3518 protected:
3519 inline explicit schedule_node_extension(__isl_take isl_schedule_node *ptr);
3521 public:
3522 inline /* implicit */ schedule_node_extension();
3523 inline /* implicit */ schedule_node_extension(const schedule_node_extension &obj);
3524 inline schedule_node_extension &operator=(schedule_node_extension obj);
3525 inline isl::ctx ctx() const;
3527 inline isl::union_map extension() const;
3528 inline isl::union_map get_extension() const;
3531 // declarations for isl::schedule_node_filter
3533 class schedule_node_filter : public schedule_node {
3534 template <class T>
3535 friend bool schedule_node::isa() const;
3536 friend schedule_node_filter schedule_node::as<schedule_node_filter>() const;
3537 static const auto type = isl_schedule_node_filter;
3539 protected:
3540 inline explicit schedule_node_filter(__isl_take isl_schedule_node *ptr);
3542 public:
3543 inline /* implicit */ schedule_node_filter();
3544 inline /* implicit */ schedule_node_filter(const schedule_node_filter &obj);
3545 inline schedule_node_filter &operator=(schedule_node_filter obj);
3546 inline isl::ctx ctx() const;
3548 inline isl::union_set filter() const;
3549 inline isl::union_set get_filter() const;
3552 // declarations for isl::schedule_node_guard
3554 class schedule_node_guard : public schedule_node {
3555 template <class T>
3556 friend bool schedule_node::isa() const;
3557 friend schedule_node_guard schedule_node::as<schedule_node_guard>() const;
3558 static const auto type = isl_schedule_node_guard;
3560 protected:
3561 inline explicit schedule_node_guard(__isl_take isl_schedule_node *ptr);
3563 public:
3564 inline /* implicit */ schedule_node_guard();
3565 inline /* implicit */ schedule_node_guard(const schedule_node_guard &obj);
3566 inline schedule_node_guard &operator=(schedule_node_guard obj);
3567 inline isl::ctx ctx() const;
3569 inline isl::set guard() const;
3570 inline isl::set get_guard() const;
3573 // declarations for isl::schedule_node_leaf
3575 class schedule_node_leaf : public schedule_node {
3576 template <class T>
3577 friend bool schedule_node::isa() const;
3578 friend schedule_node_leaf schedule_node::as<schedule_node_leaf>() const;
3579 static const auto type = isl_schedule_node_leaf;
3581 protected:
3582 inline explicit schedule_node_leaf(__isl_take isl_schedule_node *ptr);
3584 public:
3585 inline /* implicit */ schedule_node_leaf();
3586 inline /* implicit */ schedule_node_leaf(const schedule_node_leaf &obj);
3587 inline schedule_node_leaf &operator=(schedule_node_leaf obj);
3588 inline isl::ctx ctx() const;
3592 // declarations for isl::schedule_node_mark
3594 class schedule_node_mark : public schedule_node {
3595 template <class T>
3596 friend bool schedule_node::isa() const;
3597 friend schedule_node_mark schedule_node::as<schedule_node_mark>() const;
3598 static const auto type = isl_schedule_node_mark;
3600 protected:
3601 inline explicit schedule_node_mark(__isl_take isl_schedule_node *ptr);
3603 public:
3604 inline /* implicit */ schedule_node_mark();
3605 inline /* implicit */ schedule_node_mark(const schedule_node_mark &obj);
3606 inline schedule_node_mark &operator=(schedule_node_mark obj);
3607 inline isl::ctx ctx() const;
3611 // declarations for isl::schedule_node_sequence
3613 class schedule_node_sequence : public schedule_node {
3614 template <class T>
3615 friend bool schedule_node::isa() const;
3616 friend schedule_node_sequence schedule_node::as<schedule_node_sequence>() const;
3617 static const auto type = isl_schedule_node_sequence;
3619 protected:
3620 inline explicit schedule_node_sequence(__isl_take isl_schedule_node *ptr);
3622 public:
3623 inline /* implicit */ schedule_node_sequence();
3624 inline /* implicit */ schedule_node_sequence(const schedule_node_sequence &obj);
3625 inline schedule_node_sequence &operator=(schedule_node_sequence obj);
3626 inline isl::ctx ctx() const;
3630 // declarations for isl::schedule_node_set
3632 class schedule_node_set : public schedule_node {
3633 template <class T>
3634 friend bool schedule_node::isa() const;
3635 friend schedule_node_set schedule_node::as<schedule_node_set>() const;
3636 static const auto type = isl_schedule_node_set;
3638 protected:
3639 inline explicit schedule_node_set(__isl_take isl_schedule_node *ptr);
3641 public:
3642 inline /* implicit */ schedule_node_set();
3643 inline /* implicit */ schedule_node_set(const schedule_node_set &obj);
3644 inline schedule_node_set &operator=(schedule_node_set obj);
3645 inline isl::ctx ctx() const;
3649 // declarations for isl::set
3650 inline set manage(__isl_take isl_set *ptr);
3651 inline set manage_copy(__isl_keep isl_set *ptr);
3653 class set {
3654 friend inline set manage(__isl_take isl_set *ptr);
3655 friend inline set manage_copy(__isl_keep isl_set *ptr);
3657 protected:
3658 isl_set *ptr = nullptr;
3660 inline explicit set(__isl_take isl_set *ptr);
3662 public:
3663 inline /* implicit */ set();
3664 inline /* implicit */ set(const set &obj);
3665 inline /* implicit */ set(isl::basic_set bset);
3666 inline /* implicit */ set(isl::point pnt);
3667 inline explicit set(isl::ctx ctx, const std::string &str);
3668 inline set &operator=(set obj);
3669 inline ~set();
3670 inline __isl_give isl_set *copy() const &;
3671 inline __isl_give isl_set *copy() && = delete;
3672 inline __isl_keep isl_set *get() const;
3673 inline __isl_give isl_set *release();
3674 inline bool is_null() const;
3675 inline isl::ctx ctx() const;
3677 inline isl::basic_set affine_hull() const;
3678 inline isl::set apply(isl::map map) const;
3679 inline isl::union_set apply(const isl::union_map &umap) const;
3680 inline isl::set apply(const isl::basic_map &map) const;
3681 inline isl::pw_multi_aff as_pw_multi_aff() const;
3682 inline isl::set as_set() const;
3683 inline isl::set bind(isl::multi_id tuple) const;
3684 inline isl::set coalesce() const;
3685 inline isl::set complement() const;
3686 inline isl::union_set compute_divs() const;
3687 inline isl::set detect_equalities() const;
3688 inline isl::val dim_max_val(int pos) const;
3689 inline isl::val dim_min_val(int pos) const;
3690 inline isl::set drop_unused_params() const;
3691 static inline isl::set empty(isl::space space);
3692 inline bool every_set(const std::function<bool(isl::set)> &test) const;
3693 inline isl::set extract_set(const isl::space &space) const;
3694 inline isl::set flatten() const;
3695 inline void foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const;
3696 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
3697 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
3698 inline isl::set gist(isl::set context) const;
3699 inline isl::union_set gist(const isl::union_set &context) const;
3700 inline isl::set gist(const isl::basic_set &context) const;
3701 inline isl::set gist(const isl::point &context) const;
3702 inline isl::set gist_params(isl::set context) const;
3703 inline isl::map identity() const;
3704 inline isl::pw_aff indicator_function() const;
3705 inline isl::map insert_domain(isl::space domain) const;
3706 inline isl::set intersect(isl::set set2) const;
3707 inline isl::union_set intersect(const isl::union_set &uset2) const;
3708 inline isl::set intersect(const isl::basic_set &set2) const;
3709 inline isl::set intersect(const isl::point &set2) const;
3710 inline isl::set intersect_params(isl::set params) const;
3711 inline bool involves_locals() const;
3712 inline bool is_disjoint(const isl::set &set2) const;
3713 inline bool is_disjoint(const isl::union_set &uset2) const;
3714 inline bool is_disjoint(const isl::basic_set &set2) const;
3715 inline bool is_disjoint(const isl::point &set2) const;
3716 inline bool is_empty() const;
3717 inline bool is_equal(const isl::set &set2) const;
3718 inline bool is_equal(const isl::union_set &uset2) const;
3719 inline bool is_equal(const isl::basic_set &set2) const;
3720 inline bool is_equal(const isl::point &set2) const;
3721 inline bool is_singleton() const;
3722 inline bool is_strict_subset(const isl::set &set2) const;
3723 inline bool is_strict_subset(const isl::union_set &uset2) const;
3724 inline bool is_strict_subset(const isl::basic_set &set2) const;
3725 inline bool is_strict_subset(const isl::point &set2) const;
3726 inline bool is_subset(const isl::set &set2) const;
3727 inline bool is_subset(const isl::union_set &uset2) const;
3728 inline bool is_subset(const isl::basic_set &set2) const;
3729 inline bool is_subset(const isl::point &set2) const;
3730 inline bool is_wrapping() const;
3731 inline bool isa_set() const;
3732 inline isl::fixed_box lattice_tile() const;
3733 inline isl::fixed_box get_lattice_tile() const;
3734 inline isl::set lexmax() const;
3735 inline isl::pw_multi_aff lexmax_pw_multi_aff() const;
3736 inline isl::set lexmin() const;
3737 inline isl::pw_multi_aff lexmin_pw_multi_aff() const;
3738 inline isl::set lower_bound(isl::multi_pw_aff lower) const;
3739 inline isl::set lower_bound(isl::multi_val lower) const;
3740 inline isl::multi_pw_aff max_multi_pw_aff() const;
3741 inline isl::val max_val(const isl::aff &obj) const;
3742 inline isl::multi_pw_aff min_multi_pw_aff() const;
3743 inline isl::val min_val(const isl::aff &obj) const;
3744 inline unsigned n_basic_set() const;
3745 inline isl::pw_aff param_pw_aff_on_domain(isl::id id) const;
3746 inline isl::pw_aff param_pw_aff_on_domain(const std::string &id) const;
3747 inline isl::set params() const;
3748 inline isl::multi_val plain_multi_val_if_fixed() const;
3749 inline isl::multi_val get_plain_multi_val_if_fixed() const;
3750 inline isl::basic_set polyhedral_hull() const;
3751 inline isl::set preimage(isl::multi_aff ma) const;
3752 inline isl::set preimage(isl::multi_pw_aff mpa) const;
3753 inline isl::set preimage(isl::pw_multi_aff pma) const;
3754 inline isl::union_set preimage(const isl::union_pw_multi_aff &upma) const;
3755 inline isl::set product(isl::set set2) const;
3756 inline isl::set project_out_all_params() const;
3757 inline isl::set project_out_param(isl::id id) const;
3758 inline isl::set project_out_param(const std::string &id) const;
3759 inline isl::set project_out_param(isl::id_list list) const;
3760 inline isl::pw_aff pw_aff_on_domain(isl::val v) const;
3761 inline isl::pw_aff pw_aff_on_domain(long v) const;
3762 inline isl::pw_multi_aff pw_multi_aff_on_domain(isl::multi_val mv) const;
3763 inline isl::basic_set sample() const;
3764 inline isl::point sample_point() const;
3765 inline isl::set_list set_list() const;
3766 inline isl::fixed_box simple_fixed_box_hull() const;
3767 inline isl::fixed_box get_simple_fixed_box_hull() const;
3768 inline isl::space space() const;
3769 inline isl::space get_space() const;
3770 inline isl::val stride(int pos) const;
3771 inline isl::val get_stride(int pos) const;
3772 inline isl::set subtract(isl::set set2) const;
3773 inline isl::union_set subtract(const isl::union_set &uset2) const;
3774 inline isl::set subtract(const isl::basic_set &set2) const;
3775 inline isl::set subtract(const isl::point &set2) const;
3776 inline isl::set_list to_list() const;
3777 inline isl::union_set to_union_set() const;
3778 inline isl::map translation() const;
3779 inline unsigned tuple_dim() const;
3780 inline isl::set unbind_params(isl::multi_id tuple) const;
3781 inline isl::map unbind_params_insert_domain(isl::multi_id domain) const;
3782 inline isl::set unite(isl::set set2) const;
3783 inline isl::union_set unite(const isl::union_set &uset2) const;
3784 inline isl::set unite(const isl::basic_set &set2) const;
3785 inline isl::set unite(const isl::point &set2) const;
3786 static inline isl::set universe(isl::space space);
3787 inline isl::basic_set unshifted_simple_hull() const;
3788 inline isl::map unwrap() const;
3789 inline isl::set upper_bound(isl::multi_pw_aff upper) const;
3790 inline isl::set upper_bound(isl::multi_val upper) const;
3791 inline isl::set wrapped_reverse() const;
3794 // declarations for isl::set_list
3795 inline set_list manage(__isl_take isl_set_list *ptr);
3796 inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3798 class set_list {
3799 friend inline set_list manage(__isl_take isl_set_list *ptr);
3800 friend inline set_list manage_copy(__isl_keep isl_set_list *ptr);
3802 protected:
3803 isl_set_list *ptr = nullptr;
3805 inline explicit set_list(__isl_take isl_set_list *ptr);
3807 public:
3808 inline /* implicit */ set_list();
3809 inline /* implicit */ set_list(const set_list &obj);
3810 inline explicit set_list(isl::ctx ctx, int n);
3811 inline explicit set_list(isl::set el);
3812 inline explicit set_list(isl::ctx ctx, const std::string &str);
3813 inline set_list &operator=(set_list obj);
3814 inline ~set_list();
3815 inline __isl_give isl_set_list *copy() const &;
3816 inline __isl_give isl_set_list *copy() && = delete;
3817 inline __isl_keep isl_set_list *get() const;
3818 inline __isl_give isl_set_list *release();
3819 inline bool is_null() const;
3820 inline isl::ctx ctx() const;
3822 inline isl::set_list add(isl::set el) const;
3823 inline isl::set at(int index) const;
3824 inline isl::set get_at(int index) const;
3825 inline isl::set_list clear() const;
3826 inline isl::set_list concat(isl::set_list list2) const;
3827 inline isl::set_list drop(unsigned int first, unsigned int n) const;
3828 inline void foreach(const std::function<void(isl::set)> &fn) const;
3829 inline void foreach_scc(const std::function<bool(isl::set, isl::set)> &follows, const std::function<void(isl::set_list)> &fn) const;
3830 inline isl::set_list insert(unsigned int pos, isl::set el) const;
3831 inline isl::set_list set_at(int index, isl::set el) const;
3832 inline unsigned size() const;
3835 // declarations for isl::space
3836 inline space manage(__isl_take isl_space *ptr);
3837 inline space manage_copy(__isl_keep isl_space *ptr);
3839 class space {
3840 friend inline space manage(__isl_take isl_space *ptr);
3841 friend inline space manage_copy(__isl_keep isl_space *ptr);
3843 protected:
3844 isl_space *ptr = nullptr;
3846 inline explicit space(__isl_take isl_space *ptr);
3848 public:
3849 inline /* implicit */ space();
3850 inline /* implicit */ space(const space &obj);
3851 inline explicit space(isl::ctx ctx, const std::string &str);
3852 inline space &operator=(space obj);
3853 inline ~space();
3854 inline __isl_give isl_space *copy() const &;
3855 inline __isl_give isl_space *copy() && = delete;
3856 inline __isl_keep isl_space *get() const;
3857 inline __isl_give isl_space *release();
3858 inline bool is_null() const;
3859 inline isl::ctx ctx() const;
3861 inline isl::space add_named_tuple(isl::id tuple_id, unsigned int dim) const;
3862 inline isl::space add_named_tuple(const std::string &tuple_id, unsigned int dim) const;
3863 inline isl::space add_param(isl::id id) const;
3864 inline isl::space add_param(const std::string &id) const;
3865 inline isl::space add_unnamed_tuple(unsigned int dim) const;
3866 inline isl::space curry() const;
3867 inline isl::space domain() const;
3868 inline isl::multi_aff domain_map_multi_aff() const;
3869 inline isl::pw_multi_aff domain_map_pw_multi_aff() const;
3870 inline isl::space domain_reverse() const;
3871 inline isl::id domain_tuple_id() const;
3872 inline isl::id get_domain_tuple_id() const;
3873 inline isl::space drop_all_params() const;
3874 inline isl::space flatten_domain() const;
3875 inline isl::space flatten_range() const;
3876 inline bool has_domain_tuple_id() const;
3877 inline bool has_range_tuple_id() const;
3878 inline isl::multi_aff identity_multi_aff_on_domain() const;
3879 inline isl::multi_pw_aff identity_multi_pw_aff_on_domain() const;
3880 inline isl::pw_multi_aff identity_pw_multi_aff_on_domain() const;
3881 inline bool is_equal(const isl::space &space2) const;
3882 inline bool is_wrapping() const;
3883 inline isl::space map_from_set() const;
3884 inline isl::multi_aff multi_aff(isl::aff_list list) const;
3885 inline isl::multi_aff multi_aff_on_domain(isl::multi_val mv) const;
3886 inline isl::multi_id multi_id(isl::id_list list) const;
3887 inline isl::multi_pw_aff multi_pw_aff(isl::pw_aff_list list) const;
3888 inline isl::multi_union_pw_aff multi_union_pw_aff(isl::union_pw_aff_list list) const;
3889 inline isl::multi_val multi_val(isl::val_list list) const;
3890 inline isl::aff param_aff_on_domain(isl::id id) const;
3891 inline isl::aff param_aff_on_domain(const std::string &id) const;
3892 inline isl::space params() const;
3893 inline isl::space product(isl::space right) const;
3894 inline isl::space range() const;
3895 inline isl::multi_aff range_map_multi_aff() const;
3896 inline isl::pw_multi_aff range_map_pw_multi_aff() const;
3897 inline isl::space range_reverse() const;
3898 inline isl::id range_tuple_id() const;
3899 inline isl::id get_range_tuple_id() const;
3900 inline isl::space reverse() const;
3901 inline isl::space set_domain_tuple(isl::id id) const;
3902 inline isl::space set_domain_tuple(const std::string &id) const;
3903 inline isl::space set_range_tuple(isl::id id) const;
3904 inline isl::space set_range_tuple(const std::string &id) const;
3905 inline isl::space uncurry() const;
3906 static inline isl::space unit(isl::ctx ctx);
3907 inline isl::map universe_map() const;
3908 inline isl::set universe_set() const;
3909 inline isl::space unwrap() const;
3910 inline isl::space wrap() const;
3911 inline isl::space wrapped_reverse() const;
3912 inline isl::aff zero_aff_on_domain() const;
3913 inline isl::multi_aff zero_multi_aff() const;
3914 inline isl::multi_pw_aff zero_multi_pw_aff() const;
3915 inline isl::multi_union_pw_aff zero_multi_union_pw_aff() const;
3916 inline isl::multi_val zero_multi_val() const;
3919 // declarations for isl::union_access_info
3920 inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3921 inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3923 class union_access_info {
3924 friend inline union_access_info manage(__isl_take isl_union_access_info *ptr);
3925 friend inline union_access_info manage_copy(__isl_keep isl_union_access_info *ptr);
3927 protected:
3928 isl_union_access_info *ptr = nullptr;
3930 inline explicit union_access_info(__isl_take isl_union_access_info *ptr);
3932 public:
3933 inline /* implicit */ union_access_info();
3934 inline /* implicit */ union_access_info(const union_access_info &obj);
3935 inline explicit union_access_info(isl::union_map sink);
3936 inline union_access_info &operator=(union_access_info obj);
3937 inline ~union_access_info();
3938 inline __isl_give isl_union_access_info *copy() const &;
3939 inline __isl_give isl_union_access_info *copy() && = delete;
3940 inline __isl_keep isl_union_access_info *get() const;
3941 inline __isl_give isl_union_access_info *release();
3942 inline bool is_null() const;
3943 inline isl::ctx ctx() const;
3945 inline isl::union_flow compute_flow() const;
3946 inline isl::union_access_info set_kill(isl::union_map kill) const;
3947 inline isl::union_access_info set_may_source(isl::union_map may_source) const;
3948 inline isl::union_access_info set_must_source(isl::union_map must_source) const;
3949 inline isl::union_access_info set_schedule(isl::schedule schedule) const;
3950 inline isl::union_access_info set_schedule_map(isl::union_map schedule_map) const;
3953 // declarations for isl::union_flow
3954 inline union_flow manage(__isl_take isl_union_flow *ptr);
3955 inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3957 class union_flow {
3958 friend inline union_flow manage(__isl_take isl_union_flow *ptr);
3959 friend inline union_flow manage_copy(__isl_keep isl_union_flow *ptr);
3961 protected:
3962 isl_union_flow *ptr = nullptr;
3964 inline explicit union_flow(__isl_take isl_union_flow *ptr);
3966 public:
3967 inline /* implicit */ union_flow();
3968 inline /* implicit */ union_flow(const union_flow &obj);
3969 inline union_flow &operator=(union_flow obj);
3970 inline ~union_flow();
3971 inline __isl_give isl_union_flow *copy() const &;
3972 inline __isl_give isl_union_flow *copy() && = delete;
3973 inline __isl_keep isl_union_flow *get() const;
3974 inline __isl_give isl_union_flow *release();
3975 inline bool is_null() const;
3976 inline isl::ctx ctx() const;
3978 inline isl::union_map full_may_dependence() const;
3979 inline isl::union_map get_full_may_dependence() const;
3980 inline isl::union_map full_must_dependence() const;
3981 inline isl::union_map get_full_must_dependence() const;
3982 inline isl::union_map may_dependence() const;
3983 inline isl::union_map get_may_dependence() const;
3984 inline isl::union_map may_no_source() const;
3985 inline isl::union_map get_may_no_source() const;
3986 inline isl::union_map must_dependence() const;
3987 inline isl::union_map get_must_dependence() const;
3988 inline isl::union_map must_no_source() const;
3989 inline isl::union_map get_must_no_source() const;
3992 // declarations for isl::union_map
3993 inline union_map manage(__isl_take isl_union_map *ptr);
3994 inline union_map manage_copy(__isl_keep isl_union_map *ptr);
3996 class union_map {
3997 friend inline union_map manage(__isl_take isl_union_map *ptr);
3998 friend inline union_map manage_copy(__isl_keep isl_union_map *ptr);
4000 protected:
4001 isl_union_map *ptr = nullptr;
4003 inline explicit union_map(__isl_take isl_union_map *ptr);
4005 public:
4006 inline /* implicit */ union_map();
4007 inline /* implicit */ union_map(const union_map &obj);
4008 inline /* implicit */ union_map(isl::basic_map bmap);
4009 inline /* implicit */ union_map(isl::map map);
4010 inline explicit union_map(isl::ctx ctx, const std::string &str);
4011 inline union_map &operator=(union_map obj);
4012 inline ~union_map();
4013 inline __isl_give isl_union_map *copy() const &;
4014 inline __isl_give isl_union_map *copy() && = delete;
4015 inline __isl_keep isl_union_map *get() const;
4016 inline __isl_give isl_union_map *release();
4017 inline bool is_null() const;
4018 inline isl::ctx ctx() const;
4020 inline isl::union_map affine_hull() const;
4021 inline isl::union_map apply_domain(isl::union_map umap2) const;
4022 inline isl::union_map apply_range(isl::union_map umap2) const;
4023 inline isl::map as_map() const;
4024 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4025 inline isl::union_pw_multi_aff as_union_pw_multi_aff() const;
4026 inline isl::union_set bind_range(isl::multi_id tuple) const;
4027 inline isl::union_map coalesce() const;
4028 inline isl::union_map compute_divs() const;
4029 inline isl::union_map curry() const;
4030 inline isl::union_set deltas() const;
4031 inline isl::union_map detect_equalities() const;
4032 inline isl::union_set domain() const;
4033 inline isl::union_map domain_factor_domain() const;
4034 inline isl::union_map domain_factor_range() const;
4035 inline isl::union_map domain_map() const;
4036 inline isl::union_pw_multi_aff domain_map_union_pw_multi_aff() const;
4037 inline isl::union_map domain_product(isl::union_map umap2) const;
4038 inline isl::union_map domain_reverse() const;
4039 inline isl::union_map drop_unused_params() const;
4040 static inline isl::union_map empty(isl::ctx ctx);
4041 inline isl::union_map eq_at(isl::multi_union_pw_aff mupa) const;
4042 inline bool every_map(const std::function<bool(isl::map)> &test) const;
4043 inline isl::map extract_map(isl::space space) const;
4044 inline isl::union_map factor_domain() const;
4045 inline isl::union_map factor_range() const;
4046 inline isl::union_map fixed_power(isl::val exp) const;
4047 inline isl::union_map fixed_power(long exp) const;
4048 inline void foreach_map(const std::function<void(isl::map)> &fn) const;
4049 static inline isl::union_map from(isl::multi_union_pw_aff mupa);
4050 static inline isl::union_map from(isl::union_pw_multi_aff upma);
4051 static inline isl::union_map from_domain(isl::union_set uset);
4052 static inline isl::union_map from_domain_and_range(isl::union_set domain, isl::union_set range);
4053 static inline isl::union_map from_range(isl::union_set uset);
4054 inline isl::union_map gist(isl::union_map context) const;
4055 inline isl::union_map gist_domain(isl::union_set uset) const;
4056 inline isl::union_map gist_params(isl::set set) const;
4057 inline isl::union_map gist_range(isl::union_set uset) const;
4058 inline isl::union_map intersect(isl::union_map umap2) const;
4059 inline isl::union_map intersect_domain(isl::space space) const;
4060 inline isl::union_map intersect_domain(isl::union_set uset) const;
4061 inline isl::union_map intersect_domain_factor_domain(isl::union_map factor) const;
4062 inline isl::union_map intersect_domain_factor_range(isl::union_map factor) const;
4063 inline isl::union_map intersect_domain_wrapped_domain(isl::union_set domain) const;
4064 inline isl::union_map intersect_params(isl::set set) const;
4065 inline isl::union_map intersect_range(isl::space space) const;
4066 inline isl::union_map intersect_range(isl::union_set uset) const;
4067 inline isl::union_map intersect_range_factor_domain(isl::union_map factor) const;
4068 inline isl::union_map intersect_range_factor_range(isl::union_map factor) const;
4069 inline isl::union_map intersect_range_wrapped_domain(isl::union_set domain) const;
4070 inline bool is_bijective() const;
4071 inline bool is_disjoint(const isl::union_map &umap2) const;
4072 inline bool is_empty() const;
4073 inline bool is_equal(const isl::union_map &umap2) const;
4074 inline bool is_injective() const;
4075 inline bool is_single_valued() const;
4076 inline bool is_strict_subset(const isl::union_map &umap2) const;
4077 inline bool is_subset(const isl::union_map &umap2) const;
4078 inline bool isa_map() const;
4079 inline isl::union_map lexmax() const;
4080 inline isl::union_map lexmin() const;
4081 inline isl::map_list map_list() const;
4082 inline isl::map_list get_map_list() const;
4083 inline isl::set params() const;
4084 inline isl::union_map polyhedral_hull() const;
4085 inline isl::union_map preimage_domain(isl::multi_aff ma) const;
4086 inline isl::union_map preimage_domain(isl::multi_pw_aff mpa) const;
4087 inline isl::union_map preimage_domain(isl::pw_multi_aff pma) const;
4088 inline isl::union_map preimage_domain(isl::union_pw_multi_aff upma) const;
4089 inline isl::union_map preimage_range(isl::multi_aff ma) const;
4090 inline isl::union_map preimage_range(isl::pw_multi_aff pma) const;
4091 inline isl::union_map preimage_range(isl::union_pw_multi_aff upma) const;
4092 inline isl::union_map product(isl::union_map umap2) const;
4093 inline isl::union_map project_out_all_params() const;
4094 inline isl::union_map project_out_param(isl::id id) const;
4095 inline isl::union_map project_out_param(const std::string &id) const;
4096 inline isl::union_map project_out_param(isl::id_list list) const;
4097 inline isl::union_set range() const;
4098 inline isl::union_map range_factor_domain() const;
4099 inline isl::union_map range_factor_range() const;
4100 inline isl::union_map range_map() const;
4101 inline isl::union_map range_product(isl::union_map umap2) const;
4102 inline isl::union_map range_reverse() const;
4103 inline isl::union_map reverse() const;
4104 inline isl::space space() const;
4105 inline isl::space get_space() const;
4106 inline isl::union_map subtract(isl::union_map umap2) const;
4107 inline isl::union_map subtract_domain(isl::union_set dom) const;
4108 inline isl::union_map subtract_range(isl::union_set dom) const;
4109 inline isl::union_map uncurry() const;
4110 inline isl::union_map unite(isl::union_map umap2) const;
4111 inline isl::union_map universe() const;
4112 inline isl::union_set wrap() const;
4113 inline isl::union_map zip() const;
4116 // declarations for isl::union_pw_aff
4117 inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
4118 inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
4120 class union_pw_aff {
4121 friend inline union_pw_aff manage(__isl_take isl_union_pw_aff *ptr);
4122 friend inline union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr);
4124 protected:
4125 isl_union_pw_aff *ptr = nullptr;
4127 inline explicit union_pw_aff(__isl_take isl_union_pw_aff *ptr);
4129 public:
4130 inline /* implicit */ union_pw_aff();
4131 inline /* implicit */ union_pw_aff(const union_pw_aff &obj);
4132 inline /* implicit */ union_pw_aff(isl::aff aff);
4133 inline /* implicit */ union_pw_aff(isl::pw_aff pa);
4134 inline explicit union_pw_aff(isl::ctx ctx, const std::string &str);
4135 inline union_pw_aff &operator=(union_pw_aff obj);
4136 inline ~union_pw_aff();
4137 inline __isl_give isl_union_pw_aff *copy() const &;
4138 inline __isl_give isl_union_pw_aff *copy() && = delete;
4139 inline __isl_keep isl_union_pw_aff *get() const;
4140 inline __isl_give isl_union_pw_aff *release();
4141 inline bool is_null() const;
4142 inline isl::ctx ctx() const;
4144 inline isl::multi_union_pw_aff add(const isl::multi_union_pw_aff &multi2) const;
4145 inline isl::union_pw_aff add(isl::union_pw_aff upa2) const;
4146 inline isl::union_pw_multi_aff add(const isl::union_pw_multi_aff &upma2) const;
4147 inline isl::union_pw_aff add(const isl::aff &upa2) const;
4148 inline isl::union_pw_aff add(const isl::pw_aff &upa2) const;
4149 inline isl::union_pw_multi_aff apply(const isl::union_pw_multi_aff &upma2) const;
4150 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4151 inline isl::pw_multi_aff as_pw_multi_aff() const;
4152 inline isl::union_map as_union_map() const;
4153 inline isl::union_pw_aff at(int pos) const;
4154 inline isl::union_set bind(const isl::multi_id &tuple) const;
4155 inline isl::union_set bind(isl::id id) const;
4156 inline isl::union_set bind(const std::string &id) const;
4157 inline isl::union_pw_aff coalesce() const;
4158 inline isl::union_set domain() const;
4159 inline isl::union_pw_aff drop_unused_params() const;
4160 inline isl::pw_multi_aff extract_pw_multi_aff(const isl::space &space) const;
4161 inline isl::multi_union_pw_aff flat_range_product(const isl::multi_union_pw_aff &multi2) const;
4162 inline isl::union_pw_multi_aff flat_range_product(const isl::union_pw_multi_aff &upma2) const;
4163 inline isl::union_pw_aff gist(isl::union_set context) const;
4164 inline isl::multi_union_pw_aff gist_params(const isl::set &context) const;
4165 inline bool has_range_tuple_id() const;
4166 inline isl::union_pw_aff intersect_domain(isl::space space) const;
4167 inline isl::union_pw_aff intersect_domain(isl::union_set uset) const;
4168 inline isl::union_pw_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
4169 inline isl::union_pw_aff intersect_domain_wrapped_range(isl::union_set uset) const;
4170 inline isl::union_pw_aff intersect_params(isl::set set) const;
4171 inline bool involves_locals() const;
4172 inline bool involves_nan() const;
4173 inline bool isa_pw_multi_aff() const;
4174 inline isl::union_pw_aff_list list() const;
4175 inline isl::multi_union_pw_aff neg() const;
4176 inline bool plain_is_empty() const;
4177 inline bool plain_is_equal(const isl::multi_union_pw_aff &multi2) const;
4178 inline bool plain_is_equal(const isl::union_pw_aff &upa2) const;
4179 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
4180 inline bool plain_is_equal(const isl::aff &upa2) const;
4181 inline bool plain_is_equal(const isl::pw_aff &upa2) const;
4182 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const;
4183 inline isl::union_pw_aff pullback(isl::union_pw_multi_aff upma) const;
4184 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
4185 inline isl::union_pw_multi_aff range_factor_domain() const;
4186 inline isl::union_pw_multi_aff range_factor_range() const;
4187 inline isl::multi_union_pw_aff range_product(const isl::multi_union_pw_aff &multi2) const;
4188 inline isl::union_pw_multi_aff range_product(const isl::union_pw_multi_aff &upma2) const;
4189 inline isl::id range_tuple_id() const;
4190 inline isl::multi_union_pw_aff reset_range_tuple_id() const;
4191 inline isl::multi_union_pw_aff scale(const isl::multi_val &mv) const;
4192 inline isl::multi_union_pw_aff scale(const isl::val &v) const;
4193 inline isl::multi_union_pw_aff scale(long v) const;
4194 inline isl::multi_union_pw_aff scale_down(const isl::multi_val &mv) const;
4195 inline isl::multi_union_pw_aff scale_down(const isl::val &v) const;
4196 inline isl::multi_union_pw_aff scale_down(long v) const;
4197 inline isl::multi_union_pw_aff set_at(int pos, const isl::union_pw_aff &el) const;
4198 inline isl::multi_union_pw_aff set_range_tuple(const isl::id &id) const;
4199 inline isl::multi_union_pw_aff set_range_tuple(const std::string &id) const;
4200 inline unsigned size() const;
4201 inline isl::space space() const;
4202 inline isl::space get_space() const;
4203 inline isl::multi_union_pw_aff sub(const isl::multi_union_pw_aff &multi2) const;
4204 inline isl::union_pw_aff sub(isl::union_pw_aff upa2) const;
4205 inline isl::union_pw_multi_aff sub(const isl::union_pw_multi_aff &upma2) const;
4206 inline isl::union_pw_aff sub(const isl::aff &upa2) const;
4207 inline isl::union_pw_aff sub(const isl::pw_aff &upa2) const;
4208 inline isl::union_pw_aff subtract_domain(isl::space space) const;
4209 inline isl::union_pw_aff subtract_domain(isl::union_set uset) const;
4210 inline isl::union_pw_aff_list to_list() const;
4211 inline isl::multi_union_pw_aff union_add(const isl::multi_union_pw_aff &mupa2) const;
4212 inline isl::union_pw_aff union_add(isl::union_pw_aff upa2) const;
4213 inline isl::union_pw_multi_aff union_add(const isl::union_pw_multi_aff &upma2) const;
4214 inline isl::union_pw_aff union_add(const isl::aff &upa2) const;
4215 inline isl::union_pw_aff union_add(const isl::pw_aff &upa2) const;
4218 // declarations for isl::union_pw_aff_list
4219 inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4220 inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4222 class union_pw_aff_list {
4223 friend inline union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr);
4224 friend inline union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr);
4226 protected:
4227 isl_union_pw_aff_list *ptr = nullptr;
4229 inline explicit union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr);
4231 public:
4232 inline /* implicit */ union_pw_aff_list();
4233 inline /* implicit */ union_pw_aff_list(const union_pw_aff_list &obj);
4234 inline explicit union_pw_aff_list(isl::ctx ctx, int n);
4235 inline explicit union_pw_aff_list(isl::union_pw_aff el);
4236 inline explicit union_pw_aff_list(isl::ctx ctx, const std::string &str);
4237 inline union_pw_aff_list &operator=(union_pw_aff_list obj);
4238 inline ~union_pw_aff_list();
4239 inline __isl_give isl_union_pw_aff_list *copy() const &;
4240 inline __isl_give isl_union_pw_aff_list *copy() && = delete;
4241 inline __isl_keep isl_union_pw_aff_list *get() const;
4242 inline __isl_give isl_union_pw_aff_list *release();
4243 inline bool is_null() const;
4244 inline isl::ctx ctx() const;
4246 inline isl::union_pw_aff_list add(isl::union_pw_aff el) const;
4247 inline isl::union_pw_aff at(int index) const;
4248 inline isl::union_pw_aff get_at(int index) const;
4249 inline isl::union_pw_aff_list clear() const;
4250 inline isl::union_pw_aff_list concat(isl::union_pw_aff_list list2) const;
4251 inline isl::union_pw_aff_list drop(unsigned int first, unsigned int n) const;
4252 inline void foreach(const std::function<void(isl::union_pw_aff)> &fn) const;
4253 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;
4254 inline isl::union_pw_aff_list insert(unsigned int pos, isl::union_pw_aff el) const;
4255 inline isl::union_pw_aff_list set_at(int index, isl::union_pw_aff el) const;
4256 inline unsigned size() const;
4259 // declarations for isl::union_pw_multi_aff
4260 inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4261 inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4263 class union_pw_multi_aff {
4264 friend inline union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr);
4265 friend inline union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr);
4267 protected:
4268 isl_union_pw_multi_aff *ptr = nullptr;
4270 inline explicit union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr);
4272 public:
4273 inline /* implicit */ union_pw_multi_aff();
4274 inline /* implicit */ union_pw_multi_aff(const union_pw_multi_aff &obj);
4275 inline /* implicit */ union_pw_multi_aff(isl::multi_aff ma);
4276 inline /* implicit */ union_pw_multi_aff(isl::pw_multi_aff pma);
4277 inline /* implicit */ union_pw_multi_aff(isl::union_pw_aff upa);
4278 inline explicit union_pw_multi_aff(isl::ctx ctx, const std::string &str);
4279 inline union_pw_multi_aff &operator=(union_pw_multi_aff obj);
4280 inline ~union_pw_multi_aff();
4281 inline __isl_give isl_union_pw_multi_aff *copy() const &;
4282 inline __isl_give isl_union_pw_multi_aff *copy() && = delete;
4283 inline __isl_keep isl_union_pw_multi_aff *get() const;
4284 inline __isl_give isl_union_pw_multi_aff *release();
4285 inline bool is_null() const;
4286 inline isl::ctx ctx() const;
4288 inline isl::union_pw_multi_aff add(isl::union_pw_multi_aff upma2) const;
4289 inline isl::union_pw_multi_aff apply(isl::union_pw_multi_aff upma2) const;
4290 inline isl::multi_union_pw_aff as_multi_union_pw_aff() const;
4291 inline isl::pw_multi_aff as_pw_multi_aff() const;
4292 inline isl::union_map as_union_map() const;
4293 inline isl::union_pw_multi_aff coalesce() const;
4294 inline isl::union_set domain() const;
4295 inline isl::union_pw_multi_aff drop_unused_params() const;
4296 static inline isl::union_pw_multi_aff empty(isl::ctx ctx);
4297 inline isl::pw_multi_aff extract_pw_multi_aff(isl::space space) const;
4298 inline isl::union_pw_multi_aff flat_range_product(isl::union_pw_multi_aff upma2) const;
4299 inline isl::union_pw_multi_aff gist(isl::union_set context) const;
4300 inline isl::union_pw_multi_aff intersect_domain(isl::space space) const;
4301 inline isl::union_pw_multi_aff intersect_domain(isl::union_set uset) const;
4302 inline isl::union_pw_multi_aff intersect_domain_wrapped_domain(isl::union_set uset) const;
4303 inline isl::union_pw_multi_aff intersect_domain_wrapped_range(isl::union_set uset) const;
4304 inline isl::union_pw_multi_aff intersect_params(isl::set set) const;
4305 inline bool involves_locals() const;
4306 inline bool isa_pw_multi_aff() const;
4307 inline bool plain_is_empty() const;
4308 inline bool plain_is_equal(const isl::union_pw_multi_aff &upma2) const;
4309 inline isl::union_pw_multi_aff preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const;
4310 inline isl::union_pw_multi_aff pullback(isl::union_pw_multi_aff upma2) const;
4311 inline isl::pw_multi_aff_list pw_multi_aff_list() const;
4312 inline isl::pw_multi_aff_list get_pw_multi_aff_list() const;
4313 inline isl::union_pw_multi_aff range_factor_domain() const;
4314 inline isl::union_pw_multi_aff range_factor_range() const;
4315 inline isl::union_pw_multi_aff range_product(isl::union_pw_multi_aff upma2) const;
4316 inline isl::space space() const;
4317 inline isl::space get_space() const;
4318 inline isl::union_pw_multi_aff sub(isl::union_pw_multi_aff upma2) const;
4319 inline isl::union_pw_multi_aff subtract_domain(isl::space space) const;
4320 inline isl::union_pw_multi_aff subtract_domain(isl::union_set uset) const;
4321 inline isl::union_pw_multi_aff union_add(isl::union_pw_multi_aff upma2) const;
4324 // declarations for isl::union_set
4325 inline union_set manage(__isl_take isl_union_set *ptr);
4326 inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4328 class union_set {
4329 friend inline union_set manage(__isl_take isl_union_set *ptr);
4330 friend inline union_set manage_copy(__isl_keep isl_union_set *ptr);
4332 protected:
4333 isl_union_set *ptr = nullptr;
4335 inline explicit union_set(__isl_take isl_union_set *ptr);
4337 public:
4338 inline /* implicit */ union_set();
4339 inline /* implicit */ union_set(const union_set &obj);
4340 inline /* implicit */ union_set(isl::basic_set bset);
4341 inline /* implicit */ union_set(isl::point pnt);
4342 inline /* implicit */ union_set(isl::set set);
4343 inline explicit union_set(isl::ctx ctx, const std::string &str);
4344 inline union_set &operator=(union_set obj);
4345 inline ~union_set();
4346 inline __isl_give isl_union_set *copy() const &;
4347 inline __isl_give isl_union_set *copy() && = delete;
4348 inline __isl_keep isl_union_set *get() const;
4349 inline __isl_give isl_union_set *release();
4350 inline bool is_null() const;
4351 inline isl::ctx ctx() const;
4353 inline isl::union_set affine_hull() const;
4354 inline isl::union_set apply(isl::union_map umap) const;
4355 inline isl::set as_set() const;
4356 inline isl::union_set coalesce() const;
4357 inline isl::union_set compute_divs() const;
4358 inline isl::union_set detect_equalities() const;
4359 inline isl::union_set drop_unused_params() const;
4360 static inline isl::union_set empty(isl::ctx ctx);
4361 inline bool every_set(const std::function<bool(isl::set)> &test) const;
4362 inline isl::set extract_set(isl::space space) const;
4363 inline void foreach_point(const std::function<void(isl::point)> &fn) const;
4364 inline void foreach_set(const std::function<void(isl::set)> &fn) const;
4365 inline isl::union_set gist(isl::union_set context) const;
4366 inline isl::union_set gist_params(isl::set set) const;
4367 inline isl::union_map identity() const;
4368 inline isl::union_set intersect(isl::union_set uset2) const;
4369 inline isl::union_set intersect_params(isl::set set) const;
4370 inline bool is_disjoint(const isl::union_set &uset2) const;
4371 inline bool is_empty() const;
4372 inline bool is_equal(const isl::union_set &uset2) const;
4373 inline bool is_strict_subset(const isl::union_set &uset2) const;
4374 inline bool is_subset(const isl::union_set &uset2) const;
4375 inline bool isa_set() const;
4376 inline isl::union_set lexmax() const;
4377 inline isl::union_set lexmin() const;
4378 inline isl::set params() const;
4379 inline isl::union_set polyhedral_hull() const;
4380 inline isl::union_set preimage(isl::multi_aff ma) const;
4381 inline isl::union_set preimage(isl::pw_multi_aff pma) const;
4382 inline isl::union_set preimage(isl::union_pw_multi_aff upma) const;
4383 inline isl::union_set project_out_all_params() const;
4384 inline isl::point sample_point() const;
4385 inline isl::set_list set_list() const;
4386 inline isl::set_list get_set_list() const;
4387 inline isl::space space() const;
4388 inline isl::space get_space() const;
4389 inline isl::union_set subtract(isl::union_set uset2) const;
4390 inline isl::union_set_list to_list() const;
4391 inline isl::union_set unite(isl::union_set uset2) const;
4392 inline isl::union_set universe() const;
4393 inline isl::union_map unwrap() const;
4396 // declarations for isl::union_set_list
4397 inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4398 inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4400 class union_set_list {
4401 friend inline union_set_list manage(__isl_take isl_union_set_list *ptr);
4402 friend inline union_set_list manage_copy(__isl_keep isl_union_set_list *ptr);
4404 protected:
4405 isl_union_set_list *ptr = nullptr;
4407 inline explicit union_set_list(__isl_take isl_union_set_list *ptr);
4409 public:
4410 inline /* implicit */ union_set_list();
4411 inline /* implicit */ union_set_list(const union_set_list &obj);
4412 inline explicit union_set_list(isl::ctx ctx, int n);
4413 inline explicit union_set_list(isl::union_set el);
4414 inline explicit union_set_list(isl::ctx ctx, const std::string &str);
4415 inline union_set_list &operator=(union_set_list obj);
4416 inline ~union_set_list();
4417 inline __isl_give isl_union_set_list *copy() const &;
4418 inline __isl_give isl_union_set_list *copy() && = delete;
4419 inline __isl_keep isl_union_set_list *get() const;
4420 inline __isl_give isl_union_set_list *release();
4421 inline bool is_null() const;
4422 inline isl::ctx ctx() const;
4424 inline isl::union_set_list add(isl::union_set el) const;
4425 inline isl::union_set at(int index) const;
4426 inline isl::union_set get_at(int index) const;
4427 inline isl::union_set_list clear() const;
4428 inline isl::union_set_list concat(isl::union_set_list list2) const;
4429 inline isl::union_set_list drop(unsigned int first, unsigned int n) const;
4430 inline void foreach(const std::function<void(isl::union_set)> &fn) const;
4431 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;
4432 inline isl::union_set_list insert(unsigned int pos, isl::union_set el) const;
4433 inline isl::union_set_list set_at(int index, isl::union_set el) const;
4434 inline unsigned size() const;
4437 // declarations for isl::val
4438 inline val manage(__isl_take isl_val *ptr);
4439 inline val manage_copy(__isl_keep isl_val *ptr);
4441 class val {
4442 friend inline val manage(__isl_take isl_val *ptr);
4443 friend inline val manage_copy(__isl_keep isl_val *ptr);
4445 protected:
4446 isl_val *ptr = nullptr;
4448 inline explicit val(__isl_take isl_val *ptr);
4450 public:
4451 inline /* implicit */ val();
4452 inline /* implicit */ val(const val &obj);
4453 inline explicit val(isl::ctx ctx, long i);
4454 inline explicit val(isl::ctx ctx, const std::string &str);
4455 inline val &operator=(val obj);
4456 inline ~val();
4457 inline __isl_give isl_val *copy() const &;
4458 inline __isl_give isl_val *copy() && = delete;
4459 inline __isl_keep isl_val *get() const;
4460 inline __isl_give isl_val *release();
4461 inline bool is_null() const;
4462 inline isl::ctx ctx() const;
4464 inline isl::val abs() const;
4465 inline bool abs_eq(const isl::val &v2) const;
4466 inline bool abs_eq(long v2) const;
4467 inline isl::val add(isl::val v2) const;
4468 inline isl::val add(long v2) const;
4469 inline isl::val ceil() const;
4470 inline int cmp_si(long i) const;
4471 inline long den_si() const;
4472 inline long get_den_si() const;
4473 inline isl::val div(isl::val v2) const;
4474 inline isl::val div(long v2) const;
4475 inline bool eq(const isl::val &v2) const;
4476 inline bool eq(long v2) const;
4477 inline isl::val floor() const;
4478 inline isl::val gcd(isl::val v2) const;
4479 inline isl::val gcd(long v2) const;
4480 inline bool ge(const isl::val &v2) const;
4481 inline bool ge(long v2) const;
4482 inline bool gt(const isl::val &v2) const;
4483 inline bool gt(long v2) const;
4484 static inline isl::val infty(isl::ctx ctx);
4485 inline isl::val inv() const;
4486 inline bool is_divisible_by(const isl::val &v2) const;
4487 inline bool is_divisible_by(long v2) const;
4488 inline bool is_infty() const;
4489 inline bool is_int() const;
4490 inline bool is_nan() const;
4491 inline bool is_neg() const;
4492 inline bool is_neginfty() const;
4493 inline bool is_negone() const;
4494 inline bool is_nonneg() const;
4495 inline bool is_nonpos() const;
4496 inline bool is_one() const;
4497 inline bool is_pos() const;
4498 inline bool is_rat() const;
4499 inline bool is_zero() const;
4500 inline bool le(const isl::val &v2) const;
4501 inline bool le(long v2) const;
4502 inline bool lt(const isl::val &v2) const;
4503 inline bool lt(long v2) const;
4504 inline isl::val max(isl::val v2) const;
4505 inline isl::val max(long v2) const;
4506 inline isl::val min(isl::val v2) const;
4507 inline isl::val min(long v2) const;
4508 inline isl::val mod(isl::val v2) const;
4509 inline isl::val mod(long v2) const;
4510 inline isl::val mul(isl::val v2) const;
4511 inline isl::val mul(long v2) const;
4512 static inline isl::val nan(isl::ctx ctx);
4513 inline bool ne(const isl::val &v2) const;
4514 inline bool ne(long v2) const;
4515 inline isl::val neg() const;
4516 static inline isl::val neginfty(isl::ctx ctx);
4517 static inline isl::val negone(isl::ctx ctx);
4518 inline long num_si() const;
4519 inline long get_num_si() const;
4520 static inline isl::val one(isl::ctx ctx);
4521 inline isl::val pow2() const;
4522 inline int sgn() const;
4523 inline isl::val sub(isl::val v2) const;
4524 inline isl::val sub(long v2) const;
4525 inline isl::val_list to_list() const;
4526 inline isl::val trunc() const;
4527 static inline isl::val zero(isl::ctx ctx);
4530 // declarations for isl::val_list
4531 inline val_list manage(__isl_take isl_val_list *ptr);
4532 inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4534 class val_list {
4535 friend inline val_list manage(__isl_take isl_val_list *ptr);
4536 friend inline val_list manage_copy(__isl_keep isl_val_list *ptr);
4538 protected:
4539 isl_val_list *ptr = nullptr;
4541 inline explicit val_list(__isl_take isl_val_list *ptr);
4543 public:
4544 inline /* implicit */ val_list();
4545 inline /* implicit */ val_list(const val_list &obj);
4546 inline explicit val_list(isl::ctx ctx, int n);
4547 inline explicit val_list(isl::val el);
4548 inline explicit val_list(isl::ctx ctx, const std::string &str);
4549 inline val_list &operator=(val_list obj);
4550 inline ~val_list();
4551 inline __isl_give isl_val_list *copy() const &;
4552 inline __isl_give isl_val_list *copy() && = delete;
4553 inline __isl_keep isl_val_list *get() const;
4554 inline __isl_give isl_val_list *release();
4555 inline bool is_null() const;
4556 inline isl::ctx ctx() const;
4558 inline isl::val_list add(isl::val el) const;
4559 inline isl::val_list add(long el) const;
4560 inline isl::val at(int index) const;
4561 inline isl::val get_at(int index) const;
4562 inline isl::val_list clear() const;
4563 inline isl::val_list concat(isl::val_list list2) const;
4564 inline isl::val_list drop(unsigned int first, unsigned int n) const;
4565 inline void foreach(const std::function<void(isl::val)> &fn) const;
4566 inline void foreach_scc(const std::function<bool(isl::val, isl::val)> &follows, const std::function<void(isl::val_list)> &fn) const;
4567 inline isl::val_list insert(unsigned int pos, isl::val el) const;
4568 inline isl::val_list insert(unsigned int pos, long el) const;
4569 inline isl::val_list set_at(int index, isl::val el) const;
4570 inline isl::val_list set_at(int index, long el) const;
4571 inline unsigned size() const;
4574 // implementations for isl::aff
4575 aff manage(__isl_take isl_aff *ptr) {
4576 if (!ptr)
4577 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4578 return aff(ptr);
4580 aff manage_copy(__isl_keep isl_aff *ptr) {
4581 if (!ptr)
4582 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4583 auto saved_ctx = isl_aff_get_ctx(ptr);
4584 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4585 ptr = isl_aff_copy(ptr);
4586 if (!ptr)
4587 exception::throw_last_error(saved_ctx);
4588 return aff(ptr);
4591 aff::aff(__isl_take isl_aff *ptr)
4592 : ptr(ptr) {}
4594 aff::aff()
4595 : ptr(nullptr) {}
4597 aff::aff(const aff &obj)
4598 : ptr(nullptr)
4600 if (!obj.ptr)
4601 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4602 auto saved_ctx = isl_aff_get_ctx(obj.ptr);
4603 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4604 ptr = obj.copy();
4605 if (!ptr)
4606 exception::throw_last_error(saved_ctx);
4609 aff::aff(isl::ctx ctx, const std::string &str)
4611 auto saved_ctx = ctx;
4612 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4613 auto res = isl_aff_read_from_str(ctx.release(), str.c_str());
4614 if (!res)
4615 exception::throw_last_error(saved_ctx);
4616 ptr = res;
4619 aff &aff::operator=(aff obj) {
4620 std::swap(this->ptr, obj.ptr);
4621 return *this;
4624 aff::~aff() {
4625 if (ptr)
4626 isl_aff_free(ptr);
4629 __isl_give isl_aff *aff::copy() const & {
4630 return isl_aff_copy(ptr);
4633 __isl_keep isl_aff *aff::get() const {
4634 return ptr;
4637 __isl_give isl_aff *aff::release() {
4638 isl_aff *tmp = ptr;
4639 ptr = nullptr;
4640 return tmp;
4643 bool aff::is_null() const {
4644 return ptr == nullptr;
4647 isl::ctx aff::ctx() const {
4648 return isl::ctx(isl_aff_get_ctx(ptr));
4651 isl::aff aff::add(isl::aff aff2) const
4653 if (!ptr || aff2.is_null())
4654 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4655 auto saved_ctx = ctx();
4656 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4657 auto res = isl_aff_add(copy(), aff2.release());
4658 if (!res)
4659 exception::throw_last_error(saved_ctx);
4660 return manage(res);
4663 isl::multi_aff aff::add(const isl::multi_aff &multi2) const
4665 if (!ptr)
4666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4667 return isl::multi_aff(*this).add(multi2);
4670 isl::multi_pw_aff aff::add(const isl::multi_pw_aff &multi2) const
4672 if (!ptr)
4673 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4674 return isl::pw_aff(*this).add(multi2);
4677 isl::multi_union_pw_aff aff::add(const isl::multi_union_pw_aff &multi2) const
4679 if (!ptr)
4680 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4681 return isl::pw_aff(*this).add(multi2);
4684 isl::pw_aff aff::add(const isl::pw_aff &pwaff2) const
4686 if (!ptr)
4687 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4688 return isl::pw_aff(*this).add(pwaff2);
4691 isl::pw_multi_aff aff::add(const isl::pw_multi_aff &pma2) const
4693 if (!ptr)
4694 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4695 return isl::pw_aff(*this).add(pma2);
4698 isl::union_pw_aff aff::add(const isl::union_pw_aff &upa2) const
4700 if (!ptr)
4701 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4702 return isl::pw_aff(*this).add(upa2);
4705 isl::union_pw_multi_aff aff::add(const isl::union_pw_multi_aff &upma2) const
4707 if (!ptr)
4708 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4709 return isl::pw_aff(*this).add(upma2);
4712 isl::aff aff::add_constant(isl::val v) const
4714 if (!ptr || v.is_null())
4715 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4716 auto saved_ctx = ctx();
4717 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4718 auto res = isl_aff_add_constant_val(copy(), v.release());
4719 if (!res)
4720 exception::throw_last_error(saved_ctx);
4721 return manage(res);
4724 isl::aff aff::add_constant(long v) const
4726 if (!ptr)
4727 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4728 return this->add_constant(isl::val(ctx(), v));
4731 isl::multi_aff aff::add_constant(const isl::multi_val &mv) const
4733 if (!ptr)
4734 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4735 return isl::multi_aff(*this).add_constant(mv);
4738 isl::union_pw_multi_aff aff::apply(const isl::union_pw_multi_aff &upma2) const
4740 if (!ptr)
4741 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4742 return isl::pw_aff(*this).apply(upma2);
4745 isl::aff aff::as_aff() const
4747 if (!ptr)
4748 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4749 return isl::pw_aff(*this).as_aff();
4752 isl::map aff::as_map() const
4754 if (!ptr)
4755 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4756 return isl::pw_aff(*this).as_map();
4759 isl::multi_aff aff::as_multi_aff() const
4761 if (!ptr)
4762 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4763 return isl::pw_aff(*this).as_multi_aff();
4766 isl::multi_union_pw_aff aff::as_multi_union_pw_aff() const
4768 if (!ptr)
4769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4770 return isl::pw_aff(*this).as_multi_union_pw_aff();
4773 isl::pw_multi_aff aff::as_pw_multi_aff() const
4775 if (!ptr)
4776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4777 return isl::pw_aff(*this).as_pw_multi_aff();
4780 isl::set aff::as_set() const
4782 if (!ptr)
4783 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4784 return isl::multi_aff(*this).as_set();
4787 isl::union_map aff::as_union_map() const
4789 if (!ptr)
4790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4791 return isl::pw_aff(*this).as_union_map();
4794 isl::aff aff::at(int pos) const
4796 if (!ptr)
4797 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4798 return isl::multi_aff(*this).at(pos);
4801 isl::basic_set aff::bind(isl::id id) const
4803 if (!ptr || id.is_null())
4804 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4805 auto saved_ctx = ctx();
4806 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4807 auto res = isl_aff_bind_id(copy(), id.release());
4808 if (!res)
4809 exception::throw_last_error(saved_ctx);
4810 return manage(res);
4813 isl::basic_set aff::bind(const std::string &id) const
4815 if (!ptr)
4816 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4817 return this->bind(isl::id(ctx(), id));
4820 isl::basic_set aff::bind(const isl::multi_id &tuple) const
4822 if (!ptr)
4823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4824 return isl::multi_aff(*this).bind(tuple);
4827 isl::pw_aff aff::bind_domain(const isl::multi_id &tuple) const
4829 if (!ptr)
4830 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4831 return isl::pw_aff(*this).bind_domain(tuple);
4834 isl::pw_aff aff::bind_domain_wrapped_domain(const isl::multi_id &tuple) const
4836 if (!ptr)
4837 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4838 return isl::pw_aff(*this).bind_domain_wrapped_domain(tuple);
4841 isl::aff aff::ceil() const
4843 if (!ptr)
4844 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4845 auto saved_ctx = ctx();
4846 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4847 auto res = isl_aff_ceil(copy());
4848 if (!res)
4849 exception::throw_last_error(saved_ctx);
4850 return manage(res);
4853 isl::pw_aff aff::coalesce() const
4855 if (!ptr)
4856 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4857 return isl::pw_aff(*this).coalesce();
4860 isl::pw_aff aff::cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const
4862 if (!ptr)
4863 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4864 return isl::pw_aff(*this).cond(pwaff_true, pwaff_false);
4867 isl::multi_val aff::constant_multi_val() const
4869 if (!ptr)
4870 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4871 return isl::multi_aff(*this).constant_multi_val();
4874 isl::val aff::constant_val() const
4876 if (!ptr)
4877 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4878 auto saved_ctx = ctx();
4879 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4880 auto res = isl_aff_get_constant_val(get());
4881 if (!res)
4882 exception::throw_last_error(saved_ctx);
4883 return manage(res);
4886 isl::val aff::get_constant_val() const
4888 return constant_val();
4891 isl::aff aff::div(isl::aff aff2) const
4893 if (!ptr || aff2.is_null())
4894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4895 auto saved_ctx = ctx();
4896 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4897 auto res = isl_aff_div(copy(), aff2.release());
4898 if (!res)
4899 exception::throw_last_error(saved_ctx);
4900 return manage(res);
4903 isl::pw_aff aff::div(const isl::pw_aff &pa2) const
4905 if (!ptr)
4906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4907 return isl::pw_aff(*this).div(pa2);
4910 isl::set aff::domain() const
4912 if (!ptr)
4913 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4914 return isl::pw_aff(*this).domain();
4917 isl::aff aff::domain_reverse() const
4919 if (!ptr)
4920 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4921 auto saved_ctx = ctx();
4922 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4923 auto res = isl_aff_domain_reverse(copy());
4924 if (!res)
4925 exception::throw_last_error(saved_ctx);
4926 return manage(res);
4929 isl::pw_aff aff::drop_unused_params() const
4931 if (!ptr)
4932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4933 return isl::pw_aff(*this).drop_unused_params();
4936 isl::set aff::eq_set(isl::aff aff2) const
4938 if (!ptr || aff2.is_null())
4939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4940 auto saved_ctx = ctx();
4941 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4942 auto res = isl_aff_eq_set(copy(), aff2.release());
4943 if (!res)
4944 exception::throw_last_error(saved_ctx);
4945 return manage(res);
4948 isl::set aff::eq_set(const isl::pw_aff &pwaff2) const
4950 if (!ptr)
4951 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4952 return isl::pw_aff(*this).eq_set(pwaff2);
4955 isl::val aff::eval(isl::point pnt) const
4957 if (!ptr || pnt.is_null())
4958 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4959 auto saved_ctx = ctx();
4960 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
4961 auto res = isl_aff_eval(copy(), pnt.release());
4962 if (!res)
4963 exception::throw_last_error(saved_ctx);
4964 return manage(res);
4967 isl::pw_multi_aff aff::extract_pw_multi_aff(const isl::space &space) const
4969 if (!ptr)
4970 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4971 return isl::pw_aff(*this).extract_pw_multi_aff(space);
4974 isl::multi_aff aff::flat_range_product(const isl::multi_aff &multi2) const
4976 if (!ptr)
4977 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4978 return isl::multi_aff(*this).flat_range_product(multi2);
4981 isl::multi_pw_aff aff::flat_range_product(const isl::multi_pw_aff &multi2) const
4983 if (!ptr)
4984 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4985 return isl::pw_aff(*this).flat_range_product(multi2);
4988 isl::multi_union_pw_aff aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
4990 if (!ptr)
4991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4992 return isl::pw_aff(*this).flat_range_product(multi2);
4995 isl::pw_multi_aff aff::flat_range_product(const isl::pw_multi_aff &pma2) const
4997 if (!ptr)
4998 exception::throw_invalid("NULL input", __FILE__, __LINE__);
4999 return isl::pw_aff(*this).flat_range_product(pma2);
5002 isl::union_pw_multi_aff aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
5004 if (!ptr)
5005 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5006 return isl::pw_aff(*this).flat_range_product(upma2);
5009 isl::aff aff::floor() const
5011 if (!ptr)
5012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5013 auto saved_ctx = ctx();
5014 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5015 auto res = isl_aff_floor(copy());
5016 if (!res)
5017 exception::throw_last_error(saved_ctx);
5018 return manage(res);
5021 void aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
5023 if (!ptr)
5024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5025 return isl::pw_aff(*this).foreach_piece(fn);
5028 isl::set aff::ge_set(isl::aff aff2) const
5030 if (!ptr || aff2.is_null())
5031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5032 auto saved_ctx = ctx();
5033 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5034 auto res = isl_aff_ge_set(copy(), aff2.release());
5035 if (!res)
5036 exception::throw_last_error(saved_ctx);
5037 return manage(res);
5040 isl::set aff::ge_set(const isl::pw_aff &pwaff2) const
5042 if (!ptr)
5043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5044 return isl::pw_aff(*this).ge_set(pwaff2);
5047 isl::aff aff::gist(isl::set context) const
5049 if (!ptr || context.is_null())
5050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5051 auto saved_ctx = ctx();
5052 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5053 auto res = isl_aff_gist(copy(), context.release());
5054 if (!res)
5055 exception::throw_last_error(saved_ctx);
5056 return manage(res);
5059 isl::union_pw_aff aff::gist(const isl::union_set &context) const
5061 if (!ptr)
5062 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5063 return isl::pw_aff(*this).gist(context);
5066 isl::aff aff::gist(const isl::basic_set &context) const
5068 if (!ptr)
5069 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5070 return this->gist(isl::set(context));
5073 isl::aff aff::gist(const isl::point &context) const
5075 if (!ptr)
5076 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5077 return this->gist(isl::set(context));
5080 isl::aff aff::gist_params(isl::set context) const
5082 if (!ptr || context.is_null())
5083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5084 auto saved_ctx = ctx();
5085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5086 auto res = isl_aff_gist_params(copy(), context.release());
5087 if (!res)
5088 exception::throw_last_error(saved_ctx);
5089 return manage(res);
5092 isl::set aff::gt_set(isl::aff aff2) const
5094 if (!ptr || aff2.is_null())
5095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5096 auto saved_ctx = ctx();
5097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5098 auto res = isl_aff_gt_set(copy(), aff2.release());
5099 if (!res)
5100 exception::throw_last_error(saved_ctx);
5101 return manage(res);
5104 isl::set aff::gt_set(const isl::pw_aff &pwaff2) const
5106 if (!ptr)
5107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5108 return isl::pw_aff(*this).gt_set(pwaff2);
5111 bool aff::has_range_tuple_id() const
5113 if (!ptr)
5114 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5115 return isl::multi_aff(*this).has_range_tuple_id();
5118 isl::multi_aff aff::identity() const
5120 if (!ptr)
5121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5122 return isl::multi_aff(*this).identity();
5125 isl::pw_aff aff::insert_domain(const isl::space &domain) const
5127 if (!ptr)
5128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5129 return isl::pw_aff(*this).insert_domain(domain);
5132 isl::pw_aff aff::intersect_domain(const isl::set &set) const
5134 if (!ptr)
5135 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5136 return isl::pw_aff(*this).intersect_domain(set);
5139 isl::union_pw_aff aff::intersect_domain(const isl::space &space) const
5141 if (!ptr)
5142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5143 return isl::pw_aff(*this).intersect_domain(space);
5146 isl::union_pw_aff aff::intersect_domain(const isl::union_set &uset) const
5148 if (!ptr)
5149 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5150 return isl::pw_aff(*this).intersect_domain(uset);
5153 isl::union_pw_aff aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
5155 if (!ptr)
5156 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5157 return isl::pw_aff(*this).intersect_domain_wrapped_domain(uset);
5160 isl::union_pw_aff aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
5162 if (!ptr)
5163 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5164 return isl::pw_aff(*this).intersect_domain_wrapped_range(uset);
5167 isl::pw_aff aff::intersect_params(const isl::set &set) const
5169 if (!ptr)
5170 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5171 return isl::pw_aff(*this).intersect_params(set);
5174 bool aff::involves_locals() const
5176 if (!ptr)
5177 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5178 return isl::multi_aff(*this).involves_locals();
5181 bool aff::involves_nan() const
5183 if (!ptr)
5184 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5185 return isl::multi_aff(*this).involves_nan();
5188 bool aff::involves_param(const isl::id &id) const
5190 if (!ptr)
5191 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5192 return isl::pw_aff(*this).involves_param(id);
5195 bool aff::involves_param(const std::string &id) const
5197 if (!ptr)
5198 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5199 return this->involves_param(isl::id(ctx(), id));
5202 bool aff::involves_param(const isl::id_list &list) const
5204 if (!ptr)
5205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5206 return isl::pw_aff(*this).involves_param(list);
5209 bool aff::is_cst() const
5211 if (!ptr)
5212 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5213 auto saved_ctx = ctx();
5214 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5215 auto res = isl_aff_is_cst(get());
5216 if (res < 0)
5217 exception::throw_last_error(saved_ctx);
5218 return res;
5221 bool aff::isa_aff() const
5223 if (!ptr)
5224 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5225 return isl::pw_aff(*this).isa_aff();
5228 bool aff::isa_multi_aff() const
5230 if (!ptr)
5231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5232 return isl::pw_aff(*this).isa_multi_aff();
5235 bool aff::isa_pw_multi_aff() const
5237 if (!ptr)
5238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5239 return isl::pw_aff(*this).isa_pw_multi_aff();
5242 isl::set aff::le_set(isl::aff aff2) const
5244 if (!ptr || aff2.is_null())
5245 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5246 auto saved_ctx = ctx();
5247 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5248 auto res = isl_aff_le_set(copy(), aff2.release());
5249 if (!res)
5250 exception::throw_last_error(saved_ctx);
5251 return manage(res);
5254 isl::set aff::le_set(const isl::pw_aff &pwaff2) const
5256 if (!ptr)
5257 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5258 return isl::pw_aff(*this).le_set(pwaff2);
5261 isl::aff_list aff::list() const
5263 if (!ptr)
5264 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5265 return isl::multi_aff(*this).list();
5268 isl::set aff::lt_set(isl::aff aff2) const
5270 if (!ptr || aff2.is_null())
5271 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5272 auto saved_ctx = ctx();
5273 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5274 auto res = isl_aff_lt_set(copy(), aff2.release());
5275 if (!res)
5276 exception::throw_last_error(saved_ctx);
5277 return manage(res);
5280 isl::set aff::lt_set(const isl::pw_aff &pwaff2) const
5282 if (!ptr)
5283 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5284 return isl::pw_aff(*this).lt_set(pwaff2);
5287 isl::multi_pw_aff aff::max(const isl::multi_pw_aff &multi2) const
5289 if (!ptr)
5290 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5291 return isl::pw_aff(*this).max(multi2);
5294 isl::pw_aff aff::max(const isl::pw_aff &pwaff2) const
5296 if (!ptr)
5297 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5298 return isl::pw_aff(*this).max(pwaff2);
5301 isl::multi_val aff::max_multi_val() const
5303 if (!ptr)
5304 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5305 return isl::pw_aff(*this).max_multi_val();
5308 isl::val aff::max_val() const
5310 if (!ptr)
5311 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5312 return isl::pw_aff(*this).max_val();
5315 isl::multi_pw_aff aff::min(const isl::multi_pw_aff &multi2) const
5317 if (!ptr)
5318 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5319 return isl::pw_aff(*this).min(multi2);
5322 isl::pw_aff aff::min(const isl::pw_aff &pwaff2) const
5324 if (!ptr)
5325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5326 return isl::pw_aff(*this).min(pwaff2);
5329 isl::multi_val aff::min_multi_val() const
5331 if (!ptr)
5332 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5333 return isl::pw_aff(*this).min_multi_val();
5336 isl::val aff::min_val() const
5338 if (!ptr)
5339 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5340 return isl::pw_aff(*this).min_val();
5343 isl::aff aff::mod(isl::val mod) const
5345 if (!ptr || mod.is_null())
5346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5347 auto saved_ctx = ctx();
5348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5349 auto res = isl_aff_mod_val(copy(), mod.release());
5350 if (!res)
5351 exception::throw_last_error(saved_ctx);
5352 return manage(res);
5355 isl::aff aff::mod(long mod) const
5357 if (!ptr)
5358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5359 return this->mod(isl::val(ctx(), mod));
5362 isl::aff aff::mul(isl::aff aff2) const
5364 if (!ptr || aff2.is_null())
5365 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5366 auto saved_ctx = ctx();
5367 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5368 auto res = isl_aff_mul(copy(), aff2.release());
5369 if (!res)
5370 exception::throw_last_error(saved_ctx);
5371 return manage(res);
5374 isl::pw_aff aff::mul(const isl::pw_aff &pwaff2) const
5376 if (!ptr)
5377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5378 return isl::pw_aff(*this).mul(pwaff2);
5381 unsigned aff::n_piece() const
5383 if (!ptr)
5384 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5385 return isl::pw_aff(*this).n_piece();
5388 isl::set aff::ne_set(isl::aff aff2) const
5390 if (!ptr || aff2.is_null())
5391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5392 auto saved_ctx = ctx();
5393 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5394 auto res = isl_aff_ne_set(copy(), aff2.release());
5395 if (!res)
5396 exception::throw_last_error(saved_ctx);
5397 return manage(res);
5400 isl::set aff::ne_set(const isl::pw_aff &pwaff2) const
5402 if (!ptr)
5403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5404 return isl::pw_aff(*this).ne_set(pwaff2);
5407 isl::aff aff::neg() const
5409 if (!ptr)
5410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5411 auto saved_ctx = ctx();
5412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5413 auto res = isl_aff_neg(copy());
5414 if (!res)
5415 exception::throw_last_error(saved_ctx);
5416 return manage(res);
5419 isl::set aff::params() const
5421 if (!ptr)
5422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5423 return isl::pw_aff(*this).params();
5426 bool aff::plain_is_empty() const
5428 if (!ptr)
5429 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5430 return isl::pw_aff(*this).plain_is_empty();
5433 bool aff::plain_is_equal(const isl::aff &aff2) const
5435 if (!ptr || aff2.is_null())
5436 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5437 auto saved_ctx = ctx();
5438 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5439 auto res = isl_aff_plain_is_equal(get(), aff2.get());
5440 if (res < 0)
5441 exception::throw_last_error(saved_ctx);
5442 return res;
5445 bool aff::plain_is_equal(const isl::multi_aff &multi2) const
5447 if (!ptr)
5448 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5449 return isl::multi_aff(*this).plain_is_equal(multi2);
5452 bool aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
5454 if (!ptr)
5455 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5456 return isl::pw_aff(*this).plain_is_equal(multi2);
5459 bool aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
5461 if (!ptr)
5462 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5463 return isl::pw_aff(*this).plain_is_equal(multi2);
5466 bool aff::plain_is_equal(const isl::pw_aff &pwaff2) const
5468 if (!ptr)
5469 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5470 return isl::pw_aff(*this).plain_is_equal(pwaff2);
5473 bool aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
5475 if (!ptr)
5476 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5477 return isl::pw_aff(*this).plain_is_equal(pma2);
5480 bool aff::plain_is_equal(const isl::union_pw_aff &upa2) const
5482 if (!ptr)
5483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5484 return isl::pw_aff(*this).plain_is_equal(upa2);
5487 bool aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
5489 if (!ptr)
5490 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5491 return isl::pw_aff(*this).plain_is_equal(upma2);
5494 isl::pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
5496 if (!ptr)
5497 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5498 return isl::pw_aff(*this).preimage_domain_wrapped_domain(pma2);
5501 isl::union_pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
5503 if (!ptr)
5504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5505 return isl::pw_aff(*this).preimage_domain_wrapped_domain(upma2);
5508 isl::multi_aff aff::product(const isl::multi_aff &multi2) const
5510 if (!ptr)
5511 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5512 return isl::multi_aff(*this).product(multi2);
5515 isl::multi_pw_aff aff::product(const isl::multi_pw_aff &multi2) const
5517 if (!ptr)
5518 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5519 return isl::pw_aff(*this).product(multi2);
5522 isl::pw_multi_aff aff::product(const isl::pw_multi_aff &pma2) const
5524 if (!ptr)
5525 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5526 return isl::pw_aff(*this).product(pma2);
5529 isl::aff aff::pullback(isl::multi_aff ma) const
5531 if (!ptr || ma.is_null())
5532 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5533 auto saved_ctx = ctx();
5534 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5535 auto res = isl_aff_pullback_multi_aff(copy(), ma.release());
5536 if (!res)
5537 exception::throw_last_error(saved_ctx);
5538 return manage(res);
5541 isl::pw_aff aff::pullback(const isl::multi_pw_aff &mpa) const
5543 if (!ptr)
5544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5545 return isl::pw_aff(*this).pullback(mpa);
5548 isl::pw_aff aff::pullback(const isl::pw_multi_aff &pma) const
5550 if (!ptr)
5551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5552 return isl::pw_aff(*this).pullback(pma);
5555 isl::union_pw_aff aff::pullback(const isl::union_pw_multi_aff &upma) const
5557 if (!ptr)
5558 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5559 return isl::pw_aff(*this).pullback(upma);
5562 isl::aff aff::pullback(const isl::aff &ma) const
5564 if (!ptr)
5565 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5566 return this->pullback(isl::multi_aff(ma));
5569 isl::pw_multi_aff_list aff::pw_multi_aff_list() const
5571 if (!ptr)
5572 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5573 return isl::pw_aff(*this).pw_multi_aff_list();
5576 isl::pw_multi_aff aff::range_factor_domain() const
5578 if (!ptr)
5579 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5580 return isl::pw_aff(*this).range_factor_domain();
5583 isl::pw_multi_aff aff::range_factor_range() const
5585 if (!ptr)
5586 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5587 return isl::pw_aff(*this).range_factor_range();
5590 isl::multi_aff aff::range_product(const isl::multi_aff &multi2) const
5592 if (!ptr)
5593 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5594 return isl::multi_aff(*this).range_product(multi2);
5597 isl::multi_pw_aff aff::range_product(const isl::multi_pw_aff &multi2) const
5599 if (!ptr)
5600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5601 return isl::pw_aff(*this).range_product(multi2);
5604 isl::multi_union_pw_aff aff::range_product(const isl::multi_union_pw_aff &multi2) const
5606 if (!ptr)
5607 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5608 return isl::pw_aff(*this).range_product(multi2);
5611 isl::pw_multi_aff aff::range_product(const isl::pw_multi_aff &pma2) const
5613 if (!ptr)
5614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5615 return isl::pw_aff(*this).range_product(pma2);
5618 isl::union_pw_multi_aff aff::range_product(const isl::union_pw_multi_aff &upma2) const
5620 if (!ptr)
5621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5622 return isl::pw_aff(*this).range_product(upma2);
5625 isl::id aff::range_tuple_id() const
5627 if (!ptr)
5628 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5629 return isl::multi_aff(*this).range_tuple_id();
5632 isl::multi_aff aff::reset_range_tuple_id() const
5634 if (!ptr)
5635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5636 return isl::multi_aff(*this).reset_range_tuple_id();
5639 isl::aff aff::scale(isl::val v) const
5641 if (!ptr || v.is_null())
5642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5643 auto saved_ctx = ctx();
5644 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5645 auto res = isl_aff_scale_val(copy(), v.release());
5646 if (!res)
5647 exception::throw_last_error(saved_ctx);
5648 return manage(res);
5651 isl::aff aff::scale(long v) const
5653 if (!ptr)
5654 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5655 return this->scale(isl::val(ctx(), v));
5658 isl::multi_aff aff::scale(const isl::multi_val &mv) const
5660 if (!ptr)
5661 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5662 return isl::multi_aff(*this).scale(mv);
5665 isl::aff aff::scale_down(isl::val v) const
5667 if (!ptr || v.is_null())
5668 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5669 auto saved_ctx = ctx();
5670 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5671 auto res = isl_aff_scale_down_val(copy(), v.release());
5672 if (!res)
5673 exception::throw_last_error(saved_ctx);
5674 return manage(res);
5677 isl::aff aff::scale_down(long v) const
5679 if (!ptr)
5680 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5681 return this->scale_down(isl::val(ctx(), v));
5684 isl::multi_aff aff::scale_down(const isl::multi_val &mv) const
5686 if (!ptr)
5687 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5688 return isl::multi_aff(*this).scale_down(mv);
5691 isl::multi_aff aff::set_at(int pos, const isl::aff &el) const
5693 if (!ptr)
5694 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5695 return isl::multi_aff(*this).set_at(pos, el);
5698 isl::multi_pw_aff aff::set_at(int pos, const isl::pw_aff &el) const
5700 if (!ptr)
5701 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5702 return isl::pw_aff(*this).set_at(pos, el);
5705 isl::multi_union_pw_aff aff::set_at(int pos, const isl::union_pw_aff &el) const
5707 if (!ptr)
5708 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5709 return isl::pw_aff(*this).set_at(pos, el);
5712 isl::multi_aff aff::set_range_tuple(const isl::id &id) const
5714 if (!ptr)
5715 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5716 return isl::multi_aff(*this).set_range_tuple(id);
5719 isl::multi_aff aff::set_range_tuple(const std::string &id) const
5721 if (!ptr)
5722 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5723 return this->set_range_tuple(isl::id(ctx(), id));
5726 unsigned aff::size() const
5728 if (!ptr)
5729 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5730 return isl::multi_aff(*this).size();
5733 isl::space aff::space() const
5735 if (!ptr)
5736 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5737 return isl::pw_aff(*this).space();
5740 isl::aff aff::sub(isl::aff aff2) const
5742 if (!ptr || aff2.is_null())
5743 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5744 auto saved_ctx = ctx();
5745 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5746 auto res = isl_aff_sub(copy(), aff2.release());
5747 if (!res)
5748 exception::throw_last_error(saved_ctx);
5749 return manage(res);
5752 isl::multi_aff aff::sub(const isl::multi_aff &multi2) const
5754 if (!ptr)
5755 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5756 return isl::multi_aff(*this).sub(multi2);
5759 isl::multi_pw_aff aff::sub(const isl::multi_pw_aff &multi2) const
5761 if (!ptr)
5762 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5763 return isl::pw_aff(*this).sub(multi2);
5766 isl::multi_union_pw_aff aff::sub(const isl::multi_union_pw_aff &multi2) const
5768 if (!ptr)
5769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5770 return isl::pw_aff(*this).sub(multi2);
5773 isl::pw_aff aff::sub(const isl::pw_aff &pwaff2) const
5775 if (!ptr)
5776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5777 return isl::pw_aff(*this).sub(pwaff2);
5780 isl::pw_multi_aff aff::sub(const isl::pw_multi_aff &pma2) const
5782 if (!ptr)
5783 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5784 return isl::pw_aff(*this).sub(pma2);
5787 isl::union_pw_aff aff::sub(const isl::union_pw_aff &upa2) const
5789 if (!ptr)
5790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5791 return isl::pw_aff(*this).sub(upa2);
5794 isl::union_pw_multi_aff aff::sub(const isl::union_pw_multi_aff &upma2) const
5796 if (!ptr)
5797 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5798 return isl::pw_aff(*this).sub(upma2);
5801 isl::pw_aff aff::subtract_domain(const isl::set &set) const
5803 if (!ptr)
5804 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5805 return isl::pw_aff(*this).subtract_domain(set);
5808 isl::union_pw_aff aff::subtract_domain(const isl::space &space) const
5810 if (!ptr)
5811 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5812 return isl::pw_aff(*this).subtract_domain(space);
5815 isl::union_pw_aff aff::subtract_domain(const isl::union_set &uset) const
5817 if (!ptr)
5818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5819 return isl::pw_aff(*this).subtract_domain(uset);
5822 isl::pw_aff aff::tdiv_q(const isl::pw_aff &pa2) const
5824 if (!ptr)
5825 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5826 return isl::pw_aff(*this).tdiv_q(pa2);
5829 isl::pw_aff aff::tdiv_r(const isl::pw_aff &pa2) const
5831 if (!ptr)
5832 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5833 return isl::pw_aff(*this).tdiv_r(pa2);
5836 isl::aff_list aff::to_list() const
5838 if (!ptr)
5839 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5840 auto saved_ctx = ctx();
5841 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5842 auto res = isl_aff_to_list(copy());
5843 if (!res)
5844 exception::throw_last_error(saved_ctx);
5845 return manage(res);
5848 isl::multi_pw_aff aff::to_multi_pw_aff() const
5850 if (!ptr)
5851 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5852 return isl::multi_aff(*this).to_multi_pw_aff();
5855 isl::multi_union_pw_aff aff::to_multi_union_pw_aff() const
5857 if (!ptr)
5858 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5859 return isl::multi_aff(*this).to_multi_union_pw_aff();
5862 isl::pw_multi_aff aff::to_pw_multi_aff() const
5864 if (!ptr)
5865 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5866 return isl::multi_aff(*this).to_pw_multi_aff();
5869 isl::union_pw_aff aff::to_union_pw_aff() const
5871 if (!ptr)
5872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5873 return isl::pw_aff(*this).to_union_pw_aff();
5876 isl::union_pw_multi_aff aff::to_union_pw_multi_aff() const
5878 if (!ptr)
5879 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5880 return isl::pw_aff(*this).to_union_pw_multi_aff();
5883 isl::aff aff::unbind_params_insert_domain(isl::multi_id domain) const
5885 if (!ptr || domain.is_null())
5886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5887 auto saved_ctx = ctx();
5888 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5889 auto res = isl_aff_unbind_params_insert_domain(copy(), domain.release());
5890 if (!res)
5891 exception::throw_last_error(saved_ctx);
5892 return manage(res);
5895 isl::multi_pw_aff aff::union_add(const isl::multi_pw_aff &mpa2) const
5897 if (!ptr)
5898 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5899 return isl::pw_aff(*this).union_add(mpa2);
5902 isl::multi_union_pw_aff aff::union_add(const isl::multi_union_pw_aff &mupa2) const
5904 if (!ptr)
5905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5906 return isl::pw_aff(*this).union_add(mupa2);
5909 isl::pw_aff aff::union_add(const isl::pw_aff &pwaff2) const
5911 if (!ptr)
5912 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5913 return isl::pw_aff(*this).union_add(pwaff2);
5916 isl::pw_multi_aff aff::union_add(const isl::pw_multi_aff &pma2) const
5918 if (!ptr)
5919 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5920 return isl::pw_aff(*this).union_add(pma2);
5923 isl::union_pw_aff aff::union_add(const isl::union_pw_aff &upa2) const
5925 if (!ptr)
5926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5927 return isl::pw_aff(*this).union_add(upa2);
5930 isl::union_pw_multi_aff aff::union_add(const isl::union_pw_multi_aff &upma2) const
5932 if (!ptr)
5933 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5934 return isl::pw_aff(*this).union_add(upma2);
5937 isl::aff aff::zero_on_domain(isl::space space)
5939 if (space.is_null())
5940 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5941 auto saved_ctx = space.ctx();
5942 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5943 auto res = isl_aff_zero_on_domain_space(space.release());
5944 if (!res)
5945 exception::throw_last_error(saved_ctx);
5946 return manage(res);
5949 inline std::ostream &operator<<(std::ostream &os, const aff &obj)
5951 if (!obj.get())
5952 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5953 auto saved_ctx = isl_aff_get_ctx(obj.get());
5954 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5955 char *str = isl_aff_to_str(obj.get());
5956 if (!str)
5957 exception::throw_last_error(saved_ctx);
5958 os << str;
5959 free(str);
5960 return os;
5963 // implementations for isl::aff_list
5964 aff_list manage(__isl_take isl_aff_list *ptr) {
5965 if (!ptr)
5966 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5967 return aff_list(ptr);
5969 aff_list manage_copy(__isl_keep isl_aff_list *ptr) {
5970 if (!ptr)
5971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5972 auto saved_ctx = isl_aff_list_get_ctx(ptr);
5973 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5974 ptr = isl_aff_list_copy(ptr);
5975 if (!ptr)
5976 exception::throw_last_error(saved_ctx);
5977 return aff_list(ptr);
5980 aff_list::aff_list(__isl_take isl_aff_list *ptr)
5981 : ptr(ptr) {}
5983 aff_list::aff_list()
5984 : ptr(nullptr) {}
5986 aff_list::aff_list(const aff_list &obj)
5987 : ptr(nullptr)
5989 if (!obj.ptr)
5990 exception::throw_invalid("NULL input", __FILE__, __LINE__);
5991 auto saved_ctx = isl_aff_list_get_ctx(obj.ptr);
5992 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
5993 ptr = obj.copy();
5994 if (!ptr)
5995 exception::throw_last_error(saved_ctx);
5998 aff_list::aff_list(isl::ctx ctx, int n)
6000 auto saved_ctx = ctx;
6001 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6002 auto res = isl_aff_list_alloc(ctx.release(), n);
6003 if (!res)
6004 exception::throw_last_error(saved_ctx);
6005 ptr = res;
6008 aff_list::aff_list(isl::aff el)
6010 if (el.is_null())
6011 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6012 auto saved_ctx = el.ctx();
6013 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6014 auto res = isl_aff_list_from_aff(el.release());
6015 if (!res)
6016 exception::throw_last_error(saved_ctx);
6017 ptr = res;
6020 aff_list::aff_list(isl::ctx ctx, const std::string &str)
6022 auto saved_ctx = ctx;
6023 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6024 auto res = isl_aff_list_read_from_str(ctx.release(), str.c_str());
6025 if (!res)
6026 exception::throw_last_error(saved_ctx);
6027 ptr = res;
6030 aff_list &aff_list::operator=(aff_list obj) {
6031 std::swap(this->ptr, obj.ptr);
6032 return *this;
6035 aff_list::~aff_list() {
6036 if (ptr)
6037 isl_aff_list_free(ptr);
6040 __isl_give isl_aff_list *aff_list::copy() const & {
6041 return isl_aff_list_copy(ptr);
6044 __isl_keep isl_aff_list *aff_list::get() const {
6045 return ptr;
6048 __isl_give isl_aff_list *aff_list::release() {
6049 isl_aff_list *tmp = ptr;
6050 ptr = nullptr;
6051 return tmp;
6054 bool aff_list::is_null() const {
6055 return ptr == nullptr;
6058 isl::ctx aff_list::ctx() const {
6059 return isl::ctx(isl_aff_list_get_ctx(ptr));
6062 isl::aff_list aff_list::add(isl::aff el) const
6064 if (!ptr || el.is_null())
6065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6066 auto saved_ctx = ctx();
6067 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6068 auto res = isl_aff_list_add(copy(), el.release());
6069 if (!res)
6070 exception::throw_last_error(saved_ctx);
6071 return manage(res);
6074 isl::aff aff_list::at(int index) const
6076 if (!ptr)
6077 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6078 auto saved_ctx = ctx();
6079 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6080 auto res = isl_aff_list_get_at(get(), index);
6081 if (!res)
6082 exception::throw_last_error(saved_ctx);
6083 return manage(res);
6086 isl::aff aff_list::get_at(int index) const
6088 return at(index);
6091 isl::aff_list aff_list::clear() const
6093 if (!ptr)
6094 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6095 auto saved_ctx = ctx();
6096 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6097 auto res = isl_aff_list_clear(copy());
6098 if (!res)
6099 exception::throw_last_error(saved_ctx);
6100 return manage(res);
6103 isl::aff_list aff_list::concat(isl::aff_list list2) const
6105 if (!ptr || list2.is_null())
6106 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6107 auto saved_ctx = ctx();
6108 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6109 auto res = isl_aff_list_concat(copy(), list2.release());
6110 if (!res)
6111 exception::throw_last_error(saved_ctx);
6112 return manage(res);
6115 isl::aff_list aff_list::drop(unsigned int first, unsigned int n) const
6117 if (!ptr)
6118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6119 auto saved_ctx = ctx();
6120 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6121 auto res = isl_aff_list_drop(copy(), first, n);
6122 if (!res)
6123 exception::throw_last_error(saved_ctx);
6124 return manage(res);
6127 void aff_list::foreach(const std::function<void(isl::aff)> &fn) const
6129 if (!ptr)
6130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6131 auto saved_ctx = ctx();
6132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6133 struct fn_data {
6134 std::function<void(isl::aff)> func;
6135 std::exception_ptr eptr;
6136 } fn_data = { fn };
6137 auto fn_lambda = [](isl_aff *arg_0, void *arg_1) -> isl_stat {
6138 auto *data = static_cast<struct fn_data *>(arg_1);
6139 ISL_CPP_TRY {
6140 (data->func)(manage(arg_0));
6141 return isl_stat_ok;
6142 } ISL_CPP_CATCH_ALL {
6143 data->eptr = std::current_exception();
6144 return isl_stat_error;
6147 auto res = isl_aff_list_foreach(get(), fn_lambda, &fn_data);
6148 if (fn_data.eptr)
6149 std::rethrow_exception(fn_data.eptr);
6150 if (res < 0)
6151 exception::throw_last_error(saved_ctx);
6152 return;
6155 void aff_list::foreach_scc(const std::function<bool(isl::aff, isl::aff)> &follows, const std::function<void(isl::aff_list)> &fn) const
6157 if (!ptr)
6158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6159 auto saved_ctx = ctx();
6160 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6161 struct follows_data {
6162 std::function<bool(isl::aff, isl::aff)> func;
6163 std::exception_ptr eptr;
6164 } follows_data = { follows };
6165 auto follows_lambda = [](isl_aff *arg_0, isl_aff *arg_1, void *arg_2) -> isl_bool {
6166 auto *data = static_cast<struct follows_data *>(arg_2);
6167 ISL_CPP_TRY {
6168 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
6169 return ret ? isl_bool_true : isl_bool_false;
6170 } ISL_CPP_CATCH_ALL {
6171 data->eptr = std::current_exception();
6172 return isl_bool_error;
6175 struct fn_data {
6176 std::function<void(isl::aff_list)> func;
6177 std::exception_ptr eptr;
6178 } fn_data = { fn };
6179 auto fn_lambda = [](isl_aff_list *arg_0, void *arg_1) -> isl_stat {
6180 auto *data = static_cast<struct fn_data *>(arg_1);
6181 ISL_CPP_TRY {
6182 (data->func)(manage(arg_0));
6183 return isl_stat_ok;
6184 } ISL_CPP_CATCH_ALL {
6185 data->eptr = std::current_exception();
6186 return isl_stat_error;
6189 auto res = isl_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
6190 if (follows_data.eptr)
6191 std::rethrow_exception(follows_data.eptr);
6192 if (fn_data.eptr)
6193 std::rethrow_exception(fn_data.eptr);
6194 if (res < 0)
6195 exception::throw_last_error(saved_ctx);
6196 return;
6199 isl::aff_list aff_list::insert(unsigned int pos, isl::aff el) const
6201 if (!ptr || el.is_null())
6202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6203 auto saved_ctx = ctx();
6204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6205 auto res = isl_aff_list_insert(copy(), pos, el.release());
6206 if (!res)
6207 exception::throw_last_error(saved_ctx);
6208 return manage(res);
6211 isl::aff_list aff_list::set_at(int index, isl::aff el) const
6213 if (!ptr || el.is_null())
6214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6215 auto saved_ctx = ctx();
6216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6217 auto res = isl_aff_list_set_at(copy(), index, el.release());
6218 if (!res)
6219 exception::throw_last_error(saved_ctx);
6220 return manage(res);
6223 unsigned aff_list::size() const
6225 if (!ptr)
6226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6227 auto saved_ctx = ctx();
6228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6229 auto res = isl_aff_list_size(get());
6230 if (res < 0)
6231 exception::throw_last_error(saved_ctx);
6232 return res;
6235 inline std::ostream &operator<<(std::ostream &os, const aff_list &obj)
6237 if (!obj.get())
6238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6239 auto saved_ctx = isl_aff_list_get_ctx(obj.get());
6240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6241 char *str = isl_aff_list_to_str(obj.get());
6242 if (!str)
6243 exception::throw_last_error(saved_ctx);
6244 os << str;
6245 free(str);
6246 return os;
6249 // implementations for isl::ast_build
6250 ast_build manage(__isl_take isl_ast_build *ptr) {
6251 if (!ptr)
6252 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6253 return ast_build(ptr);
6255 ast_build manage_copy(__isl_keep isl_ast_build *ptr) {
6256 if (!ptr)
6257 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6258 auto saved_ctx = isl_ast_build_get_ctx(ptr);
6259 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6260 ptr = isl_ast_build_copy(ptr);
6261 if (!ptr)
6262 exception::throw_last_error(saved_ctx);
6263 return ast_build(ptr);
6266 ast_build::ast_build(__isl_take isl_ast_build *ptr)
6267 : ptr(ptr) {}
6269 ast_build::ast_build()
6270 : ptr(nullptr) {}
6272 ast_build::ast_build(const ast_build &obj)
6273 : ptr(nullptr)
6275 if (!obj.ptr)
6276 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6277 auto saved_ctx = isl_ast_build_get_ctx(obj.ptr);
6278 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6279 ptr = obj.copy();
6280 copy_callbacks(obj);
6281 if (!ptr)
6282 exception::throw_last_error(saved_ctx);
6285 ast_build::ast_build(isl::ctx ctx)
6287 auto saved_ctx = ctx;
6288 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6289 auto res = isl_ast_build_alloc(ctx.release());
6290 if (!res)
6291 exception::throw_last_error(saved_ctx);
6292 ptr = res;
6295 ast_build &ast_build::operator=(ast_build obj) {
6296 std::swap(this->ptr, obj.ptr);
6297 copy_callbacks(obj);
6298 return *this;
6301 ast_build::~ast_build() {
6302 if (ptr)
6303 isl_ast_build_free(ptr);
6306 __isl_give isl_ast_build *ast_build::copy() const & {
6307 return isl_ast_build_copy(ptr);
6310 __isl_keep isl_ast_build *ast_build::get() const {
6311 return ptr;
6314 __isl_give isl_ast_build *ast_build::release() {
6315 if (at_each_domain_data)
6316 exception::throw_invalid("cannot release object with persistent callbacks", __FILE__, __LINE__);
6317 isl_ast_build *tmp = ptr;
6318 ptr = nullptr;
6319 return tmp;
6322 bool ast_build::is_null() const {
6323 return ptr == nullptr;
6326 isl::ctx ast_build::ctx() const {
6327 return isl::ctx(isl_ast_build_get_ctx(ptr));
6330 ast_build &ast_build::copy_callbacks(const ast_build &obj)
6332 at_each_domain_data = obj.at_each_domain_data;
6333 return *this;
6336 isl_ast_node *ast_build::at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2)
6338 auto *data = static_cast<struct at_each_domain_data *>(arg_2);
6339 ISL_CPP_TRY {
6340 auto ret = (data->func)(manage(arg_0), manage_copy(arg_1));
6341 return ret.release();
6342 } ISL_CPP_CATCH_ALL {
6343 data->eptr = std::current_exception();
6344 return NULL;
6348 void ast_build::set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn)
6350 if (!ptr)
6351 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6352 auto saved_ctx = isl_ast_build_get_ctx(ptr);
6353 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6354 at_each_domain_data = std::make_shared<struct at_each_domain_data>();
6355 at_each_domain_data->func = fn;
6356 ptr = isl_ast_build_set_at_each_domain(ptr, &at_each_domain, at_each_domain_data.get());
6357 if (!ptr)
6358 exception::throw_last_error(saved_ctx);
6361 isl::ast_build ast_build::set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const
6363 auto copy = *this;
6364 copy.set_at_each_domain_data(fn);
6365 return copy;
6368 isl::ast_expr ast_build::access_from(isl::multi_pw_aff mpa) const
6370 if (!ptr || mpa.is_null())
6371 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6372 auto saved_ctx = ctx();
6373 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6374 auto res = isl_ast_build_access_from_multi_pw_aff(get(), mpa.release());
6375 if (at_each_domain_data && at_each_domain_data->eptr) {
6376 std::exception_ptr eptr = at_each_domain_data->eptr;
6377 at_each_domain_data->eptr = nullptr;
6378 std::rethrow_exception(eptr);
6380 if (!res)
6381 exception::throw_last_error(saved_ctx);
6382 return manage(res);
6385 isl::ast_expr ast_build::access_from(isl::pw_multi_aff pma) const
6387 if (!ptr || pma.is_null())
6388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6389 auto saved_ctx = ctx();
6390 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6391 auto res = isl_ast_build_access_from_pw_multi_aff(get(), pma.release());
6392 if (at_each_domain_data && at_each_domain_data->eptr) {
6393 std::exception_ptr eptr = at_each_domain_data->eptr;
6394 at_each_domain_data->eptr = nullptr;
6395 std::rethrow_exception(eptr);
6397 if (!res)
6398 exception::throw_last_error(saved_ctx);
6399 return manage(res);
6402 isl::ast_expr ast_build::call_from(isl::multi_pw_aff mpa) const
6404 if (!ptr || mpa.is_null())
6405 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6406 auto saved_ctx = ctx();
6407 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6408 auto res = isl_ast_build_call_from_multi_pw_aff(get(), mpa.release());
6409 if (at_each_domain_data && at_each_domain_data->eptr) {
6410 std::exception_ptr eptr = at_each_domain_data->eptr;
6411 at_each_domain_data->eptr = nullptr;
6412 std::rethrow_exception(eptr);
6414 if (!res)
6415 exception::throw_last_error(saved_ctx);
6416 return manage(res);
6419 isl::ast_expr ast_build::call_from(isl::pw_multi_aff pma) const
6421 if (!ptr || pma.is_null())
6422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6423 auto saved_ctx = ctx();
6424 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6425 auto res = isl_ast_build_call_from_pw_multi_aff(get(), pma.release());
6426 if (at_each_domain_data && at_each_domain_data->eptr) {
6427 std::exception_ptr eptr = at_each_domain_data->eptr;
6428 at_each_domain_data->eptr = nullptr;
6429 std::rethrow_exception(eptr);
6431 if (!res)
6432 exception::throw_last_error(saved_ctx);
6433 return manage(res);
6436 isl::ast_expr ast_build::expr_from(isl::pw_aff pa) const
6438 if (!ptr || pa.is_null())
6439 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6440 auto saved_ctx = ctx();
6441 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6442 auto res = isl_ast_build_expr_from_pw_aff(get(), pa.release());
6443 if (at_each_domain_data && at_each_domain_data->eptr) {
6444 std::exception_ptr eptr = at_each_domain_data->eptr;
6445 at_each_domain_data->eptr = nullptr;
6446 std::rethrow_exception(eptr);
6448 if (!res)
6449 exception::throw_last_error(saved_ctx);
6450 return manage(res);
6453 isl::ast_expr ast_build::expr_from(isl::set set) const
6455 if (!ptr || set.is_null())
6456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6457 auto saved_ctx = ctx();
6458 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6459 auto res = isl_ast_build_expr_from_set(get(), set.release());
6460 if (at_each_domain_data && at_each_domain_data->eptr) {
6461 std::exception_ptr eptr = at_each_domain_data->eptr;
6462 at_each_domain_data->eptr = nullptr;
6463 std::rethrow_exception(eptr);
6465 if (!res)
6466 exception::throw_last_error(saved_ctx);
6467 return manage(res);
6470 isl::ast_build ast_build::from_context(isl::set set)
6472 if (set.is_null())
6473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6474 auto saved_ctx = set.ctx();
6475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6476 auto res = isl_ast_build_from_context(set.release());
6477 if (!res)
6478 exception::throw_last_error(saved_ctx);
6479 return manage(res);
6482 isl::ast_node ast_build::node_from(isl::schedule schedule) const
6484 if (!ptr || schedule.is_null())
6485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6486 auto saved_ctx = ctx();
6487 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6488 auto res = isl_ast_build_node_from_schedule(get(), schedule.release());
6489 if (at_each_domain_data && at_each_domain_data->eptr) {
6490 std::exception_ptr eptr = at_each_domain_data->eptr;
6491 at_each_domain_data->eptr = nullptr;
6492 std::rethrow_exception(eptr);
6494 if (!res)
6495 exception::throw_last_error(saved_ctx);
6496 return manage(res);
6499 isl::ast_node ast_build::node_from_schedule_map(isl::union_map schedule) const
6501 if (!ptr || schedule.is_null())
6502 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6503 auto saved_ctx = ctx();
6504 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6505 auto res = isl_ast_build_node_from_schedule_map(get(), schedule.release());
6506 if (at_each_domain_data && at_each_domain_data->eptr) {
6507 std::exception_ptr eptr = at_each_domain_data->eptr;
6508 at_each_domain_data->eptr = nullptr;
6509 std::rethrow_exception(eptr);
6511 if (!res)
6512 exception::throw_last_error(saved_ctx);
6513 return manage(res);
6516 isl::union_map ast_build::schedule() const
6518 if (!ptr)
6519 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6520 auto saved_ctx = ctx();
6521 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6522 auto res = isl_ast_build_get_schedule(get());
6523 if (at_each_domain_data && at_each_domain_data->eptr) {
6524 std::exception_ptr eptr = at_each_domain_data->eptr;
6525 at_each_domain_data->eptr = nullptr;
6526 std::rethrow_exception(eptr);
6528 if (!res)
6529 exception::throw_last_error(saved_ctx);
6530 return manage(res);
6533 isl::union_map ast_build::get_schedule() const
6535 return schedule();
6538 // implementations for isl::ast_expr
6539 ast_expr manage(__isl_take isl_ast_expr *ptr) {
6540 if (!ptr)
6541 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6542 return ast_expr(ptr);
6544 ast_expr manage_copy(__isl_keep isl_ast_expr *ptr) {
6545 if (!ptr)
6546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6547 auto saved_ctx = isl_ast_expr_get_ctx(ptr);
6548 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6549 ptr = isl_ast_expr_copy(ptr);
6550 if (!ptr)
6551 exception::throw_last_error(saved_ctx);
6552 return ast_expr(ptr);
6555 ast_expr::ast_expr(__isl_take isl_ast_expr *ptr)
6556 : ptr(ptr) {}
6558 ast_expr::ast_expr()
6559 : ptr(nullptr) {}
6561 ast_expr::ast_expr(const ast_expr &obj)
6562 : ptr(nullptr)
6564 if (!obj.ptr)
6565 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6566 auto saved_ctx = isl_ast_expr_get_ctx(obj.ptr);
6567 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6568 ptr = obj.copy();
6569 if (!ptr)
6570 exception::throw_last_error(saved_ctx);
6573 ast_expr &ast_expr::operator=(ast_expr obj) {
6574 std::swap(this->ptr, obj.ptr);
6575 return *this;
6578 ast_expr::~ast_expr() {
6579 if (ptr)
6580 isl_ast_expr_free(ptr);
6583 __isl_give isl_ast_expr *ast_expr::copy() const & {
6584 return isl_ast_expr_copy(ptr);
6587 __isl_keep isl_ast_expr *ast_expr::get() const {
6588 return ptr;
6591 __isl_give isl_ast_expr *ast_expr::release() {
6592 isl_ast_expr *tmp = ptr;
6593 ptr = nullptr;
6594 return tmp;
6597 bool ast_expr::is_null() const {
6598 return ptr == nullptr;
6601 template <typename T, typename>
6602 bool ast_expr::isa_type(T subtype) const
6604 if (is_null())
6605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6606 return isl_ast_expr_get_type(get()) == subtype;
6608 template <class T>
6609 bool ast_expr::isa() const
6611 return isa_type<decltype(T::type)>(T::type);
6613 template <class T>
6614 T ast_expr::as() const
6616 if (!isa<T>())
6617 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6618 return T(copy());
6621 isl::ctx ast_expr::ctx() const {
6622 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6625 std::string ast_expr::to_C_str() const
6627 if (!ptr)
6628 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6629 auto saved_ctx = ctx();
6630 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6631 auto res = isl_ast_expr_to_C_str(get());
6632 std::string tmp(res);
6633 free(res);
6634 return tmp;
6637 inline std::ostream &operator<<(std::ostream &os, const ast_expr &obj)
6639 if (!obj.get())
6640 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6641 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6642 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6643 char *str = isl_ast_expr_to_str(obj.get());
6644 if (!str)
6645 exception::throw_last_error(saved_ctx);
6646 os << str;
6647 free(str);
6648 return os;
6651 // implementations for isl::ast_expr_id
6652 ast_expr_id::ast_expr_id(__isl_take isl_ast_expr *ptr)
6653 : ast_expr(ptr) {}
6655 ast_expr_id::ast_expr_id()
6656 : ast_expr() {}
6658 ast_expr_id::ast_expr_id(const ast_expr_id &obj)
6659 : ast_expr(obj)
6663 ast_expr_id &ast_expr_id::operator=(ast_expr_id obj) {
6664 std::swap(this->ptr, obj.ptr);
6665 return *this;
6668 isl::ctx ast_expr_id::ctx() const {
6669 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6672 isl::id ast_expr_id::id() const
6674 if (!ptr)
6675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6676 auto saved_ctx = ctx();
6677 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6678 auto res = isl_ast_expr_id_get_id(get());
6679 if (!res)
6680 exception::throw_last_error(saved_ctx);
6681 return manage(res);
6684 isl::id ast_expr_id::get_id() const
6686 return id();
6689 inline std::ostream &operator<<(std::ostream &os, const ast_expr_id &obj)
6691 if (!obj.get())
6692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6693 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6694 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6695 char *str = isl_ast_expr_to_str(obj.get());
6696 if (!str)
6697 exception::throw_last_error(saved_ctx);
6698 os << str;
6699 free(str);
6700 return os;
6703 // implementations for isl::ast_expr_int
6704 ast_expr_int::ast_expr_int(__isl_take isl_ast_expr *ptr)
6705 : ast_expr(ptr) {}
6707 ast_expr_int::ast_expr_int()
6708 : ast_expr() {}
6710 ast_expr_int::ast_expr_int(const ast_expr_int &obj)
6711 : ast_expr(obj)
6715 ast_expr_int &ast_expr_int::operator=(ast_expr_int obj) {
6716 std::swap(this->ptr, obj.ptr);
6717 return *this;
6720 isl::ctx ast_expr_int::ctx() const {
6721 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6724 isl::val ast_expr_int::val() const
6726 if (!ptr)
6727 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6728 auto saved_ctx = ctx();
6729 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6730 auto res = isl_ast_expr_int_get_val(get());
6731 if (!res)
6732 exception::throw_last_error(saved_ctx);
6733 return manage(res);
6736 isl::val ast_expr_int::get_val() const
6738 return val();
6741 inline std::ostream &operator<<(std::ostream &os, const ast_expr_int &obj)
6743 if (!obj.get())
6744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6745 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6746 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6747 char *str = isl_ast_expr_to_str(obj.get());
6748 if (!str)
6749 exception::throw_last_error(saved_ctx);
6750 os << str;
6751 free(str);
6752 return os;
6755 // implementations for isl::ast_expr_op
6756 ast_expr_op::ast_expr_op(__isl_take isl_ast_expr *ptr)
6757 : ast_expr(ptr) {}
6759 ast_expr_op::ast_expr_op()
6760 : ast_expr() {}
6762 ast_expr_op::ast_expr_op(const ast_expr_op &obj)
6763 : ast_expr(obj)
6767 ast_expr_op &ast_expr_op::operator=(ast_expr_op obj) {
6768 std::swap(this->ptr, obj.ptr);
6769 return *this;
6772 template <typename T, typename>
6773 bool ast_expr_op::isa_type(T subtype) const
6775 if (is_null())
6776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6777 return isl_ast_expr_op_get_type(get()) == subtype;
6779 template <class T>
6780 bool ast_expr_op::isa() const
6782 return isa_type<decltype(T::type)>(T::type);
6784 template <class T>
6785 T ast_expr_op::as() const
6787 if (!isa<T>())
6788 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6789 return T(copy());
6792 isl::ctx ast_expr_op::ctx() const {
6793 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6796 isl::ast_expr ast_expr_op::arg(int pos) const
6798 if (!ptr)
6799 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6800 auto saved_ctx = ctx();
6801 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6802 auto res = isl_ast_expr_op_get_arg(get(), pos);
6803 if (!res)
6804 exception::throw_last_error(saved_ctx);
6805 return manage(res);
6808 isl::ast_expr ast_expr_op::get_arg(int pos) const
6810 return arg(pos);
6813 unsigned ast_expr_op::n_arg() const
6815 if (!ptr)
6816 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6817 auto saved_ctx = ctx();
6818 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6819 auto res = isl_ast_expr_op_get_n_arg(get());
6820 if (res < 0)
6821 exception::throw_last_error(saved_ctx);
6822 return res;
6825 unsigned ast_expr_op::get_n_arg() const
6827 return n_arg();
6830 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op &obj)
6832 if (!obj.get())
6833 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6834 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6835 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6836 char *str = isl_ast_expr_to_str(obj.get());
6837 if (!str)
6838 exception::throw_last_error(saved_ctx);
6839 os << str;
6840 free(str);
6841 return os;
6844 // implementations for isl::ast_expr_op_access
6845 ast_expr_op_access::ast_expr_op_access(__isl_take isl_ast_expr *ptr)
6846 : ast_expr_op(ptr) {}
6848 ast_expr_op_access::ast_expr_op_access()
6849 : ast_expr_op() {}
6851 ast_expr_op_access::ast_expr_op_access(const ast_expr_op_access &obj)
6852 : ast_expr_op(obj)
6856 ast_expr_op_access &ast_expr_op_access::operator=(ast_expr_op_access obj) {
6857 std::swap(this->ptr, obj.ptr);
6858 return *this;
6861 isl::ctx ast_expr_op_access::ctx() const {
6862 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6865 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_access &obj)
6867 if (!obj.get())
6868 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6869 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6870 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6871 char *str = isl_ast_expr_to_str(obj.get());
6872 if (!str)
6873 exception::throw_last_error(saved_ctx);
6874 os << str;
6875 free(str);
6876 return os;
6879 // implementations for isl::ast_expr_op_add
6880 ast_expr_op_add::ast_expr_op_add(__isl_take isl_ast_expr *ptr)
6881 : ast_expr_op(ptr) {}
6883 ast_expr_op_add::ast_expr_op_add()
6884 : ast_expr_op() {}
6886 ast_expr_op_add::ast_expr_op_add(const ast_expr_op_add &obj)
6887 : ast_expr_op(obj)
6891 ast_expr_op_add &ast_expr_op_add::operator=(ast_expr_op_add obj) {
6892 std::swap(this->ptr, obj.ptr);
6893 return *this;
6896 isl::ctx ast_expr_op_add::ctx() const {
6897 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6900 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_add &obj)
6902 if (!obj.get())
6903 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6904 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6905 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6906 char *str = isl_ast_expr_to_str(obj.get());
6907 if (!str)
6908 exception::throw_last_error(saved_ctx);
6909 os << str;
6910 free(str);
6911 return os;
6914 // implementations for isl::ast_expr_op_address_of
6915 ast_expr_op_address_of::ast_expr_op_address_of(__isl_take isl_ast_expr *ptr)
6916 : ast_expr_op(ptr) {}
6918 ast_expr_op_address_of::ast_expr_op_address_of()
6919 : ast_expr_op() {}
6921 ast_expr_op_address_of::ast_expr_op_address_of(const ast_expr_op_address_of &obj)
6922 : ast_expr_op(obj)
6926 ast_expr_op_address_of &ast_expr_op_address_of::operator=(ast_expr_op_address_of obj) {
6927 std::swap(this->ptr, obj.ptr);
6928 return *this;
6931 isl::ctx ast_expr_op_address_of::ctx() const {
6932 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6935 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_address_of &obj)
6937 if (!obj.get())
6938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6939 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6940 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6941 char *str = isl_ast_expr_to_str(obj.get());
6942 if (!str)
6943 exception::throw_last_error(saved_ctx);
6944 os << str;
6945 free(str);
6946 return os;
6949 // implementations for isl::ast_expr_op_and
6950 ast_expr_op_and::ast_expr_op_and(__isl_take isl_ast_expr *ptr)
6951 : ast_expr_op(ptr) {}
6953 ast_expr_op_and::ast_expr_op_and()
6954 : ast_expr_op() {}
6956 ast_expr_op_and::ast_expr_op_and(const ast_expr_op_and &obj)
6957 : ast_expr_op(obj)
6961 ast_expr_op_and &ast_expr_op_and::operator=(ast_expr_op_and obj) {
6962 std::swap(this->ptr, obj.ptr);
6963 return *this;
6966 isl::ctx ast_expr_op_and::ctx() const {
6967 return isl::ctx(isl_ast_expr_get_ctx(ptr));
6970 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and &obj)
6972 if (!obj.get())
6973 exception::throw_invalid("NULL input", __FILE__, __LINE__);
6974 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
6975 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
6976 char *str = isl_ast_expr_to_str(obj.get());
6977 if (!str)
6978 exception::throw_last_error(saved_ctx);
6979 os << str;
6980 free(str);
6981 return os;
6984 // implementations for isl::ast_expr_op_and_then
6985 ast_expr_op_and_then::ast_expr_op_and_then(__isl_take isl_ast_expr *ptr)
6986 : ast_expr_op(ptr) {}
6988 ast_expr_op_and_then::ast_expr_op_and_then()
6989 : ast_expr_op() {}
6991 ast_expr_op_and_then::ast_expr_op_and_then(const ast_expr_op_and_then &obj)
6992 : ast_expr_op(obj)
6996 ast_expr_op_and_then &ast_expr_op_and_then::operator=(ast_expr_op_and_then obj) {
6997 std::swap(this->ptr, obj.ptr);
6998 return *this;
7001 isl::ctx ast_expr_op_and_then::ctx() const {
7002 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7005 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and_then &obj)
7007 if (!obj.get())
7008 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7009 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7010 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7011 char *str = isl_ast_expr_to_str(obj.get());
7012 if (!str)
7013 exception::throw_last_error(saved_ctx);
7014 os << str;
7015 free(str);
7016 return os;
7019 // implementations for isl::ast_expr_op_call
7020 ast_expr_op_call::ast_expr_op_call(__isl_take isl_ast_expr *ptr)
7021 : ast_expr_op(ptr) {}
7023 ast_expr_op_call::ast_expr_op_call()
7024 : ast_expr_op() {}
7026 ast_expr_op_call::ast_expr_op_call(const ast_expr_op_call &obj)
7027 : ast_expr_op(obj)
7031 ast_expr_op_call &ast_expr_op_call::operator=(ast_expr_op_call obj) {
7032 std::swap(this->ptr, obj.ptr);
7033 return *this;
7036 isl::ctx ast_expr_op_call::ctx() const {
7037 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7040 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_call &obj)
7042 if (!obj.get())
7043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7044 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7045 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7046 char *str = isl_ast_expr_to_str(obj.get());
7047 if (!str)
7048 exception::throw_last_error(saved_ctx);
7049 os << str;
7050 free(str);
7051 return os;
7054 // implementations for isl::ast_expr_op_cond
7055 ast_expr_op_cond::ast_expr_op_cond(__isl_take isl_ast_expr *ptr)
7056 : ast_expr_op(ptr) {}
7058 ast_expr_op_cond::ast_expr_op_cond()
7059 : ast_expr_op() {}
7061 ast_expr_op_cond::ast_expr_op_cond(const ast_expr_op_cond &obj)
7062 : ast_expr_op(obj)
7066 ast_expr_op_cond &ast_expr_op_cond::operator=(ast_expr_op_cond obj) {
7067 std::swap(this->ptr, obj.ptr);
7068 return *this;
7071 isl::ctx ast_expr_op_cond::ctx() const {
7072 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7075 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_cond &obj)
7077 if (!obj.get())
7078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7079 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7080 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7081 char *str = isl_ast_expr_to_str(obj.get());
7082 if (!str)
7083 exception::throw_last_error(saved_ctx);
7084 os << str;
7085 free(str);
7086 return os;
7089 // implementations for isl::ast_expr_op_div
7090 ast_expr_op_div::ast_expr_op_div(__isl_take isl_ast_expr *ptr)
7091 : ast_expr_op(ptr) {}
7093 ast_expr_op_div::ast_expr_op_div()
7094 : ast_expr_op() {}
7096 ast_expr_op_div::ast_expr_op_div(const ast_expr_op_div &obj)
7097 : ast_expr_op(obj)
7101 ast_expr_op_div &ast_expr_op_div::operator=(ast_expr_op_div obj) {
7102 std::swap(this->ptr, obj.ptr);
7103 return *this;
7106 isl::ctx ast_expr_op_div::ctx() const {
7107 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7110 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_div &obj)
7112 if (!obj.get())
7113 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7114 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7115 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7116 char *str = isl_ast_expr_to_str(obj.get());
7117 if (!str)
7118 exception::throw_last_error(saved_ctx);
7119 os << str;
7120 free(str);
7121 return os;
7124 // implementations for isl::ast_expr_op_eq
7125 ast_expr_op_eq::ast_expr_op_eq(__isl_take isl_ast_expr *ptr)
7126 : ast_expr_op(ptr) {}
7128 ast_expr_op_eq::ast_expr_op_eq()
7129 : ast_expr_op() {}
7131 ast_expr_op_eq::ast_expr_op_eq(const ast_expr_op_eq &obj)
7132 : ast_expr_op(obj)
7136 ast_expr_op_eq &ast_expr_op_eq::operator=(ast_expr_op_eq obj) {
7137 std::swap(this->ptr, obj.ptr);
7138 return *this;
7141 isl::ctx ast_expr_op_eq::ctx() const {
7142 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7145 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_eq &obj)
7147 if (!obj.get())
7148 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7149 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7150 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7151 char *str = isl_ast_expr_to_str(obj.get());
7152 if (!str)
7153 exception::throw_last_error(saved_ctx);
7154 os << str;
7155 free(str);
7156 return os;
7159 // implementations for isl::ast_expr_op_fdiv_q
7160 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr)
7161 : ast_expr_op(ptr) {}
7163 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q()
7164 : ast_expr_op() {}
7166 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj)
7167 : ast_expr_op(obj)
7171 ast_expr_op_fdiv_q &ast_expr_op_fdiv_q::operator=(ast_expr_op_fdiv_q obj) {
7172 std::swap(this->ptr, obj.ptr);
7173 return *this;
7176 isl::ctx ast_expr_op_fdiv_q::ctx() const {
7177 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7180 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_fdiv_q &obj)
7182 if (!obj.get())
7183 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7184 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7185 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7186 char *str = isl_ast_expr_to_str(obj.get());
7187 if (!str)
7188 exception::throw_last_error(saved_ctx);
7189 os << str;
7190 free(str);
7191 return os;
7194 // implementations for isl::ast_expr_op_ge
7195 ast_expr_op_ge::ast_expr_op_ge(__isl_take isl_ast_expr *ptr)
7196 : ast_expr_op(ptr) {}
7198 ast_expr_op_ge::ast_expr_op_ge()
7199 : ast_expr_op() {}
7201 ast_expr_op_ge::ast_expr_op_ge(const ast_expr_op_ge &obj)
7202 : ast_expr_op(obj)
7206 ast_expr_op_ge &ast_expr_op_ge::operator=(ast_expr_op_ge obj) {
7207 std::swap(this->ptr, obj.ptr);
7208 return *this;
7211 isl::ctx ast_expr_op_ge::ctx() const {
7212 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7215 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_ge &obj)
7217 if (!obj.get())
7218 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7219 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7220 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7221 char *str = isl_ast_expr_to_str(obj.get());
7222 if (!str)
7223 exception::throw_last_error(saved_ctx);
7224 os << str;
7225 free(str);
7226 return os;
7229 // implementations for isl::ast_expr_op_gt
7230 ast_expr_op_gt::ast_expr_op_gt(__isl_take isl_ast_expr *ptr)
7231 : ast_expr_op(ptr) {}
7233 ast_expr_op_gt::ast_expr_op_gt()
7234 : ast_expr_op() {}
7236 ast_expr_op_gt::ast_expr_op_gt(const ast_expr_op_gt &obj)
7237 : ast_expr_op(obj)
7241 ast_expr_op_gt &ast_expr_op_gt::operator=(ast_expr_op_gt obj) {
7242 std::swap(this->ptr, obj.ptr);
7243 return *this;
7246 isl::ctx ast_expr_op_gt::ctx() const {
7247 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7250 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_gt &obj)
7252 if (!obj.get())
7253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7254 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7255 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7256 char *str = isl_ast_expr_to_str(obj.get());
7257 if (!str)
7258 exception::throw_last_error(saved_ctx);
7259 os << str;
7260 free(str);
7261 return os;
7264 // implementations for isl::ast_expr_op_le
7265 ast_expr_op_le::ast_expr_op_le(__isl_take isl_ast_expr *ptr)
7266 : ast_expr_op(ptr) {}
7268 ast_expr_op_le::ast_expr_op_le()
7269 : ast_expr_op() {}
7271 ast_expr_op_le::ast_expr_op_le(const ast_expr_op_le &obj)
7272 : ast_expr_op(obj)
7276 ast_expr_op_le &ast_expr_op_le::operator=(ast_expr_op_le obj) {
7277 std::swap(this->ptr, obj.ptr);
7278 return *this;
7281 isl::ctx ast_expr_op_le::ctx() const {
7282 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7285 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_le &obj)
7287 if (!obj.get())
7288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7289 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7290 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7291 char *str = isl_ast_expr_to_str(obj.get());
7292 if (!str)
7293 exception::throw_last_error(saved_ctx);
7294 os << str;
7295 free(str);
7296 return os;
7299 // implementations for isl::ast_expr_op_lt
7300 ast_expr_op_lt::ast_expr_op_lt(__isl_take isl_ast_expr *ptr)
7301 : ast_expr_op(ptr) {}
7303 ast_expr_op_lt::ast_expr_op_lt()
7304 : ast_expr_op() {}
7306 ast_expr_op_lt::ast_expr_op_lt(const ast_expr_op_lt &obj)
7307 : ast_expr_op(obj)
7311 ast_expr_op_lt &ast_expr_op_lt::operator=(ast_expr_op_lt obj) {
7312 std::swap(this->ptr, obj.ptr);
7313 return *this;
7316 isl::ctx ast_expr_op_lt::ctx() const {
7317 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7320 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_lt &obj)
7322 if (!obj.get())
7323 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7324 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7325 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7326 char *str = isl_ast_expr_to_str(obj.get());
7327 if (!str)
7328 exception::throw_last_error(saved_ctx);
7329 os << str;
7330 free(str);
7331 return os;
7334 // implementations for isl::ast_expr_op_max
7335 ast_expr_op_max::ast_expr_op_max(__isl_take isl_ast_expr *ptr)
7336 : ast_expr_op(ptr) {}
7338 ast_expr_op_max::ast_expr_op_max()
7339 : ast_expr_op() {}
7341 ast_expr_op_max::ast_expr_op_max(const ast_expr_op_max &obj)
7342 : ast_expr_op(obj)
7346 ast_expr_op_max &ast_expr_op_max::operator=(ast_expr_op_max obj) {
7347 std::swap(this->ptr, obj.ptr);
7348 return *this;
7351 isl::ctx ast_expr_op_max::ctx() const {
7352 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7355 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_max &obj)
7357 if (!obj.get())
7358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7359 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7360 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7361 char *str = isl_ast_expr_to_str(obj.get());
7362 if (!str)
7363 exception::throw_last_error(saved_ctx);
7364 os << str;
7365 free(str);
7366 return os;
7369 // implementations for isl::ast_expr_op_member
7370 ast_expr_op_member::ast_expr_op_member(__isl_take isl_ast_expr *ptr)
7371 : ast_expr_op(ptr) {}
7373 ast_expr_op_member::ast_expr_op_member()
7374 : ast_expr_op() {}
7376 ast_expr_op_member::ast_expr_op_member(const ast_expr_op_member &obj)
7377 : ast_expr_op(obj)
7381 ast_expr_op_member &ast_expr_op_member::operator=(ast_expr_op_member obj) {
7382 std::swap(this->ptr, obj.ptr);
7383 return *this;
7386 isl::ctx ast_expr_op_member::ctx() const {
7387 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7390 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_member &obj)
7392 if (!obj.get())
7393 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7394 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7395 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7396 char *str = isl_ast_expr_to_str(obj.get());
7397 if (!str)
7398 exception::throw_last_error(saved_ctx);
7399 os << str;
7400 free(str);
7401 return os;
7404 // implementations for isl::ast_expr_op_min
7405 ast_expr_op_min::ast_expr_op_min(__isl_take isl_ast_expr *ptr)
7406 : ast_expr_op(ptr) {}
7408 ast_expr_op_min::ast_expr_op_min()
7409 : ast_expr_op() {}
7411 ast_expr_op_min::ast_expr_op_min(const ast_expr_op_min &obj)
7412 : ast_expr_op(obj)
7416 ast_expr_op_min &ast_expr_op_min::operator=(ast_expr_op_min obj) {
7417 std::swap(this->ptr, obj.ptr);
7418 return *this;
7421 isl::ctx ast_expr_op_min::ctx() const {
7422 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7425 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_min &obj)
7427 if (!obj.get())
7428 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7429 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7430 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7431 char *str = isl_ast_expr_to_str(obj.get());
7432 if (!str)
7433 exception::throw_last_error(saved_ctx);
7434 os << str;
7435 free(str);
7436 return os;
7439 // implementations for isl::ast_expr_op_minus
7440 ast_expr_op_minus::ast_expr_op_minus(__isl_take isl_ast_expr *ptr)
7441 : ast_expr_op(ptr) {}
7443 ast_expr_op_minus::ast_expr_op_minus()
7444 : ast_expr_op() {}
7446 ast_expr_op_minus::ast_expr_op_minus(const ast_expr_op_minus &obj)
7447 : ast_expr_op(obj)
7451 ast_expr_op_minus &ast_expr_op_minus::operator=(ast_expr_op_minus obj) {
7452 std::swap(this->ptr, obj.ptr);
7453 return *this;
7456 isl::ctx ast_expr_op_minus::ctx() const {
7457 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7460 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_minus &obj)
7462 if (!obj.get())
7463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7464 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7465 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7466 char *str = isl_ast_expr_to_str(obj.get());
7467 if (!str)
7468 exception::throw_last_error(saved_ctx);
7469 os << str;
7470 free(str);
7471 return os;
7474 // implementations for isl::ast_expr_op_mul
7475 ast_expr_op_mul::ast_expr_op_mul(__isl_take isl_ast_expr *ptr)
7476 : ast_expr_op(ptr) {}
7478 ast_expr_op_mul::ast_expr_op_mul()
7479 : ast_expr_op() {}
7481 ast_expr_op_mul::ast_expr_op_mul(const ast_expr_op_mul &obj)
7482 : ast_expr_op(obj)
7486 ast_expr_op_mul &ast_expr_op_mul::operator=(ast_expr_op_mul obj) {
7487 std::swap(this->ptr, obj.ptr);
7488 return *this;
7491 isl::ctx ast_expr_op_mul::ctx() const {
7492 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7495 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_mul &obj)
7497 if (!obj.get())
7498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7499 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7500 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7501 char *str = isl_ast_expr_to_str(obj.get());
7502 if (!str)
7503 exception::throw_last_error(saved_ctx);
7504 os << str;
7505 free(str);
7506 return os;
7509 // implementations for isl::ast_expr_op_or
7510 ast_expr_op_or::ast_expr_op_or(__isl_take isl_ast_expr *ptr)
7511 : ast_expr_op(ptr) {}
7513 ast_expr_op_or::ast_expr_op_or()
7514 : ast_expr_op() {}
7516 ast_expr_op_or::ast_expr_op_or(const ast_expr_op_or &obj)
7517 : ast_expr_op(obj)
7521 ast_expr_op_or &ast_expr_op_or::operator=(ast_expr_op_or obj) {
7522 std::swap(this->ptr, obj.ptr);
7523 return *this;
7526 isl::ctx ast_expr_op_or::ctx() const {
7527 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7530 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or &obj)
7532 if (!obj.get())
7533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7534 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7536 char *str = isl_ast_expr_to_str(obj.get());
7537 if (!str)
7538 exception::throw_last_error(saved_ctx);
7539 os << str;
7540 free(str);
7541 return os;
7544 // implementations for isl::ast_expr_op_or_else
7545 ast_expr_op_or_else::ast_expr_op_or_else(__isl_take isl_ast_expr *ptr)
7546 : ast_expr_op(ptr) {}
7548 ast_expr_op_or_else::ast_expr_op_or_else()
7549 : ast_expr_op() {}
7551 ast_expr_op_or_else::ast_expr_op_or_else(const ast_expr_op_or_else &obj)
7552 : ast_expr_op(obj)
7556 ast_expr_op_or_else &ast_expr_op_or_else::operator=(ast_expr_op_or_else obj) {
7557 std::swap(this->ptr, obj.ptr);
7558 return *this;
7561 isl::ctx ast_expr_op_or_else::ctx() const {
7562 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7565 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or_else &obj)
7567 if (!obj.get())
7568 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7569 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7570 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7571 char *str = isl_ast_expr_to_str(obj.get());
7572 if (!str)
7573 exception::throw_last_error(saved_ctx);
7574 os << str;
7575 free(str);
7576 return os;
7579 // implementations for isl::ast_expr_op_pdiv_q
7580 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr)
7581 : ast_expr_op(ptr) {}
7583 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q()
7584 : ast_expr_op() {}
7586 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj)
7587 : ast_expr_op(obj)
7591 ast_expr_op_pdiv_q &ast_expr_op_pdiv_q::operator=(ast_expr_op_pdiv_q obj) {
7592 std::swap(this->ptr, obj.ptr);
7593 return *this;
7596 isl::ctx ast_expr_op_pdiv_q::ctx() const {
7597 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7600 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_q &obj)
7602 if (!obj.get())
7603 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7604 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7605 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7606 char *str = isl_ast_expr_to_str(obj.get());
7607 if (!str)
7608 exception::throw_last_error(saved_ctx);
7609 os << str;
7610 free(str);
7611 return os;
7614 // implementations for isl::ast_expr_op_pdiv_r
7615 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr)
7616 : ast_expr_op(ptr) {}
7618 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r()
7619 : ast_expr_op() {}
7621 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj)
7622 : ast_expr_op(obj)
7626 ast_expr_op_pdiv_r &ast_expr_op_pdiv_r::operator=(ast_expr_op_pdiv_r obj) {
7627 std::swap(this->ptr, obj.ptr);
7628 return *this;
7631 isl::ctx ast_expr_op_pdiv_r::ctx() const {
7632 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7635 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_r &obj)
7637 if (!obj.get())
7638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7639 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7641 char *str = isl_ast_expr_to_str(obj.get());
7642 if (!str)
7643 exception::throw_last_error(saved_ctx);
7644 os << str;
7645 free(str);
7646 return os;
7649 // implementations for isl::ast_expr_op_select
7650 ast_expr_op_select::ast_expr_op_select(__isl_take isl_ast_expr *ptr)
7651 : ast_expr_op(ptr) {}
7653 ast_expr_op_select::ast_expr_op_select()
7654 : ast_expr_op() {}
7656 ast_expr_op_select::ast_expr_op_select(const ast_expr_op_select &obj)
7657 : ast_expr_op(obj)
7661 ast_expr_op_select &ast_expr_op_select::operator=(ast_expr_op_select obj) {
7662 std::swap(this->ptr, obj.ptr);
7663 return *this;
7666 isl::ctx ast_expr_op_select::ctx() const {
7667 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7670 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_select &obj)
7672 if (!obj.get())
7673 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7674 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7675 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7676 char *str = isl_ast_expr_to_str(obj.get());
7677 if (!str)
7678 exception::throw_last_error(saved_ctx);
7679 os << str;
7680 free(str);
7681 return os;
7684 // implementations for isl::ast_expr_op_sub
7685 ast_expr_op_sub::ast_expr_op_sub(__isl_take isl_ast_expr *ptr)
7686 : ast_expr_op(ptr) {}
7688 ast_expr_op_sub::ast_expr_op_sub()
7689 : ast_expr_op() {}
7691 ast_expr_op_sub::ast_expr_op_sub(const ast_expr_op_sub &obj)
7692 : ast_expr_op(obj)
7696 ast_expr_op_sub &ast_expr_op_sub::operator=(ast_expr_op_sub obj) {
7697 std::swap(this->ptr, obj.ptr);
7698 return *this;
7701 isl::ctx ast_expr_op_sub::ctx() const {
7702 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7705 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_sub &obj)
7707 if (!obj.get())
7708 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7709 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7710 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7711 char *str = isl_ast_expr_to_str(obj.get());
7712 if (!str)
7713 exception::throw_last_error(saved_ctx);
7714 os << str;
7715 free(str);
7716 return os;
7719 // implementations for isl::ast_expr_op_zdiv_r
7720 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr)
7721 : ast_expr_op(ptr) {}
7723 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r()
7724 : ast_expr_op() {}
7726 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj)
7727 : ast_expr_op(obj)
7731 ast_expr_op_zdiv_r &ast_expr_op_zdiv_r::operator=(ast_expr_op_zdiv_r obj) {
7732 std::swap(this->ptr, obj.ptr);
7733 return *this;
7736 isl::ctx ast_expr_op_zdiv_r::ctx() const {
7737 return isl::ctx(isl_ast_expr_get_ctx(ptr));
7740 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_zdiv_r &obj)
7742 if (!obj.get())
7743 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7744 auto saved_ctx = isl_ast_expr_get_ctx(obj.get());
7745 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7746 char *str = isl_ast_expr_to_str(obj.get());
7747 if (!str)
7748 exception::throw_last_error(saved_ctx);
7749 os << str;
7750 free(str);
7751 return os;
7754 // implementations for isl::ast_node
7755 ast_node manage(__isl_take isl_ast_node *ptr) {
7756 if (!ptr)
7757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7758 return ast_node(ptr);
7760 ast_node manage_copy(__isl_keep isl_ast_node *ptr) {
7761 if (!ptr)
7762 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7763 auto saved_ctx = isl_ast_node_get_ctx(ptr);
7764 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7765 ptr = isl_ast_node_copy(ptr);
7766 if (!ptr)
7767 exception::throw_last_error(saved_ctx);
7768 return ast_node(ptr);
7771 ast_node::ast_node(__isl_take isl_ast_node *ptr)
7772 : ptr(ptr) {}
7774 ast_node::ast_node()
7775 : ptr(nullptr) {}
7777 ast_node::ast_node(const ast_node &obj)
7778 : ptr(nullptr)
7780 if (!obj.ptr)
7781 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7782 auto saved_ctx = isl_ast_node_get_ctx(obj.ptr);
7783 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7784 ptr = obj.copy();
7785 if (!ptr)
7786 exception::throw_last_error(saved_ctx);
7789 ast_node &ast_node::operator=(ast_node obj) {
7790 std::swap(this->ptr, obj.ptr);
7791 return *this;
7794 ast_node::~ast_node() {
7795 if (ptr)
7796 isl_ast_node_free(ptr);
7799 __isl_give isl_ast_node *ast_node::copy() const & {
7800 return isl_ast_node_copy(ptr);
7803 __isl_keep isl_ast_node *ast_node::get() const {
7804 return ptr;
7807 __isl_give isl_ast_node *ast_node::release() {
7808 isl_ast_node *tmp = ptr;
7809 ptr = nullptr;
7810 return tmp;
7813 bool ast_node::is_null() const {
7814 return ptr == nullptr;
7817 template <typename T, typename>
7818 bool ast_node::isa_type(T subtype) const
7820 if (is_null())
7821 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7822 return isl_ast_node_get_type(get()) == subtype;
7824 template <class T>
7825 bool ast_node::isa() const
7827 return isa_type<decltype(T::type)>(T::type);
7829 template <class T>
7830 T ast_node::as() const
7832 if (!isa<T>())
7833 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
7834 return T(copy());
7837 isl::ctx ast_node::ctx() const {
7838 return isl::ctx(isl_ast_node_get_ctx(ptr));
7841 isl::ast_node ast_node::map_descendant_bottom_up(const std::function<isl::ast_node(isl::ast_node)> &fn) const
7843 if (!ptr)
7844 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7845 auto saved_ctx = ctx();
7846 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7847 struct fn_data {
7848 std::function<isl::ast_node(isl::ast_node)> func;
7849 std::exception_ptr eptr;
7850 } fn_data = { fn };
7851 auto fn_lambda = [](isl_ast_node *arg_0, void *arg_1) -> isl_ast_node * {
7852 auto *data = static_cast<struct fn_data *>(arg_1);
7853 ISL_CPP_TRY {
7854 auto ret = (data->func)(manage(arg_0));
7855 return ret.release();
7856 } ISL_CPP_CATCH_ALL {
7857 data->eptr = std::current_exception();
7858 return NULL;
7861 auto res = isl_ast_node_map_descendant_bottom_up(copy(), fn_lambda, &fn_data);
7862 if (fn_data.eptr)
7863 std::rethrow_exception(fn_data.eptr);
7864 if (!res)
7865 exception::throw_last_error(saved_ctx);
7866 return manage(res);
7869 std::string ast_node::to_C_str() const
7871 if (!ptr)
7872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7873 auto saved_ctx = ctx();
7874 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7875 auto res = isl_ast_node_to_C_str(get());
7876 std::string tmp(res);
7877 free(res);
7878 return tmp;
7881 isl::ast_node_list ast_node::to_list() const
7883 if (!ptr)
7884 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7885 auto saved_ctx = ctx();
7886 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7887 auto res = isl_ast_node_to_list(copy());
7888 if (!res)
7889 exception::throw_last_error(saved_ctx);
7890 return manage(res);
7893 inline std::ostream &operator<<(std::ostream &os, const ast_node &obj)
7895 if (!obj.get())
7896 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7897 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7898 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7899 char *str = isl_ast_node_to_str(obj.get());
7900 if (!str)
7901 exception::throw_last_error(saved_ctx);
7902 os << str;
7903 free(str);
7904 return os;
7907 // implementations for isl::ast_node_block
7908 ast_node_block::ast_node_block(__isl_take isl_ast_node *ptr)
7909 : ast_node(ptr) {}
7911 ast_node_block::ast_node_block()
7912 : ast_node() {}
7914 ast_node_block::ast_node_block(const ast_node_block &obj)
7915 : ast_node(obj)
7919 ast_node_block::ast_node_block(isl::ast_node_list list)
7921 if (list.is_null())
7922 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7923 auto saved_ctx = list.ctx();
7924 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7925 auto res = isl_ast_node_block_from_children(list.release());
7926 if (!res)
7927 exception::throw_last_error(saved_ctx);
7928 ptr = res;
7931 ast_node_block &ast_node_block::operator=(ast_node_block obj) {
7932 std::swap(this->ptr, obj.ptr);
7933 return *this;
7936 isl::ctx ast_node_block::ctx() const {
7937 return isl::ctx(isl_ast_node_get_ctx(ptr));
7940 isl::ast_node_list ast_node_block::children() const
7942 if (!ptr)
7943 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7944 auto saved_ctx = ctx();
7945 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7946 auto res = isl_ast_node_block_get_children(get());
7947 if (!res)
7948 exception::throw_last_error(saved_ctx);
7949 return manage(res);
7952 isl::ast_node_list ast_node_block::get_children() const
7954 return children();
7957 inline std::ostream &operator<<(std::ostream &os, const ast_node_block &obj)
7959 if (!obj.get())
7960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7961 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
7962 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7963 char *str = isl_ast_node_to_str(obj.get());
7964 if (!str)
7965 exception::throw_last_error(saved_ctx);
7966 os << str;
7967 free(str);
7968 return os;
7971 // implementations for isl::ast_node_for
7972 ast_node_for::ast_node_for(__isl_take isl_ast_node *ptr)
7973 : ast_node(ptr) {}
7975 ast_node_for::ast_node_for()
7976 : ast_node() {}
7978 ast_node_for::ast_node_for(const ast_node_for &obj)
7979 : ast_node(obj)
7983 ast_node_for &ast_node_for::operator=(ast_node_for obj) {
7984 std::swap(this->ptr, obj.ptr);
7985 return *this;
7988 isl::ctx ast_node_for::ctx() const {
7989 return isl::ctx(isl_ast_node_get_ctx(ptr));
7992 isl::ast_node ast_node_for::body() const
7994 if (!ptr)
7995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
7996 auto saved_ctx = ctx();
7997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
7998 auto res = isl_ast_node_for_get_body(get());
7999 if (!res)
8000 exception::throw_last_error(saved_ctx);
8001 return manage(res);
8004 isl::ast_node ast_node_for::get_body() const
8006 return body();
8009 isl::ast_expr ast_node_for::cond() const
8011 if (!ptr)
8012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8013 auto saved_ctx = ctx();
8014 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8015 auto res = isl_ast_node_for_get_cond(get());
8016 if (!res)
8017 exception::throw_last_error(saved_ctx);
8018 return manage(res);
8021 isl::ast_expr ast_node_for::get_cond() const
8023 return cond();
8026 isl::ast_expr ast_node_for::inc() const
8028 if (!ptr)
8029 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8030 auto saved_ctx = ctx();
8031 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8032 auto res = isl_ast_node_for_get_inc(get());
8033 if (!res)
8034 exception::throw_last_error(saved_ctx);
8035 return manage(res);
8038 isl::ast_expr ast_node_for::get_inc() const
8040 return inc();
8043 isl::ast_expr ast_node_for::init() const
8045 if (!ptr)
8046 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8047 auto saved_ctx = ctx();
8048 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8049 auto res = isl_ast_node_for_get_init(get());
8050 if (!res)
8051 exception::throw_last_error(saved_ctx);
8052 return manage(res);
8055 isl::ast_expr ast_node_for::get_init() const
8057 return init();
8060 bool ast_node_for::is_degenerate() const
8062 if (!ptr)
8063 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8064 auto saved_ctx = ctx();
8065 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8066 auto res = isl_ast_node_for_is_degenerate(get());
8067 if (res < 0)
8068 exception::throw_last_error(saved_ctx);
8069 return res;
8072 isl::ast_expr ast_node_for::iterator() const
8074 if (!ptr)
8075 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8076 auto saved_ctx = ctx();
8077 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8078 auto res = isl_ast_node_for_get_iterator(get());
8079 if (!res)
8080 exception::throw_last_error(saved_ctx);
8081 return manage(res);
8084 isl::ast_expr ast_node_for::get_iterator() const
8086 return iterator();
8089 inline std::ostream &operator<<(std::ostream &os, const ast_node_for &obj)
8091 if (!obj.get())
8092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8093 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8094 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8095 char *str = isl_ast_node_to_str(obj.get());
8096 if (!str)
8097 exception::throw_last_error(saved_ctx);
8098 os << str;
8099 free(str);
8100 return os;
8103 // implementations for isl::ast_node_if
8104 ast_node_if::ast_node_if(__isl_take isl_ast_node *ptr)
8105 : ast_node(ptr) {}
8107 ast_node_if::ast_node_if()
8108 : ast_node() {}
8110 ast_node_if::ast_node_if(const ast_node_if &obj)
8111 : ast_node(obj)
8115 ast_node_if &ast_node_if::operator=(ast_node_if obj) {
8116 std::swap(this->ptr, obj.ptr);
8117 return *this;
8120 isl::ctx ast_node_if::ctx() const {
8121 return isl::ctx(isl_ast_node_get_ctx(ptr));
8124 isl::ast_expr ast_node_if::cond() const
8126 if (!ptr)
8127 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8128 auto saved_ctx = ctx();
8129 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8130 auto res = isl_ast_node_if_get_cond(get());
8131 if (!res)
8132 exception::throw_last_error(saved_ctx);
8133 return manage(res);
8136 isl::ast_expr ast_node_if::get_cond() const
8138 return cond();
8141 isl::ast_node ast_node_if::else_node() const
8143 if (!ptr)
8144 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8145 auto saved_ctx = ctx();
8146 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8147 auto res = isl_ast_node_if_get_else_node(get());
8148 if (!res)
8149 exception::throw_last_error(saved_ctx);
8150 return manage(res);
8153 isl::ast_node ast_node_if::get_else_node() const
8155 return else_node();
8158 bool ast_node_if::has_else_node() const
8160 if (!ptr)
8161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8162 auto saved_ctx = ctx();
8163 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8164 auto res = isl_ast_node_if_has_else_node(get());
8165 if (res < 0)
8166 exception::throw_last_error(saved_ctx);
8167 return res;
8170 isl::ast_node ast_node_if::then_node() const
8172 if (!ptr)
8173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8174 auto saved_ctx = ctx();
8175 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8176 auto res = isl_ast_node_if_get_then_node(get());
8177 if (!res)
8178 exception::throw_last_error(saved_ctx);
8179 return manage(res);
8182 isl::ast_node ast_node_if::get_then_node() const
8184 return then_node();
8187 inline std::ostream &operator<<(std::ostream &os, const ast_node_if &obj)
8189 if (!obj.get())
8190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8191 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8193 char *str = isl_ast_node_to_str(obj.get());
8194 if (!str)
8195 exception::throw_last_error(saved_ctx);
8196 os << str;
8197 free(str);
8198 return os;
8201 // implementations for isl::ast_node_list
8202 ast_node_list manage(__isl_take isl_ast_node_list *ptr) {
8203 if (!ptr)
8204 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8205 return ast_node_list(ptr);
8207 ast_node_list manage_copy(__isl_keep isl_ast_node_list *ptr) {
8208 if (!ptr)
8209 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8210 auto saved_ctx = isl_ast_node_list_get_ctx(ptr);
8211 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8212 ptr = isl_ast_node_list_copy(ptr);
8213 if (!ptr)
8214 exception::throw_last_error(saved_ctx);
8215 return ast_node_list(ptr);
8218 ast_node_list::ast_node_list(__isl_take isl_ast_node_list *ptr)
8219 : ptr(ptr) {}
8221 ast_node_list::ast_node_list()
8222 : ptr(nullptr) {}
8224 ast_node_list::ast_node_list(const ast_node_list &obj)
8225 : ptr(nullptr)
8227 if (!obj.ptr)
8228 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8229 auto saved_ctx = isl_ast_node_list_get_ctx(obj.ptr);
8230 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8231 ptr = obj.copy();
8232 if (!ptr)
8233 exception::throw_last_error(saved_ctx);
8236 ast_node_list::ast_node_list(isl::ctx ctx, int n)
8238 auto saved_ctx = ctx;
8239 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8240 auto res = isl_ast_node_list_alloc(ctx.release(), n);
8241 if (!res)
8242 exception::throw_last_error(saved_ctx);
8243 ptr = res;
8246 ast_node_list::ast_node_list(isl::ast_node el)
8248 if (el.is_null())
8249 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8250 auto saved_ctx = el.ctx();
8251 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8252 auto res = isl_ast_node_list_from_ast_node(el.release());
8253 if (!res)
8254 exception::throw_last_error(saved_ctx);
8255 ptr = res;
8258 ast_node_list &ast_node_list::operator=(ast_node_list obj) {
8259 std::swap(this->ptr, obj.ptr);
8260 return *this;
8263 ast_node_list::~ast_node_list() {
8264 if (ptr)
8265 isl_ast_node_list_free(ptr);
8268 __isl_give isl_ast_node_list *ast_node_list::copy() const & {
8269 return isl_ast_node_list_copy(ptr);
8272 __isl_keep isl_ast_node_list *ast_node_list::get() const {
8273 return ptr;
8276 __isl_give isl_ast_node_list *ast_node_list::release() {
8277 isl_ast_node_list *tmp = ptr;
8278 ptr = nullptr;
8279 return tmp;
8282 bool ast_node_list::is_null() const {
8283 return ptr == nullptr;
8286 isl::ctx ast_node_list::ctx() const {
8287 return isl::ctx(isl_ast_node_list_get_ctx(ptr));
8290 isl::ast_node_list ast_node_list::add(isl::ast_node el) const
8292 if (!ptr || el.is_null())
8293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8294 auto saved_ctx = ctx();
8295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8296 auto res = isl_ast_node_list_add(copy(), el.release());
8297 if (!res)
8298 exception::throw_last_error(saved_ctx);
8299 return manage(res);
8302 isl::ast_node ast_node_list::at(int index) const
8304 if (!ptr)
8305 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8306 auto saved_ctx = ctx();
8307 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8308 auto res = isl_ast_node_list_get_at(get(), index);
8309 if (!res)
8310 exception::throw_last_error(saved_ctx);
8311 return manage(res);
8314 isl::ast_node ast_node_list::get_at(int index) const
8316 return at(index);
8319 isl::ast_node_list ast_node_list::clear() const
8321 if (!ptr)
8322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8323 auto saved_ctx = ctx();
8324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8325 auto res = isl_ast_node_list_clear(copy());
8326 if (!res)
8327 exception::throw_last_error(saved_ctx);
8328 return manage(res);
8331 isl::ast_node_list ast_node_list::concat(isl::ast_node_list list2) const
8333 if (!ptr || list2.is_null())
8334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8335 auto saved_ctx = ctx();
8336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8337 auto res = isl_ast_node_list_concat(copy(), list2.release());
8338 if (!res)
8339 exception::throw_last_error(saved_ctx);
8340 return manage(res);
8343 isl::ast_node_list ast_node_list::drop(unsigned int first, unsigned int n) const
8345 if (!ptr)
8346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8347 auto saved_ctx = ctx();
8348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8349 auto res = isl_ast_node_list_drop(copy(), first, n);
8350 if (!res)
8351 exception::throw_last_error(saved_ctx);
8352 return manage(res);
8355 void ast_node_list::foreach(const std::function<void(isl::ast_node)> &fn) const
8357 if (!ptr)
8358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8359 auto saved_ctx = ctx();
8360 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8361 struct fn_data {
8362 std::function<void(isl::ast_node)> func;
8363 std::exception_ptr eptr;
8364 } fn_data = { fn };
8365 auto fn_lambda = [](isl_ast_node *arg_0, void *arg_1) -> isl_stat {
8366 auto *data = static_cast<struct fn_data *>(arg_1);
8367 ISL_CPP_TRY {
8368 (data->func)(manage(arg_0));
8369 return isl_stat_ok;
8370 } ISL_CPP_CATCH_ALL {
8371 data->eptr = std::current_exception();
8372 return isl_stat_error;
8375 auto res = isl_ast_node_list_foreach(get(), fn_lambda, &fn_data);
8376 if (fn_data.eptr)
8377 std::rethrow_exception(fn_data.eptr);
8378 if (res < 0)
8379 exception::throw_last_error(saved_ctx);
8380 return;
8383 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
8385 if (!ptr)
8386 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8387 auto saved_ctx = ctx();
8388 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8389 struct follows_data {
8390 std::function<bool(isl::ast_node, isl::ast_node)> func;
8391 std::exception_ptr eptr;
8392 } follows_data = { follows };
8393 auto follows_lambda = [](isl_ast_node *arg_0, isl_ast_node *arg_1, void *arg_2) -> isl_bool {
8394 auto *data = static_cast<struct follows_data *>(arg_2);
8395 ISL_CPP_TRY {
8396 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
8397 return ret ? isl_bool_true : isl_bool_false;
8398 } ISL_CPP_CATCH_ALL {
8399 data->eptr = std::current_exception();
8400 return isl_bool_error;
8403 struct fn_data {
8404 std::function<void(isl::ast_node_list)> func;
8405 std::exception_ptr eptr;
8406 } fn_data = { fn };
8407 auto fn_lambda = [](isl_ast_node_list *arg_0, void *arg_1) -> isl_stat {
8408 auto *data = static_cast<struct fn_data *>(arg_1);
8409 ISL_CPP_TRY {
8410 (data->func)(manage(arg_0));
8411 return isl_stat_ok;
8412 } ISL_CPP_CATCH_ALL {
8413 data->eptr = std::current_exception();
8414 return isl_stat_error;
8417 auto res = isl_ast_node_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
8418 if (follows_data.eptr)
8419 std::rethrow_exception(follows_data.eptr);
8420 if (fn_data.eptr)
8421 std::rethrow_exception(fn_data.eptr);
8422 if (res < 0)
8423 exception::throw_last_error(saved_ctx);
8424 return;
8427 isl::ast_node_list ast_node_list::insert(unsigned int pos, isl::ast_node el) const
8429 if (!ptr || el.is_null())
8430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8431 auto saved_ctx = ctx();
8432 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8433 auto res = isl_ast_node_list_insert(copy(), pos, el.release());
8434 if (!res)
8435 exception::throw_last_error(saved_ctx);
8436 return manage(res);
8439 isl::ast_node_list ast_node_list::set_at(int index, isl::ast_node el) const
8441 if (!ptr || el.is_null())
8442 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8443 auto saved_ctx = ctx();
8444 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8445 auto res = isl_ast_node_list_set_at(copy(), index, el.release());
8446 if (!res)
8447 exception::throw_last_error(saved_ctx);
8448 return manage(res);
8451 unsigned ast_node_list::size() const
8453 if (!ptr)
8454 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8455 auto saved_ctx = ctx();
8456 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8457 auto res = isl_ast_node_list_size(get());
8458 if (res < 0)
8459 exception::throw_last_error(saved_ctx);
8460 return res;
8463 inline std::ostream &operator<<(std::ostream &os, const ast_node_list &obj)
8465 if (!obj.get())
8466 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8467 auto saved_ctx = isl_ast_node_list_get_ctx(obj.get());
8468 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8469 char *str = isl_ast_node_list_to_str(obj.get());
8470 if (!str)
8471 exception::throw_last_error(saved_ctx);
8472 os << str;
8473 free(str);
8474 return os;
8477 // implementations for isl::ast_node_mark
8478 ast_node_mark::ast_node_mark(__isl_take isl_ast_node *ptr)
8479 : ast_node(ptr) {}
8481 ast_node_mark::ast_node_mark()
8482 : ast_node() {}
8484 ast_node_mark::ast_node_mark(const ast_node_mark &obj)
8485 : ast_node(obj)
8489 ast_node_mark &ast_node_mark::operator=(ast_node_mark obj) {
8490 std::swap(this->ptr, obj.ptr);
8491 return *this;
8494 isl::ctx ast_node_mark::ctx() const {
8495 return isl::ctx(isl_ast_node_get_ctx(ptr));
8498 isl::id ast_node_mark::id() const
8500 if (!ptr)
8501 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8502 auto saved_ctx = ctx();
8503 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8504 auto res = isl_ast_node_mark_get_id(get());
8505 if (!res)
8506 exception::throw_last_error(saved_ctx);
8507 return manage(res);
8510 isl::id ast_node_mark::get_id() const
8512 return id();
8515 isl::ast_node ast_node_mark::node() const
8517 if (!ptr)
8518 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8519 auto saved_ctx = ctx();
8520 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8521 auto res = isl_ast_node_mark_get_node(get());
8522 if (!res)
8523 exception::throw_last_error(saved_ctx);
8524 return manage(res);
8527 isl::ast_node ast_node_mark::get_node() const
8529 return node();
8532 inline std::ostream &operator<<(std::ostream &os, const ast_node_mark &obj)
8534 if (!obj.get())
8535 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8536 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8537 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8538 char *str = isl_ast_node_to_str(obj.get());
8539 if (!str)
8540 exception::throw_last_error(saved_ctx);
8541 os << str;
8542 free(str);
8543 return os;
8546 // implementations for isl::ast_node_user
8547 ast_node_user::ast_node_user(__isl_take isl_ast_node *ptr)
8548 : ast_node(ptr) {}
8550 ast_node_user::ast_node_user()
8551 : ast_node() {}
8553 ast_node_user::ast_node_user(const ast_node_user &obj)
8554 : ast_node(obj)
8558 ast_node_user::ast_node_user(isl::ast_expr expr)
8560 if (expr.is_null())
8561 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8562 auto saved_ctx = expr.ctx();
8563 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8564 auto res = isl_ast_node_user_from_expr(expr.release());
8565 if (!res)
8566 exception::throw_last_error(saved_ctx);
8567 ptr = res;
8570 ast_node_user &ast_node_user::operator=(ast_node_user obj) {
8571 std::swap(this->ptr, obj.ptr);
8572 return *this;
8575 isl::ctx ast_node_user::ctx() const {
8576 return isl::ctx(isl_ast_node_get_ctx(ptr));
8579 isl::ast_expr ast_node_user::expr() const
8581 if (!ptr)
8582 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8583 auto saved_ctx = ctx();
8584 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8585 auto res = isl_ast_node_user_get_expr(get());
8586 if (!res)
8587 exception::throw_last_error(saved_ctx);
8588 return manage(res);
8591 isl::ast_expr ast_node_user::get_expr() const
8593 return expr();
8596 inline std::ostream &operator<<(std::ostream &os, const ast_node_user &obj)
8598 if (!obj.get())
8599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8600 auto saved_ctx = isl_ast_node_get_ctx(obj.get());
8601 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8602 char *str = isl_ast_node_to_str(obj.get());
8603 if (!str)
8604 exception::throw_last_error(saved_ctx);
8605 os << str;
8606 free(str);
8607 return os;
8610 // implementations for isl::basic_map
8611 basic_map manage(__isl_take isl_basic_map *ptr) {
8612 if (!ptr)
8613 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8614 return basic_map(ptr);
8616 basic_map manage_copy(__isl_keep isl_basic_map *ptr) {
8617 if (!ptr)
8618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8619 auto saved_ctx = isl_basic_map_get_ctx(ptr);
8620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8621 ptr = isl_basic_map_copy(ptr);
8622 if (!ptr)
8623 exception::throw_last_error(saved_ctx);
8624 return basic_map(ptr);
8627 basic_map::basic_map(__isl_take isl_basic_map *ptr)
8628 : ptr(ptr) {}
8630 basic_map::basic_map()
8631 : ptr(nullptr) {}
8633 basic_map::basic_map(const basic_map &obj)
8634 : ptr(nullptr)
8636 if (!obj.ptr)
8637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8638 auto saved_ctx = isl_basic_map_get_ctx(obj.ptr);
8639 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8640 ptr = obj.copy();
8641 if (!ptr)
8642 exception::throw_last_error(saved_ctx);
8645 basic_map::basic_map(isl::ctx ctx, const std::string &str)
8647 auto saved_ctx = ctx;
8648 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8649 auto res = isl_basic_map_read_from_str(ctx.release(), str.c_str());
8650 if (!res)
8651 exception::throw_last_error(saved_ctx);
8652 ptr = res;
8655 basic_map &basic_map::operator=(basic_map obj) {
8656 std::swap(this->ptr, obj.ptr);
8657 return *this;
8660 basic_map::~basic_map() {
8661 if (ptr)
8662 isl_basic_map_free(ptr);
8665 __isl_give isl_basic_map *basic_map::copy() const & {
8666 return isl_basic_map_copy(ptr);
8669 __isl_keep isl_basic_map *basic_map::get() const {
8670 return ptr;
8673 __isl_give isl_basic_map *basic_map::release() {
8674 isl_basic_map *tmp = ptr;
8675 ptr = nullptr;
8676 return tmp;
8679 bool basic_map::is_null() const {
8680 return ptr == nullptr;
8683 isl::ctx basic_map::ctx() const {
8684 return isl::ctx(isl_basic_map_get_ctx(ptr));
8687 isl::basic_map basic_map::affine_hull() const
8689 if (!ptr)
8690 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8691 auto saved_ctx = ctx();
8692 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8693 auto res = isl_basic_map_affine_hull(copy());
8694 if (!res)
8695 exception::throw_last_error(saved_ctx);
8696 return manage(res);
8699 isl::basic_map basic_map::apply_domain(isl::basic_map bmap2) const
8701 if (!ptr || bmap2.is_null())
8702 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8703 auto saved_ctx = ctx();
8704 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8705 auto res = isl_basic_map_apply_domain(copy(), bmap2.release());
8706 if (!res)
8707 exception::throw_last_error(saved_ctx);
8708 return manage(res);
8711 isl::map basic_map::apply_domain(const isl::map &map2) const
8713 if (!ptr)
8714 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8715 return isl::map(*this).apply_domain(map2);
8718 isl::union_map basic_map::apply_domain(const isl::union_map &umap2) const
8720 if (!ptr)
8721 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8722 return isl::map(*this).apply_domain(umap2);
8725 isl::basic_map basic_map::apply_range(isl::basic_map bmap2) const
8727 if (!ptr || bmap2.is_null())
8728 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8729 auto saved_ctx = ctx();
8730 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8731 auto res = isl_basic_map_apply_range(copy(), bmap2.release());
8732 if (!res)
8733 exception::throw_last_error(saved_ctx);
8734 return manage(res);
8737 isl::map basic_map::apply_range(const isl::map &map2) const
8739 if (!ptr)
8740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8741 return isl::map(*this).apply_range(map2);
8744 isl::union_map basic_map::apply_range(const isl::union_map &umap2) const
8746 if (!ptr)
8747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8748 return isl::map(*this).apply_range(umap2);
8751 isl::map basic_map::as_map() const
8753 if (!ptr)
8754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8755 return isl::map(*this).as_map();
8758 isl::multi_union_pw_aff basic_map::as_multi_union_pw_aff() const
8760 if (!ptr)
8761 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8762 return isl::map(*this).as_multi_union_pw_aff();
8765 isl::pw_multi_aff basic_map::as_pw_multi_aff() const
8767 if (!ptr)
8768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8769 return isl::map(*this).as_pw_multi_aff();
8772 isl::union_pw_multi_aff basic_map::as_union_pw_multi_aff() const
8774 if (!ptr)
8775 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8776 return isl::map(*this).as_union_pw_multi_aff();
8779 isl::set basic_map::bind_domain(const isl::multi_id &tuple) const
8781 if (!ptr)
8782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8783 return isl::map(*this).bind_domain(tuple);
8786 isl::set basic_map::bind_range(const isl::multi_id &tuple) const
8788 if (!ptr)
8789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8790 return isl::map(*this).bind_range(tuple);
8793 isl::map basic_map::coalesce() const
8795 if (!ptr)
8796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8797 return isl::map(*this).coalesce();
8800 isl::map basic_map::complement() const
8802 if (!ptr)
8803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8804 return isl::map(*this).complement();
8807 isl::union_map basic_map::compute_divs() const
8809 if (!ptr)
8810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8811 return isl::map(*this).compute_divs();
8814 isl::map basic_map::curry() const
8816 if (!ptr)
8817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8818 return isl::map(*this).curry();
8821 isl::basic_set basic_map::deltas() const
8823 if (!ptr)
8824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8825 auto saved_ctx = ctx();
8826 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8827 auto res = isl_basic_map_deltas(copy());
8828 if (!res)
8829 exception::throw_last_error(saved_ctx);
8830 return manage(res);
8833 isl::basic_map basic_map::detect_equalities() const
8835 if (!ptr)
8836 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8837 auto saved_ctx = ctx();
8838 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8839 auto res = isl_basic_map_detect_equalities(copy());
8840 if (!res)
8841 exception::throw_last_error(saved_ctx);
8842 return manage(res);
8845 isl::set basic_map::domain() const
8847 if (!ptr)
8848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8849 return isl::map(*this).domain();
8852 isl::map basic_map::domain_factor_domain() const
8854 if (!ptr)
8855 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8856 return isl::map(*this).domain_factor_domain();
8859 isl::map basic_map::domain_factor_range() const
8861 if (!ptr)
8862 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8863 return isl::map(*this).domain_factor_range();
8866 isl::union_map basic_map::domain_map() const
8868 if (!ptr)
8869 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8870 return isl::map(*this).domain_map();
8873 isl::union_pw_multi_aff basic_map::domain_map_union_pw_multi_aff() const
8875 if (!ptr)
8876 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8877 return isl::map(*this).domain_map_union_pw_multi_aff();
8880 isl::map basic_map::domain_product(const isl::map &map2) const
8882 if (!ptr)
8883 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8884 return isl::map(*this).domain_product(map2);
8887 isl::union_map basic_map::domain_product(const isl::union_map &umap2) const
8889 if (!ptr)
8890 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8891 return isl::map(*this).domain_product(umap2);
8894 isl::map basic_map::domain_reverse() const
8896 if (!ptr)
8897 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8898 return isl::map(*this).domain_reverse();
8901 unsigned basic_map::domain_tuple_dim() const
8903 if (!ptr)
8904 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8905 return isl::map(*this).domain_tuple_dim();
8908 isl::id basic_map::domain_tuple_id() const
8910 if (!ptr)
8911 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8912 return isl::map(*this).domain_tuple_id();
8915 isl::map basic_map::drop_unused_params() const
8917 if (!ptr)
8918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8919 return isl::map(*this).drop_unused_params();
8922 isl::map basic_map::eq_at(const isl::multi_pw_aff &mpa) const
8924 if (!ptr)
8925 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8926 return isl::map(*this).eq_at(mpa);
8929 isl::union_map basic_map::eq_at(const isl::multi_union_pw_aff &mupa) const
8931 if (!ptr)
8932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8933 return isl::map(*this).eq_at(mupa);
8936 bool basic_map::every_map(const std::function<bool(isl::map)> &test) const
8938 if (!ptr)
8939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8940 return isl::map(*this).every_map(test);
8943 isl::map basic_map::extract_map(const isl::space &space) const
8945 if (!ptr)
8946 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8947 return isl::map(*this).extract_map(space);
8950 isl::map basic_map::factor_domain() const
8952 if (!ptr)
8953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8954 return isl::map(*this).factor_domain();
8957 isl::map basic_map::factor_range() const
8959 if (!ptr)
8960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8961 return isl::map(*this).factor_range();
8964 isl::map basic_map::fixed_power(const isl::val &exp) const
8966 if (!ptr)
8967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8968 return isl::map(*this).fixed_power(exp);
8971 isl::map basic_map::fixed_power(long exp) const
8973 if (!ptr)
8974 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8975 return this->fixed_power(isl::val(ctx(), exp));
8978 isl::basic_map basic_map::flatten() const
8980 if (!ptr)
8981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8982 auto saved_ctx = ctx();
8983 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8984 auto res = isl_basic_map_flatten(copy());
8985 if (!res)
8986 exception::throw_last_error(saved_ctx);
8987 return manage(res);
8990 isl::basic_map basic_map::flatten_domain() const
8992 if (!ptr)
8993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
8994 auto saved_ctx = ctx();
8995 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
8996 auto res = isl_basic_map_flatten_domain(copy());
8997 if (!res)
8998 exception::throw_last_error(saved_ctx);
8999 return manage(res);
9002 isl::basic_map basic_map::flatten_range() const
9004 if (!ptr)
9005 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9006 auto saved_ctx = ctx();
9007 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9008 auto res = isl_basic_map_flatten_range(copy());
9009 if (!res)
9010 exception::throw_last_error(saved_ctx);
9011 return manage(res);
9014 void basic_map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
9016 if (!ptr)
9017 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9018 return isl::map(*this).foreach_basic_map(fn);
9021 void basic_map::foreach_map(const std::function<void(isl::map)> &fn) const
9023 if (!ptr)
9024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9025 return isl::map(*this).foreach_map(fn);
9028 isl::basic_map basic_map::gist(isl::basic_map context) const
9030 if (!ptr || context.is_null())
9031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9032 auto saved_ctx = ctx();
9033 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9034 auto res = isl_basic_map_gist(copy(), context.release());
9035 if (!res)
9036 exception::throw_last_error(saved_ctx);
9037 return manage(res);
9040 isl::map basic_map::gist(const isl::map &context) const
9042 if (!ptr)
9043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9044 return isl::map(*this).gist(context);
9047 isl::union_map basic_map::gist(const isl::union_map &context) const
9049 if (!ptr)
9050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9051 return isl::map(*this).gist(context);
9054 isl::map basic_map::gist_domain(const isl::set &context) const
9056 if (!ptr)
9057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9058 return isl::map(*this).gist_domain(context);
9061 isl::union_map basic_map::gist_domain(const isl::union_set &uset) const
9063 if (!ptr)
9064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9065 return isl::map(*this).gist_domain(uset);
9068 isl::map basic_map::gist_params(const isl::set &context) const
9070 if (!ptr)
9071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9072 return isl::map(*this).gist_params(context);
9075 isl::union_map basic_map::gist_range(const isl::union_set &uset) const
9077 if (!ptr)
9078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9079 return isl::map(*this).gist_range(uset);
9082 bool basic_map::has_domain_tuple_id() const
9084 if (!ptr)
9085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9086 return isl::map(*this).has_domain_tuple_id();
9089 bool basic_map::has_range_tuple_id() const
9091 if (!ptr)
9092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9093 return isl::map(*this).has_range_tuple_id();
9096 isl::basic_map basic_map::intersect(isl::basic_map bmap2) const
9098 if (!ptr || bmap2.is_null())
9099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9100 auto saved_ctx = ctx();
9101 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9102 auto res = isl_basic_map_intersect(copy(), bmap2.release());
9103 if (!res)
9104 exception::throw_last_error(saved_ctx);
9105 return manage(res);
9108 isl::map basic_map::intersect(const isl::map &map2) const
9110 if (!ptr)
9111 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9112 return isl::map(*this).intersect(map2);
9115 isl::union_map basic_map::intersect(const isl::union_map &umap2) const
9117 if (!ptr)
9118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9119 return isl::map(*this).intersect(umap2);
9122 isl::basic_map basic_map::intersect_domain(isl::basic_set bset) const
9124 if (!ptr || bset.is_null())
9125 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9126 auto saved_ctx = ctx();
9127 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9128 auto res = isl_basic_map_intersect_domain(copy(), bset.release());
9129 if (!res)
9130 exception::throw_last_error(saved_ctx);
9131 return manage(res);
9134 isl::map basic_map::intersect_domain(const isl::set &set) const
9136 if (!ptr)
9137 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9138 return isl::map(*this).intersect_domain(set);
9141 isl::union_map basic_map::intersect_domain(const isl::space &space) const
9143 if (!ptr)
9144 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9145 return isl::map(*this).intersect_domain(space);
9148 isl::union_map basic_map::intersect_domain(const isl::union_set &uset) const
9150 if (!ptr)
9151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9152 return isl::map(*this).intersect_domain(uset);
9155 isl::basic_map basic_map::intersect_domain(const isl::point &bset) const
9157 if (!ptr)
9158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9159 return this->intersect_domain(isl::basic_set(bset));
9162 isl::map basic_map::intersect_domain_factor_domain(const isl::map &factor) const
9164 if (!ptr)
9165 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9166 return isl::map(*this).intersect_domain_factor_domain(factor);
9169 isl::union_map basic_map::intersect_domain_factor_domain(const isl::union_map &factor) const
9171 if (!ptr)
9172 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9173 return isl::map(*this).intersect_domain_factor_domain(factor);
9176 isl::map basic_map::intersect_domain_factor_range(const isl::map &factor) const
9178 if (!ptr)
9179 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9180 return isl::map(*this).intersect_domain_factor_range(factor);
9183 isl::union_map basic_map::intersect_domain_factor_range(const isl::union_map &factor) const
9185 if (!ptr)
9186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9187 return isl::map(*this).intersect_domain_factor_range(factor);
9190 isl::map basic_map::intersect_domain_wrapped_domain(const isl::set &domain) const
9192 if (!ptr)
9193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9194 return isl::map(*this).intersect_domain_wrapped_domain(domain);
9197 isl::union_map basic_map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
9199 if (!ptr)
9200 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9201 return isl::map(*this).intersect_domain_wrapped_domain(domain);
9204 isl::map basic_map::intersect_params(const isl::set &params) const
9206 if (!ptr)
9207 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9208 return isl::map(*this).intersect_params(params);
9211 isl::basic_map basic_map::intersect_range(isl::basic_set bset) const
9213 if (!ptr || bset.is_null())
9214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9215 auto saved_ctx = ctx();
9216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9217 auto res = isl_basic_map_intersect_range(copy(), bset.release());
9218 if (!res)
9219 exception::throw_last_error(saved_ctx);
9220 return manage(res);
9223 isl::map basic_map::intersect_range(const isl::set &set) const
9225 if (!ptr)
9226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9227 return isl::map(*this).intersect_range(set);
9230 isl::union_map basic_map::intersect_range(const isl::space &space) const
9232 if (!ptr)
9233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9234 return isl::map(*this).intersect_range(space);
9237 isl::union_map basic_map::intersect_range(const isl::union_set &uset) const
9239 if (!ptr)
9240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9241 return isl::map(*this).intersect_range(uset);
9244 isl::basic_map basic_map::intersect_range(const isl::point &bset) const
9246 if (!ptr)
9247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9248 return this->intersect_range(isl::basic_set(bset));
9251 isl::map basic_map::intersect_range_factor_domain(const isl::map &factor) const
9253 if (!ptr)
9254 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9255 return isl::map(*this).intersect_range_factor_domain(factor);
9258 isl::union_map basic_map::intersect_range_factor_domain(const isl::union_map &factor) const
9260 if (!ptr)
9261 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9262 return isl::map(*this).intersect_range_factor_domain(factor);
9265 isl::map basic_map::intersect_range_factor_range(const isl::map &factor) const
9267 if (!ptr)
9268 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9269 return isl::map(*this).intersect_range_factor_range(factor);
9272 isl::union_map basic_map::intersect_range_factor_range(const isl::union_map &factor) const
9274 if (!ptr)
9275 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9276 return isl::map(*this).intersect_range_factor_range(factor);
9279 isl::map basic_map::intersect_range_wrapped_domain(const isl::set &domain) const
9281 if (!ptr)
9282 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9283 return isl::map(*this).intersect_range_wrapped_domain(domain);
9286 isl::union_map basic_map::intersect_range_wrapped_domain(const isl::union_set &domain) const
9288 if (!ptr)
9289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9290 return isl::map(*this).intersect_range_wrapped_domain(domain);
9293 bool basic_map::is_bijective() const
9295 if (!ptr)
9296 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9297 return isl::map(*this).is_bijective();
9300 bool basic_map::is_disjoint(const isl::map &map2) const
9302 if (!ptr)
9303 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9304 return isl::map(*this).is_disjoint(map2);
9307 bool basic_map::is_disjoint(const isl::union_map &umap2) const
9309 if (!ptr)
9310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9311 return isl::map(*this).is_disjoint(umap2);
9314 bool basic_map::is_empty() const
9316 if (!ptr)
9317 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9318 auto saved_ctx = ctx();
9319 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9320 auto res = isl_basic_map_is_empty(get());
9321 if (res < 0)
9322 exception::throw_last_error(saved_ctx);
9323 return res;
9326 bool basic_map::is_equal(const isl::basic_map &bmap2) const
9328 if (!ptr || bmap2.is_null())
9329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9330 auto saved_ctx = ctx();
9331 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9332 auto res = isl_basic_map_is_equal(get(), bmap2.get());
9333 if (res < 0)
9334 exception::throw_last_error(saved_ctx);
9335 return res;
9338 bool basic_map::is_equal(const isl::map &map2) const
9340 if (!ptr)
9341 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9342 return isl::map(*this).is_equal(map2);
9345 bool basic_map::is_equal(const isl::union_map &umap2) const
9347 if (!ptr)
9348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9349 return isl::map(*this).is_equal(umap2);
9352 bool basic_map::is_injective() const
9354 if (!ptr)
9355 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9356 return isl::map(*this).is_injective();
9359 bool basic_map::is_single_valued() const
9361 if (!ptr)
9362 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9363 return isl::map(*this).is_single_valued();
9366 bool basic_map::is_strict_subset(const isl::map &map2) const
9368 if (!ptr)
9369 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9370 return isl::map(*this).is_strict_subset(map2);
9373 bool basic_map::is_strict_subset(const isl::union_map &umap2) const
9375 if (!ptr)
9376 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9377 return isl::map(*this).is_strict_subset(umap2);
9380 bool basic_map::is_subset(const isl::basic_map &bmap2) const
9382 if (!ptr || bmap2.is_null())
9383 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9384 auto saved_ctx = ctx();
9385 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9386 auto res = isl_basic_map_is_subset(get(), bmap2.get());
9387 if (res < 0)
9388 exception::throw_last_error(saved_ctx);
9389 return res;
9392 bool basic_map::is_subset(const isl::map &map2) const
9394 if (!ptr)
9395 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9396 return isl::map(*this).is_subset(map2);
9399 bool basic_map::is_subset(const isl::union_map &umap2) const
9401 if (!ptr)
9402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9403 return isl::map(*this).is_subset(umap2);
9406 bool basic_map::isa_map() const
9408 if (!ptr)
9409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9410 return isl::map(*this).isa_map();
9413 isl::map basic_map::lex_ge_at(const isl::multi_pw_aff &mpa) const
9415 if (!ptr)
9416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9417 return isl::map(*this).lex_ge_at(mpa);
9420 isl::map basic_map::lex_gt_at(const isl::multi_pw_aff &mpa) const
9422 if (!ptr)
9423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9424 return isl::map(*this).lex_gt_at(mpa);
9427 isl::map basic_map::lex_le_at(const isl::multi_pw_aff &mpa) const
9429 if (!ptr)
9430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9431 return isl::map(*this).lex_le_at(mpa);
9434 isl::map basic_map::lex_lt_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_lt_at(mpa);
9441 isl::map basic_map::lexmax() const
9443 if (!ptr)
9444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9445 auto saved_ctx = ctx();
9446 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9447 auto res = isl_basic_map_lexmax(copy());
9448 if (!res)
9449 exception::throw_last_error(saved_ctx);
9450 return manage(res);
9453 isl::pw_multi_aff basic_map::lexmax_pw_multi_aff() const
9455 if (!ptr)
9456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9457 return isl::map(*this).lexmax_pw_multi_aff();
9460 isl::map basic_map::lexmin() const
9462 if (!ptr)
9463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9464 auto saved_ctx = ctx();
9465 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9466 auto res = isl_basic_map_lexmin(copy());
9467 if (!res)
9468 exception::throw_last_error(saved_ctx);
9469 return manage(res);
9472 isl::pw_multi_aff basic_map::lexmin_pw_multi_aff() const
9474 if (!ptr)
9475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9476 return isl::map(*this).lexmin_pw_multi_aff();
9479 isl::map basic_map::lower_bound(const isl::multi_pw_aff &lower) const
9481 if (!ptr)
9482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9483 return isl::map(*this).lower_bound(lower);
9486 isl::map_list basic_map::map_list() const
9488 if (!ptr)
9489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9490 return isl::map(*this).map_list();
9493 isl::multi_pw_aff basic_map::max_multi_pw_aff() const
9495 if (!ptr)
9496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9497 return isl::map(*this).max_multi_pw_aff();
9500 isl::multi_pw_aff basic_map::min_multi_pw_aff() const
9502 if (!ptr)
9503 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9504 return isl::map(*this).min_multi_pw_aff();
9507 unsigned basic_map::n_basic_map() const
9509 if (!ptr)
9510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9511 return isl::map(*this).n_basic_map();
9514 isl::set basic_map::params() const
9516 if (!ptr)
9517 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9518 return isl::map(*this).params();
9521 isl::basic_map basic_map::polyhedral_hull() const
9523 if (!ptr)
9524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9525 return isl::map(*this).polyhedral_hull();
9528 isl::map basic_map::preimage_domain(const isl::multi_aff &ma) const
9530 if (!ptr)
9531 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9532 return isl::map(*this).preimage_domain(ma);
9535 isl::map basic_map::preimage_domain(const isl::multi_pw_aff &mpa) const
9537 if (!ptr)
9538 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9539 return isl::map(*this).preimage_domain(mpa);
9542 isl::map basic_map::preimage_domain(const isl::pw_multi_aff &pma) const
9544 if (!ptr)
9545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9546 return isl::map(*this).preimage_domain(pma);
9549 isl::union_map basic_map::preimage_domain(const isl::union_pw_multi_aff &upma) const
9551 if (!ptr)
9552 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9553 return isl::map(*this).preimage_domain(upma);
9556 isl::map basic_map::preimage_range(const isl::multi_aff &ma) const
9558 if (!ptr)
9559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9560 return isl::map(*this).preimage_range(ma);
9563 isl::map basic_map::preimage_range(const isl::pw_multi_aff &pma) const
9565 if (!ptr)
9566 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9567 return isl::map(*this).preimage_range(pma);
9570 isl::union_map basic_map::preimage_range(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_range(upma);
9577 isl::map basic_map::product(const isl::map &map2) const
9579 if (!ptr)
9580 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9581 return isl::map(*this).product(map2);
9584 isl::union_map basic_map::product(const isl::union_map &umap2) const
9586 if (!ptr)
9587 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9588 return isl::map(*this).product(umap2);
9591 isl::map basic_map::project_out_all_params() const
9593 if (!ptr)
9594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9595 return isl::map(*this).project_out_all_params();
9598 isl::map basic_map::project_out_param(const isl::id &id) const
9600 if (!ptr)
9601 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9602 return isl::map(*this).project_out_param(id);
9605 isl::map basic_map::project_out_param(const std::string &id) const
9607 if (!ptr)
9608 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9609 return this->project_out_param(isl::id(ctx(), id));
9612 isl::map basic_map::project_out_param(const isl::id_list &list) const
9614 if (!ptr)
9615 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9616 return isl::map(*this).project_out_param(list);
9619 isl::set basic_map::range() const
9621 if (!ptr)
9622 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9623 return isl::map(*this).range();
9626 isl::map basic_map::range_factor_domain() const
9628 if (!ptr)
9629 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9630 return isl::map(*this).range_factor_domain();
9633 isl::map basic_map::range_factor_range() const
9635 if (!ptr)
9636 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9637 return isl::map(*this).range_factor_range();
9640 isl::fixed_box basic_map::range_lattice_tile() const
9642 if (!ptr)
9643 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9644 return isl::map(*this).range_lattice_tile();
9647 isl::union_map basic_map::range_map() const
9649 if (!ptr)
9650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9651 return isl::map(*this).range_map();
9654 isl::map basic_map::range_product(const isl::map &map2) const
9656 if (!ptr)
9657 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9658 return isl::map(*this).range_product(map2);
9661 isl::union_map basic_map::range_product(const isl::union_map &umap2) const
9663 if (!ptr)
9664 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9665 return isl::map(*this).range_product(umap2);
9668 isl::map basic_map::range_reverse() const
9670 if (!ptr)
9671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9672 return isl::map(*this).range_reverse();
9675 isl::fixed_box basic_map::range_simple_fixed_box_hull() const
9677 if (!ptr)
9678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9679 return isl::map(*this).range_simple_fixed_box_hull();
9682 unsigned basic_map::range_tuple_dim() const
9684 if (!ptr)
9685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9686 return isl::map(*this).range_tuple_dim();
9689 isl::id basic_map::range_tuple_id() const
9691 if (!ptr)
9692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9693 return isl::map(*this).range_tuple_id();
9696 isl::basic_map basic_map::reverse() const
9698 if (!ptr)
9699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9700 auto saved_ctx = ctx();
9701 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9702 auto res = isl_basic_map_reverse(copy());
9703 if (!res)
9704 exception::throw_last_error(saved_ctx);
9705 return manage(res);
9708 isl::basic_map basic_map::sample() const
9710 if (!ptr)
9711 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9712 auto saved_ctx = ctx();
9713 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9714 auto res = isl_basic_map_sample(copy());
9715 if (!res)
9716 exception::throw_last_error(saved_ctx);
9717 return manage(res);
9720 isl::map basic_map::set_domain_tuple(const isl::id &id) const
9722 if (!ptr)
9723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9724 return isl::map(*this).set_domain_tuple(id);
9727 isl::map basic_map::set_domain_tuple(const std::string &id) const
9729 if (!ptr)
9730 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9731 return this->set_domain_tuple(isl::id(ctx(), id));
9734 isl::map basic_map::set_range_tuple(const isl::id &id) const
9736 if (!ptr)
9737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9738 return isl::map(*this).set_range_tuple(id);
9741 isl::map basic_map::set_range_tuple(const std::string &id) const
9743 if (!ptr)
9744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9745 return this->set_range_tuple(isl::id(ctx(), id));
9748 isl::space basic_map::space() const
9750 if (!ptr)
9751 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9752 return isl::map(*this).space();
9755 isl::map basic_map::subtract(const isl::map &map2) const
9757 if (!ptr)
9758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9759 return isl::map(*this).subtract(map2);
9762 isl::union_map basic_map::subtract(const isl::union_map &umap2) const
9764 if (!ptr)
9765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9766 return isl::map(*this).subtract(umap2);
9769 isl::union_map basic_map::subtract_domain(const isl::union_set &dom) const
9771 if (!ptr)
9772 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9773 return isl::map(*this).subtract_domain(dom);
9776 isl::union_map basic_map::subtract_range(const isl::union_set &dom) const
9778 if (!ptr)
9779 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9780 return isl::map(*this).subtract_range(dom);
9783 isl::map_list basic_map::to_list() const
9785 if (!ptr)
9786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9787 return isl::map(*this).to_list();
9790 isl::union_map basic_map::to_union_map() const
9792 if (!ptr)
9793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9794 return isl::map(*this).to_union_map();
9797 isl::map basic_map::uncurry() const
9799 if (!ptr)
9800 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9801 return isl::map(*this).uncurry();
9804 isl::map basic_map::unite(isl::basic_map bmap2) const
9806 if (!ptr || bmap2.is_null())
9807 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9808 auto saved_ctx = ctx();
9809 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9810 auto res = isl_basic_map_union(copy(), bmap2.release());
9811 if (!res)
9812 exception::throw_last_error(saved_ctx);
9813 return manage(res);
9816 isl::map basic_map::unite(const isl::map &map2) const
9818 if (!ptr)
9819 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9820 return isl::map(*this).unite(map2);
9823 isl::union_map basic_map::unite(const isl::union_map &umap2) const
9825 if (!ptr)
9826 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9827 return isl::map(*this).unite(umap2);
9830 isl::basic_map basic_map::unshifted_simple_hull() const
9832 if (!ptr)
9833 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9834 return isl::map(*this).unshifted_simple_hull();
9837 isl::map basic_map::upper_bound(const isl::multi_pw_aff &upper) const
9839 if (!ptr)
9840 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9841 return isl::map(*this).upper_bound(upper);
9844 isl::set basic_map::wrap() const
9846 if (!ptr)
9847 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9848 return isl::map(*this).wrap();
9851 isl::map basic_map::zip() const
9853 if (!ptr)
9854 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9855 return isl::map(*this).zip();
9858 inline std::ostream &operator<<(std::ostream &os, const basic_map &obj)
9860 if (!obj.get())
9861 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9862 auto saved_ctx = isl_basic_map_get_ctx(obj.get());
9863 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9864 char *str = isl_basic_map_to_str(obj.get());
9865 if (!str)
9866 exception::throw_last_error(saved_ctx);
9867 os << str;
9868 free(str);
9869 return os;
9872 // implementations for isl::basic_set
9873 basic_set manage(__isl_take isl_basic_set *ptr) {
9874 if (!ptr)
9875 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9876 return basic_set(ptr);
9878 basic_set manage_copy(__isl_keep isl_basic_set *ptr) {
9879 if (!ptr)
9880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9881 auto saved_ctx = isl_basic_set_get_ctx(ptr);
9882 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9883 ptr = isl_basic_set_copy(ptr);
9884 if (!ptr)
9885 exception::throw_last_error(saved_ctx);
9886 return basic_set(ptr);
9889 basic_set::basic_set(__isl_take isl_basic_set *ptr)
9890 : ptr(ptr) {}
9892 basic_set::basic_set()
9893 : ptr(nullptr) {}
9895 basic_set::basic_set(const basic_set &obj)
9896 : ptr(nullptr)
9898 if (!obj.ptr)
9899 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9900 auto saved_ctx = isl_basic_set_get_ctx(obj.ptr);
9901 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9902 ptr = obj.copy();
9903 if (!ptr)
9904 exception::throw_last_error(saved_ctx);
9907 basic_set::basic_set(isl::point pnt)
9909 if (pnt.is_null())
9910 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9911 auto saved_ctx = pnt.ctx();
9912 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9913 auto res = isl_basic_set_from_point(pnt.release());
9914 if (!res)
9915 exception::throw_last_error(saved_ctx);
9916 ptr = res;
9919 basic_set::basic_set(isl::ctx ctx, const std::string &str)
9921 auto saved_ctx = ctx;
9922 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9923 auto res = isl_basic_set_read_from_str(ctx.release(), str.c_str());
9924 if (!res)
9925 exception::throw_last_error(saved_ctx);
9926 ptr = res;
9929 basic_set &basic_set::operator=(basic_set obj) {
9930 std::swap(this->ptr, obj.ptr);
9931 return *this;
9934 basic_set::~basic_set() {
9935 if (ptr)
9936 isl_basic_set_free(ptr);
9939 __isl_give isl_basic_set *basic_set::copy() const & {
9940 return isl_basic_set_copy(ptr);
9943 __isl_keep isl_basic_set *basic_set::get() const {
9944 return ptr;
9947 __isl_give isl_basic_set *basic_set::release() {
9948 isl_basic_set *tmp = ptr;
9949 ptr = nullptr;
9950 return tmp;
9953 bool basic_set::is_null() const {
9954 return ptr == nullptr;
9957 isl::ctx basic_set::ctx() const {
9958 return isl::ctx(isl_basic_set_get_ctx(ptr));
9961 isl::basic_set basic_set::affine_hull() const
9963 if (!ptr)
9964 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9965 auto saved_ctx = ctx();
9966 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9967 auto res = isl_basic_set_affine_hull(copy());
9968 if (!res)
9969 exception::throw_last_error(saved_ctx);
9970 return manage(res);
9973 isl::basic_set basic_set::apply(isl::basic_map bmap) const
9975 if (!ptr || bmap.is_null())
9976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9977 auto saved_ctx = ctx();
9978 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
9979 auto res = isl_basic_set_apply(copy(), bmap.release());
9980 if (!res)
9981 exception::throw_last_error(saved_ctx);
9982 return manage(res);
9985 isl::set basic_set::apply(const isl::map &map) const
9987 if (!ptr)
9988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9989 return isl::set(*this).apply(map);
9992 isl::union_set basic_set::apply(const isl::union_map &umap) const
9994 if (!ptr)
9995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
9996 return isl::set(*this).apply(umap);
9999 isl::pw_multi_aff basic_set::as_pw_multi_aff() const
10001 if (!ptr)
10002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10003 return isl::set(*this).as_pw_multi_aff();
10006 isl::set basic_set::as_set() const
10008 if (!ptr)
10009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10010 return isl::set(*this).as_set();
10013 isl::set basic_set::bind(const isl::multi_id &tuple) const
10015 if (!ptr)
10016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10017 return isl::set(*this).bind(tuple);
10020 isl::set basic_set::coalesce() const
10022 if (!ptr)
10023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10024 return isl::set(*this).coalesce();
10027 isl::set basic_set::complement() const
10029 if (!ptr)
10030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10031 return isl::set(*this).complement();
10034 isl::union_set basic_set::compute_divs() const
10036 if (!ptr)
10037 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10038 return isl::set(*this).compute_divs();
10041 isl::basic_set basic_set::detect_equalities() const
10043 if (!ptr)
10044 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10045 auto saved_ctx = ctx();
10046 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10047 auto res = isl_basic_set_detect_equalities(copy());
10048 if (!res)
10049 exception::throw_last_error(saved_ctx);
10050 return manage(res);
10053 isl::val basic_set::dim_max_val(int pos) const
10055 if (!ptr)
10056 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10057 auto saved_ctx = ctx();
10058 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10059 auto res = isl_basic_set_dim_max_val(copy(), pos);
10060 if (!res)
10061 exception::throw_last_error(saved_ctx);
10062 return manage(res);
10065 isl::val basic_set::dim_min_val(int pos) const
10067 if (!ptr)
10068 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10069 return isl::set(*this).dim_min_val(pos);
10072 isl::set basic_set::drop_unused_params() const
10074 if (!ptr)
10075 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10076 return isl::set(*this).drop_unused_params();
10079 bool basic_set::every_set(const std::function<bool(isl::set)> &test) const
10081 if (!ptr)
10082 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10083 return isl::set(*this).every_set(test);
10086 isl::set basic_set::extract_set(const isl::space &space) const
10088 if (!ptr)
10089 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10090 return isl::set(*this).extract_set(space);
10093 isl::basic_set basic_set::flatten() const
10095 if (!ptr)
10096 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10097 auto saved_ctx = ctx();
10098 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10099 auto res = isl_basic_set_flatten(copy());
10100 if (!res)
10101 exception::throw_last_error(saved_ctx);
10102 return manage(res);
10105 void basic_set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
10107 if (!ptr)
10108 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10109 return isl::set(*this).foreach_basic_set(fn);
10112 void basic_set::foreach_point(const std::function<void(isl::point)> &fn) const
10114 if (!ptr)
10115 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10116 return isl::set(*this).foreach_point(fn);
10119 void basic_set::foreach_set(const std::function<void(isl::set)> &fn) const
10121 if (!ptr)
10122 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10123 return isl::set(*this).foreach_set(fn);
10126 isl::basic_set basic_set::gist(isl::basic_set context) const
10128 if (!ptr || context.is_null())
10129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10130 auto saved_ctx = ctx();
10131 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10132 auto res = isl_basic_set_gist(copy(), context.release());
10133 if (!res)
10134 exception::throw_last_error(saved_ctx);
10135 return manage(res);
10138 isl::set basic_set::gist(const isl::set &context) const
10140 if (!ptr)
10141 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10142 return isl::set(*this).gist(context);
10145 isl::union_set basic_set::gist(const isl::union_set &context) const
10147 if (!ptr)
10148 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10149 return isl::set(*this).gist(context);
10152 isl::basic_set basic_set::gist(const isl::point &context) const
10154 if (!ptr)
10155 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10156 return this->gist(isl::basic_set(context));
10159 isl::set basic_set::gist_params(const isl::set &context) const
10161 if (!ptr)
10162 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10163 return isl::set(*this).gist_params(context);
10166 isl::map basic_set::identity() const
10168 if (!ptr)
10169 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10170 return isl::set(*this).identity();
10173 isl::pw_aff basic_set::indicator_function() const
10175 if (!ptr)
10176 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10177 return isl::set(*this).indicator_function();
10180 isl::map basic_set::insert_domain(const isl::space &domain) const
10182 if (!ptr)
10183 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10184 return isl::set(*this).insert_domain(domain);
10187 isl::basic_set basic_set::intersect(isl::basic_set bset2) const
10189 if (!ptr || bset2.is_null())
10190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10191 auto saved_ctx = ctx();
10192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10193 auto res = isl_basic_set_intersect(copy(), bset2.release());
10194 if (!res)
10195 exception::throw_last_error(saved_ctx);
10196 return manage(res);
10199 isl::set basic_set::intersect(const isl::set &set2) const
10201 if (!ptr)
10202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10203 return isl::set(*this).intersect(set2);
10206 isl::union_set basic_set::intersect(const isl::union_set &uset2) const
10208 if (!ptr)
10209 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10210 return isl::set(*this).intersect(uset2);
10213 isl::basic_set basic_set::intersect(const isl::point &bset2) const
10215 if (!ptr)
10216 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10217 return this->intersect(isl::basic_set(bset2));
10220 isl::basic_set basic_set::intersect_params(isl::basic_set bset2) const
10222 if (!ptr || bset2.is_null())
10223 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10224 auto saved_ctx = ctx();
10225 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10226 auto res = isl_basic_set_intersect_params(copy(), bset2.release());
10227 if (!res)
10228 exception::throw_last_error(saved_ctx);
10229 return manage(res);
10232 isl::set basic_set::intersect_params(const isl::set &params) const
10234 if (!ptr)
10235 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10236 return isl::set(*this).intersect_params(params);
10239 isl::basic_set basic_set::intersect_params(const isl::point &bset2) const
10241 if (!ptr)
10242 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10243 return this->intersect_params(isl::basic_set(bset2));
10246 bool basic_set::involves_locals() const
10248 if (!ptr)
10249 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10250 return isl::set(*this).involves_locals();
10253 bool basic_set::is_disjoint(const isl::set &set2) const
10255 if (!ptr)
10256 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10257 return isl::set(*this).is_disjoint(set2);
10260 bool basic_set::is_disjoint(const isl::union_set &uset2) const
10262 if (!ptr)
10263 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10264 return isl::set(*this).is_disjoint(uset2);
10267 bool basic_set::is_empty() const
10269 if (!ptr)
10270 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10271 auto saved_ctx = ctx();
10272 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10273 auto res = isl_basic_set_is_empty(get());
10274 if (res < 0)
10275 exception::throw_last_error(saved_ctx);
10276 return res;
10279 bool basic_set::is_equal(const isl::basic_set &bset2) const
10281 if (!ptr || bset2.is_null())
10282 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10283 auto saved_ctx = ctx();
10284 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10285 auto res = isl_basic_set_is_equal(get(), bset2.get());
10286 if (res < 0)
10287 exception::throw_last_error(saved_ctx);
10288 return res;
10291 bool basic_set::is_equal(const isl::set &set2) const
10293 if (!ptr)
10294 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10295 return isl::set(*this).is_equal(set2);
10298 bool basic_set::is_equal(const isl::union_set &uset2) const
10300 if (!ptr)
10301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10302 return isl::set(*this).is_equal(uset2);
10305 bool basic_set::is_equal(const isl::point &bset2) const
10307 if (!ptr)
10308 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10309 return this->is_equal(isl::basic_set(bset2));
10312 bool basic_set::is_singleton() const
10314 if (!ptr)
10315 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10316 return isl::set(*this).is_singleton();
10319 bool basic_set::is_strict_subset(const isl::set &set2) const
10321 if (!ptr)
10322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10323 return isl::set(*this).is_strict_subset(set2);
10326 bool basic_set::is_strict_subset(const isl::union_set &uset2) const
10328 if (!ptr)
10329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10330 return isl::set(*this).is_strict_subset(uset2);
10333 bool basic_set::is_subset(const isl::basic_set &bset2) const
10335 if (!ptr || bset2.is_null())
10336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10337 auto saved_ctx = ctx();
10338 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10339 auto res = isl_basic_set_is_subset(get(), bset2.get());
10340 if (res < 0)
10341 exception::throw_last_error(saved_ctx);
10342 return res;
10345 bool basic_set::is_subset(const isl::set &set2) const
10347 if (!ptr)
10348 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10349 return isl::set(*this).is_subset(set2);
10352 bool basic_set::is_subset(const isl::union_set &uset2) const
10354 if (!ptr)
10355 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10356 return isl::set(*this).is_subset(uset2);
10359 bool basic_set::is_subset(const isl::point &bset2) const
10361 if (!ptr)
10362 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10363 return this->is_subset(isl::basic_set(bset2));
10366 bool basic_set::is_wrapping() const
10368 if (!ptr)
10369 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10370 auto saved_ctx = ctx();
10371 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10372 auto res = isl_basic_set_is_wrapping(get());
10373 if (res < 0)
10374 exception::throw_last_error(saved_ctx);
10375 return res;
10378 bool basic_set::isa_set() const
10380 if (!ptr)
10381 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10382 return isl::set(*this).isa_set();
10385 isl::fixed_box basic_set::lattice_tile() const
10387 if (!ptr)
10388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10389 return isl::set(*this).lattice_tile();
10392 isl::set basic_set::lexmax() const
10394 if (!ptr)
10395 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10396 auto saved_ctx = ctx();
10397 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10398 auto res = isl_basic_set_lexmax(copy());
10399 if (!res)
10400 exception::throw_last_error(saved_ctx);
10401 return manage(res);
10404 isl::pw_multi_aff basic_set::lexmax_pw_multi_aff() const
10406 if (!ptr)
10407 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10408 return isl::set(*this).lexmax_pw_multi_aff();
10411 isl::set basic_set::lexmin() const
10413 if (!ptr)
10414 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10415 auto saved_ctx = ctx();
10416 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10417 auto res = isl_basic_set_lexmin(copy());
10418 if (!res)
10419 exception::throw_last_error(saved_ctx);
10420 return manage(res);
10423 isl::pw_multi_aff basic_set::lexmin_pw_multi_aff() const
10425 if (!ptr)
10426 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10427 return isl::set(*this).lexmin_pw_multi_aff();
10430 isl::set basic_set::lower_bound(const isl::multi_pw_aff &lower) const
10432 if (!ptr)
10433 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10434 return isl::set(*this).lower_bound(lower);
10437 isl::set basic_set::lower_bound(const isl::multi_val &lower) const
10439 if (!ptr)
10440 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10441 return isl::set(*this).lower_bound(lower);
10444 isl::multi_pw_aff basic_set::max_multi_pw_aff() const
10446 if (!ptr)
10447 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10448 return isl::set(*this).max_multi_pw_aff();
10451 isl::val basic_set::max_val(const isl::aff &obj) const
10453 if (!ptr)
10454 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10455 return isl::set(*this).max_val(obj);
10458 isl::multi_pw_aff basic_set::min_multi_pw_aff() const
10460 if (!ptr)
10461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10462 return isl::set(*this).min_multi_pw_aff();
10465 isl::val basic_set::min_val(const isl::aff &obj) const
10467 if (!ptr)
10468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10469 return isl::set(*this).min_val(obj);
10472 unsigned basic_set::n_basic_set() const
10474 if (!ptr)
10475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10476 return isl::set(*this).n_basic_set();
10479 isl::pw_aff basic_set::param_pw_aff_on_domain(const isl::id &id) const
10481 if (!ptr)
10482 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10483 return isl::set(*this).param_pw_aff_on_domain(id);
10486 isl::pw_aff basic_set::param_pw_aff_on_domain(const std::string &id) const
10488 if (!ptr)
10489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10490 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
10493 isl::basic_set basic_set::params() const
10495 if (!ptr)
10496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10497 auto saved_ctx = ctx();
10498 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10499 auto res = isl_basic_set_params(copy());
10500 if (!res)
10501 exception::throw_last_error(saved_ctx);
10502 return manage(res);
10505 isl::multi_val basic_set::plain_multi_val_if_fixed() const
10507 if (!ptr)
10508 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10509 return isl::set(*this).plain_multi_val_if_fixed();
10512 isl::basic_set basic_set::polyhedral_hull() const
10514 if (!ptr)
10515 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10516 return isl::set(*this).polyhedral_hull();
10519 isl::set basic_set::preimage(const isl::multi_aff &ma) const
10521 if (!ptr)
10522 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10523 return isl::set(*this).preimage(ma);
10526 isl::set basic_set::preimage(const isl::multi_pw_aff &mpa) const
10528 if (!ptr)
10529 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10530 return isl::set(*this).preimage(mpa);
10533 isl::set basic_set::preimage(const isl::pw_multi_aff &pma) const
10535 if (!ptr)
10536 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10537 return isl::set(*this).preimage(pma);
10540 isl::union_set basic_set::preimage(const isl::union_pw_multi_aff &upma) const
10542 if (!ptr)
10543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10544 return isl::set(*this).preimage(upma);
10547 isl::set basic_set::product(const isl::set &set2) const
10549 if (!ptr)
10550 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10551 return isl::set(*this).product(set2);
10554 isl::set basic_set::project_out_all_params() const
10556 if (!ptr)
10557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10558 return isl::set(*this).project_out_all_params();
10561 isl::set basic_set::project_out_param(const isl::id &id) const
10563 if (!ptr)
10564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10565 return isl::set(*this).project_out_param(id);
10568 isl::set basic_set::project_out_param(const std::string &id) const
10570 if (!ptr)
10571 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10572 return this->project_out_param(isl::id(ctx(), id));
10575 isl::set basic_set::project_out_param(const isl::id_list &list) const
10577 if (!ptr)
10578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10579 return isl::set(*this).project_out_param(list);
10582 isl::pw_aff basic_set::pw_aff_on_domain(const isl::val &v) const
10584 if (!ptr)
10585 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10586 return isl::set(*this).pw_aff_on_domain(v);
10589 isl::pw_aff basic_set::pw_aff_on_domain(long v) const
10591 if (!ptr)
10592 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10593 return this->pw_aff_on_domain(isl::val(ctx(), v));
10596 isl::pw_multi_aff basic_set::pw_multi_aff_on_domain(const isl::multi_val &mv) const
10598 if (!ptr)
10599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10600 return isl::set(*this).pw_multi_aff_on_domain(mv);
10603 isl::basic_set basic_set::sample() const
10605 if (!ptr)
10606 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10607 auto saved_ctx = ctx();
10608 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10609 auto res = isl_basic_set_sample(copy());
10610 if (!res)
10611 exception::throw_last_error(saved_ctx);
10612 return manage(res);
10615 isl::point basic_set::sample_point() const
10617 if (!ptr)
10618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10619 auto saved_ctx = ctx();
10620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10621 auto res = isl_basic_set_sample_point(copy());
10622 if (!res)
10623 exception::throw_last_error(saved_ctx);
10624 return manage(res);
10627 isl::set_list basic_set::set_list() const
10629 if (!ptr)
10630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10631 return isl::set(*this).set_list();
10634 isl::fixed_box basic_set::simple_fixed_box_hull() const
10636 if (!ptr)
10637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10638 return isl::set(*this).simple_fixed_box_hull();
10641 isl::space basic_set::space() const
10643 if (!ptr)
10644 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10645 return isl::set(*this).space();
10648 isl::val basic_set::stride(int pos) const
10650 if (!ptr)
10651 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10652 return isl::set(*this).stride(pos);
10655 isl::set basic_set::subtract(const isl::set &set2) const
10657 if (!ptr)
10658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10659 return isl::set(*this).subtract(set2);
10662 isl::union_set basic_set::subtract(const isl::union_set &uset2) const
10664 if (!ptr)
10665 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10666 return isl::set(*this).subtract(uset2);
10669 isl::set_list basic_set::to_list() const
10671 if (!ptr)
10672 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10673 return isl::set(*this).to_list();
10676 isl::set basic_set::to_set() const
10678 if (!ptr)
10679 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10680 auto saved_ctx = ctx();
10681 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10682 auto res = isl_basic_set_to_set(copy());
10683 if (!res)
10684 exception::throw_last_error(saved_ctx);
10685 return manage(res);
10688 isl::union_set basic_set::to_union_set() const
10690 if (!ptr)
10691 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10692 return isl::set(*this).to_union_set();
10695 isl::map basic_set::translation() const
10697 if (!ptr)
10698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10699 return isl::set(*this).translation();
10702 unsigned basic_set::tuple_dim() const
10704 if (!ptr)
10705 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10706 return isl::set(*this).tuple_dim();
10709 isl::set basic_set::unbind_params(const isl::multi_id &tuple) const
10711 if (!ptr)
10712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10713 return isl::set(*this).unbind_params(tuple);
10716 isl::map basic_set::unbind_params_insert_domain(const isl::multi_id &domain) const
10718 if (!ptr)
10719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10720 return isl::set(*this).unbind_params_insert_domain(domain);
10723 isl::set basic_set::unite(isl::basic_set bset2) const
10725 if (!ptr || bset2.is_null())
10726 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10727 auto saved_ctx = ctx();
10728 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10729 auto res = isl_basic_set_union(copy(), bset2.release());
10730 if (!res)
10731 exception::throw_last_error(saved_ctx);
10732 return manage(res);
10735 isl::set basic_set::unite(const isl::set &set2) const
10737 if (!ptr)
10738 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10739 return isl::set(*this).unite(set2);
10742 isl::union_set basic_set::unite(const isl::union_set &uset2) const
10744 if (!ptr)
10745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10746 return isl::set(*this).unite(uset2);
10749 isl::set basic_set::unite(const isl::point &bset2) const
10751 if (!ptr)
10752 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10753 return this->unite(isl::basic_set(bset2));
10756 isl::basic_set basic_set::unshifted_simple_hull() const
10758 if (!ptr)
10759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10760 return isl::set(*this).unshifted_simple_hull();
10763 isl::map basic_set::unwrap() const
10765 if (!ptr)
10766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10767 return isl::set(*this).unwrap();
10770 isl::set basic_set::upper_bound(const isl::multi_pw_aff &upper) const
10772 if (!ptr)
10773 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10774 return isl::set(*this).upper_bound(upper);
10777 isl::set basic_set::upper_bound(const isl::multi_val &upper) const
10779 if (!ptr)
10780 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10781 return isl::set(*this).upper_bound(upper);
10784 isl::set basic_set::wrapped_reverse() const
10786 if (!ptr)
10787 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10788 return isl::set(*this).wrapped_reverse();
10791 inline std::ostream &operator<<(std::ostream &os, const basic_set &obj)
10793 if (!obj.get())
10794 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10795 auto saved_ctx = isl_basic_set_get_ctx(obj.get());
10796 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10797 char *str = isl_basic_set_to_str(obj.get());
10798 if (!str)
10799 exception::throw_last_error(saved_ctx);
10800 os << str;
10801 free(str);
10802 return os;
10805 // implementations for isl::fixed_box
10806 fixed_box manage(__isl_take isl_fixed_box *ptr) {
10807 if (!ptr)
10808 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10809 return fixed_box(ptr);
10811 fixed_box manage_copy(__isl_keep isl_fixed_box *ptr) {
10812 if (!ptr)
10813 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10814 auto saved_ctx = isl_fixed_box_get_ctx(ptr);
10815 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10816 ptr = isl_fixed_box_copy(ptr);
10817 if (!ptr)
10818 exception::throw_last_error(saved_ctx);
10819 return fixed_box(ptr);
10822 fixed_box::fixed_box(__isl_take isl_fixed_box *ptr)
10823 : ptr(ptr) {}
10825 fixed_box::fixed_box()
10826 : ptr(nullptr) {}
10828 fixed_box::fixed_box(const fixed_box &obj)
10829 : ptr(nullptr)
10831 if (!obj.ptr)
10832 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10833 auto saved_ctx = isl_fixed_box_get_ctx(obj.ptr);
10834 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10835 ptr = obj.copy();
10836 if (!ptr)
10837 exception::throw_last_error(saved_ctx);
10840 fixed_box::fixed_box(isl::ctx ctx, const std::string &str)
10842 auto saved_ctx = ctx;
10843 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10844 auto res = isl_fixed_box_read_from_str(ctx.release(), str.c_str());
10845 if (!res)
10846 exception::throw_last_error(saved_ctx);
10847 ptr = res;
10850 fixed_box &fixed_box::operator=(fixed_box obj) {
10851 std::swap(this->ptr, obj.ptr);
10852 return *this;
10855 fixed_box::~fixed_box() {
10856 if (ptr)
10857 isl_fixed_box_free(ptr);
10860 __isl_give isl_fixed_box *fixed_box::copy() const & {
10861 return isl_fixed_box_copy(ptr);
10864 __isl_keep isl_fixed_box *fixed_box::get() const {
10865 return ptr;
10868 __isl_give isl_fixed_box *fixed_box::release() {
10869 isl_fixed_box *tmp = ptr;
10870 ptr = nullptr;
10871 return tmp;
10874 bool fixed_box::is_null() const {
10875 return ptr == nullptr;
10878 isl::ctx fixed_box::ctx() const {
10879 return isl::ctx(isl_fixed_box_get_ctx(ptr));
10882 bool fixed_box::is_valid() const
10884 if (!ptr)
10885 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10886 auto saved_ctx = ctx();
10887 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10888 auto res = isl_fixed_box_is_valid(get());
10889 if (res < 0)
10890 exception::throw_last_error(saved_ctx);
10891 return res;
10894 isl::multi_aff fixed_box::offset() const
10896 if (!ptr)
10897 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10898 auto saved_ctx = ctx();
10899 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10900 auto res = isl_fixed_box_get_offset(get());
10901 if (!res)
10902 exception::throw_last_error(saved_ctx);
10903 return manage(res);
10906 isl::multi_aff fixed_box::get_offset() const
10908 return offset();
10911 isl::multi_val fixed_box::size() const
10913 if (!ptr)
10914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10915 auto saved_ctx = ctx();
10916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10917 auto res = isl_fixed_box_get_size(get());
10918 if (!res)
10919 exception::throw_last_error(saved_ctx);
10920 return manage(res);
10923 isl::multi_val fixed_box::get_size() const
10925 return size();
10928 isl::space fixed_box::space() const
10930 if (!ptr)
10931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10932 auto saved_ctx = ctx();
10933 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10934 auto res = isl_fixed_box_get_space(get());
10935 if (!res)
10936 exception::throw_last_error(saved_ctx);
10937 return manage(res);
10940 isl::space fixed_box::get_space() const
10942 return space();
10945 inline std::ostream &operator<<(std::ostream &os, const fixed_box &obj)
10947 if (!obj.get())
10948 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10949 auto saved_ctx = isl_fixed_box_get_ctx(obj.get());
10950 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10951 char *str = isl_fixed_box_to_str(obj.get());
10952 if (!str)
10953 exception::throw_last_error(saved_ctx);
10954 os << str;
10955 free(str);
10956 return os;
10959 // implementations for isl::id
10960 id manage(__isl_take isl_id *ptr) {
10961 if (!ptr)
10962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10963 return id(ptr);
10965 id manage_copy(__isl_keep isl_id *ptr) {
10966 if (!ptr)
10967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10968 auto saved_ctx = isl_id_get_ctx(ptr);
10969 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10970 ptr = isl_id_copy(ptr);
10971 if (!ptr)
10972 exception::throw_last_error(saved_ctx);
10973 return id(ptr);
10976 id::id(__isl_take isl_id *ptr)
10977 : ptr(ptr) {}
10979 id::id()
10980 : ptr(nullptr) {}
10982 id::id(const id &obj)
10983 : ptr(nullptr)
10985 if (!obj.ptr)
10986 exception::throw_invalid("NULL input", __FILE__, __LINE__);
10987 auto saved_ctx = isl_id_get_ctx(obj.ptr);
10988 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10989 ptr = obj.copy();
10990 if (!ptr)
10991 exception::throw_last_error(saved_ctx);
10994 id::id(isl::ctx ctx, const std::string &str)
10996 auto saved_ctx = ctx;
10997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
10998 auto res = isl_id_read_from_str(ctx.release(), str.c_str());
10999 if (!res)
11000 exception::throw_last_error(saved_ctx);
11001 ptr = res;
11004 id &id::operator=(id obj) {
11005 std::swap(this->ptr, obj.ptr);
11006 return *this;
11009 id::~id() {
11010 if (ptr)
11011 isl_id_free(ptr);
11014 __isl_give isl_id *id::copy() const & {
11015 return isl_id_copy(ptr);
11018 __isl_keep isl_id *id::get() const {
11019 return ptr;
11022 __isl_give isl_id *id::release() {
11023 isl_id *tmp = ptr;
11024 ptr = nullptr;
11025 return tmp;
11028 bool id::is_null() const {
11029 return ptr == nullptr;
11032 isl::ctx id::ctx() const {
11033 return isl::ctx(isl_id_get_ctx(ptr));
11036 std::string id::name() const
11038 if (!ptr)
11039 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11040 auto saved_ctx = ctx();
11041 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11042 auto res = isl_id_get_name(get());
11043 std::string tmp(res);
11044 return tmp;
11047 std::string id::get_name() const
11049 return name();
11052 isl::id_list id::to_list() const
11054 if (!ptr)
11055 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11056 auto saved_ctx = ctx();
11057 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11058 auto res = isl_id_to_list(copy());
11059 if (!res)
11060 exception::throw_last_error(saved_ctx);
11061 return manage(res);
11064 #if __cplusplus >= 201703L
11065 id::id(isl::ctx ctx, const std::string &str, const std::any &any)
11067 auto saved_ctx = ctx;
11068 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11069 std::any *p = new std::any(any);
11070 auto res = isl_id_alloc(ctx.get(), str.c_str(), p);
11071 res = isl_id_set_free_user(res, &ctx::free_user);
11072 if (!res) {
11073 delete p;
11074 exception::throw_last_error(saved_ctx);
11076 ptr = res;
11079 template <class T>
11080 std::optional<T> id::try_user() const
11082 if (!ptr)
11083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11084 std::any *p = (std::any *) isl_id_get_user(ptr);
11085 if (!p)
11086 return std::nullopt;
11087 if (isl_id_get_free_user(ptr) != &ctx::free_user)
11088 return std::nullopt;
11089 T *res = std::any_cast<T>(p);
11090 if (!res)
11091 return std::nullopt;
11092 return *res;
11095 template <class T>
11096 T id::user() const
11098 if (!ptr)
11099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11100 std::any *p = (std::any *) isl_id_get_user(ptr);
11101 if (!p)
11102 exception::throw_invalid("no user pointer", __FILE__, __LINE__);
11103 if (isl_id_get_free_user(ptr) != &ctx::free_user)
11104 exception::throw_invalid("user pointer not attached by C++ interface", __FILE__, __LINE__);
11105 T *res = std::any_cast<T>(p);
11106 if (!res)
11107 exception::throw_invalid("user pointer not of given type", __FILE__, __LINE__);
11108 return *res;
11110 #endif
11112 inline std::ostream &operator<<(std::ostream &os, const id &obj)
11114 if (!obj.get())
11115 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11116 auto saved_ctx = isl_id_get_ctx(obj.get());
11117 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11118 char *str = isl_id_to_str(obj.get());
11119 if (!str)
11120 exception::throw_last_error(saved_ctx);
11121 os << str;
11122 free(str);
11123 return os;
11126 // implementations for isl::id_list
11127 id_list manage(__isl_take isl_id_list *ptr) {
11128 if (!ptr)
11129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11130 return id_list(ptr);
11132 id_list manage_copy(__isl_keep isl_id_list *ptr) {
11133 if (!ptr)
11134 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11135 auto saved_ctx = isl_id_list_get_ctx(ptr);
11136 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11137 ptr = isl_id_list_copy(ptr);
11138 if (!ptr)
11139 exception::throw_last_error(saved_ctx);
11140 return id_list(ptr);
11143 id_list::id_list(__isl_take isl_id_list *ptr)
11144 : ptr(ptr) {}
11146 id_list::id_list()
11147 : ptr(nullptr) {}
11149 id_list::id_list(const id_list &obj)
11150 : ptr(nullptr)
11152 if (!obj.ptr)
11153 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11154 auto saved_ctx = isl_id_list_get_ctx(obj.ptr);
11155 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11156 ptr = obj.copy();
11157 if (!ptr)
11158 exception::throw_last_error(saved_ctx);
11161 id_list::id_list(isl::ctx ctx, int n)
11163 auto saved_ctx = ctx;
11164 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11165 auto res = isl_id_list_alloc(ctx.release(), n);
11166 if (!res)
11167 exception::throw_last_error(saved_ctx);
11168 ptr = res;
11171 id_list::id_list(isl::id el)
11173 if (el.is_null())
11174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11175 auto saved_ctx = el.ctx();
11176 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11177 auto res = isl_id_list_from_id(el.release());
11178 if (!res)
11179 exception::throw_last_error(saved_ctx);
11180 ptr = res;
11183 id_list::id_list(isl::ctx ctx, const std::string &str)
11185 auto saved_ctx = ctx;
11186 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11187 auto res = isl_id_list_read_from_str(ctx.release(), str.c_str());
11188 if (!res)
11189 exception::throw_last_error(saved_ctx);
11190 ptr = res;
11193 id_list &id_list::operator=(id_list obj) {
11194 std::swap(this->ptr, obj.ptr);
11195 return *this;
11198 id_list::~id_list() {
11199 if (ptr)
11200 isl_id_list_free(ptr);
11203 __isl_give isl_id_list *id_list::copy() const & {
11204 return isl_id_list_copy(ptr);
11207 __isl_keep isl_id_list *id_list::get() const {
11208 return ptr;
11211 __isl_give isl_id_list *id_list::release() {
11212 isl_id_list *tmp = ptr;
11213 ptr = nullptr;
11214 return tmp;
11217 bool id_list::is_null() const {
11218 return ptr == nullptr;
11221 isl::ctx id_list::ctx() const {
11222 return isl::ctx(isl_id_list_get_ctx(ptr));
11225 isl::id_list id_list::add(isl::id el) const
11227 if (!ptr || el.is_null())
11228 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11229 auto saved_ctx = ctx();
11230 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11231 auto res = isl_id_list_add(copy(), el.release());
11232 if (!res)
11233 exception::throw_last_error(saved_ctx);
11234 return manage(res);
11237 isl::id_list id_list::add(const std::string &el) const
11239 if (!ptr)
11240 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11241 return this->add(isl::id(ctx(), el));
11244 isl::id id_list::at(int index) const
11246 if (!ptr)
11247 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11248 auto saved_ctx = ctx();
11249 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11250 auto res = isl_id_list_get_at(get(), index);
11251 if (!res)
11252 exception::throw_last_error(saved_ctx);
11253 return manage(res);
11256 isl::id id_list::get_at(int index) const
11258 return at(index);
11261 isl::id_list id_list::clear() const
11263 if (!ptr)
11264 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11265 auto saved_ctx = ctx();
11266 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11267 auto res = isl_id_list_clear(copy());
11268 if (!res)
11269 exception::throw_last_error(saved_ctx);
11270 return manage(res);
11273 isl::id_list id_list::concat(isl::id_list list2) const
11275 if (!ptr || list2.is_null())
11276 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11277 auto saved_ctx = ctx();
11278 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11279 auto res = isl_id_list_concat(copy(), list2.release());
11280 if (!res)
11281 exception::throw_last_error(saved_ctx);
11282 return manage(res);
11285 isl::id_list id_list::drop(unsigned int first, unsigned int n) const
11287 if (!ptr)
11288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11289 auto saved_ctx = ctx();
11290 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11291 auto res = isl_id_list_drop(copy(), first, n);
11292 if (!res)
11293 exception::throw_last_error(saved_ctx);
11294 return manage(res);
11297 void id_list::foreach(const std::function<void(isl::id)> &fn) const
11299 if (!ptr)
11300 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11301 auto saved_ctx = ctx();
11302 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11303 struct fn_data {
11304 std::function<void(isl::id)> func;
11305 std::exception_ptr eptr;
11306 } fn_data = { fn };
11307 auto fn_lambda = [](isl_id *arg_0, void *arg_1) -> isl_stat {
11308 auto *data = static_cast<struct fn_data *>(arg_1);
11309 ISL_CPP_TRY {
11310 (data->func)(manage(arg_0));
11311 return isl_stat_ok;
11312 } ISL_CPP_CATCH_ALL {
11313 data->eptr = std::current_exception();
11314 return isl_stat_error;
11317 auto res = isl_id_list_foreach(get(), fn_lambda, &fn_data);
11318 if (fn_data.eptr)
11319 std::rethrow_exception(fn_data.eptr);
11320 if (res < 0)
11321 exception::throw_last_error(saved_ctx);
11322 return;
11325 void id_list::foreach_scc(const std::function<bool(isl::id, isl::id)> &follows, const std::function<void(isl::id_list)> &fn) const
11327 if (!ptr)
11328 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11329 auto saved_ctx = ctx();
11330 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11331 struct follows_data {
11332 std::function<bool(isl::id, isl::id)> func;
11333 std::exception_ptr eptr;
11334 } follows_data = { follows };
11335 auto follows_lambda = [](isl_id *arg_0, isl_id *arg_1, void *arg_2) -> isl_bool {
11336 auto *data = static_cast<struct follows_data *>(arg_2);
11337 ISL_CPP_TRY {
11338 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
11339 return ret ? isl_bool_true : isl_bool_false;
11340 } ISL_CPP_CATCH_ALL {
11341 data->eptr = std::current_exception();
11342 return isl_bool_error;
11345 struct fn_data {
11346 std::function<void(isl::id_list)> func;
11347 std::exception_ptr eptr;
11348 } fn_data = { fn };
11349 auto fn_lambda = [](isl_id_list *arg_0, void *arg_1) -> isl_stat {
11350 auto *data = static_cast<struct fn_data *>(arg_1);
11351 ISL_CPP_TRY {
11352 (data->func)(manage(arg_0));
11353 return isl_stat_ok;
11354 } ISL_CPP_CATCH_ALL {
11355 data->eptr = std::current_exception();
11356 return isl_stat_error;
11359 auto res = isl_id_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
11360 if (follows_data.eptr)
11361 std::rethrow_exception(follows_data.eptr);
11362 if (fn_data.eptr)
11363 std::rethrow_exception(fn_data.eptr);
11364 if (res < 0)
11365 exception::throw_last_error(saved_ctx);
11366 return;
11369 isl::id_list id_list::insert(unsigned int pos, isl::id el) const
11371 if (!ptr || el.is_null())
11372 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11373 auto saved_ctx = ctx();
11374 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11375 auto res = isl_id_list_insert(copy(), pos, el.release());
11376 if (!res)
11377 exception::throw_last_error(saved_ctx);
11378 return manage(res);
11381 isl::id_list id_list::insert(unsigned int pos, const std::string &el) const
11383 if (!ptr)
11384 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11385 return this->insert(pos, isl::id(ctx(), el));
11388 isl::id_list id_list::set_at(int index, isl::id el) const
11390 if (!ptr || el.is_null())
11391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11392 auto saved_ctx = ctx();
11393 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11394 auto res = isl_id_list_set_at(copy(), index, el.release());
11395 if (!res)
11396 exception::throw_last_error(saved_ctx);
11397 return manage(res);
11400 isl::id_list id_list::set_at(int index, const std::string &el) const
11402 if (!ptr)
11403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11404 return this->set_at(index, isl::id(ctx(), el));
11407 unsigned id_list::size() const
11409 if (!ptr)
11410 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11411 auto saved_ctx = ctx();
11412 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11413 auto res = isl_id_list_size(get());
11414 if (res < 0)
11415 exception::throw_last_error(saved_ctx);
11416 return res;
11419 inline std::ostream &operator<<(std::ostream &os, const id_list &obj)
11421 if (!obj.get())
11422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11423 auto saved_ctx = isl_id_list_get_ctx(obj.get());
11424 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11425 char *str = isl_id_list_to_str(obj.get());
11426 if (!str)
11427 exception::throw_last_error(saved_ctx);
11428 os << str;
11429 free(str);
11430 return os;
11433 // implementations for isl::id_to_ast_expr
11434 id_to_ast_expr manage(__isl_take isl_id_to_ast_expr *ptr) {
11435 if (!ptr)
11436 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11437 return id_to_ast_expr(ptr);
11439 id_to_ast_expr manage_copy(__isl_keep isl_id_to_ast_expr *ptr) {
11440 if (!ptr)
11441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11442 auto saved_ctx = isl_id_to_ast_expr_get_ctx(ptr);
11443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11444 ptr = isl_id_to_ast_expr_copy(ptr);
11445 if (!ptr)
11446 exception::throw_last_error(saved_ctx);
11447 return id_to_ast_expr(ptr);
11450 id_to_ast_expr::id_to_ast_expr(__isl_take isl_id_to_ast_expr *ptr)
11451 : ptr(ptr) {}
11453 id_to_ast_expr::id_to_ast_expr()
11454 : ptr(nullptr) {}
11456 id_to_ast_expr::id_to_ast_expr(const id_to_ast_expr &obj)
11457 : ptr(nullptr)
11459 if (!obj.ptr)
11460 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11461 auto saved_ctx = isl_id_to_ast_expr_get_ctx(obj.ptr);
11462 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11463 ptr = obj.copy();
11464 if (!ptr)
11465 exception::throw_last_error(saved_ctx);
11468 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, int min_size)
11470 auto saved_ctx = ctx;
11471 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11472 auto res = isl_id_to_ast_expr_alloc(ctx.release(), min_size);
11473 if (!res)
11474 exception::throw_last_error(saved_ctx);
11475 ptr = res;
11478 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, const std::string &str)
11480 auto saved_ctx = ctx;
11481 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11482 auto res = isl_id_to_ast_expr_read_from_str(ctx.release(), str.c_str());
11483 if (!res)
11484 exception::throw_last_error(saved_ctx);
11485 ptr = res;
11488 id_to_ast_expr &id_to_ast_expr::operator=(id_to_ast_expr obj) {
11489 std::swap(this->ptr, obj.ptr);
11490 return *this;
11493 id_to_ast_expr::~id_to_ast_expr() {
11494 if (ptr)
11495 isl_id_to_ast_expr_free(ptr);
11498 __isl_give isl_id_to_ast_expr *id_to_ast_expr::copy() const & {
11499 return isl_id_to_ast_expr_copy(ptr);
11502 __isl_keep isl_id_to_ast_expr *id_to_ast_expr::get() const {
11503 return ptr;
11506 __isl_give isl_id_to_ast_expr *id_to_ast_expr::release() {
11507 isl_id_to_ast_expr *tmp = ptr;
11508 ptr = nullptr;
11509 return tmp;
11512 bool id_to_ast_expr::is_null() const {
11513 return ptr == nullptr;
11516 isl::ctx id_to_ast_expr::ctx() const {
11517 return isl::ctx(isl_id_to_ast_expr_get_ctx(ptr));
11520 bool id_to_ast_expr::is_equal(const isl::id_to_ast_expr &hmap2) const
11522 if (!ptr || hmap2.is_null())
11523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11524 auto saved_ctx = ctx();
11525 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11526 auto res = isl_id_to_ast_expr_is_equal(get(), hmap2.get());
11527 if (res < 0)
11528 exception::throw_last_error(saved_ctx);
11529 return res;
11532 isl::id_to_ast_expr id_to_ast_expr::set(isl::id key, isl::ast_expr val) const
11534 if (!ptr || key.is_null() || val.is_null())
11535 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11536 auto saved_ctx = ctx();
11537 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11538 auto res = isl_id_to_ast_expr_set(copy(), key.release(), val.release());
11539 if (!res)
11540 exception::throw_last_error(saved_ctx);
11541 return manage(res);
11544 isl::id_to_ast_expr id_to_ast_expr::set(const std::string &key, const isl::ast_expr &val) const
11546 if (!ptr)
11547 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11548 return this->set(isl::id(ctx(), key), val);
11551 inline std::ostream &operator<<(std::ostream &os, const id_to_ast_expr &obj)
11553 if (!obj.get())
11554 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11555 auto saved_ctx = isl_id_to_ast_expr_get_ctx(obj.get());
11556 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11557 char *str = isl_id_to_ast_expr_to_str(obj.get());
11558 if (!str)
11559 exception::throw_last_error(saved_ctx);
11560 os << str;
11561 free(str);
11562 return os;
11565 // implementations for isl::id_to_id
11566 id_to_id manage(__isl_take isl_id_to_id *ptr) {
11567 if (!ptr)
11568 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11569 return id_to_id(ptr);
11571 id_to_id manage_copy(__isl_keep isl_id_to_id *ptr) {
11572 if (!ptr)
11573 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11574 auto saved_ctx = isl_id_to_id_get_ctx(ptr);
11575 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11576 ptr = isl_id_to_id_copy(ptr);
11577 if (!ptr)
11578 exception::throw_last_error(saved_ctx);
11579 return id_to_id(ptr);
11582 id_to_id::id_to_id(__isl_take isl_id_to_id *ptr)
11583 : ptr(ptr) {}
11585 id_to_id::id_to_id()
11586 : ptr(nullptr) {}
11588 id_to_id::id_to_id(const id_to_id &obj)
11589 : ptr(nullptr)
11591 if (!obj.ptr)
11592 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11593 auto saved_ctx = isl_id_to_id_get_ctx(obj.ptr);
11594 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11595 ptr = obj.copy();
11596 if (!ptr)
11597 exception::throw_last_error(saved_ctx);
11600 id_to_id::id_to_id(isl::ctx ctx, int min_size)
11602 auto saved_ctx = ctx;
11603 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11604 auto res = isl_id_to_id_alloc(ctx.release(), min_size);
11605 if (!res)
11606 exception::throw_last_error(saved_ctx);
11607 ptr = res;
11610 id_to_id::id_to_id(isl::ctx ctx, const std::string &str)
11612 auto saved_ctx = ctx;
11613 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11614 auto res = isl_id_to_id_read_from_str(ctx.release(), str.c_str());
11615 if (!res)
11616 exception::throw_last_error(saved_ctx);
11617 ptr = res;
11620 id_to_id &id_to_id::operator=(id_to_id obj) {
11621 std::swap(this->ptr, obj.ptr);
11622 return *this;
11625 id_to_id::~id_to_id() {
11626 if (ptr)
11627 isl_id_to_id_free(ptr);
11630 __isl_give isl_id_to_id *id_to_id::copy() const & {
11631 return isl_id_to_id_copy(ptr);
11634 __isl_keep isl_id_to_id *id_to_id::get() const {
11635 return ptr;
11638 __isl_give isl_id_to_id *id_to_id::release() {
11639 isl_id_to_id *tmp = ptr;
11640 ptr = nullptr;
11641 return tmp;
11644 bool id_to_id::is_null() const {
11645 return ptr == nullptr;
11648 isl::ctx id_to_id::ctx() const {
11649 return isl::ctx(isl_id_to_id_get_ctx(ptr));
11652 bool id_to_id::is_equal(const isl::id_to_id &hmap2) const
11654 if (!ptr || hmap2.is_null())
11655 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11656 auto saved_ctx = ctx();
11657 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11658 auto res = isl_id_to_id_is_equal(get(), hmap2.get());
11659 if (res < 0)
11660 exception::throw_last_error(saved_ctx);
11661 return res;
11664 isl::id_to_id id_to_id::set(isl::id key, isl::id val) const
11666 if (!ptr || key.is_null() || val.is_null())
11667 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11668 auto saved_ctx = ctx();
11669 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11670 auto res = isl_id_to_id_set(copy(), key.release(), val.release());
11671 if (!res)
11672 exception::throw_last_error(saved_ctx);
11673 return manage(res);
11676 isl::id_to_id id_to_id::set(const isl::id &key, const std::string &val) const
11678 if (!ptr)
11679 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11680 return this->set(key, isl::id(ctx(), val));
11683 isl::id_to_id id_to_id::set(const std::string &key, const isl::id &val) const
11685 if (!ptr)
11686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11687 return this->set(isl::id(ctx(), key), val);
11690 isl::id_to_id id_to_id::set(const std::string &key, const std::string &val) const
11692 if (!ptr)
11693 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11694 return this->set(isl::id(ctx(), key), isl::id(ctx(), val));
11697 inline std::ostream &operator<<(std::ostream &os, const id_to_id &obj)
11699 if (!obj.get())
11700 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11701 auto saved_ctx = isl_id_to_id_get_ctx(obj.get());
11702 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11703 char *str = isl_id_to_id_to_str(obj.get());
11704 if (!str)
11705 exception::throw_last_error(saved_ctx);
11706 os << str;
11707 free(str);
11708 return os;
11711 // implementations for isl::map
11712 map manage(__isl_take isl_map *ptr) {
11713 if (!ptr)
11714 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11715 return map(ptr);
11717 map manage_copy(__isl_keep isl_map *ptr) {
11718 if (!ptr)
11719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11720 auto saved_ctx = isl_map_get_ctx(ptr);
11721 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11722 ptr = isl_map_copy(ptr);
11723 if (!ptr)
11724 exception::throw_last_error(saved_ctx);
11725 return map(ptr);
11728 map::map(__isl_take isl_map *ptr)
11729 : ptr(ptr) {}
11731 map::map()
11732 : ptr(nullptr) {}
11734 map::map(const map &obj)
11735 : ptr(nullptr)
11737 if (!obj.ptr)
11738 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11739 auto saved_ctx = isl_map_get_ctx(obj.ptr);
11740 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11741 ptr = obj.copy();
11742 if (!ptr)
11743 exception::throw_last_error(saved_ctx);
11746 map::map(isl::basic_map bmap)
11748 if (bmap.is_null())
11749 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11750 auto saved_ctx = bmap.ctx();
11751 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11752 auto res = isl_map_from_basic_map(bmap.release());
11753 if (!res)
11754 exception::throw_last_error(saved_ctx);
11755 ptr = res;
11758 map::map(isl::ctx ctx, const std::string &str)
11760 auto saved_ctx = ctx;
11761 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11762 auto res = isl_map_read_from_str(ctx.release(), str.c_str());
11763 if (!res)
11764 exception::throw_last_error(saved_ctx);
11765 ptr = res;
11768 map &map::operator=(map obj) {
11769 std::swap(this->ptr, obj.ptr);
11770 return *this;
11773 map::~map() {
11774 if (ptr)
11775 isl_map_free(ptr);
11778 __isl_give isl_map *map::copy() const & {
11779 return isl_map_copy(ptr);
11782 __isl_keep isl_map *map::get() const {
11783 return ptr;
11786 __isl_give isl_map *map::release() {
11787 isl_map *tmp = ptr;
11788 ptr = nullptr;
11789 return tmp;
11792 bool map::is_null() const {
11793 return ptr == nullptr;
11796 isl::ctx map::ctx() const {
11797 return isl::ctx(isl_map_get_ctx(ptr));
11800 isl::basic_map map::affine_hull() const
11802 if (!ptr)
11803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11804 auto saved_ctx = ctx();
11805 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11806 auto res = isl_map_affine_hull(copy());
11807 if (!res)
11808 exception::throw_last_error(saved_ctx);
11809 return manage(res);
11812 isl::map map::apply_domain(isl::map map2) const
11814 if (!ptr || map2.is_null())
11815 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11816 auto saved_ctx = ctx();
11817 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11818 auto res = isl_map_apply_domain(copy(), map2.release());
11819 if (!res)
11820 exception::throw_last_error(saved_ctx);
11821 return manage(res);
11824 isl::union_map map::apply_domain(const isl::union_map &umap2) const
11826 if (!ptr)
11827 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11828 return isl::union_map(*this).apply_domain(umap2);
11831 isl::map map::apply_domain(const isl::basic_map &map2) const
11833 if (!ptr)
11834 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11835 return this->apply_domain(isl::map(map2));
11838 isl::map map::apply_range(isl::map map2) const
11840 if (!ptr || map2.is_null())
11841 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11842 auto saved_ctx = ctx();
11843 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11844 auto res = isl_map_apply_range(copy(), map2.release());
11845 if (!res)
11846 exception::throw_last_error(saved_ctx);
11847 return manage(res);
11850 isl::union_map map::apply_range(const isl::union_map &umap2) const
11852 if (!ptr)
11853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11854 return isl::union_map(*this).apply_range(umap2);
11857 isl::map map::apply_range(const isl::basic_map &map2) const
11859 if (!ptr)
11860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11861 return this->apply_range(isl::map(map2));
11864 isl::map map::as_map() const
11866 if (!ptr)
11867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11868 return isl::union_map(*this).as_map();
11871 isl::multi_union_pw_aff map::as_multi_union_pw_aff() const
11873 if (!ptr)
11874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11875 return isl::union_map(*this).as_multi_union_pw_aff();
11878 isl::pw_multi_aff map::as_pw_multi_aff() const
11880 if (!ptr)
11881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11882 auto saved_ctx = ctx();
11883 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11884 auto res = isl_map_as_pw_multi_aff(copy());
11885 if (!res)
11886 exception::throw_last_error(saved_ctx);
11887 return manage(res);
11890 isl::union_pw_multi_aff map::as_union_pw_multi_aff() const
11892 if (!ptr)
11893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11894 return isl::union_map(*this).as_union_pw_multi_aff();
11897 isl::set map::bind_domain(isl::multi_id tuple) const
11899 if (!ptr || tuple.is_null())
11900 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11901 auto saved_ctx = ctx();
11902 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11903 auto res = isl_map_bind_domain(copy(), tuple.release());
11904 if (!res)
11905 exception::throw_last_error(saved_ctx);
11906 return manage(res);
11909 isl::set map::bind_range(isl::multi_id tuple) const
11911 if (!ptr || tuple.is_null())
11912 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11913 auto saved_ctx = ctx();
11914 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11915 auto res = isl_map_bind_range(copy(), tuple.release());
11916 if (!res)
11917 exception::throw_last_error(saved_ctx);
11918 return manage(res);
11921 isl::map map::coalesce() const
11923 if (!ptr)
11924 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11925 auto saved_ctx = ctx();
11926 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11927 auto res = isl_map_coalesce(copy());
11928 if (!res)
11929 exception::throw_last_error(saved_ctx);
11930 return manage(res);
11933 isl::map map::complement() const
11935 if (!ptr)
11936 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11937 auto saved_ctx = ctx();
11938 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11939 auto res = isl_map_complement(copy());
11940 if (!res)
11941 exception::throw_last_error(saved_ctx);
11942 return manage(res);
11945 isl::union_map map::compute_divs() const
11947 if (!ptr)
11948 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11949 return isl::union_map(*this).compute_divs();
11952 isl::map map::curry() const
11954 if (!ptr)
11955 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11956 auto saved_ctx = ctx();
11957 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11958 auto res = isl_map_curry(copy());
11959 if (!res)
11960 exception::throw_last_error(saved_ctx);
11961 return manage(res);
11964 isl::set map::deltas() const
11966 if (!ptr)
11967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11968 auto saved_ctx = ctx();
11969 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11970 auto res = isl_map_deltas(copy());
11971 if (!res)
11972 exception::throw_last_error(saved_ctx);
11973 return manage(res);
11976 isl::map map::detect_equalities() const
11978 if (!ptr)
11979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11980 auto saved_ctx = ctx();
11981 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11982 auto res = isl_map_detect_equalities(copy());
11983 if (!res)
11984 exception::throw_last_error(saved_ctx);
11985 return manage(res);
11988 isl::set map::domain() const
11990 if (!ptr)
11991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
11992 auto saved_ctx = ctx();
11993 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
11994 auto res = isl_map_domain(copy());
11995 if (!res)
11996 exception::throw_last_error(saved_ctx);
11997 return manage(res);
12000 isl::map map::domain_factor_domain() const
12002 if (!ptr)
12003 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12004 auto saved_ctx = ctx();
12005 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12006 auto res = isl_map_domain_factor_domain(copy());
12007 if (!res)
12008 exception::throw_last_error(saved_ctx);
12009 return manage(res);
12012 isl::map map::domain_factor_range() const
12014 if (!ptr)
12015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12016 auto saved_ctx = ctx();
12017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12018 auto res = isl_map_domain_factor_range(copy());
12019 if (!res)
12020 exception::throw_last_error(saved_ctx);
12021 return manage(res);
12024 isl::union_map map::domain_map() const
12026 if (!ptr)
12027 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12028 return isl::union_map(*this).domain_map();
12031 isl::union_pw_multi_aff map::domain_map_union_pw_multi_aff() const
12033 if (!ptr)
12034 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12035 return isl::union_map(*this).domain_map_union_pw_multi_aff();
12038 isl::map map::domain_product(isl::map map2) const
12040 if (!ptr || map2.is_null())
12041 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12042 auto saved_ctx = ctx();
12043 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12044 auto res = isl_map_domain_product(copy(), map2.release());
12045 if (!res)
12046 exception::throw_last_error(saved_ctx);
12047 return manage(res);
12050 isl::union_map map::domain_product(const isl::union_map &umap2) const
12052 if (!ptr)
12053 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12054 return isl::union_map(*this).domain_product(umap2);
12057 isl::map map::domain_product(const isl::basic_map &map2) const
12059 if (!ptr)
12060 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12061 return this->domain_product(isl::map(map2));
12064 isl::map map::domain_reverse() const
12066 if (!ptr)
12067 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12068 auto saved_ctx = ctx();
12069 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12070 auto res = isl_map_domain_reverse(copy());
12071 if (!res)
12072 exception::throw_last_error(saved_ctx);
12073 return manage(res);
12076 unsigned map::domain_tuple_dim() const
12078 if (!ptr)
12079 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12080 auto saved_ctx = ctx();
12081 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12082 auto res = isl_map_domain_tuple_dim(get());
12083 if (res < 0)
12084 exception::throw_last_error(saved_ctx);
12085 return res;
12088 isl::id map::domain_tuple_id() const
12090 if (!ptr)
12091 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12092 auto saved_ctx = ctx();
12093 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12094 auto res = isl_map_get_domain_tuple_id(get());
12095 if (!res)
12096 exception::throw_last_error(saved_ctx);
12097 return manage(res);
12100 isl::id map::get_domain_tuple_id() const
12102 return domain_tuple_id();
12105 isl::map map::drop_unused_params() const
12107 if (!ptr)
12108 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12109 auto saved_ctx = ctx();
12110 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12111 auto res = isl_map_drop_unused_params(copy());
12112 if (!res)
12113 exception::throw_last_error(saved_ctx);
12114 return manage(res);
12117 isl::map map::empty(isl::space space)
12119 if (space.is_null())
12120 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12121 auto saved_ctx = space.ctx();
12122 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12123 auto res = isl_map_empty(space.release());
12124 if (!res)
12125 exception::throw_last_error(saved_ctx);
12126 return manage(res);
12129 isl::map map::eq_at(isl::multi_pw_aff mpa) const
12131 if (!ptr || mpa.is_null())
12132 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12133 auto saved_ctx = ctx();
12134 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12135 auto res = isl_map_eq_at_multi_pw_aff(copy(), mpa.release());
12136 if (!res)
12137 exception::throw_last_error(saved_ctx);
12138 return manage(res);
12141 isl::union_map map::eq_at(const isl::multi_union_pw_aff &mupa) const
12143 if (!ptr)
12144 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12145 return isl::union_map(*this).eq_at(mupa);
12148 isl::map map::eq_at(const isl::aff &mpa) const
12150 if (!ptr)
12151 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12152 return this->eq_at(isl::multi_pw_aff(mpa));
12155 isl::map map::eq_at(const isl::multi_aff &mpa) const
12157 if (!ptr)
12158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12159 return this->eq_at(isl::multi_pw_aff(mpa));
12162 isl::map map::eq_at(const isl::pw_aff &mpa) const
12164 if (!ptr)
12165 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12166 return this->eq_at(isl::multi_pw_aff(mpa));
12169 isl::map map::eq_at(const isl::pw_multi_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 bool map::every_map(const std::function<bool(isl::map)> &test) const
12178 if (!ptr)
12179 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12180 return isl::union_map(*this).every_map(test);
12183 isl::map map::extract_map(const isl::space &space) const
12185 if (!ptr)
12186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12187 return isl::union_map(*this).extract_map(space);
12190 isl::map map::factor_domain() const
12192 if (!ptr)
12193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12194 auto saved_ctx = ctx();
12195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12196 auto res = isl_map_factor_domain(copy());
12197 if (!res)
12198 exception::throw_last_error(saved_ctx);
12199 return manage(res);
12202 isl::map map::factor_range() const
12204 if (!ptr)
12205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12206 auto saved_ctx = ctx();
12207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12208 auto res = isl_map_factor_range(copy());
12209 if (!res)
12210 exception::throw_last_error(saved_ctx);
12211 return manage(res);
12214 isl::map map::fixed_power(isl::val exp) const
12216 if (!ptr || exp.is_null())
12217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12218 auto saved_ctx = ctx();
12219 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12220 auto res = isl_map_fixed_power_val(copy(), exp.release());
12221 if (!res)
12222 exception::throw_last_error(saved_ctx);
12223 return manage(res);
12226 isl::map map::fixed_power(long exp) const
12228 if (!ptr)
12229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12230 return this->fixed_power(isl::val(ctx(), exp));
12233 isl::map map::flatten() const
12235 if (!ptr)
12236 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12237 auto saved_ctx = ctx();
12238 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12239 auto res = isl_map_flatten(copy());
12240 if (!res)
12241 exception::throw_last_error(saved_ctx);
12242 return manage(res);
12245 isl::map map::flatten_domain() const
12247 if (!ptr)
12248 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12249 auto saved_ctx = ctx();
12250 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12251 auto res = isl_map_flatten_domain(copy());
12252 if (!res)
12253 exception::throw_last_error(saved_ctx);
12254 return manage(res);
12257 isl::map map::flatten_range() const
12259 if (!ptr)
12260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12261 auto saved_ctx = ctx();
12262 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12263 auto res = isl_map_flatten_range(copy());
12264 if (!res)
12265 exception::throw_last_error(saved_ctx);
12266 return manage(res);
12269 void map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
12271 if (!ptr)
12272 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12273 auto saved_ctx = ctx();
12274 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12275 struct fn_data {
12276 std::function<void(isl::basic_map)> func;
12277 std::exception_ptr eptr;
12278 } fn_data = { fn };
12279 auto fn_lambda = [](isl_basic_map *arg_0, void *arg_1) -> isl_stat {
12280 auto *data = static_cast<struct fn_data *>(arg_1);
12281 ISL_CPP_TRY {
12282 (data->func)(manage(arg_0));
12283 return isl_stat_ok;
12284 } ISL_CPP_CATCH_ALL {
12285 data->eptr = std::current_exception();
12286 return isl_stat_error;
12289 auto res = isl_map_foreach_basic_map(get(), fn_lambda, &fn_data);
12290 if (fn_data.eptr)
12291 std::rethrow_exception(fn_data.eptr);
12292 if (res < 0)
12293 exception::throw_last_error(saved_ctx);
12294 return;
12297 void map::foreach_map(const std::function<void(isl::map)> &fn) const
12299 if (!ptr)
12300 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12301 return isl::union_map(*this).foreach_map(fn);
12304 isl::map map::gist(isl::map context) const
12306 if (!ptr || context.is_null())
12307 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12308 auto saved_ctx = ctx();
12309 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12310 auto res = isl_map_gist(copy(), context.release());
12311 if (!res)
12312 exception::throw_last_error(saved_ctx);
12313 return manage(res);
12316 isl::union_map map::gist(const isl::union_map &context) const
12318 if (!ptr)
12319 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12320 return isl::union_map(*this).gist(context);
12323 isl::map map::gist(const isl::basic_map &context) const
12325 if (!ptr)
12326 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12327 return this->gist(isl::map(context));
12330 isl::map map::gist_domain(isl::set context) const
12332 if (!ptr || context.is_null())
12333 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12334 auto saved_ctx = ctx();
12335 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12336 auto res = isl_map_gist_domain(copy(), context.release());
12337 if (!res)
12338 exception::throw_last_error(saved_ctx);
12339 return manage(res);
12342 isl::union_map map::gist_domain(const isl::union_set &uset) const
12344 if (!ptr)
12345 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12346 return isl::union_map(*this).gist_domain(uset);
12349 isl::map map::gist_domain(const isl::basic_set &context) const
12351 if (!ptr)
12352 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12353 return this->gist_domain(isl::set(context));
12356 isl::map map::gist_domain(const isl::point &context) const
12358 if (!ptr)
12359 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12360 return this->gist_domain(isl::set(context));
12363 isl::map map::gist_params(isl::set context) const
12365 if (!ptr || context.is_null())
12366 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12367 auto saved_ctx = ctx();
12368 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12369 auto res = isl_map_gist_params(copy(), context.release());
12370 if (!res)
12371 exception::throw_last_error(saved_ctx);
12372 return manage(res);
12375 isl::union_map map::gist_range(const isl::union_set &uset) const
12377 if (!ptr)
12378 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12379 return isl::union_map(*this).gist_range(uset);
12382 bool map::has_domain_tuple_id() const
12384 if (!ptr)
12385 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12386 auto saved_ctx = ctx();
12387 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12388 auto res = isl_map_has_domain_tuple_id(get());
12389 if (res < 0)
12390 exception::throw_last_error(saved_ctx);
12391 return res;
12394 bool map::has_range_tuple_id() const
12396 if (!ptr)
12397 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12398 auto saved_ctx = ctx();
12399 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12400 auto res = isl_map_has_range_tuple_id(get());
12401 if (res < 0)
12402 exception::throw_last_error(saved_ctx);
12403 return res;
12406 isl::map map::intersect(isl::map map2) const
12408 if (!ptr || map2.is_null())
12409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12410 auto saved_ctx = ctx();
12411 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12412 auto res = isl_map_intersect(copy(), map2.release());
12413 if (!res)
12414 exception::throw_last_error(saved_ctx);
12415 return manage(res);
12418 isl::union_map map::intersect(const isl::union_map &umap2) const
12420 if (!ptr)
12421 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12422 return isl::union_map(*this).intersect(umap2);
12425 isl::map map::intersect(const isl::basic_map &map2) const
12427 if (!ptr)
12428 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12429 return this->intersect(isl::map(map2));
12432 isl::map map::intersect_domain(isl::set set) const
12434 if (!ptr || set.is_null())
12435 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12436 auto saved_ctx = ctx();
12437 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12438 auto res = isl_map_intersect_domain(copy(), set.release());
12439 if (!res)
12440 exception::throw_last_error(saved_ctx);
12441 return manage(res);
12444 isl::union_map map::intersect_domain(const isl::space &space) const
12446 if (!ptr)
12447 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12448 return isl::union_map(*this).intersect_domain(space);
12451 isl::union_map map::intersect_domain(const isl::union_set &uset) const
12453 if (!ptr)
12454 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12455 return isl::union_map(*this).intersect_domain(uset);
12458 isl::map map::intersect_domain(const isl::basic_set &set) const
12460 if (!ptr)
12461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12462 return this->intersect_domain(isl::set(set));
12465 isl::map map::intersect_domain(const isl::point &set) const
12467 if (!ptr)
12468 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12469 return this->intersect_domain(isl::set(set));
12472 isl::map map::intersect_domain_factor_domain(isl::map factor) const
12474 if (!ptr || factor.is_null())
12475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12476 auto saved_ctx = ctx();
12477 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12478 auto res = isl_map_intersect_domain_factor_domain(copy(), factor.release());
12479 if (!res)
12480 exception::throw_last_error(saved_ctx);
12481 return manage(res);
12484 isl::union_map map::intersect_domain_factor_domain(const isl::union_map &factor) const
12486 if (!ptr)
12487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12488 return isl::union_map(*this).intersect_domain_factor_domain(factor);
12491 isl::map map::intersect_domain_factor_domain(const isl::basic_map &factor) const
12493 if (!ptr)
12494 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12495 return this->intersect_domain_factor_domain(isl::map(factor));
12498 isl::map map::intersect_domain_factor_range(isl::map factor) const
12500 if (!ptr || factor.is_null())
12501 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12502 auto saved_ctx = ctx();
12503 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12504 auto res = isl_map_intersect_domain_factor_range(copy(), factor.release());
12505 if (!res)
12506 exception::throw_last_error(saved_ctx);
12507 return manage(res);
12510 isl::union_map map::intersect_domain_factor_range(const isl::union_map &factor) const
12512 if (!ptr)
12513 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12514 return isl::union_map(*this).intersect_domain_factor_range(factor);
12517 isl::map map::intersect_domain_factor_range(const isl::basic_map &factor) const
12519 if (!ptr)
12520 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12521 return this->intersect_domain_factor_range(isl::map(factor));
12524 isl::map map::intersect_domain_wrapped_domain(isl::set domain) const
12526 if (!ptr || domain.is_null())
12527 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12528 auto saved_ctx = ctx();
12529 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12530 auto res = isl_map_intersect_domain_wrapped_domain(copy(), domain.release());
12531 if (!res)
12532 exception::throw_last_error(saved_ctx);
12533 return manage(res);
12536 isl::union_map map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
12538 if (!ptr)
12539 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12540 return isl::union_map(*this).intersect_domain_wrapped_domain(domain);
12543 isl::map map::intersect_domain_wrapped_domain(const isl::basic_set &domain) const
12545 if (!ptr)
12546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12547 return this->intersect_domain_wrapped_domain(isl::set(domain));
12550 isl::map map::intersect_domain_wrapped_domain(const isl::point &domain) const
12552 if (!ptr)
12553 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12554 return this->intersect_domain_wrapped_domain(isl::set(domain));
12557 isl::map map::intersect_params(isl::set params) const
12559 if (!ptr || params.is_null())
12560 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12561 auto saved_ctx = ctx();
12562 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12563 auto res = isl_map_intersect_params(copy(), params.release());
12564 if (!res)
12565 exception::throw_last_error(saved_ctx);
12566 return manage(res);
12569 isl::map map::intersect_range(isl::set set) const
12571 if (!ptr || set.is_null())
12572 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12573 auto saved_ctx = ctx();
12574 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12575 auto res = isl_map_intersect_range(copy(), set.release());
12576 if (!res)
12577 exception::throw_last_error(saved_ctx);
12578 return manage(res);
12581 isl::union_map map::intersect_range(const isl::space &space) const
12583 if (!ptr)
12584 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12585 return isl::union_map(*this).intersect_range(space);
12588 isl::union_map map::intersect_range(const isl::union_set &uset) const
12590 if (!ptr)
12591 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12592 return isl::union_map(*this).intersect_range(uset);
12595 isl::map map::intersect_range(const isl::basic_set &set) const
12597 if (!ptr)
12598 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12599 return this->intersect_range(isl::set(set));
12602 isl::map map::intersect_range(const isl::point &set) const
12604 if (!ptr)
12605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12606 return this->intersect_range(isl::set(set));
12609 isl::map map::intersect_range_factor_domain(isl::map factor) const
12611 if (!ptr || factor.is_null())
12612 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12613 auto saved_ctx = ctx();
12614 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12615 auto res = isl_map_intersect_range_factor_domain(copy(), factor.release());
12616 if (!res)
12617 exception::throw_last_error(saved_ctx);
12618 return manage(res);
12621 isl::union_map map::intersect_range_factor_domain(const isl::union_map &factor) const
12623 if (!ptr)
12624 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12625 return isl::union_map(*this).intersect_range_factor_domain(factor);
12628 isl::map map::intersect_range_factor_domain(const isl::basic_map &factor) const
12630 if (!ptr)
12631 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12632 return this->intersect_range_factor_domain(isl::map(factor));
12635 isl::map map::intersect_range_factor_range(isl::map factor) const
12637 if (!ptr || factor.is_null())
12638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12639 auto saved_ctx = ctx();
12640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12641 auto res = isl_map_intersect_range_factor_range(copy(), factor.release());
12642 if (!res)
12643 exception::throw_last_error(saved_ctx);
12644 return manage(res);
12647 isl::union_map map::intersect_range_factor_range(const isl::union_map &factor) const
12649 if (!ptr)
12650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12651 return isl::union_map(*this).intersect_range_factor_range(factor);
12654 isl::map map::intersect_range_factor_range(const isl::basic_map &factor) const
12656 if (!ptr)
12657 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12658 return this->intersect_range_factor_range(isl::map(factor));
12661 isl::map map::intersect_range_wrapped_domain(isl::set domain) const
12663 if (!ptr || domain.is_null())
12664 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12665 auto saved_ctx = ctx();
12666 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12667 auto res = isl_map_intersect_range_wrapped_domain(copy(), domain.release());
12668 if (!res)
12669 exception::throw_last_error(saved_ctx);
12670 return manage(res);
12673 isl::union_map map::intersect_range_wrapped_domain(const isl::union_set &domain) const
12675 if (!ptr)
12676 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12677 return isl::union_map(*this).intersect_range_wrapped_domain(domain);
12680 isl::map map::intersect_range_wrapped_domain(const isl::basic_set &domain) const
12682 if (!ptr)
12683 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12684 return this->intersect_range_wrapped_domain(isl::set(domain));
12687 isl::map map::intersect_range_wrapped_domain(const isl::point &domain) const
12689 if (!ptr)
12690 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12691 return this->intersect_range_wrapped_domain(isl::set(domain));
12694 bool map::is_bijective() const
12696 if (!ptr)
12697 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12698 auto saved_ctx = ctx();
12699 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12700 auto res = isl_map_is_bijective(get());
12701 if (res < 0)
12702 exception::throw_last_error(saved_ctx);
12703 return res;
12706 bool map::is_disjoint(const isl::map &map2) const
12708 if (!ptr || map2.is_null())
12709 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12710 auto saved_ctx = ctx();
12711 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12712 auto res = isl_map_is_disjoint(get(), map2.get());
12713 if (res < 0)
12714 exception::throw_last_error(saved_ctx);
12715 return res;
12718 bool map::is_disjoint(const isl::union_map &umap2) const
12720 if (!ptr)
12721 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12722 return isl::union_map(*this).is_disjoint(umap2);
12725 bool map::is_disjoint(const isl::basic_map &map2) const
12727 if (!ptr)
12728 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12729 return this->is_disjoint(isl::map(map2));
12732 bool map::is_empty() const
12734 if (!ptr)
12735 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12736 auto saved_ctx = ctx();
12737 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12738 auto res = isl_map_is_empty(get());
12739 if (res < 0)
12740 exception::throw_last_error(saved_ctx);
12741 return res;
12744 bool map::is_equal(const isl::map &map2) const
12746 if (!ptr || map2.is_null())
12747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12748 auto saved_ctx = ctx();
12749 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12750 auto res = isl_map_is_equal(get(), map2.get());
12751 if (res < 0)
12752 exception::throw_last_error(saved_ctx);
12753 return res;
12756 bool map::is_equal(const isl::union_map &umap2) const
12758 if (!ptr)
12759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12760 return isl::union_map(*this).is_equal(umap2);
12763 bool map::is_equal(const isl::basic_map &map2) const
12765 if (!ptr)
12766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12767 return this->is_equal(isl::map(map2));
12770 bool map::is_injective() const
12772 if (!ptr)
12773 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12774 auto saved_ctx = ctx();
12775 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12776 auto res = isl_map_is_injective(get());
12777 if (res < 0)
12778 exception::throw_last_error(saved_ctx);
12779 return res;
12782 bool map::is_single_valued() const
12784 if (!ptr)
12785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12786 auto saved_ctx = ctx();
12787 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12788 auto res = isl_map_is_single_valued(get());
12789 if (res < 0)
12790 exception::throw_last_error(saved_ctx);
12791 return res;
12794 bool map::is_strict_subset(const isl::map &map2) const
12796 if (!ptr || map2.is_null())
12797 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12798 auto saved_ctx = ctx();
12799 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12800 auto res = isl_map_is_strict_subset(get(), map2.get());
12801 if (res < 0)
12802 exception::throw_last_error(saved_ctx);
12803 return res;
12806 bool map::is_strict_subset(const isl::union_map &umap2) const
12808 if (!ptr)
12809 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12810 return isl::union_map(*this).is_strict_subset(umap2);
12813 bool map::is_strict_subset(const isl::basic_map &map2) const
12815 if (!ptr)
12816 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12817 return this->is_strict_subset(isl::map(map2));
12820 bool map::is_subset(const isl::map &map2) const
12822 if (!ptr || map2.is_null())
12823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12824 auto saved_ctx = ctx();
12825 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12826 auto res = isl_map_is_subset(get(), map2.get());
12827 if (res < 0)
12828 exception::throw_last_error(saved_ctx);
12829 return res;
12832 bool map::is_subset(const isl::union_map &umap2) const
12834 if (!ptr)
12835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12836 return isl::union_map(*this).is_subset(umap2);
12839 bool map::is_subset(const isl::basic_map &map2) const
12841 if (!ptr)
12842 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12843 return this->is_subset(isl::map(map2));
12846 bool map::isa_map() const
12848 if (!ptr)
12849 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12850 return isl::union_map(*this).isa_map();
12853 isl::map map::lex_ge_at(isl::multi_pw_aff mpa) const
12855 if (!ptr || mpa.is_null())
12856 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12857 auto saved_ctx = ctx();
12858 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12859 auto res = isl_map_lex_ge_at_multi_pw_aff(copy(), mpa.release());
12860 if (!res)
12861 exception::throw_last_error(saved_ctx);
12862 return manage(res);
12865 isl::map map::lex_gt_at(isl::multi_pw_aff mpa) const
12867 if (!ptr || mpa.is_null())
12868 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12869 auto saved_ctx = ctx();
12870 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12871 auto res = isl_map_lex_gt_at_multi_pw_aff(copy(), mpa.release());
12872 if (!res)
12873 exception::throw_last_error(saved_ctx);
12874 return manage(res);
12877 isl::map map::lex_le_at(isl::multi_pw_aff mpa) const
12879 if (!ptr || mpa.is_null())
12880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12881 auto saved_ctx = ctx();
12882 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12883 auto res = isl_map_lex_le_at_multi_pw_aff(copy(), mpa.release());
12884 if (!res)
12885 exception::throw_last_error(saved_ctx);
12886 return manage(res);
12889 isl::map map::lex_lt_at(isl::multi_pw_aff mpa) const
12891 if (!ptr || mpa.is_null())
12892 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12893 auto saved_ctx = ctx();
12894 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12895 auto res = isl_map_lex_lt_at_multi_pw_aff(copy(), mpa.release());
12896 if (!res)
12897 exception::throw_last_error(saved_ctx);
12898 return manage(res);
12901 isl::map map::lexmax() const
12903 if (!ptr)
12904 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12905 auto saved_ctx = ctx();
12906 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12907 auto res = isl_map_lexmax(copy());
12908 if (!res)
12909 exception::throw_last_error(saved_ctx);
12910 return manage(res);
12913 isl::pw_multi_aff map::lexmax_pw_multi_aff() const
12915 if (!ptr)
12916 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12917 auto saved_ctx = ctx();
12918 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12919 auto res = isl_map_lexmax_pw_multi_aff(copy());
12920 if (!res)
12921 exception::throw_last_error(saved_ctx);
12922 return manage(res);
12925 isl::map map::lexmin() const
12927 if (!ptr)
12928 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12929 auto saved_ctx = ctx();
12930 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12931 auto res = isl_map_lexmin(copy());
12932 if (!res)
12933 exception::throw_last_error(saved_ctx);
12934 return manage(res);
12937 isl::pw_multi_aff map::lexmin_pw_multi_aff() const
12939 if (!ptr)
12940 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12941 auto saved_ctx = ctx();
12942 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12943 auto res = isl_map_lexmin_pw_multi_aff(copy());
12944 if (!res)
12945 exception::throw_last_error(saved_ctx);
12946 return manage(res);
12949 isl::map map::lower_bound(isl::multi_pw_aff lower) const
12951 if (!ptr || lower.is_null())
12952 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12953 auto saved_ctx = ctx();
12954 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12955 auto res = isl_map_lower_bound_multi_pw_aff(copy(), lower.release());
12956 if (!res)
12957 exception::throw_last_error(saved_ctx);
12958 return manage(res);
12961 isl::map_list map::map_list() const
12963 if (!ptr)
12964 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12965 return isl::union_map(*this).map_list();
12968 isl::multi_pw_aff map::max_multi_pw_aff() const
12970 if (!ptr)
12971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12972 auto saved_ctx = ctx();
12973 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12974 auto res = isl_map_max_multi_pw_aff(copy());
12975 if (!res)
12976 exception::throw_last_error(saved_ctx);
12977 return manage(res);
12980 isl::multi_pw_aff map::min_multi_pw_aff() const
12982 if (!ptr)
12983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12984 auto saved_ctx = ctx();
12985 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12986 auto res = isl_map_min_multi_pw_aff(copy());
12987 if (!res)
12988 exception::throw_last_error(saved_ctx);
12989 return manage(res);
12992 unsigned map::n_basic_map() const
12994 if (!ptr)
12995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
12996 auto saved_ctx = ctx();
12997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
12998 auto res = isl_map_n_basic_map(get());
12999 if (res < 0)
13000 exception::throw_last_error(saved_ctx);
13001 return res;
13004 isl::set map::params() const
13006 if (!ptr)
13007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13008 auto saved_ctx = ctx();
13009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13010 auto res = isl_map_params(copy());
13011 if (!res)
13012 exception::throw_last_error(saved_ctx);
13013 return manage(res);
13016 isl::basic_map map::polyhedral_hull() const
13018 if (!ptr)
13019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13020 auto saved_ctx = ctx();
13021 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13022 auto res = isl_map_polyhedral_hull(copy());
13023 if (!res)
13024 exception::throw_last_error(saved_ctx);
13025 return manage(res);
13028 isl::map map::preimage_domain(isl::multi_aff ma) const
13030 if (!ptr || ma.is_null())
13031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13032 auto saved_ctx = ctx();
13033 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13034 auto res = isl_map_preimage_domain_multi_aff(copy(), ma.release());
13035 if (!res)
13036 exception::throw_last_error(saved_ctx);
13037 return manage(res);
13040 isl::map map::preimage_domain(isl::multi_pw_aff mpa) const
13042 if (!ptr || mpa.is_null())
13043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13044 auto saved_ctx = ctx();
13045 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13046 auto res = isl_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
13047 if (!res)
13048 exception::throw_last_error(saved_ctx);
13049 return manage(res);
13052 isl::map map::preimage_domain(isl::pw_multi_aff pma) const
13054 if (!ptr || pma.is_null())
13055 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13056 auto saved_ctx = ctx();
13057 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13058 auto res = isl_map_preimage_domain_pw_multi_aff(copy(), pma.release());
13059 if (!res)
13060 exception::throw_last_error(saved_ctx);
13061 return manage(res);
13064 isl::union_map map::preimage_domain(const isl::union_pw_multi_aff &upma) const
13066 if (!ptr)
13067 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13068 return isl::union_map(*this).preimage_domain(upma);
13071 isl::map map::preimage_range(isl::multi_aff ma) const
13073 if (!ptr || ma.is_null())
13074 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13075 auto saved_ctx = ctx();
13076 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13077 auto res = isl_map_preimage_range_multi_aff(copy(), ma.release());
13078 if (!res)
13079 exception::throw_last_error(saved_ctx);
13080 return manage(res);
13083 isl::map map::preimage_range(isl::pw_multi_aff pma) const
13085 if (!ptr || pma.is_null())
13086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13087 auto saved_ctx = ctx();
13088 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13089 auto res = isl_map_preimage_range_pw_multi_aff(copy(), pma.release());
13090 if (!res)
13091 exception::throw_last_error(saved_ctx);
13092 return manage(res);
13095 isl::union_map map::preimage_range(const isl::union_pw_multi_aff &upma) const
13097 if (!ptr)
13098 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13099 return isl::union_map(*this).preimage_range(upma);
13102 isl::map map::product(isl::map map2) const
13104 if (!ptr || map2.is_null())
13105 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13106 auto saved_ctx = ctx();
13107 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13108 auto res = isl_map_product(copy(), map2.release());
13109 if (!res)
13110 exception::throw_last_error(saved_ctx);
13111 return manage(res);
13114 isl::union_map map::product(const isl::union_map &umap2) const
13116 if (!ptr)
13117 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13118 return isl::union_map(*this).product(umap2);
13121 isl::map map::product(const isl::basic_map &map2) const
13123 if (!ptr)
13124 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13125 return this->product(isl::map(map2));
13128 isl::map map::project_out_all_params() const
13130 if (!ptr)
13131 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13132 auto saved_ctx = ctx();
13133 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13134 auto res = isl_map_project_out_all_params(copy());
13135 if (!res)
13136 exception::throw_last_error(saved_ctx);
13137 return manage(res);
13140 isl::map map::project_out_param(isl::id id) const
13142 if (!ptr || id.is_null())
13143 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13144 auto saved_ctx = ctx();
13145 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13146 auto res = isl_map_project_out_param_id(copy(), id.release());
13147 if (!res)
13148 exception::throw_last_error(saved_ctx);
13149 return manage(res);
13152 isl::map map::project_out_param(const std::string &id) const
13154 if (!ptr)
13155 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13156 return this->project_out_param(isl::id(ctx(), id));
13159 isl::map map::project_out_param(isl::id_list list) const
13161 if (!ptr || list.is_null())
13162 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13163 auto saved_ctx = ctx();
13164 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13165 auto res = isl_map_project_out_param_id_list(copy(), list.release());
13166 if (!res)
13167 exception::throw_last_error(saved_ctx);
13168 return manage(res);
13171 isl::set map::range() const
13173 if (!ptr)
13174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13175 auto saved_ctx = ctx();
13176 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13177 auto res = isl_map_range(copy());
13178 if (!res)
13179 exception::throw_last_error(saved_ctx);
13180 return manage(res);
13183 isl::map map::range_factor_domain() const
13185 if (!ptr)
13186 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13187 auto saved_ctx = ctx();
13188 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13189 auto res = isl_map_range_factor_domain(copy());
13190 if (!res)
13191 exception::throw_last_error(saved_ctx);
13192 return manage(res);
13195 isl::map map::range_factor_range() const
13197 if (!ptr)
13198 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13199 auto saved_ctx = ctx();
13200 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13201 auto res = isl_map_range_factor_range(copy());
13202 if (!res)
13203 exception::throw_last_error(saved_ctx);
13204 return manage(res);
13207 isl::fixed_box map::range_lattice_tile() const
13209 if (!ptr)
13210 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13211 auto saved_ctx = ctx();
13212 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13213 auto res = isl_map_get_range_lattice_tile(get());
13214 if (!res)
13215 exception::throw_last_error(saved_ctx);
13216 return manage(res);
13219 isl::fixed_box map::get_range_lattice_tile() const
13221 return range_lattice_tile();
13224 isl::union_map map::range_map() const
13226 if (!ptr)
13227 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13228 return isl::union_map(*this).range_map();
13231 isl::map map::range_product(isl::map map2) const
13233 if (!ptr || map2.is_null())
13234 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13235 auto saved_ctx = ctx();
13236 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13237 auto res = isl_map_range_product(copy(), map2.release());
13238 if (!res)
13239 exception::throw_last_error(saved_ctx);
13240 return manage(res);
13243 isl::union_map map::range_product(const isl::union_map &umap2) const
13245 if (!ptr)
13246 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13247 return isl::union_map(*this).range_product(umap2);
13250 isl::map map::range_product(const isl::basic_map &map2) const
13252 if (!ptr)
13253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13254 return this->range_product(isl::map(map2));
13257 isl::map map::range_reverse() const
13259 if (!ptr)
13260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13261 auto saved_ctx = ctx();
13262 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13263 auto res = isl_map_range_reverse(copy());
13264 if (!res)
13265 exception::throw_last_error(saved_ctx);
13266 return manage(res);
13269 isl::fixed_box map::range_simple_fixed_box_hull() const
13271 if (!ptr)
13272 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13273 auto saved_ctx = ctx();
13274 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13275 auto res = isl_map_get_range_simple_fixed_box_hull(get());
13276 if (!res)
13277 exception::throw_last_error(saved_ctx);
13278 return manage(res);
13281 isl::fixed_box map::get_range_simple_fixed_box_hull() const
13283 return range_simple_fixed_box_hull();
13286 unsigned map::range_tuple_dim() const
13288 if (!ptr)
13289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13290 auto saved_ctx = ctx();
13291 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13292 auto res = isl_map_range_tuple_dim(get());
13293 if (res < 0)
13294 exception::throw_last_error(saved_ctx);
13295 return res;
13298 isl::id map::range_tuple_id() const
13300 if (!ptr)
13301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13302 auto saved_ctx = ctx();
13303 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13304 auto res = isl_map_get_range_tuple_id(get());
13305 if (!res)
13306 exception::throw_last_error(saved_ctx);
13307 return manage(res);
13310 isl::id map::get_range_tuple_id() const
13312 return range_tuple_id();
13315 isl::map map::reverse() const
13317 if (!ptr)
13318 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13319 auto saved_ctx = ctx();
13320 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13321 auto res = isl_map_reverse(copy());
13322 if (!res)
13323 exception::throw_last_error(saved_ctx);
13324 return manage(res);
13327 isl::basic_map map::sample() const
13329 if (!ptr)
13330 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13331 auto saved_ctx = ctx();
13332 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13333 auto res = isl_map_sample(copy());
13334 if (!res)
13335 exception::throw_last_error(saved_ctx);
13336 return manage(res);
13339 isl::map map::set_domain_tuple(isl::id id) const
13341 if (!ptr || id.is_null())
13342 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13343 auto saved_ctx = ctx();
13344 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13345 auto res = isl_map_set_domain_tuple_id(copy(), id.release());
13346 if (!res)
13347 exception::throw_last_error(saved_ctx);
13348 return manage(res);
13351 isl::map map::set_domain_tuple(const std::string &id) const
13353 if (!ptr)
13354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13355 return this->set_domain_tuple(isl::id(ctx(), id));
13358 isl::map map::set_range_tuple(isl::id id) const
13360 if (!ptr || id.is_null())
13361 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13362 auto saved_ctx = ctx();
13363 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13364 auto res = isl_map_set_range_tuple_id(copy(), id.release());
13365 if (!res)
13366 exception::throw_last_error(saved_ctx);
13367 return manage(res);
13370 isl::map map::set_range_tuple(const std::string &id) const
13372 if (!ptr)
13373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13374 return this->set_range_tuple(isl::id(ctx(), id));
13377 isl::space map::space() const
13379 if (!ptr)
13380 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13381 auto saved_ctx = ctx();
13382 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13383 auto res = isl_map_get_space(get());
13384 if (!res)
13385 exception::throw_last_error(saved_ctx);
13386 return manage(res);
13389 isl::space map::get_space() const
13391 return space();
13394 isl::map map::subtract(isl::map map2) const
13396 if (!ptr || map2.is_null())
13397 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13398 auto saved_ctx = ctx();
13399 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13400 auto res = isl_map_subtract(copy(), map2.release());
13401 if (!res)
13402 exception::throw_last_error(saved_ctx);
13403 return manage(res);
13406 isl::union_map map::subtract(const isl::union_map &umap2) const
13408 if (!ptr)
13409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13410 return isl::union_map(*this).subtract(umap2);
13413 isl::map map::subtract(const isl::basic_map &map2) const
13415 if (!ptr)
13416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13417 return this->subtract(isl::map(map2));
13420 isl::union_map map::subtract_domain(const isl::union_set &dom) const
13422 if (!ptr)
13423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13424 return isl::union_map(*this).subtract_domain(dom);
13427 isl::union_map map::subtract_range(const isl::union_set &dom) const
13429 if (!ptr)
13430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13431 return isl::union_map(*this).subtract_range(dom);
13434 isl::map_list map::to_list() const
13436 if (!ptr)
13437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13438 auto saved_ctx = ctx();
13439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13440 auto res = isl_map_to_list(copy());
13441 if (!res)
13442 exception::throw_last_error(saved_ctx);
13443 return manage(res);
13446 isl::union_map map::to_union_map() const
13448 if (!ptr)
13449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13450 auto saved_ctx = ctx();
13451 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13452 auto res = isl_map_to_union_map(copy());
13453 if (!res)
13454 exception::throw_last_error(saved_ctx);
13455 return manage(res);
13458 isl::map map::uncurry() const
13460 if (!ptr)
13461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13462 auto saved_ctx = ctx();
13463 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13464 auto res = isl_map_uncurry(copy());
13465 if (!res)
13466 exception::throw_last_error(saved_ctx);
13467 return manage(res);
13470 isl::map map::unite(isl::map map2) const
13472 if (!ptr || map2.is_null())
13473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13474 auto saved_ctx = ctx();
13475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13476 auto res = isl_map_union(copy(), map2.release());
13477 if (!res)
13478 exception::throw_last_error(saved_ctx);
13479 return manage(res);
13482 isl::union_map map::unite(const isl::union_map &umap2) const
13484 if (!ptr)
13485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13486 return isl::union_map(*this).unite(umap2);
13489 isl::map map::unite(const isl::basic_map &map2) const
13491 if (!ptr)
13492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13493 return this->unite(isl::map(map2));
13496 isl::map map::universe(isl::space space)
13498 if (space.is_null())
13499 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13500 auto saved_ctx = space.ctx();
13501 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13502 auto res = isl_map_universe(space.release());
13503 if (!res)
13504 exception::throw_last_error(saved_ctx);
13505 return manage(res);
13508 isl::basic_map map::unshifted_simple_hull() const
13510 if (!ptr)
13511 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13512 auto saved_ctx = ctx();
13513 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13514 auto res = isl_map_unshifted_simple_hull(copy());
13515 if (!res)
13516 exception::throw_last_error(saved_ctx);
13517 return manage(res);
13520 isl::map map::upper_bound(isl::multi_pw_aff upper) const
13522 if (!ptr || upper.is_null())
13523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13524 auto saved_ctx = ctx();
13525 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13526 auto res = isl_map_upper_bound_multi_pw_aff(copy(), upper.release());
13527 if (!res)
13528 exception::throw_last_error(saved_ctx);
13529 return manage(res);
13532 isl::set map::wrap() const
13534 if (!ptr)
13535 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13536 auto saved_ctx = ctx();
13537 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13538 auto res = isl_map_wrap(copy());
13539 if (!res)
13540 exception::throw_last_error(saved_ctx);
13541 return manage(res);
13544 isl::map map::zip() const
13546 if (!ptr)
13547 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13548 auto saved_ctx = ctx();
13549 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13550 auto res = isl_map_zip(copy());
13551 if (!res)
13552 exception::throw_last_error(saved_ctx);
13553 return manage(res);
13556 inline std::ostream &operator<<(std::ostream &os, const map &obj)
13558 if (!obj.get())
13559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13560 auto saved_ctx = isl_map_get_ctx(obj.get());
13561 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13562 char *str = isl_map_to_str(obj.get());
13563 if (!str)
13564 exception::throw_last_error(saved_ctx);
13565 os << str;
13566 free(str);
13567 return os;
13570 // implementations for isl::map_list
13571 map_list manage(__isl_take isl_map_list *ptr) {
13572 if (!ptr)
13573 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13574 return map_list(ptr);
13576 map_list manage_copy(__isl_keep isl_map_list *ptr) {
13577 if (!ptr)
13578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13579 auto saved_ctx = isl_map_list_get_ctx(ptr);
13580 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13581 ptr = isl_map_list_copy(ptr);
13582 if (!ptr)
13583 exception::throw_last_error(saved_ctx);
13584 return map_list(ptr);
13587 map_list::map_list(__isl_take isl_map_list *ptr)
13588 : ptr(ptr) {}
13590 map_list::map_list()
13591 : ptr(nullptr) {}
13593 map_list::map_list(const map_list &obj)
13594 : ptr(nullptr)
13596 if (!obj.ptr)
13597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13598 auto saved_ctx = isl_map_list_get_ctx(obj.ptr);
13599 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13600 ptr = obj.copy();
13601 if (!ptr)
13602 exception::throw_last_error(saved_ctx);
13605 map_list::map_list(isl::ctx ctx, int n)
13607 auto saved_ctx = ctx;
13608 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13609 auto res = isl_map_list_alloc(ctx.release(), n);
13610 if (!res)
13611 exception::throw_last_error(saved_ctx);
13612 ptr = res;
13615 map_list::map_list(isl::map el)
13617 if (el.is_null())
13618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13619 auto saved_ctx = el.ctx();
13620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13621 auto res = isl_map_list_from_map(el.release());
13622 if (!res)
13623 exception::throw_last_error(saved_ctx);
13624 ptr = res;
13627 map_list::map_list(isl::ctx ctx, const std::string &str)
13629 auto saved_ctx = ctx;
13630 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13631 auto res = isl_map_list_read_from_str(ctx.release(), str.c_str());
13632 if (!res)
13633 exception::throw_last_error(saved_ctx);
13634 ptr = res;
13637 map_list &map_list::operator=(map_list obj) {
13638 std::swap(this->ptr, obj.ptr);
13639 return *this;
13642 map_list::~map_list() {
13643 if (ptr)
13644 isl_map_list_free(ptr);
13647 __isl_give isl_map_list *map_list::copy() const & {
13648 return isl_map_list_copy(ptr);
13651 __isl_keep isl_map_list *map_list::get() const {
13652 return ptr;
13655 __isl_give isl_map_list *map_list::release() {
13656 isl_map_list *tmp = ptr;
13657 ptr = nullptr;
13658 return tmp;
13661 bool map_list::is_null() const {
13662 return ptr == nullptr;
13665 isl::ctx map_list::ctx() const {
13666 return isl::ctx(isl_map_list_get_ctx(ptr));
13669 isl::map_list map_list::add(isl::map el) const
13671 if (!ptr || el.is_null())
13672 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13673 auto saved_ctx = ctx();
13674 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13675 auto res = isl_map_list_add(copy(), el.release());
13676 if (!res)
13677 exception::throw_last_error(saved_ctx);
13678 return manage(res);
13681 isl::map map_list::at(int index) const
13683 if (!ptr)
13684 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13685 auto saved_ctx = ctx();
13686 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13687 auto res = isl_map_list_get_at(get(), index);
13688 if (!res)
13689 exception::throw_last_error(saved_ctx);
13690 return manage(res);
13693 isl::map map_list::get_at(int index) const
13695 return at(index);
13698 isl::map_list map_list::clear() const
13700 if (!ptr)
13701 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13702 auto saved_ctx = ctx();
13703 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13704 auto res = isl_map_list_clear(copy());
13705 if (!res)
13706 exception::throw_last_error(saved_ctx);
13707 return manage(res);
13710 isl::map_list map_list::concat(isl::map_list list2) const
13712 if (!ptr || list2.is_null())
13713 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13714 auto saved_ctx = ctx();
13715 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13716 auto res = isl_map_list_concat(copy(), list2.release());
13717 if (!res)
13718 exception::throw_last_error(saved_ctx);
13719 return manage(res);
13722 isl::map_list map_list::drop(unsigned int first, unsigned int n) const
13724 if (!ptr)
13725 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13726 auto saved_ctx = ctx();
13727 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13728 auto res = isl_map_list_drop(copy(), first, n);
13729 if (!res)
13730 exception::throw_last_error(saved_ctx);
13731 return manage(res);
13734 void map_list::foreach(const std::function<void(isl::map)> &fn) const
13736 if (!ptr)
13737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13738 auto saved_ctx = ctx();
13739 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13740 struct fn_data {
13741 std::function<void(isl::map)> func;
13742 std::exception_ptr eptr;
13743 } fn_data = { fn };
13744 auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
13745 auto *data = static_cast<struct fn_data *>(arg_1);
13746 ISL_CPP_TRY {
13747 (data->func)(manage(arg_0));
13748 return isl_stat_ok;
13749 } ISL_CPP_CATCH_ALL {
13750 data->eptr = std::current_exception();
13751 return isl_stat_error;
13754 auto res = isl_map_list_foreach(get(), fn_lambda, &fn_data);
13755 if (fn_data.eptr)
13756 std::rethrow_exception(fn_data.eptr);
13757 if (res < 0)
13758 exception::throw_last_error(saved_ctx);
13759 return;
13762 void map_list::foreach_scc(const std::function<bool(isl::map, isl::map)> &follows, const std::function<void(isl::map_list)> &fn) const
13764 if (!ptr)
13765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13766 auto saved_ctx = ctx();
13767 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13768 struct follows_data {
13769 std::function<bool(isl::map, isl::map)> func;
13770 std::exception_ptr eptr;
13771 } follows_data = { follows };
13772 auto follows_lambda = [](isl_map *arg_0, isl_map *arg_1, void *arg_2) -> isl_bool {
13773 auto *data = static_cast<struct follows_data *>(arg_2);
13774 ISL_CPP_TRY {
13775 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
13776 return ret ? isl_bool_true : isl_bool_false;
13777 } ISL_CPP_CATCH_ALL {
13778 data->eptr = std::current_exception();
13779 return isl_bool_error;
13782 struct fn_data {
13783 std::function<void(isl::map_list)> func;
13784 std::exception_ptr eptr;
13785 } fn_data = { fn };
13786 auto fn_lambda = [](isl_map_list *arg_0, void *arg_1) -> isl_stat {
13787 auto *data = static_cast<struct fn_data *>(arg_1);
13788 ISL_CPP_TRY {
13789 (data->func)(manage(arg_0));
13790 return isl_stat_ok;
13791 } ISL_CPP_CATCH_ALL {
13792 data->eptr = std::current_exception();
13793 return isl_stat_error;
13796 auto res = isl_map_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
13797 if (follows_data.eptr)
13798 std::rethrow_exception(follows_data.eptr);
13799 if (fn_data.eptr)
13800 std::rethrow_exception(fn_data.eptr);
13801 if (res < 0)
13802 exception::throw_last_error(saved_ctx);
13803 return;
13806 isl::map_list map_list::insert(unsigned int pos, isl::map el) const
13808 if (!ptr || el.is_null())
13809 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13810 auto saved_ctx = ctx();
13811 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13812 auto res = isl_map_list_insert(copy(), pos, el.release());
13813 if (!res)
13814 exception::throw_last_error(saved_ctx);
13815 return manage(res);
13818 isl::map_list map_list::set_at(int index, isl::map el) const
13820 if (!ptr || el.is_null())
13821 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13822 auto saved_ctx = ctx();
13823 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13824 auto res = isl_map_list_set_at(copy(), index, el.release());
13825 if (!res)
13826 exception::throw_last_error(saved_ctx);
13827 return manage(res);
13830 unsigned map_list::size() const
13832 if (!ptr)
13833 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13834 auto saved_ctx = ctx();
13835 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13836 auto res = isl_map_list_size(get());
13837 if (res < 0)
13838 exception::throw_last_error(saved_ctx);
13839 return res;
13842 inline std::ostream &operator<<(std::ostream &os, const map_list &obj)
13844 if (!obj.get())
13845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13846 auto saved_ctx = isl_map_list_get_ctx(obj.get());
13847 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13848 char *str = isl_map_list_to_str(obj.get());
13849 if (!str)
13850 exception::throw_last_error(saved_ctx);
13851 os << str;
13852 free(str);
13853 return os;
13856 // implementations for isl::multi_aff
13857 multi_aff manage(__isl_take isl_multi_aff *ptr) {
13858 if (!ptr)
13859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13860 return multi_aff(ptr);
13862 multi_aff manage_copy(__isl_keep isl_multi_aff *ptr) {
13863 if (!ptr)
13864 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13865 auto saved_ctx = isl_multi_aff_get_ctx(ptr);
13866 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13867 ptr = isl_multi_aff_copy(ptr);
13868 if (!ptr)
13869 exception::throw_last_error(saved_ctx);
13870 return multi_aff(ptr);
13873 multi_aff::multi_aff(__isl_take isl_multi_aff *ptr)
13874 : ptr(ptr) {}
13876 multi_aff::multi_aff()
13877 : ptr(nullptr) {}
13879 multi_aff::multi_aff(const multi_aff &obj)
13880 : ptr(nullptr)
13882 if (!obj.ptr)
13883 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13884 auto saved_ctx = isl_multi_aff_get_ctx(obj.ptr);
13885 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13886 ptr = obj.copy();
13887 if (!ptr)
13888 exception::throw_last_error(saved_ctx);
13891 multi_aff::multi_aff(isl::aff aff)
13893 if (aff.is_null())
13894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13895 auto saved_ctx = aff.ctx();
13896 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13897 auto res = isl_multi_aff_from_aff(aff.release());
13898 if (!res)
13899 exception::throw_last_error(saved_ctx);
13900 ptr = res;
13903 multi_aff::multi_aff(isl::space space, isl::aff_list list)
13905 if (space.is_null() || list.is_null())
13906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13907 auto saved_ctx = space.ctx();
13908 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13909 auto res = isl_multi_aff_from_aff_list(space.release(), list.release());
13910 if (!res)
13911 exception::throw_last_error(saved_ctx);
13912 ptr = res;
13915 multi_aff::multi_aff(isl::ctx ctx, const std::string &str)
13917 auto saved_ctx = ctx;
13918 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13919 auto res = isl_multi_aff_read_from_str(ctx.release(), str.c_str());
13920 if (!res)
13921 exception::throw_last_error(saved_ctx);
13922 ptr = res;
13925 multi_aff &multi_aff::operator=(multi_aff obj) {
13926 std::swap(this->ptr, obj.ptr);
13927 return *this;
13930 multi_aff::~multi_aff() {
13931 if (ptr)
13932 isl_multi_aff_free(ptr);
13935 __isl_give isl_multi_aff *multi_aff::copy() const & {
13936 return isl_multi_aff_copy(ptr);
13939 __isl_keep isl_multi_aff *multi_aff::get() const {
13940 return ptr;
13943 __isl_give isl_multi_aff *multi_aff::release() {
13944 isl_multi_aff *tmp = ptr;
13945 ptr = nullptr;
13946 return tmp;
13949 bool multi_aff::is_null() const {
13950 return ptr == nullptr;
13953 isl::ctx multi_aff::ctx() const {
13954 return isl::ctx(isl_multi_aff_get_ctx(ptr));
13957 isl::multi_aff multi_aff::add(isl::multi_aff multi2) const
13959 if (!ptr || multi2.is_null())
13960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13961 auto saved_ctx = ctx();
13962 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
13963 auto res = isl_multi_aff_add(copy(), multi2.release());
13964 if (!res)
13965 exception::throw_last_error(saved_ctx);
13966 return manage(res);
13969 isl::multi_pw_aff multi_aff::add(const isl::multi_pw_aff &multi2) const
13971 if (!ptr)
13972 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13973 return isl::pw_multi_aff(*this).add(multi2);
13976 isl::multi_union_pw_aff multi_aff::add(const isl::multi_union_pw_aff &multi2) const
13978 if (!ptr)
13979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13980 return isl::pw_multi_aff(*this).add(multi2);
13983 isl::pw_multi_aff multi_aff::add(const isl::pw_multi_aff &pma2) const
13985 if (!ptr)
13986 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13987 return isl::pw_multi_aff(*this).add(pma2);
13990 isl::union_pw_multi_aff multi_aff::add(const isl::union_pw_multi_aff &upma2) const
13992 if (!ptr)
13993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
13994 return isl::pw_multi_aff(*this).add(upma2);
13997 isl::multi_aff multi_aff::add(const isl::aff &multi2) const
13999 if (!ptr)
14000 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14001 return this->add(isl::multi_aff(multi2));
14004 isl::multi_aff multi_aff::add_constant(isl::multi_val mv) const
14006 if (!ptr || mv.is_null())
14007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14008 auto saved_ctx = ctx();
14009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14010 auto res = isl_multi_aff_add_constant_multi_val(copy(), mv.release());
14011 if (!res)
14012 exception::throw_last_error(saved_ctx);
14013 return manage(res);
14016 isl::multi_aff multi_aff::add_constant(isl::val v) const
14018 if (!ptr || v.is_null())
14019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14020 auto saved_ctx = ctx();
14021 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14022 auto res = isl_multi_aff_add_constant_val(copy(), v.release());
14023 if (!res)
14024 exception::throw_last_error(saved_ctx);
14025 return manage(res);
14028 isl::multi_aff multi_aff::add_constant(long v) const
14030 if (!ptr)
14031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14032 return this->add_constant(isl::val(ctx(), v));
14035 isl::union_pw_multi_aff multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
14037 if (!ptr)
14038 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14039 return isl::pw_multi_aff(*this).apply(upma2);
14042 isl::map multi_aff::as_map() const
14044 if (!ptr)
14045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14046 auto saved_ctx = ctx();
14047 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14048 auto res = isl_multi_aff_as_map(copy());
14049 if (!res)
14050 exception::throw_last_error(saved_ctx);
14051 return manage(res);
14054 isl::multi_aff multi_aff::as_multi_aff() const
14056 if (!ptr)
14057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14058 return isl::pw_multi_aff(*this).as_multi_aff();
14061 isl::multi_union_pw_aff multi_aff::as_multi_union_pw_aff() const
14063 if (!ptr)
14064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14065 return isl::pw_multi_aff(*this).as_multi_union_pw_aff();
14068 isl::pw_multi_aff multi_aff::as_pw_multi_aff() const
14070 if (!ptr)
14071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14072 return isl::pw_multi_aff(*this).as_pw_multi_aff();
14075 isl::set multi_aff::as_set() const
14077 if (!ptr)
14078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14079 auto saved_ctx = ctx();
14080 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14081 auto res = isl_multi_aff_as_set(copy());
14082 if (!res)
14083 exception::throw_last_error(saved_ctx);
14084 return manage(res);
14087 isl::union_map multi_aff::as_union_map() const
14089 if (!ptr)
14090 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14091 return isl::pw_multi_aff(*this).as_union_map();
14094 isl::aff multi_aff::at(int pos) const
14096 if (!ptr)
14097 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14098 auto saved_ctx = ctx();
14099 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14100 auto res = isl_multi_aff_get_at(get(), pos);
14101 if (!res)
14102 exception::throw_last_error(saved_ctx);
14103 return manage(res);
14106 isl::aff multi_aff::get_at(int pos) const
14108 return at(pos);
14111 isl::basic_set multi_aff::bind(isl::multi_id tuple) const
14113 if (!ptr || tuple.is_null())
14114 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14115 auto saved_ctx = ctx();
14116 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14117 auto res = isl_multi_aff_bind(copy(), tuple.release());
14118 if (!res)
14119 exception::throw_last_error(saved_ctx);
14120 return manage(res);
14123 isl::multi_aff multi_aff::bind_domain(isl::multi_id tuple) const
14125 if (!ptr || tuple.is_null())
14126 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14127 auto saved_ctx = ctx();
14128 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14129 auto res = isl_multi_aff_bind_domain(copy(), tuple.release());
14130 if (!res)
14131 exception::throw_last_error(saved_ctx);
14132 return manage(res);
14135 isl::multi_aff multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
14137 if (!ptr || tuple.is_null())
14138 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14139 auto saved_ctx = ctx();
14140 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14141 auto res = isl_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
14142 if (!res)
14143 exception::throw_last_error(saved_ctx);
14144 return manage(res);
14147 isl::pw_multi_aff multi_aff::coalesce() const
14149 if (!ptr)
14150 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14151 return isl::pw_multi_aff(*this).coalesce();
14154 isl::multi_val multi_aff::constant_multi_val() const
14156 if (!ptr)
14157 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14158 auto saved_ctx = ctx();
14159 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14160 auto res = isl_multi_aff_get_constant_multi_val(get());
14161 if (!res)
14162 exception::throw_last_error(saved_ctx);
14163 return manage(res);
14166 isl::multi_val multi_aff::get_constant_multi_val() const
14168 return constant_multi_val();
14171 isl::set multi_aff::domain() const
14173 if (!ptr)
14174 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14175 return isl::pw_multi_aff(*this).domain();
14178 isl::multi_aff multi_aff::domain_map(isl::space space)
14180 if (space.is_null())
14181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14182 auto saved_ctx = space.ctx();
14183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14184 auto res = isl_multi_aff_domain_map(space.release());
14185 if (!res)
14186 exception::throw_last_error(saved_ctx);
14187 return manage(res);
14190 isl::multi_aff multi_aff::domain_reverse() const
14192 if (!ptr)
14193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14194 auto saved_ctx = ctx();
14195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14196 auto res = isl_multi_aff_domain_reverse(copy());
14197 if (!res)
14198 exception::throw_last_error(saved_ctx);
14199 return manage(res);
14202 isl::pw_multi_aff multi_aff::drop_unused_params() const
14204 if (!ptr)
14205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14206 return isl::pw_multi_aff(*this).drop_unused_params();
14209 isl::pw_multi_aff multi_aff::extract_pw_multi_aff(const isl::space &space) const
14211 if (!ptr)
14212 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14213 return isl::pw_multi_aff(*this).extract_pw_multi_aff(space);
14216 isl::multi_aff multi_aff::flat_range_product(isl::multi_aff multi2) const
14218 if (!ptr || multi2.is_null())
14219 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14220 auto saved_ctx = ctx();
14221 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14222 auto res = isl_multi_aff_flat_range_product(copy(), multi2.release());
14223 if (!res)
14224 exception::throw_last_error(saved_ctx);
14225 return manage(res);
14228 isl::multi_pw_aff multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
14230 if (!ptr)
14231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14232 return isl::pw_multi_aff(*this).flat_range_product(multi2);
14235 isl::multi_union_pw_aff multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
14237 if (!ptr)
14238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14239 return isl::pw_multi_aff(*this).flat_range_product(multi2);
14242 isl::pw_multi_aff multi_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
14244 if (!ptr)
14245 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14246 return isl::pw_multi_aff(*this).flat_range_product(pma2);
14249 isl::union_pw_multi_aff multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
14251 if (!ptr)
14252 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14253 return isl::pw_multi_aff(*this).flat_range_product(upma2);
14256 isl::multi_aff multi_aff::flat_range_product(const isl::aff &multi2) const
14258 if (!ptr)
14259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14260 return this->flat_range_product(isl::multi_aff(multi2));
14263 isl::multi_aff multi_aff::floor() const
14265 if (!ptr)
14266 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14267 auto saved_ctx = ctx();
14268 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14269 auto res = isl_multi_aff_floor(copy());
14270 if (!res)
14271 exception::throw_last_error(saved_ctx);
14272 return manage(res);
14275 void multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
14277 if (!ptr)
14278 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14279 return isl::pw_multi_aff(*this).foreach_piece(fn);
14282 isl::multi_aff multi_aff::gist(isl::set context) const
14284 if (!ptr || context.is_null())
14285 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14286 auto saved_ctx = ctx();
14287 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14288 auto res = isl_multi_aff_gist(copy(), context.release());
14289 if (!res)
14290 exception::throw_last_error(saved_ctx);
14291 return manage(res);
14294 isl::union_pw_multi_aff multi_aff::gist(const isl::union_set &context) const
14296 if (!ptr)
14297 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14298 return isl::pw_multi_aff(*this).gist(context);
14301 isl::multi_aff multi_aff::gist(const isl::basic_set &context) const
14303 if (!ptr)
14304 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14305 return this->gist(isl::set(context));
14308 isl::multi_aff multi_aff::gist(const isl::point &context) const
14310 if (!ptr)
14311 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14312 return this->gist(isl::set(context));
14315 isl::multi_aff multi_aff::gist_params(isl::set context) const
14317 if (!ptr || context.is_null())
14318 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14319 auto saved_ctx = ctx();
14320 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14321 auto res = isl_multi_aff_gist_params(copy(), context.release());
14322 if (!res)
14323 exception::throw_last_error(saved_ctx);
14324 return manage(res);
14327 bool multi_aff::has_range_tuple_id() const
14329 if (!ptr)
14330 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14331 auto saved_ctx = ctx();
14332 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14333 auto res = isl_multi_aff_has_range_tuple_id(get());
14334 if (res < 0)
14335 exception::throw_last_error(saved_ctx);
14336 return res;
14339 isl::multi_aff multi_aff::identity() const
14341 if (!ptr)
14342 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14343 auto saved_ctx = ctx();
14344 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14345 auto res = isl_multi_aff_identity_multi_aff(copy());
14346 if (!res)
14347 exception::throw_last_error(saved_ctx);
14348 return manage(res);
14351 isl::multi_aff multi_aff::identity_on_domain(isl::space space)
14353 if (space.is_null())
14354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14355 auto saved_ctx = space.ctx();
14356 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14357 auto res = isl_multi_aff_identity_on_domain_space(space.release());
14358 if (!res)
14359 exception::throw_last_error(saved_ctx);
14360 return manage(res);
14363 isl::multi_aff multi_aff::insert_domain(isl::space domain) const
14365 if (!ptr || domain.is_null())
14366 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14367 auto saved_ctx = ctx();
14368 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14369 auto res = isl_multi_aff_insert_domain(copy(), domain.release());
14370 if (!res)
14371 exception::throw_last_error(saved_ctx);
14372 return manage(res);
14375 isl::pw_multi_aff multi_aff::intersect_domain(const isl::set &set) const
14377 if (!ptr)
14378 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14379 return isl::pw_multi_aff(*this).intersect_domain(set);
14382 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::space &space) const
14384 if (!ptr)
14385 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14386 return isl::pw_multi_aff(*this).intersect_domain(space);
14389 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::union_set &uset) const
14391 if (!ptr)
14392 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14393 return isl::pw_multi_aff(*this).intersect_domain(uset);
14396 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
14398 if (!ptr)
14399 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14400 return isl::pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
14403 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
14405 if (!ptr)
14406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14407 return isl::pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
14410 isl::pw_multi_aff multi_aff::intersect_params(const isl::set &set) const
14412 if (!ptr)
14413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14414 return isl::pw_multi_aff(*this).intersect_params(set);
14417 bool multi_aff::involves_locals() const
14419 if (!ptr)
14420 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14421 auto saved_ctx = ctx();
14422 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14423 auto res = isl_multi_aff_involves_locals(get());
14424 if (res < 0)
14425 exception::throw_last_error(saved_ctx);
14426 return res;
14429 bool multi_aff::involves_nan() const
14431 if (!ptr)
14432 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14433 auto saved_ctx = ctx();
14434 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14435 auto res = isl_multi_aff_involves_nan(get());
14436 if (res < 0)
14437 exception::throw_last_error(saved_ctx);
14438 return res;
14441 bool multi_aff::involves_param(const isl::id &id) const
14443 if (!ptr)
14444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14445 return isl::pw_multi_aff(*this).involves_param(id);
14448 bool multi_aff::involves_param(const std::string &id) const
14450 if (!ptr)
14451 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14452 return this->involves_param(isl::id(ctx(), id));
14455 bool multi_aff::involves_param(const isl::id_list &list) const
14457 if (!ptr)
14458 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14459 return isl::pw_multi_aff(*this).involves_param(list);
14462 bool multi_aff::isa_multi_aff() const
14464 if (!ptr)
14465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14466 return isl::pw_multi_aff(*this).isa_multi_aff();
14469 bool multi_aff::isa_pw_multi_aff() const
14471 if (!ptr)
14472 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14473 return isl::pw_multi_aff(*this).isa_pw_multi_aff();
14476 isl::aff_list multi_aff::list() const
14478 if (!ptr)
14479 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14480 auto saved_ctx = ctx();
14481 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14482 auto res = isl_multi_aff_get_list(get());
14483 if (!res)
14484 exception::throw_last_error(saved_ctx);
14485 return manage(res);
14488 isl::aff_list multi_aff::get_list() const
14490 return list();
14493 isl::multi_pw_aff multi_aff::max(const isl::multi_pw_aff &multi2) const
14495 if (!ptr)
14496 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14497 return isl::pw_multi_aff(*this).max(multi2);
14500 isl::multi_val multi_aff::max_multi_val() const
14502 if (!ptr)
14503 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14504 return isl::pw_multi_aff(*this).max_multi_val();
14507 isl::multi_pw_aff multi_aff::min(const isl::multi_pw_aff &multi2) const
14509 if (!ptr)
14510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14511 return isl::pw_multi_aff(*this).min(multi2);
14514 isl::multi_val multi_aff::min_multi_val() const
14516 if (!ptr)
14517 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14518 return isl::pw_multi_aff(*this).min_multi_val();
14521 isl::multi_aff multi_aff::multi_val_on_domain(isl::space space, isl::multi_val mv)
14523 if (space.is_null() || mv.is_null())
14524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14525 auto saved_ctx = space.ctx();
14526 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14527 auto res = isl_multi_aff_multi_val_on_domain_space(space.release(), mv.release());
14528 if (!res)
14529 exception::throw_last_error(saved_ctx);
14530 return manage(res);
14533 unsigned multi_aff::n_piece() const
14535 if (!ptr)
14536 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14537 return isl::pw_multi_aff(*this).n_piece();
14540 isl::multi_aff multi_aff::neg() const
14542 if (!ptr)
14543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14544 auto saved_ctx = ctx();
14545 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14546 auto res = isl_multi_aff_neg(copy());
14547 if (!res)
14548 exception::throw_last_error(saved_ctx);
14549 return manage(res);
14552 bool multi_aff::plain_is_empty() const
14554 if (!ptr)
14555 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14556 return isl::pw_multi_aff(*this).plain_is_empty();
14559 bool multi_aff::plain_is_equal(const isl::multi_aff &multi2) const
14561 if (!ptr || multi2.is_null())
14562 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14563 auto saved_ctx = ctx();
14564 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14565 auto res = isl_multi_aff_plain_is_equal(get(), multi2.get());
14566 if (res < 0)
14567 exception::throw_last_error(saved_ctx);
14568 return res;
14571 bool multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
14573 if (!ptr)
14574 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14575 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14578 bool multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
14580 if (!ptr)
14581 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14582 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14585 bool multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
14587 if (!ptr)
14588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14589 return isl::pw_multi_aff(*this).plain_is_equal(pma2);
14592 bool multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
14594 if (!ptr)
14595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14596 return isl::pw_multi_aff(*this).plain_is_equal(upma2);
14599 bool multi_aff::plain_is_equal(const isl::aff &multi2) const
14601 if (!ptr)
14602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14603 return this->plain_is_equal(isl::multi_aff(multi2));
14606 isl::pw_multi_aff multi_aff::preimage_domain_wrapped_domain(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).preimage_domain_wrapped_domain(pma2);
14613 isl::union_pw_multi_aff multi_aff::preimage_domain_wrapped_domain(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).preimage_domain_wrapped_domain(upma2);
14620 isl::multi_aff multi_aff::product(isl::multi_aff multi2) const
14622 if (!ptr || multi2.is_null())
14623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14624 auto saved_ctx = ctx();
14625 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14626 auto res = isl_multi_aff_product(copy(), multi2.release());
14627 if (!res)
14628 exception::throw_last_error(saved_ctx);
14629 return manage(res);
14632 isl::multi_pw_aff multi_aff::product(const isl::multi_pw_aff &multi2) const
14634 if (!ptr)
14635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14636 return isl::pw_multi_aff(*this).product(multi2);
14639 isl::pw_multi_aff multi_aff::product(const isl::pw_multi_aff &pma2) const
14641 if (!ptr)
14642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14643 return isl::pw_multi_aff(*this).product(pma2);
14646 isl::multi_aff multi_aff::product(const isl::aff &multi2) const
14648 if (!ptr)
14649 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14650 return this->product(isl::multi_aff(multi2));
14653 isl::multi_aff multi_aff::pullback(isl::multi_aff ma2) const
14655 if (!ptr || ma2.is_null())
14656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14657 auto saved_ctx = ctx();
14658 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14659 auto res = isl_multi_aff_pullback_multi_aff(copy(), ma2.release());
14660 if (!res)
14661 exception::throw_last_error(saved_ctx);
14662 return manage(res);
14665 isl::multi_pw_aff multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
14667 if (!ptr)
14668 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14669 return isl::pw_multi_aff(*this).pullback(mpa2);
14672 isl::pw_multi_aff multi_aff::pullback(const isl::pw_multi_aff &pma2) const
14674 if (!ptr)
14675 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14676 return isl::pw_multi_aff(*this).pullback(pma2);
14679 isl::union_pw_multi_aff multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
14681 if (!ptr)
14682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14683 return isl::pw_multi_aff(*this).pullback(upma2);
14686 isl::multi_aff multi_aff::pullback(const isl::aff &ma2) const
14688 if (!ptr)
14689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14690 return this->pullback(isl::multi_aff(ma2));
14693 isl::pw_multi_aff_list multi_aff::pw_multi_aff_list() const
14695 if (!ptr)
14696 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14697 return isl::pw_multi_aff(*this).pw_multi_aff_list();
14700 isl::pw_multi_aff multi_aff::range_factor_domain() const
14702 if (!ptr)
14703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14704 return isl::pw_multi_aff(*this).range_factor_domain();
14707 isl::pw_multi_aff multi_aff::range_factor_range() const
14709 if (!ptr)
14710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14711 return isl::pw_multi_aff(*this).range_factor_range();
14714 isl::multi_aff multi_aff::range_map(isl::space space)
14716 if (space.is_null())
14717 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14718 auto saved_ctx = space.ctx();
14719 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14720 auto res = isl_multi_aff_range_map(space.release());
14721 if (!res)
14722 exception::throw_last_error(saved_ctx);
14723 return manage(res);
14726 isl::multi_aff multi_aff::range_product(isl::multi_aff multi2) const
14728 if (!ptr || multi2.is_null())
14729 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14730 auto saved_ctx = ctx();
14731 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14732 auto res = isl_multi_aff_range_product(copy(), multi2.release());
14733 if (!res)
14734 exception::throw_last_error(saved_ctx);
14735 return manage(res);
14738 isl::multi_pw_aff multi_aff::range_product(const isl::multi_pw_aff &multi2) const
14740 if (!ptr)
14741 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14742 return isl::pw_multi_aff(*this).range_product(multi2);
14745 isl::multi_union_pw_aff multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
14747 if (!ptr)
14748 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14749 return isl::pw_multi_aff(*this).range_product(multi2);
14752 isl::pw_multi_aff multi_aff::range_product(const isl::pw_multi_aff &pma2) const
14754 if (!ptr)
14755 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14756 return isl::pw_multi_aff(*this).range_product(pma2);
14759 isl::union_pw_multi_aff multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
14761 if (!ptr)
14762 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14763 return isl::pw_multi_aff(*this).range_product(upma2);
14766 isl::multi_aff multi_aff::range_product(const isl::aff &multi2) const
14768 if (!ptr)
14769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14770 return this->range_product(isl::multi_aff(multi2));
14773 isl::id multi_aff::range_tuple_id() const
14775 if (!ptr)
14776 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14777 auto saved_ctx = ctx();
14778 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14779 auto res = isl_multi_aff_get_range_tuple_id(get());
14780 if (!res)
14781 exception::throw_last_error(saved_ctx);
14782 return manage(res);
14785 isl::id multi_aff::get_range_tuple_id() const
14787 return range_tuple_id();
14790 isl::multi_aff multi_aff::reset_range_tuple_id() const
14792 if (!ptr)
14793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14794 auto saved_ctx = ctx();
14795 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14796 auto res = isl_multi_aff_reset_range_tuple_id(copy());
14797 if (!res)
14798 exception::throw_last_error(saved_ctx);
14799 return manage(res);
14802 isl::multi_aff multi_aff::scale(isl::multi_val mv) const
14804 if (!ptr || mv.is_null())
14805 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14806 auto saved_ctx = ctx();
14807 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14808 auto res = isl_multi_aff_scale_multi_val(copy(), mv.release());
14809 if (!res)
14810 exception::throw_last_error(saved_ctx);
14811 return manage(res);
14814 isl::multi_aff multi_aff::scale(isl::val v) const
14816 if (!ptr || v.is_null())
14817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14818 auto saved_ctx = ctx();
14819 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14820 auto res = isl_multi_aff_scale_val(copy(), v.release());
14821 if (!res)
14822 exception::throw_last_error(saved_ctx);
14823 return manage(res);
14826 isl::multi_aff multi_aff::scale(long v) const
14828 if (!ptr)
14829 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14830 return this->scale(isl::val(ctx(), v));
14833 isl::multi_aff multi_aff::scale_down(isl::multi_val mv) const
14835 if (!ptr || mv.is_null())
14836 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14837 auto saved_ctx = ctx();
14838 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14839 auto res = isl_multi_aff_scale_down_multi_val(copy(), mv.release());
14840 if (!res)
14841 exception::throw_last_error(saved_ctx);
14842 return manage(res);
14845 isl::multi_aff multi_aff::scale_down(isl::val v) const
14847 if (!ptr || v.is_null())
14848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14849 auto saved_ctx = ctx();
14850 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14851 auto res = isl_multi_aff_scale_down_val(copy(), v.release());
14852 if (!res)
14853 exception::throw_last_error(saved_ctx);
14854 return manage(res);
14857 isl::multi_aff multi_aff::scale_down(long v) const
14859 if (!ptr)
14860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14861 return this->scale_down(isl::val(ctx(), v));
14864 isl::multi_aff multi_aff::set_at(int pos, isl::aff el) const
14866 if (!ptr || el.is_null())
14867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14868 auto saved_ctx = ctx();
14869 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14870 auto res = isl_multi_aff_set_at(copy(), pos, el.release());
14871 if (!res)
14872 exception::throw_last_error(saved_ctx);
14873 return manage(res);
14876 isl::multi_pw_aff multi_aff::set_at(int pos, const isl::pw_aff &el) const
14878 if (!ptr)
14879 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14880 return isl::pw_multi_aff(*this).set_at(pos, el);
14883 isl::multi_union_pw_aff multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
14885 if (!ptr)
14886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14887 return isl::pw_multi_aff(*this).set_at(pos, el);
14890 isl::multi_aff multi_aff::set_range_tuple(isl::id id) const
14892 if (!ptr || id.is_null())
14893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14894 auto saved_ctx = ctx();
14895 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14896 auto res = isl_multi_aff_set_range_tuple_id(copy(), id.release());
14897 if (!res)
14898 exception::throw_last_error(saved_ctx);
14899 return manage(res);
14902 isl::multi_aff multi_aff::set_range_tuple(const std::string &id) const
14904 if (!ptr)
14905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14906 return this->set_range_tuple(isl::id(ctx(), id));
14909 unsigned multi_aff::size() const
14911 if (!ptr)
14912 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14913 auto saved_ctx = ctx();
14914 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14915 auto res = isl_multi_aff_size(get());
14916 if (res < 0)
14917 exception::throw_last_error(saved_ctx);
14918 return res;
14921 isl::space multi_aff::space() const
14923 if (!ptr)
14924 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14925 auto saved_ctx = ctx();
14926 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14927 auto res = isl_multi_aff_get_space(get());
14928 if (!res)
14929 exception::throw_last_error(saved_ctx);
14930 return manage(res);
14933 isl::space multi_aff::get_space() const
14935 return space();
14938 isl::multi_aff multi_aff::sub(isl::multi_aff multi2) const
14940 if (!ptr || multi2.is_null())
14941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14942 auto saved_ctx = ctx();
14943 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
14944 auto res = isl_multi_aff_sub(copy(), multi2.release());
14945 if (!res)
14946 exception::throw_last_error(saved_ctx);
14947 return manage(res);
14950 isl::multi_pw_aff multi_aff::sub(const isl::multi_pw_aff &multi2) const
14952 if (!ptr)
14953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14954 return isl::pw_multi_aff(*this).sub(multi2);
14957 isl::multi_union_pw_aff multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
14959 if (!ptr)
14960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14961 return isl::pw_multi_aff(*this).sub(multi2);
14964 isl::pw_multi_aff multi_aff::sub(const isl::pw_multi_aff &pma2) const
14966 if (!ptr)
14967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14968 return isl::pw_multi_aff(*this).sub(pma2);
14971 isl::union_pw_multi_aff multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
14973 if (!ptr)
14974 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14975 return isl::pw_multi_aff(*this).sub(upma2);
14978 isl::multi_aff multi_aff::sub(const isl::aff &multi2) const
14980 if (!ptr)
14981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14982 return this->sub(isl::multi_aff(multi2));
14985 isl::pw_multi_aff multi_aff::subtract_domain(const isl::set &set) const
14987 if (!ptr)
14988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14989 return isl::pw_multi_aff(*this).subtract_domain(set);
14992 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::space &space) const
14994 if (!ptr)
14995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
14996 return isl::pw_multi_aff(*this).subtract_domain(space);
14999 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::union_set &uset) const
15001 if (!ptr)
15002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15003 return isl::pw_multi_aff(*this).subtract_domain(uset);
15006 isl::pw_multi_aff_list multi_aff::to_list() const
15008 if (!ptr)
15009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15010 return isl::pw_multi_aff(*this).to_list();
15013 isl::multi_pw_aff multi_aff::to_multi_pw_aff() const
15015 if (!ptr)
15016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15017 auto saved_ctx = ctx();
15018 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15019 auto res = isl_multi_aff_to_multi_pw_aff(copy());
15020 if (!res)
15021 exception::throw_last_error(saved_ctx);
15022 return manage(res);
15025 isl::multi_union_pw_aff multi_aff::to_multi_union_pw_aff() const
15027 if (!ptr)
15028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15029 auto saved_ctx = ctx();
15030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15031 auto res = isl_multi_aff_to_multi_union_pw_aff(copy());
15032 if (!res)
15033 exception::throw_last_error(saved_ctx);
15034 return manage(res);
15037 isl::pw_multi_aff multi_aff::to_pw_multi_aff() const
15039 if (!ptr)
15040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15041 auto saved_ctx = ctx();
15042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15043 auto res = isl_multi_aff_to_pw_multi_aff(copy());
15044 if (!res)
15045 exception::throw_last_error(saved_ctx);
15046 return manage(res);
15049 isl::union_pw_multi_aff multi_aff::to_union_pw_multi_aff() const
15051 if (!ptr)
15052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15053 return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
15056 isl::multi_aff multi_aff::unbind_params_insert_domain(isl::multi_id domain) const
15058 if (!ptr || domain.is_null())
15059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15060 auto saved_ctx = ctx();
15061 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15062 auto res = isl_multi_aff_unbind_params_insert_domain(copy(), domain.release());
15063 if (!res)
15064 exception::throw_last_error(saved_ctx);
15065 return manage(res);
15068 isl::multi_pw_aff multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
15070 if (!ptr)
15071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15072 return isl::pw_multi_aff(*this).union_add(mpa2);
15075 isl::multi_union_pw_aff multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
15077 if (!ptr)
15078 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15079 return isl::pw_multi_aff(*this).union_add(mupa2);
15082 isl::pw_multi_aff multi_aff::union_add(const isl::pw_multi_aff &pma2) const
15084 if (!ptr)
15085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15086 return isl::pw_multi_aff(*this).union_add(pma2);
15089 isl::union_pw_multi_aff multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
15091 if (!ptr)
15092 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15093 return isl::pw_multi_aff(*this).union_add(upma2);
15096 isl::multi_aff multi_aff::zero(isl::space space)
15098 if (space.is_null())
15099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15100 auto saved_ctx = space.ctx();
15101 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15102 auto res = isl_multi_aff_zero(space.release());
15103 if (!res)
15104 exception::throw_last_error(saved_ctx);
15105 return manage(res);
15108 inline std::ostream &operator<<(std::ostream &os, const multi_aff &obj)
15110 if (!obj.get())
15111 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15112 auto saved_ctx = isl_multi_aff_get_ctx(obj.get());
15113 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15114 char *str = isl_multi_aff_to_str(obj.get());
15115 if (!str)
15116 exception::throw_last_error(saved_ctx);
15117 os << str;
15118 free(str);
15119 return os;
15122 // implementations for isl::multi_id
15123 multi_id manage(__isl_take isl_multi_id *ptr) {
15124 if (!ptr)
15125 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15126 return multi_id(ptr);
15128 multi_id manage_copy(__isl_keep isl_multi_id *ptr) {
15129 if (!ptr)
15130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15131 auto saved_ctx = isl_multi_id_get_ctx(ptr);
15132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15133 ptr = isl_multi_id_copy(ptr);
15134 if (!ptr)
15135 exception::throw_last_error(saved_ctx);
15136 return multi_id(ptr);
15139 multi_id::multi_id(__isl_take isl_multi_id *ptr)
15140 : ptr(ptr) {}
15142 multi_id::multi_id()
15143 : ptr(nullptr) {}
15145 multi_id::multi_id(const multi_id &obj)
15146 : ptr(nullptr)
15148 if (!obj.ptr)
15149 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15150 auto saved_ctx = isl_multi_id_get_ctx(obj.ptr);
15151 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15152 ptr = obj.copy();
15153 if (!ptr)
15154 exception::throw_last_error(saved_ctx);
15157 multi_id::multi_id(isl::space space, isl::id_list list)
15159 if (space.is_null() || list.is_null())
15160 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15161 auto saved_ctx = space.ctx();
15162 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15163 auto res = isl_multi_id_from_id_list(space.release(), list.release());
15164 if (!res)
15165 exception::throw_last_error(saved_ctx);
15166 ptr = res;
15169 multi_id::multi_id(isl::ctx ctx, const std::string &str)
15171 auto saved_ctx = ctx;
15172 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15173 auto res = isl_multi_id_read_from_str(ctx.release(), str.c_str());
15174 if (!res)
15175 exception::throw_last_error(saved_ctx);
15176 ptr = res;
15179 multi_id &multi_id::operator=(multi_id obj) {
15180 std::swap(this->ptr, obj.ptr);
15181 return *this;
15184 multi_id::~multi_id() {
15185 if (ptr)
15186 isl_multi_id_free(ptr);
15189 __isl_give isl_multi_id *multi_id::copy() const & {
15190 return isl_multi_id_copy(ptr);
15193 __isl_keep isl_multi_id *multi_id::get() const {
15194 return ptr;
15197 __isl_give isl_multi_id *multi_id::release() {
15198 isl_multi_id *tmp = ptr;
15199 ptr = nullptr;
15200 return tmp;
15203 bool multi_id::is_null() const {
15204 return ptr == nullptr;
15207 isl::ctx multi_id::ctx() const {
15208 return isl::ctx(isl_multi_id_get_ctx(ptr));
15211 isl::id multi_id::at(int pos) const
15213 if (!ptr)
15214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15215 auto saved_ctx = ctx();
15216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15217 auto res = isl_multi_id_get_at(get(), pos);
15218 if (!res)
15219 exception::throw_last_error(saved_ctx);
15220 return manage(res);
15223 isl::id multi_id::get_at(int pos) const
15225 return at(pos);
15228 isl::multi_id multi_id::flat_range_product(isl::multi_id multi2) const
15230 if (!ptr || multi2.is_null())
15231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15232 auto saved_ctx = ctx();
15233 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15234 auto res = isl_multi_id_flat_range_product(copy(), multi2.release());
15235 if (!res)
15236 exception::throw_last_error(saved_ctx);
15237 return manage(res);
15240 isl::id_list multi_id::list() const
15242 if (!ptr)
15243 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15244 auto saved_ctx = ctx();
15245 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15246 auto res = isl_multi_id_get_list(get());
15247 if (!res)
15248 exception::throw_last_error(saved_ctx);
15249 return manage(res);
15252 isl::id_list multi_id::get_list() const
15254 return list();
15257 bool multi_id::plain_is_equal(const isl::multi_id &multi2) const
15259 if (!ptr || multi2.is_null())
15260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15261 auto saved_ctx = ctx();
15262 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15263 auto res = isl_multi_id_plain_is_equal(get(), multi2.get());
15264 if (res < 0)
15265 exception::throw_last_error(saved_ctx);
15266 return res;
15269 isl::multi_id multi_id::range_product(isl::multi_id multi2) const
15271 if (!ptr || multi2.is_null())
15272 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15273 auto saved_ctx = ctx();
15274 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15275 auto res = isl_multi_id_range_product(copy(), multi2.release());
15276 if (!res)
15277 exception::throw_last_error(saved_ctx);
15278 return manage(res);
15281 isl::multi_id multi_id::set_at(int pos, isl::id el) const
15283 if (!ptr || el.is_null())
15284 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15285 auto saved_ctx = ctx();
15286 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15287 auto res = isl_multi_id_set_at(copy(), pos, el.release());
15288 if (!res)
15289 exception::throw_last_error(saved_ctx);
15290 return manage(res);
15293 isl::multi_id multi_id::set_at(int pos, const std::string &el) const
15295 if (!ptr)
15296 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15297 return this->set_at(pos, isl::id(ctx(), el));
15300 unsigned multi_id::size() const
15302 if (!ptr)
15303 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15304 auto saved_ctx = ctx();
15305 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15306 auto res = isl_multi_id_size(get());
15307 if (res < 0)
15308 exception::throw_last_error(saved_ctx);
15309 return res;
15312 isl::space multi_id::space() const
15314 if (!ptr)
15315 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15316 auto saved_ctx = ctx();
15317 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15318 auto res = isl_multi_id_get_space(get());
15319 if (!res)
15320 exception::throw_last_error(saved_ctx);
15321 return manage(res);
15324 isl::space multi_id::get_space() const
15326 return space();
15329 inline std::ostream &operator<<(std::ostream &os, const multi_id &obj)
15331 if (!obj.get())
15332 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15333 auto saved_ctx = isl_multi_id_get_ctx(obj.get());
15334 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15335 char *str = isl_multi_id_to_str(obj.get());
15336 if (!str)
15337 exception::throw_last_error(saved_ctx);
15338 os << str;
15339 free(str);
15340 return os;
15343 // implementations for isl::multi_pw_aff
15344 multi_pw_aff manage(__isl_take isl_multi_pw_aff *ptr) {
15345 if (!ptr)
15346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15347 return multi_pw_aff(ptr);
15349 multi_pw_aff manage_copy(__isl_keep isl_multi_pw_aff *ptr) {
15350 if (!ptr)
15351 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15352 auto saved_ctx = isl_multi_pw_aff_get_ctx(ptr);
15353 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15354 ptr = isl_multi_pw_aff_copy(ptr);
15355 if (!ptr)
15356 exception::throw_last_error(saved_ctx);
15357 return multi_pw_aff(ptr);
15360 multi_pw_aff::multi_pw_aff(__isl_take isl_multi_pw_aff *ptr)
15361 : ptr(ptr) {}
15363 multi_pw_aff::multi_pw_aff()
15364 : ptr(nullptr) {}
15366 multi_pw_aff::multi_pw_aff(const multi_pw_aff &obj)
15367 : ptr(nullptr)
15369 if (!obj.ptr)
15370 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15371 auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.ptr);
15372 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15373 ptr = obj.copy();
15374 if (!ptr)
15375 exception::throw_last_error(saved_ctx);
15378 multi_pw_aff::multi_pw_aff(isl::aff aff)
15380 if (aff.is_null())
15381 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15382 auto saved_ctx = aff.ctx();
15383 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15384 auto res = isl_multi_pw_aff_from_aff(aff.release());
15385 if (!res)
15386 exception::throw_last_error(saved_ctx);
15387 ptr = res;
15390 multi_pw_aff::multi_pw_aff(isl::multi_aff ma)
15392 if (ma.is_null())
15393 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15394 auto saved_ctx = ma.ctx();
15395 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15396 auto res = isl_multi_pw_aff_from_multi_aff(ma.release());
15397 if (!res)
15398 exception::throw_last_error(saved_ctx);
15399 ptr = res;
15402 multi_pw_aff::multi_pw_aff(isl::pw_aff pa)
15404 if (pa.is_null())
15405 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15406 auto saved_ctx = pa.ctx();
15407 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15408 auto res = isl_multi_pw_aff_from_pw_aff(pa.release());
15409 if (!res)
15410 exception::throw_last_error(saved_ctx);
15411 ptr = res;
15414 multi_pw_aff::multi_pw_aff(isl::space space, isl::pw_aff_list list)
15416 if (space.is_null() || list.is_null())
15417 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15418 auto saved_ctx = space.ctx();
15419 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15420 auto res = isl_multi_pw_aff_from_pw_aff_list(space.release(), list.release());
15421 if (!res)
15422 exception::throw_last_error(saved_ctx);
15423 ptr = res;
15426 multi_pw_aff::multi_pw_aff(isl::pw_multi_aff pma)
15428 if (pma.is_null())
15429 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15430 auto saved_ctx = pma.ctx();
15431 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15432 auto res = isl_multi_pw_aff_from_pw_multi_aff(pma.release());
15433 if (!res)
15434 exception::throw_last_error(saved_ctx);
15435 ptr = res;
15438 multi_pw_aff::multi_pw_aff(isl::ctx ctx, const std::string &str)
15440 auto saved_ctx = ctx;
15441 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15442 auto res = isl_multi_pw_aff_read_from_str(ctx.release(), str.c_str());
15443 if (!res)
15444 exception::throw_last_error(saved_ctx);
15445 ptr = res;
15448 multi_pw_aff &multi_pw_aff::operator=(multi_pw_aff obj) {
15449 std::swap(this->ptr, obj.ptr);
15450 return *this;
15453 multi_pw_aff::~multi_pw_aff() {
15454 if (ptr)
15455 isl_multi_pw_aff_free(ptr);
15458 __isl_give isl_multi_pw_aff *multi_pw_aff::copy() const & {
15459 return isl_multi_pw_aff_copy(ptr);
15462 __isl_keep isl_multi_pw_aff *multi_pw_aff::get() const {
15463 return ptr;
15466 __isl_give isl_multi_pw_aff *multi_pw_aff::release() {
15467 isl_multi_pw_aff *tmp = ptr;
15468 ptr = nullptr;
15469 return tmp;
15472 bool multi_pw_aff::is_null() const {
15473 return ptr == nullptr;
15476 isl::ctx multi_pw_aff::ctx() const {
15477 return isl::ctx(isl_multi_pw_aff_get_ctx(ptr));
15480 isl::multi_pw_aff multi_pw_aff::add(isl::multi_pw_aff multi2) const
15482 if (!ptr || multi2.is_null())
15483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15484 auto saved_ctx = ctx();
15485 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15486 auto res = isl_multi_pw_aff_add(copy(), multi2.release());
15487 if (!res)
15488 exception::throw_last_error(saved_ctx);
15489 return manage(res);
15492 isl::multi_union_pw_aff multi_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
15494 if (!ptr)
15495 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15496 return isl::multi_union_pw_aff(*this).add(multi2);
15499 isl::multi_pw_aff multi_pw_aff::add(const isl::aff &multi2) const
15501 if (!ptr)
15502 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15503 return this->add(isl::multi_pw_aff(multi2));
15506 isl::multi_pw_aff multi_pw_aff::add(const isl::multi_aff &multi2) const
15508 if (!ptr)
15509 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15510 return this->add(isl::multi_pw_aff(multi2));
15513 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_aff &multi2) const
15515 if (!ptr)
15516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15517 return this->add(isl::multi_pw_aff(multi2));
15520 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_multi_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_constant(isl::multi_val mv) const
15529 if (!ptr || mv.is_null())
15530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15531 auto saved_ctx = ctx();
15532 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15533 auto res = isl_multi_pw_aff_add_constant_multi_val(copy(), mv.release());
15534 if (!res)
15535 exception::throw_last_error(saved_ctx);
15536 return manage(res);
15539 isl::multi_pw_aff multi_pw_aff::add_constant(isl::val v) const
15541 if (!ptr || v.is_null())
15542 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15543 auto saved_ctx = ctx();
15544 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15545 auto res = isl_multi_pw_aff_add_constant_val(copy(), v.release());
15546 if (!res)
15547 exception::throw_last_error(saved_ctx);
15548 return manage(res);
15551 isl::multi_pw_aff multi_pw_aff::add_constant(long v) const
15553 if (!ptr)
15554 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15555 return this->add_constant(isl::val(ctx(), v));
15558 isl::map multi_pw_aff::as_map() const
15560 if (!ptr)
15561 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15562 auto saved_ctx = ctx();
15563 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15564 auto res = isl_multi_pw_aff_as_map(copy());
15565 if (!res)
15566 exception::throw_last_error(saved_ctx);
15567 return manage(res);
15570 isl::multi_aff multi_pw_aff::as_multi_aff() const
15572 if (!ptr)
15573 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15574 auto saved_ctx = ctx();
15575 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15576 auto res = isl_multi_pw_aff_as_multi_aff(copy());
15577 if (!res)
15578 exception::throw_last_error(saved_ctx);
15579 return manage(res);
15582 isl::set multi_pw_aff::as_set() const
15584 if (!ptr)
15585 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15586 auto saved_ctx = ctx();
15587 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15588 auto res = isl_multi_pw_aff_as_set(copy());
15589 if (!res)
15590 exception::throw_last_error(saved_ctx);
15591 return manage(res);
15594 isl::pw_aff multi_pw_aff::at(int pos) const
15596 if (!ptr)
15597 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15598 auto saved_ctx = ctx();
15599 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15600 auto res = isl_multi_pw_aff_get_at(get(), pos);
15601 if (!res)
15602 exception::throw_last_error(saved_ctx);
15603 return manage(res);
15606 isl::pw_aff multi_pw_aff::get_at(int pos) const
15608 return at(pos);
15611 isl::set multi_pw_aff::bind(isl::multi_id tuple) const
15613 if (!ptr || tuple.is_null())
15614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15615 auto saved_ctx = ctx();
15616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15617 auto res = isl_multi_pw_aff_bind(copy(), tuple.release());
15618 if (!res)
15619 exception::throw_last_error(saved_ctx);
15620 return manage(res);
15623 isl::multi_pw_aff multi_pw_aff::bind_domain(isl::multi_id tuple) const
15625 if (!ptr || tuple.is_null())
15626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15627 auto saved_ctx = ctx();
15628 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15629 auto res = isl_multi_pw_aff_bind_domain(copy(), tuple.release());
15630 if (!res)
15631 exception::throw_last_error(saved_ctx);
15632 return manage(res);
15635 isl::multi_pw_aff multi_pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
15637 if (!ptr || tuple.is_null())
15638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15639 auto saved_ctx = ctx();
15640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15641 auto res = isl_multi_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
15642 if (!res)
15643 exception::throw_last_error(saved_ctx);
15644 return manage(res);
15647 isl::multi_pw_aff multi_pw_aff::coalesce() const
15649 if (!ptr)
15650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15651 auto saved_ctx = ctx();
15652 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15653 auto res = isl_multi_pw_aff_coalesce(copy());
15654 if (!res)
15655 exception::throw_last_error(saved_ctx);
15656 return manage(res);
15659 isl::set multi_pw_aff::domain() const
15661 if (!ptr)
15662 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15663 auto saved_ctx = ctx();
15664 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15665 auto res = isl_multi_pw_aff_domain(copy());
15666 if (!res)
15667 exception::throw_last_error(saved_ctx);
15668 return manage(res);
15671 isl::multi_pw_aff multi_pw_aff::domain_reverse() const
15673 if (!ptr)
15674 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15675 auto saved_ctx = ctx();
15676 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15677 auto res = isl_multi_pw_aff_domain_reverse(copy());
15678 if (!res)
15679 exception::throw_last_error(saved_ctx);
15680 return manage(res);
15683 isl::multi_pw_aff multi_pw_aff::flat_range_product(isl::multi_pw_aff multi2) const
15685 if (!ptr || multi2.is_null())
15686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15687 auto saved_ctx = ctx();
15688 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15689 auto res = isl_multi_pw_aff_flat_range_product(copy(), multi2.release());
15690 if (!res)
15691 exception::throw_last_error(saved_ctx);
15692 return manage(res);
15695 isl::multi_union_pw_aff multi_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
15697 if (!ptr)
15698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15699 return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
15702 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::aff &multi2) const
15704 if (!ptr)
15705 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15706 return this->flat_range_product(isl::multi_pw_aff(multi2));
15709 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::multi_aff &multi2) const
15711 if (!ptr)
15712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15713 return this->flat_range_product(isl::multi_pw_aff(multi2));
15716 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_aff &multi2) const
15718 if (!ptr)
15719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15720 return this->flat_range_product(isl::multi_pw_aff(multi2));
15723 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_multi_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::gist(isl::set set) const
15732 if (!ptr || set.is_null())
15733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15734 auto saved_ctx = ctx();
15735 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15736 auto res = isl_multi_pw_aff_gist(copy(), set.release());
15737 if (!res)
15738 exception::throw_last_error(saved_ctx);
15739 return manage(res);
15742 isl::multi_union_pw_aff multi_pw_aff::gist(const isl::union_set &context) const
15744 if (!ptr)
15745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15746 return isl::multi_union_pw_aff(*this).gist(context);
15749 isl::multi_pw_aff multi_pw_aff::gist(const isl::basic_set &set) const
15751 if (!ptr)
15752 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15753 return this->gist(isl::set(set));
15756 isl::multi_pw_aff multi_pw_aff::gist(const isl::point &set) const
15758 if (!ptr)
15759 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15760 return this->gist(isl::set(set));
15763 isl::multi_pw_aff multi_pw_aff::gist_params(isl::set set) const
15765 if (!ptr || set.is_null())
15766 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15767 auto saved_ctx = ctx();
15768 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15769 auto res = isl_multi_pw_aff_gist_params(copy(), set.release());
15770 if (!res)
15771 exception::throw_last_error(saved_ctx);
15772 return manage(res);
15775 bool multi_pw_aff::has_range_tuple_id() const
15777 if (!ptr)
15778 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15779 auto saved_ctx = ctx();
15780 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15781 auto res = isl_multi_pw_aff_has_range_tuple_id(get());
15782 if (res < 0)
15783 exception::throw_last_error(saved_ctx);
15784 return res;
15787 isl::multi_pw_aff multi_pw_aff::identity() const
15789 if (!ptr)
15790 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15791 auto saved_ctx = ctx();
15792 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15793 auto res = isl_multi_pw_aff_identity_multi_pw_aff(copy());
15794 if (!res)
15795 exception::throw_last_error(saved_ctx);
15796 return manage(res);
15799 isl::multi_pw_aff multi_pw_aff::identity_on_domain(isl::space space)
15801 if (space.is_null())
15802 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15803 auto saved_ctx = space.ctx();
15804 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15805 auto res = isl_multi_pw_aff_identity_on_domain_space(space.release());
15806 if (!res)
15807 exception::throw_last_error(saved_ctx);
15808 return manage(res);
15811 isl::multi_pw_aff multi_pw_aff::insert_domain(isl::space domain) const
15813 if (!ptr || domain.is_null())
15814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15815 auto saved_ctx = ctx();
15816 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15817 auto res = isl_multi_pw_aff_insert_domain(copy(), domain.release());
15818 if (!res)
15819 exception::throw_last_error(saved_ctx);
15820 return manage(res);
15823 isl::multi_pw_aff multi_pw_aff::intersect_domain(isl::set domain) const
15825 if (!ptr || domain.is_null())
15826 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15827 auto saved_ctx = ctx();
15828 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15829 auto res = isl_multi_pw_aff_intersect_domain(copy(), domain.release());
15830 if (!res)
15831 exception::throw_last_error(saved_ctx);
15832 return manage(res);
15835 isl::multi_union_pw_aff multi_pw_aff::intersect_domain(const isl::union_set &uset) const
15837 if (!ptr)
15838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15839 return isl::multi_union_pw_aff(*this).intersect_domain(uset);
15842 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::basic_set &domain) const
15844 if (!ptr)
15845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15846 return this->intersect_domain(isl::set(domain));
15849 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::point &domain) const
15851 if (!ptr)
15852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15853 return this->intersect_domain(isl::set(domain));
15856 isl::multi_pw_aff multi_pw_aff::intersect_params(isl::set set) const
15858 if (!ptr || set.is_null())
15859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15860 auto saved_ctx = ctx();
15861 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15862 auto res = isl_multi_pw_aff_intersect_params(copy(), set.release());
15863 if (!res)
15864 exception::throw_last_error(saved_ctx);
15865 return manage(res);
15868 bool multi_pw_aff::involves_nan() const
15870 if (!ptr)
15871 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15872 auto saved_ctx = ctx();
15873 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15874 auto res = isl_multi_pw_aff_involves_nan(get());
15875 if (res < 0)
15876 exception::throw_last_error(saved_ctx);
15877 return res;
15880 bool multi_pw_aff::involves_param(const isl::id &id) const
15882 if (!ptr || id.is_null())
15883 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15884 auto saved_ctx = ctx();
15885 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15886 auto res = isl_multi_pw_aff_involves_param_id(get(), id.get());
15887 if (res < 0)
15888 exception::throw_last_error(saved_ctx);
15889 return res;
15892 bool multi_pw_aff::involves_param(const std::string &id) const
15894 if (!ptr)
15895 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15896 return this->involves_param(isl::id(ctx(), id));
15899 bool multi_pw_aff::involves_param(const isl::id_list &list) const
15901 if (!ptr || list.is_null())
15902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15903 auto saved_ctx = ctx();
15904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15905 auto res = isl_multi_pw_aff_involves_param_id_list(get(), list.get());
15906 if (res < 0)
15907 exception::throw_last_error(saved_ctx);
15908 return res;
15911 bool multi_pw_aff::isa_multi_aff() const
15913 if (!ptr)
15914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15915 auto saved_ctx = ctx();
15916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15917 auto res = isl_multi_pw_aff_isa_multi_aff(get());
15918 if (res < 0)
15919 exception::throw_last_error(saved_ctx);
15920 return res;
15923 isl::pw_aff_list multi_pw_aff::list() const
15925 if (!ptr)
15926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15927 auto saved_ctx = ctx();
15928 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15929 auto res = isl_multi_pw_aff_get_list(get());
15930 if (!res)
15931 exception::throw_last_error(saved_ctx);
15932 return manage(res);
15935 isl::pw_aff_list multi_pw_aff::get_list() const
15937 return list();
15940 isl::multi_pw_aff multi_pw_aff::max(isl::multi_pw_aff multi2) const
15942 if (!ptr || multi2.is_null())
15943 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15944 auto saved_ctx = ctx();
15945 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15946 auto res = isl_multi_pw_aff_max(copy(), multi2.release());
15947 if (!res)
15948 exception::throw_last_error(saved_ctx);
15949 return manage(res);
15952 isl::multi_val multi_pw_aff::max_multi_val() const
15954 if (!ptr)
15955 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15956 auto saved_ctx = ctx();
15957 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15958 auto res = isl_multi_pw_aff_max_multi_val(copy());
15959 if (!res)
15960 exception::throw_last_error(saved_ctx);
15961 return manage(res);
15964 isl::multi_pw_aff multi_pw_aff::min(isl::multi_pw_aff multi2) const
15966 if (!ptr || multi2.is_null())
15967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15968 auto saved_ctx = ctx();
15969 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15970 auto res = isl_multi_pw_aff_min(copy(), multi2.release());
15971 if (!res)
15972 exception::throw_last_error(saved_ctx);
15973 return manage(res);
15976 isl::multi_val multi_pw_aff::min_multi_val() const
15978 if (!ptr)
15979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15980 auto saved_ctx = ctx();
15981 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15982 auto res = isl_multi_pw_aff_min_multi_val(copy());
15983 if (!res)
15984 exception::throw_last_error(saved_ctx);
15985 return manage(res);
15988 isl::multi_pw_aff multi_pw_aff::neg() const
15990 if (!ptr)
15991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
15992 auto saved_ctx = ctx();
15993 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
15994 auto res = isl_multi_pw_aff_neg(copy());
15995 if (!res)
15996 exception::throw_last_error(saved_ctx);
15997 return manage(res);
16000 bool multi_pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
16002 if (!ptr || multi2.is_null())
16003 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16004 auto saved_ctx = ctx();
16005 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16006 auto res = isl_multi_pw_aff_plain_is_equal(get(), multi2.get());
16007 if (res < 0)
16008 exception::throw_last_error(saved_ctx);
16009 return res;
16012 bool multi_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16014 if (!ptr)
16015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16016 return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
16019 bool multi_pw_aff::plain_is_equal(const isl::aff &multi2) const
16021 if (!ptr)
16022 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16023 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16026 bool multi_pw_aff::plain_is_equal(const isl::multi_aff &multi2) const
16028 if (!ptr)
16029 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16030 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16033 bool multi_pw_aff::plain_is_equal(const isl::pw_aff &multi2) const
16035 if (!ptr)
16036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16037 return this->plain_is_equal(isl::multi_pw_aff(multi2));
16040 bool multi_pw_aff::plain_is_equal(const isl::pw_multi_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 isl::multi_pw_aff multi_pw_aff::product(isl::multi_pw_aff multi2) const
16049 if (!ptr || multi2.is_null())
16050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16051 auto saved_ctx = ctx();
16052 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16053 auto res = isl_multi_pw_aff_product(copy(), multi2.release());
16054 if (!res)
16055 exception::throw_last_error(saved_ctx);
16056 return manage(res);
16059 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_aff ma) const
16061 if (!ptr || ma.is_null())
16062 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16063 auto saved_ctx = ctx();
16064 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16065 auto res = isl_multi_pw_aff_pullback_multi_aff(copy(), ma.release());
16066 if (!res)
16067 exception::throw_last_error(saved_ctx);
16068 return manage(res);
16071 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_pw_aff mpa2) const
16073 if (!ptr || mpa2.is_null())
16074 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16075 auto saved_ctx = ctx();
16076 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16077 auto res = isl_multi_pw_aff_pullback_multi_pw_aff(copy(), mpa2.release());
16078 if (!res)
16079 exception::throw_last_error(saved_ctx);
16080 return manage(res);
16083 isl::multi_pw_aff multi_pw_aff::pullback(isl::pw_multi_aff pma) const
16085 if (!ptr || pma.is_null())
16086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16087 auto saved_ctx = ctx();
16088 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16089 auto res = isl_multi_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
16090 if (!res)
16091 exception::throw_last_error(saved_ctx);
16092 return manage(res);
16095 isl::multi_union_pw_aff multi_pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
16097 if (!ptr)
16098 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16099 return isl::multi_union_pw_aff(*this).pullback(upma);
16102 isl::multi_pw_aff multi_pw_aff::range_product(isl::multi_pw_aff multi2) const
16104 if (!ptr || multi2.is_null())
16105 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16106 auto saved_ctx = ctx();
16107 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16108 auto res = isl_multi_pw_aff_range_product(copy(), multi2.release());
16109 if (!res)
16110 exception::throw_last_error(saved_ctx);
16111 return manage(res);
16114 isl::multi_union_pw_aff multi_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
16116 if (!ptr)
16117 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16118 return isl::multi_union_pw_aff(*this).range_product(multi2);
16121 isl::multi_pw_aff multi_pw_aff::range_product(const isl::aff &multi2) const
16123 if (!ptr)
16124 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16125 return this->range_product(isl::multi_pw_aff(multi2));
16128 isl::multi_pw_aff multi_pw_aff::range_product(const isl::multi_aff &multi2) const
16130 if (!ptr)
16131 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16132 return this->range_product(isl::multi_pw_aff(multi2));
16135 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_aff &multi2) const
16137 if (!ptr)
16138 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16139 return this->range_product(isl::multi_pw_aff(multi2));
16142 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_multi_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::id multi_pw_aff::range_tuple_id() const
16151 if (!ptr)
16152 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16153 auto saved_ctx = ctx();
16154 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16155 auto res = isl_multi_pw_aff_get_range_tuple_id(get());
16156 if (!res)
16157 exception::throw_last_error(saved_ctx);
16158 return manage(res);
16161 isl::id multi_pw_aff::get_range_tuple_id() const
16163 return range_tuple_id();
16166 isl::multi_pw_aff multi_pw_aff::reset_range_tuple_id() const
16168 if (!ptr)
16169 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16170 auto saved_ctx = ctx();
16171 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16172 auto res = isl_multi_pw_aff_reset_range_tuple_id(copy());
16173 if (!res)
16174 exception::throw_last_error(saved_ctx);
16175 return manage(res);
16178 isl::multi_pw_aff multi_pw_aff::scale(isl::multi_val mv) const
16180 if (!ptr || mv.is_null())
16181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16182 auto saved_ctx = ctx();
16183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16184 auto res = isl_multi_pw_aff_scale_multi_val(copy(), mv.release());
16185 if (!res)
16186 exception::throw_last_error(saved_ctx);
16187 return manage(res);
16190 isl::multi_pw_aff multi_pw_aff::scale(isl::val v) const
16192 if (!ptr || v.is_null())
16193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16194 auto saved_ctx = ctx();
16195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16196 auto res = isl_multi_pw_aff_scale_val(copy(), v.release());
16197 if (!res)
16198 exception::throw_last_error(saved_ctx);
16199 return manage(res);
16202 isl::multi_pw_aff multi_pw_aff::scale(long v) const
16204 if (!ptr)
16205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16206 return this->scale(isl::val(ctx(), v));
16209 isl::multi_pw_aff multi_pw_aff::scale_down(isl::multi_val mv) const
16211 if (!ptr || mv.is_null())
16212 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16213 auto saved_ctx = ctx();
16214 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16215 auto res = isl_multi_pw_aff_scale_down_multi_val(copy(), mv.release());
16216 if (!res)
16217 exception::throw_last_error(saved_ctx);
16218 return manage(res);
16221 isl::multi_pw_aff multi_pw_aff::scale_down(isl::val v) const
16223 if (!ptr || v.is_null())
16224 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16225 auto saved_ctx = ctx();
16226 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16227 auto res = isl_multi_pw_aff_scale_down_val(copy(), v.release());
16228 if (!res)
16229 exception::throw_last_error(saved_ctx);
16230 return manage(res);
16233 isl::multi_pw_aff multi_pw_aff::scale_down(long v) const
16235 if (!ptr)
16236 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16237 return this->scale_down(isl::val(ctx(), v));
16240 isl::multi_pw_aff multi_pw_aff::set_at(int pos, isl::pw_aff el) const
16242 if (!ptr || el.is_null())
16243 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16244 auto saved_ctx = ctx();
16245 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16246 auto res = isl_multi_pw_aff_set_at(copy(), pos, el.release());
16247 if (!res)
16248 exception::throw_last_error(saved_ctx);
16249 return manage(res);
16252 isl::multi_union_pw_aff multi_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
16254 if (!ptr)
16255 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16256 return isl::multi_union_pw_aff(*this).set_at(pos, el);
16259 isl::multi_pw_aff multi_pw_aff::set_range_tuple(isl::id id) const
16261 if (!ptr || id.is_null())
16262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16263 auto saved_ctx = ctx();
16264 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16265 auto res = isl_multi_pw_aff_set_range_tuple_id(copy(), id.release());
16266 if (!res)
16267 exception::throw_last_error(saved_ctx);
16268 return manage(res);
16271 isl::multi_pw_aff multi_pw_aff::set_range_tuple(const std::string &id) const
16273 if (!ptr)
16274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16275 return this->set_range_tuple(isl::id(ctx(), id));
16278 unsigned multi_pw_aff::size() const
16280 if (!ptr)
16281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16282 auto saved_ctx = ctx();
16283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16284 auto res = isl_multi_pw_aff_size(get());
16285 if (res < 0)
16286 exception::throw_last_error(saved_ctx);
16287 return res;
16290 isl::space multi_pw_aff::space() const
16292 if (!ptr)
16293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16294 auto saved_ctx = ctx();
16295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16296 auto res = isl_multi_pw_aff_get_space(get());
16297 if (!res)
16298 exception::throw_last_error(saved_ctx);
16299 return manage(res);
16302 isl::space multi_pw_aff::get_space() const
16304 return space();
16307 isl::multi_pw_aff multi_pw_aff::sub(isl::multi_pw_aff multi2) const
16309 if (!ptr || multi2.is_null())
16310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16311 auto saved_ctx = ctx();
16312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16313 auto res = isl_multi_pw_aff_sub(copy(), multi2.release());
16314 if (!res)
16315 exception::throw_last_error(saved_ctx);
16316 return manage(res);
16319 isl::multi_union_pw_aff multi_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
16321 if (!ptr)
16322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16323 return isl::multi_union_pw_aff(*this).sub(multi2);
16326 isl::multi_pw_aff multi_pw_aff::sub(const isl::aff &multi2) const
16328 if (!ptr)
16329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16330 return this->sub(isl::multi_pw_aff(multi2));
16333 isl::multi_pw_aff multi_pw_aff::sub(const isl::multi_aff &multi2) const
16335 if (!ptr)
16336 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16337 return this->sub(isl::multi_pw_aff(multi2));
16340 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_aff &multi2) const
16342 if (!ptr)
16343 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16344 return this->sub(isl::multi_pw_aff(multi2));
16347 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_multi_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::unbind_params_insert_domain(isl::multi_id domain) const
16356 if (!ptr || domain.is_null())
16357 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16358 auto saved_ctx = ctx();
16359 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16360 auto res = isl_multi_pw_aff_unbind_params_insert_domain(copy(), domain.release());
16361 if (!res)
16362 exception::throw_last_error(saved_ctx);
16363 return manage(res);
16366 isl::multi_pw_aff multi_pw_aff::union_add(isl::multi_pw_aff mpa2) const
16368 if (!ptr || mpa2.is_null())
16369 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16370 auto saved_ctx = ctx();
16371 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16372 auto res = isl_multi_pw_aff_union_add(copy(), mpa2.release());
16373 if (!res)
16374 exception::throw_last_error(saved_ctx);
16375 return manage(res);
16378 isl::multi_union_pw_aff multi_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
16380 if (!ptr)
16381 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16382 return isl::multi_union_pw_aff(*this).union_add(mupa2);
16385 isl::multi_pw_aff multi_pw_aff::union_add(const isl::aff &mpa2) const
16387 if (!ptr)
16388 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16389 return this->union_add(isl::multi_pw_aff(mpa2));
16392 isl::multi_pw_aff multi_pw_aff::union_add(const isl::multi_aff &mpa2) const
16394 if (!ptr)
16395 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16396 return this->union_add(isl::multi_pw_aff(mpa2));
16399 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_aff &mpa2) const
16401 if (!ptr)
16402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16403 return this->union_add(isl::multi_pw_aff(mpa2));
16406 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_multi_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::zero(isl::space space)
16415 if (space.is_null())
16416 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16417 auto saved_ctx = space.ctx();
16418 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16419 auto res = isl_multi_pw_aff_zero(space.release());
16420 if (!res)
16421 exception::throw_last_error(saved_ctx);
16422 return manage(res);
16425 inline std::ostream &operator<<(std::ostream &os, const multi_pw_aff &obj)
16427 if (!obj.get())
16428 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16429 auto saved_ctx = isl_multi_pw_aff_get_ctx(obj.get());
16430 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16431 char *str = isl_multi_pw_aff_to_str(obj.get());
16432 if (!str)
16433 exception::throw_last_error(saved_ctx);
16434 os << str;
16435 free(str);
16436 return os;
16439 // implementations for isl::multi_union_pw_aff
16440 multi_union_pw_aff manage(__isl_take isl_multi_union_pw_aff *ptr) {
16441 if (!ptr)
16442 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16443 return multi_union_pw_aff(ptr);
16445 multi_union_pw_aff manage_copy(__isl_keep isl_multi_union_pw_aff *ptr) {
16446 if (!ptr)
16447 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16448 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(ptr);
16449 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16450 ptr = isl_multi_union_pw_aff_copy(ptr);
16451 if (!ptr)
16452 exception::throw_last_error(saved_ctx);
16453 return multi_union_pw_aff(ptr);
16456 multi_union_pw_aff::multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr)
16457 : ptr(ptr) {}
16459 multi_union_pw_aff::multi_union_pw_aff()
16460 : ptr(nullptr) {}
16462 multi_union_pw_aff::multi_union_pw_aff(const multi_union_pw_aff &obj)
16463 : ptr(nullptr)
16465 if (!obj.ptr)
16466 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16467 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.ptr);
16468 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16469 ptr = obj.copy();
16470 if (!ptr)
16471 exception::throw_last_error(saved_ctx);
16474 multi_union_pw_aff::multi_union_pw_aff(isl::multi_pw_aff mpa)
16476 if (mpa.is_null())
16477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16478 auto saved_ctx = mpa.ctx();
16479 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16480 auto res = isl_multi_union_pw_aff_from_multi_pw_aff(mpa.release());
16481 if (!res)
16482 exception::throw_last_error(saved_ctx);
16483 ptr = res;
16486 multi_union_pw_aff::multi_union_pw_aff(isl::union_pw_aff upa)
16488 if (upa.is_null())
16489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16490 auto saved_ctx = upa.ctx();
16491 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16492 auto res = isl_multi_union_pw_aff_from_union_pw_aff(upa.release());
16493 if (!res)
16494 exception::throw_last_error(saved_ctx);
16495 ptr = res;
16498 multi_union_pw_aff::multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list)
16500 if (space.is_null() || list.is_null())
16501 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16502 auto saved_ctx = space.ctx();
16503 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16504 auto res = isl_multi_union_pw_aff_from_union_pw_aff_list(space.release(), list.release());
16505 if (!res)
16506 exception::throw_last_error(saved_ctx);
16507 ptr = res;
16510 multi_union_pw_aff::multi_union_pw_aff(isl::ctx ctx, const std::string &str)
16512 auto saved_ctx = ctx;
16513 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16514 auto res = isl_multi_union_pw_aff_read_from_str(ctx.release(), str.c_str());
16515 if (!res)
16516 exception::throw_last_error(saved_ctx);
16517 ptr = res;
16520 multi_union_pw_aff &multi_union_pw_aff::operator=(multi_union_pw_aff obj) {
16521 std::swap(this->ptr, obj.ptr);
16522 return *this;
16525 multi_union_pw_aff::~multi_union_pw_aff() {
16526 if (ptr)
16527 isl_multi_union_pw_aff_free(ptr);
16530 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::copy() const & {
16531 return isl_multi_union_pw_aff_copy(ptr);
16534 __isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::get() const {
16535 return ptr;
16538 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::release() {
16539 isl_multi_union_pw_aff *tmp = ptr;
16540 ptr = nullptr;
16541 return tmp;
16544 bool multi_union_pw_aff::is_null() const {
16545 return ptr == nullptr;
16548 isl::ctx multi_union_pw_aff::ctx() const {
16549 return isl::ctx(isl_multi_union_pw_aff_get_ctx(ptr));
16552 isl::multi_union_pw_aff multi_union_pw_aff::add(isl::multi_union_pw_aff multi2) const
16554 if (!ptr || multi2.is_null())
16555 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16556 auto saved_ctx = ctx();
16557 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16558 auto res = isl_multi_union_pw_aff_add(copy(), multi2.release());
16559 if (!res)
16560 exception::throw_last_error(saved_ctx);
16561 return manage(res);
16564 isl::union_pw_aff multi_union_pw_aff::at(int pos) const
16566 if (!ptr)
16567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16568 auto saved_ctx = ctx();
16569 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16570 auto res = isl_multi_union_pw_aff_get_at(get(), pos);
16571 if (!res)
16572 exception::throw_last_error(saved_ctx);
16573 return manage(res);
16576 isl::union_pw_aff multi_union_pw_aff::get_at(int pos) const
16578 return at(pos);
16581 isl::union_set multi_union_pw_aff::bind(isl::multi_id tuple) const
16583 if (!ptr || tuple.is_null())
16584 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16585 auto saved_ctx = ctx();
16586 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16587 auto res = isl_multi_union_pw_aff_bind(copy(), tuple.release());
16588 if (!res)
16589 exception::throw_last_error(saved_ctx);
16590 return manage(res);
16593 isl::multi_union_pw_aff multi_union_pw_aff::coalesce() const
16595 if (!ptr)
16596 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16597 auto saved_ctx = ctx();
16598 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16599 auto res = isl_multi_union_pw_aff_coalesce(copy());
16600 if (!res)
16601 exception::throw_last_error(saved_ctx);
16602 return manage(res);
16605 isl::union_set multi_union_pw_aff::domain() const
16607 if (!ptr)
16608 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16609 auto saved_ctx = ctx();
16610 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16611 auto res = isl_multi_union_pw_aff_domain(copy());
16612 if (!res)
16613 exception::throw_last_error(saved_ctx);
16614 return manage(res);
16617 isl::multi_union_pw_aff multi_union_pw_aff::flat_range_product(isl::multi_union_pw_aff multi2) const
16619 if (!ptr || multi2.is_null())
16620 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16621 auto saved_ctx = ctx();
16622 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16623 auto res = isl_multi_union_pw_aff_flat_range_product(copy(), multi2.release());
16624 if (!res)
16625 exception::throw_last_error(saved_ctx);
16626 return manage(res);
16629 isl::multi_union_pw_aff multi_union_pw_aff::gist(isl::union_set context) const
16631 if (!ptr || context.is_null())
16632 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16633 auto saved_ctx = ctx();
16634 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16635 auto res = isl_multi_union_pw_aff_gist(copy(), context.release());
16636 if (!res)
16637 exception::throw_last_error(saved_ctx);
16638 return manage(res);
16641 isl::multi_union_pw_aff multi_union_pw_aff::gist_params(isl::set context) const
16643 if (!ptr || context.is_null())
16644 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16645 auto saved_ctx = ctx();
16646 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16647 auto res = isl_multi_union_pw_aff_gist_params(copy(), context.release());
16648 if (!res)
16649 exception::throw_last_error(saved_ctx);
16650 return manage(res);
16653 bool multi_union_pw_aff::has_range_tuple_id() const
16655 if (!ptr)
16656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16657 auto saved_ctx = ctx();
16658 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16659 auto res = isl_multi_union_pw_aff_has_range_tuple_id(get());
16660 if (res < 0)
16661 exception::throw_last_error(saved_ctx);
16662 return res;
16665 isl::multi_union_pw_aff multi_union_pw_aff::intersect_domain(isl::union_set uset) const
16667 if (!ptr || uset.is_null())
16668 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16669 auto saved_ctx = ctx();
16670 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16671 auto res = isl_multi_union_pw_aff_intersect_domain(copy(), uset.release());
16672 if (!res)
16673 exception::throw_last_error(saved_ctx);
16674 return manage(res);
16677 isl::multi_union_pw_aff multi_union_pw_aff::intersect_params(isl::set params) const
16679 if (!ptr || params.is_null())
16680 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16681 auto saved_ctx = ctx();
16682 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16683 auto res = isl_multi_union_pw_aff_intersect_params(copy(), params.release());
16684 if (!res)
16685 exception::throw_last_error(saved_ctx);
16686 return manage(res);
16689 bool multi_union_pw_aff::involves_nan() const
16691 if (!ptr)
16692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16693 auto saved_ctx = ctx();
16694 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16695 auto res = isl_multi_union_pw_aff_involves_nan(get());
16696 if (res < 0)
16697 exception::throw_last_error(saved_ctx);
16698 return res;
16701 isl::union_pw_aff_list multi_union_pw_aff::list() const
16703 if (!ptr)
16704 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16705 auto saved_ctx = ctx();
16706 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16707 auto res = isl_multi_union_pw_aff_get_list(get());
16708 if (!res)
16709 exception::throw_last_error(saved_ctx);
16710 return manage(res);
16713 isl::union_pw_aff_list multi_union_pw_aff::get_list() const
16715 return list();
16718 isl::multi_union_pw_aff multi_union_pw_aff::neg() const
16720 if (!ptr)
16721 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16722 auto saved_ctx = ctx();
16723 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16724 auto res = isl_multi_union_pw_aff_neg(copy());
16725 if (!res)
16726 exception::throw_last_error(saved_ctx);
16727 return manage(res);
16730 bool multi_union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16732 if (!ptr || multi2.is_null())
16733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16734 auto saved_ctx = ctx();
16735 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16736 auto res = isl_multi_union_pw_aff_plain_is_equal(get(), multi2.get());
16737 if (res < 0)
16738 exception::throw_last_error(saved_ctx);
16739 return res;
16742 isl::multi_union_pw_aff multi_union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
16744 if (!ptr || upma.is_null())
16745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16746 auto saved_ctx = ctx();
16747 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16748 auto res = isl_multi_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
16749 if (!res)
16750 exception::throw_last_error(saved_ctx);
16751 return manage(res);
16754 isl::multi_union_pw_aff multi_union_pw_aff::range_product(isl::multi_union_pw_aff multi2) const
16756 if (!ptr || multi2.is_null())
16757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16758 auto saved_ctx = ctx();
16759 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16760 auto res = isl_multi_union_pw_aff_range_product(copy(), multi2.release());
16761 if (!res)
16762 exception::throw_last_error(saved_ctx);
16763 return manage(res);
16766 isl::id multi_union_pw_aff::range_tuple_id() const
16768 if (!ptr)
16769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16770 auto saved_ctx = ctx();
16771 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16772 auto res = isl_multi_union_pw_aff_get_range_tuple_id(get());
16773 if (!res)
16774 exception::throw_last_error(saved_ctx);
16775 return manage(res);
16778 isl::id multi_union_pw_aff::get_range_tuple_id() const
16780 return range_tuple_id();
16783 isl::multi_union_pw_aff multi_union_pw_aff::reset_range_tuple_id() const
16785 if (!ptr)
16786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16787 auto saved_ctx = ctx();
16788 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16789 auto res = isl_multi_union_pw_aff_reset_range_tuple_id(copy());
16790 if (!res)
16791 exception::throw_last_error(saved_ctx);
16792 return manage(res);
16795 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::multi_val mv) const
16797 if (!ptr || mv.is_null())
16798 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16799 auto saved_ctx = ctx();
16800 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16801 auto res = isl_multi_union_pw_aff_scale_multi_val(copy(), mv.release());
16802 if (!res)
16803 exception::throw_last_error(saved_ctx);
16804 return manage(res);
16807 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::val v) const
16809 if (!ptr || v.is_null())
16810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16811 auto saved_ctx = ctx();
16812 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16813 auto res = isl_multi_union_pw_aff_scale_val(copy(), v.release());
16814 if (!res)
16815 exception::throw_last_error(saved_ctx);
16816 return manage(res);
16819 isl::multi_union_pw_aff multi_union_pw_aff::scale(long v) const
16821 if (!ptr)
16822 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16823 return this->scale(isl::val(ctx(), v));
16826 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::multi_val mv) const
16828 if (!ptr || mv.is_null())
16829 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16830 auto saved_ctx = ctx();
16831 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16832 auto res = isl_multi_union_pw_aff_scale_down_multi_val(copy(), mv.release());
16833 if (!res)
16834 exception::throw_last_error(saved_ctx);
16835 return manage(res);
16838 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::val v) const
16840 if (!ptr || v.is_null())
16841 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16842 auto saved_ctx = ctx();
16843 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16844 auto res = isl_multi_union_pw_aff_scale_down_val(copy(), v.release());
16845 if (!res)
16846 exception::throw_last_error(saved_ctx);
16847 return manage(res);
16850 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(long v) const
16852 if (!ptr)
16853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16854 return this->scale_down(isl::val(ctx(), v));
16857 isl::multi_union_pw_aff multi_union_pw_aff::set_at(int pos, isl::union_pw_aff el) const
16859 if (!ptr || el.is_null())
16860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16861 auto saved_ctx = ctx();
16862 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16863 auto res = isl_multi_union_pw_aff_set_at(copy(), pos, el.release());
16864 if (!res)
16865 exception::throw_last_error(saved_ctx);
16866 return manage(res);
16869 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(isl::id id) const
16871 if (!ptr || id.is_null())
16872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16873 auto saved_ctx = ctx();
16874 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16875 auto res = isl_multi_union_pw_aff_set_range_tuple_id(copy(), id.release());
16876 if (!res)
16877 exception::throw_last_error(saved_ctx);
16878 return manage(res);
16881 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(const std::string &id) const
16883 if (!ptr)
16884 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16885 return this->set_range_tuple(isl::id(ctx(), id));
16888 unsigned multi_union_pw_aff::size() const
16890 if (!ptr)
16891 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16892 auto saved_ctx = ctx();
16893 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16894 auto res = isl_multi_union_pw_aff_size(get());
16895 if (res < 0)
16896 exception::throw_last_error(saved_ctx);
16897 return res;
16900 isl::space multi_union_pw_aff::space() const
16902 if (!ptr)
16903 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16904 auto saved_ctx = ctx();
16905 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16906 auto res = isl_multi_union_pw_aff_get_space(get());
16907 if (!res)
16908 exception::throw_last_error(saved_ctx);
16909 return manage(res);
16912 isl::space multi_union_pw_aff::get_space() const
16914 return space();
16917 isl::multi_union_pw_aff multi_union_pw_aff::sub(isl::multi_union_pw_aff multi2) const
16919 if (!ptr || multi2.is_null())
16920 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16921 auto saved_ctx = ctx();
16922 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16923 auto res = isl_multi_union_pw_aff_sub(copy(), multi2.release());
16924 if (!res)
16925 exception::throw_last_error(saved_ctx);
16926 return manage(res);
16929 isl::multi_union_pw_aff multi_union_pw_aff::union_add(isl::multi_union_pw_aff mupa2) const
16931 if (!ptr || mupa2.is_null())
16932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16933 auto saved_ctx = ctx();
16934 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16935 auto res = isl_multi_union_pw_aff_union_add(copy(), mupa2.release());
16936 if (!res)
16937 exception::throw_last_error(saved_ctx);
16938 return manage(res);
16941 isl::multi_union_pw_aff multi_union_pw_aff::zero(isl::space space)
16943 if (space.is_null())
16944 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16945 auto saved_ctx = space.ctx();
16946 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16947 auto res = isl_multi_union_pw_aff_zero(space.release());
16948 if (!res)
16949 exception::throw_last_error(saved_ctx);
16950 return manage(res);
16953 inline std::ostream &operator<<(std::ostream &os, const multi_union_pw_aff &obj)
16955 if (!obj.get())
16956 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16957 auto saved_ctx = isl_multi_union_pw_aff_get_ctx(obj.get());
16958 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16959 char *str = isl_multi_union_pw_aff_to_str(obj.get());
16960 if (!str)
16961 exception::throw_last_error(saved_ctx);
16962 os << str;
16963 free(str);
16964 return os;
16967 // implementations for isl::multi_val
16968 multi_val manage(__isl_take isl_multi_val *ptr) {
16969 if (!ptr)
16970 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16971 return multi_val(ptr);
16973 multi_val manage_copy(__isl_keep isl_multi_val *ptr) {
16974 if (!ptr)
16975 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16976 auto saved_ctx = isl_multi_val_get_ctx(ptr);
16977 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16978 ptr = isl_multi_val_copy(ptr);
16979 if (!ptr)
16980 exception::throw_last_error(saved_ctx);
16981 return multi_val(ptr);
16984 multi_val::multi_val(__isl_take isl_multi_val *ptr)
16985 : ptr(ptr) {}
16987 multi_val::multi_val()
16988 : ptr(nullptr) {}
16990 multi_val::multi_val(const multi_val &obj)
16991 : ptr(nullptr)
16993 if (!obj.ptr)
16994 exception::throw_invalid("NULL input", __FILE__, __LINE__);
16995 auto saved_ctx = isl_multi_val_get_ctx(obj.ptr);
16996 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
16997 ptr = obj.copy();
16998 if (!ptr)
16999 exception::throw_last_error(saved_ctx);
17002 multi_val::multi_val(isl::space space, isl::val_list list)
17004 if (space.is_null() || list.is_null())
17005 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17006 auto saved_ctx = space.ctx();
17007 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17008 auto res = isl_multi_val_from_val_list(space.release(), list.release());
17009 if (!res)
17010 exception::throw_last_error(saved_ctx);
17011 ptr = res;
17014 multi_val::multi_val(isl::ctx ctx, const std::string &str)
17016 auto saved_ctx = ctx;
17017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17018 auto res = isl_multi_val_read_from_str(ctx.release(), str.c_str());
17019 if (!res)
17020 exception::throw_last_error(saved_ctx);
17021 ptr = res;
17024 multi_val &multi_val::operator=(multi_val obj) {
17025 std::swap(this->ptr, obj.ptr);
17026 return *this;
17029 multi_val::~multi_val() {
17030 if (ptr)
17031 isl_multi_val_free(ptr);
17034 __isl_give isl_multi_val *multi_val::copy() const & {
17035 return isl_multi_val_copy(ptr);
17038 __isl_keep isl_multi_val *multi_val::get() const {
17039 return ptr;
17042 __isl_give isl_multi_val *multi_val::release() {
17043 isl_multi_val *tmp = ptr;
17044 ptr = nullptr;
17045 return tmp;
17048 bool multi_val::is_null() const {
17049 return ptr == nullptr;
17052 isl::ctx multi_val::ctx() const {
17053 return isl::ctx(isl_multi_val_get_ctx(ptr));
17056 isl::multi_val multi_val::add(isl::multi_val multi2) const
17058 if (!ptr || multi2.is_null())
17059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17060 auto saved_ctx = ctx();
17061 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17062 auto res = isl_multi_val_add(copy(), multi2.release());
17063 if (!res)
17064 exception::throw_last_error(saved_ctx);
17065 return manage(res);
17068 isl::multi_val multi_val::add(isl::val v) const
17070 if (!ptr || v.is_null())
17071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17072 auto saved_ctx = ctx();
17073 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17074 auto res = isl_multi_val_add_val(copy(), v.release());
17075 if (!res)
17076 exception::throw_last_error(saved_ctx);
17077 return manage(res);
17080 isl::multi_val multi_val::add(long v) const
17082 if (!ptr)
17083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17084 return this->add(isl::val(ctx(), v));
17087 isl::val multi_val::at(int pos) const
17089 if (!ptr)
17090 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17091 auto saved_ctx = ctx();
17092 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17093 auto res = isl_multi_val_get_at(get(), pos);
17094 if (!res)
17095 exception::throw_last_error(saved_ctx);
17096 return manage(res);
17099 isl::val multi_val::get_at(int pos) const
17101 return at(pos);
17104 isl::multi_val multi_val::flat_range_product(isl::multi_val multi2) const
17106 if (!ptr || multi2.is_null())
17107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17108 auto saved_ctx = ctx();
17109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17110 auto res = isl_multi_val_flat_range_product(copy(), multi2.release());
17111 if (!res)
17112 exception::throw_last_error(saved_ctx);
17113 return manage(res);
17116 bool multi_val::has_range_tuple_id() const
17118 if (!ptr)
17119 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17120 auto saved_ctx = ctx();
17121 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17122 auto res = isl_multi_val_has_range_tuple_id(get());
17123 if (res < 0)
17124 exception::throw_last_error(saved_ctx);
17125 return res;
17128 bool multi_val::involves_nan() const
17130 if (!ptr)
17131 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17132 auto saved_ctx = ctx();
17133 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17134 auto res = isl_multi_val_involves_nan(get());
17135 if (res < 0)
17136 exception::throw_last_error(saved_ctx);
17137 return res;
17140 isl::val_list multi_val::list() const
17142 if (!ptr)
17143 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17144 auto saved_ctx = ctx();
17145 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17146 auto res = isl_multi_val_get_list(get());
17147 if (!res)
17148 exception::throw_last_error(saved_ctx);
17149 return manage(res);
17152 isl::val_list multi_val::get_list() const
17154 return list();
17157 isl::multi_val multi_val::max(isl::multi_val multi2) const
17159 if (!ptr || multi2.is_null())
17160 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17161 auto saved_ctx = ctx();
17162 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17163 auto res = isl_multi_val_max(copy(), multi2.release());
17164 if (!res)
17165 exception::throw_last_error(saved_ctx);
17166 return manage(res);
17169 isl::multi_val multi_val::min(isl::multi_val multi2) const
17171 if (!ptr || multi2.is_null())
17172 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17173 auto saved_ctx = ctx();
17174 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17175 auto res = isl_multi_val_min(copy(), multi2.release());
17176 if (!res)
17177 exception::throw_last_error(saved_ctx);
17178 return manage(res);
17181 isl::multi_val multi_val::neg() const
17183 if (!ptr)
17184 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17185 auto saved_ctx = ctx();
17186 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17187 auto res = isl_multi_val_neg(copy());
17188 if (!res)
17189 exception::throw_last_error(saved_ctx);
17190 return manage(res);
17193 bool multi_val::plain_is_equal(const isl::multi_val &multi2) const
17195 if (!ptr || multi2.is_null())
17196 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17197 auto saved_ctx = ctx();
17198 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17199 auto res = isl_multi_val_plain_is_equal(get(), multi2.get());
17200 if (res < 0)
17201 exception::throw_last_error(saved_ctx);
17202 return res;
17205 isl::multi_val multi_val::product(isl::multi_val multi2) const
17207 if (!ptr || multi2.is_null())
17208 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17209 auto saved_ctx = ctx();
17210 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17211 auto res = isl_multi_val_product(copy(), multi2.release());
17212 if (!res)
17213 exception::throw_last_error(saved_ctx);
17214 return manage(res);
17217 isl::multi_val multi_val::range_product(isl::multi_val multi2) const
17219 if (!ptr || multi2.is_null())
17220 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17221 auto saved_ctx = ctx();
17222 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17223 auto res = isl_multi_val_range_product(copy(), multi2.release());
17224 if (!res)
17225 exception::throw_last_error(saved_ctx);
17226 return manage(res);
17229 isl::id multi_val::range_tuple_id() const
17231 if (!ptr)
17232 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17233 auto saved_ctx = ctx();
17234 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17235 auto res = isl_multi_val_get_range_tuple_id(get());
17236 if (!res)
17237 exception::throw_last_error(saved_ctx);
17238 return manage(res);
17241 isl::id multi_val::get_range_tuple_id() const
17243 return range_tuple_id();
17246 isl::multi_val multi_val::reset_range_tuple_id() const
17248 if (!ptr)
17249 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17250 auto saved_ctx = ctx();
17251 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17252 auto res = isl_multi_val_reset_range_tuple_id(copy());
17253 if (!res)
17254 exception::throw_last_error(saved_ctx);
17255 return manage(res);
17258 isl::multi_val multi_val::scale(isl::multi_val mv) const
17260 if (!ptr || mv.is_null())
17261 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17262 auto saved_ctx = ctx();
17263 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17264 auto res = isl_multi_val_scale_multi_val(copy(), mv.release());
17265 if (!res)
17266 exception::throw_last_error(saved_ctx);
17267 return manage(res);
17270 isl::multi_val multi_val::scale(isl::val v) const
17272 if (!ptr || v.is_null())
17273 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17274 auto saved_ctx = ctx();
17275 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17276 auto res = isl_multi_val_scale_val(copy(), v.release());
17277 if (!res)
17278 exception::throw_last_error(saved_ctx);
17279 return manage(res);
17282 isl::multi_val multi_val::scale(long v) const
17284 if (!ptr)
17285 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17286 return this->scale(isl::val(ctx(), v));
17289 isl::multi_val multi_val::scale_down(isl::multi_val mv) const
17291 if (!ptr || mv.is_null())
17292 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17293 auto saved_ctx = ctx();
17294 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17295 auto res = isl_multi_val_scale_down_multi_val(copy(), mv.release());
17296 if (!res)
17297 exception::throw_last_error(saved_ctx);
17298 return manage(res);
17301 isl::multi_val multi_val::scale_down(isl::val v) const
17303 if (!ptr || v.is_null())
17304 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17305 auto saved_ctx = ctx();
17306 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17307 auto res = isl_multi_val_scale_down_val(copy(), v.release());
17308 if (!res)
17309 exception::throw_last_error(saved_ctx);
17310 return manage(res);
17313 isl::multi_val multi_val::scale_down(long v) const
17315 if (!ptr)
17316 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17317 return this->scale_down(isl::val(ctx(), v));
17320 isl::multi_val multi_val::set_at(int pos, isl::val el) const
17322 if (!ptr || el.is_null())
17323 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17324 auto saved_ctx = ctx();
17325 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17326 auto res = isl_multi_val_set_at(copy(), pos, el.release());
17327 if (!res)
17328 exception::throw_last_error(saved_ctx);
17329 return manage(res);
17332 isl::multi_val multi_val::set_at(int pos, long el) const
17334 if (!ptr)
17335 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17336 return this->set_at(pos, isl::val(ctx(), el));
17339 isl::multi_val multi_val::set_range_tuple(isl::id id) const
17341 if (!ptr || id.is_null())
17342 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17343 auto saved_ctx = ctx();
17344 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17345 auto res = isl_multi_val_set_range_tuple_id(copy(), id.release());
17346 if (!res)
17347 exception::throw_last_error(saved_ctx);
17348 return manage(res);
17351 isl::multi_val multi_val::set_range_tuple(const std::string &id) const
17353 if (!ptr)
17354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17355 return this->set_range_tuple(isl::id(ctx(), id));
17358 unsigned multi_val::size() const
17360 if (!ptr)
17361 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17362 auto saved_ctx = ctx();
17363 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17364 auto res = isl_multi_val_size(get());
17365 if (res < 0)
17366 exception::throw_last_error(saved_ctx);
17367 return res;
17370 isl::space multi_val::space() const
17372 if (!ptr)
17373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17374 auto saved_ctx = ctx();
17375 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17376 auto res = isl_multi_val_get_space(get());
17377 if (!res)
17378 exception::throw_last_error(saved_ctx);
17379 return manage(res);
17382 isl::space multi_val::get_space() const
17384 return space();
17387 isl::multi_val multi_val::sub(isl::multi_val multi2) const
17389 if (!ptr || multi2.is_null())
17390 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17391 auto saved_ctx = ctx();
17392 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17393 auto res = isl_multi_val_sub(copy(), multi2.release());
17394 if (!res)
17395 exception::throw_last_error(saved_ctx);
17396 return manage(res);
17399 isl::multi_val multi_val::zero(isl::space space)
17401 if (space.is_null())
17402 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17403 auto saved_ctx = space.ctx();
17404 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17405 auto res = isl_multi_val_zero(space.release());
17406 if (!res)
17407 exception::throw_last_error(saved_ctx);
17408 return manage(res);
17411 inline std::ostream &operator<<(std::ostream &os, const multi_val &obj)
17413 if (!obj.get())
17414 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17415 auto saved_ctx = isl_multi_val_get_ctx(obj.get());
17416 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17417 char *str = isl_multi_val_to_str(obj.get());
17418 if (!str)
17419 exception::throw_last_error(saved_ctx);
17420 os << str;
17421 free(str);
17422 return os;
17425 // implementations for isl::point
17426 point manage(__isl_take isl_point *ptr) {
17427 if (!ptr)
17428 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17429 return point(ptr);
17431 point manage_copy(__isl_keep isl_point *ptr) {
17432 if (!ptr)
17433 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17434 auto saved_ctx = isl_point_get_ctx(ptr);
17435 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17436 ptr = isl_point_copy(ptr);
17437 if (!ptr)
17438 exception::throw_last_error(saved_ctx);
17439 return point(ptr);
17442 point::point(__isl_take isl_point *ptr)
17443 : ptr(ptr) {}
17445 point::point()
17446 : ptr(nullptr) {}
17448 point::point(const point &obj)
17449 : ptr(nullptr)
17451 if (!obj.ptr)
17452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17453 auto saved_ctx = isl_point_get_ctx(obj.ptr);
17454 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17455 ptr = obj.copy();
17456 if (!ptr)
17457 exception::throw_last_error(saved_ctx);
17460 point &point::operator=(point obj) {
17461 std::swap(this->ptr, obj.ptr);
17462 return *this;
17465 point::~point() {
17466 if (ptr)
17467 isl_point_free(ptr);
17470 __isl_give isl_point *point::copy() const & {
17471 return isl_point_copy(ptr);
17474 __isl_keep isl_point *point::get() const {
17475 return ptr;
17478 __isl_give isl_point *point::release() {
17479 isl_point *tmp = ptr;
17480 ptr = nullptr;
17481 return tmp;
17484 bool point::is_null() const {
17485 return ptr == nullptr;
17488 isl::ctx point::ctx() const {
17489 return isl::ctx(isl_point_get_ctx(ptr));
17492 isl::basic_set point::affine_hull() const
17494 if (!ptr)
17495 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17496 return isl::basic_set(*this).affine_hull();
17499 isl::basic_set point::apply(const isl::basic_map &bmap) const
17501 if (!ptr)
17502 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17503 return isl::basic_set(*this).apply(bmap);
17506 isl::set point::apply(const isl::map &map) const
17508 if (!ptr)
17509 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17510 return isl::basic_set(*this).apply(map);
17513 isl::union_set point::apply(const isl::union_map &umap) const
17515 if (!ptr)
17516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17517 return isl::basic_set(*this).apply(umap);
17520 isl::pw_multi_aff point::as_pw_multi_aff() const
17522 if (!ptr)
17523 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17524 return isl::basic_set(*this).as_pw_multi_aff();
17527 isl::set point::as_set() const
17529 if (!ptr)
17530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17531 return isl::basic_set(*this).as_set();
17534 isl::set point::bind(const isl::multi_id &tuple) const
17536 if (!ptr)
17537 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17538 return isl::basic_set(*this).bind(tuple);
17541 isl::set point::coalesce() const
17543 if (!ptr)
17544 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17545 return isl::basic_set(*this).coalesce();
17548 isl::set point::complement() const
17550 if (!ptr)
17551 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17552 return isl::basic_set(*this).complement();
17555 isl::union_set point::compute_divs() const
17557 if (!ptr)
17558 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17559 return isl::basic_set(*this).compute_divs();
17562 isl::basic_set point::detect_equalities() const
17564 if (!ptr)
17565 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17566 return isl::basic_set(*this).detect_equalities();
17569 isl::val point::dim_max_val(int pos) const
17571 if (!ptr)
17572 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17573 return isl::basic_set(*this).dim_max_val(pos);
17576 isl::val point::dim_min_val(int pos) const
17578 if (!ptr)
17579 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17580 return isl::basic_set(*this).dim_min_val(pos);
17583 isl::set point::drop_unused_params() const
17585 if (!ptr)
17586 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17587 return isl::basic_set(*this).drop_unused_params();
17590 bool point::every_set(const std::function<bool(isl::set)> &test) const
17592 if (!ptr)
17593 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17594 return isl::basic_set(*this).every_set(test);
17597 isl::set point::extract_set(const isl::space &space) const
17599 if (!ptr)
17600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17601 return isl::basic_set(*this).extract_set(space);
17604 isl::basic_set point::flatten() const
17606 if (!ptr)
17607 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17608 return isl::basic_set(*this).flatten();
17611 void point::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
17613 if (!ptr)
17614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17615 return isl::basic_set(*this).foreach_basic_set(fn);
17618 void point::foreach_point(const std::function<void(isl::point)> &fn) const
17620 if (!ptr)
17621 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17622 return isl::basic_set(*this).foreach_point(fn);
17625 void point::foreach_set(const std::function<void(isl::set)> &fn) const
17627 if (!ptr)
17628 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17629 return isl::basic_set(*this).foreach_set(fn);
17632 isl::basic_set point::gist(const isl::basic_set &context) const
17634 if (!ptr)
17635 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17636 return isl::basic_set(*this).gist(context);
17639 isl::set point::gist(const isl::set &context) const
17641 if (!ptr)
17642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17643 return isl::basic_set(*this).gist(context);
17646 isl::union_set point::gist(const isl::union_set &context) const
17648 if (!ptr)
17649 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17650 return isl::basic_set(*this).gist(context);
17653 isl::set point::gist_params(const isl::set &context) const
17655 if (!ptr)
17656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17657 return isl::basic_set(*this).gist_params(context);
17660 isl::map point::identity() const
17662 if (!ptr)
17663 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17664 return isl::basic_set(*this).identity();
17667 isl::pw_aff point::indicator_function() const
17669 if (!ptr)
17670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17671 return isl::basic_set(*this).indicator_function();
17674 isl::map point::insert_domain(const isl::space &domain) const
17676 if (!ptr)
17677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17678 return isl::basic_set(*this).insert_domain(domain);
17681 isl::basic_set point::intersect(const isl::basic_set &bset2) const
17683 if (!ptr)
17684 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17685 return isl::basic_set(*this).intersect(bset2);
17688 isl::set point::intersect(const isl::set &set2) const
17690 if (!ptr)
17691 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17692 return isl::basic_set(*this).intersect(set2);
17695 isl::union_set point::intersect(const isl::union_set &uset2) const
17697 if (!ptr)
17698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17699 return isl::basic_set(*this).intersect(uset2);
17702 isl::basic_set point::intersect_params(const isl::basic_set &bset2) const
17704 if (!ptr)
17705 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17706 return isl::basic_set(*this).intersect_params(bset2);
17709 isl::set point::intersect_params(const isl::set &params) const
17711 if (!ptr)
17712 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17713 return isl::basic_set(*this).intersect_params(params);
17716 bool point::involves_locals() const
17718 if (!ptr)
17719 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17720 return isl::basic_set(*this).involves_locals();
17723 bool point::is_disjoint(const isl::set &set2) const
17725 if (!ptr)
17726 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17727 return isl::basic_set(*this).is_disjoint(set2);
17730 bool point::is_disjoint(const isl::union_set &uset2) const
17732 if (!ptr)
17733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17734 return isl::basic_set(*this).is_disjoint(uset2);
17737 bool point::is_empty() const
17739 if (!ptr)
17740 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17741 return isl::basic_set(*this).is_empty();
17744 bool point::is_equal(const isl::basic_set &bset2) const
17746 if (!ptr)
17747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17748 return isl::basic_set(*this).is_equal(bset2);
17751 bool point::is_equal(const isl::set &set2) const
17753 if (!ptr)
17754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17755 return isl::basic_set(*this).is_equal(set2);
17758 bool point::is_equal(const isl::union_set &uset2) const
17760 if (!ptr)
17761 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17762 return isl::basic_set(*this).is_equal(uset2);
17765 bool point::is_singleton() const
17767 if (!ptr)
17768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17769 return isl::basic_set(*this).is_singleton();
17772 bool point::is_strict_subset(const isl::set &set2) const
17774 if (!ptr)
17775 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17776 return isl::basic_set(*this).is_strict_subset(set2);
17779 bool point::is_strict_subset(const isl::union_set &uset2) const
17781 if (!ptr)
17782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17783 return isl::basic_set(*this).is_strict_subset(uset2);
17786 bool point::is_subset(const isl::basic_set &bset2) const
17788 if (!ptr)
17789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17790 return isl::basic_set(*this).is_subset(bset2);
17793 bool point::is_subset(const isl::set &set2) const
17795 if (!ptr)
17796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17797 return isl::basic_set(*this).is_subset(set2);
17800 bool point::is_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_subset(uset2);
17807 bool point::is_wrapping() const
17809 if (!ptr)
17810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17811 return isl::basic_set(*this).is_wrapping();
17814 bool point::isa_set() const
17816 if (!ptr)
17817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17818 return isl::basic_set(*this).isa_set();
17821 isl::fixed_box point::lattice_tile() const
17823 if (!ptr)
17824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17825 return isl::basic_set(*this).lattice_tile();
17828 isl::set point::lexmax() const
17830 if (!ptr)
17831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17832 return isl::basic_set(*this).lexmax();
17835 isl::pw_multi_aff point::lexmax_pw_multi_aff() const
17837 if (!ptr)
17838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17839 return isl::basic_set(*this).lexmax_pw_multi_aff();
17842 isl::set point::lexmin() const
17844 if (!ptr)
17845 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17846 return isl::basic_set(*this).lexmin();
17849 isl::pw_multi_aff point::lexmin_pw_multi_aff() const
17851 if (!ptr)
17852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17853 return isl::basic_set(*this).lexmin_pw_multi_aff();
17856 isl::set point::lower_bound(const isl::multi_pw_aff &lower) const
17858 if (!ptr)
17859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17860 return isl::basic_set(*this).lower_bound(lower);
17863 isl::set point::lower_bound(const isl::multi_val &lower) const
17865 if (!ptr)
17866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17867 return isl::basic_set(*this).lower_bound(lower);
17870 isl::multi_pw_aff point::max_multi_pw_aff() const
17872 if (!ptr)
17873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17874 return isl::basic_set(*this).max_multi_pw_aff();
17877 isl::val point::max_val(const isl::aff &obj) const
17879 if (!ptr)
17880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17881 return isl::basic_set(*this).max_val(obj);
17884 isl::multi_pw_aff point::min_multi_pw_aff() const
17886 if (!ptr)
17887 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17888 return isl::basic_set(*this).min_multi_pw_aff();
17891 isl::val point::min_val(const isl::aff &obj) const
17893 if (!ptr)
17894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17895 return isl::basic_set(*this).min_val(obj);
17898 isl::multi_val point::multi_val() const
17900 if (!ptr)
17901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17902 auto saved_ctx = ctx();
17903 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
17904 auto res = isl_point_get_multi_val(get());
17905 if (!res)
17906 exception::throw_last_error(saved_ctx);
17907 return manage(res);
17910 isl::multi_val point::get_multi_val() const
17912 return multi_val();
17915 unsigned point::n_basic_set() const
17917 if (!ptr)
17918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17919 return isl::basic_set(*this).n_basic_set();
17922 isl::pw_aff point::param_pw_aff_on_domain(const isl::id &id) const
17924 if (!ptr)
17925 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17926 return isl::basic_set(*this).param_pw_aff_on_domain(id);
17929 isl::pw_aff point::param_pw_aff_on_domain(const std::string &id) const
17931 if (!ptr)
17932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17933 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
17936 isl::basic_set point::params() const
17938 if (!ptr)
17939 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17940 return isl::basic_set(*this).params();
17943 isl::multi_val point::plain_multi_val_if_fixed() const
17945 if (!ptr)
17946 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17947 return isl::basic_set(*this).plain_multi_val_if_fixed();
17950 isl::basic_set point::polyhedral_hull() const
17952 if (!ptr)
17953 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17954 return isl::basic_set(*this).polyhedral_hull();
17957 isl::set point::preimage(const isl::multi_aff &ma) const
17959 if (!ptr)
17960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17961 return isl::basic_set(*this).preimage(ma);
17964 isl::set point::preimage(const isl::multi_pw_aff &mpa) const
17966 if (!ptr)
17967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17968 return isl::basic_set(*this).preimage(mpa);
17971 isl::set point::preimage(const isl::pw_multi_aff &pma) const
17973 if (!ptr)
17974 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17975 return isl::basic_set(*this).preimage(pma);
17978 isl::union_set point::preimage(const isl::union_pw_multi_aff &upma) const
17980 if (!ptr)
17981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17982 return isl::basic_set(*this).preimage(upma);
17985 isl::set point::product(const isl::set &set2) const
17987 if (!ptr)
17988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17989 return isl::basic_set(*this).product(set2);
17992 isl::set point::project_out_all_params() const
17994 if (!ptr)
17995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
17996 return isl::basic_set(*this).project_out_all_params();
17999 isl::set point::project_out_param(const isl::id &id) const
18001 if (!ptr)
18002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18003 return isl::basic_set(*this).project_out_param(id);
18006 isl::set point::project_out_param(const std::string &id) const
18008 if (!ptr)
18009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18010 return this->project_out_param(isl::id(ctx(), id));
18013 isl::set point::project_out_param(const isl::id_list &list) const
18015 if (!ptr)
18016 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18017 return isl::basic_set(*this).project_out_param(list);
18020 isl::pw_aff point::pw_aff_on_domain(const isl::val &v) const
18022 if (!ptr)
18023 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18024 return isl::basic_set(*this).pw_aff_on_domain(v);
18027 isl::pw_aff point::pw_aff_on_domain(long v) const
18029 if (!ptr)
18030 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18031 return this->pw_aff_on_domain(isl::val(ctx(), v));
18034 isl::pw_multi_aff point::pw_multi_aff_on_domain(const isl::multi_val &mv) const
18036 if (!ptr)
18037 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18038 return isl::basic_set(*this).pw_multi_aff_on_domain(mv);
18041 isl::basic_set point::sample() const
18043 if (!ptr)
18044 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18045 return isl::basic_set(*this).sample();
18048 isl::point point::sample_point() const
18050 if (!ptr)
18051 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18052 return isl::basic_set(*this).sample_point();
18055 isl::set_list point::set_list() const
18057 if (!ptr)
18058 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18059 return isl::basic_set(*this).set_list();
18062 isl::fixed_box point::simple_fixed_box_hull() const
18064 if (!ptr)
18065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18066 return isl::basic_set(*this).simple_fixed_box_hull();
18069 isl::space point::space() const
18071 if (!ptr)
18072 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18073 return isl::basic_set(*this).space();
18076 isl::val point::stride(int pos) const
18078 if (!ptr)
18079 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18080 return isl::basic_set(*this).stride(pos);
18083 isl::set point::subtract(const isl::set &set2) const
18085 if (!ptr)
18086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18087 return isl::basic_set(*this).subtract(set2);
18090 isl::union_set point::subtract(const isl::union_set &uset2) const
18092 if (!ptr)
18093 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18094 return isl::basic_set(*this).subtract(uset2);
18097 isl::set_list point::to_list() const
18099 if (!ptr)
18100 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18101 return isl::basic_set(*this).to_list();
18104 isl::set point::to_set() const
18106 if (!ptr)
18107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18108 auto saved_ctx = ctx();
18109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18110 auto res = isl_point_to_set(copy());
18111 if (!res)
18112 exception::throw_last_error(saved_ctx);
18113 return manage(res);
18116 isl::union_set point::to_union_set() const
18118 if (!ptr)
18119 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18120 return isl::basic_set(*this).to_union_set();
18123 isl::map point::translation() const
18125 if (!ptr)
18126 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18127 return isl::basic_set(*this).translation();
18130 unsigned point::tuple_dim() const
18132 if (!ptr)
18133 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18134 return isl::basic_set(*this).tuple_dim();
18137 isl::set point::unbind_params(const isl::multi_id &tuple) const
18139 if (!ptr)
18140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18141 return isl::basic_set(*this).unbind_params(tuple);
18144 isl::map point::unbind_params_insert_domain(const isl::multi_id &domain) const
18146 if (!ptr)
18147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18148 return isl::basic_set(*this).unbind_params_insert_domain(domain);
18151 isl::set point::unite(const isl::basic_set &bset2) const
18153 if (!ptr)
18154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18155 return isl::basic_set(*this).unite(bset2);
18158 isl::set point::unite(const isl::set &set2) const
18160 if (!ptr)
18161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18162 return isl::basic_set(*this).unite(set2);
18165 isl::union_set point::unite(const isl::union_set &uset2) const
18167 if (!ptr)
18168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18169 return isl::basic_set(*this).unite(uset2);
18172 isl::basic_set point::unshifted_simple_hull() const
18174 if (!ptr)
18175 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18176 return isl::basic_set(*this).unshifted_simple_hull();
18179 isl::map point::unwrap() const
18181 if (!ptr)
18182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18183 return isl::basic_set(*this).unwrap();
18186 isl::set point::upper_bound(const isl::multi_pw_aff &upper) const
18188 if (!ptr)
18189 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18190 return isl::basic_set(*this).upper_bound(upper);
18193 isl::set point::upper_bound(const isl::multi_val &upper) const
18195 if (!ptr)
18196 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18197 return isl::basic_set(*this).upper_bound(upper);
18200 isl::set point::wrapped_reverse() const
18202 if (!ptr)
18203 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18204 return isl::basic_set(*this).wrapped_reverse();
18207 inline std::ostream &operator<<(std::ostream &os, const point &obj)
18209 if (!obj.get())
18210 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18211 auto saved_ctx = isl_point_get_ctx(obj.get());
18212 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18213 char *str = isl_point_to_str(obj.get());
18214 if (!str)
18215 exception::throw_last_error(saved_ctx);
18216 os << str;
18217 free(str);
18218 return os;
18221 // implementations for isl::pw_aff
18222 pw_aff manage(__isl_take isl_pw_aff *ptr) {
18223 if (!ptr)
18224 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18225 return pw_aff(ptr);
18227 pw_aff manage_copy(__isl_keep isl_pw_aff *ptr) {
18228 if (!ptr)
18229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18230 auto saved_ctx = isl_pw_aff_get_ctx(ptr);
18231 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18232 ptr = isl_pw_aff_copy(ptr);
18233 if (!ptr)
18234 exception::throw_last_error(saved_ctx);
18235 return pw_aff(ptr);
18238 pw_aff::pw_aff(__isl_take isl_pw_aff *ptr)
18239 : ptr(ptr) {}
18241 pw_aff::pw_aff()
18242 : ptr(nullptr) {}
18244 pw_aff::pw_aff(const pw_aff &obj)
18245 : ptr(nullptr)
18247 if (!obj.ptr)
18248 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18249 auto saved_ctx = isl_pw_aff_get_ctx(obj.ptr);
18250 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18251 ptr = obj.copy();
18252 if (!ptr)
18253 exception::throw_last_error(saved_ctx);
18256 pw_aff::pw_aff(isl::aff aff)
18258 if (aff.is_null())
18259 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18260 auto saved_ctx = aff.ctx();
18261 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18262 auto res = isl_pw_aff_from_aff(aff.release());
18263 if (!res)
18264 exception::throw_last_error(saved_ctx);
18265 ptr = res;
18268 pw_aff::pw_aff(isl::ctx ctx, const std::string &str)
18270 auto saved_ctx = ctx;
18271 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18272 auto res = isl_pw_aff_read_from_str(ctx.release(), str.c_str());
18273 if (!res)
18274 exception::throw_last_error(saved_ctx);
18275 ptr = res;
18278 pw_aff &pw_aff::operator=(pw_aff obj) {
18279 std::swap(this->ptr, obj.ptr);
18280 return *this;
18283 pw_aff::~pw_aff() {
18284 if (ptr)
18285 isl_pw_aff_free(ptr);
18288 __isl_give isl_pw_aff *pw_aff::copy() const & {
18289 return isl_pw_aff_copy(ptr);
18292 __isl_keep isl_pw_aff *pw_aff::get() const {
18293 return ptr;
18296 __isl_give isl_pw_aff *pw_aff::release() {
18297 isl_pw_aff *tmp = ptr;
18298 ptr = nullptr;
18299 return tmp;
18302 bool pw_aff::is_null() const {
18303 return ptr == nullptr;
18306 isl::ctx pw_aff::ctx() const {
18307 return isl::ctx(isl_pw_aff_get_ctx(ptr));
18310 isl::multi_pw_aff pw_aff::add(const isl::multi_pw_aff &multi2) const
18312 if (!ptr)
18313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18314 return isl::pw_multi_aff(*this).add(multi2);
18317 isl::multi_union_pw_aff pw_aff::add(const isl::multi_union_pw_aff &multi2) const
18319 if (!ptr)
18320 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18321 return isl::union_pw_aff(*this).add(multi2);
18324 isl::pw_aff pw_aff::add(isl::pw_aff pwaff2) const
18326 if (!ptr || pwaff2.is_null())
18327 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18328 auto saved_ctx = ctx();
18329 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18330 auto res = isl_pw_aff_add(copy(), pwaff2.release());
18331 if (!res)
18332 exception::throw_last_error(saved_ctx);
18333 return manage(res);
18336 isl::pw_multi_aff pw_aff::add(const isl::pw_multi_aff &pma2) const
18338 if (!ptr)
18339 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18340 return isl::pw_multi_aff(*this).add(pma2);
18343 isl::union_pw_aff pw_aff::add(const isl::union_pw_aff &upa2) const
18345 if (!ptr)
18346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18347 return isl::union_pw_aff(*this).add(upa2);
18350 isl::union_pw_multi_aff pw_aff::add(const isl::union_pw_multi_aff &upma2) const
18352 if (!ptr)
18353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18354 return isl::union_pw_aff(*this).add(upma2);
18357 isl::pw_aff pw_aff::add(const isl::aff &pwaff2) const
18359 if (!ptr)
18360 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18361 return this->add(isl::pw_aff(pwaff2));
18364 isl::pw_aff pw_aff::add_constant(isl::val v) const
18366 if (!ptr || v.is_null())
18367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18368 auto saved_ctx = ctx();
18369 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18370 auto res = isl_pw_aff_add_constant_val(copy(), v.release());
18371 if (!res)
18372 exception::throw_last_error(saved_ctx);
18373 return manage(res);
18376 isl::pw_aff pw_aff::add_constant(long v) const
18378 if (!ptr)
18379 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18380 return this->add_constant(isl::val(ctx(), v));
18383 isl::pw_multi_aff pw_aff::add_constant(const isl::multi_val &mv) const
18385 if (!ptr)
18386 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18387 return isl::pw_multi_aff(*this).add_constant(mv);
18390 isl::union_pw_multi_aff pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
18392 if (!ptr)
18393 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18394 return isl::union_pw_aff(*this).apply(upma2);
18397 isl::aff pw_aff::as_aff() const
18399 if (!ptr)
18400 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18401 auto saved_ctx = ctx();
18402 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18403 auto res = isl_pw_aff_as_aff(copy());
18404 if (!res)
18405 exception::throw_last_error(saved_ctx);
18406 return manage(res);
18409 isl::map pw_aff::as_map() const
18411 if (!ptr)
18412 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18413 auto saved_ctx = ctx();
18414 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18415 auto res = isl_pw_aff_as_map(copy());
18416 if (!res)
18417 exception::throw_last_error(saved_ctx);
18418 return manage(res);
18421 isl::multi_aff pw_aff::as_multi_aff() const
18423 if (!ptr)
18424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18425 return isl::pw_multi_aff(*this).as_multi_aff();
18428 isl::multi_union_pw_aff pw_aff::as_multi_union_pw_aff() const
18430 if (!ptr)
18431 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18432 return isl::union_pw_aff(*this).as_multi_union_pw_aff();
18435 isl::pw_multi_aff pw_aff::as_pw_multi_aff() const
18437 if (!ptr)
18438 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18439 return isl::union_pw_aff(*this).as_pw_multi_aff();
18442 isl::set pw_aff::as_set() const
18444 if (!ptr)
18445 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18446 return isl::pw_multi_aff(*this).as_set();
18449 isl::union_map pw_aff::as_union_map() const
18451 if (!ptr)
18452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18453 return isl::union_pw_aff(*this).as_union_map();
18456 isl::pw_aff pw_aff::at(int pos) const
18458 if (!ptr)
18459 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18460 return isl::pw_multi_aff(*this).at(pos);
18463 isl::set pw_aff::bind(const isl::multi_id &tuple) const
18465 if (!ptr)
18466 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18467 return isl::multi_pw_aff(*this).bind(tuple);
18470 isl::set pw_aff::bind(isl::id id) const
18472 if (!ptr || id.is_null())
18473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18474 auto saved_ctx = ctx();
18475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18476 auto res = isl_pw_aff_bind_id(copy(), id.release());
18477 if (!res)
18478 exception::throw_last_error(saved_ctx);
18479 return manage(res);
18482 isl::set pw_aff::bind(const std::string &id) const
18484 if (!ptr)
18485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18486 return this->bind(isl::id(ctx(), id));
18489 isl::pw_aff pw_aff::bind_domain(isl::multi_id tuple) const
18491 if (!ptr || tuple.is_null())
18492 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18493 auto saved_ctx = ctx();
18494 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18495 auto res = isl_pw_aff_bind_domain(copy(), tuple.release());
18496 if (!res)
18497 exception::throw_last_error(saved_ctx);
18498 return manage(res);
18501 isl::pw_aff pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
18503 if (!ptr || tuple.is_null())
18504 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18505 auto saved_ctx = ctx();
18506 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18507 auto res = isl_pw_aff_bind_domain_wrapped_domain(copy(), tuple.release());
18508 if (!res)
18509 exception::throw_last_error(saved_ctx);
18510 return manage(res);
18513 isl::pw_aff pw_aff::ceil() const
18515 if (!ptr)
18516 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18517 auto saved_ctx = ctx();
18518 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18519 auto res = isl_pw_aff_ceil(copy());
18520 if (!res)
18521 exception::throw_last_error(saved_ctx);
18522 return manage(res);
18525 isl::pw_aff pw_aff::coalesce() const
18527 if (!ptr)
18528 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18529 auto saved_ctx = ctx();
18530 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18531 auto res = isl_pw_aff_coalesce(copy());
18532 if (!res)
18533 exception::throw_last_error(saved_ctx);
18534 return manage(res);
18537 isl::pw_aff pw_aff::cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const
18539 if (!ptr || pwaff_true.is_null() || pwaff_false.is_null())
18540 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18541 auto saved_ctx = ctx();
18542 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18543 auto res = isl_pw_aff_cond(copy(), pwaff_true.release(), pwaff_false.release());
18544 if (!res)
18545 exception::throw_last_error(saved_ctx);
18546 return manage(res);
18549 isl::pw_aff pw_aff::div(isl::pw_aff pa2) const
18551 if (!ptr || pa2.is_null())
18552 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18553 auto saved_ctx = ctx();
18554 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18555 auto res = isl_pw_aff_div(copy(), pa2.release());
18556 if (!res)
18557 exception::throw_last_error(saved_ctx);
18558 return manage(res);
18561 isl::set pw_aff::domain() const
18563 if (!ptr)
18564 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18565 auto saved_ctx = ctx();
18566 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18567 auto res = isl_pw_aff_domain(copy());
18568 if (!res)
18569 exception::throw_last_error(saved_ctx);
18570 return manage(res);
18573 isl::pw_aff pw_aff::domain_reverse() const
18575 if (!ptr)
18576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18577 auto saved_ctx = ctx();
18578 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18579 auto res = isl_pw_aff_domain_reverse(copy());
18580 if (!res)
18581 exception::throw_last_error(saved_ctx);
18582 return manage(res);
18585 isl::pw_aff pw_aff::drop_unused_params() const
18587 if (!ptr)
18588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18589 auto saved_ctx = ctx();
18590 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18591 auto res = isl_pw_aff_drop_unused_params(copy());
18592 if (!res)
18593 exception::throw_last_error(saved_ctx);
18594 return manage(res);
18597 isl::set pw_aff::eq_set(isl::pw_aff pwaff2) const
18599 if (!ptr || pwaff2.is_null())
18600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18601 auto saved_ctx = ctx();
18602 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18603 auto res = isl_pw_aff_eq_set(copy(), pwaff2.release());
18604 if (!res)
18605 exception::throw_last_error(saved_ctx);
18606 return manage(res);
18609 isl::val pw_aff::eval(isl::point pnt) const
18611 if (!ptr || pnt.is_null())
18612 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18613 auto saved_ctx = ctx();
18614 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18615 auto res = isl_pw_aff_eval(copy(), pnt.release());
18616 if (!res)
18617 exception::throw_last_error(saved_ctx);
18618 return manage(res);
18621 isl::pw_multi_aff pw_aff::extract_pw_multi_aff(const isl::space &space) const
18623 if (!ptr)
18624 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18625 return isl::union_pw_aff(*this).extract_pw_multi_aff(space);
18628 isl::multi_pw_aff pw_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
18630 if (!ptr)
18631 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18632 return isl::pw_multi_aff(*this).flat_range_product(multi2);
18635 isl::multi_union_pw_aff pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
18637 if (!ptr)
18638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18639 return isl::union_pw_aff(*this).flat_range_product(multi2);
18642 isl::pw_multi_aff pw_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
18644 if (!ptr)
18645 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18646 return isl::pw_multi_aff(*this).flat_range_product(pma2);
18649 isl::union_pw_multi_aff pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
18651 if (!ptr)
18652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18653 return isl::union_pw_aff(*this).flat_range_product(upma2);
18656 isl::pw_aff pw_aff::floor() const
18658 if (!ptr)
18659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18660 auto saved_ctx = ctx();
18661 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18662 auto res = isl_pw_aff_floor(copy());
18663 if (!res)
18664 exception::throw_last_error(saved_ctx);
18665 return manage(res);
18668 void pw_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
18670 if (!ptr)
18671 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18672 return isl::pw_multi_aff(*this).foreach_piece(fn);
18675 isl::set pw_aff::ge_set(isl::pw_aff pwaff2) const
18677 if (!ptr || pwaff2.is_null())
18678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18679 auto saved_ctx = ctx();
18680 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18681 auto res = isl_pw_aff_ge_set(copy(), pwaff2.release());
18682 if (!res)
18683 exception::throw_last_error(saved_ctx);
18684 return manage(res);
18687 isl::pw_aff pw_aff::gist(isl::set context) const
18689 if (!ptr || context.is_null())
18690 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18691 auto saved_ctx = ctx();
18692 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18693 auto res = isl_pw_aff_gist(copy(), context.release());
18694 if (!res)
18695 exception::throw_last_error(saved_ctx);
18696 return manage(res);
18699 isl::union_pw_aff pw_aff::gist(const isl::union_set &context) const
18701 if (!ptr)
18702 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18703 return isl::union_pw_aff(*this).gist(context);
18706 isl::pw_aff pw_aff::gist(const isl::basic_set &context) const
18708 if (!ptr)
18709 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18710 return this->gist(isl::set(context));
18713 isl::pw_aff pw_aff::gist(const isl::point &context) const
18715 if (!ptr)
18716 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18717 return this->gist(isl::set(context));
18720 isl::pw_aff pw_aff::gist_params(isl::set context) const
18722 if (!ptr || context.is_null())
18723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18724 auto saved_ctx = ctx();
18725 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18726 auto res = isl_pw_aff_gist_params(copy(), context.release());
18727 if (!res)
18728 exception::throw_last_error(saved_ctx);
18729 return manage(res);
18732 isl::set pw_aff::gt_set(isl::pw_aff pwaff2) const
18734 if (!ptr || pwaff2.is_null())
18735 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18736 auto saved_ctx = ctx();
18737 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18738 auto res = isl_pw_aff_gt_set(copy(), pwaff2.release());
18739 if (!res)
18740 exception::throw_last_error(saved_ctx);
18741 return manage(res);
18744 bool pw_aff::has_range_tuple_id() const
18746 if (!ptr)
18747 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18748 return isl::pw_multi_aff(*this).has_range_tuple_id();
18751 isl::multi_pw_aff pw_aff::identity() const
18753 if (!ptr)
18754 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18755 return isl::pw_multi_aff(*this).identity();
18758 isl::pw_aff pw_aff::insert_domain(isl::space domain) const
18760 if (!ptr || domain.is_null())
18761 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18762 auto saved_ctx = ctx();
18763 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18764 auto res = isl_pw_aff_insert_domain(copy(), domain.release());
18765 if (!res)
18766 exception::throw_last_error(saved_ctx);
18767 return manage(res);
18770 isl::pw_aff pw_aff::intersect_domain(isl::set set) const
18772 if (!ptr || set.is_null())
18773 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18774 auto saved_ctx = ctx();
18775 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18776 auto res = isl_pw_aff_intersect_domain(copy(), set.release());
18777 if (!res)
18778 exception::throw_last_error(saved_ctx);
18779 return manage(res);
18782 isl::union_pw_aff pw_aff::intersect_domain(const isl::space &space) const
18784 if (!ptr)
18785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18786 return isl::union_pw_aff(*this).intersect_domain(space);
18789 isl::union_pw_aff pw_aff::intersect_domain(const isl::union_set &uset) const
18791 if (!ptr)
18792 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18793 return isl::union_pw_aff(*this).intersect_domain(uset);
18796 isl::pw_aff pw_aff::intersect_domain(const isl::basic_set &set) const
18798 if (!ptr)
18799 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18800 return this->intersect_domain(isl::set(set));
18803 isl::pw_aff pw_aff::intersect_domain(const isl::point &set) const
18805 if (!ptr)
18806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18807 return this->intersect_domain(isl::set(set));
18810 isl::union_pw_aff pw_aff::intersect_domain_wrapped_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_wrapped_domain(uset);
18817 isl::union_pw_aff pw_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
18819 if (!ptr)
18820 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18821 return isl::union_pw_aff(*this).intersect_domain_wrapped_range(uset);
18824 isl::pw_aff pw_aff::intersect_params(isl::set set) const
18826 if (!ptr || set.is_null())
18827 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18828 auto saved_ctx = ctx();
18829 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18830 auto res = isl_pw_aff_intersect_params(copy(), set.release());
18831 if (!res)
18832 exception::throw_last_error(saved_ctx);
18833 return manage(res);
18836 bool pw_aff::involves_locals() const
18838 if (!ptr)
18839 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18840 return isl::pw_multi_aff(*this).involves_locals();
18843 bool pw_aff::involves_nan() const
18845 if (!ptr)
18846 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18847 return isl::multi_pw_aff(*this).involves_nan();
18850 bool pw_aff::involves_param(const isl::id &id) const
18852 if (!ptr)
18853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18854 return isl::pw_multi_aff(*this).involves_param(id);
18857 bool pw_aff::involves_param(const std::string &id) const
18859 if (!ptr)
18860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18861 return this->involves_param(isl::id(ctx(), id));
18864 bool pw_aff::involves_param(const isl::id_list &list) const
18866 if (!ptr)
18867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18868 return isl::pw_multi_aff(*this).involves_param(list);
18871 bool pw_aff::isa_aff() const
18873 if (!ptr)
18874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18875 auto saved_ctx = ctx();
18876 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18877 auto res = isl_pw_aff_isa_aff(get());
18878 if (res < 0)
18879 exception::throw_last_error(saved_ctx);
18880 return res;
18883 bool pw_aff::isa_multi_aff() const
18885 if (!ptr)
18886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18887 return isl::pw_multi_aff(*this).isa_multi_aff();
18890 bool pw_aff::isa_pw_multi_aff() const
18892 if (!ptr)
18893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18894 return isl::union_pw_aff(*this).isa_pw_multi_aff();
18897 isl::set pw_aff::le_set(isl::pw_aff pwaff2) const
18899 if (!ptr || pwaff2.is_null())
18900 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18901 auto saved_ctx = ctx();
18902 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18903 auto res = isl_pw_aff_le_set(copy(), pwaff2.release());
18904 if (!res)
18905 exception::throw_last_error(saved_ctx);
18906 return manage(res);
18909 isl::pw_aff_list pw_aff::list() const
18911 if (!ptr)
18912 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18913 return isl::multi_pw_aff(*this).list();
18916 isl::set pw_aff::lt_set(isl::pw_aff pwaff2) const
18918 if (!ptr || pwaff2.is_null())
18919 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18920 auto saved_ctx = ctx();
18921 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18922 auto res = isl_pw_aff_lt_set(copy(), pwaff2.release());
18923 if (!res)
18924 exception::throw_last_error(saved_ctx);
18925 return manage(res);
18928 isl::multi_pw_aff pw_aff::max(const isl::multi_pw_aff &multi2) const
18930 if (!ptr)
18931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18932 return isl::pw_multi_aff(*this).max(multi2);
18935 isl::pw_aff pw_aff::max(isl::pw_aff pwaff2) const
18937 if (!ptr || pwaff2.is_null())
18938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18939 auto saved_ctx = ctx();
18940 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18941 auto res = isl_pw_aff_max(copy(), pwaff2.release());
18942 if (!res)
18943 exception::throw_last_error(saved_ctx);
18944 return manage(res);
18947 isl::pw_aff pw_aff::max(const isl::aff &pwaff2) const
18949 if (!ptr)
18950 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18951 return this->max(isl::pw_aff(pwaff2));
18954 isl::multi_val pw_aff::max_multi_val() const
18956 if (!ptr)
18957 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18958 return isl::pw_multi_aff(*this).max_multi_val();
18961 isl::val pw_aff::max_val() const
18963 if (!ptr)
18964 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18965 auto saved_ctx = ctx();
18966 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18967 auto res = isl_pw_aff_max_val(copy());
18968 if (!res)
18969 exception::throw_last_error(saved_ctx);
18970 return manage(res);
18973 isl::multi_pw_aff pw_aff::min(const isl::multi_pw_aff &multi2) const
18975 if (!ptr)
18976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18977 return isl::pw_multi_aff(*this).min(multi2);
18980 isl::pw_aff pw_aff::min(isl::pw_aff pwaff2) const
18982 if (!ptr || pwaff2.is_null())
18983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18984 auto saved_ctx = ctx();
18985 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
18986 auto res = isl_pw_aff_min(copy(), pwaff2.release());
18987 if (!res)
18988 exception::throw_last_error(saved_ctx);
18989 return manage(res);
18992 isl::pw_aff pw_aff::min(const isl::aff &pwaff2) const
18994 if (!ptr)
18995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
18996 return this->min(isl::pw_aff(pwaff2));
18999 isl::multi_val pw_aff::min_multi_val() const
19001 if (!ptr)
19002 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19003 return isl::pw_multi_aff(*this).min_multi_val();
19006 isl::val pw_aff::min_val() const
19008 if (!ptr)
19009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19010 auto saved_ctx = ctx();
19011 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19012 auto res = isl_pw_aff_min_val(copy());
19013 if (!res)
19014 exception::throw_last_error(saved_ctx);
19015 return manage(res);
19018 isl::pw_aff pw_aff::mod(isl::val mod) const
19020 if (!ptr || mod.is_null())
19021 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19022 auto saved_ctx = ctx();
19023 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19024 auto res = isl_pw_aff_mod_val(copy(), mod.release());
19025 if (!res)
19026 exception::throw_last_error(saved_ctx);
19027 return manage(res);
19030 isl::pw_aff pw_aff::mod(long mod) const
19032 if (!ptr)
19033 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19034 return this->mod(isl::val(ctx(), mod));
19037 isl::pw_aff pw_aff::mul(isl::pw_aff pwaff2) const
19039 if (!ptr || pwaff2.is_null())
19040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19041 auto saved_ctx = ctx();
19042 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19043 auto res = isl_pw_aff_mul(copy(), pwaff2.release());
19044 if (!res)
19045 exception::throw_last_error(saved_ctx);
19046 return manage(res);
19049 unsigned pw_aff::n_piece() const
19051 if (!ptr)
19052 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19053 return isl::pw_multi_aff(*this).n_piece();
19056 isl::set pw_aff::ne_set(isl::pw_aff pwaff2) const
19058 if (!ptr || pwaff2.is_null())
19059 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19060 auto saved_ctx = ctx();
19061 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19062 auto res = isl_pw_aff_ne_set(copy(), pwaff2.release());
19063 if (!res)
19064 exception::throw_last_error(saved_ctx);
19065 return manage(res);
19068 isl::pw_aff pw_aff::neg() const
19070 if (!ptr)
19071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19072 auto saved_ctx = ctx();
19073 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19074 auto res = isl_pw_aff_neg(copy());
19075 if (!res)
19076 exception::throw_last_error(saved_ctx);
19077 return manage(res);
19080 isl::pw_aff pw_aff::param_on_domain(isl::set domain, isl::id id)
19082 if (domain.is_null() || id.is_null())
19083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19084 auto saved_ctx = domain.ctx();
19085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19086 auto res = isl_pw_aff_param_on_domain_id(domain.release(), id.release());
19087 if (!res)
19088 exception::throw_last_error(saved_ctx);
19089 return manage(res);
19092 isl::set pw_aff::params() const
19094 if (!ptr)
19095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19096 auto saved_ctx = ctx();
19097 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19098 auto res = isl_pw_aff_params(copy());
19099 if (!res)
19100 exception::throw_last_error(saved_ctx);
19101 return manage(res);
19104 bool pw_aff::plain_is_empty() const
19106 if (!ptr)
19107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19108 return isl::union_pw_aff(*this).plain_is_empty();
19111 bool pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
19113 if (!ptr)
19114 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19115 return isl::pw_multi_aff(*this).plain_is_equal(multi2);
19118 bool pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
19120 if (!ptr)
19121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19122 return isl::union_pw_aff(*this).plain_is_equal(multi2);
19125 bool pw_aff::plain_is_equal(const isl::pw_aff &pwaff2) const
19127 if (!ptr || pwaff2.is_null())
19128 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19129 auto saved_ctx = ctx();
19130 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19131 auto res = isl_pw_aff_plain_is_equal(get(), pwaff2.get());
19132 if (res < 0)
19133 exception::throw_last_error(saved_ctx);
19134 return res;
19137 bool pw_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
19139 if (!ptr)
19140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19141 return isl::pw_multi_aff(*this).plain_is_equal(pma2);
19144 bool pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
19146 if (!ptr)
19147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19148 return isl::union_pw_aff(*this).plain_is_equal(upa2);
19151 bool pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
19153 if (!ptr)
19154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19155 return isl::union_pw_aff(*this).plain_is_equal(upma2);
19158 bool pw_aff::plain_is_equal(const isl::aff &pwaff2) const
19160 if (!ptr)
19161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19162 return this->plain_is_equal(isl::pw_aff(pwaff2));
19165 isl::pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
19167 if (!ptr)
19168 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19169 return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
19172 isl::union_pw_multi_aff pw_aff::preimage_domain_wrapped_domain(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).preimage_domain_wrapped_domain(upma2);
19179 isl::multi_pw_aff pw_aff::product(const isl::multi_pw_aff &multi2) const
19181 if (!ptr)
19182 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19183 return isl::pw_multi_aff(*this).product(multi2);
19186 isl::pw_multi_aff pw_aff::product(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).product(pma2);
19193 isl::pw_aff pw_aff::pullback(isl::multi_aff ma) const
19195 if (!ptr || ma.is_null())
19196 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19197 auto saved_ctx = ctx();
19198 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19199 auto res = isl_pw_aff_pullback_multi_aff(copy(), ma.release());
19200 if (!res)
19201 exception::throw_last_error(saved_ctx);
19202 return manage(res);
19205 isl::pw_aff pw_aff::pullback(isl::multi_pw_aff mpa) const
19207 if (!ptr || mpa.is_null())
19208 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19209 auto saved_ctx = ctx();
19210 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19211 auto res = isl_pw_aff_pullback_multi_pw_aff(copy(), mpa.release());
19212 if (!res)
19213 exception::throw_last_error(saved_ctx);
19214 return manage(res);
19217 isl::pw_aff pw_aff::pullback(isl::pw_multi_aff pma) const
19219 if (!ptr || pma.is_null())
19220 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19221 auto saved_ctx = ctx();
19222 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19223 auto res = isl_pw_aff_pullback_pw_multi_aff(copy(), pma.release());
19224 if (!res)
19225 exception::throw_last_error(saved_ctx);
19226 return manage(res);
19229 isl::union_pw_aff pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
19231 if (!ptr)
19232 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19233 return isl::union_pw_aff(*this).pullback(upma);
19236 isl::pw_multi_aff_list pw_aff::pw_multi_aff_list() const
19238 if (!ptr)
19239 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19240 return isl::union_pw_aff(*this).pw_multi_aff_list();
19243 isl::pw_multi_aff pw_aff::range_factor_domain() const
19245 if (!ptr)
19246 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19247 return isl::pw_multi_aff(*this).range_factor_domain();
19250 isl::pw_multi_aff pw_aff::range_factor_range() const
19252 if (!ptr)
19253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19254 return isl::pw_multi_aff(*this).range_factor_range();
19257 isl::multi_pw_aff pw_aff::range_product(const isl::multi_pw_aff &multi2) const
19259 if (!ptr)
19260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19261 return isl::pw_multi_aff(*this).range_product(multi2);
19264 isl::multi_union_pw_aff pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
19266 if (!ptr)
19267 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19268 return isl::union_pw_aff(*this).range_product(multi2);
19271 isl::pw_multi_aff pw_aff::range_product(const isl::pw_multi_aff &pma2) const
19273 if (!ptr)
19274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19275 return isl::pw_multi_aff(*this).range_product(pma2);
19278 isl::union_pw_multi_aff pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
19280 if (!ptr)
19281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19282 return isl::union_pw_aff(*this).range_product(upma2);
19285 isl::id pw_aff::range_tuple_id() const
19287 if (!ptr)
19288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19289 return isl::pw_multi_aff(*this).range_tuple_id();
19292 isl::multi_pw_aff pw_aff::reset_range_tuple_id() const
19294 if (!ptr)
19295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19296 return isl::multi_pw_aff(*this).reset_range_tuple_id();
19299 isl::pw_aff pw_aff::scale(isl::val v) const
19301 if (!ptr || v.is_null())
19302 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19303 auto saved_ctx = ctx();
19304 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19305 auto res = isl_pw_aff_scale_val(copy(), v.release());
19306 if (!res)
19307 exception::throw_last_error(saved_ctx);
19308 return manage(res);
19311 isl::pw_aff pw_aff::scale(long v) const
19313 if (!ptr)
19314 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19315 return this->scale(isl::val(ctx(), v));
19318 isl::pw_multi_aff pw_aff::scale(const isl::multi_val &mv) const
19320 if (!ptr)
19321 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19322 return isl::pw_multi_aff(*this).scale(mv);
19325 isl::pw_aff pw_aff::scale_down(isl::val f) const
19327 if (!ptr || f.is_null())
19328 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19329 auto saved_ctx = ctx();
19330 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19331 auto res = isl_pw_aff_scale_down_val(copy(), f.release());
19332 if (!res)
19333 exception::throw_last_error(saved_ctx);
19334 return manage(res);
19337 isl::pw_aff pw_aff::scale_down(long f) const
19339 if (!ptr)
19340 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19341 return this->scale_down(isl::val(ctx(), f));
19344 isl::pw_multi_aff pw_aff::scale_down(const isl::multi_val &mv) const
19346 if (!ptr)
19347 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19348 return isl::pw_multi_aff(*this).scale_down(mv);
19351 isl::multi_pw_aff pw_aff::set_at(int pos, const isl::pw_aff &el) const
19353 if (!ptr)
19354 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19355 return isl::pw_multi_aff(*this).set_at(pos, el);
19358 isl::multi_union_pw_aff pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
19360 if (!ptr)
19361 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19362 return isl::union_pw_aff(*this).set_at(pos, el);
19365 isl::pw_multi_aff pw_aff::set_range_tuple(const isl::id &id) const
19367 if (!ptr)
19368 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19369 return isl::pw_multi_aff(*this).set_range_tuple(id);
19372 isl::pw_multi_aff pw_aff::set_range_tuple(const std::string &id) const
19374 if (!ptr)
19375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19376 return this->set_range_tuple(isl::id(ctx(), id));
19379 unsigned pw_aff::size() const
19381 if (!ptr)
19382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19383 return isl::multi_pw_aff(*this).size();
19386 isl::space pw_aff::space() const
19388 if (!ptr)
19389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19390 auto saved_ctx = ctx();
19391 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19392 auto res = isl_pw_aff_get_space(get());
19393 if (!res)
19394 exception::throw_last_error(saved_ctx);
19395 return manage(res);
19398 isl::space pw_aff::get_space() const
19400 return space();
19403 isl::multi_pw_aff pw_aff::sub(const isl::multi_pw_aff &multi2) const
19405 if (!ptr)
19406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19407 return isl::pw_multi_aff(*this).sub(multi2);
19410 isl::multi_union_pw_aff pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
19412 if (!ptr)
19413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19414 return isl::union_pw_aff(*this).sub(multi2);
19417 isl::pw_aff pw_aff::sub(isl::pw_aff pwaff2) const
19419 if (!ptr || pwaff2.is_null())
19420 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19421 auto saved_ctx = ctx();
19422 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19423 auto res = isl_pw_aff_sub(copy(), pwaff2.release());
19424 if (!res)
19425 exception::throw_last_error(saved_ctx);
19426 return manage(res);
19429 isl::pw_multi_aff pw_aff::sub(const isl::pw_multi_aff &pma2) const
19431 if (!ptr)
19432 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19433 return isl::pw_multi_aff(*this).sub(pma2);
19436 isl::union_pw_aff pw_aff::sub(const isl::union_pw_aff &upa2) const
19438 if (!ptr)
19439 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19440 return isl::union_pw_aff(*this).sub(upa2);
19443 isl::union_pw_multi_aff pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
19445 if (!ptr)
19446 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19447 return isl::union_pw_aff(*this).sub(upma2);
19450 isl::pw_aff pw_aff::sub(const isl::aff &pwaff2) const
19452 if (!ptr)
19453 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19454 return this->sub(isl::pw_aff(pwaff2));
19457 isl::pw_aff pw_aff::subtract_domain(isl::set set) const
19459 if (!ptr || set.is_null())
19460 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19461 auto saved_ctx = ctx();
19462 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19463 auto res = isl_pw_aff_subtract_domain(copy(), set.release());
19464 if (!res)
19465 exception::throw_last_error(saved_ctx);
19466 return manage(res);
19469 isl::union_pw_aff pw_aff::subtract_domain(const isl::space &space) const
19471 if (!ptr)
19472 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19473 return isl::union_pw_aff(*this).subtract_domain(space);
19476 isl::union_pw_aff pw_aff::subtract_domain(const isl::union_set &uset) const
19478 if (!ptr)
19479 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19480 return isl::union_pw_aff(*this).subtract_domain(uset);
19483 isl::pw_aff pw_aff::subtract_domain(const isl::basic_set &set) const
19485 if (!ptr)
19486 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19487 return this->subtract_domain(isl::set(set));
19490 isl::pw_aff pw_aff::subtract_domain(const isl::point &set) const
19492 if (!ptr)
19493 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19494 return this->subtract_domain(isl::set(set));
19497 isl::pw_aff pw_aff::tdiv_q(isl::pw_aff pa2) const
19499 if (!ptr || pa2.is_null())
19500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19501 auto saved_ctx = ctx();
19502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19503 auto res = isl_pw_aff_tdiv_q(copy(), pa2.release());
19504 if (!res)
19505 exception::throw_last_error(saved_ctx);
19506 return manage(res);
19509 isl::pw_aff pw_aff::tdiv_r(isl::pw_aff pa2) const
19511 if (!ptr || pa2.is_null())
19512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19513 auto saved_ctx = ctx();
19514 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19515 auto res = isl_pw_aff_tdiv_r(copy(), pa2.release());
19516 if (!res)
19517 exception::throw_last_error(saved_ctx);
19518 return manage(res);
19521 isl::pw_aff_list pw_aff::to_list() const
19523 if (!ptr)
19524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19525 auto saved_ctx = ctx();
19526 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19527 auto res = isl_pw_aff_to_list(copy());
19528 if (!res)
19529 exception::throw_last_error(saved_ctx);
19530 return manage(res);
19533 isl::multi_pw_aff pw_aff::to_multi_pw_aff() const
19535 if (!ptr)
19536 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19537 return isl::pw_multi_aff(*this).to_multi_pw_aff();
19540 isl::union_pw_aff pw_aff::to_union_pw_aff() const
19542 if (!ptr)
19543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19544 auto saved_ctx = ctx();
19545 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19546 auto res = isl_pw_aff_to_union_pw_aff(copy());
19547 if (!res)
19548 exception::throw_last_error(saved_ctx);
19549 return manage(res);
19552 isl::union_pw_multi_aff pw_aff::to_union_pw_multi_aff() const
19554 if (!ptr)
19555 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19556 return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
19559 isl::multi_pw_aff pw_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
19561 if (!ptr)
19562 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19563 return isl::pw_multi_aff(*this).unbind_params_insert_domain(domain);
19566 isl::multi_pw_aff pw_aff::union_add(const isl::multi_pw_aff &mpa2) const
19568 if (!ptr)
19569 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19570 return isl::pw_multi_aff(*this).union_add(mpa2);
19573 isl::multi_union_pw_aff pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
19575 if (!ptr)
19576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19577 return isl::union_pw_aff(*this).union_add(mupa2);
19580 isl::pw_aff pw_aff::union_add(isl::pw_aff pwaff2) const
19582 if (!ptr || pwaff2.is_null())
19583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19584 auto saved_ctx = ctx();
19585 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19586 auto res = isl_pw_aff_union_add(copy(), pwaff2.release());
19587 if (!res)
19588 exception::throw_last_error(saved_ctx);
19589 return manage(res);
19592 isl::pw_multi_aff pw_aff::union_add(const isl::pw_multi_aff &pma2) const
19594 if (!ptr)
19595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19596 return isl::pw_multi_aff(*this).union_add(pma2);
19599 isl::union_pw_aff pw_aff::union_add(const isl::union_pw_aff &upa2) const
19601 if (!ptr)
19602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19603 return isl::union_pw_aff(*this).union_add(upa2);
19606 isl::union_pw_multi_aff pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
19608 if (!ptr)
19609 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19610 return isl::union_pw_aff(*this).union_add(upma2);
19613 isl::pw_aff pw_aff::union_add(const isl::aff &pwaff2) const
19615 if (!ptr)
19616 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19617 return this->union_add(isl::pw_aff(pwaff2));
19620 inline std::ostream &operator<<(std::ostream &os, const pw_aff &obj)
19622 if (!obj.get())
19623 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19624 auto saved_ctx = isl_pw_aff_get_ctx(obj.get());
19625 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19626 char *str = isl_pw_aff_to_str(obj.get());
19627 if (!str)
19628 exception::throw_last_error(saved_ctx);
19629 os << str;
19630 free(str);
19631 return os;
19634 // implementations for isl::pw_aff_list
19635 pw_aff_list manage(__isl_take isl_pw_aff_list *ptr) {
19636 if (!ptr)
19637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19638 return pw_aff_list(ptr);
19640 pw_aff_list manage_copy(__isl_keep isl_pw_aff_list *ptr) {
19641 if (!ptr)
19642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19643 auto saved_ctx = isl_pw_aff_list_get_ctx(ptr);
19644 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19645 ptr = isl_pw_aff_list_copy(ptr);
19646 if (!ptr)
19647 exception::throw_last_error(saved_ctx);
19648 return pw_aff_list(ptr);
19651 pw_aff_list::pw_aff_list(__isl_take isl_pw_aff_list *ptr)
19652 : ptr(ptr) {}
19654 pw_aff_list::pw_aff_list()
19655 : ptr(nullptr) {}
19657 pw_aff_list::pw_aff_list(const pw_aff_list &obj)
19658 : ptr(nullptr)
19660 if (!obj.ptr)
19661 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19662 auto saved_ctx = isl_pw_aff_list_get_ctx(obj.ptr);
19663 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19664 ptr = obj.copy();
19665 if (!ptr)
19666 exception::throw_last_error(saved_ctx);
19669 pw_aff_list::pw_aff_list(isl::ctx ctx, int n)
19671 auto saved_ctx = ctx;
19672 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19673 auto res = isl_pw_aff_list_alloc(ctx.release(), n);
19674 if (!res)
19675 exception::throw_last_error(saved_ctx);
19676 ptr = res;
19679 pw_aff_list::pw_aff_list(isl::pw_aff el)
19681 if (el.is_null())
19682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19683 auto saved_ctx = el.ctx();
19684 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19685 auto res = isl_pw_aff_list_from_pw_aff(el.release());
19686 if (!res)
19687 exception::throw_last_error(saved_ctx);
19688 ptr = res;
19691 pw_aff_list::pw_aff_list(isl::ctx ctx, const std::string &str)
19693 auto saved_ctx = ctx;
19694 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19695 auto res = isl_pw_aff_list_read_from_str(ctx.release(), str.c_str());
19696 if (!res)
19697 exception::throw_last_error(saved_ctx);
19698 ptr = res;
19701 pw_aff_list &pw_aff_list::operator=(pw_aff_list obj) {
19702 std::swap(this->ptr, obj.ptr);
19703 return *this;
19706 pw_aff_list::~pw_aff_list() {
19707 if (ptr)
19708 isl_pw_aff_list_free(ptr);
19711 __isl_give isl_pw_aff_list *pw_aff_list::copy() const & {
19712 return isl_pw_aff_list_copy(ptr);
19715 __isl_keep isl_pw_aff_list *pw_aff_list::get() const {
19716 return ptr;
19719 __isl_give isl_pw_aff_list *pw_aff_list::release() {
19720 isl_pw_aff_list *tmp = ptr;
19721 ptr = nullptr;
19722 return tmp;
19725 bool pw_aff_list::is_null() const {
19726 return ptr == nullptr;
19729 isl::ctx pw_aff_list::ctx() const {
19730 return isl::ctx(isl_pw_aff_list_get_ctx(ptr));
19733 isl::pw_aff_list pw_aff_list::add(isl::pw_aff el) const
19735 if (!ptr || el.is_null())
19736 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19737 auto saved_ctx = ctx();
19738 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19739 auto res = isl_pw_aff_list_add(copy(), el.release());
19740 if (!res)
19741 exception::throw_last_error(saved_ctx);
19742 return manage(res);
19745 isl::pw_aff pw_aff_list::at(int index) const
19747 if (!ptr)
19748 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19749 auto saved_ctx = ctx();
19750 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19751 auto res = isl_pw_aff_list_get_at(get(), index);
19752 if (!res)
19753 exception::throw_last_error(saved_ctx);
19754 return manage(res);
19757 isl::pw_aff pw_aff_list::get_at(int index) const
19759 return at(index);
19762 isl::pw_aff_list pw_aff_list::clear() const
19764 if (!ptr)
19765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19766 auto saved_ctx = ctx();
19767 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19768 auto res = isl_pw_aff_list_clear(copy());
19769 if (!res)
19770 exception::throw_last_error(saved_ctx);
19771 return manage(res);
19774 isl::pw_aff_list pw_aff_list::concat(isl::pw_aff_list list2) const
19776 if (!ptr || list2.is_null())
19777 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19778 auto saved_ctx = ctx();
19779 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19780 auto res = isl_pw_aff_list_concat(copy(), list2.release());
19781 if (!res)
19782 exception::throw_last_error(saved_ctx);
19783 return manage(res);
19786 isl::pw_aff_list pw_aff_list::drop(unsigned int first, unsigned int n) const
19788 if (!ptr)
19789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19790 auto saved_ctx = ctx();
19791 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19792 auto res = isl_pw_aff_list_drop(copy(), first, n);
19793 if (!res)
19794 exception::throw_last_error(saved_ctx);
19795 return manage(res);
19798 void pw_aff_list::foreach(const std::function<void(isl::pw_aff)> &fn) const
19800 if (!ptr)
19801 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19802 auto saved_ctx = ctx();
19803 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19804 struct fn_data {
19805 std::function<void(isl::pw_aff)> func;
19806 std::exception_ptr eptr;
19807 } fn_data = { fn };
19808 auto fn_lambda = [](isl_pw_aff *arg_0, void *arg_1) -> isl_stat {
19809 auto *data = static_cast<struct fn_data *>(arg_1);
19810 ISL_CPP_TRY {
19811 (data->func)(manage(arg_0));
19812 return isl_stat_ok;
19813 } ISL_CPP_CATCH_ALL {
19814 data->eptr = std::current_exception();
19815 return isl_stat_error;
19818 auto res = isl_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
19819 if (fn_data.eptr)
19820 std::rethrow_exception(fn_data.eptr);
19821 if (res < 0)
19822 exception::throw_last_error(saved_ctx);
19823 return;
19826 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
19828 if (!ptr)
19829 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19830 auto saved_ctx = ctx();
19831 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19832 struct follows_data {
19833 std::function<bool(isl::pw_aff, isl::pw_aff)> func;
19834 std::exception_ptr eptr;
19835 } follows_data = { follows };
19836 auto follows_lambda = [](isl_pw_aff *arg_0, isl_pw_aff *arg_1, void *arg_2) -> isl_bool {
19837 auto *data = static_cast<struct follows_data *>(arg_2);
19838 ISL_CPP_TRY {
19839 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
19840 return ret ? isl_bool_true : isl_bool_false;
19841 } ISL_CPP_CATCH_ALL {
19842 data->eptr = std::current_exception();
19843 return isl_bool_error;
19846 struct fn_data {
19847 std::function<void(isl::pw_aff_list)> func;
19848 std::exception_ptr eptr;
19849 } fn_data = { fn };
19850 auto fn_lambda = [](isl_pw_aff_list *arg_0, void *arg_1) -> isl_stat {
19851 auto *data = static_cast<struct fn_data *>(arg_1);
19852 ISL_CPP_TRY {
19853 (data->func)(manage(arg_0));
19854 return isl_stat_ok;
19855 } ISL_CPP_CATCH_ALL {
19856 data->eptr = std::current_exception();
19857 return isl_stat_error;
19860 auto res = isl_pw_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
19861 if (follows_data.eptr)
19862 std::rethrow_exception(follows_data.eptr);
19863 if (fn_data.eptr)
19864 std::rethrow_exception(fn_data.eptr);
19865 if (res < 0)
19866 exception::throw_last_error(saved_ctx);
19867 return;
19870 isl::pw_aff_list pw_aff_list::insert(unsigned int pos, isl::pw_aff el) const
19872 if (!ptr || el.is_null())
19873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19874 auto saved_ctx = ctx();
19875 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19876 auto res = isl_pw_aff_list_insert(copy(), pos, el.release());
19877 if (!res)
19878 exception::throw_last_error(saved_ctx);
19879 return manage(res);
19882 isl::pw_aff_list pw_aff_list::set_at(int index, isl::pw_aff el) const
19884 if (!ptr || el.is_null())
19885 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19886 auto saved_ctx = ctx();
19887 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19888 auto res = isl_pw_aff_list_set_at(copy(), index, el.release());
19889 if (!res)
19890 exception::throw_last_error(saved_ctx);
19891 return manage(res);
19894 unsigned pw_aff_list::size() const
19896 if (!ptr)
19897 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19898 auto saved_ctx = ctx();
19899 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19900 auto res = isl_pw_aff_list_size(get());
19901 if (res < 0)
19902 exception::throw_last_error(saved_ctx);
19903 return res;
19906 inline std::ostream &operator<<(std::ostream &os, const pw_aff_list &obj)
19908 if (!obj.get())
19909 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19910 auto saved_ctx = isl_pw_aff_list_get_ctx(obj.get());
19911 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19912 char *str = isl_pw_aff_list_to_str(obj.get());
19913 if (!str)
19914 exception::throw_last_error(saved_ctx);
19915 os << str;
19916 free(str);
19917 return os;
19920 // implementations for isl::pw_multi_aff
19921 pw_multi_aff manage(__isl_take isl_pw_multi_aff *ptr) {
19922 if (!ptr)
19923 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19924 return pw_multi_aff(ptr);
19926 pw_multi_aff manage_copy(__isl_keep isl_pw_multi_aff *ptr) {
19927 if (!ptr)
19928 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19929 auto saved_ctx = isl_pw_multi_aff_get_ctx(ptr);
19930 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19931 ptr = isl_pw_multi_aff_copy(ptr);
19932 if (!ptr)
19933 exception::throw_last_error(saved_ctx);
19934 return pw_multi_aff(ptr);
19937 pw_multi_aff::pw_multi_aff(__isl_take isl_pw_multi_aff *ptr)
19938 : ptr(ptr) {}
19940 pw_multi_aff::pw_multi_aff()
19941 : ptr(nullptr) {}
19943 pw_multi_aff::pw_multi_aff(const pw_multi_aff &obj)
19944 : ptr(nullptr)
19946 if (!obj.ptr)
19947 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19948 auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.ptr);
19949 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19950 ptr = obj.copy();
19951 if (!ptr)
19952 exception::throw_last_error(saved_ctx);
19955 pw_multi_aff::pw_multi_aff(isl::multi_aff ma)
19957 if (ma.is_null())
19958 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19959 auto saved_ctx = ma.ctx();
19960 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19961 auto res = isl_pw_multi_aff_from_multi_aff(ma.release());
19962 if (!res)
19963 exception::throw_last_error(saved_ctx);
19964 ptr = res;
19967 pw_multi_aff::pw_multi_aff(isl::pw_aff pa)
19969 if (pa.is_null())
19970 exception::throw_invalid("NULL input", __FILE__, __LINE__);
19971 auto saved_ctx = pa.ctx();
19972 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19973 auto res = isl_pw_multi_aff_from_pw_aff(pa.release());
19974 if (!res)
19975 exception::throw_last_error(saved_ctx);
19976 ptr = res;
19979 pw_multi_aff::pw_multi_aff(isl::ctx ctx, const std::string &str)
19981 auto saved_ctx = ctx;
19982 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
19983 auto res = isl_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
19984 if (!res)
19985 exception::throw_last_error(saved_ctx);
19986 ptr = res;
19989 pw_multi_aff &pw_multi_aff::operator=(pw_multi_aff obj) {
19990 std::swap(this->ptr, obj.ptr);
19991 return *this;
19994 pw_multi_aff::~pw_multi_aff() {
19995 if (ptr)
19996 isl_pw_multi_aff_free(ptr);
19999 __isl_give isl_pw_multi_aff *pw_multi_aff::copy() const & {
20000 return isl_pw_multi_aff_copy(ptr);
20003 __isl_keep isl_pw_multi_aff *pw_multi_aff::get() const {
20004 return ptr;
20007 __isl_give isl_pw_multi_aff *pw_multi_aff::release() {
20008 isl_pw_multi_aff *tmp = ptr;
20009 ptr = nullptr;
20010 return tmp;
20013 bool pw_multi_aff::is_null() const {
20014 return ptr == nullptr;
20017 isl::ctx pw_multi_aff::ctx() const {
20018 return isl::ctx(isl_pw_multi_aff_get_ctx(ptr));
20021 isl::multi_pw_aff pw_multi_aff::add(const isl::multi_pw_aff &multi2) const
20023 if (!ptr)
20024 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20025 return isl::multi_pw_aff(*this).add(multi2);
20028 isl::multi_union_pw_aff pw_multi_aff::add(const isl::multi_union_pw_aff &multi2) const
20030 if (!ptr)
20031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20032 return isl::multi_pw_aff(*this).add(multi2);
20035 isl::pw_multi_aff pw_multi_aff::add(isl::pw_multi_aff pma2) const
20037 if (!ptr || pma2.is_null())
20038 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20039 auto saved_ctx = ctx();
20040 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20041 auto res = isl_pw_multi_aff_add(copy(), pma2.release());
20042 if (!res)
20043 exception::throw_last_error(saved_ctx);
20044 return manage(res);
20047 isl::union_pw_multi_aff pw_multi_aff::add(const isl::union_pw_multi_aff &upma2) const
20049 if (!ptr)
20050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20051 return isl::union_pw_multi_aff(*this).add(upma2);
20054 isl::pw_multi_aff pw_multi_aff::add(const isl::multi_aff &pma2) const
20056 if (!ptr)
20057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20058 return this->add(isl::pw_multi_aff(pma2));
20061 isl::pw_multi_aff pw_multi_aff::add(const isl::pw_aff &pma2) const
20063 if (!ptr)
20064 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20065 return this->add(isl::pw_multi_aff(pma2));
20068 isl::pw_multi_aff pw_multi_aff::add_constant(isl::multi_val mv) const
20070 if (!ptr || mv.is_null())
20071 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20072 auto saved_ctx = ctx();
20073 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20074 auto res = isl_pw_multi_aff_add_constant_multi_val(copy(), mv.release());
20075 if (!res)
20076 exception::throw_last_error(saved_ctx);
20077 return manage(res);
20080 isl::pw_multi_aff pw_multi_aff::add_constant(isl::val v) const
20082 if (!ptr || v.is_null())
20083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20084 auto saved_ctx = ctx();
20085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20086 auto res = isl_pw_multi_aff_add_constant_val(copy(), v.release());
20087 if (!res)
20088 exception::throw_last_error(saved_ctx);
20089 return manage(res);
20092 isl::pw_multi_aff pw_multi_aff::add_constant(long v) const
20094 if (!ptr)
20095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20096 return this->add_constant(isl::val(ctx(), v));
20099 isl::union_pw_multi_aff pw_multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
20101 if (!ptr)
20102 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20103 return isl::union_pw_multi_aff(*this).apply(upma2);
20106 isl::map pw_multi_aff::as_map() const
20108 if (!ptr)
20109 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20110 auto saved_ctx = ctx();
20111 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20112 auto res = isl_pw_multi_aff_as_map(copy());
20113 if (!res)
20114 exception::throw_last_error(saved_ctx);
20115 return manage(res);
20118 isl::multi_aff pw_multi_aff::as_multi_aff() const
20120 if (!ptr)
20121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20122 auto saved_ctx = ctx();
20123 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20124 auto res = isl_pw_multi_aff_as_multi_aff(copy());
20125 if (!res)
20126 exception::throw_last_error(saved_ctx);
20127 return manage(res);
20130 isl::multi_union_pw_aff pw_multi_aff::as_multi_union_pw_aff() const
20132 if (!ptr)
20133 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20134 return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
20137 isl::pw_multi_aff pw_multi_aff::as_pw_multi_aff() const
20139 if (!ptr)
20140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20141 return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
20144 isl::set pw_multi_aff::as_set() const
20146 if (!ptr)
20147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20148 auto saved_ctx = ctx();
20149 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20150 auto res = isl_pw_multi_aff_as_set(copy());
20151 if (!res)
20152 exception::throw_last_error(saved_ctx);
20153 return manage(res);
20156 isl::union_map pw_multi_aff::as_union_map() const
20158 if (!ptr)
20159 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20160 return isl::union_pw_multi_aff(*this).as_union_map();
20163 isl::pw_aff pw_multi_aff::at(int pos) const
20165 if (!ptr)
20166 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20167 auto saved_ctx = ctx();
20168 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20169 auto res = isl_pw_multi_aff_get_at(get(), pos);
20170 if (!res)
20171 exception::throw_last_error(saved_ctx);
20172 return manage(res);
20175 isl::pw_aff pw_multi_aff::get_at(int pos) const
20177 return at(pos);
20180 isl::set pw_multi_aff::bind(const isl::multi_id &tuple) const
20182 if (!ptr)
20183 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20184 return isl::multi_pw_aff(*this).bind(tuple);
20187 isl::pw_multi_aff pw_multi_aff::bind_domain(isl::multi_id tuple) const
20189 if (!ptr || tuple.is_null())
20190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20191 auto saved_ctx = ctx();
20192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20193 auto res = isl_pw_multi_aff_bind_domain(copy(), tuple.release());
20194 if (!res)
20195 exception::throw_last_error(saved_ctx);
20196 return manage(res);
20199 isl::pw_multi_aff pw_multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
20201 if (!ptr || tuple.is_null())
20202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20203 auto saved_ctx = ctx();
20204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20205 auto res = isl_pw_multi_aff_bind_domain_wrapped_domain(copy(), tuple.release());
20206 if (!res)
20207 exception::throw_last_error(saved_ctx);
20208 return manage(res);
20211 isl::pw_multi_aff pw_multi_aff::coalesce() const
20213 if (!ptr)
20214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20215 auto saved_ctx = ctx();
20216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20217 auto res = isl_pw_multi_aff_coalesce(copy());
20218 if (!res)
20219 exception::throw_last_error(saved_ctx);
20220 return manage(res);
20223 isl::set pw_multi_aff::domain() const
20225 if (!ptr)
20226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20227 auto saved_ctx = ctx();
20228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20229 auto res = isl_pw_multi_aff_domain(copy());
20230 if (!res)
20231 exception::throw_last_error(saved_ctx);
20232 return manage(res);
20235 isl::pw_multi_aff pw_multi_aff::domain_map(isl::space space)
20237 if (space.is_null())
20238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20239 auto saved_ctx = space.ctx();
20240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20241 auto res = isl_pw_multi_aff_domain_map(space.release());
20242 if (!res)
20243 exception::throw_last_error(saved_ctx);
20244 return manage(res);
20247 isl::pw_multi_aff pw_multi_aff::domain_reverse() const
20249 if (!ptr)
20250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20251 auto saved_ctx = ctx();
20252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20253 auto res = isl_pw_multi_aff_domain_reverse(copy());
20254 if (!res)
20255 exception::throw_last_error(saved_ctx);
20256 return manage(res);
20259 isl::pw_multi_aff pw_multi_aff::drop_unused_params() const
20261 if (!ptr)
20262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20263 auto saved_ctx = ctx();
20264 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20265 auto res = isl_pw_multi_aff_drop_unused_params(copy());
20266 if (!res)
20267 exception::throw_last_error(saved_ctx);
20268 return manage(res);
20271 isl::pw_multi_aff pw_multi_aff::extract_pw_multi_aff(const isl::space &space) const
20273 if (!ptr)
20274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20275 return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
20278 isl::multi_pw_aff pw_multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
20280 if (!ptr)
20281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20282 return isl::multi_pw_aff(*this).flat_range_product(multi2);
20285 isl::multi_union_pw_aff pw_multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
20287 if (!ptr)
20288 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20289 return isl::multi_pw_aff(*this).flat_range_product(multi2);
20292 isl::pw_multi_aff pw_multi_aff::flat_range_product(isl::pw_multi_aff pma2) const
20294 if (!ptr || pma2.is_null())
20295 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20296 auto saved_ctx = ctx();
20297 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20298 auto res = isl_pw_multi_aff_flat_range_product(copy(), pma2.release());
20299 if (!res)
20300 exception::throw_last_error(saved_ctx);
20301 return manage(res);
20304 isl::union_pw_multi_aff pw_multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
20306 if (!ptr)
20307 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20308 return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
20311 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::multi_aff &pma2) const
20313 if (!ptr)
20314 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20315 return this->flat_range_product(isl::pw_multi_aff(pma2));
20318 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::pw_aff &pma2) const
20320 if (!ptr)
20321 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20322 return this->flat_range_product(isl::pw_multi_aff(pma2));
20325 void pw_multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
20327 if (!ptr)
20328 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20329 auto saved_ctx = ctx();
20330 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20331 struct fn_data {
20332 std::function<void(isl::set, isl::multi_aff)> func;
20333 std::exception_ptr eptr;
20334 } fn_data = { fn };
20335 auto fn_lambda = [](isl_set *arg_0, isl_multi_aff *arg_1, void *arg_2) -> isl_stat {
20336 auto *data = static_cast<struct fn_data *>(arg_2);
20337 ISL_CPP_TRY {
20338 (data->func)(manage(arg_0), manage(arg_1));
20339 return isl_stat_ok;
20340 } ISL_CPP_CATCH_ALL {
20341 data->eptr = std::current_exception();
20342 return isl_stat_error;
20345 auto res = isl_pw_multi_aff_foreach_piece(get(), fn_lambda, &fn_data);
20346 if (fn_data.eptr)
20347 std::rethrow_exception(fn_data.eptr);
20348 if (res < 0)
20349 exception::throw_last_error(saved_ctx);
20350 return;
20353 isl::pw_multi_aff pw_multi_aff::gist(isl::set set) const
20355 if (!ptr || set.is_null())
20356 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20357 auto saved_ctx = ctx();
20358 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20359 auto res = isl_pw_multi_aff_gist(copy(), set.release());
20360 if (!res)
20361 exception::throw_last_error(saved_ctx);
20362 return manage(res);
20365 isl::union_pw_multi_aff pw_multi_aff::gist(const isl::union_set &context) const
20367 if (!ptr)
20368 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20369 return isl::union_pw_multi_aff(*this).gist(context);
20372 isl::pw_multi_aff pw_multi_aff::gist(const isl::basic_set &set) const
20374 if (!ptr)
20375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20376 return this->gist(isl::set(set));
20379 isl::pw_multi_aff pw_multi_aff::gist(const isl::point &set) const
20381 if (!ptr)
20382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20383 return this->gist(isl::set(set));
20386 isl::pw_multi_aff pw_multi_aff::gist_params(isl::set set) const
20388 if (!ptr || set.is_null())
20389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20390 auto saved_ctx = ctx();
20391 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20392 auto res = isl_pw_multi_aff_gist_params(copy(), set.release());
20393 if (!res)
20394 exception::throw_last_error(saved_ctx);
20395 return manage(res);
20398 bool pw_multi_aff::has_range_tuple_id() const
20400 if (!ptr)
20401 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20402 auto saved_ctx = ctx();
20403 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20404 auto res = isl_pw_multi_aff_has_range_tuple_id(get());
20405 if (res < 0)
20406 exception::throw_last_error(saved_ctx);
20407 return res;
20410 isl::multi_pw_aff pw_multi_aff::identity() const
20412 if (!ptr)
20413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20414 return isl::multi_pw_aff(*this).identity();
20417 isl::pw_multi_aff pw_multi_aff::identity_on_domain(isl::space space)
20419 if (space.is_null())
20420 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20421 auto saved_ctx = space.ctx();
20422 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20423 auto res = isl_pw_multi_aff_identity_on_domain_space(space.release());
20424 if (!res)
20425 exception::throw_last_error(saved_ctx);
20426 return manage(res);
20429 isl::pw_multi_aff pw_multi_aff::insert_domain(isl::space domain) const
20431 if (!ptr || domain.is_null())
20432 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20433 auto saved_ctx = ctx();
20434 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20435 auto res = isl_pw_multi_aff_insert_domain(copy(), domain.release());
20436 if (!res)
20437 exception::throw_last_error(saved_ctx);
20438 return manage(res);
20441 isl::pw_multi_aff pw_multi_aff::intersect_domain(isl::set set) const
20443 if (!ptr || set.is_null())
20444 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20445 auto saved_ctx = ctx();
20446 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20447 auto res = isl_pw_multi_aff_intersect_domain(copy(), set.release());
20448 if (!res)
20449 exception::throw_last_error(saved_ctx);
20450 return manage(res);
20453 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::space &space) const
20455 if (!ptr)
20456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20457 return isl::union_pw_multi_aff(*this).intersect_domain(space);
20460 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::union_set &uset) const
20462 if (!ptr)
20463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20464 return isl::union_pw_multi_aff(*this).intersect_domain(uset);
20467 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::basic_set &set) const
20469 if (!ptr)
20470 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20471 return this->intersect_domain(isl::set(set));
20474 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::point &set) const
20476 if (!ptr)
20477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20478 return this->intersect_domain(isl::set(set));
20481 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_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_wrapped_domain(uset);
20488 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
20490 if (!ptr)
20491 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20492 return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
20495 isl::pw_multi_aff pw_multi_aff::intersect_params(isl::set set) const
20497 if (!ptr || set.is_null())
20498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20499 auto saved_ctx = ctx();
20500 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20501 auto res = isl_pw_multi_aff_intersect_params(copy(), set.release());
20502 if (!res)
20503 exception::throw_last_error(saved_ctx);
20504 return manage(res);
20507 bool pw_multi_aff::involves_locals() const
20509 if (!ptr)
20510 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20511 auto saved_ctx = ctx();
20512 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20513 auto res = isl_pw_multi_aff_involves_locals(get());
20514 if (res < 0)
20515 exception::throw_last_error(saved_ctx);
20516 return res;
20519 bool pw_multi_aff::involves_nan() const
20521 if (!ptr)
20522 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20523 return isl::multi_pw_aff(*this).involves_nan();
20526 bool pw_multi_aff::involves_param(const isl::id &id) const
20528 if (!ptr)
20529 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20530 return isl::multi_pw_aff(*this).involves_param(id);
20533 bool pw_multi_aff::involves_param(const std::string &id) const
20535 if (!ptr)
20536 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20537 return this->involves_param(isl::id(ctx(), id));
20540 bool pw_multi_aff::involves_param(const isl::id_list &list) const
20542 if (!ptr)
20543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20544 return isl::multi_pw_aff(*this).involves_param(list);
20547 bool pw_multi_aff::isa_multi_aff() const
20549 if (!ptr)
20550 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20551 auto saved_ctx = ctx();
20552 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20553 auto res = isl_pw_multi_aff_isa_multi_aff(get());
20554 if (res < 0)
20555 exception::throw_last_error(saved_ctx);
20556 return res;
20559 bool pw_multi_aff::isa_pw_multi_aff() const
20561 if (!ptr)
20562 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20563 return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
20566 isl::pw_aff_list pw_multi_aff::list() const
20568 if (!ptr)
20569 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20570 return isl::multi_pw_aff(*this).list();
20573 isl::multi_pw_aff pw_multi_aff::max(const isl::multi_pw_aff &multi2) const
20575 if (!ptr)
20576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20577 return isl::multi_pw_aff(*this).max(multi2);
20580 isl::multi_val pw_multi_aff::max_multi_val() const
20582 if (!ptr)
20583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20584 auto saved_ctx = ctx();
20585 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20586 auto res = isl_pw_multi_aff_max_multi_val(copy());
20587 if (!res)
20588 exception::throw_last_error(saved_ctx);
20589 return manage(res);
20592 isl::multi_pw_aff pw_multi_aff::min(const isl::multi_pw_aff &multi2) const
20594 if (!ptr)
20595 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20596 return isl::multi_pw_aff(*this).min(multi2);
20599 isl::multi_val pw_multi_aff::min_multi_val() const
20601 if (!ptr)
20602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20603 auto saved_ctx = ctx();
20604 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20605 auto res = isl_pw_multi_aff_min_multi_val(copy());
20606 if (!res)
20607 exception::throw_last_error(saved_ctx);
20608 return manage(res);
20611 isl::pw_multi_aff pw_multi_aff::multi_val_on_domain(isl::set domain, isl::multi_val mv)
20613 if (domain.is_null() || mv.is_null())
20614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20615 auto saved_ctx = domain.ctx();
20616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20617 auto res = isl_pw_multi_aff_multi_val_on_domain(domain.release(), mv.release());
20618 if (!res)
20619 exception::throw_last_error(saved_ctx);
20620 return manage(res);
20623 unsigned pw_multi_aff::n_piece() const
20625 if (!ptr)
20626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20627 auto saved_ctx = ctx();
20628 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20629 auto res = isl_pw_multi_aff_n_piece(get());
20630 if (res < 0)
20631 exception::throw_last_error(saved_ctx);
20632 return res;
20635 isl::multi_pw_aff pw_multi_aff::neg() const
20637 if (!ptr)
20638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20639 return isl::multi_pw_aff(*this).neg();
20642 bool pw_multi_aff::plain_is_empty() const
20644 if (!ptr)
20645 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20646 return isl::union_pw_multi_aff(*this).plain_is_empty();
20649 bool pw_multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
20651 if (!ptr)
20652 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20653 return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20656 bool pw_multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
20658 if (!ptr)
20659 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20660 return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20663 bool pw_multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
20665 if (!ptr || pma2.is_null())
20666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20667 auto saved_ctx = ctx();
20668 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20669 auto res = isl_pw_multi_aff_plain_is_equal(get(), pma2.get());
20670 if (res < 0)
20671 exception::throw_last_error(saved_ctx);
20672 return res;
20675 bool pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
20677 if (!ptr)
20678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20679 return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
20682 bool pw_multi_aff::plain_is_equal(const isl::multi_aff &pma2) const
20684 if (!ptr)
20685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20686 return this->plain_is_equal(isl::pw_multi_aff(pma2));
20689 bool pw_multi_aff::plain_is_equal(const isl::pw_aff &pma2) const
20691 if (!ptr)
20692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20693 return this->plain_is_equal(isl::pw_multi_aff(pma2));
20696 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const
20698 if (!ptr || pma2.is_null())
20699 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20700 auto saved_ctx = ctx();
20701 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20702 auto res = isl_pw_multi_aff_preimage_domain_wrapped_domain_pw_multi_aff(copy(), pma2.release());
20703 if (!res)
20704 exception::throw_last_error(saved_ctx);
20705 return manage(res);
20708 isl::union_pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
20710 if (!ptr)
20711 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20712 return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
20715 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const
20717 if (!ptr)
20718 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20719 return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20722 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const
20724 if (!ptr)
20725 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20726 return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20729 isl::multi_pw_aff pw_multi_aff::product(const isl::multi_pw_aff &multi2) const
20731 if (!ptr)
20732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20733 return isl::multi_pw_aff(*this).product(multi2);
20736 isl::pw_multi_aff pw_multi_aff::product(isl::pw_multi_aff pma2) const
20738 if (!ptr || pma2.is_null())
20739 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20740 auto saved_ctx = ctx();
20741 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20742 auto res = isl_pw_multi_aff_product(copy(), pma2.release());
20743 if (!res)
20744 exception::throw_last_error(saved_ctx);
20745 return manage(res);
20748 isl::pw_multi_aff pw_multi_aff::product(const isl::multi_aff &pma2) const
20750 if (!ptr)
20751 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20752 return this->product(isl::pw_multi_aff(pma2));
20755 isl::pw_multi_aff pw_multi_aff::product(const isl::pw_aff &pma2) const
20757 if (!ptr)
20758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20759 return this->product(isl::pw_multi_aff(pma2));
20762 isl::multi_pw_aff pw_multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
20764 if (!ptr)
20765 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20766 return isl::multi_pw_aff(*this).pullback(mpa2);
20769 isl::pw_multi_aff pw_multi_aff::pullback(isl::multi_aff ma) const
20771 if (!ptr || ma.is_null())
20772 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20773 auto saved_ctx = ctx();
20774 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20775 auto res = isl_pw_multi_aff_pullback_multi_aff(copy(), ma.release());
20776 if (!res)
20777 exception::throw_last_error(saved_ctx);
20778 return manage(res);
20781 isl::pw_multi_aff pw_multi_aff::pullback(isl::pw_multi_aff pma2) const
20783 if (!ptr || pma2.is_null())
20784 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20785 auto saved_ctx = ctx();
20786 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20787 auto res = isl_pw_multi_aff_pullback_pw_multi_aff(copy(), pma2.release());
20788 if (!res)
20789 exception::throw_last_error(saved_ctx);
20790 return manage(res);
20793 isl::union_pw_multi_aff pw_multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
20795 if (!ptr)
20796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20797 return isl::union_pw_multi_aff(*this).pullback(upma2);
20800 isl::pw_multi_aff_list pw_multi_aff::pw_multi_aff_list() const
20802 if (!ptr)
20803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20804 return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
20807 isl::pw_multi_aff pw_multi_aff::range_factor_domain() const
20809 if (!ptr)
20810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20811 auto saved_ctx = ctx();
20812 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20813 auto res = isl_pw_multi_aff_range_factor_domain(copy());
20814 if (!res)
20815 exception::throw_last_error(saved_ctx);
20816 return manage(res);
20819 isl::pw_multi_aff pw_multi_aff::range_factor_range() const
20821 if (!ptr)
20822 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20823 auto saved_ctx = ctx();
20824 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20825 auto res = isl_pw_multi_aff_range_factor_range(copy());
20826 if (!res)
20827 exception::throw_last_error(saved_ctx);
20828 return manage(res);
20831 isl::pw_multi_aff pw_multi_aff::range_map(isl::space space)
20833 if (space.is_null())
20834 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20835 auto saved_ctx = space.ctx();
20836 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20837 auto res = isl_pw_multi_aff_range_map(space.release());
20838 if (!res)
20839 exception::throw_last_error(saved_ctx);
20840 return manage(res);
20843 isl::multi_pw_aff pw_multi_aff::range_product(const isl::multi_pw_aff &multi2) const
20845 if (!ptr)
20846 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20847 return isl::multi_pw_aff(*this).range_product(multi2);
20850 isl::multi_union_pw_aff pw_multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
20852 if (!ptr)
20853 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20854 return isl::multi_pw_aff(*this).range_product(multi2);
20857 isl::pw_multi_aff pw_multi_aff::range_product(isl::pw_multi_aff pma2) const
20859 if (!ptr || pma2.is_null())
20860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20861 auto saved_ctx = ctx();
20862 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20863 auto res = isl_pw_multi_aff_range_product(copy(), pma2.release());
20864 if (!res)
20865 exception::throw_last_error(saved_ctx);
20866 return manage(res);
20869 isl::union_pw_multi_aff pw_multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
20871 if (!ptr)
20872 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20873 return isl::union_pw_multi_aff(*this).range_product(upma2);
20876 isl::pw_multi_aff pw_multi_aff::range_product(const isl::multi_aff &pma2) const
20878 if (!ptr)
20879 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20880 return this->range_product(isl::pw_multi_aff(pma2));
20883 isl::pw_multi_aff pw_multi_aff::range_product(const isl::pw_aff &pma2) const
20885 if (!ptr)
20886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20887 return this->range_product(isl::pw_multi_aff(pma2));
20890 isl::id pw_multi_aff::range_tuple_id() const
20892 if (!ptr)
20893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20894 auto saved_ctx = ctx();
20895 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20896 auto res = isl_pw_multi_aff_get_range_tuple_id(get());
20897 if (!res)
20898 exception::throw_last_error(saved_ctx);
20899 return manage(res);
20902 isl::id pw_multi_aff::get_range_tuple_id() const
20904 return range_tuple_id();
20907 isl::multi_pw_aff pw_multi_aff::reset_range_tuple_id() const
20909 if (!ptr)
20910 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20911 return isl::multi_pw_aff(*this).reset_range_tuple_id();
20914 isl::pw_multi_aff pw_multi_aff::scale(isl::multi_val mv) const
20916 if (!ptr || mv.is_null())
20917 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20918 auto saved_ctx = ctx();
20919 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20920 auto res = isl_pw_multi_aff_scale_multi_val(copy(), mv.release());
20921 if (!res)
20922 exception::throw_last_error(saved_ctx);
20923 return manage(res);
20926 isl::pw_multi_aff pw_multi_aff::scale(isl::val v) const
20928 if (!ptr || v.is_null())
20929 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20930 auto saved_ctx = ctx();
20931 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20932 auto res = isl_pw_multi_aff_scale_val(copy(), v.release());
20933 if (!res)
20934 exception::throw_last_error(saved_ctx);
20935 return manage(res);
20938 isl::pw_multi_aff pw_multi_aff::scale(long v) const
20940 if (!ptr)
20941 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20942 return this->scale(isl::val(ctx(), v));
20945 isl::pw_multi_aff pw_multi_aff::scale_down(isl::multi_val mv) const
20947 if (!ptr || mv.is_null())
20948 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20949 auto saved_ctx = ctx();
20950 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20951 auto res = isl_pw_multi_aff_scale_down_multi_val(copy(), mv.release());
20952 if (!res)
20953 exception::throw_last_error(saved_ctx);
20954 return manage(res);
20957 isl::pw_multi_aff pw_multi_aff::scale_down(isl::val v) const
20959 if (!ptr || v.is_null())
20960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20961 auto saved_ctx = ctx();
20962 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20963 auto res = isl_pw_multi_aff_scale_down_val(copy(), v.release());
20964 if (!res)
20965 exception::throw_last_error(saved_ctx);
20966 return manage(res);
20969 isl::pw_multi_aff pw_multi_aff::scale_down(long v) const
20971 if (!ptr)
20972 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20973 return this->scale_down(isl::val(ctx(), v));
20976 isl::multi_pw_aff pw_multi_aff::set_at(int pos, const isl::pw_aff &el) const
20978 if (!ptr)
20979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20980 return isl::multi_pw_aff(*this).set_at(pos, el);
20983 isl::multi_union_pw_aff pw_multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
20985 if (!ptr)
20986 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20987 return isl::multi_pw_aff(*this).set_at(pos, el);
20990 isl::pw_multi_aff pw_multi_aff::set_range_tuple(isl::id id) const
20992 if (!ptr || id.is_null())
20993 exception::throw_invalid("NULL input", __FILE__, __LINE__);
20994 auto saved_ctx = ctx();
20995 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
20996 auto res = isl_pw_multi_aff_set_range_tuple_id(copy(), id.release());
20997 if (!res)
20998 exception::throw_last_error(saved_ctx);
20999 return manage(res);
21002 isl::pw_multi_aff pw_multi_aff::set_range_tuple(const std::string &id) const
21004 if (!ptr)
21005 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21006 return this->set_range_tuple(isl::id(ctx(), id));
21009 unsigned pw_multi_aff::size() const
21011 if (!ptr)
21012 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21013 return isl::multi_pw_aff(*this).size();
21016 isl::space pw_multi_aff::space() const
21018 if (!ptr)
21019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21020 auto saved_ctx = ctx();
21021 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21022 auto res = isl_pw_multi_aff_get_space(get());
21023 if (!res)
21024 exception::throw_last_error(saved_ctx);
21025 return manage(res);
21028 isl::space pw_multi_aff::get_space() const
21030 return space();
21033 isl::multi_pw_aff pw_multi_aff::sub(const isl::multi_pw_aff &multi2) const
21035 if (!ptr)
21036 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21037 return isl::multi_pw_aff(*this).sub(multi2);
21040 isl::multi_union_pw_aff pw_multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
21042 if (!ptr)
21043 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21044 return isl::multi_pw_aff(*this).sub(multi2);
21047 isl::pw_multi_aff pw_multi_aff::sub(isl::pw_multi_aff pma2) const
21049 if (!ptr || pma2.is_null())
21050 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21051 auto saved_ctx = ctx();
21052 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21053 auto res = isl_pw_multi_aff_sub(copy(), pma2.release());
21054 if (!res)
21055 exception::throw_last_error(saved_ctx);
21056 return manage(res);
21059 isl::union_pw_multi_aff pw_multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
21061 if (!ptr)
21062 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21063 return isl::union_pw_multi_aff(*this).sub(upma2);
21066 isl::pw_multi_aff pw_multi_aff::sub(const isl::multi_aff &pma2) const
21068 if (!ptr)
21069 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21070 return this->sub(isl::pw_multi_aff(pma2));
21073 isl::pw_multi_aff pw_multi_aff::sub(const isl::pw_aff &pma2) const
21075 if (!ptr)
21076 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21077 return this->sub(isl::pw_multi_aff(pma2));
21080 isl::pw_multi_aff pw_multi_aff::subtract_domain(isl::set set) const
21082 if (!ptr || set.is_null())
21083 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21084 auto saved_ctx = ctx();
21085 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21086 auto res = isl_pw_multi_aff_subtract_domain(copy(), set.release());
21087 if (!res)
21088 exception::throw_last_error(saved_ctx);
21089 return manage(res);
21092 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::space &space) const
21094 if (!ptr)
21095 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21096 return isl::union_pw_multi_aff(*this).subtract_domain(space);
21099 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::union_set &uset) const
21101 if (!ptr)
21102 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21103 return isl::union_pw_multi_aff(*this).subtract_domain(uset);
21106 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::basic_set &set) const
21108 if (!ptr)
21109 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21110 return this->subtract_domain(isl::set(set));
21113 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::point &set) const
21115 if (!ptr)
21116 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21117 return this->subtract_domain(isl::set(set));
21120 isl::pw_multi_aff_list pw_multi_aff::to_list() const
21122 if (!ptr)
21123 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21124 auto saved_ctx = ctx();
21125 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21126 auto res = isl_pw_multi_aff_to_list(copy());
21127 if (!res)
21128 exception::throw_last_error(saved_ctx);
21129 return manage(res);
21132 isl::multi_pw_aff pw_multi_aff::to_multi_pw_aff() const
21134 if (!ptr)
21135 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21136 auto saved_ctx = ctx();
21137 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21138 auto res = isl_pw_multi_aff_to_multi_pw_aff(copy());
21139 if (!res)
21140 exception::throw_last_error(saved_ctx);
21141 return manage(res);
21144 isl::union_pw_multi_aff pw_multi_aff::to_union_pw_multi_aff() const
21146 if (!ptr)
21147 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21148 auto saved_ctx = ctx();
21149 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21150 auto res = isl_pw_multi_aff_to_union_pw_multi_aff(copy());
21151 if (!res)
21152 exception::throw_last_error(saved_ctx);
21153 return manage(res);
21156 isl::multi_pw_aff pw_multi_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
21158 if (!ptr)
21159 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21160 return isl::multi_pw_aff(*this).unbind_params_insert_domain(domain);
21163 isl::multi_pw_aff pw_multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
21165 if (!ptr)
21166 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21167 return isl::multi_pw_aff(*this).union_add(mpa2);
21170 isl::multi_union_pw_aff pw_multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
21172 if (!ptr)
21173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21174 return isl::multi_pw_aff(*this).union_add(mupa2);
21177 isl::pw_multi_aff pw_multi_aff::union_add(isl::pw_multi_aff pma2) const
21179 if (!ptr || pma2.is_null())
21180 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21181 auto saved_ctx = ctx();
21182 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21183 auto res = isl_pw_multi_aff_union_add(copy(), pma2.release());
21184 if (!res)
21185 exception::throw_last_error(saved_ctx);
21186 return manage(res);
21189 isl::union_pw_multi_aff pw_multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
21191 if (!ptr)
21192 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21193 return isl::union_pw_multi_aff(*this).union_add(upma2);
21196 isl::pw_multi_aff pw_multi_aff::union_add(const isl::multi_aff &pma2) const
21198 if (!ptr)
21199 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21200 return this->union_add(isl::pw_multi_aff(pma2));
21203 isl::pw_multi_aff pw_multi_aff::union_add(const isl::pw_aff &pma2) const
21205 if (!ptr)
21206 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21207 return this->union_add(isl::pw_multi_aff(pma2));
21210 isl::pw_multi_aff pw_multi_aff::zero(isl::space space)
21212 if (space.is_null())
21213 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21214 auto saved_ctx = space.ctx();
21215 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21216 auto res = isl_pw_multi_aff_zero(space.release());
21217 if (!res)
21218 exception::throw_last_error(saved_ctx);
21219 return manage(res);
21222 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff &obj)
21224 if (!obj.get())
21225 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21226 auto saved_ctx = isl_pw_multi_aff_get_ctx(obj.get());
21227 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21228 char *str = isl_pw_multi_aff_to_str(obj.get());
21229 if (!str)
21230 exception::throw_last_error(saved_ctx);
21231 os << str;
21232 free(str);
21233 return os;
21236 // implementations for isl::pw_multi_aff_list
21237 pw_multi_aff_list manage(__isl_take isl_pw_multi_aff_list *ptr) {
21238 if (!ptr)
21239 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21240 return pw_multi_aff_list(ptr);
21242 pw_multi_aff_list manage_copy(__isl_keep isl_pw_multi_aff_list *ptr) {
21243 if (!ptr)
21244 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21245 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(ptr);
21246 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21247 ptr = isl_pw_multi_aff_list_copy(ptr);
21248 if (!ptr)
21249 exception::throw_last_error(saved_ctx);
21250 return pw_multi_aff_list(ptr);
21253 pw_multi_aff_list::pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr)
21254 : ptr(ptr) {}
21256 pw_multi_aff_list::pw_multi_aff_list()
21257 : ptr(nullptr) {}
21259 pw_multi_aff_list::pw_multi_aff_list(const pw_multi_aff_list &obj)
21260 : ptr(nullptr)
21262 if (!obj.ptr)
21263 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21264 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.ptr);
21265 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21266 ptr = obj.copy();
21267 if (!ptr)
21268 exception::throw_last_error(saved_ctx);
21271 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, int n)
21273 auto saved_ctx = ctx;
21274 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21275 auto res = isl_pw_multi_aff_list_alloc(ctx.release(), n);
21276 if (!res)
21277 exception::throw_last_error(saved_ctx);
21278 ptr = res;
21281 pw_multi_aff_list::pw_multi_aff_list(isl::pw_multi_aff el)
21283 if (el.is_null())
21284 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21285 auto saved_ctx = el.ctx();
21286 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21287 auto res = isl_pw_multi_aff_list_from_pw_multi_aff(el.release());
21288 if (!res)
21289 exception::throw_last_error(saved_ctx);
21290 ptr = res;
21293 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, const std::string &str)
21295 auto saved_ctx = ctx;
21296 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21297 auto res = isl_pw_multi_aff_list_read_from_str(ctx.release(), str.c_str());
21298 if (!res)
21299 exception::throw_last_error(saved_ctx);
21300 ptr = res;
21303 pw_multi_aff_list &pw_multi_aff_list::operator=(pw_multi_aff_list obj) {
21304 std::swap(this->ptr, obj.ptr);
21305 return *this;
21308 pw_multi_aff_list::~pw_multi_aff_list() {
21309 if (ptr)
21310 isl_pw_multi_aff_list_free(ptr);
21313 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::copy() const & {
21314 return isl_pw_multi_aff_list_copy(ptr);
21317 __isl_keep isl_pw_multi_aff_list *pw_multi_aff_list::get() const {
21318 return ptr;
21321 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::release() {
21322 isl_pw_multi_aff_list *tmp = ptr;
21323 ptr = nullptr;
21324 return tmp;
21327 bool pw_multi_aff_list::is_null() const {
21328 return ptr == nullptr;
21331 isl::ctx pw_multi_aff_list::ctx() const {
21332 return isl::ctx(isl_pw_multi_aff_list_get_ctx(ptr));
21335 isl::pw_multi_aff_list pw_multi_aff_list::add(isl::pw_multi_aff el) const
21337 if (!ptr || el.is_null())
21338 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21339 auto saved_ctx = ctx();
21340 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21341 auto res = isl_pw_multi_aff_list_add(copy(), el.release());
21342 if (!res)
21343 exception::throw_last_error(saved_ctx);
21344 return manage(res);
21347 isl::pw_multi_aff pw_multi_aff_list::at(int index) const
21349 if (!ptr)
21350 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21351 auto saved_ctx = ctx();
21352 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21353 auto res = isl_pw_multi_aff_list_get_at(get(), index);
21354 if (!res)
21355 exception::throw_last_error(saved_ctx);
21356 return manage(res);
21359 isl::pw_multi_aff pw_multi_aff_list::get_at(int index) const
21361 return at(index);
21364 isl::pw_multi_aff_list pw_multi_aff_list::clear() const
21366 if (!ptr)
21367 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21368 auto saved_ctx = ctx();
21369 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21370 auto res = isl_pw_multi_aff_list_clear(copy());
21371 if (!res)
21372 exception::throw_last_error(saved_ctx);
21373 return manage(res);
21376 isl::pw_multi_aff_list pw_multi_aff_list::concat(isl::pw_multi_aff_list list2) const
21378 if (!ptr || list2.is_null())
21379 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21380 auto saved_ctx = ctx();
21381 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21382 auto res = isl_pw_multi_aff_list_concat(copy(), list2.release());
21383 if (!res)
21384 exception::throw_last_error(saved_ctx);
21385 return manage(res);
21388 isl::pw_multi_aff_list pw_multi_aff_list::drop(unsigned int first, unsigned int n) const
21390 if (!ptr)
21391 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21392 auto saved_ctx = ctx();
21393 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21394 auto res = isl_pw_multi_aff_list_drop(copy(), first, n);
21395 if (!res)
21396 exception::throw_last_error(saved_ctx);
21397 return manage(res);
21400 void pw_multi_aff_list::foreach(const std::function<void(isl::pw_multi_aff)> &fn) const
21402 if (!ptr)
21403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21404 auto saved_ctx = ctx();
21405 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21406 struct fn_data {
21407 std::function<void(isl::pw_multi_aff)> func;
21408 std::exception_ptr eptr;
21409 } fn_data = { fn };
21410 auto fn_lambda = [](isl_pw_multi_aff *arg_0, void *arg_1) -> isl_stat {
21411 auto *data = static_cast<struct fn_data *>(arg_1);
21412 ISL_CPP_TRY {
21413 (data->func)(manage(arg_0));
21414 return isl_stat_ok;
21415 } ISL_CPP_CATCH_ALL {
21416 data->eptr = std::current_exception();
21417 return isl_stat_error;
21420 auto res = isl_pw_multi_aff_list_foreach(get(), fn_lambda, &fn_data);
21421 if (fn_data.eptr)
21422 std::rethrow_exception(fn_data.eptr);
21423 if (res < 0)
21424 exception::throw_last_error(saved_ctx);
21425 return;
21428 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
21430 if (!ptr)
21431 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21432 auto saved_ctx = ctx();
21433 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21434 struct follows_data {
21435 std::function<bool(isl::pw_multi_aff, isl::pw_multi_aff)> func;
21436 std::exception_ptr eptr;
21437 } follows_data = { follows };
21438 auto follows_lambda = [](isl_pw_multi_aff *arg_0, isl_pw_multi_aff *arg_1, void *arg_2) -> isl_bool {
21439 auto *data = static_cast<struct follows_data *>(arg_2);
21440 ISL_CPP_TRY {
21441 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
21442 return ret ? isl_bool_true : isl_bool_false;
21443 } ISL_CPP_CATCH_ALL {
21444 data->eptr = std::current_exception();
21445 return isl_bool_error;
21448 struct fn_data {
21449 std::function<void(isl::pw_multi_aff_list)> func;
21450 std::exception_ptr eptr;
21451 } fn_data = { fn };
21452 auto fn_lambda = [](isl_pw_multi_aff_list *arg_0, void *arg_1) -> isl_stat {
21453 auto *data = static_cast<struct fn_data *>(arg_1);
21454 ISL_CPP_TRY {
21455 (data->func)(manage(arg_0));
21456 return isl_stat_ok;
21457 } ISL_CPP_CATCH_ALL {
21458 data->eptr = std::current_exception();
21459 return isl_stat_error;
21462 auto res = isl_pw_multi_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
21463 if (follows_data.eptr)
21464 std::rethrow_exception(follows_data.eptr);
21465 if (fn_data.eptr)
21466 std::rethrow_exception(fn_data.eptr);
21467 if (res < 0)
21468 exception::throw_last_error(saved_ctx);
21469 return;
21472 isl::pw_multi_aff_list pw_multi_aff_list::insert(unsigned int pos, isl::pw_multi_aff el) const
21474 if (!ptr || el.is_null())
21475 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21476 auto saved_ctx = ctx();
21477 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21478 auto res = isl_pw_multi_aff_list_insert(copy(), pos, el.release());
21479 if (!res)
21480 exception::throw_last_error(saved_ctx);
21481 return manage(res);
21484 isl::pw_multi_aff_list pw_multi_aff_list::set_at(int index, isl::pw_multi_aff el) const
21486 if (!ptr || el.is_null())
21487 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21488 auto saved_ctx = ctx();
21489 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21490 auto res = isl_pw_multi_aff_list_set_at(copy(), index, el.release());
21491 if (!res)
21492 exception::throw_last_error(saved_ctx);
21493 return manage(res);
21496 unsigned pw_multi_aff_list::size() const
21498 if (!ptr)
21499 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21500 auto saved_ctx = ctx();
21501 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21502 auto res = isl_pw_multi_aff_list_size(get());
21503 if (res < 0)
21504 exception::throw_last_error(saved_ctx);
21505 return res;
21508 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff_list &obj)
21510 if (!obj.get())
21511 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21512 auto saved_ctx = isl_pw_multi_aff_list_get_ctx(obj.get());
21513 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21514 char *str = isl_pw_multi_aff_list_to_str(obj.get());
21515 if (!str)
21516 exception::throw_last_error(saved_ctx);
21517 os << str;
21518 free(str);
21519 return os;
21522 // implementations for isl::schedule
21523 schedule manage(__isl_take isl_schedule *ptr) {
21524 if (!ptr)
21525 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21526 return schedule(ptr);
21528 schedule manage_copy(__isl_keep isl_schedule *ptr) {
21529 if (!ptr)
21530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21531 auto saved_ctx = isl_schedule_get_ctx(ptr);
21532 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21533 ptr = isl_schedule_copy(ptr);
21534 if (!ptr)
21535 exception::throw_last_error(saved_ctx);
21536 return schedule(ptr);
21539 schedule::schedule(__isl_take isl_schedule *ptr)
21540 : ptr(ptr) {}
21542 schedule::schedule()
21543 : ptr(nullptr) {}
21545 schedule::schedule(const schedule &obj)
21546 : ptr(nullptr)
21548 if (!obj.ptr)
21549 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21550 auto saved_ctx = isl_schedule_get_ctx(obj.ptr);
21551 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21552 ptr = obj.copy();
21553 if (!ptr)
21554 exception::throw_last_error(saved_ctx);
21557 schedule::schedule(isl::ctx ctx, const std::string &str)
21559 auto saved_ctx = ctx;
21560 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21561 auto res = isl_schedule_read_from_str(ctx.release(), str.c_str());
21562 if (!res)
21563 exception::throw_last_error(saved_ctx);
21564 ptr = res;
21567 schedule &schedule::operator=(schedule obj) {
21568 std::swap(this->ptr, obj.ptr);
21569 return *this;
21572 schedule::~schedule() {
21573 if (ptr)
21574 isl_schedule_free(ptr);
21577 __isl_give isl_schedule *schedule::copy() const & {
21578 return isl_schedule_copy(ptr);
21581 __isl_keep isl_schedule *schedule::get() const {
21582 return ptr;
21585 __isl_give isl_schedule *schedule::release() {
21586 isl_schedule *tmp = ptr;
21587 ptr = nullptr;
21588 return tmp;
21591 bool schedule::is_null() const {
21592 return ptr == nullptr;
21595 isl::ctx schedule::ctx() const {
21596 return isl::ctx(isl_schedule_get_ctx(ptr));
21599 isl::union_set schedule::domain() const
21601 if (!ptr)
21602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21603 auto saved_ctx = ctx();
21604 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21605 auto res = isl_schedule_get_domain(get());
21606 if (!res)
21607 exception::throw_last_error(saved_ctx);
21608 return manage(res);
21611 isl::union_set schedule::get_domain() const
21613 return domain();
21616 isl::schedule schedule::from_domain(isl::union_set domain)
21618 if (domain.is_null())
21619 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21620 auto saved_ctx = domain.ctx();
21621 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21622 auto res = isl_schedule_from_domain(domain.release());
21623 if (!res)
21624 exception::throw_last_error(saved_ctx);
21625 return manage(res);
21628 isl::union_map schedule::map() const
21630 if (!ptr)
21631 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21632 auto saved_ctx = ctx();
21633 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21634 auto res = isl_schedule_get_map(get());
21635 if (!res)
21636 exception::throw_last_error(saved_ctx);
21637 return manage(res);
21640 isl::union_map schedule::get_map() const
21642 return map();
21645 isl::schedule schedule::pullback(isl::union_pw_multi_aff upma) const
21647 if (!ptr || upma.is_null())
21648 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21649 auto saved_ctx = ctx();
21650 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21651 auto res = isl_schedule_pullback_union_pw_multi_aff(copy(), upma.release());
21652 if (!res)
21653 exception::throw_last_error(saved_ctx);
21654 return manage(res);
21657 isl::schedule_node schedule::root() const
21659 if (!ptr)
21660 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21661 auto saved_ctx = ctx();
21662 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21663 auto res = isl_schedule_get_root(get());
21664 if (!res)
21665 exception::throw_last_error(saved_ctx);
21666 return manage(res);
21669 isl::schedule_node schedule::get_root() const
21671 return root();
21674 inline std::ostream &operator<<(std::ostream &os, const schedule &obj)
21676 if (!obj.get())
21677 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21678 auto saved_ctx = isl_schedule_get_ctx(obj.get());
21679 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21680 char *str = isl_schedule_to_str(obj.get());
21681 if (!str)
21682 exception::throw_last_error(saved_ctx);
21683 os << str;
21684 free(str);
21685 return os;
21688 // implementations for isl::schedule_constraints
21689 schedule_constraints manage(__isl_take isl_schedule_constraints *ptr) {
21690 if (!ptr)
21691 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21692 return schedule_constraints(ptr);
21694 schedule_constraints manage_copy(__isl_keep isl_schedule_constraints *ptr) {
21695 if (!ptr)
21696 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21697 auto saved_ctx = isl_schedule_constraints_get_ctx(ptr);
21698 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21699 ptr = isl_schedule_constraints_copy(ptr);
21700 if (!ptr)
21701 exception::throw_last_error(saved_ctx);
21702 return schedule_constraints(ptr);
21705 schedule_constraints::schedule_constraints(__isl_take isl_schedule_constraints *ptr)
21706 : ptr(ptr) {}
21708 schedule_constraints::schedule_constraints()
21709 : ptr(nullptr) {}
21711 schedule_constraints::schedule_constraints(const schedule_constraints &obj)
21712 : ptr(nullptr)
21714 if (!obj.ptr)
21715 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21716 auto saved_ctx = isl_schedule_constraints_get_ctx(obj.ptr);
21717 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21718 ptr = obj.copy();
21719 if (!ptr)
21720 exception::throw_last_error(saved_ctx);
21723 schedule_constraints::schedule_constraints(isl::ctx ctx, const std::string &str)
21725 auto saved_ctx = ctx;
21726 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21727 auto res = isl_schedule_constraints_read_from_str(ctx.release(), str.c_str());
21728 if (!res)
21729 exception::throw_last_error(saved_ctx);
21730 ptr = res;
21733 schedule_constraints &schedule_constraints::operator=(schedule_constraints obj) {
21734 std::swap(this->ptr, obj.ptr);
21735 return *this;
21738 schedule_constraints::~schedule_constraints() {
21739 if (ptr)
21740 isl_schedule_constraints_free(ptr);
21743 __isl_give isl_schedule_constraints *schedule_constraints::copy() const & {
21744 return isl_schedule_constraints_copy(ptr);
21747 __isl_keep isl_schedule_constraints *schedule_constraints::get() const {
21748 return ptr;
21751 __isl_give isl_schedule_constraints *schedule_constraints::release() {
21752 isl_schedule_constraints *tmp = ptr;
21753 ptr = nullptr;
21754 return tmp;
21757 bool schedule_constraints::is_null() const {
21758 return ptr == nullptr;
21761 isl::ctx schedule_constraints::ctx() const {
21762 return isl::ctx(isl_schedule_constraints_get_ctx(ptr));
21765 isl::union_map schedule_constraints::coincidence() const
21767 if (!ptr)
21768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21769 auto saved_ctx = ctx();
21770 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21771 auto res = isl_schedule_constraints_get_coincidence(get());
21772 if (!res)
21773 exception::throw_last_error(saved_ctx);
21774 return manage(res);
21777 isl::union_map schedule_constraints::get_coincidence() const
21779 return coincidence();
21782 isl::schedule schedule_constraints::compute_schedule() const
21784 if (!ptr)
21785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21786 auto saved_ctx = ctx();
21787 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21788 auto res = isl_schedule_constraints_compute_schedule(copy());
21789 if (!res)
21790 exception::throw_last_error(saved_ctx);
21791 return manage(res);
21794 isl::union_map schedule_constraints::conditional_validity() const
21796 if (!ptr)
21797 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21798 auto saved_ctx = ctx();
21799 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21800 auto res = isl_schedule_constraints_get_conditional_validity(get());
21801 if (!res)
21802 exception::throw_last_error(saved_ctx);
21803 return manage(res);
21806 isl::union_map schedule_constraints::get_conditional_validity() const
21808 return conditional_validity();
21811 isl::union_map schedule_constraints::conditional_validity_condition() const
21813 if (!ptr)
21814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21815 auto saved_ctx = ctx();
21816 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21817 auto res = isl_schedule_constraints_get_conditional_validity_condition(get());
21818 if (!res)
21819 exception::throw_last_error(saved_ctx);
21820 return manage(res);
21823 isl::union_map schedule_constraints::get_conditional_validity_condition() const
21825 return conditional_validity_condition();
21828 isl::set schedule_constraints::context() const
21830 if (!ptr)
21831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21832 auto saved_ctx = ctx();
21833 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21834 auto res = isl_schedule_constraints_get_context(get());
21835 if (!res)
21836 exception::throw_last_error(saved_ctx);
21837 return manage(res);
21840 isl::set schedule_constraints::get_context() const
21842 return context();
21845 isl::union_set schedule_constraints::domain() const
21847 if (!ptr)
21848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21849 auto saved_ctx = ctx();
21850 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21851 auto res = isl_schedule_constraints_get_domain(get());
21852 if (!res)
21853 exception::throw_last_error(saved_ctx);
21854 return manage(res);
21857 isl::union_set schedule_constraints::get_domain() const
21859 return domain();
21862 isl::schedule_constraints schedule_constraints::on_domain(isl::union_set domain)
21864 if (domain.is_null())
21865 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21866 auto saved_ctx = domain.ctx();
21867 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21868 auto res = isl_schedule_constraints_on_domain(domain.release());
21869 if (!res)
21870 exception::throw_last_error(saved_ctx);
21871 return manage(res);
21874 isl::union_map schedule_constraints::proximity() const
21876 if (!ptr)
21877 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21878 auto saved_ctx = ctx();
21879 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21880 auto res = isl_schedule_constraints_get_proximity(get());
21881 if (!res)
21882 exception::throw_last_error(saved_ctx);
21883 return manage(res);
21886 isl::union_map schedule_constraints::get_proximity() const
21888 return proximity();
21891 isl::schedule_constraints schedule_constraints::set_coincidence(isl::union_map coincidence) const
21893 if (!ptr || coincidence.is_null())
21894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21895 auto saved_ctx = ctx();
21896 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21897 auto res = isl_schedule_constraints_set_coincidence(copy(), coincidence.release());
21898 if (!res)
21899 exception::throw_last_error(saved_ctx);
21900 return manage(res);
21903 isl::schedule_constraints schedule_constraints::set_conditional_validity(isl::union_map condition, isl::union_map validity) const
21905 if (!ptr || condition.is_null() || validity.is_null())
21906 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21907 auto saved_ctx = ctx();
21908 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21909 auto res = isl_schedule_constraints_set_conditional_validity(copy(), condition.release(), validity.release());
21910 if (!res)
21911 exception::throw_last_error(saved_ctx);
21912 return manage(res);
21915 isl::schedule_constraints schedule_constraints::set_context(isl::set context) const
21917 if (!ptr || context.is_null())
21918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21919 auto saved_ctx = ctx();
21920 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21921 auto res = isl_schedule_constraints_set_context(copy(), context.release());
21922 if (!res)
21923 exception::throw_last_error(saved_ctx);
21924 return manage(res);
21927 isl::schedule_constraints schedule_constraints::set_proximity(isl::union_map proximity) const
21929 if (!ptr || proximity.is_null())
21930 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21931 auto saved_ctx = ctx();
21932 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21933 auto res = isl_schedule_constraints_set_proximity(copy(), proximity.release());
21934 if (!res)
21935 exception::throw_last_error(saved_ctx);
21936 return manage(res);
21939 isl::schedule_constraints schedule_constraints::set_validity(isl::union_map validity) const
21941 if (!ptr || validity.is_null())
21942 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21943 auto saved_ctx = ctx();
21944 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21945 auto res = isl_schedule_constraints_set_validity(copy(), validity.release());
21946 if (!res)
21947 exception::throw_last_error(saved_ctx);
21948 return manage(res);
21951 isl::union_map schedule_constraints::validity() const
21953 if (!ptr)
21954 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21955 auto saved_ctx = ctx();
21956 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21957 auto res = isl_schedule_constraints_get_validity(get());
21958 if (!res)
21959 exception::throw_last_error(saved_ctx);
21960 return manage(res);
21963 isl::union_map schedule_constraints::get_validity() const
21965 return validity();
21968 inline std::ostream &operator<<(std::ostream &os, const schedule_constraints &obj)
21970 if (!obj.get())
21971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21972 auto saved_ctx = isl_schedule_constraints_get_ctx(obj.get());
21973 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21974 char *str = isl_schedule_constraints_to_str(obj.get());
21975 if (!str)
21976 exception::throw_last_error(saved_ctx);
21977 os << str;
21978 free(str);
21979 return os;
21982 // implementations for isl::schedule_node
21983 schedule_node manage(__isl_take isl_schedule_node *ptr) {
21984 if (!ptr)
21985 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21986 return schedule_node(ptr);
21988 schedule_node manage_copy(__isl_keep isl_schedule_node *ptr) {
21989 if (!ptr)
21990 exception::throw_invalid("NULL input", __FILE__, __LINE__);
21991 auto saved_ctx = isl_schedule_node_get_ctx(ptr);
21992 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
21993 ptr = isl_schedule_node_copy(ptr);
21994 if (!ptr)
21995 exception::throw_last_error(saved_ctx);
21996 return schedule_node(ptr);
21999 schedule_node::schedule_node(__isl_take isl_schedule_node *ptr)
22000 : ptr(ptr) {}
22002 schedule_node::schedule_node()
22003 : ptr(nullptr) {}
22005 schedule_node::schedule_node(const schedule_node &obj)
22006 : ptr(nullptr)
22008 if (!obj.ptr)
22009 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22010 auto saved_ctx = isl_schedule_node_get_ctx(obj.ptr);
22011 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22012 ptr = obj.copy();
22013 if (!ptr)
22014 exception::throw_last_error(saved_ctx);
22017 schedule_node &schedule_node::operator=(schedule_node obj) {
22018 std::swap(this->ptr, obj.ptr);
22019 return *this;
22022 schedule_node::~schedule_node() {
22023 if (ptr)
22024 isl_schedule_node_free(ptr);
22027 __isl_give isl_schedule_node *schedule_node::copy() const & {
22028 return isl_schedule_node_copy(ptr);
22031 __isl_keep isl_schedule_node *schedule_node::get() const {
22032 return ptr;
22035 __isl_give isl_schedule_node *schedule_node::release() {
22036 isl_schedule_node *tmp = ptr;
22037 ptr = nullptr;
22038 return tmp;
22041 bool schedule_node::is_null() const {
22042 return ptr == nullptr;
22045 template <typename T, typename>
22046 bool schedule_node::isa_type(T subtype) const
22048 if (is_null())
22049 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22050 return isl_schedule_node_get_type(get()) == subtype;
22052 template <class T>
22053 bool schedule_node::isa() const
22055 return isa_type<decltype(T::type)>(T::type);
22057 template <class T>
22058 T schedule_node::as() const
22060 if (!isa<T>())
22061 exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
22062 return T(copy());
22065 isl::ctx schedule_node::ctx() const {
22066 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22069 isl::schedule_node schedule_node::ancestor(int generation) const
22071 if (!ptr)
22072 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22073 auto saved_ctx = ctx();
22074 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22075 auto res = isl_schedule_node_ancestor(copy(), generation);
22076 if (!res)
22077 exception::throw_last_error(saved_ctx);
22078 return manage(res);
22081 unsigned schedule_node::ancestor_child_position(const isl::schedule_node &ancestor) const
22083 if (!ptr || ancestor.is_null())
22084 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22085 auto saved_ctx = ctx();
22086 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22087 auto res = isl_schedule_node_get_ancestor_child_position(get(), ancestor.get());
22088 if (res < 0)
22089 exception::throw_last_error(saved_ctx);
22090 return res;
22093 unsigned schedule_node::get_ancestor_child_position(const isl::schedule_node &ancestor) const
22095 return ancestor_child_position(ancestor);
22098 isl::schedule_node schedule_node::child(int pos) const
22100 if (!ptr)
22101 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22102 auto saved_ctx = ctx();
22103 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22104 auto res = isl_schedule_node_child(copy(), pos);
22105 if (!res)
22106 exception::throw_last_error(saved_ctx);
22107 return manage(res);
22110 unsigned schedule_node::child_position() const
22112 if (!ptr)
22113 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22114 auto saved_ctx = ctx();
22115 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22116 auto res = isl_schedule_node_get_child_position(get());
22117 if (res < 0)
22118 exception::throw_last_error(saved_ctx);
22119 return res;
22122 unsigned schedule_node::get_child_position() const
22124 return child_position();
22127 bool schedule_node::every_descendant(const std::function<bool(isl::schedule_node)> &test) const
22129 if (!ptr)
22130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22131 auto saved_ctx = ctx();
22132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22133 struct test_data {
22134 std::function<bool(isl::schedule_node)> func;
22135 std::exception_ptr eptr;
22136 } test_data = { test };
22137 auto test_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
22138 auto *data = static_cast<struct test_data *>(arg_1);
22139 ISL_CPP_TRY {
22140 auto ret = (data->func)(manage_copy(arg_0));
22141 return ret ? isl_bool_true : isl_bool_false;
22142 } ISL_CPP_CATCH_ALL {
22143 data->eptr = std::current_exception();
22144 return isl_bool_error;
22147 auto res = isl_schedule_node_every_descendant(get(), test_lambda, &test_data);
22148 if (test_data.eptr)
22149 std::rethrow_exception(test_data.eptr);
22150 if (res < 0)
22151 exception::throw_last_error(saved_ctx);
22152 return res;
22155 isl::schedule_node schedule_node::first_child() const
22157 if (!ptr)
22158 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22159 auto saved_ctx = ctx();
22160 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22161 auto res = isl_schedule_node_first_child(copy());
22162 if (!res)
22163 exception::throw_last_error(saved_ctx);
22164 return manage(res);
22167 void schedule_node::foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const
22169 if (!ptr)
22170 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22171 auto saved_ctx = ctx();
22172 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22173 struct fn_data {
22174 std::function<void(isl::schedule_node)> func;
22175 std::exception_ptr eptr;
22176 } fn_data = { fn };
22177 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_stat {
22178 auto *data = static_cast<struct fn_data *>(arg_1);
22179 ISL_CPP_TRY {
22180 (data->func)(manage_copy(arg_0));
22181 return isl_stat_ok;
22182 } ISL_CPP_CATCH_ALL {
22183 data->eptr = std::current_exception();
22184 return isl_stat_error;
22187 auto res = isl_schedule_node_foreach_ancestor_top_down(get(), fn_lambda, &fn_data);
22188 if (fn_data.eptr)
22189 std::rethrow_exception(fn_data.eptr);
22190 if (res < 0)
22191 exception::throw_last_error(saved_ctx);
22192 return;
22195 void schedule_node::foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const
22197 if (!ptr)
22198 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22199 auto saved_ctx = ctx();
22200 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22201 struct fn_data {
22202 std::function<bool(isl::schedule_node)> func;
22203 std::exception_ptr eptr;
22204 } fn_data = { fn };
22205 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_bool {
22206 auto *data = static_cast<struct fn_data *>(arg_1);
22207 ISL_CPP_TRY {
22208 auto ret = (data->func)(manage_copy(arg_0));
22209 return ret ? isl_bool_true : isl_bool_false;
22210 } ISL_CPP_CATCH_ALL {
22211 data->eptr = std::current_exception();
22212 return isl_bool_error;
22215 auto res = isl_schedule_node_foreach_descendant_top_down(get(), fn_lambda, &fn_data);
22216 if (fn_data.eptr)
22217 std::rethrow_exception(fn_data.eptr);
22218 if (res < 0)
22219 exception::throw_last_error(saved_ctx);
22220 return;
22223 isl::schedule_node schedule_node::from_domain(isl::union_set domain)
22225 if (domain.is_null())
22226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22227 auto saved_ctx = domain.ctx();
22228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22229 auto res = isl_schedule_node_from_domain(domain.release());
22230 if (!res)
22231 exception::throw_last_error(saved_ctx);
22232 return manage(res);
22235 isl::schedule_node schedule_node::from_extension(isl::union_map extension)
22237 if (extension.is_null())
22238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22239 auto saved_ctx = extension.ctx();
22240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22241 auto res = isl_schedule_node_from_extension(extension.release());
22242 if (!res)
22243 exception::throw_last_error(saved_ctx);
22244 return manage(res);
22247 isl::schedule_node schedule_node::graft_after(isl::schedule_node graft) const
22249 if (!ptr || graft.is_null())
22250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22251 auto saved_ctx = ctx();
22252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22253 auto res = isl_schedule_node_graft_after(copy(), graft.release());
22254 if (!res)
22255 exception::throw_last_error(saved_ctx);
22256 return manage(res);
22259 isl::schedule_node schedule_node::graft_before(isl::schedule_node graft) const
22261 if (!ptr || graft.is_null())
22262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22263 auto saved_ctx = ctx();
22264 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22265 auto res = isl_schedule_node_graft_before(copy(), graft.release());
22266 if (!res)
22267 exception::throw_last_error(saved_ctx);
22268 return manage(res);
22271 bool schedule_node::has_children() const
22273 if (!ptr)
22274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22275 auto saved_ctx = ctx();
22276 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22277 auto res = isl_schedule_node_has_children(get());
22278 if (res < 0)
22279 exception::throw_last_error(saved_ctx);
22280 return res;
22283 bool schedule_node::has_next_sibling() const
22285 if (!ptr)
22286 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22287 auto saved_ctx = ctx();
22288 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22289 auto res = isl_schedule_node_has_next_sibling(get());
22290 if (res < 0)
22291 exception::throw_last_error(saved_ctx);
22292 return res;
22295 bool schedule_node::has_parent() const
22297 if (!ptr)
22298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22299 auto saved_ctx = ctx();
22300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22301 auto res = isl_schedule_node_has_parent(get());
22302 if (res < 0)
22303 exception::throw_last_error(saved_ctx);
22304 return res;
22307 bool schedule_node::has_previous_sibling() const
22309 if (!ptr)
22310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22311 auto saved_ctx = ctx();
22312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22313 auto res = isl_schedule_node_has_previous_sibling(get());
22314 if (res < 0)
22315 exception::throw_last_error(saved_ctx);
22316 return res;
22319 isl::schedule_node schedule_node::insert_context(isl::set context) const
22321 if (!ptr || context.is_null())
22322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22323 auto saved_ctx = ctx();
22324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22325 auto res = isl_schedule_node_insert_context(copy(), context.release());
22326 if (!res)
22327 exception::throw_last_error(saved_ctx);
22328 return manage(res);
22331 isl::schedule_node schedule_node::insert_filter(isl::union_set filter) const
22333 if (!ptr || filter.is_null())
22334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22335 auto saved_ctx = ctx();
22336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22337 auto res = isl_schedule_node_insert_filter(copy(), filter.release());
22338 if (!res)
22339 exception::throw_last_error(saved_ctx);
22340 return manage(res);
22343 isl::schedule_node schedule_node::insert_guard(isl::set context) const
22345 if (!ptr || context.is_null())
22346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22347 auto saved_ctx = ctx();
22348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22349 auto res = isl_schedule_node_insert_guard(copy(), context.release());
22350 if (!res)
22351 exception::throw_last_error(saved_ctx);
22352 return manage(res);
22355 isl::schedule_node schedule_node::insert_mark(isl::id mark) const
22357 if (!ptr || mark.is_null())
22358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22359 auto saved_ctx = ctx();
22360 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22361 auto res = isl_schedule_node_insert_mark(copy(), mark.release());
22362 if (!res)
22363 exception::throw_last_error(saved_ctx);
22364 return manage(res);
22367 isl::schedule_node schedule_node::insert_mark(const std::string &mark) const
22369 if (!ptr)
22370 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22371 return this->insert_mark(isl::id(ctx(), mark));
22374 isl::schedule_node schedule_node::insert_partial_schedule(isl::multi_union_pw_aff schedule) const
22376 if (!ptr || schedule.is_null())
22377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22378 auto saved_ctx = ctx();
22379 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22380 auto res = isl_schedule_node_insert_partial_schedule(copy(), schedule.release());
22381 if (!res)
22382 exception::throw_last_error(saved_ctx);
22383 return manage(res);
22386 isl::schedule_node schedule_node::insert_sequence(isl::union_set_list filters) const
22388 if (!ptr || filters.is_null())
22389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22390 auto saved_ctx = ctx();
22391 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22392 auto res = isl_schedule_node_insert_sequence(copy(), filters.release());
22393 if (!res)
22394 exception::throw_last_error(saved_ctx);
22395 return manage(res);
22398 isl::schedule_node schedule_node::insert_set(isl::union_set_list filters) const
22400 if (!ptr || filters.is_null())
22401 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22402 auto saved_ctx = ctx();
22403 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22404 auto res = isl_schedule_node_insert_set(copy(), filters.release());
22405 if (!res)
22406 exception::throw_last_error(saved_ctx);
22407 return manage(res);
22410 bool schedule_node::is_equal(const isl::schedule_node &node2) const
22412 if (!ptr || node2.is_null())
22413 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22414 auto saved_ctx = ctx();
22415 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22416 auto res = isl_schedule_node_is_equal(get(), node2.get());
22417 if (res < 0)
22418 exception::throw_last_error(saved_ctx);
22419 return res;
22422 bool schedule_node::is_subtree_anchored() const
22424 if (!ptr)
22425 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22426 auto saved_ctx = ctx();
22427 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22428 auto res = isl_schedule_node_is_subtree_anchored(get());
22429 if (res < 0)
22430 exception::throw_last_error(saved_ctx);
22431 return res;
22434 isl::schedule_node schedule_node::map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const
22436 if (!ptr)
22437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22438 auto saved_ctx = ctx();
22439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22440 struct fn_data {
22441 std::function<isl::schedule_node(isl::schedule_node)> func;
22442 std::exception_ptr eptr;
22443 } fn_data = { fn };
22444 auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_schedule_node * {
22445 auto *data = static_cast<struct fn_data *>(arg_1);
22446 ISL_CPP_TRY {
22447 auto ret = (data->func)(manage(arg_0));
22448 return ret.release();
22449 } ISL_CPP_CATCH_ALL {
22450 data->eptr = std::current_exception();
22451 return NULL;
22454 auto res = isl_schedule_node_map_descendant_bottom_up(copy(), fn_lambda, &fn_data);
22455 if (fn_data.eptr)
22456 std::rethrow_exception(fn_data.eptr);
22457 if (!res)
22458 exception::throw_last_error(saved_ctx);
22459 return manage(res);
22462 unsigned schedule_node::n_children() const
22464 if (!ptr)
22465 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22466 auto saved_ctx = ctx();
22467 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22468 auto res = isl_schedule_node_n_children(get());
22469 if (res < 0)
22470 exception::throw_last_error(saved_ctx);
22471 return res;
22474 isl::schedule_node schedule_node::next_sibling() const
22476 if (!ptr)
22477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22478 auto saved_ctx = ctx();
22479 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22480 auto res = isl_schedule_node_next_sibling(copy());
22481 if (!res)
22482 exception::throw_last_error(saved_ctx);
22483 return manage(res);
22486 isl::schedule_node schedule_node::order_after(isl::union_set filter) const
22488 if (!ptr || filter.is_null())
22489 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22490 auto saved_ctx = ctx();
22491 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22492 auto res = isl_schedule_node_order_after(copy(), filter.release());
22493 if (!res)
22494 exception::throw_last_error(saved_ctx);
22495 return manage(res);
22498 isl::schedule_node schedule_node::order_before(isl::union_set filter) const
22500 if (!ptr || filter.is_null())
22501 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22502 auto saved_ctx = ctx();
22503 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22504 auto res = isl_schedule_node_order_before(copy(), filter.release());
22505 if (!res)
22506 exception::throw_last_error(saved_ctx);
22507 return manage(res);
22510 isl::schedule_node schedule_node::parent() const
22512 if (!ptr)
22513 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22514 auto saved_ctx = ctx();
22515 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22516 auto res = isl_schedule_node_parent(copy());
22517 if (!res)
22518 exception::throw_last_error(saved_ctx);
22519 return manage(res);
22522 isl::multi_union_pw_aff schedule_node::prefix_schedule_multi_union_pw_aff() const
22524 if (!ptr)
22525 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22526 auto saved_ctx = ctx();
22527 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22528 auto res = isl_schedule_node_get_prefix_schedule_multi_union_pw_aff(get());
22529 if (!res)
22530 exception::throw_last_error(saved_ctx);
22531 return manage(res);
22534 isl::multi_union_pw_aff schedule_node::get_prefix_schedule_multi_union_pw_aff() const
22536 return prefix_schedule_multi_union_pw_aff();
22539 isl::union_map schedule_node::prefix_schedule_union_map() const
22541 if (!ptr)
22542 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22543 auto saved_ctx = ctx();
22544 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22545 auto res = isl_schedule_node_get_prefix_schedule_union_map(get());
22546 if (!res)
22547 exception::throw_last_error(saved_ctx);
22548 return manage(res);
22551 isl::union_map schedule_node::get_prefix_schedule_union_map() const
22553 return prefix_schedule_union_map();
22556 isl::union_pw_multi_aff schedule_node::prefix_schedule_union_pw_multi_aff() const
22558 if (!ptr)
22559 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22560 auto saved_ctx = ctx();
22561 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22562 auto res = isl_schedule_node_get_prefix_schedule_union_pw_multi_aff(get());
22563 if (!res)
22564 exception::throw_last_error(saved_ctx);
22565 return manage(res);
22568 isl::union_pw_multi_aff schedule_node::get_prefix_schedule_union_pw_multi_aff() const
22570 return prefix_schedule_union_pw_multi_aff();
22573 isl::schedule_node schedule_node::previous_sibling() const
22575 if (!ptr)
22576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22577 auto saved_ctx = ctx();
22578 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22579 auto res = isl_schedule_node_previous_sibling(copy());
22580 if (!res)
22581 exception::throw_last_error(saved_ctx);
22582 return manage(res);
22585 isl::schedule_node schedule_node::root() const
22587 if (!ptr)
22588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22589 auto saved_ctx = ctx();
22590 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22591 auto res = isl_schedule_node_root(copy());
22592 if (!res)
22593 exception::throw_last_error(saved_ctx);
22594 return manage(res);
22597 isl::schedule schedule_node::schedule() const
22599 if (!ptr)
22600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22601 auto saved_ctx = ctx();
22602 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22603 auto res = isl_schedule_node_get_schedule(get());
22604 if (!res)
22605 exception::throw_last_error(saved_ctx);
22606 return manage(res);
22609 isl::schedule schedule_node::get_schedule() const
22611 return schedule();
22614 isl::schedule_node schedule_node::shared_ancestor(const isl::schedule_node &node2) const
22616 if (!ptr || node2.is_null())
22617 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22618 auto saved_ctx = ctx();
22619 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22620 auto res = isl_schedule_node_get_shared_ancestor(get(), node2.get());
22621 if (!res)
22622 exception::throw_last_error(saved_ctx);
22623 return manage(res);
22626 isl::schedule_node schedule_node::get_shared_ancestor(const isl::schedule_node &node2) const
22628 return shared_ancestor(node2);
22631 unsigned schedule_node::tree_depth() const
22633 if (!ptr)
22634 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22635 auto saved_ctx = ctx();
22636 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22637 auto res = isl_schedule_node_get_tree_depth(get());
22638 if (res < 0)
22639 exception::throw_last_error(saved_ctx);
22640 return res;
22643 unsigned schedule_node::get_tree_depth() const
22645 return tree_depth();
22648 inline std::ostream &operator<<(std::ostream &os, const schedule_node &obj)
22650 if (!obj.get())
22651 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22652 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
22653 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22654 char *str = isl_schedule_node_to_str(obj.get());
22655 if (!str)
22656 exception::throw_last_error(saved_ctx);
22657 os << str;
22658 free(str);
22659 return os;
22662 // implementations for isl::schedule_node_band
22663 schedule_node_band::schedule_node_band(__isl_take isl_schedule_node *ptr)
22664 : schedule_node(ptr) {}
22666 schedule_node_band::schedule_node_band()
22667 : schedule_node() {}
22669 schedule_node_band::schedule_node_band(const schedule_node_band &obj)
22670 : schedule_node(obj)
22674 schedule_node_band &schedule_node_band::operator=(schedule_node_band obj) {
22675 std::swap(this->ptr, obj.ptr);
22676 return *this;
22679 isl::ctx schedule_node_band::ctx() const {
22680 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22683 isl::union_set schedule_node_band::ast_build_options() const
22685 if (!ptr)
22686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22687 auto saved_ctx = ctx();
22688 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22689 auto res = isl_schedule_node_band_get_ast_build_options(get());
22690 if (!res)
22691 exception::throw_last_error(saved_ctx);
22692 return manage(res);
22695 isl::union_set schedule_node_band::get_ast_build_options() const
22697 return ast_build_options();
22700 isl::set schedule_node_band::ast_isolate_option() const
22702 if (!ptr)
22703 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22704 auto saved_ctx = ctx();
22705 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22706 auto res = isl_schedule_node_band_get_ast_isolate_option(get());
22707 if (!res)
22708 exception::throw_last_error(saved_ctx);
22709 return manage(res);
22712 isl::set schedule_node_band::get_ast_isolate_option() const
22714 return ast_isolate_option();
22717 bool schedule_node_band::member_get_coincident(int pos) const
22719 if (!ptr)
22720 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22721 auto saved_ctx = ctx();
22722 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22723 auto res = isl_schedule_node_band_member_get_coincident(get(), pos);
22724 if (res < 0)
22725 exception::throw_last_error(saved_ctx);
22726 return res;
22729 schedule_node_band schedule_node_band::member_set_coincident(int pos, int coincident) const
22731 if (!ptr)
22732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22733 auto saved_ctx = ctx();
22734 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22735 auto res = isl_schedule_node_band_member_set_coincident(copy(), pos, coincident);
22736 if (!res)
22737 exception::throw_last_error(saved_ctx);
22738 return manage(res).as<schedule_node_band>();
22741 schedule_node_band schedule_node_band::mod(isl::multi_val mv) const
22743 if (!ptr || mv.is_null())
22744 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22745 auto saved_ctx = ctx();
22746 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22747 auto res = isl_schedule_node_band_mod(copy(), mv.release());
22748 if (!res)
22749 exception::throw_last_error(saved_ctx);
22750 return manage(res).as<schedule_node_band>();
22753 unsigned schedule_node_band::n_member() const
22755 if (!ptr)
22756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22757 auto saved_ctx = ctx();
22758 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22759 auto res = isl_schedule_node_band_n_member(get());
22760 if (res < 0)
22761 exception::throw_last_error(saved_ctx);
22762 return res;
22765 isl::multi_union_pw_aff schedule_node_band::partial_schedule() const
22767 if (!ptr)
22768 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22769 auto saved_ctx = ctx();
22770 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22771 auto res = isl_schedule_node_band_get_partial_schedule(get());
22772 if (!res)
22773 exception::throw_last_error(saved_ctx);
22774 return manage(res);
22777 isl::multi_union_pw_aff schedule_node_band::get_partial_schedule() const
22779 return partial_schedule();
22782 bool schedule_node_band::permutable() const
22784 if (!ptr)
22785 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22786 auto saved_ctx = ctx();
22787 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22788 auto res = isl_schedule_node_band_get_permutable(get());
22789 if (res < 0)
22790 exception::throw_last_error(saved_ctx);
22791 return res;
22794 bool schedule_node_band::get_permutable() const
22796 return permutable();
22799 schedule_node_band schedule_node_band::scale(isl::multi_val mv) const
22801 if (!ptr || mv.is_null())
22802 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22803 auto saved_ctx = ctx();
22804 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22805 auto res = isl_schedule_node_band_scale(copy(), mv.release());
22806 if (!res)
22807 exception::throw_last_error(saved_ctx);
22808 return manage(res).as<schedule_node_band>();
22811 schedule_node_band schedule_node_band::scale_down(isl::multi_val mv) const
22813 if (!ptr || mv.is_null())
22814 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22815 auto saved_ctx = ctx();
22816 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22817 auto res = isl_schedule_node_band_scale_down(copy(), mv.release());
22818 if (!res)
22819 exception::throw_last_error(saved_ctx);
22820 return manage(res).as<schedule_node_band>();
22823 schedule_node_band schedule_node_band::set_ast_build_options(isl::union_set options) const
22825 if (!ptr || options.is_null())
22826 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22827 auto saved_ctx = ctx();
22828 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22829 auto res = isl_schedule_node_band_set_ast_build_options(copy(), options.release());
22830 if (!res)
22831 exception::throw_last_error(saved_ctx);
22832 return manage(res).as<schedule_node_band>();
22835 schedule_node_band schedule_node_band::set_permutable(int permutable) const
22837 if (!ptr)
22838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22839 auto saved_ctx = ctx();
22840 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22841 auto res = isl_schedule_node_band_set_permutable(copy(), permutable);
22842 if (!res)
22843 exception::throw_last_error(saved_ctx);
22844 return manage(res).as<schedule_node_band>();
22847 schedule_node_band schedule_node_band::shift(isl::multi_union_pw_aff shift) const
22849 if (!ptr || shift.is_null())
22850 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22851 auto saved_ctx = ctx();
22852 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22853 auto res = isl_schedule_node_band_shift(copy(), shift.release());
22854 if (!res)
22855 exception::throw_last_error(saved_ctx);
22856 return manage(res).as<schedule_node_band>();
22859 schedule_node_band schedule_node_band::split(int pos) const
22861 if (!ptr)
22862 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22863 auto saved_ctx = ctx();
22864 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22865 auto res = isl_schedule_node_band_split(copy(), pos);
22866 if (!res)
22867 exception::throw_last_error(saved_ctx);
22868 return manage(res).as<schedule_node_band>();
22871 schedule_node_band schedule_node_band::tile(isl::multi_val sizes) const
22873 if (!ptr || sizes.is_null())
22874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22875 auto saved_ctx = ctx();
22876 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22877 auto res = isl_schedule_node_band_tile(copy(), sizes.release());
22878 if (!res)
22879 exception::throw_last_error(saved_ctx);
22880 return manage(res).as<schedule_node_band>();
22883 schedule_node_band schedule_node_band::member_set_ast_loop_default(int pos) const
22885 if (!ptr)
22886 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22887 auto saved_ctx = ctx();
22888 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22889 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_default);
22890 if (!res)
22891 exception::throw_last_error(saved_ctx);
22892 return manage(res).as<schedule_node_band>();
22895 schedule_node_band schedule_node_band::member_set_ast_loop_atomic(int pos) const
22897 if (!ptr)
22898 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22899 auto saved_ctx = ctx();
22900 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22901 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_atomic);
22902 if (!res)
22903 exception::throw_last_error(saved_ctx);
22904 return manage(res).as<schedule_node_band>();
22907 schedule_node_band schedule_node_band::member_set_ast_loop_unroll(int pos) const
22909 if (!ptr)
22910 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22911 auto saved_ctx = ctx();
22912 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22913 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_unroll);
22914 if (!res)
22915 exception::throw_last_error(saved_ctx);
22916 return manage(res).as<schedule_node_band>();
22919 schedule_node_band schedule_node_band::member_set_ast_loop_separate(int pos) const
22921 if (!ptr)
22922 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22923 auto saved_ctx = ctx();
22924 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22925 auto res = isl_schedule_node_band_member_set_ast_loop_type(copy(), pos, isl_ast_loop_separate);
22926 if (!res)
22927 exception::throw_last_error(saved_ctx);
22928 return manage(res).as<schedule_node_band>();
22931 inline std::ostream &operator<<(std::ostream &os, const schedule_node_band &obj)
22933 if (!obj.get())
22934 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22935 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
22936 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22937 char *str = isl_schedule_node_to_str(obj.get());
22938 if (!str)
22939 exception::throw_last_error(saved_ctx);
22940 os << str;
22941 free(str);
22942 return os;
22945 // implementations for isl::schedule_node_context
22946 schedule_node_context::schedule_node_context(__isl_take isl_schedule_node *ptr)
22947 : schedule_node(ptr) {}
22949 schedule_node_context::schedule_node_context()
22950 : schedule_node() {}
22952 schedule_node_context::schedule_node_context(const schedule_node_context &obj)
22953 : schedule_node(obj)
22957 schedule_node_context &schedule_node_context::operator=(schedule_node_context obj) {
22958 std::swap(this->ptr, obj.ptr);
22959 return *this;
22962 isl::ctx schedule_node_context::ctx() const {
22963 return isl::ctx(isl_schedule_node_get_ctx(ptr));
22966 isl::set schedule_node_context::context() const
22968 if (!ptr)
22969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22970 auto saved_ctx = ctx();
22971 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22972 auto res = isl_schedule_node_context_get_context(get());
22973 if (!res)
22974 exception::throw_last_error(saved_ctx);
22975 return manage(res);
22978 isl::set schedule_node_context::get_context() const
22980 return context();
22983 inline std::ostream &operator<<(std::ostream &os, const schedule_node_context &obj)
22985 if (!obj.get())
22986 exception::throw_invalid("NULL input", __FILE__, __LINE__);
22987 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
22988 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
22989 char *str = isl_schedule_node_to_str(obj.get());
22990 if (!str)
22991 exception::throw_last_error(saved_ctx);
22992 os << str;
22993 free(str);
22994 return os;
22997 // implementations for isl::schedule_node_domain
22998 schedule_node_domain::schedule_node_domain(__isl_take isl_schedule_node *ptr)
22999 : schedule_node(ptr) {}
23001 schedule_node_domain::schedule_node_domain()
23002 : schedule_node() {}
23004 schedule_node_domain::schedule_node_domain(const schedule_node_domain &obj)
23005 : schedule_node(obj)
23009 schedule_node_domain &schedule_node_domain::operator=(schedule_node_domain obj) {
23010 std::swap(this->ptr, obj.ptr);
23011 return *this;
23014 isl::ctx schedule_node_domain::ctx() const {
23015 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23018 isl::union_set schedule_node_domain::domain() const
23020 if (!ptr)
23021 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23022 auto saved_ctx = ctx();
23023 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23024 auto res = isl_schedule_node_domain_get_domain(get());
23025 if (!res)
23026 exception::throw_last_error(saved_ctx);
23027 return manage(res);
23030 isl::union_set schedule_node_domain::get_domain() const
23032 return domain();
23035 inline std::ostream &operator<<(std::ostream &os, const schedule_node_domain &obj)
23037 if (!obj.get())
23038 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23039 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23040 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23041 char *str = isl_schedule_node_to_str(obj.get());
23042 if (!str)
23043 exception::throw_last_error(saved_ctx);
23044 os << str;
23045 free(str);
23046 return os;
23049 // implementations for isl::schedule_node_expansion
23050 schedule_node_expansion::schedule_node_expansion(__isl_take isl_schedule_node *ptr)
23051 : schedule_node(ptr) {}
23053 schedule_node_expansion::schedule_node_expansion()
23054 : schedule_node() {}
23056 schedule_node_expansion::schedule_node_expansion(const schedule_node_expansion &obj)
23057 : schedule_node(obj)
23061 schedule_node_expansion &schedule_node_expansion::operator=(schedule_node_expansion obj) {
23062 std::swap(this->ptr, obj.ptr);
23063 return *this;
23066 isl::ctx schedule_node_expansion::ctx() const {
23067 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23070 isl::union_pw_multi_aff schedule_node_expansion::contraction() const
23072 if (!ptr)
23073 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23074 auto saved_ctx = ctx();
23075 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23076 auto res = isl_schedule_node_expansion_get_contraction(get());
23077 if (!res)
23078 exception::throw_last_error(saved_ctx);
23079 return manage(res);
23082 isl::union_pw_multi_aff schedule_node_expansion::get_contraction() const
23084 return contraction();
23087 isl::union_map schedule_node_expansion::expansion() const
23089 if (!ptr)
23090 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23091 auto saved_ctx = ctx();
23092 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23093 auto res = isl_schedule_node_expansion_get_expansion(get());
23094 if (!res)
23095 exception::throw_last_error(saved_ctx);
23096 return manage(res);
23099 isl::union_map schedule_node_expansion::get_expansion() const
23101 return expansion();
23104 inline std::ostream &operator<<(std::ostream &os, const schedule_node_expansion &obj)
23106 if (!obj.get())
23107 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23108 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23109 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23110 char *str = isl_schedule_node_to_str(obj.get());
23111 if (!str)
23112 exception::throw_last_error(saved_ctx);
23113 os << str;
23114 free(str);
23115 return os;
23118 // implementations for isl::schedule_node_extension
23119 schedule_node_extension::schedule_node_extension(__isl_take isl_schedule_node *ptr)
23120 : schedule_node(ptr) {}
23122 schedule_node_extension::schedule_node_extension()
23123 : schedule_node() {}
23125 schedule_node_extension::schedule_node_extension(const schedule_node_extension &obj)
23126 : schedule_node(obj)
23130 schedule_node_extension &schedule_node_extension::operator=(schedule_node_extension obj) {
23131 std::swap(this->ptr, obj.ptr);
23132 return *this;
23135 isl::ctx schedule_node_extension::ctx() const {
23136 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23139 isl::union_map schedule_node_extension::extension() const
23141 if (!ptr)
23142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23143 auto saved_ctx = ctx();
23144 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23145 auto res = isl_schedule_node_extension_get_extension(get());
23146 if (!res)
23147 exception::throw_last_error(saved_ctx);
23148 return manage(res);
23151 isl::union_map schedule_node_extension::get_extension() const
23153 return extension();
23156 inline std::ostream &operator<<(std::ostream &os, const schedule_node_extension &obj)
23158 if (!obj.get())
23159 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23160 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23161 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23162 char *str = isl_schedule_node_to_str(obj.get());
23163 if (!str)
23164 exception::throw_last_error(saved_ctx);
23165 os << str;
23166 free(str);
23167 return os;
23170 // implementations for isl::schedule_node_filter
23171 schedule_node_filter::schedule_node_filter(__isl_take isl_schedule_node *ptr)
23172 : schedule_node(ptr) {}
23174 schedule_node_filter::schedule_node_filter()
23175 : schedule_node() {}
23177 schedule_node_filter::schedule_node_filter(const schedule_node_filter &obj)
23178 : schedule_node(obj)
23182 schedule_node_filter &schedule_node_filter::operator=(schedule_node_filter obj) {
23183 std::swap(this->ptr, obj.ptr);
23184 return *this;
23187 isl::ctx schedule_node_filter::ctx() const {
23188 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23191 isl::union_set schedule_node_filter::filter() const
23193 if (!ptr)
23194 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23195 auto saved_ctx = ctx();
23196 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23197 auto res = isl_schedule_node_filter_get_filter(get());
23198 if (!res)
23199 exception::throw_last_error(saved_ctx);
23200 return manage(res);
23203 isl::union_set schedule_node_filter::get_filter() const
23205 return filter();
23208 inline std::ostream &operator<<(std::ostream &os, const schedule_node_filter &obj)
23210 if (!obj.get())
23211 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23212 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23213 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23214 char *str = isl_schedule_node_to_str(obj.get());
23215 if (!str)
23216 exception::throw_last_error(saved_ctx);
23217 os << str;
23218 free(str);
23219 return os;
23222 // implementations for isl::schedule_node_guard
23223 schedule_node_guard::schedule_node_guard(__isl_take isl_schedule_node *ptr)
23224 : schedule_node(ptr) {}
23226 schedule_node_guard::schedule_node_guard()
23227 : schedule_node() {}
23229 schedule_node_guard::schedule_node_guard(const schedule_node_guard &obj)
23230 : schedule_node(obj)
23234 schedule_node_guard &schedule_node_guard::operator=(schedule_node_guard obj) {
23235 std::swap(this->ptr, obj.ptr);
23236 return *this;
23239 isl::ctx schedule_node_guard::ctx() const {
23240 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23243 isl::set schedule_node_guard::guard() const
23245 if (!ptr)
23246 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23247 auto saved_ctx = ctx();
23248 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23249 auto res = isl_schedule_node_guard_get_guard(get());
23250 if (!res)
23251 exception::throw_last_error(saved_ctx);
23252 return manage(res);
23255 isl::set schedule_node_guard::get_guard() const
23257 return guard();
23260 inline std::ostream &operator<<(std::ostream &os, const schedule_node_guard &obj)
23262 if (!obj.get())
23263 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23264 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23265 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23266 char *str = isl_schedule_node_to_str(obj.get());
23267 if (!str)
23268 exception::throw_last_error(saved_ctx);
23269 os << str;
23270 free(str);
23271 return os;
23274 // implementations for isl::schedule_node_leaf
23275 schedule_node_leaf::schedule_node_leaf(__isl_take isl_schedule_node *ptr)
23276 : schedule_node(ptr) {}
23278 schedule_node_leaf::schedule_node_leaf()
23279 : schedule_node() {}
23281 schedule_node_leaf::schedule_node_leaf(const schedule_node_leaf &obj)
23282 : schedule_node(obj)
23286 schedule_node_leaf &schedule_node_leaf::operator=(schedule_node_leaf obj) {
23287 std::swap(this->ptr, obj.ptr);
23288 return *this;
23291 isl::ctx schedule_node_leaf::ctx() const {
23292 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23295 inline std::ostream &operator<<(std::ostream &os, const schedule_node_leaf &obj)
23297 if (!obj.get())
23298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23299 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23301 char *str = isl_schedule_node_to_str(obj.get());
23302 if (!str)
23303 exception::throw_last_error(saved_ctx);
23304 os << str;
23305 free(str);
23306 return os;
23309 // implementations for isl::schedule_node_mark
23310 schedule_node_mark::schedule_node_mark(__isl_take isl_schedule_node *ptr)
23311 : schedule_node(ptr) {}
23313 schedule_node_mark::schedule_node_mark()
23314 : schedule_node() {}
23316 schedule_node_mark::schedule_node_mark(const schedule_node_mark &obj)
23317 : schedule_node(obj)
23321 schedule_node_mark &schedule_node_mark::operator=(schedule_node_mark obj) {
23322 std::swap(this->ptr, obj.ptr);
23323 return *this;
23326 isl::ctx schedule_node_mark::ctx() const {
23327 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23330 inline std::ostream &operator<<(std::ostream &os, const schedule_node_mark &obj)
23332 if (!obj.get())
23333 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23334 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23335 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23336 char *str = isl_schedule_node_to_str(obj.get());
23337 if (!str)
23338 exception::throw_last_error(saved_ctx);
23339 os << str;
23340 free(str);
23341 return os;
23344 // implementations for isl::schedule_node_sequence
23345 schedule_node_sequence::schedule_node_sequence(__isl_take isl_schedule_node *ptr)
23346 : schedule_node(ptr) {}
23348 schedule_node_sequence::schedule_node_sequence()
23349 : schedule_node() {}
23351 schedule_node_sequence::schedule_node_sequence(const schedule_node_sequence &obj)
23352 : schedule_node(obj)
23356 schedule_node_sequence &schedule_node_sequence::operator=(schedule_node_sequence obj) {
23357 std::swap(this->ptr, obj.ptr);
23358 return *this;
23361 isl::ctx schedule_node_sequence::ctx() const {
23362 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23365 inline std::ostream &operator<<(std::ostream &os, const schedule_node_sequence &obj)
23367 if (!obj.get())
23368 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23369 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23370 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23371 char *str = isl_schedule_node_to_str(obj.get());
23372 if (!str)
23373 exception::throw_last_error(saved_ctx);
23374 os << str;
23375 free(str);
23376 return os;
23379 // implementations for isl::schedule_node_set
23380 schedule_node_set::schedule_node_set(__isl_take isl_schedule_node *ptr)
23381 : schedule_node(ptr) {}
23383 schedule_node_set::schedule_node_set()
23384 : schedule_node() {}
23386 schedule_node_set::schedule_node_set(const schedule_node_set &obj)
23387 : schedule_node(obj)
23391 schedule_node_set &schedule_node_set::operator=(schedule_node_set obj) {
23392 std::swap(this->ptr, obj.ptr);
23393 return *this;
23396 isl::ctx schedule_node_set::ctx() const {
23397 return isl::ctx(isl_schedule_node_get_ctx(ptr));
23400 inline std::ostream &operator<<(std::ostream &os, const schedule_node_set &obj)
23402 if (!obj.get())
23403 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23404 auto saved_ctx = isl_schedule_node_get_ctx(obj.get());
23405 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23406 char *str = isl_schedule_node_to_str(obj.get());
23407 if (!str)
23408 exception::throw_last_error(saved_ctx);
23409 os << str;
23410 free(str);
23411 return os;
23414 // implementations for isl::set
23415 set manage(__isl_take isl_set *ptr) {
23416 if (!ptr)
23417 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23418 return set(ptr);
23420 set manage_copy(__isl_keep isl_set *ptr) {
23421 if (!ptr)
23422 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23423 auto saved_ctx = isl_set_get_ctx(ptr);
23424 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23425 ptr = isl_set_copy(ptr);
23426 if (!ptr)
23427 exception::throw_last_error(saved_ctx);
23428 return set(ptr);
23431 set::set(__isl_take isl_set *ptr)
23432 : ptr(ptr) {}
23434 set::set()
23435 : ptr(nullptr) {}
23437 set::set(const set &obj)
23438 : ptr(nullptr)
23440 if (!obj.ptr)
23441 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23442 auto saved_ctx = isl_set_get_ctx(obj.ptr);
23443 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23444 ptr = obj.copy();
23445 if (!ptr)
23446 exception::throw_last_error(saved_ctx);
23449 set::set(isl::basic_set bset)
23451 if (bset.is_null())
23452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23453 auto saved_ctx = bset.ctx();
23454 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23455 auto res = isl_set_from_basic_set(bset.release());
23456 if (!res)
23457 exception::throw_last_error(saved_ctx);
23458 ptr = res;
23461 set::set(isl::point pnt)
23463 if (pnt.is_null())
23464 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23465 auto saved_ctx = pnt.ctx();
23466 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23467 auto res = isl_set_from_point(pnt.release());
23468 if (!res)
23469 exception::throw_last_error(saved_ctx);
23470 ptr = res;
23473 set::set(isl::ctx ctx, const std::string &str)
23475 auto saved_ctx = ctx;
23476 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23477 auto res = isl_set_read_from_str(ctx.release(), str.c_str());
23478 if (!res)
23479 exception::throw_last_error(saved_ctx);
23480 ptr = res;
23483 set &set::operator=(set obj) {
23484 std::swap(this->ptr, obj.ptr);
23485 return *this;
23488 set::~set() {
23489 if (ptr)
23490 isl_set_free(ptr);
23493 __isl_give isl_set *set::copy() const & {
23494 return isl_set_copy(ptr);
23497 __isl_keep isl_set *set::get() const {
23498 return ptr;
23501 __isl_give isl_set *set::release() {
23502 isl_set *tmp = ptr;
23503 ptr = nullptr;
23504 return tmp;
23507 bool set::is_null() const {
23508 return ptr == nullptr;
23511 isl::ctx set::ctx() const {
23512 return isl::ctx(isl_set_get_ctx(ptr));
23515 isl::basic_set set::affine_hull() const
23517 if (!ptr)
23518 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23519 auto saved_ctx = ctx();
23520 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23521 auto res = isl_set_affine_hull(copy());
23522 if (!res)
23523 exception::throw_last_error(saved_ctx);
23524 return manage(res);
23527 isl::set set::apply(isl::map map) const
23529 if (!ptr || map.is_null())
23530 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23531 auto saved_ctx = ctx();
23532 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23533 auto res = isl_set_apply(copy(), map.release());
23534 if (!res)
23535 exception::throw_last_error(saved_ctx);
23536 return manage(res);
23539 isl::union_set set::apply(const isl::union_map &umap) const
23541 if (!ptr)
23542 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23543 return isl::union_set(*this).apply(umap);
23546 isl::set set::apply(const isl::basic_map &map) const
23548 if (!ptr)
23549 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23550 return this->apply(isl::map(map));
23553 isl::pw_multi_aff set::as_pw_multi_aff() const
23555 if (!ptr)
23556 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23557 auto saved_ctx = ctx();
23558 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23559 auto res = isl_set_as_pw_multi_aff(copy());
23560 if (!res)
23561 exception::throw_last_error(saved_ctx);
23562 return manage(res);
23565 isl::set set::as_set() const
23567 if (!ptr)
23568 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23569 return isl::union_set(*this).as_set();
23572 isl::set set::bind(isl::multi_id tuple) const
23574 if (!ptr || tuple.is_null())
23575 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23576 auto saved_ctx = ctx();
23577 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23578 auto res = isl_set_bind(copy(), tuple.release());
23579 if (!res)
23580 exception::throw_last_error(saved_ctx);
23581 return manage(res);
23584 isl::set set::coalesce() const
23586 if (!ptr)
23587 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23588 auto saved_ctx = ctx();
23589 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23590 auto res = isl_set_coalesce(copy());
23591 if (!res)
23592 exception::throw_last_error(saved_ctx);
23593 return manage(res);
23596 isl::set set::complement() const
23598 if (!ptr)
23599 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23600 auto saved_ctx = ctx();
23601 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23602 auto res = isl_set_complement(copy());
23603 if (!res)
23604 exception::throw_last_error(saved_ctx);
23605 return manage(res);
23608 isl::union_set set::compute_divs() const
23610 if (!ptr)
23611 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23612 return isl::union_set(*this).compute_divs();
23615 isl::set set::detect_equalities() const
23617 if (!ptr)
23618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23619 auto saved_ctx = ctx();
23620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23621 auto res = isl_set_detect_equalities(copy());
23622 if (!res)
23623 exception::throw_last_error(saved_ctx);
23624 return manage(res);
23627 isl::val set::dim_max_val(int pos) const
23629 if (!ptr)
23630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23631 auto saved_ctx = ctx();
23632 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23633 auto res = isl_set_dim_max_val(copy(), pos);
23634 if (!res)
23635 exception::throw_last_error(saved_ctx);
23636 return manage(res);
23639 isl::val set::dim_min_val(int pos) const
23641 if (!ptr)
23642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23643 auto saved_ctx = ctx();
23644 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23645 auto res = isl_set_dim_min_val(copy(), pos);
23646 if (!res)
23647 exception::throw_last_error(saved_ctx);
23648 return manage(res);
23651 isl::set set::drop_unused_params() const
23653 if (!ptr)
23654 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23655 auto saved_ctx = ctx();
23656 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23657 auto res = isl_set_drop_unused_params(copy());
23658 if (!res)
23659 exception::throw_last_error(saved_ctx);
23660 return manage(res);
23663 isl::set set::empty(isl::space space)
23665 if (space.is_null())
23666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23667 auto saved_ctx = space.ctx();
23668 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23669 auto res = isl_set_empty(space.release());
23670 if (!res)
23671 exception::throw_last_error(saved_ctx);
23672 return manage(res);
23675 bool set::every_set(const std::function<bool(isl::set)> &test) const
23677 if (!ptr)
23678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23679 return isl::union_set(*this).every_set(test);
23682 isl::set set::extract_set(const isl::space &space) const
23684 if (!ptr)
23685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23686 return isl::union_set(*this).extract_set(space);
23689 isl::set set::flatten() const
23691 if (!ptr)
23692 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23693 auto saved_ctx = ctx();
23694 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23695 auto res = isl_set_flatten(copy());
23696 if (!res)
23697 exception::throw_last_error(saved_ctx);
23698 return manage(res);
23701 void set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
23703 if (!ptr)
23704 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23705 auto saved_ctx = ctx();
23706 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23707 struct fn_data {
23708 std::function<void(isl::basic_set)> func;
23709 std::exception_ptr eptr;
23710 } fn_data = { fn };
23711 auto fn_lambda = [](isl_basic_set *arg_0, void *arg_1) -> isl_stat {
23712 auto *data = static_cast<struct fn_data *>(arg_1);
23713 ISL_CPP_TRY {
23714 (data->func)(manage(arg_0));
23715 return isl_stat_ok;
23716 } ISL_CPP_CATCH_ALL {
23717 data->eptr = std::current_exception();
23718 return isl_stat_error;
23721 auto res = isl_set_foreach_basic_set(get(), fn_lambda, &fn_data);
23722 if (fn_data.eptr)
23723 std::rethrow_exception(fn_data.eptr);
23724 if (res < 0)
23725 exception::throw_last_error(saved_ctx);
23726 return;
23729 void set::foreach_point(const std::function<void(isl::point)> &fn) const
23731 if (!ptr)
23732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23733 auto saved_ctx = ctx();
23734 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23735 struct fn_data {
23736 std::function<void(isl::point)> func;
23737 std::exception_ptr eptr;
23738 } fn_data = { fn };
23739 auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
23740 auto *data = static_cast<struct fn_data *>(arg_1);
23741 ISL_CPP_TRY {
23742 (data->func)(manage(arg_0));
23743 return isl_stat_ok;
23744 } ISL_CPP_CATCH_ALL {
23745 data->eptr = std::current_exception();
23746 return isl_stat_error;
23749 auto res = isl_set_foreach_point(get(), fn_lambda, &fn_data);
23750 if (fn_data.eptr)
23751 std::rethrow_exception(fn_data.eptr);
23752 if (res < 0)
23753 exception::throw_last_error(saved_ctx);
23754 return;
23757 void set::foreach_set(const std::function<void(isl::set)> &fn) const
23759 if (!ptr)
23760 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23761 return isl::union_set(*this).foreach_set(fn);
23764 isl::set set::gist(isl::set context) const
23766 if (!ptr || context.is_null())
23767 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23768 auto saved_ctx = ctx();
23769 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23770 auto res = isl_set_gist(copy(), context.release());
23771 if (!res)
23772 exception::throw_last_error(saved_ctx);
23773 return manage(res);
23776 isl::union_set set::gist(const isl::union_set &context) const
23778 if (!ptr)
23779 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23780 return isl::union_set(*this).gist(context);
23783 isl::set set::gist(const isl::basic_set &context) const
23785 if (!ptr)
23786 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23787 return this->gist(isl::set(context));
23790 isl::set set::gist(const isl::point &context) const
23792 if (!ptr)
23793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23794 return this->gist(isl::set(context));
23797 isl::set set::gist_params(isl::set context) const
23799 if (!ptr || context.is_null())
23800 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23801 auto saved_ctx = ctx();
23802 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23803 auto res = isl_set_gist_params(copy(), context.release());
23804 if (!res)
23805 exception::throw_last_error(saved_ctx);
23806 return manage(res);
23809 isl::map set::identity() const
23811 if (!ptr)
23812 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23813 auto saved_ctx = ctx();
23814 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23815 auto res = isl_set_identity(copy());
23816 if (!res)
23817 exception::throw_last_error(saved_ctx);
23818 return manage(res);
23821 isl::pw_aff set::indicator_function() const
23823 if (!ptr)
23824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23825 auto saved_ctx = ctx();
23826 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23827 auto res = isl_set_indicator_function(copy());
23828 if (!res)
23829 exception::throw_last_error(saved_ctx);
23830 return manage(res);
23833 isl::map set::insert_domain(isl::space domain) const
23835 if (!ptr || domain.is_null())
23836 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23837 auto saved_ctx = ctx();
23838 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23839 auto res = isl_set_insert_domain(copy(), domain.release());
23840 if (!res)
23841 exception::throw_last_error(saved_ctx);
23842 return manage(res);
23845 isl::set set::intersect(isl::set set2) const
23847 if (!ptr || set2.is_null())
23848 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23849 auto saved_ctx = ctx();
23850 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23851 auto res = isl_set_intersect(copy(), set2.release());
23852 if (!res)
23853 exception::throw_last_error(saved_ctx);
23854 return manage(res);
23857 isl::union_set set::intersect(const isl::union_set &uset2) const
23859 if (!ptr)
23860 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23861 return isl::union_set(*this).intersect(uset2);
23864 isl::set set::intersect(const isl::basic_set &set2) const
23866 if (!ptr)
23867 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23868 return this->intersect(isl::set(set2));
23871 isl::set set::intersect(const isl::point &set2) const
23873 if (!ptr)
23874 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23875 return this->intersect(isl::set(set2));
23878 isl::set set::intersect_params(isl::set params) const
23880 if (!ptr || params.is_null())
23881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23882 auto saved_ctx = ctx();
23883 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23884 auto res = isl_set_intersect_params(copy(), params.release());
23885 if (!res)
23886 exception::throw_last_error(saved_ctx);
23887 return manage(res);
23890 bool set::involves_locals() const
23892 if (!ptr)
23893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23894 auto saved_ctx = ctx();
23895 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23896 auto res = isl_set_involves_locals(get());
23897 if (res < 0)
23898 exception::throw_last_error(saved_ctx);
23899 return res;
23902 bool set::is_disjoint(const isl::set &set2) const
23904 if (!ptr || set2.is_null())
23905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23906 auto saved_ctx = ctx();
23907 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23908 auto res = isl_set_is_disjoint(get(), set2.get());
23909 if (res < 0)
23910 exception::throw_last_error(saved_ctx);
23911 return res;
23914 bool set::is_disjoint(const isl::union_set &uset2) const
23916 if (!ptr)
23917 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23918 return isl::union_set(*this).is_disjoint(uset2);
23921 bool set::is_disjoint(const isl::basic_set &set2) const
23923 if (!ptr)
23924 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23925 return this->is_disjoint(isl::set(set2));
23928 bool set::is_disjoint(const isl::point &set2) const
23930 if (!ptr)
23931 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23932 return this->is_disjoint(isl::set(set2));
23935 bool set::is_empty() const
23937 if (!ptr)
23938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23939 auto saved_ctx = ctx();
23940 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23941 auto res = isl_set_is_empty(get());
23942 if (res < 0)
23943 exception::throw_last_error(saved_ctx);
23944 return res;
23947 bool set::is_equal(const isl::set &set2) const
23949 if (!ptr || set2.is_null())
23950 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23951 auto saved_ctx = ctx();
23952 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23953 auto res = isl_set_is_equal(get(), set2.get());
23954 if (res < 0)
23955 exception::throw_last_error(saved_ctx);
23956 return res;
23959 bool set::is_equal(const isl::union_set &uset2) const
23961 if (!ptr)
23962 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23963 return isl::union_set(*this).is_equal(uset2);
23966 bool set::is_equal(const isl::basic_set &set2) const
23968 if (!ptr)
23969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23970 return this->is_equal(isl::set(set2));
23973 bool set::is_equal(const isl::point &set2) const
23975 if (!ptr)
23976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23977 return this->is_equal(isl::set(set2));
23980 bool set::is_singleton() const
23982 if (!ptr)
23983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23984 auto saved_ctx = ctx();
23985 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23986 auto res = isl_set_is_singleton(get());
23987 if (res < 0)
23988 exception::throw_last_error(saved_ctx);
23989 return res;
23992 bool set::is_strict_subset(const isl::set &set2) const
23994 if (!ptr || set2.is_null())
23995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
23996 auto saved_ctx = ctx();
23997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
23998 auto res = isl_set_is_strict_subset(get(), set2.get());
23999 if (res < 0)
24000 exception::throw_last_error(saved_ctx);
24001 return res;
24004 bool set::is_strict_subset(const isl::union_set &uset2) const
24006 if (!ptr)
24007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24008 return isl::union_set(*this).is_strict_subset(uset2);
24011 bool set::is_strict_subset(const isl::basic_set &set2) const
24013 if (!ptr)
24014 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24015 return this->is_strict_subset(isl::set(set2));
24018 bool set::is_strict_subset(const isl::point &set2) const
24020 if (!ptr)
24021 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24022 return this->is_strict_subset(isl::set(set2));
24025 bool set::is_subset(const isl::set &set2) const
24027 if (!ptr || set2.is_null())
24028 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24029 auto saved_ctx = ctx();
24030 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24031 auto res = isl_set_is_subset(get(), set2.get());
24032 if (res < 0)
24033 exception::throw_last_error(saved_ctx);
24034 return res;
24037 bool set::is_subset(const isl::union_set &uset2) const
24039 if (!ptr)
24040 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24041 return isl::union_set(*this).is_subset(uset2);
24044 bool set::is_subset(const isl::basic_set &set2) const
24046 if (!ptr)
24047 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24048 return this->is_subset(isl::set(set2));
24051 bool set::is_subset(const isl::point &set2) const
24053 if (!ptr)
24054 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24055 return this->is_subset(isl::set(set2));
24058 bool set::is_wrapping() const
24060 if (!ptr)
24061 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24062 auto saved_ctx = ctx();
24063 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24064 auto res = isl_set_is_wrapping(get());
24065 if (res < 0)
24066 exception::throw_last_error(saved_ctx);
24067 return res;
24070 bool set::isa_set() const
24072 if (!ptr)
24073 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24074 return isl::union_set(*this).isa_set();
24077 isl::fixed_box set::lattice_tile() const
24079 if (!ptr)
24080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24081 auto saved_ctx = ctx();
24082 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24083 auto res = isl_set_get_lattice_tile(get());
24084 if (!res)
24085 exception::throw_last_error(saved_ctx);
24086 return manage(res);
24089 isl::fixed_box set::get_lattice_tile() const
24091 return lattice_tile();
24094 isl::set set::lexmax() const
24096 if (!ptr)
24097 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24098 auto saved_ctx = ctx();
24099 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24100 auto res = isl_set_lexmax(copy());
24101 if (!res)
24102 exception::throw_last_error(saved_ctx);
24103 return manage(res);
24106 isl::pw_multi_aff set::lexmax_pw_multi_aff() const
24108 if (!ptr)
24109 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24110 auto saved_ctx = ctx();
24111 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24112 auto res = isl_set_lexmax_pw_multi_aff(copy());
24113 if (!res)
24114 exception::throw_last_error(saved_ctx);
24115 return manage(res);
24118 isl::set set::lexmin() const
24120 if (!ptr)
24121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24122 auto saved_ctx = ctx();
24123 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24124 auto res = isl_set_lexmin(copy());
24125 if (!res)
24126 exception::throw_last_error(saved_ctx);
24127 return manage(res);
24130 isl::pw_multi_aff set::lexmin_pw_multi_aff() const
24132 if (!ptr)
24133 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24134 auto saved_ctx = ctx();
24135 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24136 auto res = isl_set_lexmin_pw_multi_aff(copy());
24137 if (!res)
24138 exception::throw_last_error(saved_ctx);
24139 return manage(res);
24142 isl::set set::lower_bound(isl::multi_pw_aff lower) const
24144 if (!ptr || lower.is_null())
24145 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24146 auto saved_ctx = ctx();
24147 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24148 auto res = isl_set_lower_bound_multi_pw_aff(copy(), lower.release());
24149 if (!res)
24150 exception::throw_last_error(saved_ctx);
24151 return manage(res);
24154 isl::set set::lower_bound(isl::multi_val lower) const
24156 if (!ptr || lower.is_null())
24157 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24158 auto saved_ctx = ctx();
24159 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24160 auto res = isl_set_lower_bound_multi_val(copy(), lower.release());
24161 if (!res)
24162 exception::throw_last_error(saved_ctx);
24163 return manage(res);
24166 isl::multi_pw_aff set::max_multi_pw_aff() const
24168 if (!ptr)
24169 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24170 auto saved_ctx = ctx();
24171 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24172 auto res = isl_set_max_multi_pw_aff(copy());
24173 if (!res)
24174 exception::throw_last_error(saved_ctx);
24175 return manage(res);
24178 isl::val set::max_val(const isl::aff &obj) const
24180 if (!ptr || obj.is_null())
24181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24182 auto saved_ctx = ctx();
24183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24184 auto res = isl_set_max_val(get(), obj.get());
24185 if (!res)
24186 exception::throw_last_error(saved_ctx);
24187 return manage(res);
24190 isl::multi_pw_aff set::min_multi_pw_aff() const
24192 if (!ptr)
24193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24194 auto saved_ctx = ctx();
24195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24196 auto res = isl_set_min_multi_pw_aff(copy());
24197 if (!res)
24198 exception::throw_last_error(saved_ctx);
24199 return manage(res);
24202 isl::val set::min_val(const isl::aff &obj) const
24204 if (!ptr || obj.is_null())
24205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24206 auto saved_ctx = ctx();
24207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24208 auto res = isl_set_min_val(get(), obj.get());
24209 if (!res)
24210 exception::throw_last_error(saved_ctx);
24211 return manage(res);
24214 unsigned set::n_basic_set() const
24216 if (!ptr)
24217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24218 auto saved_ctx = ctx();
24219 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24220 auto res = isl_set_n_basic_set(get());
24221 if (res < 0)
24222 exception::throw_last_error(saved_ctx);
24223 return res;
24226 isl::pw_aff set::param_pw_aff_on_domain(isl::id id) const
24228 if (!ptr || id.is_null())
24229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24230 auto saved_ctx = ctx();
24231 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24232 auto res = isl_set_param_pw_aff_on_domain_id(copy(), id.release());
24233 if (!res)
24234 exception::throw_last_error(saved_ctx);
24235 return manage(res);
24238 isl::pw_aff set::param_pw_aff_on_domain(const std::string &id) const
24240 if (!ptr)
24241 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24242 return this->param_pw_aff_on_domain(isl::id(ctx(), id));
24245 isl::set set::params() const
24247 if (!ptr)
24248 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24249 auto saved_ctx = ctx();
24250 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24251 auto res = isl_set_params(copy());
24252 if (!res)
24253 exception::throw_last_error(saved_ctx);
24254 return manage(res);
24257 isl::multi_val set::plain_multi_val_if_fixed() const
24259 if (!ptr)
24260 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24261 auto saved_ctx = ctx();
24262 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24263 auto res = isl_set_get_plain_multi_val_if_fixed(get());
24264 if (!res)
24265 exception::throw_last_error(saved_ctx);
24266 return manage(res);
24269 isl::multi_val set::get_plain_multi_val_if_fixed() const
24271 return plain_multi_val_if_fixed();
24274 isl::basic_set set::polyhedral_hull() const
24276 if (!ptr)
24277 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24278 auto saved_ctx = ctx();
24279 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24280 auto res = isl_set_polyhedral_hull(copy());
24281 if (!res)
24282 exception::throw_last_error(saved_ctx);
24283 return manage(res);
24286 isl::set set::preimage(isl::multi_aff ma) const
24288 if (!ptr || ma.is_null())
24289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24290 auto saved_ctx = ctx();
24291 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24292 auto res = isl_set_preimage_multi_aff(copy(), ma.release());
24293 if (!res)
24294 exception::throw_last_error(saved_ctx);
24295 return manage(res);
24298 isl::set set::preimage(isl::multi_pw_aff mpa) const
24300 if (!ptr || mpa.is_null())
24301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24302 auto saved_ctx = ctx();
24303 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24304 auto res = isl_set_preimage_multi_pw_aff(copy(), mpa.release());
24305 if (!res)
24306 exception::throw_last_error(saved_ctx);
24307 return manage(res);
24310 isl::set set::preimage(isl::pw_multi_aff pma) const
24312 if (!ptr || pma.is_null())
24313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24314 auto saved_ctx = ctx();
24315 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24316 auto res = isl_set_preimage_pw_multi_aff(copy(), pma.release());
24317 if (!res)
24318 exception::throw_last_error(saved_ctx);
24319 return manage(res);
24322 isl::union_set set::preimage(const isl::union_pw_multi_aff &upma) const
24324 if (!ptr)
24325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24326 return isl::union_set(*this).preimage(upma);
24329 isl::set set::product(isl::set set2) const
24331 if (!ptr || set2.is_null())
24332 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24333 auto saved_ctx = ctx();
24334 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24335 auto res = isl_set_product(copy(), set2.release());
24336 if (!res)
24337 exception::throw_last_error(saved_ctx);
24338 return manage(res);
24341 isl::set set::project_out_all_params() const
24343 if (!ptr)
24344 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24345 auto saved_ctx = ctx();
24346 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24347 auto res = isl_set_project_out_all_params(copy());
24348 if (!res)
24349 exception::throw_last_error(saved_ctx);
24350 return manage(res);
24353 isl::set set::project_out_param(isl::id id) const
24355 if (!ptr || id.is_null())
24356 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24357 auto saved_ctx = ctx();
24358 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24359 auto res = isl_set_project_out_param_id(copy(), id.release());
24360 if (!res)
24361 exception::throw_last_error(saved_ctx);
24362 return manage(res);
24365 isl::set set::project_out_param(const std::string &id) const
24367 if (!ptr)
24368 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24369 return this->project_out_param(isl::id(ctx(), id));
24372 isl::set set::project_out_param(isl::id_list list) const
24374 if (!ptr || list.is_null())
24375 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24376 auto saved_ctx = ctx();
24377 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24378 auto res = isl_set_project_out_param_id_list(copy(), list.release());
24379 if (!res)
24380 exception::throw_last_error(saved_ctx);
24381 return manage(res);
24384 isl::pw_aff set::pw_aff_on_domain(isl::val v) const
24386 if (!ptr || v.is_null())
24387 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24388 auto saved_ctx = ctx();
24389 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24390 auto res = isl_set_pw_aff_on_domain_val(copy(), v.release());
24391 if (!res)
24392 exception::throw_last_error(saved_ctx);
24393 return manage(res);
24396 isl::pw_aff set::pw_aff_on_domain(long v) const
24398 if (!ptr)
24399 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24400 return this->pw_aff_on_domain(isl::val(ctx(), v));
24403 isl::pw_multi_aff set::pw_multi_aff_on_domain(isl::multi_val mv) const
24405 if (!ptr || mv.is_null())
24406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24407 auto saved_ctx = ctx();
24408 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24409 auto res = isl_set_pw_multi_aff_on_domain_multi_val(copy(), mv.release());
24410 if (!res)
24411 exception::throw_last_error(saved_ctx);
24412 return manage(res);
24415 isl::basic_set set::sample() const
24417 if (!ptr)
24418 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24419 auto saved_ctx = ctx();
24420 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24421 auto res = isl_set_sample(copy());
24422 if (!res)
24423 exception::throw_last_error(saved_ctx);
24424 return manage(res);
24427 isl::point set::sample_point() const
24429 if (!ptr)
24430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24431 auto saved_ctx = ctx();
24432 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24433 auto res = isl_set_sample_point(copy());
24434 if (!res)
24435 exception::throw_last_error(saved_ctx);
24436 return manage(res);
24439 isl::set_list set::set_list() const
24441 if (!ptr)
24442 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24443 return isl::union_set(*this).set_list();
24446 isl::fixed_box set::simple_fixed_box_hull() const
24448 if (!ptr)
24449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24450 auto saved_ctx = ctx();
24451 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24452 auto res = isl_set_get_simple_fixed_box_hull(get());
24453 if (!res)
24454 exception::throw_last_error(saved_ctx);
24455 return manage(res);
24458 isl::fixed_box set::get_simple_fixed_box_hull() const
24460 return simple_fixed_box_hull();
24463 isl::space set::space() const
24465 if (!ptr)
24466 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24467 auto saved_ctx = ctx();
24468 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24469 auto res = isl_set_get_space(get());
24470 if (!res)
24471 exception::throw_last_error(saved_ctx);
24472 return manage(res);
24475 isl::space set::get_space() const
24477 return space();
24480 isl::val set::stride(int pos) const
24482 if (!ptr)
24483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24484 auto saved_ctx = ctx();
24485 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24486 auto res = isl_set_get_stride(get(), pos);
24487 if (!res)
24488 exception::throw_last_error(saved_ctx);
24489 return manage(res);
24492 isl::val set::get_stride(int pos) const
24494 return stride(pos);
24497 isl::set set::subtract(isl::set set2) const
24499 if (!ptr || set2.is_null())
24500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24501 auto saved_ctx = ctx();
24502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24503 auto res = isl_set_subtract(copy(), set2.release());
24504 if (!res)
24505 exception::throw_last_error(saved_ctx);
24506 return manage(res);
24509 isl::union_set set::subtract(const isl::union_set &uset2) const
24511 if (!ptr)
24512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24513 return isl::union_set(*this).subtract(uset2);
24516 isl::set set::subtract(const isl::basic_set &set2) const
24518 if (!ptr)
24519 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24520 return this->subtract(isl::set(set2));
24523 isl::set set::subtract(const isl::point &set2) const
24525 if (!ptr)
24526 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24527 return this->subtract(isl::set(set2));
24530 isl::set_list set::to_list() const
24532 if (!ptr)
24533 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24534 auto saved_ctx = ctx();
24535 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24536 auto res = isl_set_to_list(copy());
24537 if (!res)
24538 exception::throw_last_error(saved_ctx);
24539 return manage(res);
24542 isl::union_set set::to_union_set() const
24544 if (!ptr)
24545 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24546 auto saved_ctx = ctx();
24547 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24548 auto res = isl_set_to_union_set(copy());
24549 if (!res)
24550 exception::throw_last_error(saved_ctx);
24551 return manage(res);
24554 isl::map set::translation() const
24556 if (!ptr)
24557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24558 auto saved_ctx = ctx();
24559 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24560 auto res = isl_set_translation(copy());
24561 if (!res)
24562 exception::throw_last_error(saved_ctx);
24563 return manage(res);
24566 unsigned set::tuple_dim() const
24568 if (!ptr)
24569 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24570 auto saved_ctx = ctx();
24571 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24572 auto res = isl_set_tuple_dim(get());
24573 if (res < 0)
24574 exception::throw_last_error(saved_ctx);
24575 return res;
24578 isl::set set::unbind_params(isl::multi_id tuple) const
24580 if (!ptr || tuple.is_null())
24581 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24582 auto saved_ctx = ctx();
24583 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24584 auto res = isl_set_unbind_params(copy(), tuple.release());
24585 if (!res)
24586 exception::throw_last_error(saved_ctx);
24587 return manage(res);
24590 isl::map set::unbind_params_insert_domain(isl::multi_id domain) const
24592 if (!ptr || domain.is_null())
24593 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24594 auto saved_ctx = ctx();
24595 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24596 auto res = isl_set_unbind_params_insert_domain(copy(), domain.release());
24597 if (!res)
24598 exception::throw_last_error(saved_ctx);
24599 return manage(res);
24602 isl::set set::unite(isl::set set2) const
24604 if (!ptr || set2.is_null())
24605 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24606 auto saved_ctx = ctx();
24607 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24608 auto res = isl_set_union(copy(), set2.release());
24609 if (!res)
24610 exception::throw_last_error(saved_ctx);
24611 return manage(res);
24614 isl::union_set set::unite(const isl::union_set &uset2) const
24616 if (!ptr)
24617 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24618 return isl::union_set(*this).unite(uset2);
24621 isl::set set::unite(const isl::basic_set &set2) const
24623 if (!ptr)
24624 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24625 return this->unite(isl::set(set2));
24628 isl::set set::unite(const isl::point &set2) const
24630 if (!ptr)
24631 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24632 return this->unite(isl::set(set2));
24635 isl::set set::universe(isl::space space)
24637 if (space.is_null())
24638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24639 auto saved_ctx = space.ctx();
24640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24641 auto res = isl_set_universe(space.release());
24642 if (!res)
24643 exception::throw_last_error(saved_ctx);
24644 return manage(res);
24647 isl::basic_set set::unshifted_simple_hull() const
24649 if (!ptr)
24650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24651 auto saved_ctx = ctx();
24652 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24653 auto res = isl_set_unshifted_simple_hull(copy());
24654 if (!res)
24655 exception::throw_last_error(saved_ctx);
24656 return manage(res);
24659 isl::map set::unwrap() const
24661 if (!ptr)
24662 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24663 auto saved_ctx = ctx();
24664 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24665 auto res = isl_set_unwrap(copy());
24666 if (!res)
24667 exception::throw_last_error(saved_ctx);
24668 return manage(res);
24671 isl::set set::upper_bound(isl::multi_pw_aff upper) const
24673 if (!ptr || upper.is_null())
24674 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24675 auto saved_ctx = ctx();
24676 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24677 auto res = isl_set_upper_bound_multi_pw_aff(copy(), upper.release());
24678 if (!res)
24679 exception::throw_last_error(saved_ctx);
24680 return manage(res);
24683 isl::set set::upper_bound(isl::multi_val upper) const
24685 if (!ptr || upper.is_null())
24686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24687 auto saved_ctx = ctx();
24688 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24689 auto res = isl_set_upper_bound_multi_val(copy(), upper.release());
24690 if (!res)
24691 exception::throw_last_error(saved_ctx);
24692 return manage(res);
24695 isl::set set::wrapped_reverse() const
24697 if (!ptr)
24698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24699 auto saved_ctx = ctx();
24700 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24701 auto res = isl_set_wrapped_reverse(copy());
24702 if (!res)
24703 exception::throw_last_error(saved_ctx);
24704 return manage(res);
24707 inline std::ostream &operator<<(std::ostream &os, const set &obj)
24709 if (!obj.get())
24710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24711 auto saved_ctx = isl_set_get_ctx(obj.get());
24712 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24713 char *str = isl_set_to_str(obj.get());
24714 if (!str)
24715 exception::throw_last_error(saved_ctx);
24716 os << str;
24717 free(str);
24718 return os;
24721 // implementations for isl::set_list
24722 set_list manage(__isl_take isl_set_list *ptr) {
24723 if (!ptr)
24724 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24725 return set_list(ptr);
24727 set_list manage_copy(__isl_keep isl_set_list *ptr) {
24728 if (!ptr)
24729 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24730 auto saved_ctx = isl_set_list_get_ctx(ptr);
24731 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24732 ptr = isl_set_list_copy(ptr);
24733 if (!ptr)
24734 exception::throw_last_error(saved_ctx);
24735 return set_list(ptr);
24738 set_list::set_list(__isl_take isl_set_list *ptr)
24739 : ptr(ptr) {}
24741 set_list::set_list()
24742 : ptr(nullptr) {}
24744 set_list::set_list(const set_list &obj)
24745 : ptr(nullptr)
24747 if (!obj.ptr)
24748 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24749 auto saved_ctx = isl_set_list_get_ctx(obj.ptr);
24750 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24751 ptr = obj.copy();
24752 if (!ptr)
24753 exception::throw_last_error(saved_ctx);
24756 set_list::set_list(isl::ctx ctx, int n)
24758 auto saved_ctx = ctx;
24759 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24760 auto res = isl_set_list_alloc(ctx.release(), n);
24761 if (!res)
24762 exception::throw_last_error(saved_ctx);
24763 ptr = res;
24766 set_list::set_list(isl::set el)
24768 if (el.is_null())
24769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24770 auto saved_ctx = el.ctx();
24771 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24772 auto res = isl_set_list_from_set(el.release());
24773 if (!res)
24774 exception::throw_last_error(saved_ctx);
24775 ptr = res;
24778 set_list::set_list(isl::ctx ctx, const std::string &str)
24780 auto saved_ctx = ctx;
24781 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24782 auto res = isl_set_list_read_from_str(ctx.release(), str.c_str());
24783 if (!res)
24784 exception::throw_last_error(saved_ctx);
24785 ptr = res;
24788 set_list &set_list::operator=(set_list obj) {
24789 std::swap(this->ptr, obj.ptr);
24790 return *this;
24793 set_list::~set_list() {
24794 if (ptr)
24795 isl_set_list_free(ptr);
24798 __isl_give isl_set_list *set_list::copy() const & {
24799 return isl_set_list_copy(ptr);
24802 __isl_keep isl_set_list *set_list::get() const {
24803 return ptr;
24806 __isl_give isl_set_list *set_list::release() {
24807 isl_set_list *tmp = ptr;
24808 ptr = nullptr;
24809 return tmp;
24812 bool set_list::is_null() const {
24813 return ptr == nullptr;
24816 isl::ctx set_list::ctx() const {
24817 return isl::ctx(isl_set_list_get_ctx(ptr));
24820 isl::set_list set_list::add(isl::set el) const
24822 if (!ptr || el.is_null())
24823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24824 auto saved_ctx = ctx();
24825 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24826 auto res = isl_set_list_add(copy(), el.release());
24827 if (!res)
24828 exception::throw_last_error(saved_ctx);
24829 return manage(res);
24832 isl::set set_list::at(int index) const
24834 if (!ptr)
24835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24836 auto saved_ctx = ctx();
24837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24838 auto res = isl_set_list_get_at(get(), index);
24839 if (!res)
24840 exception::throw_last_error(saved_ctx);
24841 return manage(res);
24844 isl::set set_list::get_at(int index) const
24846 return at(index);
24849 isl::set_list set_list::clear() const
24851 if (!ptr)
24852 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24853 auto saved_ctx = ctx();
24854 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24855 auto res = isl_set_list_clear(copy());
24856 if (!res)
24857 exception::throw_last_error(saved_ctx);
24858 return manage(res);
24861 isl::set_list set_list::concat(isl::set_list list2) const
24863 if (!ptr || list2.is_null())
24864 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24865 auto saved_ctx = ctx();
24866 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24867 auto res = isl_set_list_concat(copy(), list2.release());
24868 if (!res)
24869 exception::throw_last_error(saved_ctx);
24870 return manage(res);
24873 isl::set_list set_list::drop(unsigned int first, unsigned int n) const
24875 if (!ptr)
24876 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24877 auto saved_ctx = ctx();
24878 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24879 auto res = isl_set_list_drop(copy(), first, n);
24880 if (!res)
24881 exception::throw_last_error(saved_ctx);
24882 return manage(res);
24885 void set_list::foreach(const std::function<void(isl::set)> &fn) const
24887 if (!ptr)
24888 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24889 auto saved_ctx = ctx();
24890 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24891 struct fn_data {
24892 std::function<void(isl::set)> func;
24893 std::exception_ptr eptr;
24894 } fn_data = { fn };
24895 auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
24896 auto *data = static_cast<struct fn_data *>(arg_1);
24897 ISL_CPP_TRY {
24898 (data->func)(manage(arg_0));
24899 return isl_stat_ok;
24900 } ISL_CPP_CATCH_ALL {
24901 data->eptr = std::current_exception();
24902 return isl_stat_error;
24905 auto res = isl_set_list_foreach(get(), fn_lambda, &fn_data);
24906 if (fn_data.eptr)
24907 std::rethrow_exception(fn_data.eptr);
24908 if (res < 0)
24909 exception::throw_last_error(saved_ctx);
24910 return;
24913 void set_list::foreach_scc(const std::function<bool(isl::set, isl::set)> &follows, const std::function<void(isl::set_list)> &fn) const
24915 if (!ptr)
24916 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24917 auto saved_ctx = ctx();
24918 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24919 struct follows_data {
24920 std::function<bool(isl::set, isl::set)> func;
24921 std::exception_ptr eptr;
24922 } follows_data = { follows };
24923 auto follows_lambda = [](isl_set *arg_0, isl_set *arg_1, void *arg_2) -> isl_bool {
24924 auto *data = static_cast<struct follows_data *>(arg_2);
24925 ISL_CPP_TRY {
24926 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
24927 return ret ? isl_bool_true : isl_bool_false;
24928 } ISL_CPP_CATCH_ALL {
24929 data->eptr = std::current_exception();
24930 return isl_bool_error;
24933 struct fn_data {
24934 std::function<void(isl::set_list)> func;
24935 std::exception_ptr eptr;
24936 } fn_data = { fn };
24937 auto fn_lambda = [](isl_set_list *arg_0, void *arg_1) -> isl_stat {
24938 auto *data = static_cast<struct fn_data *>(arg_1);
24939 ISL_CPP_TRY {
24940 (data->func)(manage(arg_0));
24941 return isl_stat_ok;
24942 } ISL_CPP_CATCH_ALL {
24943 data->eptr = std::current_exception();
24944 return isl_stat_error;
24947 auto res = isl_set_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
24948 if (follows_data.eptr)
24949 std::rethrow_exception(follows_data.eptr);
24950 if (fn_data.eptr)
24951 std::rethrow_exception(fn_data.eptr);
24952 if (res < 0)
24953 exception::throw_last_error(saved_ctx);
24954 return;
24957 isl::set_list set_list::insert(unsigned int pos, isl::set el) const
24959 if (!ptr || el.is_null())
24960 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24961 auto saved_ctx = ctx();
24962 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24963 auto res = isl_set_list_insert(copy(), pos, el.release());
24964 if (!res)
24965 exception::throw_last_error(saved_ctx);
24966 return manage(res);
24969 isl::set_list set_list::set_at(int index, isl::set el) const
24971 if (!ptr || el.is_null())
24972 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24973 auto saved_ctx = ctx();
24974 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24975 auto res = isl_set_list_set_at(copy(), index, el.release());
24976 if (!res)
24977 exception::throw_last_error(saved_ctx);
24978 return manage(res);
24981 unsigned set_list::size() const
24983 if (!ptr)
24984 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24985 auto saved_ctx = ctx();
24986 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24987 auto res = isl_set_list_size(get());
24988 if (res < 0)
24989 exception::throw_last_error(saved_ctx);
24990 return res;
24993 inline std::ostream &operator<<(std::ostream &os, const set_list &obj)
24995 if (!obj.get())
24996 exception::throw_invalid("NULL input", __FILE__, __LINE__);
24997 auto saved_ctx = isl_set_list_get_ctx(obj.get());
24998 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
24999 char *str = isl_set_list_to_str(obj.get());
25000 if (!str)
25001 exception::throw_last_error(saved_ctx);
25002 os << str;
25003 free(str);
25004 return os;
25007 // implementations for isl::space
25008 space manage(__isl_take isl_space *ptr) {
25009 if (!ptr)
25010 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25011 return space(ptr);
25013 space manage_copy(__isl_keep isl_space *ptr) {
25014 if (!ptr)
25015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25016 auto saved_ctx = isl_space_get_ctx(ptr);
25017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25018 ptr = isl_space_copy(ptr);
25019 if (!ptr)
25020 exception::throw_last_error(saved_ctx);
25021 return space(ptr);
25024 space::space(__isl_take isl_space *ptr)
25025 : ptr(ptr) {}
25027 space::space()
25028 : ptr(nullptr) {}
25030 space::space(const space &obj)
25031 : ptr(nullptr)
25033 if (!obj.ptr)
25034 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25035 auto saved_ctx = isl_space_get_ctx(obj.ptr);
25036 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25037 ptr = obj.copy();
25038 if (!ptr)
25039 exception::throw_last_error(saved_ctx);
25042 space::space(isl::ctx ctx, const std::string &str)
25044 auto saved_ctx = ctx;
25045 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25046 auto res = isl_space_read_from_str(ctx.release(), str.c_str());
25047 if (!res)
25048 exception::throw_last_error(saved_ctx);
25049 ptr = res;
25052 space &space::operator=(space obj) {
25053 std::swap(this->ptr, obj.ptr);
25054 return *this;
25057 space::~space() {
25058 if (ptr)
25059 isl_space_free(ptr);
25062 __isl_give isl_space *space::copy() const & {
25063 return isl_space_copy(ptr);
25066 __isl_keep isl_space *space::get() const {
25067 return ptr;
25070 __isl_give isl_space *space::release() {
25071 isl_space *tmp = ptr;
25072 ptr = nullptr;
25073 return tmp;
25076 bool space::is_null() const {
25077 return ptr == nullptr;
25080 isl::ctx space::ctx() const {
25081 return isl::ctx(isl_space_get_ctx(ptr));
25084 isl::space space::add_named_tuple(isl::id tuple_id, unsigned int dim) const
25086 if (!ptr || tuple_id.is_null())
25087 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25088 auto saved_ctx = ctx();
25089 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25090 auto res = isl_space_add_named_tuple_id_ui(copy(), tuple_id.release(), dim);
25091 if (!res)
25092 exception::throw_last_error(saved_ctx);
25093 return manage(res);
25096 isl::space space::add_named_tuple(const std::string &tuple_id, unsigned int dim) const
25098 if (!ptr)
25099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25100 return this->add_named_tuple(isl::id(ctx(), tuple_id), dim);
25103 isl::space space::add_param(isl::id id) const
25105 if (!ptr || id.is_null())
25106 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25107 auto saved_ctx = ctx();
25108 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25109 auto res = isl_space_add_param_id(copy(), id.release());
25110 if (!res)
25111 exception::throw_last_error(saved_ctx);
25112 return manage(res);
25115 isl::space space::add_param(const std::string &id) const
25117 if (!ptr)
25118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25119 return this->add_param(isl::id(ctx(), id));
25122 isl::space space::add_unnamed_tuple(unsigned int dim) const
25124 if (!ptr)
25125 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25126 auto saved_ctx = ctx();
25127 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25128 auto res = isl_space_add_unnamed_tuple_ui(copy(), dim);
25129 if (!res)
25130 exception::throw_last_error(saved_ctx);
25131 return manage(res);
25134 isl::space space::curry() const
25136 if (!ptr)
25137 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25138 auto saved_ctx = ctx();
25139 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25140 auto res = isl_space_curry(copy());
25141 if (!res)
25142 exception::throw_last_error(saved_ctx);
25143 return manage(res);
25146 isl::space space::domain() const
25148 if (!ptr)
25149 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25150 auto saved_ctx = ctx();
25151 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25152 auto res = isl_space_domain(copy());
25153 if (!res)
25154 exception::throw_last_error(saved_ctx);
25155 return manage(res);
25158 isl::multi_aff space::domain_map_multi_aff() const
25160 if (!ptr)
25161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25162 auto saved_ctx = ctx();
25163 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25164 auto res = isl_space_domain_map_multi_aff(copy());
25165 if (!res)
25166 exception::throw_last_error(saved_ctx);
25167 return manage(res);
25170 isl::pw_multi_aff space::domain_map_pw_multi_aff() const
25172 if (!ptr)
25173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25174 auto saved_ctx = ctx();
25175 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25176 auto res = isl_space_domain_map_pw_multi_aff(copy());
25177 if (!res)
25178 exception::throw_last_error(saved_ctx);
25179 return manage(res);
25182 isl::space space::domain_reverse() const
25184 if (!ptr)
25185 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25186 auto saved_ctx = ctx();
25187 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25188 auto res = isl_space_domain_reverse(copy());
25189 if (!res)
25190 exception::throw_last_error(saved_ctx);
25191 return manage(res);
25194 isl::id space::domain_tuple_id() const
25196 if (!ptr)
25197 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25198 auto saved_ctx = ctx();
25199 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25200 auto res = isl_space_get_domain_tuple_id(get());
25201 if (!res)
25202 exception::throw_last_error(saved_ctx);
25203 return manage(res);
25206 isl::id space::get_domain_tuple_id() const
25208 return domain_tuple_id();
25211 isl::space space::drop_all_params() const
25213 if (!ptr)
25214 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25215 auto saved_ctx = ctx();
25216 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25217 auto res = isl_space_drop_all_params(copy());
25218 if (!res)
25219 exception::throw_last_error(saved_ctx);
25220 return manage(res);
25223 isl::space space::flatten_domain() const
25225 if (!ptr)
25226 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25227 auto saved_ctx = ctx();
25228 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25229 auto res = isl_space_flatten_domain(copy());
25230 if (!res)
25231 exception::throw_last_error(saved_ctx);
25232 return manage(res);
25235 isl::space space::flatten_range() const
25237 if (!ptr)
25238 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25239 auto saved_ctx = ctx();
25240 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25241 auto res = isl_space_flatten_range(copy());
25242 if (!res)
25243 exception::throw_last_error(saved_ctx);
25244 return manage(res);
25247 bool space::has_domain_tuple_id() const
25249 if (!ptr)
25250 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25251 auto saved_ctx = ctx();
25252 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25253 auto res = isl_space_has_domain_tuple_id(get());
25254 if (res < 0)
25255 exception::throw_last_error(saved_ctx);
25256 return res;
25259 bool space::has_range_tuple_id() const
25261 if (!ptr)
25262 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25263 auto saved_ctx = ctx();
25264 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25265 auto res = isl_space_has_range_tuple_id(get());
25266 if (res < 0)
25267 exception::throw_last_error(saved_ctx);
25268 return res;
25271 isl::multi_aff space::identity_multi_aff_on_domain() const
25273 if (!ptr)
25274 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25275 auto saved_ctx = ctx();
25276 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25277 auto res = isl_space_identity_multi_aff_on_domain(copy());
25278 if (!res)
25279 exception::throw_last_error(saved_ctx);
25280 return manage(res);
25283 isl::multi_pw_aff space::identity_multi_pw_aff_on_domain() const
25285 if (!ptr)
25286 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25287 auto saved_ctx = ctx();
25288 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25289 auto res = isl_space_identity_multi_pw_aff_on_domain(copy());
25290 if (!res)
25291 exception::throw_last_error(saved_ctx);
25292 return manage(res);
25295 isl::pw_multi_aff space::identity_pw_multi_aff_on_domain() const
25297 if (!ptr)
25298 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25299 auto saved_ctx = ctx();
25300 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25301 auto res = isl_space_identity_pw_multi_aff_on_domain(copy());
25302 if (!res)
25303 exception::throw_last_error(saved_ctx);
25304 return manage(res);
25307 bool space::is_equal(const isl::space &space2) const
25309 if (!ptr || space2.is_null())
25310 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25311 auto saved_ctx = ctx();
25312 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25313 auto res = isl_space_is_equal(get(), space2.get());
25314 if (res < 0)
25315 exception::throw_last_error(saved_ctx);
25316 return res;
25319 bool space::is_wrapping() const
25321 if (!ptr)
25322 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25323 auto saved_ctx = ctx();
25324 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25325 auto res = isl_space_is_wrapping(get());
25326 if (res < 0)
25327 exception::throw_last_error(saved_ctx);
25328 return res;
25331 isl::space space::map_from_set() const
25333 if (!ptr)
25334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25335 auto saved_ctx = ctx();
25336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25337 auto res = isl_space_map_from_set(copy());
25338 if (!res)
25339 exception::throw_last_error(saved_ctx);
25340 return manage(res);
25343 isl::multi_aff space::multi_aff(isl::aff_list list) const
25345 if (!ptr || list.is_null())
25346 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25347 auto saved_ctx = ctx();
25348 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25349 auto res = isl_space_multi_aff(copy(), list.release());
25350 if (!res)
25351 exception::throw_last_error(saved_ctx);
25352 return manage(res);
25355 isl::multi_aff space::multi_aff_on_domain(isl::multi_val mv) const
25357 if (!ptr || mv.is_null())
25358 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25359 auto saved_ctx = ctx();
25360 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25361 auto res = isl_space_multi_aff_on_domain_multi_val(copy(), mv.release());
25362 if (!res)
25363 exception::throw_last_error(saved_ctx);
25364 return manage(res);
25367 isl::multi_id space::multi_id(isl::id_list list) const
25369 if (!ptr || list.is_null())
25370 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25371 auto saved_ctx = ctx();
25372 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25373 auto res = isl_space_multi_id(copy(), list.release());
25374 if (!res)
25375 exception::throw_last_error(saved_ctx);
25376 return manage(res);
25379 isl::multi_pw_aff space::multi_pw_aff(isl::pw_aff_list list) const
25381 if (!ptr || list.is_null())
25382 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25383 auto saved_ctx = ctx();
25384 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25385 auto res = isl_space_multi_pw_aff(copy(), list.release());
25386 if (!res)
25387 exception::throw_last_error(saved_ctx);
25388 return manage(res);
25391 isl::multi_union_pw_aff space::multi_union_pw_aff(isl::union_pw_aff_list list) const
25393 if (!ptr || list.is_null())
25394 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25395 auto saved_ctx = ctx();
25396 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25397 auto res = isl_space_multi_union_pw_aff(copy(), list.release());
25398 if (!res)
25399 exception::throw_last_error(saved_ctx);
25400 return manage(res);
25403 isl::multi_val space::multi_val(isl::val_list list) const
25405 if (!ptr || list.is_null())
25406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25407 auto saved_ctx = ctx();
25408 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25409 auto res = isl_space_multi_val(copy(), list.release());
25410 if (!res)
25411 exception::throw_last_error(saved_ctx);
25412 return manage(res);
25415 isl::aff space::param_aff_on_domain(isl::id id) const
25417 if (!ptr || id.is_null())
25418 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25419 auto saved_ctx = ctx();
25420 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25421 auto res = isl_space_param_aff_on_domain_id(copy(), id.release());
25422 if (!res)
25423 exception::throw_last_error(saved_ctx);
25424 return manage(res);
25427 isl::aff space::param_aff_on_domain(const std::string &id) const
25429 if (!ptr)
25430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25431 return this->param_aff_on_domain(isl::id(ctx(), id));
25434 isl::space space::params() const
25436 if (!ptr)
25437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25438 auto saved_ctx = ctx();
25439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25440 auto res = isl_space_params(copy());
25441 if (!res)
25442 exception::throw_last_error(saved_ctx);
25443 return manage(res);
25446 isl::space space::product(isl::space right) const
25448 if (!ptr || right.is_null())
25449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25450 auto saved_ctx = ctx();
25451 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25452 auto res = isl_space_product(copy(), right.release());
25453 if (!res)
25454 exception::throw_last_error(saved_ctx);
25455 return manage(res);
25458 isl::space space::range() const
25460 if (!ptr)
25461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25462 auto saved_ctx = ctx();
25463 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25464 auto res = isl_space_range(copy());
25465 if (!res)
25466 exception::throw_last_error(saved_ctx);
25467 return manage(res);
25470 isl::multi_aff space::range_map_multi_aff() const
25472 if (!ptr)
25473 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25474 auto saved_ctx = ctx();
25475 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25476 auto res = isl_space_range_map_multi_aff(copy());
25477 if (!res)
25478 exception::throw_last_error(saved_ctx);
25479 return manage(res);
25482 isl::pw_multi_aff space::range_map_pw_multi_aff() const
25484 if (!ptr)
25485 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25486 auto saved_ctx = ctx();
25487 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25488 auto res = isl_space_range_map_pw_multi_aff(copy());
25489 if (!res)
25490 exception::throw_last_error(saved_ctx);
25491 return manage(res);
25494 isl::space space::range_reverse() const
25496 if (!ptr)
25497 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25498 auto saved_ctx = ctx();
25499 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25500 auto res = isl_space_range_reverse(copy());
25501 if (!res)
25502 exception::throw_last_error(saved_ctx);
25503 return manage(res);
25506 isl::id space::range_tuple_id() const
25508 if (!ptr)
25509 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25510 auto saved_ctx = ctx();
25511 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25512 auto res = isl_space_get_range_tuple_id(get());
25513 if (!res)
25514 exception::throw_last_error(saved_ctx);
25515 return manage(res);
25518 isl::id space::get_range_tuple_id() const
25520 return range_tuple_id();
25523 isl::space space::reverse() const
25525 if (!ptr)
25526 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25527 auto saved_ctx = ctx();
25528 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25529 auto res = isl_space_reverse(copy());
25530 if (!res)
25531 exception::throw_last_error(saved_ctx);
25532 return manage(res);
25535 isl::space space::set_domain_tuple(isl::id id) const
25537 if (!ptr || id.is_null())
25538 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25539 auto saved_ctx = ctx();
25540 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25541 auto res = isl_space_set_domain_tuple_id(copy(), id.release());
25542 if (!res)
25543 exception::throw_last_error(saved_ctx);
25544 return manage(res);
25547 isl::space space::set_domain_tuple(const std::string &id) const
25549 if (!ptr)
25550 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25551 return this->set_domain_tuple(isl::id(ctx(), id));
25554 isl::space space::set_range_tuple(isl::id id) const
25556 if (!ptr || id.is_null())
25557 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25558 auto saved_ctx = ctx();
25559 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25560 auto res = isl_space_set_range_tuple_id(copy(), id.release());
25561 if (!res)
25562 exception::throw_last_error(saved_ctx);
25563 return manage(res);
25566 isl::space space::set_range_tuple(const std::string &id) const
25568 if (!ptr)
25569 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25570 return this->set_range_tuple(isl::id(ctx(), id));
25573 isl::space space::uncurry() const
25575 if (!ptr)
25576 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25577 auto saved_ctx = ctx();
25578 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25579 auto res = isl_space_uncurry(copy());
25580 if (!res)
25581 exception::throw_last_error(saved_ctx);
25582 return manage(res);
25585 isl::space space::unit(isl::ctx ctx)
25587 auto saved_ctx = ctx;
25588 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25589 auto res = isl_space_unit(ctx.release());
25590 if (!res)
25591 exception::throw_last_error(saved_ctx);
25592 return manage(res);
25595 isl::map space::universe_map() const
25597 if (!ptr)
25598 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25599 auto saved_ctx = ctx();
25600 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25601 auto res = isl_space_universe_map(copy());
25602 if (!res)
25603 exception::throw_last_error(saved_ctx);
25604 return manage(res);
25607 isl::set space::universe_set() const
25609 if (!ptr)
25610 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25611 auto saved_ctx = ctx();
25612 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25613 auto res = isl_space_universe_set(copy());
25614 if (!res)
25615 exception::throw_last_error(saved_ctx);
25616 return manage(res);
25619 isl::space space::unwrap() const
25621 if (!ptr)
25622 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25623 auto saved_ctx = ctx();
25624 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25625 auto res = isl_space_unwrap(copy());
25626 if (!res)
25627 exception::throw_last_error(saved_ctx);
25628 return manage(res);
25631 isl::space space::wrap() const
25633 if (!ptr)
25634 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25635 auto saved_ctx = ctx();
25636 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25637 auto res = isl_space_wrap(copy());
25638 if (!res)
25639 exception::throw_last_error(saved_ctx);
25640 return manage(res);
25643 isl::space space::wrapped_reverse() const
25645 if (!ptr)
25646 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25647 auto saved_ctx = ctx();
25648 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25649 auto res = isl_space_wrapped_reverse(copy());
25650 if (!res)
25651 exception::throw_last_error(saved_ctx);
25652 return manage(res);
25655 isl::aff space::zero_aff_on_domain() const
25657 if (!ptr)
25658 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25659 auto saved_ctx = ctx();
25660 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25661 auto res = isl_space_zero_aff_on_domain(copy());
25662 if (!res)
25663 exception::throw_last_error(saved_ctx);
25664 return manage(res);
25667 isl::multi_aff space::zero_multi_aff() const
25669 if (!ptr)
25670 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25671 auto saved_ctx = ctx();
25672 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25673 auto res = isl_space_zero_multi_aff(copy());
25674 if (!res)
25675 exception::throw_last_error(saved_ctx);
25676 return manage(res);
25679 isl::multi_pw_aff space::zero_multi_pw_aff() const
25681 if (!ptr)
25682 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25683 auto saved_ctx = ctx();
25684 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25685 auto res = isl_space_zero_multi_pw_aff(copy());
25686 if (!res)
25687 exception::throw_last_error(saved_ctx);
25688 return manage(res);
25691 isl::multi_union_pw_aff space::zero_multi_union_pw_aff() const
25693 if (!ptr)
25694 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25695 auto saved_ctx = ctx();
25696 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25697 auto res = isl_space_zero_multi_union_pw_aff(copy());
25698 if (!res)
25699 exception::throw_last_error(saved_ctx);
25700 return manage(res);
25703 isl::multi_val space::zero_multi_val() const
25705 if (!ptr)
25706 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25707 auto saved_ctx = ctx();
25708 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25709 auto res = isl_space_zero_multi_val(copy());
25710 if (!res)
25711 exception::throw_last_error(saved_ctx);
25712 return manage(res);
25715 inline std::ostream &operator<<(std::ostream &os, const space &obj)
25717 if (!obj.get())
25718 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25719 auto saved_ctx = isl_space_get_ctx(obj.get());
25720 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25721 char *str = isl_space_to_str(obj.get());
25722 if (!str)
25723 exception::throw_last_error(saved_ctx);
25724 os << str;
25725 free(str);
25726 return os;
25729 // implementations for isl::union_access_info
25730 union_access_info manage(__isl_take isl_union_access_info *ptr) {
25731 if (!ptr)
25732 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25733 return union_access_info(ptr);
25735 union_access_info manage_copy(__isl_keep isl_union_access_info *ptr) {
25736 if (!ptr)
25737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25738 auto saved_ctx = isl_union_access_info_get_ctx(ptr);
25739 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25740 ptr = isl_union_access_info_copy(ptr);
25741 if (!ptr)
25742 exception::throw_last_error(saved_ctx);
25743 return union_access_info(ptr);
25746 union_access_info::union_access_info(__isl_take isl_union_access_info *ptr)
25747 : ptr(ptr) {}
25749 union_access_info::union_access_info()
25750 : ptr(nullptr) {}
25752 union_access_info::union_access_info(const union_access_info &obj)
25753 : ptr(nullptr)
25755 if (!obj.ptr)
25756 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25757 auto saved_ctx = isl_union_access_info_get_ctx(obj.ptr);
25758 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25759 ptr = obj.copy();
25760 if (!ptr)
25761 exception::throw_last_error(saved_ctx);
25764 union_access_info::union_access_info(isl::union_map sink)
25766 if (sink.is_null())
25767 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25768 auto saved_ctx = sink.ctx();
25769 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25770 auto res = isl_union_access_info_from_sink(sink.release());
25771 if (!res)
25772 exception::throw_last_error(saved_ctx);
25773 ptr = res;
25776 union_access_info &union_access_info::operator=(union_access_info obj) {
25777 std::swap(this->ptr, obj.ptr);
25778 return *this;
25781 union_access_info::~union_access_info() {
25782 if (ptr)
25783 isl_union_access_info_free(ptr);
25786 __isl_give isl_union_access_info *union_access_info::copy() const & {
25787 return isl_union_access_info_copy(ptr);
25790 __isl_keep isl_union_access_info *union_access_info::get() const {
25791 return ptr;
25794 __isl_give isl_union_access_info *union_access_info::release() {
25795 isl_union_access_info *tmp = ptr;
25796 ptr = nullptr;
25797 return tmp;
25800 bool union_access_info::is_null() const {
25801 return ptr == nullptr;
25804 isl::ctx union_access_info::ctx() const {
25805 return isl::ctx(isl_union_access_info_get_ctx(ptr));
25808 isl::union_flow union_access_info::compute_flow() const
25810 if (!ptr)
25811 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25812 auto saved_ctx = ctx();
25813 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25814 auto res = isl_union_access_info_compute_flow(copy());
25815 if (!res)
25816 exception::throw_last_error(saved_ctx);
25817 return manage(res);
25820 isl::union_access_info union_access_info::set_kill(isl::union_map kill) const
25822 if (!ptr || kill.is_null())
25823 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25824 auto saved_ctx = ctx();
25825 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25826 auto res = isl_union_access_info_set_kill(copy(), kill.release());
25827 if (!res)
25828 exception::throw_last_error(saved_ctx);
25829 return manage(res);
25832 isl::union_access_info union_access_info::set_may_source(isl::union_map may_source) const
25834 if (!ptr || may_source.is_null())
25835 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25836 auto saved_ctx = ctx();
25837 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25838 auto res = isl_union_access_info_set_may_source(copy(), may_source.release());
25839 if (!res)
25840 exception::throw_last_error(saved_ctx);
25841 return manage(res);
25844 isl::union_access_info union_access_info::set_must_source(isl::union_map must_source) const
25846 if (!ptr || must_source.is_null())
25847 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25848 auto saved_ctx = ctx();
25849 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25850 auto res = isl_union_access_info_set_must_source(copy(), must_source.release());
25851 if (!res)
25852 exception::throw_last_error(saved_ctx);
25853 return manage(res);
25856 isl::union_access_info union_access_info::set_schedule(isl::schedule schedule) const
25858 if (!ptr || schedule.is_null())
25859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25860 auto saved_ctx = ctx();
25861 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25862 auto res = isl_union_access_info_set_schedule(copy(), schedule.release());
25863 if (!res)
25864 exception::throw_last_error(saved_ctx);
25865 return manage(res);
25868 isl::union_access_info union_access_info::set_schedule_map(isl::union_map schedule_map) const
25870 if (!ptr || schedule_map.is_null())
25871 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25872 auto saved_ctx = ctx();
25873 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25874 auto res = isl_union_access_info_set_schedule_map(copy(), schedule_map.release());
25875 if (!res)
25876 exception::throw_last_error(saved_ctx);
25877 return manage(res);
25880 inline std::ostream &operator<<(std::ostream &os, const union_access_info &obj)
25882 if (!obj.get())
25883 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25884 auto saved_ctx = isl_union_access_info_get_ctx(obj.get());
25885 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25886 char *str = isl_union_access_info_to_str(obj.get());
25887 if (!str)
25888 exception::throw_last_error(saved_ctx);
25889 os << str;
25890 free(str);
25891 return os;
25894 // implementations for isl::union_flow
25895 union_flow manage(__isl_take isl_union_flow *ptr) {
25896 if (!ptr)
25897 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25898 return union_flow(ptr);
25900 union_flow manage_copy(__isl_keep isl_union_flow *ptr) {
25901 if (!ptr)
25902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25903 auto saved_ctx = isl_union_flow_get_ctx(ptr);
25904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25905 ptr = isl_union_flow_copy(ptr);
25906 if (!ptr)
25907 exception::throw_last_error(saved_ctx);
25908 return union_flow(ptr);
25911 union_flow::union_flow(__isl_take isl_union_flow *ptr)
25912 : ptr(ptr) {}
25914 union_flow::union_flow()
25915 : ptr(nullptr) {}
25917 union_flow::union_flow(const union_flow &obj)
25918 : ptr(nullptr)
25920 if (!obj.ptr)
25921 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25922 auto saved_ctx = isl_union_flow_get_ctx(obj.ptr);
25923 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25924 ptr = obj.copy();
25925 if (!ptr)
25926 exception::throw_last_error(saved_ctx);
25929 union_flow &union_flow::operator=(union_flow obj) {
25930 std::swap(this->ptr, obj.ptr);
25931 return *this;
25934 union_flow::~union_flow() {
25935 if (ptr)
25936 isl_union_flow_free(ptr);
25939 __isl_give isl_union_flow *union_flow::copy() const & {
25940 return isl_union_flow_copy(ptr);
25943 __isl_keep isl_union_flow *union_flow::get() const {
25944 return ptr;
25947 __isl_give isl_union_flow *union_flow::release() {
25948 isl_union_flow *tmp = ptr;
25949 ptr = nullptr;
25950 return tmp;
25953 bool union_flow::is_null() const {
25954 return ptr == nullptr;
25957 isl::ctx union_flow::ctx() const {
25958 return isl::ctx(isl_union_flow_get_ctx(ptr));
25961 isl::union_map union_flow::full_may_dependence() const
25963 if (!ptr)
25964 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25965 auto saved_ctx = ctx();
25966 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25967 auto res = isl_union_flow_get_full_may_dependence(get());
25968 if (!res)
25969 exception::throw_last_error(saved_ctx);
25970 return manage(res);
25973 isl::union_map union_flow::get_full_may_dependence() const
25975 return full_may_dependence();
25978 isl::union_map union_flow::full_must_dependence() const
25980 if (!ptr)
25981 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25982 auto saved_ctx = ctx();
25983 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
25984 auto res = isl_union_flow_get_full_must_dependence(get());
25985 if (!res)
25986 exception::throw_last_error(saved_ctx);
25987 return manage(res);
25990 isl::union_map union_flow::get_full_must_dependence() const
25992 return full_must_dependence();
25995 isl::union_map union_flow::may_dependence() const
25997 if (!ptr)
25998 exception::throw_invalid("NULL input", __FILE__, __LINE__);
25999 auto saved_ctx = ctx();
26000 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26001 auto res = isl_union_flow_get_may_dependence(get());
26002 if (!res)
26003 exception::throw_last_error(saved_ctx);
26004 return manage(res);
26007 isl::union_map union_flow::get_may_dependence() const
26009 return may_dependence();
26012 isl::union_map union_flow::may_no_source() const
26014 if (!ptr)
26015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26016 auto saved_ctx = ctx();
26017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26018 auto res = isl_union_flow_get_may_no_source(get());
26019 if (!res)
26020 exception::throw_last_error(saved_ctx);
26021 return manage(res);
26024 isl::union_map union_flow::get_may_no_source() const
26026 return may_no_source();
26029 isl::union_map union_flow::must_dependence() const
26031 if (!ptr)
26032 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26033 auto saved_ctx = ctx();
26034 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26035 auto res = isl_union_flow_get_must_dependence(get());
26036 if (!res)
26037 exception::throw_last_error(saved_ctx);
26038 return manage(res);
26041 isl::union_map union_flow::get_must_dependence() const
26043 return must_dependence();
26046 isl::union_map union_flow::must_no_source() const
26048 if (!ptr)
26049 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26050 auto saved_ctx = ctx();
26051 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26052 auto res = isl_union_flow_get_must_no_source(get());
26053 if (!res)
26054 exception::throw_last_error(saved_ctx);
26055 return manage(res);
26058 isl::union_map union_flow::get_must_no_source() const
26060 return must_no_source();
26063 inline std::ostream &operator<<(std::ostream &os, const union_flow &obj)
26065 if (!obj.get())
26066 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26067 auto saved_ctx = isl_union_flow_get_ctx(obj.get());
26068 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26069 char *str = isl_union_flow_to_str(obj.get());
26070 if (!str)
26071 exception::throw_last_error(saved_ctx);
26072 os << str;
26073 free(str);
26074 return os;
26077 // implementations for isl::union_map
26078 union_map manage(__isl_take isl_union_map *ptr) {
26079 if (!ptr)
26080 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26081 return union_map(ptr);
26083 union_map manage_copy(__isl_keep isl_union_map *ptr) {
26084 if (!ptr)
26085 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26086 auto saved_ctx = isl_union_map_get_ctx(ptr);
26087 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26088 ptr = isl_union_map_copy(ptr);
26089 if (!ptr)
26090 exception::throw_last_error(saved_ctx);
26091 return union_map(ptr);
26094 union_map::union_map(__isl_take isl_union_map *ptr)
26095 : ptr(ptr) {}
26097 union_map::union_map()
26098 : ptr(nullptr) {}
26100 union_map::union_map(const union_map &obj)
26101 : ptr(nullptr)
26103 if (!obj.ptr)
26104 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26105 auto saved_ctx = isl_union_map_get_ctx(obj.ptr);
26106 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26107 ptr = obj.copy();
26108 if (!ptr)
26109 exception::throw_last_error(saved_ctx);
26112 union_map::union_map(isl::basic_map bmap)
26114 if (bmap.is_null())
26115 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26116 auto saved_ctx = bmap.ctx();
26117 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26118 auto res = isl_union_map_from_basic_map(bmap.release());
26119 if (!res)
26120 exception::throw_last_error(saved_ctx);
26121 ptr = res;
26124 union_map::union_map(isl::map map)
26126 if (map.is_null())
26127 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26128 auto saved_ctx = map.ctx();
26129 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26130 auto res = isl_union_map_from_map(map.release());
26131 if (!res)
26132 exception::throw_last_error(saved_ctx);
26133 ptr = res;
26136 union_map::union_map(isl::ctx ctx, const std::string &str)
26138 auto saved_ctx = ctx;
26139 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26140 auto res = isl_union_map_read_from_str(ctx.release(), str.c_str());
26141 if (!res)
26142 exception::throw_last_error(saved_ctx);
26143 ptr = res;
26146 union_map &union_map::operator=(union_map obj) {
26147 std::swap(this->ptr, obj.ptr);
26148 return *this;
26151 union_map::~union_map() {
26152 if (ptr)
26153 isl_union_map_free(ptr);
26156 __isl_give isl_union_map *union_map::copy() const & {
26157 return isl_union_map_copy(ptr);
26160 __isl_keep isl_union_map *union_map::get() const {
26161 return ptr;
26164 __isl_give isl_union_map *union_map::release() {
26165 isl_union_map *tmp = ptr;
26166 ptr = nullptr;
26167 return tmp;
26170 bool union_map::is_null() const {
26171 return ptr == nullptr;
26174 isl::ctx union_map::ctx() const {
26175 return isl::ctx(isl_union_map_get_ctx(ptr));
26178 isl::union_map union_map::affine_hull() const
26180 if (!ptr)
26181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26182 auto saved_ctx = ctx();
26183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26184 auto res = isl_union_map_affine_hull(copy());
26185 if (!res)
26186 exception::throw_last_error(saved_ctx);
26187 return manage(res);
26190 isl::union_map union_map::apply_domain(isl::union_map umap2) const
26192 if (!ptr || umap2.is_null())
26193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26194 auto saved_ctx = ctx();
26195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26196 auto res = isl_union_map_apply_domain(copy(), umap2.release());
26197 if (!res)
26198 exception::throw_last_error(saved_ctx);
26199 return manage(res);
26202 isl::union_map union_map::apply_range(isl::union_map umap2) const
26204 if (!ptr || umap2.is_null())
26205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26206 auto saved_ctx = ctx();
26207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26208 auto res = isl_union_map_apply_range(copy(), umap2.release());
26209 if (!res)
26210 exception::throw_last_error(saved_ctx);
26211 return manage(res);
26214 isl::map union_map::as_map() const
26216 if (!ptr)
26217 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26218 auto saved_ctx = ctx();
26219 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26220 auto res = isl_union_map_as_map(copy());
26221 if (!res)
26222 exception::throw_last_error(saved_ctx);
26223 return manage(res);
26226 isl::multi_union_pw_aff union_map::as_multi_union_pw_aff() const
26228 if (!ptr)
26229 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26230 auto saved_ctx = ctx();
26231 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26232 auto res = isl_union_map_as_multi_union_pw_aff(copy());
26233 if (!res)
26234 exception::throw_last_error(saved_ctx);
26235 return manage(res);
26238 isl::union_pw_multi_aff union_map::as_union_pw_multi_aff() const
26240 if (!ptr)
26241 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26242 auto saved_ctx = ctx();
26243 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26244 auto res = isl_union_map_as_union_pw_multi_aff(copy());
26245 if (!res)
26246 exception::throw_last_error(saved_ctx);
26247 return manage(res);
26250 isl::union_set union_map::bind_range(isl::multi_id tuple) const
26252 if (!ptr || tuple.is_null())
26253 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26254 auto saved_ctx = ctx();
26255 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26256 auto res = isl_union_map_bind_range(copy(), tuple.release());
26257 if (!res)
26258 exception::throw_last_error(saved_ctx);
26259 return manage(res);
26262 isl::union_map union_map::coalesce() const
26264 if (!ptr)
26265 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26266 auto saved_ctx = ctx();
26267 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26268 auto res = isl_union_map_coalesce(copy());
26269 if (!res)
26270 exception::throw_last_error(saved_ctx);
26271 return manage(res);
26274 isl::union_map union_map::compute_divs() const
26276 if (!ptr)
26277 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26278 auto saved_ctx = ctx();
26279 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26280 auto res = isl_union_map_compute_divs(copy());
26281 if (!res)
26282 exception::throw_last_error(saved_ctx);
26283 return manage(res);
26286 isl::union_map union_map::curry() const
26288 if (!ptr)
26289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26290 auto saved_ctx = ctx();
26291 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26292 auto res = isl_union_map_curry(copy());
26293 if (!res)
26294 exception::throw_last_error(saved_ctx);
26295 return manage(res);
26298 isl::union_set union_map::deltas() const
26300 if (!ptr)
26301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26302 auto saved_ctx = ctx();
26303 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26304 auto res = isl_union_map_deltas(copy());
26305 if (!res)
26306 exception::throw_last_error(saved_ctx);
26307 return manage(res);
26310 isl::union_map union_map::detect_equalities() const
26312 if (!ptr)
26313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26314 auto saved_ctx = ctx();
26315 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26316 auto res = isl_union_map_detect_equalities(copy());
26317 if (!res)
26318 exception::throw_last_error(saved_ctx);
26319 return manage(res);
26322 isl::union_set union_map::domain() const
26324 if (!ptr)
26325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26326 auto saved_ctx = ctx();
26327 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26328 auto res = isl_union_map_domain(copy());
26329 if (!res)
26330 exception::throw_last_error(saved_ctx);
26331 return manage(res);
26334 isl::union_map union_map::domain_factor_domain() const
26336 if (!ptr)
26337 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26338 auto saved_ctx = ctx();
26339 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26340 auto res = isl_union_map_domain_factor_domain(copy());
26341 if (!res)
26342 exception::throw_last_error(saved_ctx);
26343 return manage(res);
26346 isl::union_map union_map::domain_factor_range() const
26348 if (!ptr)
26349 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26350 auto saved_ctx = ctx();
26351 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26352 auto res = isl_union_map_domain_factor_range(copy());
26353 if (!res)
26354 exception::throw_last_error(saved_ctx);
26355 return manage(res);
26358 isl::union_map union_map::domain_map() const
26360 if (!ptr)
26361 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26362 auto saved_ctx = ctx();
26363 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26364 auto res = isl_union_map_domain_map(copy());
26365 if (!res)
26366 exception::throw_last_error(saved_ctx);
26367 return manage(res);
26370 isl::union_pw_multi_aff union_map::domain_map_union_pw_multi_aff() const
26372 if (!ptr)
26373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26374 auto saved_ctx = ctx();
26375 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26376 auto res = isl_union_map_domain_map_union_pw_multi_aff(copy());
26377 if (!res)
26378 exception::throw_last_error(saved_ctx);
26379 return manage(res);
26382 isl::union_map union_map::domain_product(isl::union_map umap2) const
26384 if (!ptr || umap2.is_null())
26385 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26386 auto saved_ctx = ctx();
26387 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26388 auto res = isl_union_map_domain_product(copy(), umap2.release());
26389 if (!res)
26390 exception::throw_last_error(saved_ctx);
26391 return manage(res);
26394 isl::union_map union_map::domain_reverse() const
26396 if (!ptr)
26397 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26398 auto saved_ctx = ctx();
26399 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26400 auto res = isl_union_map_domain_reverse(copy());
26401 if (!res)
26402 exception::throw_last_error(saved_ctx);
26403 return manage(res);
26406 isl::union_map union_map::drop_unused_params() const
26408 if (!ptr)
26409 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26410 auto saved_ctx = ctx();
26411 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26412 auto res = isl_union_map_drop_unused_params(copy());
26413 if (!res)
26414 exception::throw_last_error(saved_ctx);
26415 return manage(res);
26418 isl::union_map union_map::empty(isl::ctx ctx)
26420 auto saved_ctx = ctx;
26421 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26422 auto res = isl_union_map_empty_ctx(ctx.release());
26423 if (!res)
26424 exception::throw_last_error(saved_ctx);
26425 return manage(res);
26428 isl::union_map union_map::eq_at(isl::multi_union_pw_aff mupa) const
26430 if (!ptr || mupa.is_null())
26431 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26432 auto saved_ctx = ctx();
26433 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26434 auto res = isl_union_map_eq_at_multi_union_pw_aff(copy(), mupa.release());
26435 if (!res)
26436 exception::throw_last_error(saved_ctx);
26437 return manage(res);
26440 bool union_map::every_map(const std::function<bool(isl::map)> &test) const
26442 if (!ptr)
26443 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26444 auto saved_ctx = ctx();
26445 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26446 struct test_data {
26447 std::function<bool(isl::map)> func;
26448 std::exception_ptr eptr;
26449 } test_data = { test };
26450 auto test_lambda = [](isl_map *arg_0, void *arg_1) -> isl_bool {
26451 auto *data = static_cast<struct test_data *>(arg_1);
26452 ISL_CPP_TRY {
26453 auto ret = (data->func)(manage_copy(arg_0));
26454 return ret ? isl_bool_true : isl_bool_false;
26455 } ISL_CPP_CATCH_ALL {
26456 data->eptr = std::current_exception();
26457 return isl_bool_error;
26460 auto res = isl_union_map_every_map(get(), test_lambda, &test_data);
26461 if (test_data.eptr)
26462 std::rethrow_exception(test_data.eptr);
26463 if (res < 0)
26464 exception::throw_last_error(saved_ctx);
26465 return res;
26468 isl::map union_map::extract_map(isl::space space) const
26470 if (!ptr || space.is_null())
26471 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26472 auto saved_ctx = ctx();
26473 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26474 auto res = isl_union_map_extract_map(get(), space.release());
26475 if (!res)
26476 exception::throw_last_error(saved_ctx);
26477 return manage(res);
26480 isl::union_map union_map::factor_domain() const
26482 if (!ptr)
26483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26484 auto saved_ctx = ctx();
26485 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26486 auto res = isl_union_map_factor_domain(copy());
26487 if (!res)
26488 exception::throw_last_error(saved_ctx);
26489 return manage(res);
26492 isl::union_map union_map::factor_range() const
26494 if (!ptr)
26495 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26496 auto saved_ctx = ctx();
26497 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26498 auto res = isl_union_map_factor_range(copy());
26499 if (!res)
26500 exception::throw_last_error(saved_ctx);
26501 return manage(res);
26504 isl::union_map union_map::fixed_power(isl::val exp) const
26506 if (!ptr || exp.is_null())
26507 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26508 auto saved_ctx = ctx();
26509 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26510 auto res = isl_union_map_fixed_power_val(copy(), exp.release());
26511 if (!res)
26512 exception::throw_last_error(saved_ctx);
26513 return manage(res);
26516 isl::union_map union_map::fixed_power(long exp) const
26518 if (!ptr)
26519 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26520 return this->fixed_power(isl::val(ctx(), exp));
26523 void union_map::foreach_map(const std::function<void(isl::map)> &fn) const
26525 if (!ptr)
26526 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26527 auto saved_ctx = ctx();
26528 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26529 struct fn_data {
26530 std::function<void(isl::map)> func;
26531 std::exception_ptr eptr;
26532 } fn_data = { fn };
26533 auto fn_lambda = [](isl_map *arg_0, void *arg_1) -> isl_stat {
26534 auto *data = static_cast<struct fn_data *>(arg_1);
26535 ISL_CPP_TRY {
26536 (data->func)(manage(arg_0));
26537 return isl_stat_ok;
26538 } ISL_CPP_CATCH_ALL {
26539 data->eptr = std::current_exception();
26540 return isl_stat_error;
26543 auto res = isl_union_map_foreach_map(get(), fn_lambda, &fn_data);
26544 if (fn_data.eptr)
26545 std::rethrow_exception(fn_data.eptr);
26546 if (res < 0)
26547 exception::throw_last_error(saved_ctx);
26548 return;
26551 isl::union_map union_map::from(isl::multi_union_pw_aff mupa)
26553 if (mupa.is_null())
26554 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26555 auto saved_ctx = mupa.ctx();
26556 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26557 auto res = isl_union_map_from_multi_union_pw_aff(mupa.release());
26558 if (!res)
26559 exception::throw_last_error(saved_ctx);
26560 return manage(res);
26563 isl::union_map union_map::from(isl::union_pw_multi_aff upma)
26565 if (upma.is_null())
26566 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26567 auto saved_ctx = upma.ctx();
26568 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26569 auto res = isl_union_map_from_union_pw_multi_aff(upma.release());
26570 if (!res)
26571 exception::throw_last_error(saved_ctx);
26572 return manage(res);
26575 isl::union_map union_map::from_domain(isl::union_set uset)
26577 if (uset.is_null())
26578 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26579 auto saved_ctx = uset.ctx();
26580 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26581 auto res = isl_union_map_from_domain(uset.release());
26582 if (!res)
26583 exception::throw_last_error(saved_ctx);
26584 return manage(res);
26587 isl::union_map union_map::from_domain_and_range(isl::union_set domain, isl::union_set range)
26589 if (domain.is_null() || range.is_null())
26590 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26591 auto saved_ctx = domain.ctx();
26592 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26593 auto res = isl_union_map_from_domain_and_range(domain.release(), range.release());
26594 if (!res)
26595 exception::throw_last_error(saved_ctx);
26596 return manage(res);
26599 isl::union_map union_map::from_range(isl::union_set uset)
26601 if (uset.is_null())
26602 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26603 auto saved_ctx = uset.ctx();
26604 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26605 auto res = isl_union_map_from_range(uset.release());
26606 if (!res)
26607 exception::throw_last_error(saved_ctx);
26608 return manage(res);
26611 isl::union_map union_map::gist(isl::union_map context) const
26613 if (!ptr || context.is_null())
26614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26615 auto saved_ctx = ctx();
26616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26617 auto res = isl_union_map_gist(copy(), context.release());
26618 if (!res)
26619 exception::throw_last_error(saved_ctx);
26620 return manage(res);
26623 isl::union_map union_map::gist_domain(isl::union_set uset) const
26625 if (!ptr || uset.is_null())
26626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26627 auto saved_ctx = ctx();
26628 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26629 auto res = isl_union_map_gist_domain(copy(), uset.release());
26630 if (!res)
26631 exception::throw_last_error(saved_ctx);
26632 return manage(res);
26635 isl::union_map union_map::gist_params(isl::set set) const
26637 if (!ptr || set.is_null())
26638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26639 auto saved_ctx = ctx();
26640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26641 auto res = isl_union_map_gist_params(copy(), set.release());
26642 if (!res)
26643 exception::throw_last_error(saved_ctx);
26644 return manage(res);
26647 isl::union_map union_map::gist_range(isl::union_set uset) const
26649 if (!ptr || uset.is_null())
26650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26651 auto saved_ctx = ctx();
26652 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26653 auto res = isl_union_map_gist_range(copy(), uset.release());
26654 if (!res)
26655 exception::throw_last_error(saved_ctx);
26656 return manage(res);
26659 isl::union_map union_map::intersect(isl::union_map umap2) const
26661 if (!ptr || umap2.is_null())
26662 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26663 auto saved_ctx = ctx();
26664 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26665 auto res = isl_union_map_intersect(copy(), umap2.release());
26666 if (!res)
26667 exception::throw_last_error(saved_ctx);
26668 return manage(res);
26671 isl::union_map union_map::intersect_domain(isl::space space) const
26673 if (!ptr || space.is_null())
26674 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26675 auto saved_ctx = ctx();
26676 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26677 auto res = isl_union_map_intersect_domain_space(copy(), space.release());
26678 if (!res)
26679 exception::throw_last_error(saved_ctx);
26680 return manage(res);
26683 isl::union_map union_map::intersect_domain(isl::union_set uset) const
26685 if (!ptr || uset.is_null())
26686 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26687 auto saved_ctx = ctx();
26688 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26689 auto res = isl_union_map_intersect_domain_union_set(copy(), uset.release());
26690 if (!res)
26691 exception::throw_last_error(saved_ctx);
26692 return manage(res);
26695 isl::union_map union_map::intersect_domain_factor_domain(isl::union_map factor) const
26697 if (!ptr || factor.is_null())
26698 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26699 auto saved_ctx = ctx();
26700 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26701 auto res = isl_union_map_intersect_domain_factor_domain(copy(), factor.release());
26702 if (!res)
26703 exception::throw_last_error(saved_ctx);
26704 return manage(res);
26707 isl::union_map union_map::intersect_domain_factor_range(isl::union_map factor) const
26709 if (!ptr || factor.is_null())
26710 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26711 auto saved_ctx = ctx();
26712 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26713 auto res = isl_union_map_intersect_domain_factor_range(copy(), factor.release());
26714 if (!res)
26715 exception::throw_last_error(saved_ctx);
26716 return manage(res);
26719 isl::union_map union_map::intersect_domain_wrapped_domain(isl::union_set domain) const
26721 if (!ptr || domain.is_null())
26722 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26723 auto saved_ctx = ctx();
26724 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26725 auto res = isl_union_map_intersect_domain_wrapped_domain_union_set(copy(), domain.release());
26726 if (!res)
26727 exception::throw_last_error(saved_ctx);
26728 return manage(res);
26731 isl::union_map union_map::intersect_params(isl::set set) const
26733 if (!ptr || set.is_null())
26734 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26735 auto saved_ctx = ctx();
26736 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26737 auto res = isl_union_map_intersect_params(copy(), set.release());
26738 if (!res)
26739 exception::throw_last_error(saved_ctx);
26740 return manage(res);
26743 isl::union_map union_map::intersect_range(isl::space space) const
26745 if (!ptr || space.is_null())
26746 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26747 auto saved_ctx = ctx();
26748 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26749 auto res = isl_union_map_intersect_range_space(copy(), space.release());
26750 if (!res)
26751 exception::throw_last_error(saved_ctx);
26752 return manage(res);
26755 isl::union_map union_map::intersect_range(isl::union_set uset) const
26757 if (!ptr || uset.is_null())
26758 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26759 auto saved_ctx = ctx();
26760 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26761 auto res = isl_union_map_intersect_range_union_set(copy(), uset.release());
26762 if (!res)
26763 exception::throw_last_error(saved_ctx);
26764 return manage(res);
26767 isl::union_map union_map::intersect_range_factor_domain(isl::union_map factor) const
26769 if (!ptr || factor.is_null())
26770 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26771 auto saved_ctx = ctx();
26772 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26773 auto res = isl_union_map_intersect_range_factor_domain(copy(), factor.release());
26774 if (!res)
26775 exception::throw_last_error(saved_ctx);
26776 return manage(res);
26779 isl::union_map union_map::intersect_range_factor_range(isl::union_map factor) const
26781 if (!ptr || factor.is_null())
26782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26783 auto saved_ctx = ctx();
26784 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26785 auto res = isl_union_map_intersect_range_factor_range(copy(), factor.release());
26786 if (!res)
26787 exception::throw_last_error(saved_ctx);
26788 return manage(res);
26791 isl::union_map union_map::intersect_range_wrapped_domain(isl::union_set domain) const
26793 if (!ptr || domain.is_null())
26794 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26795 auto saved_ctx = ctx();
26796 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26797 auto res = isl_union_map_intersect_range_wrapped_domain_union_set(copy(), domain.release());
26798 if (!res)
26799 exception::throw_last_error(saved_ctx);
26800 return manage(res);
26803 bool union_map::is_bijective() const
26805 if (!ptr)
26806 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26807 auto saved_ctx = ctx();
26808 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26809 auto res = isl_union_map_is_bijective(get());
26810 if (res < 0)
26811 exception::throw_last_error(saved_ctx);
26812 return res;
26815 bool union_map::is_disjoint(const isl::union_map &umap2) const
26817 if (!ptr || umap2.is_null())
26818 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26819 auto saved_ctx = ctx();
26820 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26821 auto res = isl_union_map_is_disjoint(get(), umap2.get());
26822 if (res < 0)
26823 exception::throw_last_error(saved_ctx);
26824 return res;
26827 bool union_map::is_empty() const
26829 if (!ptr)
26830 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26831 auto saved_ctx = ctx();
26832 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26833 auto res = isl_union_map_is_empty(get());
26834 if (res < 0)
26835 exception::throw_last_error(saved_ctx);
26836 return res;
26839 bool union_map::is_equal(const isl::union_map &umap2) const
26841 if (!ptr || umap2.is_null())
26842 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26843 auto saved_ctx = ctx();
26844 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26845 auto res = isl_union_map_is_equal(get(), umap2.get());
26846 if (res < 0)
26847 exception::throw_last_error(saved_ctx);
26848 return res;
26851 bool union_map::is_injective() const
26853 if (!ptr)
26854 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26855 auto saved_ctx = ctx();
26856 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26857 auto res = isl_union_map_is_injective(get());
26858 if (res < 0)
26859 exception::throw_last_error(saved_ctx);
26860 return res;
26863 bool union_map::is_single_valued() const
26865 if (!ptr)
26866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26867 auto saved_ctx = ctx();
26868 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26869 auto res = isl_union_map_is_single_valued(get());
26870 if (res < 0)
26871 exception::throw_last_error(saved_ctx);
26872 return res;
26875 bool union_map::is_strict_subset(const isl::union_map &umap2) const
26877 if (!ptr || umap2.is_null())
26878 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26879 auto saved_ctx = ctx();
26880 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26881 auto res = isl_union_map_is_strict_subset(get(), umap2.get());
26882 if (res < 0)
26883 exception::throw_last_error(saved_ctx);
26884 return res;
26887 bool union_map::is_subset(const isl::union_map &umap2) const
26889 if (!ptr || umap2.is_null())
26890 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26891 auto saved_ctx = ctx();
26892 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26893 auto res = isl_union_map_is_subset(get(), umap2.get());
26894 if (res < 0)
26895 exception::throw_last_error(saved_ctx);
26896 return res;
26899 bool union_map::isa_map() const
26901 if (!ptr)
26902 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26903 auto saved_ctx = ctx();
26904 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26905 auto res = isl_union_map_isa_map(get());
26906 if (res < 0)
26907 exception::throw_last_error(saved_ctx);
26908 return res;
26911 isl::union_map union_map::lexmax() const
26913 if (!ptr)
26914 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26915 auto saved_ctx = ctx();
26916 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26917 auto res = isl_union_map_lexmax(copy());
26918 if (!res)
26919 exception::throw_last_error(saved_ctx);
26920 return manage(res);
26923 isl::union_map union_map::lexmin() const
26925 if (!ptr)
26926 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26927 auto saved_ctx = ctx();
26928 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26929 auto res = isl_union_map_lexmin(copy());
26930 if (!res)
26931 exception::throw_last_error(saved_ctx);
26932 return manage(res);
26935 isl::map_list union_map::map_list() const
26937 if (!ptr)
26938 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26939 auto saved_ctx = ctx();
26940 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26941 auto res = isl_union_map_get_map_list(get());
26942 if (!res)
26943 exception::throw_last_error(saved_ctx);
26944 return manage(res);
26947 isl::map_list union_map::get_map_list() const
26949 return map_list();
26952 isl::set union_map::params() const
26954 if (!ptr)
26955 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26956 auto saved_ctx = ctx();
26957 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26958 auto res = isl_union_map_params(copy());
26959 if (!res)
26960 exception::throw_last_error(saved_ctx);
26961 return manage(res);
26964 isl::union_map union_map::polyhedral_hull() const
26966 if (!ptr)
26967 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26968 auto saved_ctx = ctx();
26969 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26970 auto res = isl_union_map_polyhedral_hull(copy());
26971 if (!res)
26972 exception::throw_last_error(saved_ctx);
26973 return manage(res);
26976 isl::union_map union_map::preimage_domain(isl::multi_aff ma) const
26978 if (!ptr || ma.is_null())
26979 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26980 auto saved_ctx = ctx();
26981 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26982 auto res = isl_union_map_preimage_domain_multi_aff(copy(), ma.release());
26983 if (!res)
26984 exception::throw_last_error(saved_ctx);
26985 return manage(res);
26988 isl::union_map union_map::preimage_domain(isl::multi_pw_aff mpa) const
26990 if (!ptr || mpa.is_null())
26991 exception::throw_invalid("NULL input", __FILE__, __LINE__);
26992 auto saved_ctx = ctx();
26993 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
26994 auto res = isl_union_map_preimage_domain_multi_pw_aff(copy(), mpa.release());
26995 if (!res)
26996 exception::throw_last_error(saved_ctx);
26997 return manage(res);
27000 isl::union_map union_map::preimage_domain(isl::pw_multi_aff pma) const
27002 if (!ptr || pma.is_null())
27003 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27004 auto saved_ctx = ctx();
27005 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27006 auto res = isl_union_map_preimage_domain_pw_multi_aff(copy(), pma.release());
27007 if (!res)
27008 exception::throw_last_error(saved_ctx);
27009 return manage(res);
27012 isl::union_map union_map::preimage_domain(isl::union_pw_multi_aff upma) const
27014 if (!ptr || upma.is_null())
27015 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27016 auto saved_ctx = ctx();
27017 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27018 auto res = isl_union_map_preimage_domain_union_pw_multi_aff(copy(), upma.release());
27019 if (!res)
27020 exception::throw_last_error(saved_ctx);
27021 return manage(res);
27024 isl::union_map union_map::preimage_range(isl::multi_aff ma) const
27026 if (!ptr || ma.is_null())
27027 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27028 auto saved_ctx = ctx();
27029 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27030 auto res = isl_union_map_preimage_range_multi_aff(copy(), ma.release());
27031 if (!res)
27032 exception::throw_last_error(saved_ctx);
27033 return manage(res);
27036 isl::union_map union_map::preimage_range(isl::pw_multi_aff pma) const
27038 if (!ptr || pma.is_null())
27039 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27040 auto saved_ctx = ctx();
27041 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27042 auto res = isl_union_map_preimage_range_pw_multi_aff(copy(), pma.release());
27043 if (!res)
27044 exception::throw_last_error(saved_ctx);
27045 return manage(res);
27048 isl::union_map union_map::preimage_range(isl::union_pw_multi_aff upma) const
27050 if (!ptr || upma.is_null())
27051 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27052 auto saved_ctx = ctx();
27053 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27054 auto res = isl_union_map_preimage_range_union_pw_multi_aff(copy(), upma.release());
27055 if (!res)
27056 exception::throw_last_error(saved_ctx);
27057 return manage(res);
27060 isl::union_map union_map::product(isl::union_map umap2) const
27062 if (!ptr || umap2.is_null())
27063 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27064 auto saved_ctx = ctx();
27065 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27066 auto res = isl_union_map_product(copy(), umap2.release());
27067 if (!res)
27068 exception::throw_last_error(saved_ctx);
27069 return manage(res);
27072 isl::union_map union_map::project_out_all_params() const
27074 if (!ptr)
27075 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27076 auto saved_ctx = ctx();
27077 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27078 auto res = isl_union_map_project_out_all_params(copy());
27079 if (!res)
27080 exception::throw_last_error(saved_ctx);
27081 return manage(res);
27084 isl::union_map union_map::project_out_param(isl::id id) const
27086 if (!ptr || id.is_null())
27087 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27088 auto saved_ctx = ctx();
27089 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27090 auto res = isl_union_map_project_out_param_id(copy(), id.release());
27091 if (!res)
27092 exception::throw_last_error(saved_ctx);
27093 return manage(res);
27096 isl::union_map union_map::project_out_param(const std::string &id) const
27098 if (!ptr)
27099 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27100 return this->project_out_param(isl::id(ctx(), id));
27103 isl::union_map union_map::project_out_param(isl::id_list list) const
27105 if (!ptr || list.is_null())
27106 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27107 auto saved_ctx = ctx();
27108 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27109 auto res = isl_union_map_project_out_param_id_list(copy(), list.release());
27110 if (!res)
27111 exception::throw_last_error(saved_ctx);
27112 return manage(res);
27115 isl::union_set union_map::range() const
27117 if (!ptr)
27118 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27119 auto saved_ctx = ctx();
27120 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27121 auto res = isl_union_map_range(copy());
27122 if (!res)
27123 exception::throw_last_error(saved_ctx);
27124 return manage(res);
27127 isl::union_map union_map::range_factor_domain() const
27129 if (!ptr)
27130 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27131 auto saved_ctx = ctx();
27132 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27133 auto res = isl_union_map_range_factor_domain(copy());
27134 if (!res)
27135 exception::throw_last_error(saved_ctx);
27136 return manage(res);
27139 isl::union_map union_map::range_factor_range() const
27141 if (!ptr)
27142 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27143 auto saved_ctx = ctx();
27144 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27145 auto res = isl_union_map_range_factor_range(copy());
27146 if (!res)
27147 exception::throw_last_error(saved_ctx);
27148 return manage(res);
27151 isl::union_map union_map::range_map() const
27153 if (!ptr)
27154 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27155 auto saved_ctx = ctx();
27156 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27157 auto res = isl_union_map_range_map(copy());
27158 if (!res)
27159 exception::throw_last_error(saved_ctx);
27160 return manage(res);
27163 isl::union_map union_map::range_product(isl::union_map umap2) const
27165 if (!ptr || umap2.is_null())
27166 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27167 auto saved_ctx = ctx();
27168 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27169 auto res = isl_union_map_range_product(copy(), umap2.release());
27170 if (!res)
27171 exception::throw_last_error(saved_ctx);
27172 return manage(res);
27175 isl::union_map union_map::range_reverse() const
27177 if (!ptr)
27178 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27179 auto saved_ctx = ctx();
27180 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27181 auto res = isl_union_map_range_reverse(copy());
27182 if (!res)
27183 exception::throw_last_error(saved_ctx);
27184 return manage(res);
27187 isl::union_map union_map::reverse() const
27189 if (!ptr)
27190 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27191 auto saved_ctx = ctx();
27192 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27193 auto res = isl_union_map_reverse(copy());
27194 if (!res)
27195 exception::throw_last_error(saved_ctx);
27196 return manage(res);
27199 isl::space union_map::space() const
27201 if (!ptr)
27202 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27203 auto saved_ctx = ctx();
27204 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27205 auto res = isl_union_map_get_space(get());
27206 if (!res)
27207 exception::throw_last_error(saved_ctx);
27208 return manage(res);
27211 isl::space union_map::get_space() const
27213 return space();
27216 isl::union_map union_map::subtract(isl::union_map umap2) const
27218 if (!ptr || umap2.is_null())
27219 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27220 auto saved_ctx = ctx();
27221 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27222 auto res = isl_union_map_subtract(copy(), umap2.release());
27223 if (!res)
27224 exception::throw_last_error(saved_ctx);
27225 return manage(res);
27228 isl::union_map union_map::subtract_domain(isl::union_set dom) const
27230 if (!ptr || dom.is_null())
27231 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27232 auto saved_ctx = ctx();
27233 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27234 auto res = isl_union_map_subtract_domain(copy(), dom.release());
27235 if (!res)
27236 exception::throw_last_error(saved_ctx);
27237 return manage(res);
27240 isl::union_map union_map::subtract_range(isl::union_set dom) const
27242 if (!ptr || dom.is_null())
27243 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27244 auto saved_ctx = ctx();
27245 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27246 auto res = isl_union_map_subtract_range(copy(), dom.release());
27247 if (!res)
27248 exception::throw_last_error(saved_ctx);
27249 return manage(res);
27252 isl::union_map union_map::uncurry() const
27254 if (!ptr)
27255 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27256 auto saved_ctx = ctx();
27257 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27258 auto res = isl_union_map_uncurry(copy());
27259 if (!res)
27260 exception::throw_last_error(saved_ctx);
27261 return manage(res);
27264 isl::union_map union_map::unite(isl::union_map umap2) const
27266 if (!ptr || umap2.is_null())
27267 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27268 auto saved_ctx = ctx();
27269 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27270 auto res = isl_union_map_union(copy(), umap2.release());
27271 if (!res)
27272 exception::throw_last_error(saved_ctx);
27273 return manage(res);
27276 isl::union_map union_map::universe() const
27278 if (!ptr)
27279 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27280 auto saved_ctx = ctx();
27281 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27282 auto res = isl_union_map_universe(copy());
27283 if (!res)
27284 exception::throw_last_error(saved_ctx);
27285 return manage(res);
27288 isl::union_set union_map::wrap() const
27290 if (!ptr)
27291 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27292 auto saved_ctx = ctx();
27293 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27294 auto res = isl_union_map_wrap(copy());
27295 if (!res)
27296 exception::throw_last_error(saved_ctx);
27297 return manage(res);
27300 isl::union_map union_map::zip() const
27302 if (!ptr)
27303 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27304 auto saved_ctx = ctx();
27305 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27306 auto res = isl_union_map_zip(copy());
27307 if (!res)
27308 exception::throw_last_error(saved_ctx);
27309 return manage(res);
27312 inline std::ostream &operator<<(std::ostream &os, const union_map &obj)
27314 if (!obj.get())
27315 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27316 auto saved_ctx = isl_union_map_get_ctx(obj.get());
27317 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27318 char *str = isl_union_map_to_str(obj.get());
27319 if (!str)
27320 exception::throw_last_error(saved_ctx);
27321 os << str;
27322 free(str);
27323 return os;
27326 // implementations for isl::union_pw_aff
27327 union_pw_aff manage(__isl_take isl_union_pw_aff *ptr) {
27328 if (!ptr)
27329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27330 return union_pw_aff(ptr);
27332 union_pw_aff manage_copy(__isl_keep isl_union_pw_aff *ptr) {
27333 if (!ptr)
27334 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27335 auto saved_ctx = isl_union_pw_aff_get_ctx(ptr);
27336 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27337 ptr = isl_union_pw_aff_copy(ptr);
27338 if (!ptr)
27339 exception::throw_last_error(saved_ctx);
27340 return union_pw_aff(ptr);
27343 union_pw_aff::union_pw_aff(__isl_take isl_union_pw_aff *ptr)
27344 : ptr(ptr) {}
27346 union_pw_aff::union_pw_aff()
27347 : ptr(nullptr) {}
27349 union_pw_aff::union_pw_aff(const union_pw_aff &obj)
27350 : ptr(nullptr)
27352 if (!obj.ptr)
27353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27354 auto saved_ctx = isl_union_pw_aff_get_ctx(obj.ptr);
27355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27356 ptr = obj.copy();
27357 if (!ptr)
27358 exception::throw_last_error(saved_ctx);
27361 union_pw_aff::union_pw_aff(isl::aff aff)
27363 if (aff.is_null())
27364 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27365 auto saved_ctx = aff.ctx();
27366 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27367 auto res = isl_union_pw_aff_from_aff(aff.release());
27368 if (!res)
27369 exception::throw_last_error(saved_ctx);
27370 ptr = res;
27373 union_pw_aff::union_pw_aff(isl::pw_aff pa)
27375 if (pa.is_null())
27376 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27377 auto saved_ctx = pa.ctx();
27378 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27379 auto res = isl_union_pw_aff_from_pw_aff(pa.release());
27380 if (!res)
27381 exception::throw_last_error(saved_ctx);
27382 ptr = res;
27385 union_pw_aff::union_pw_aff(isl::ctx ctx, const std::string &str)
27387 auto saved_ctx = ctx;
27388 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27389 auto res = isl_union_pw_aff_read_from_str(ctx.release(), str.c_str());
27390 if (!res)
27391 exception::throw_last_error(saved_ctx);
27392 ptr = res;
27395 union_pw_aff &union_pw_aff::operator=(union_pw_aff obj) {
27396 std::swap(this->ptr, obj.ptr);
27397 return *this;
27400 union_pw_aff::~union_pw_aff() {
27401 if (ptr)
27402 isl_union_pw_aff_free(ptr);
27405 __isl_give isl_union_pw_aff *union_pw_aff::copy() const & {
27406 return isl_union_pw_aff_copy(ptr);
27409 __isl_keep isl_union_pw_aff *union_pw_aff::get() const {
27410 return ptr;
27413 __isl_give isl_union_pw_aff *union_pw_aff::release() {
27414 isl_union_pw_aff *tmp = ptr;
27415 ptr = nullptr;
27416 return tmp;
27419 bool union_pw_aff::is_null() const {
27420 return ptr == nullptr;
27423 isl::ctx union_pw_aff::ctx() const {
27424 return isl::ctx(isl_union_pw_aff_get_ctx(ptr));
27427 isl::multi_union_pw_aff union_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
27429 if (!ptr)
27430 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27431 return isl::multi_union_pw_aff(*this).add(multi2);
27434 isl::union_pw_aff union_pw_aff::add(isl::union_pw_aff upa2) const
27436 if (!ptr || upa2.is_null())
27437 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27438 auto saved_ctx = ctx();
27439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27440 auto res = isl_union_pw_aff_add(copy(), upa2.release());
27441 if (!res)
27442 exception::throw_last_error(saved_ctx);
27443 return manage(res);
27446 isl::union_pw_multi_aff union_pw_aff::add(const isl::union_pw_multi_aff &upma2) const
27448 if (!ptr)
27449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27450 return isl::union_pw_multi_aff(*this).add(upma2);
27453 isl::union_pw_aff union_pw_aff::add(const isl::aff &upa2) const
27455 if (!ptr)
27456 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27457 return this->add(isl::union_pw_aff(upa2));
27460 isl::union_pw_aff union_pw_aff::add(const isl::pw_aff &upa2) const
27462 if (!ptr)
27463 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27464 return this->add(isl::union_pw_aff(upa2));
27467 isl::union_pw_multi_aff union_pw_aff::apply(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).apply(upma2);
27474 isl::multi_union_pw_aff union_pw_aff::as_multi_union_pw_aff() const
27476 if (!ptr)
27477 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27478 return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
27481 isl::pw_multi_aff union_pw_aff::as_pw_multi_aff() const
27483 if (!ptr)
27484 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27485 return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
27488 isl::union_map union_pw_aff::as_union_map() const
27490 if (!ptr)
27491 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27492 return isl::union_pw_multi_aff(*this).as_union_map();
27495 isl::union_pw_aff union_pw_aff::at(int pos) const
27497 if (!ptr)
27498 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27499 return isl::multi_union_pw_aff(*this).at(pos);
27502 isl::union_set union_pw_aff::bind(const isl::multi_id &tuple) const
27504 if (!ptr)
27505 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27506 return isl::multi_union_pw_aff(*this).bind(tuple);
27509 isl::union_set union_pw_aff::bind(isl::id id) const
27511 if (!ptr || id.is_null())
27512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27513 auto saved_ctx = ctx();
27514 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27515 auto res = isl_union_pw_aff_bind_id(copy(), id.release());
27516 if (!res)
27517 exception::throw_last_error(saved_ctx);
27518 return manage(res);
27521 isl::union_set union_pw_aff::bind(const std::string &id) const
27523 if (!ptr)
27524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27525 return this->bind(isl::id(ctx(), id));
27528 isl::union_pw_aff union_pw_aff::coalesce() const
27530 if (!ptr)
27531 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27532 auto saved_ctx = ctx();
27533 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27534 auto res = isl_union_pw_aff_coalesce(copy());
27535 if (!res)
27536 exception::throw_last_error(saved_ctx);
27537 return manage(res);
27540 isl::union_set union_pw_aff::domain() const
27542 if (!ptr)
27543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27544 auto saved_ctx = ctx();
27545 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27546 auto res = isl_union_pw_aff_domain(copy());
27547 if (!res)
27548 exception::throw_last_error(saved_ctx);
27549 return manage(res);
27552 isl::union_pw_aff union_pw_aff::drop_unused_params() const
27554 if (!ptr)
27555 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27556 auto saved_ctx = ctx();
27557 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27558 auto res = isl_union_pw_aff_drop_unused_params(copy());
27559 if (!res)
27560 exception::throw_last_error(saved_ctx);
27561 return manage(res);
27564 isl::pw_multi_aff union_pw_aff::extract_pw_multi_aff(const isl::space &space) const
27566 if (!ptr)
27567 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27568 return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
27571 isl::multi_union_pw_aff union_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
27573 if (!ptr)
27574 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27575 return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
27578 isl::union_pw_multi_aff union_pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
27580 if (!ptr)
27581 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27582 return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
27585 isl::union_pw_aff union_pw_aff::gist(isl::union_set context) const
27587 if (!ptr || context.is_null())
27588 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27589 auto saved_ctx = ctx();
27590 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27591 auto res = isl_union_pw_aff_gist(copy(), context.release());
27592 if (!res)
27593 exception::throw_last_error(saved_ctx);
27594 return manage(res);
27597 isl::multi_union_pw_aff union_pw_aff::gist_params(const isl::set &context) const
27599 if (!ptr)
27600 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27601 return isl::multi_union_pw_aff(*this).gist_params(context);
27604 bool union_pw_aff::has_range_tuple_id() const
27606 if (!ptr)
27607 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27608 return isl::multi_union_pw_aff(*this).has_range_tuple_id();
27611 isl::union_pw_aff union_pw_aff::intersect_domain(isl::space space) const
27613 if (!ptr || space.is_null())
27614 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27615 auto saved_ctx = ctx();
27616 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27617 auto res = isl_union_pw_aff_intersect_domain_space(copy(), space.release());
27618 if (!res)
27619 exception::throw_last_error(saved_ctx);
27620 return manage(res);
27623 isl::union_pw_aff union_pw_aff::intersect_domain(isl::union_set uset) const
27625 if (!ptr || uset.is_null())
27626 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27627 auto saved_ctx = ctx();
27628 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27629 auto res = isl_union_pw_aff_intersect_domain_union_set(copy(), uset.release());
27630 if (!res)
27631 exception::throw_last_error(saved_ctx);
27632 return manage(res);
27635 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
27637 if (!ptr || uset.is_null())
27638 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27639 auto saved_ctx = ctx();
27640 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27641 auto res = isl_union_pw_aff_intersect_domain_wrapped_domain(copy(), uset.release());
27642 if (!res)
27643 exception::throw_last_error(saved_ctx);
27644 return manage(res);
27647 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_range(isl::union_set uset) const
27649 if (!ptr || uset.is_null())
27650 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27651 auto saved_ctx = ctx();
27652 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27653 auto res = isl_union_pw_aff_intersect_domain_wrapped_range(copy(), uset.release());
27654 if (!res)
27655 exception::throw_last_error(saved_ctx);
27656 return manage(res);
27659 isl::union_pw_aff union_pw_aff::intersect_params(isl::set set) const
27661 if (!ptr || set.is_null())
27662 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27663 auto saved_ctx = ctx();
27664 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27665 auto res = isl_union_pw_aff_intersect_params(copy(), set.release());
27666 if (!res)
27667 exception::throw_last_error(saved_ctx);
27668 return manage(res);
27671 bool union_pw_aff::involves_locals() const
27673 if (!ptr)
27674 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27675 return isl::union_pw_multi_aff(*this).involves_locals();
27678 bool union_pw_aff::involves_nan() const
27680 if (!ptr)
27681 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27682 return isl::multi_union_pw_aff(*this).involves_nan();
27685 bool union_pw_aff::isa_pw_multi_aff() const
27687 if (!ptr)
27688 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27689 return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
27692 isl::union_pw_aff_list union_pw_aff::list() const
27694 if (!ptr)
27695 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27696 return isl::multi_union_pw_aff(*this).list();
27699 isl::multi_union_pw_aff union_pw_aff::neg() const
27701 if (!ptr)
27702 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27703 return isl::multi_union_pw_aff(*this).neg();
27706 bool union_pw_aff::plain_is_empty() const
27708 if (!ptr)
27709 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27710 return isl::union_pw_multi_aff(*this).plain_is_empty();
27713 bool union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
27715 if (!ptr)
27716 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27717 return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
27720 bool union_pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
27722 if (!ptr || upa2.is_null())
27723 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27724 auto saved_ctx = ctx();
27725 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27726 auto res = isl_union_pw_aff_plain_is_equal(get(), upa2.get());
27727 if (res < 0)
27728 exception::throw_last_error(saved_ctx);
27729 return res;
27732 bool union_pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
27734 if (!ptr)
27735 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27736 return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
27739 bool union_pw_aff::plain_is_equal(const isl::aff &upa2) const
27741 if (!ptr)
27742 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27743 return this->plain_is_equal(isl::union_pw_aff(upa2));
27746 bool union_pw_aff::plain_is_equal(const isl::pw_aff &upa2) const
27748 if (!ptr)
27749 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27750 return this->plain_is_equal(isl::union_pw_aff(upa2));
27753 isl::union_pw_multi_aff union_pw_aff::preimage_domain_wrapped_domain(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).preimage_domain_wrapped_domain(upma2);
27760 isl::union_pw_aff union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
27762 if (!ptr || upma.is_null())
27763 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27764 auto saved_ctx = ctx();
27765 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27766 auto res = isl_union_pw_aff_pullback_union_pw_multi_aff(copy(), upma.release());
27767 if (!res)
27768 exception::throw_last_error(saved_ctx);
27769 return manage(res);
27772 isl::pw_multi_aff_list union_pw_aff::pw_multi_aff_list() const
27774 if (!ptr)
27775 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27776 return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
27779 isl::union_pw_multi_aff union_pw_aff::range_factor_domain() const
27781 if (!ptr)
27782 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27783 return isl::union_pw_multi_aff(*this).range_factor_domain();
27786 isl::union_pw_multi_aff union_pw_aff::range_factor_range() const
27788 if (!ptr)
27789 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27790 return isl::union_pw_multi_aff(*this).range_factor_range();
27793 isl::multi_union_pw_aff union_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
27795 if (!ptr)
27796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27797 return isl::multi_union_pw_aff(*this).range_product(multi2);
27800 isl::union_pw_multi_aff union_pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
27802 if (!ptr)
27803 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27804 return isl::union_pw_multi_aff(*this).range_product(upma2);
27807 isl::id union_pw_aff::range_tuple_id() const
27809 if (!ptr)
27810 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27811 return isl::multi_union_pw_aff(*this).range_tuple_id();
27814 isl::multi_union_pw_aff union_pw_aff::reset_range_tuple_id() const
27816 if (!ptr)
27817 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27818 return isl::multi_union_pw_aff(*this).reset_range_tuple_id();
27821 isl::multi_union_pw_aff union_pw_aff::scale(const isl::multi_val &mv) const
27823 if (!ptr)
27824 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27825 return isl::multi_union_pw_aff(*this).scale(mv);
27828 isl::multi_union_pw_aff union_pw_aff::scale(const isl::val &v) const
27830 if (!ptr)
27831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27832 return isl::multi_union_pw_aff(*this).scale(v);
27835 isl::multi_union_pw_aff union_pw_aff::scale(long v) const
27837 if (!ptr)
27838 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27839 return this->scale(isl::val(ctx(), v));
27842 isl::multi_union_pw_aff union_pw_aff::scale_down(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_down(mv);
27849 isl::multi_union_pw_aff union_pw_aff::scale_down(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_down(v);
27856 isl::multi_union_pw_aff union_pw_aff::scale_down(long v) const
27858 if (!ptr)
27859 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27860 return this->scale_down(isl::val(ctx(), v));
27863 isl::multi_union_pw_aff union_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
27865 if (!ptr)
27866 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27867 return isl::multi_union_pw_aff(*this).set_at(pos, el);
27870 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const isl::id &id) const
27872 if (!ptr)
27873 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27874 return isl::multi_union_pw_aff(*this).set_range_tuple(id);
27877 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const std::string &id) const
27879 if (!ptr)
27880 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27881 return this->set_range_tuple(isl::id(ctx(), id));
27884 unsigned union_pw_aff::size() const
27886 if (!ptr)
27887 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27888 return isl::multi_union_pw_aff(*this).size();
27891 isl::space union_pw_aff::space() const
27893 if (!ptr)
27894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27895 auto saved_ctx = ctx();
27896 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27897 auto res = isl_union_pw_aff_get_space(get());
27898 if (!res)
27899 exception::throw_last_error(saved_ctx);
27900 return manage(res);
27903 isl::space union_pw_aff::get_space() const
27905 return space();
27908 isl::multi_union_pw_aff union_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
27910 if (!ptr)
27911 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27912 return isl::multi_union_pw_aff(*this).sub(multi2);
27915 isl::union_pw_aff union_pw_aff::sub(isl::union_pw_aff upa2) const
27917 if (!ptr || upa2.is_null())
27918 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27919 auto saved_ctx = ctx();
27920 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27921 auto res = isl_union_pw_aff_sub(copy(), upa2.release());
27922 if (!res)
27923 exception::throw_last_error(saved_ctx);
27924 return manage(res);
27927 isl::union_pw_multi_aff union_pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
27929 if (!ptr)
27930 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27931 return isl::union_pw_multi_aff(*this).sub(upma2);
27934 isl::union_pw_aff union_pw_aff::sub(const isl::aff &upa2) const
27936 if (!ptr)
27937 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27938 return this->sub(isl::union_pw_aff(upa2));
27941 isl::union_pw_aff union_pw_aff::sub(const isl::pw_aff &upa2) const
27943 if (!ptr)
27944 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27945 return this->sub(isl::union_pw_aff(upa2));
27948 isl::union_pw_aff union_pw_aff::subtract_domain(isl::space space) const
27950 if (!ptr || space.is_null())
27951 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27952 auto saved_ctx = ctx();
27953 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27954 auto res = isl_union_pw_aff_subtract_domain_space(copy(), space.release());
27955 if (!res)
27956 exception::throw_last_error(saved_ctx);
27957 return manage(res);
27960 isl::union_pw_aff union_pw_aff::subtract_domain(isl::union_set uset) const
27962 if (!ptr || uset.is_null())
27963 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27964 auto saved_ctx = ctx();
27965 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27966 auto res = isl_union_pw_aff_subtract_domain_union_set(copy(), uset.release());
27967 if (!res)
27968 exception::throw_last_error(saved_ctx);
27969 return manage(res);
27972 isl::union_pw_aff_list union_pw_aff::to_list() const
27974 if (!ptr)
27975 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27976 auto saved_ctx = ctx();
27977 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27978 auto res = isl_union_pw_aff_to_list(copy());
27979 if (!res)
27980 exception::throw_last_error(saved_ctx);
27981 return manage(res);
27984 isl::multi_union_pw_aff union_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
27986 if (!ptr)
27987 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27988 return isl::multi_union_pw_aff(*this).union_add(mupa2);
27991 isl::union_pw_aff union_pw_aff::union_add(isl::union_pw_aff upa2) const
27993 if (!ptr || upa2.is_null())
27994 exception::throw_invalid("NULL input", __FILE__, __LINE__);
27995 auto saved_ctx = ctx();
27996 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
27997 auto res = isl_union_pw_aff_union_add(copy(), upa2.release());
27998 if (!res)
27999 exception::throw_last_error(saved_ctx);
28000 return manage(res);
28003 isl::union_pw_multi_aff union_pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
28005 if (!ptr)
28006 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28007 return isl::union_pw_multi_aff(*this).union_add(upma2);
28010 isl::union_pw_aff union_pw_aff::union_add(const isl::aff &upa2) const
28012 if (!ptr)
28013 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28014 return this->union_add(isl::union_pw_aff(upa2));
28017 isl::union_pw_aff union_pw_aff::union_add(const isl::pw_aff &upa2) const
28019 if (!ptr)
28020 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28021 return this->union_add(isl::union_pw_aff(upa2));
28024 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff &obj)
28026 if (!obj.get())
28027 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28028 auto saved_ctx = isl_union_pw_aff_get_ctx(obj.get());
28029 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28030 char *str = isl_union_pw_aff_to_str(obj.get());
28031 if (!str)
28032 exception::throw_last_error(saved_ctx);
28033 os << str;
28034 free(str);
28035 return os;
28038 // implementations for isl::union_pw_aff_list
28039 union_pw_aff_list manage(__isl_take isl_union_pw_aff_list *ptr) {
28040 if (!ptr)
28041 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28042 return union_pw_aff_list(ptr);
28044 union_pw_aff_list manage_copy(__isl_keep isl_union_pw_aff_list *ptr) {
28045 if (!ptr)
28046 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28047 auto saved_ctx = isl_union_pw_aff_list_get_ctx(ptr);
28048 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28049 ptr = isl_union_pw_aff_list_copy(ptr);
28050 if (!ptr)
28051 exception::throw_last_error(saved_ctx);
28052 return union_pw_aff_list(ptr);
28055 union_pw_aff_list::union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr)
28056 : ptr(ptr) {}
28058 union_pw_aff_list::union_pw_aff_list()
28059 : ptr(nullptr) {}
28061 union_pw_aff_list::union_pw_aff_list(const union_pw_aff_list &obj)
28062 : ptr(nullptr)
28064 if (!obj.ptr)
28065 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28066 auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.ptr);
28067 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28068 ptr = obj.copy();
28069 if (!ptr)
28070 exception::throw_last_error(saved_ctx);
28073 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, int n)
28075 auto saved_ctx = ctx;
28076 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28077 auto res = isl_union_pw_aff_list_alloc(ctx.release(), n);
28078 if (!res)
28079 exception::throw_last_error(saved_ctx);
28080 ptr = res;
28083 union_pw_aff_list::union_pw_aff_list(isl::union_pw_aff el)
28085 if (el.is_null())
28086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28087 auto saved_ctx = el.ctx();
28088 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28089 auto res = isl_union_pw_aff_list_from_union_pw_aff(el.release());
28090 if (!res)
28091 exception::throw_last_error(saved_ctx);
28092 ptr = res;
28095 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, const std::string &str)
28097 auto saved_ctx = ctx;
28098 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28099 auto res = isl_union_pw_aff_list_read_from_str(ctx.release(), str.c_str());
28100 if (!res)
28101 exception::throw_last_error(saved_ctx);
28102 ptr = res;
28105 union_pw_aff_list &union_pw_aff_list::operator=(union_pw_aff_list obj) {
28106 std::swap(this->ptr, obj.ptr);
28107 return *this;
28110 union_pw_aff_list::~union_pw_aff_list() {
28111 if (ptr)
28112 isl_union_pw_aff_list_free(ptr);
28115 __isl_give isl_union_pw_aff_list *union_pw_aff_list::copy() const & {
28116 return isl_union_pw_aff_list_copy(ptr);
28119 __isl_keep isl_union_pw_aff_list *union_pw_aff_list::get() const {
28120 return ptr;
28123 __isl_give isl_union_pw_aff_list *union_pw_aff_list::release() {
28124 isl_union_pw_aff_list *tmp = ptr;
28125 ptr = nullptr;
28126 return tmp;
28129 bool union_pw_aff_list::is_null() const {
28130 return ptr == nullptr;
28133 isl::ctx union_pw_aff_list::ctx() const {
28134 return isl::ctx(isl_union_pw_aff_list_get_ctx(ptr));
28137 isl::union_pw_aff_list union_pw_aff_list::add(isl::union_pw_aff el) const
28139 if (!ptr || el.is_null())
28140 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28141 auto saved_ctx = ctx();
28142 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28143 auto res = isl_union_pw_aff_list_add(copy(), el.release());
28144 if (!res)
28145 exception::throw_last_error(saved_ctx);
28146 return manage(res);
28149 isl::union_pw_aff union_pw_aff_list::at(int index) const
28151 if (!ptr)
28152 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28153 auto saved_ctx = ctx();
28154 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28155 auto res = isl_union_pw_aff_list_get_at(get(), index);
28156 if (!res)
28157 exception::throw_last_error(saved_ctx);
28158 return manage(res);
28161 isl::union_pw_aff union_pw_aff_list::get_at(int index) const
28163 return at(index);
28166 isl::union_pw_aff_list union_pw_aff_list::clear() const
28168 if (!ptr)
28169 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28170 auto saved_ctx = ctx();
28171 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28172 auto res = isl_union_pw_aff_list_clear(copy());
28173 if (!res)
28174 exception::throw_last_error(saved_ctx);
28175 return manage(res);
28178 isl::union_pw_aff_list union_pw_aff_list::concat(isl::union_pw_aff_list list2) const
28180 if (!ptr || list2.is_null())
28181 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28182 auto saved_ctx = ctx();
28183 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28184 auto res = isl_union_pw_aff_list_concat(copy(), list2.release());
28185 if (!res)
28186 exception::throw_last_error(saved_ctx);
28187 return manage(res);
28190 isl::union_pw_aff_list union_pw_aff_list::drop(unsigned int first, unsigned int n) const
28192 if (!ptr)
28193 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28194 auto saved_ctx = ctx();
28195 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28196 auto res = isl_union_pw_aff_list_drop(copy(), first, n);
28197 if (!res)
28198 exception::throw_last_error(saved_ctx);
28199 return manage(res);
28202 void union_pw_aff_list::foreach(const std::function<void(isl::union_pw_aff)> &fn) const
28204 if (!ptr)
28205 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28206 auto saved_ctx = ctx();
28207 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28208 struct fn_data {
28209 std::function<void(isl::union_pw_aff)> func;
28210 std::exception_ptr eptr;
28211 } fn_data = { fn };
28212 auto fn_lambda = [](isl_union_pw_aff *arg_0, void *arg_1) -> isl_stat {
28213 auto *data = static_cast<struct fn_data *>(arg_1);
28214 ISL_CPP_TRY {
28215 (data->func)(manage(arg_0));
28216 return isl_stat_ok;
28217 } ISL_CPP_CATCH_ALL {
28218 data->eptr = std::current_exception();
28219 return isl_stat_error;
28222 auto res = isl_union_pw_aff_list_foreach(get(), fn_lambda, &fn_data);
28223 if (fn_data.eptr)
28224 std::rethrow_exception(fn_data.eptr);
28225 if (res < 0)
28226 exception::throw_last_error(saved_ctx);
28227 return;
28230 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
28232 if (!ptr)
28233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28234 auto saved_ctx = ctx();
28235 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28236 struct follows_data {
28237 std::function<bool(isl::union_pw_aff, isl::union_pw_aff)> func;
28238 std::exception_ptr eptr;
28239 } follows_data = { follows };
28240 auto follows_lambda = [](isl_union_pw_aff *arg_0, isl_union_pw_aff *arg_1, void *arg_2) -> isl_bool {
28241 auto *data = static_cast<struct follows_data *>(arg_2);
28242 ISL_CPP_TRY {
28243 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
28244 return ret ? isl_bool_true : isl_bool_false;
28245 } ISL_CPP_CATCH_ALL {
28246 data->eptr = std::current_exception();
28247 return isl_bool_error;
28250 struct fn_data {
28251 std::function<void(isl::union_pw_aff_list)> func;
28252 std::exception_ptr eptr;
28253 } fn_data = { fn };
28254 auto fn_lambda = [](isl_union_pw_aff_list *arg_0, void *arg_1) -> isl_stat {
28255 auto *data = static_cast<struct fn_data *>(arg_1);
28256 ISL_CPP_TRY {
28257 (data->func)(manage(arg_0));
28258 return isl_stat_ok;
28259 } ISL_CPP_CATCH_ALL {
28260 data->eptr = std::current_exception();
28261 return isl_stat_error;
28264 auto res = isl_union_pw_aff_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
28265 if (follows_data.eptr)
28266 std::rethrow_exception(follows_data.eptr);
28267 if (fn_data.eptr)
28268 std::rethrow_exception(fn_data.eptr);
28269 if (res < 0)
28270 exception::throw_last_error(saved_ctx);
28271 return;
28274 isl::union_pw_aff_list union_pw_aff_list::insert(unsigned int pos, isl::union_pw_aff el) const
28276 if (!ptr || el.is_null())
28277 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28278 auto saved_ctx = ctx();
28279 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28280 auto res = isl_union_pw_aff_list_insert(copy(), pos, el.release());
28281 if (!res)
28282 exception::throw_last_error(saved_ctx);
28283 return manage(res);
28286 isl::union_pw_aff_list union_pw_aff_list::set_at(int index, isl::union_pw_aff el) const
28288 if (!ptr || el.is_null())
28289 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28290 auto saved_ctx = ctx();
28291 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28292 auto res = isl_union_pw_aff_list_set_at(copy(), index, el.release());
28293 if (!res)
28294 exception::throw_last_error(saved_ctx);
28295 return manage(res);
28298 unsigned union_pw_aff_list::size() const
28300 if (!ptr)
28301 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28302 auto saved_ctx = ctx();
28303 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28304 auto res = isl_union_pw_aff_list_size(get());
28305 if (res < 0)
28306 exception::throw_last_error(saved_ctx);
28307 return res;
28310 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff_list &obj)
28312 if (!obj.get())
28313 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28314 auto saved_ctx = isl_union_pw_aff_list_get_ctx(obj.get());
28315 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28316 char *str = isl_union_pw_aff_list_to_str(obj.get());
28317 if (!str)
28318 exception::throw_last_error(saved_ctx);
28319 os << str;
28320 free(str);
28321 return os;
28324 // implementations for isl::union_pw_multi_aff
28325 union_pw_multi_aff manage(__isl_take isl_union_pw_multi_aff *ptr) {
28326 if (!ptr)
28327 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28328 return union_pw_multi_aff(ptr);
28330 union_pw_multi_aff manage_copy(__isl_keep isl_union_pw_multi_aff *ptr) {
28331 if (!ptr)
28332 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28333 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(ptr);
28334 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28335 ptr = isl_union_pw_multi_aff_copy(ptr);
28336 if (!ptr)
28337 exception::throw_last_error(saved_ctx);
28338 return union_pw_multi_aff(ptr);
28341 union_pw_multi_aff::union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr)
28342 : ptr(ptr) {}
28344 union_pw_multi_aff::union_pw_multi_aff()
28345 : ptr(nullptr) {}
28347 union_pw_multi_aff::union_pw_multi_aff(const union_pw_multi_aff &obj)
28348 : ptr(nullptr)
28350 if (!obj.ptr)
28351 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28352 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.ptr);
28353 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28354 ptr = obj.copy();
28355 if (!ptr)
28356 exception::throw_last_error(saved_ctx);
28359 union_pw_multi_aff::union_pw_multi_aff(isl::multi_aff ma)
28361 if (ma.is_null())
28362 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28363 auto saved_ctx = ma.ctx();
28364 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28365 auto res = isl_union_pw_multi_aff_from_multi_aff(ma.release());
28366 if (!res)
28367 exception::throw_last_error(saved_ctx);
28368 ptr = res;
28371 union_pw_multi_aff::union_pw_multi_aff(isl::pw_multi_aff pma)
28373 if (pma.is_null())
28374 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28375 auto saved_ctx = pma.ctx();
28376 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28377 auto res = isl_union_pw_multi_aff_from_pw_multi_aff(pma.release());
28378 if (!res)
28379 exception::throw_last_error(saved_ctx);
28380 ptr = res;
28383 union_pw_multi_aff::union_pw_multi_aff(isl::union_pw_aff upa)
28385 if (upa.is_null())
28386 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28387 auto saved_ctx = upa.ctx();
28388 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28389 auto res = isl_union_pw_multi_aff_from_union_pw_aff(upa.release());
28390 if (!res)
28391 exception::throw_last_error(saved_ctx);
28392 ptr = res;
28395 union_pw_multi_aff::union_pw_multi_aff(isl::ctx ctx, const std::string &str)
28397 auto saved_ctx = ctx;
28398 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28399 auto res = isl_union_pw_multi_aff_read_from_str(ctx.release(), str.c_str());
28400 if (!res)
28401 exception::throw_last_error(saved_ctx);
28402 ptr = res;
28405 union_pw_multi_aff &union_pw_multi_aff::operator=(union_pw_multi_aff obj) {
28406 std::swap(this->ptr, obj.ptr);
28407 return *this;
28410 union_pw_multi_aff::~union_pw_multi_aff() {
28411 if (ptr)
28412 isl_union_pw_multi_aff_free(ptr);
28415 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::copy() const & {
28416 return isl_union_pw_multi_aff_copy(ptr);
28419 __isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::get() const {
28420 return ptr;
28423 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::release() {
28424 isl_union_pw_multi_aff *tmp = ptr;
28425 ptr = nullptr;
28426 return tmp;
28429 bool union_pw_multi_aff::is_null() const {
28430 return ptr == nullptr;
28433 isl::ctx union_pw_multi_aff::ctx() const {
28434 return isl::ctx(isl_union_pw_multi_aff_get_ctx(ptr));
28437 isl::union_pw_multi_aff union_pw_multi_aff::add(isl::union_pw_multi_aff upma2) const
28439 if (!ptr || upma2.is_null())
28440 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28441 auto saved_ctx = ctx();
28442 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28443 auto res = isl_union_pw_multi_aff_add(copy(), upma2.release());
28444 if (!res)
28445 exception::throw_last_error(saved_ctx);
28446 return manage(res);
28449 isl::union_pw_multi_aff union_pw_multi_aff::apply(isl::union_pw_multi_aff upma2) const
28451 if (!ptr || upma2.is_null())
28452 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28453 auto saved_ctx = ctx();
28454 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28455 auto res = isl_union_pw_multi_aff_apply_union_pw_multi_aff(copy(), upma2.release());
28456 if (!res)
28457 exception::throw_last_error(saved_ctx);
28458 return manage(res);
28461 isl::multi_union_pw_aff union_pw_multi_aff::as_multi_union_pw_aff() const
28463 if (!ptr)
28464 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28465 auto saved_ctx = ctx();
28466 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28467 auto res = isl_union_pw_multi_aff_as_multi_union_pw_aff(copy());
28468 if (!res)
28469 exception::throw_last_error(saved_ctx);
28470 return manage(res);
28473 isl::pw_multi_aff union_pw_multi_aff::as_pw_multi_aff() const
28475 if (!ptr)
28476 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28477 auto saved_ctx = ctx();
28478 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28479 auto res = isl_union_pw_multi_aff_as_pw_multi_aff(copy());
28480 if (!res)
28481 exception::throw_last_error(saved_ctx);
28482 return manage(res);
28485 isl::union_map union_pw_multi_aff::as_union_map() const
28487 if (!ptr)
28488 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28489 auto saved_ctx = ctx();
28490 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28491 auto res = isl_union_pw_multi_aff_as_union_map(copy());
28492 if (!res)
28493 exception::throw_last_error(saved_ctx);
28494 return manage(res);
28497 isl::union_pw_multi_aff union_pw_multi_aff::coalesce() const
28499 if (!ptr)
28500 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28501 auto saved_ctx = ctx();
28502 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28503 auto res = isl_union_pw_multi_aff_coalesce(copy());
28504 if (!res)
28505 exception::throw_last_error(saved_ctx);
28506 return manage(res);
28509 isl::union_set union_pw_multi_aff::domain() const
28511 if (!ptr)
28512 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28513 auto saved_ctx = ctx();
28514 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28515 auto res = isl_union_pw_multi_aff_domain(copy());
28516 if (!res)
28517 exception::throw_last_error(saved_ctx);
28518 return manage(res);
28521 isl::union_pw_multi_aff union_pw_multi_aff::drop_unused_params() const
28523 if (!ptr)
28524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28525 auto saved_ctx = ctx();
28526 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28527 auto res = isl_union_pw_multi_aff_drop_unused_params(copy());
28528 if (!res)
28529 exception::throw_last_error(saved_ctx);
28530 return manage(res);
28533 isl::union_pw_multi_aff union_pw_multi_aff::empty(isl::ctx ctx)
28535 auto saved_ctx = ctx;
28536 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28537 auto res = isl_union_pw_multi_aff_empty_ctx(ctx.release());
28538 if (!res)
28539 exception::throw_last_error(saved_ctx);
28540 return manage(res);
28543 isl::pw_multi_aff union_pw_multi_aff::extract_pw_multi_aff(isl::space space) const
28545 if (!ptr || space.is_null())
28546 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28547 auto saved_ctx = ctx();
28548 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28549 auto res = isl_union_pw_multi_aff_extract_pw_multi_aff(get(), space.release());
28550 if (!res)
28551 exception::throw_last_error(saved_ctx);
28552 return manage(res);
28555 isl::union_pw_multi_aff union_pw_multi_aff::flat_range_product(isl::union_pw_multi_aff upma2) const
28557 if (!ptr || upma2.is_null())
28558 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28559 auto saved_ctx = ctx();
28560 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28561 auto res = isl_union_pw_multi_aff_flat_range_product(copy(), upma2.release());
28562 if (!res)
28563 exception::throw_last_error(saved_ctx);
28564 return manage(res);
28567 isl::union_pw_multi_aff union_pw_multi_aff::gist(isl::union_set context) const
28569 if (!ptr || context.is_null())
28570 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28571 auto saved_ctx = ctx();
28572 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28573 auto res = isl_union_pw_multi_aff_gist(copy(), context.release());
28574 if (!res)
28575 exception::throw_last_error(saved_ctx);
28576 return manage(res);
28579 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::space space) const
28581 if (!ptr || space.is_null())
28582 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28583 auto saved_ctx = ctx();
28584 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28585 auto res = isl_union_pw_multi_aff_intersect_domain_space(copy(), space.release());
28586 if (!res)
28587 exception::throw_last_error(saved_ctx);
28588 return manage(res);
28591 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::union_set uset) const
28593 if (!ptr || uset.is_null())
28594 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28595 auto saved_ctx = ctx();
28596 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28597 auto res = isl_union_pw_multi_aff_intersect_domain_union_set(copy(), uset.release());
28598 if (!res)
28599 exception::throw_last_error(saved_ctx);
28600 return manage(res);
28603 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
28605 if (!ptr || uset.is_null())
28606 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28607 auto saved_ctx = ctx();
28608 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28609 auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_domain(copy(), uset.release());
28610 if (!res)
28611 exception::throw_last_error(saved_ctx);
28612 return manage(res);
28615 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_range(isl::union_set uset) const
28617 if (!ptr || uset.is_null())
28618 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28619 auto saved_ctx = ctx();
28620 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28621 auto res = isl_union_pw_multi_aff_intersect_domain_wrapped_range(copy(), uset.release());
28622 if (!res)
28623 exception::throw_last_error(saved_ctx);
28624 return manage(res);
28627 isl::union_pw_multi_aff union_pw_multi_aff::intersect_params(isl::set set) const
28629 if (!ptr || set.is_null())
28630 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28631 auto saved_ctx = ctx();
28632 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28633 auto res = isl_union_pw_multi_aff_intersect_params(copy(), set.release());
28634 if (!res)
28635 exception::throw_last_error(saved_ctx);
28636 return manage(res);
28639 bool union_pw_multi_aff::involves_locals() const
28641 if (!ptr)
28642 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28643 auto saved_ctx = ctx();
28644 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28645 auto res = isl_union_pw_multi_aff_involves_locals(get());
28646 if (res < 0)
28647 exception::throw_last_error(saved_ctx);
28648 return res;
28651 bool union_pw_multi_aff::isa_pw_multi_aff() const
28653 if (!ptr)
28654 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28655 auto saved_ctx = ctx();
28656 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28657 auto res = isl_union_pw_multi_aff_isa_pw_multi_aff(get());
28658 if (res < 0)
28659 exception::throw_last_error(saved_ctx);
28660 return res;
28663 bool union_pw_multi_aff::plain_is_empty() const
28665 if (!ptr)
28666 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28667 auto saved_ctx = ctx();
28668 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28669 auto res = isl_union_pw_multi_aff_plain_is_empty(get());
28670 if (res < 0)
28671 exception::throw_last_error(saved_ctx);
28672 return res;
28675 bool union_pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
28677 if (!ptr || upma2.is_null())
28678 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28679 auto saved_ctx = ctx();
28680 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28681 auto res = isl_union_pw_multi_aff_plain_is_equal(get(), upma2.get());
28682 if (res < 0)
28683 exception::throw_last_error(saved_ctx);
28684 return res;
28687 isl::union_pw_multi_aff union_pw_multi_aff::preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const
28689 if (!ptr || upma2.is_null())
28690 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28691 auto saved_ctx = ctx();
28692 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28693 auto res = isl_union_pw_multi_aff_preimage_domain_wrapped_domain_union_pw_multi_aff(copy(), upma2.release());
28694 if (!res)
28695 exception::throw_last_error(saved_ctx);
28696 return manage(res);
28699 isl::union_pw_multi_aff union_pw_multi_aff::pullback(isl::union_pw_multi_aff upma2) const
28701 if (!ptr || upma2.is_null())
28702 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28703 auto saved_ctx = ctx();
28704 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28705 auto res = isl_union_pw_multi_aff_pullback_union_pw_multi_aff(copy(), upma2.release());
28706 if (!res)
28707 exception::throw_last_error(saved_ctx);
28708 return manage(res);
28711 isl::pw_multi_aff_list union_pw_multi_aff::pw_multi_aff_list() const
28713 if (!ptr)
28714 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28715 auto saved_ctx = ctx();
28716 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28717 auto res = isl_union_pw_multi_aff_get_pw_multi_aff_list(get());
28718 if (!res)
28719 exception::throw_last_error(saved_ctx);
28720 return manage(res);
28723 isl::pw_multi_aff_list union_pw_multi_aff::get_pw_multi_aff_list() const
28725 return pw_multi_aff_list();
28728 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_domain() const
28730 if (!ptr)
28731 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28732 auto saved_ctx = ctx();
28733 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28734 auto res = isl_union_pw_multi_aff_range_factor_domain(copy());
28735 if (!res)
28736 exception::throw_last_error(saved_ctx);
28737 return manage(res);
28740 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_range() const
28742 if (!ptr)
28743 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28744 auto saved_ctx = ctx();
28745 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28746 auto res = isl_union_pw_multi_aff_range_factor_range(copy());
28747 if (!res)
28748 exception::throw_last_error(saved_ctx);
28749 return manage(res);
28752 isl::union_pw_multi_aff union_pw_multi_aff::range_product(isl::union_pw_multi_aff upma2) const
28754 if (!ptr || upma2.is_null())
28755 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28756 auto saved_ctx = ctx();
28757 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28758 auto res = isl_union_pw_multi_aff_range_product(copy(), upma2.release());
28759 if (!res)
28760 exception::throw_last_error(saved_ctx);
28761 return manage(res);
28764 isl::space union_pw_multi_aff::space() const
28766 if (!ptr)
28767 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28768 auto saved_ctx = ctx();
28769 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28770 auto res = isl_union_pw_multi_aff_get_space(get());
28771 if (!res)
28772 exception::throw_last_error(saved_ctx);
28773 return manage(res);
28776 isl::space union_pw_multi_aff::get_space() const
28778 return space();
28781 isl::union_pw_multi_aff union_pw_multi_aff::sub(isl::union_pw_multi_aff upma2) const
28783 if (!ptr || upma2.is_null())
28784 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28785 auto saved_ctx = ctx();
28786 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28787 auto res = isl_union_pw_multi_aff_sub(copy(), upma2.release());
28788 if (!res)
28789 exception::throw_last_error(saved_ctx);
28790 return manage(res);
28793 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::space space) const
28795 if (!ptr || space.is_null())
28796 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28797 auto saved_ctx = ctx();
28798 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28799 auto res = isl_union_pw_multi_aff_subtract_domain_space(copy(), space.release());
28800 if (!res)
28801 exception::throw_last_error(saved_ctx);
28802 return manage(res);
28805 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::union_set uset) const
28807 if (!ptr || uset.is_null())
28808 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28809 auto saved_ctx = ctx();
28810 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28811 auto res = isl_union_pw_multi_aff_subtract_domain_union_set(copy(), uset.release());
28812 if (!res)
28813 exception::throw_last_error(saved_ctx);
28814 return manage(res);
28817 isl::union_pw_multi_aff union_pw_multi_aff::union_add(isl::union_pw_multi_aff upma2) const
28819 if (!ptr || upma2.is_null())
28820 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28821 auto saved_ctx = ctx();
28822 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28823 auto res = isl_union_pw_multi_aff_union_add(copy(), upma2.release());
28824 if (!res)
28825 exception::throw_last_error(saved_ctx);
28826 return manage(res);
28829 inline std::ostream &operator<<(std::ostream &os, const union_pw_multi_aff &obj)
28831 if (!obj.get())
28832 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28833 auto saved_ctx = isl_union_pw_multi_aff_get_ctx(obj.get());
28834 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28835 char *str = isl_union_pw_multi_aff_to_str(obj.get());
28836 if (!str)
28837 exception::throw_last_error(saved_ctx);
28838 os << str;
28839 free(str);
28840 return os;
28843 // implementations for isl::union_set
28844 union_set manage(__isl_take isl_union_set *ptr) {
28845 if (!ptr)
28846 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28847 return union_set(ptr);
28849 union_set manage_copy(__isl_keep isl_union_set *ptr) {
28850 if (!ptr)
28851 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28852 auto saved_ctx = isl_union_set_get_ctx(ptr);
28853 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28854 ptr = isl_union_set_copy(ptr);
28855 if (!ptr)
28856 exception::throw_last_error(saved_ctx);
28857 return union_set(ptr);
28860 union_set::union_set(__isl_take isl_union_set *ptr)
28861 : ptr(ptr) {}
28863 union_set::union_set()
28864 : ptr(nullptr) {}
28866 union_set::union_set(const union_set &obj)
28867 : ptr(nullptr)
28869 if (!obj.ptr)
28870 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28871 auto saved_ctx = isl_union_set_get_ctx(obj.ptr);
28872 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28873 ptr = obj.copy();
28874 if (!ptr)
28875 exception::throw_last_error(saved_ctx);
28878 union_set::union_set(isl::basic_set bset)
28880 if (bset.is_null())
28881 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28882 auto saved_ctx = bset.ctx();
28883 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28884 auto res = isl_union_set_from_basic_set(bset.release());
28885 if (!res)
28886 exception::throw_last_error(saved_ctx);
28887 ptr = res;
28890 union_set::union_set(isl::point pnt)
28892 if (pnt.is_null())
28893 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28894 auto saved_ctx = pnt.ctx();
28895 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28896 auto res = isl_union_set_from_point(pnt.release());
28897 if (!res)
28898 exception::throw_last_error(saved_ctx);
28899 ptr = res;
28902 union_set::union_set(isl::set set)
28904 if (set.is_null())
28905 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28906 auto saved_ctx = set.ctx();
28907 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28908 auto res = isl_union_set_from_set(set.release());
28909 if (!res)
28910 exception::throw_last_error(saved_ctx);
28911 ptr = res;
28914 union_set::union_set(isl::ctx ctx, const std::string &str)
28916 auto saved_ctx = ctx;
28917 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28918 auto res = isl_union_set_read_from_str(ctx.release(), str.c_str());
28919 if (!res)
28920 exception::throw_last_error(saved_ctx);
28921 ptr = res;
28924 union_set &union_set::operator=(union_set obj) {
28925 std::swap(this->ptr, obj.ptr);
28926 return *this;
28929 union_set::~union_set() {
28930 if (ptr)
28931 isl_union_set_free(ptr);
28934 __isl_give isl_union_set *union_set::copy() const & {
28935 return isl_union_set_copy(ptr);
28938 __isl_keep isl_union_set *union_set::get() const {
28939 return ptr;
28942 __isl_give isl_union_set *union_set::release() {
28943 isl_union_set *tmp = ptr;
28944 ptr = nullptr;
28945 return tmp;
28948 bool union_set::is_null() const {
28949 return ptr == nullptr;
28952 isl::ctx union_set::ctx() const {
28953 return isl::ctx(isl_union_set_get_ctx(ptr));
28956 isl::union_set union_set::affine_hull() const
28958 if (!ptr)
28959 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28960 auto saved_ctx = ctx();
28961 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28962 auto res = isl_union_set_affine_hull(copy());
28963 if (!res)
28964 exception::throw_last_error(saved_ctx);
28965 return manage(res);
28968 isl::union_set union_set::apply(isl::union_map umap) const
28970 if (!ptr || umap.is_null())
28971 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28972 auto saved_ctx = ctx();
28973 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28974 auto res = isl_union_set_apply(copy(), umap.release());
28975 if (!res)
28976 exception::throw_last_error(saved_ctx);
28977 return manage(res);
28980 isl::set union_set::as_set() const
28982 if (!ptr)
28983 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28984 auto saved_ctx = ctx();
28985 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28986 auto res = isl_union_set_as_set(copy());
28987 if (!res)
28988 exception::throw_last_error(saved_ctx);
28989 return manage(res);
28992 isl::union_set union_set::coalesce() const
28994 if (!ptr)
28995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
28996 auto saved_ctx = ctx();
28997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
28998 auto res = isl_union_set_coalesce(copy());
28999 if (!res)
29000 exception::throw_last_error(saved_ctx);
29001 return manage(res);
29004 isl::union_set union_set::compute_divs() const
29006 if (!ptr)
29007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29008 auto saved_ctx = ctx();
29009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29010 auto res = isl_union_set_compute_divs(copy());
29011 if (!res)
29012 exception::throw_last_error(saved_ctx);
29013 return manage(res);
29016 isl::union_set union_set::detect_equalities() const
29018 if (!ptr)
29019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29020 auto saved_ctx = ctx();
29021 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29022 auto res = isl_union_set_detect_equalities(copy());
29023 if (!res)
29024 exception::throw_last_error(saved_ctx);
29025 return manage(res);
29028 isl::union_set union_set::drop_unused_params() const
29030 if (!ptr)
29031 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29032 auto saved_ctx = ctx();
29033 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29034 auto res = isl_union_set_drop_unused_params(copy());
29035 if (!res)
29036 exception::throw_last_error(saved_ctx);
29037 return manage(res);
29040 isl::union_set union_set::empty(isl::ctx ctx)
29042 auto saved_ctx = ctx;
29043 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29044 auto res = isl_union_set_empty_ctx(ctx.release());
29045 if (!res)
29046 exception::throw_last_error(saved_ctx);
29047 return manage(res);
29050 bool union_set::every_set(const std::function<bool(isl::set)> &test) const
29052 if (!ptr)
29053 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29054 auto saved_ctx = ctx();
29055 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29056 struct test_data {
29057 std::function<bool(isl::set)> func;
29058 std::exception_ptr eptr;
29059 } test_data = { test };
29060 auto test_lambda = [](isl_set *arg_0, void *arg_1) -> isl_bool {
29061 auto *data = static_cast<struct test_data *>(arg_1);
29062 ISL_CPP_TRY {
29063 auto ret = (data->func)(manage_copy(arg_0));
29064 return ret ? isl_bool_true : isl_bool_false;
29065 } ISL_CPP_CATCH_ALL {
29066 data->eptr = std::current_exception();
29067 return isl_bool_error;
29070 auto res = isl_union_set_every_set(get(), test_lambda, &test_data);
29071 if (test_data.eptr)
29072 std::rethrow_exception(test_data.eptr);
29073 if (res < 0)
29074 exception::throw_last_error(saved_ctx);
29075 return res;
29078 isl::set union_set::extract_set(isl::space space) const
29080 if (!ptr || space.is_null())
29081 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29082 auto saved_ctx = ctx();
29083 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29084 auto res = isl_union_set_extract_set(get(), space.release());
29085 if (!res)
29086 exception::throw_last_error(saved_ctx);
29087 return manage(res);
29090 void union_set::foreach_point(const std::function<void(isl::point)> &fn) const
29092 if (!ptr)
29093 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29094 auto saved_ctx = ctx();
29095 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29096 struct fn_data {
29097 std::function<void(isl::point)> func;
29098 std::exception_ptr eptr;
29099 } fn_data = { fn };
29100 auto fn_lambda = [](isl_point *arg_0, void *arg_1) -> isl_stat {
29101 auto *data = static_cast<struct fn_data *>(arg_1);
29102 ISL_CPP_TRY {
29103 (data->func)(manage(arg_0));
29104 return isl_stat_ok;
29105 } ISL_CPP_CATCH_ALL {
29106 data->eptr = std::current_exception();
29107 return isl_stat_error;
29110 auto res = isl_union_set_foreach_point(get(), fn_lambda, &fn_data);
29111 if (fn_data.eptr)
29112 std::rethrow_exception(fn_data.eptr);
29113 if (res < 0)
29114 exception::throw_last_error(saved_ctx);
29115 return;
29118 void union_set::foreach_set(const std::function<void(isl::set)> &fn) const
29120 if (!ptr)
29121 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29122 auto saved_ctx = ctx();
29123 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29124 struct fn_data {
29125 std::function<void(isl::set)> func;
29126 std::exception_ptr eptr;
29127 } fn_data = { fn };
29128 auto fn_lambda = [](isl_set *arg_0, void *arg_1) -> isl_stat {
29129 auto *data = static_cast<struct fn_data *>(arg_1);
29130 ISL_CPP_TRY {
29131 (data->func)(manage(arg_0));
29132 return isl_stat_ok;
29133 } ISL_CPP_CATCH_ALL {
29134 data->eptr = std::current_exception();
29135 return isl_stat_error;
29138 auto res = isl_union_set_foreach_set(get(), fn_lambda, &fn_data);
29139 if (fn_data.eptr)
29140 std::rethrow_exception(fn_data.eptr);
29141 if (res < 0)
29142 exception::throw_last_error(saved_ctx);
29143 return;
29146 isl::union_set union_set::gist(isl::union_set context) const
29148 if (!ptr || context.is_null())
29149 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29150 auto saved_ctx = ctx();
29151 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29152 auto res = isl_union_set_gist(copy(), context.release());
29153 if (!res)
29154 exception::throw_last_error(saved_ctx);
29155 return manage(res);
29158 isl::union_set union_set::gist_params(isl::set set) const
29160 if (!ptr || set.is_null())
29161 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29162 auto saved_ctx = ctx();
29163 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29164 auto res = isl_union_set_gist_params(copy(), set.release());
29165 if (!res)
29166 exception::throw_last_error(saved_ctx);
29167 return manage(res);
29170 isl::union_map union_set::identity() const
29172 if (!ptr)
29173 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29174 auto saved_ctx = ctx();
29175 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29176 auto res = isl_union_set_identity(copy());
29177 if (!res)
29178 exception::throw_last_error(saved_ctx);
29179 return manage(res);
29182 isl::union_set union_set::intersect(isl::union_set uset2) const
29184 if (!ptr || uset2.is_null())
29185 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29186 auto saved_ctx = ctx();
29187 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29188 auto res = isl_union_set_intersect(copy(), uset2.release());
29189 if (!res)
29190 exception::throw_last_error(saved_ctx);
29191 return manage(res);
29194 isl::union_set union_set::intersect_params(isl::set set) const
29196 if (!ptr || set.is_null())
29197 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29198 auto saved_ctx = ctx();
29199 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29200 auto res = isl_union_set_intersect_params(copy(), set.release());
29201 if (!res)
29202 exception::throw_last_error(saved_ctx);
29203 return manage(res);
29206 bool union_set::is_disjoint(const isl::union_set &uset2) const
29208 if (!ptr || uset2.is_null())
29209 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29210 auto saved_ctx = ctx();
29211 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29212 auto res = isl_union_set_is_disjoint(get(), uset2.get());
29213 if (res < 0)
29214 exception::throw_last_error(saved_ctx);
29215 return res;
29218 bool union_set::is_empty() const
29220 if (!ptr)
29221 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29222 auto saved_ctx = ctx();
29223 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29224 auto res = isl_union_set_is_empty(get());
29225 if (res < 0)
29226 exception::throw_last_error(saved_ctx);
29227 return res;
29230 bool union_set::is_equal(const isl::union_set &uset2) const
29232 if (!ptr || uset2.is_null())
29233 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29234 auto saved_ctx = ctx();
29235 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29236 auto res = isl_union_set_is_equal(get(), uset2.get());
29237 if (res < 0)
29238 exception::throw_last_error(saved_ctx);
29239 return res;
29242 bool union_set::is_strict_subset(const isl::union_set &uset2) const
29244 if (!ptr || uset2.is_null())
29245 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29246 auto saved_ctx = ctx();
29247 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29248 auto res = isl_union_set_is_strict_subset(get(), uset2.get());
29249 if (res < 0)
29250 exception::throw_last_error(saved_ctx);
29251 return res;
29254 bool union_set::is_subset(const isl::union_set &uset2) const
29256 if (!ptr || uset2.is_null())
29257 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29258 auto saved_ctx = ctx();
29259 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29260 auto res = isl_union_set_is_subset(get(), uset2.get());
29261 if (res < 0)
29262 exception::throw_last_error(saved_ctx);
29263 return res;
29266 bool union_set::isa_set() const
29268 if (!ptr)
29269 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29270 auto saved_ctx = ctx();
29271 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29272 auto res = isl_union_set_isa_set(get());
29273 if (res < 0)
29274 exception::throw_last_error(saved_ctx);
29275 return res;
29278 isl::union_set union_set::lexmax() const
29280 if (!ptr)
29281 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29282 auto saved_ctx = ctx();
29283 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29284 auto res = isl_union_set_lexmax(copy());
29285 if (!res)
29286 exception::throw_last_error(saved_ctx);
29287 return manage(res);
29290 isl::union_set union_set::lexmin() const
29292 if (!ptr)
29293 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29294 auto saved_ctx = ctx();
29295 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29296 auto res = isl_union_set_lexmin(copy());
29297 if (!res)
29298 exception::throw_last_error(saved_ctx);
29299 return manage(res);
29302 isl::set union_set::params() const
29304 if (!ptr)
29305 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29306 auto saved_ctx = ctx();
29307 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29308 auto res = isl_union_set_params(copy());
29309 if (!res)
29310 exception::throw_last_error(saved_ctx);
29311 return manage(res);
29314 isl::union_set union_set::polyhedral_hull() const
29316 if (!ptr)
29317 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29318 auto saved_ctx = ctx();
29319 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29320 auto res = isl_union_set_polyhedral_hull(copy());
29321 if (!res)
29322 exception::throw_last_error(saved_ctx);
29323 return manage(res);
29326 isl::union_set union_set::preimage(isl::multi_aff ma) const
29328 if (!ptr || ma.is_null())
29329 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29330 auto saved_ctx = ctx();
29331 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29332 auto res = isl_union_set_preimage_multi_aff(copy(), ma.release());
29333 if (!res)
29334 exception::throw_last_error(saved_ctx);
29335 return manage(res);
29338 isl::union_set union_set::preimage(isl::pw_multi_aff pma) const
29340 if (!ptr || pma.is_null())
29341 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29342 auto saved_ctx = ctx();
29343 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29344 auto res = isl_union_set_preimage_pw_multi_aff(copy(), pma.release());
29345 if (!res)
29346 exception::throw_last_error(saved_ctx);
29347 return manage(res);
29350 isl::union_set union_set::preimage(isl::union_pw_multi_aff upma) const
29352 if (!ptr || upma.is_null())
29353 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29354 auto saved_ctx = ctx();
29355 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29356 auto res = isl_union_set_preimage_union_pw_multi_aff(copy(), upma.release());
29357 if (!res)
29358 exception::throw_last_error(saved_ctx);
29359 return manage(res);
29362 isl::union_set union_set::project_out_all_params() const
29364 if (!ptr)
29365 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29366 auto saved_ctx = ctx();
29367 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29368 auto res = isl_union_set_project_out_all_params(copy());
29369 if (!res)
29370 exception::throw_last_error(saved_ctx);
29371 return manage(res);
29374 isl::point union_set::sample_point() const
29376 if (!ptr)
29377 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29378 auto saved_ctx = ctx();
29379 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29380 auto res = isl_union_set_sample_point(copy());
29381 if (!res)
29382 exception::throw_last_error(saved_ctx);
29383 return manage(res);
29386 isl::set_list union_set::set_list() const
29388 if (!ptr)
29389 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29390 auto saved_ctx = ctx();
29391 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29392 auto res = isl_union_set_get_set_list(get());
29393 if (!res)
29394 exception::throw_last_error(saved_ctx);
29395 return manage(res);
29398 isl::set_list union_set::get_set_list() const
29400 return set_list();
29403 isl::space union_set::space() const
29405 if (!ptr)
29406 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29407 auto saved_ctx = ctx();
29408 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29409 auto res = isl_union_set_get_space(get());
29410 if (!res)
29411 exception::throw_last_error(saved_ctx);
29412 return manage(res);
29415 isl::space union_set::get_space() const
29417 return space();
29420 isl::union_set union_set::subtract(isl::union_set uset2) const
29422 if (!ptr || uset2.is_null())
29423 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29424 auto saved_ctx = ctx();
29425 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29426 auto res = isl_union_set_subtract(copy(), uset2.release());
29427 if (!res)
29428 exception::throw_last_error(saved_ctx);
29429 return manage(res);
29432 isl::union_set_list union_set::to_list() const
29434 if (!ptr)
29435 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29436 auto saved_ctx = ctx();
29437 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29438 auto res = isl_union_set_to_list(copy());
29439 if (!res)
29440 exception::throw_last_error(saved_ctx);
29441 return manage(res);
29444 isl::union_set union_set::unite(isl::union_set uset2) const
29446 if (!ptr || uset2.is_null())
29447 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29448 auto saved_ctx = ctx();
29449 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29450 auto res = isl_union_set_union(copy(), uset2.release());
29451 if (!res)
29452 exception::throw_last_error(saved_ctx);
29453 return manage(res);
29456 isl::union_set union_set::universe() const
29458 if (!ptr)
29459 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29460 auto saved_ctx = ctx();
29461 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29462 auto res = isl_union_set_universe(copy());
29463 if (!res)
29464 exception::throw_last_error(saved_ctx);
29465 return manage(res);
29468 isl::union_map union_set::unwrap() const
29470 if (!ptr)
29471 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29472 auto saved_ctx = ctx();
29473 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29474 auto res = isl_union_set_unwrap(copy());
29475 if (!res)
29476 exception::throw_last_error(saved_ctx);
29477 return manage(res);
29480 inline std::ostream &operator<<(std::ostream &os, const union_set &obj)
29482 if (!obj.get())
29483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29484 auto saved_ctx = isl_union_set_get_ctx(obj.get());
29485 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29486 char *str = isl_union_set_to_str(obj.get());
29487 if (!str)
29488 exception::throw_last_error(saved_ctx);
29489 os << str;
29490 free(str);
29491 return os;
29494 // implementations for isl::union_set_list
29495 union_set_list manage(__isl_take isl_union_set_list *ptr) {
29496 if (!ptr)
29497 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29498 return union_set_list(ptr);
29500 union_set_list manage_copy(__isl_keep isl_union_set_list *ptr) {
29501 if (!ptr)
29502 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29503 auto saved_ctx = isl_union_set_list_get_ctx(ptr);
29504 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29505 ptr = isl_union_set_list_copy(ptr);
29506 if (!ptr)
29507 exception::throw_last_error(saved_ctx);
29508 return union_set_list(ptr);
29511 union_set_list::union_set_list(__isl_take isl_union_set_list *ptr)
29512 : ptr(ptr) {}
29514 union_set_list::union_set_list()
29515 : ptr(nullptr) {}
29517 union_set_list::union_set_list(const union_set_list &obj)
29518 : ptr(nullptr)
29520 if (!obj.ptr)
29521 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29522 auto saved_ctx = isl_union_set_list_get_ctx(obj.ptr);
29523 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29524 ptr = obj.copy();
29525 if (!ptr)
29526 exception::throw_last_error(saved_ctx);
29529 union_set_list::union_set_list(isl::ctx ctx, int n)
29531 auto saved_ctx = ctx;
29532 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29533 auto res = isl_union_set_list_alloc(ctx.release(), n);
29534 if (!res)
29535 exception::throw_last_error(saved_ctx);
29536 ptr = res;
29539 union_set_list::union_set_list(isl::union_set el)
29541 if (el.is_null())
29542 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29543 auto saved_ctx = el.ctx();
29544 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29545 auto res = isl_union_set_list_from_union_set(el.release());
29546 if (!res)
29547 exception::throw_last_error(saved_ctx);
29548 ptr = res;
29551 union_set_list::union_set_list(isl::ctx ctx, const std::string &str)
29553 auto saved_ctx = ctx;
29554 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29555 auto res = isl_union_set_list_read_from_str(ctx.release(), str.c_str());
29556 if (!res)
29557 exception::throw_last_error(saved_ctx);
29558 ptr = res;
29561 union_set_list &union_set_list::operator=(union_set_list obj) {
29562 std::swap(this->ptr, obj.ptr);
29563 return *this;
29566 union_set_list::~union_set_list() {
29567 if (ptr)
29568 isl_union_set_list_free(ptr);
29571 __isl_give isl_union_set_list *union_set_list::copy() const & {
29572 return isl_union_set_list_copy(ptr);
29575 __isl_keep isl_union_set_list *union_set_list::get() const {
29576 return ptr;
29579 __isl_give isl_union_set_list *union_set_list::release() {
29580 isl_union_set_list *tmp = ptr;
29581 ptr = nullptr;
29582 return tmp;
29585 bool union_set_list::is_null() const {
29586 return ptr == nullptr;
29589 isl::ctx union_set_list::ctx() const {
29590 return isl::ctx(isl_union_set_list_get_ctx(ptr));
29593 isl::union_set_list union_set_list::add(isl::union_set el) const
29595 if (!ptr || el.is_null())
29596 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29597 auto saved_ctx = ctx();
29598 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29599 auto res = isl_union_set_list_add(copy(), el.release());
29600 if (!res)
29601 exception::throw_last_error(saved_ctx);
29602 return manage(res);
29605 isl::union_set union_set_list::at(int index) const
29607 if (!ptr)
29608 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29609 auto saved_ctx = ctx();
29610 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29611 auto res = isl_union_set_list_get_at(get(), index);
29612 if (!res)
29613 exception::throw_last_error(saved_ctx);
29614 return manage(res);
29617 isl::union_set union_set_list::get_at(int index) const
29619 return at(index);
29622 isl::union_set_list union_set_list::clear() const
29624 if (!ptr)
29625 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29626 auto saved_ctx = ctx();
29627 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29628 auto res = isl_union_set_list_clear(copy());
29629 if (!res)
29630 exception::throw_last_error(saved_ctx);
29631 return manage(res);
29634 isl::union_set_list union_set_list::concat(isl::union_set_list list2) const
29636 if (!ptr || list2.is_null())
29637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29638 auto saved_ctx = ctx();
29639 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29640 auto res = isl_union_set_list_concat(copy(), list2.release());
29641 if (!res)
29642 exception::throw_last_error(saved_ctx);
29643 return manage(res);
29646 isl::union_set_list union_set_list::drop(unsigned int first, unsigned int n) const
29648 if (!ptr)
29649 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29650 auto saved_ctx = ctx();
29651 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29652 auto res = isl_union_set_list_drop(copy(), first, n);
29653 if (!res)
29654 exception::throw_last_error(saved_ctx);
29655 return manage(res);
29658 void union_set_list::foreach(const std::function<void(isl::union_set)> &fn) const
29660 if (!ptr)
29661 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29662 auto saved_ctx = ctx();
29663 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29664 struct fn_data {
29665 std::function<void(isl::union_set)> func;
29666 std::exception_ptr eptr;
29667 } fn_data = { fn };
29668 auto fn_lambda = [](isl_union_set *arg_0, void *arg_1) -> isl_stat {
29669 auto *data = static_cast<struct fn_data *>(arg_1);
29670 ISL_CPP_TRY {
29671 (data->func)(manage(arg_0));
29672 return isl_stat_ok;
29673 } ISL_CPP_CATCH_ALL {
29674 data->eptr = std::current_exception();
29675 return isl_stat_error;
29678 auto res = isl_union_set_list_foreach(get(), fn_lambda, &fn_data);
29679 if (fn_data.eptr)
29680 std::rethrow_exception(fn_data.eptr);
29681 if (res < 0)
29682 exception::throw_last_error(saved_ctx);
29683 return;
29686 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
29688 if (!ptr)
29689 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29690 auto saved_ctx = ctx();
29691 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29692 struct follows_data {
29693 std::function<bool(isl::union_set, isl::union_set)> func;
29694 std::exception_ptr eptr;
29695 } follows_data = { follows };
29696 auto follows_lambda = [](isl_union_set *arg_0, isl_union_set *arg_1, void *arg_2) -> isl_bool {
29697 auto *data = static_cast<struct follows_data *>(arg_2);
29698 ISL_CPP_TRY {
29699 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
29700 return ret ? isl_bool_true : isl_bool_false;
29701 } ISL_CPP_CATCH_ALL {
29702 data->eptr = std::current_exception();
29703 return isl_bool_error;
29706 struct fn_data {
29707 std::function<void(isl::union_set_list)> func;
29708 std::exception_ptr eptr;
29709 } fn_data = { fn };
29710 auto fn_lambda = [](isl_union_set_list *arg_0, void *arg_1) -> isl_stat {
29711 auto *data = static_cast<struct fn_data *>(arg_1);
29712 ISL_CPP_TRY {
29713 (data->func)(manage(arg_0));
29714 return isl_stat_ok;
29715 } ISL_CPP_CATCH_ALL {
29716 data->eptr = std::current_exception();
29717 return isl_stat_error;
29720 auto res = isl_union_set_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
29721 if (follows_data.eptr)
29722 std::rethrow_exception(follows_data.eptr);
29723 if (fn_data.eptr)
29724 std::rethrow_exception(fn_data.eptr);
29725 if (res < 0)
29726 exception::throw_last_error(saved_ctx);
29727 return;
29730 isl::union_set_list union_set_list::insert(unsigned int pos, isl::union_set el) const
29732 if (!ptr || el.is_null())
29733 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29734 auto saved_ctx = ctx();
29735 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29736 auto res = isl_union_set_list_insert(copy(), pos, el.release());
29737 if (!res)
29738 exception::throw_last_error(saved_ctx);
29739 return manage(res);
29742 isl::union_set_list union_set_list::set_at(int index, isl::union_set el) const
29744 if (!ptr || el.is_null())
29745 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29746 auto saved_ctx = ctx();
29747 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29748 auto res = isl_union_set_list_set_at(copy(), index, el.release());
29749 if (!res)
29750 exception::throw_last_error(saved_ctx);
29751 return manage(res);
29754 unsigned union_set_list::size() const
29756 if (!ptr)
29757 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29758 auto saved_ctx = ctx();
29759 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29760 auto res = isl_union_set_list_size(get());
29761 if (res < 0)
29762 exception::throw_last_error(saved_ctx);
29763 return res;
29766 inline std::ostream &operator<<(std::ostream &os, const union_set_list &obj)
29768 if (!obj.get())
29769 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29770 auto saved_ctx = isl_union_set_list_get_ctx(obj.get());
29771 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29772 char *str = isl_union_set_list_to_str(obj.get());
29773 if (!str)
29774 exception::throw_last_error(saved_ctx);
29775 os << str;
29776 free(str);
29777 return os;
29780 // implementations for isl::val
29781 val manage(__isl_take isl_val *ptr) {
29782 if (!ptr)
29783 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29784 return val(ptr);
29786 val manage_copy(__isl_keep isl_val *ptr) {
29787 if (!ptr)
29788 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29789 auto saved_ctx = isl_val_get_ctx(ptr);
29790 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29791 ptr = isl_val_copy(ptr);
29792 if (!ptr)
29793 exception::throw_last_error(saved_ctx);
29794 return val(ptr);
29797 val::val(__isl_take isl_val *ptr)
29798 : ptr(ptr) {}
29800 val::val()
29801 : ptr(nullptr) {}
29803 val::val(const val &obj)
29804 : ptr(nullptr)
29806 if (!obj.ptr)
29807 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29808 auto saved_ctx = isl_val_get_ctx(obj.ptr);
29809 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29810 ptr = obj.copy();
29811 if (!ptr)
29812 exception::throw_last_error(saved_ctx);
29815 val::val(isl::ctx ctx, long i)
29817 auto saved_ctx = ctx;
29818 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29819 auto res = isl_val_int_from_si(ctx.release(), i);
29820 if (!res)
29821 exception::throw_last_error(saved_ctx);
29822 ptr = res;
29825 val::val(isl::ctx ctx, const std::string &str)
29827 auto saved_ctx = ctx;
29828 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29829 auto res = isl_val_read_from_str(ctx.release(), str.c_str());
29830 if (!res)
29831 exception::throw_last_error(saved_ctx);
29832 ptr = res;
29835 val &val::operator=(val obj) {
29836 std::swap(this->ptr, obj.ptr);
29837 return *this;
29840 val::~val() {
29841 if (ptr)
29842 isl_val_free(ptr);
29845 __isl_give isl_val *val::copy() const & {
29846 return isl_val_copy(ptr);
29849 __isl_keep isl_val *val::get() const {
29850 return ptr;
29853 __isl_give isl_val *val::release() {
29854 isl_val *tmp = ptr;
29855 ptr = nullptr;
29856 return tmp;
29859 bool val::is_null() const {
29860 return ptr == nullptr;
29863 isl::ctx val::ctx() const {
29864 return isl::ctx(isl_val_get_ctx(ptr));
29867 isl::val val::abs() const
29869 if (!ptr)
29870 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29871 auto saved_ctx = ctx();
29872 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29873 auto res = isl_val_abs(copy());
29874 if (!res)
29875 exception::throw_last_error(saved_ctx);
29876 return manage(res);
29879 bool val::abs_eq(const isl::val &v2) const
29881 if (!ptr || v2.is_null())
29882 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29883 auto saved_ctx = ctx();
29884 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29885 auto res = isl_val_abs_eq(get(), v2.get());
29886 if (res < 0)
29887 exception::throw_last_error(saved_ctx);
29888 return res;
29891 bool val::abs_eq(long v2) const
29893 if (!ptr)
29894 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29895 return this->abs_eq(isl::val(ctx(), v2));
29898 isl::val val::add(isl::val v2) const
29900 if (!ptr || v2.is_null())
29901 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29902 auto saved_ctx = ctx();
29903 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29904 auto res = isl_val_add(copy(), v2.release());
29905 if (!res)
29906 exception::throw_last_error(saved_ctx);
29907 return manage(res);
29910 isl::val val::add(long v2) const
29912 if (!ptr)
29913 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29914 return this->add(isl::val(ctx(), v2));
29917 isl::val val::ceil() const
29919 if (!ptr)
29920 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29921 auto saved_ctx = ctx();
29922 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29923 auto res = isl_val_ceil(copy());
29924 if (!res)
29925 exception::throw_last_error(saved_ctx);
29926 return manage(res);
29929 int val::cmp_si(long i) const
29931 if (!ptr)
29932 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29933 auto saved_ctx = ctx();
29934 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29935 auto res = isl_val_cmp_si(get(), i);
29936 return res;
29939 long val::den_si() const
29941 if (!ptr)
29942 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29943 auto saved_ctx = ctx();
29944 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29945 auto res = isl_val_get_den_si(get());
29946 return res;
29949 long val::get_den_si() const
29951 return den_si();
29954 isl::val val::div(isl::val v2) const
29956 if (!ptr || v2.is_null())
29957 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29958 auto saved_ctx = ctx();
29959 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29960 auto res = isl_val_div(copy(), v2.release());
29961 if (!res)
29962 exception::throw_last_error(saved_ctx);
29963 return manage(res);
29966 isl::val val::div(long v2) const
29968 if (!ptr)
29969 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29970 return this->div(isl::val(ctx(), v2));
29973 bool val::eq(const isl::val &v2) const
29975 if (!ptr || v2.is_null())
29976 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29977 auto saved_ctx = ctx();
29978 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29979 auto res = isl_val_eq(get(), v2.get());
29980 if (res < 0)
29981 exception::throw_last_error(saved_ctx);
29982 return res;
29985 bool val::eq(long v2) const
29987 if (!ptr)
29988 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29989 return this->eq(isl::val(ctx(), v2));
29992 isl::val val::floor() const
29994 if (!ptr)
29995 exception::throw_invalid("NULL input", __FILE__, __LINE__);
29996 auto saved_ctx = ctx();
29997 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
29998 auto res = isl_val_floor(copy());
29999 if (!res)
30000 exception::throw_last_error(saved_ctx);
30001 return manage(res);
30004 isl::val val::gcd(isl::val v2) const
30006 if (!ptr || v2.is_null())
30007 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30008 auto saved_ctx = ctx();
30009 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30010 auto res = isl_val_gcd(copy(), v2.release());
30011 if (!res)
30012 exception::throw_last_error(saved_ctx);
30013 return manage(res);
30016 isl::val val::gcd(long v2) const
30018 if (!ptr)
30019 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30020 return this->gcd(isl::val(ctx(), v2));
30023 bool val::ge(const isl::val &v2) const
30025 if (!ptr || v2.is_null())
30026 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30027 auto saved_ctx = ctx();
30028 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30029 auto res = isl_val_ge(get(), v2.get());
30030 if (res < 0)
30031 exception::throw_last_error(saved_ctx);
30032 return res;
30035 bool val::ge(long v2) const
30037 if (!ptr)
30038 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30039 return this->ge(isl::val(ctx(), v2));
30042 bool val::gt(const isl::val &v2) const
30044 if (!ptr || v2.is_null())
30045 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30046 auto saved_ctx = ctx();
30047 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30048 auto res = isl_val_gt(get(), v2.get());
30049 if (res < 0)
30050 exception::throw_last_error(saved_ctx);
30051 return res;
30054 bool val::gt(long v2) const
30056 if (!ptr)
30057 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30058 return this->gt(isl::val(ctx(), v2));
30061 isl::val val::infty(isl::ctx ctx)
30063 auto saved_ctx = ctx;
30064 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30065 auto res = isl_val_infty(ctx.release());
30066 if (!res)
30067 exception::throw_last_error(saved_ctx);
30068 return manage(res);
30071 isl::val val::inv() const
30073 if (!ptr)
30074 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30075 auto saved_ctx = ctx();
30076 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30077 auto res = isl_val_inv(copy());
30078 if (!res)
30079 exception::throw_last_error(saved_ctx);
30080 return manage(res);
30083 bool val::is_divisible_by(const isl::val &v2) const
30085 if (!ptr || v2.is_null())
30086 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30087 auto saved_ctx = ctx();
30088 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30089 auto res = isl_val_is_divisible_by(get(), v2.get());
30090 if (res < 0)
30091 exception::throw_last_error(saved_ctx);
30092 return res;
30095 bool val::is_divisible_by(long v2) const
30097 if (!ptr)
30098 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30099 return this->is_divisible_by(isl::val(ctx(), v2));
30102 bool val::is_infty() const
30104 if (!ptr)
30105 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30106 auto saved_ctx = ctx();
30107 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30108 auto res = isl_val_is_infty(get());
30109 if (res < 0)
30110 exception::throw_last_error(saved_ctx);
30111 return res;
30114 bool val::is_int() const
30116 if (!ptr)
30117 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30118 auto saved_ctx = ctx();
30119 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30120 auto res = isl_val_is_int(get());
30121 if (res < 0)
30122 exception::throw_last_error(saved_ctx);
30123 return res;
30126 bool val::is_nan() const
30128 if (!ptr)
30129 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30130 auto saved_ctx = ctx();
30131 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30132 auto res = isl_val_is_nan(get());
30133 if (res < 0)
30134 exception::throw_last_error(saved_ctx);
30135 return res;
30138 bool val::is_neg() const
30140 if (!ptr)
30141 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30142 auto saved_ctx = ctx();
30143 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30144 auto res = isl_val_is_neg(get());
30145 if (res < 0)
30146 exception::throw_last_error(saved_ctx);
30147 return res;
30150 bool val::is_neginfty() const
30152 if (!ptr)
30153 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30154 auto saved_ctx = ctx();
30155 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30156 auto res = isl_val_is_neginfty(get());
30157 if (res < 0)
30158 exception::throw_last_error(saved_ctx);
30159 return res;
30162 bool val::is_negone() const
30164 if (!ptr)
30165 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30166 auto saved_ctx = ctx();
30167 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30168 auto res = isl_val_is_negone(get());
30169 if (res < 0)
30170 exception::throw_last_error(saved_ctx);
30171 return res;
30174 bool val::is_nonneg() const
30176 if (!ptr)
30177 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30178 auto saved_ctx = ctx();
30179 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30180 auto res = isl_val_is_nonneg(get());
30181 if (res < 0)
30182 exception::throw_last_error(saved_ctx);
30183 return res;
30186 bool val::is_nonpos() const
30188 if (!ptr)
30189 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30190 auto saved_ctx = ctx();
30191 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30192 auto res = isl_val_is_nonpos(get());
30193 if (res < 0)
30194 exception::throw_last_error(saved_ctx);
30195 return res;
30198 bool val::is_one() const
30200 if (!ptr)
30201 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30202 auto saved_ctx = ctx();
30203 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30204 auto res = isl_val_is_one(get());
30205 if (res < 0)
30206 exception::throw_last_error(saved_ctx);
30207 return res;
30210 bool val::is_pos() const
30212 if (!ptr)
30213 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30214 auto saved_ctx = ctx();
30215 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30216 auto res = isl_val_is_pos(get());
30217 if (res < 0)
30218 exception::throw_last_error(saved_ctx);
30219 return res;
30222 bool val::is_rat() const
30224 if (!ptr)
30225 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30226 auto saved_ctx = ctx();
30227 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30228 auto res = isl_val_is_rat(get());
30229 if (res < 0)
30230 exception::throw_last_error(saved_ctx);
30231 return res;
30234 bool val::is_zero() const
30236 if (!ptr)
30237 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30238 auto saved_ctx = ctx();
30239 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30240 auto res = isl_val_is_zero(get());
30241 if (res < 0)
30242 exception::throw_last_error(saved_ctx);
30243 return res;
30246 bool val::le(const isl::val &v2) const
30248 if (!ptr || v2.is_null())
30249 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30250 auto saved_ctx = ctx();
30251 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30252 auto res = isl_val_le(get(), v2.get());
30253 if (res < 0)
30254 exception::throw_last_error(saved_ctx);
30255 return res;
30258 bool val::le(long v2) const
30260 if (!ptr)
30261 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30262 return this->le(isl::val(ctx(), v2));
30265 bool val::lt(const isl::val &v2) const
30267 if (!ptr || v2.is_null())
30268 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30269 auto saved_ctx = ctx();
30270 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30271 auto res = isl_val_lt(get(), v2.get());
30272 if (res < 0)
30273 exception::throw_last_error(saved_ctx);
30274 return res;
30277 bool val::lt(long v2) const
30279 if (!ptr)
30280 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30281 return this->lt(isl::val(ctx(), v2));
30284 isl::val val::max(isl::val v2) const
30286 if (!ptr || v2.is_null())
30287 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30288 auto saved_ctx = ctx();
30289 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30290 auto res = isl_val_max(copy(), v2.release());
30291 if (!res)
30292 exception::throw_last_error(saved_ctx);
30293 return manage(res);
30296 isl::val val::max(long v2) const
30298 if (!ptr)
30299 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30300 return this->max(isl::val(ctx(), v2));
30303 isl::val val::min(isl::val v2) const
30305 if (!ptr || v2.is_null())
30306 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30307 auto saved_ctx = ctx();
30308 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30309 auto res = isl_val_min(copy(), v2.release());
30310 if (!res)
30311 exception::throw_last_error(saved_ctx);
30312 return manage(res);
30315 isl::val val::min(long v2) const
30317 if (!ptr)
30318 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30319 return this->min(isl::val(ctx(), v2));
30322 isl::val val::mod(isl::val v2) const
30324 if (!ptr || v2.is_null())
30325 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30326 auto saved_ctx = ctx();
30327 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30328 auto res = isl_val_mod(copy(), v2.release());
30329 if (!res)
30330 exception::throw_last_error(saved_ctx);
30331 return manage(res);
30334 isl::val val::mod(long v2) const
30336 if (!ptr)
30337 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30338 return this->mod(isl::val(ctx(), v2));
30341 isl::val val::mul(isl::val v2) const
30343 if (!ptr || v2.is_null())
30344 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30345 auto saved_ctx = ctx();
30346 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30347 auto res = isl_val_mul(copy(), v2.release());
30348 if (!res)
30349 exception::throw_last_error(saved_ctx);
30350 return manage(res);
30353 isl::val val::mul(long v2) const
30355 if (!ptr)
30356 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30357 return this->mul(isl::val(ctx(), v2));
30360 isl::val val::nan(isl::ctx ctx)
30362 auto saved_ctx = ctx;
30363 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30364 auto res = isl_val_nan(ctx.release());
30365 if (!res)
30366 exception::throw_last_error(saved_ctx);
30367 return manage(res);
30370 bool val::ne(const isl::val &v2) const
30372 if (!ptr || v2.is_null())
30373 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30374 auto saved_ctx = ctx();
30375 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30376 auto res = isl_val_ne(get(), v2.get());
30377 if (res < 0)
30378 exception::throw_last_error(saved_ctx);
30379 return res;
30382 bool val::ne(long v2) const
30384 if (!ptr)
30385 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30386 return this->ne(isl::val(ctx(), v2));
30389 isl::val val::neg() const
30391 if (!ptr)
30392 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30393 auto saved_ctx = ctx();
30394 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30395 auto res = isl_val_neg(copy());
30396 if (!res)
30397 exception::throw_last_error(saved_ctx);
30398 return manage(res);
30401 isl::val val::neginfty(isl::ctx ctx)
30403 auto saved_ctx = ctx;
30404 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30405 auto res = isl_val_neginfty(ctx.release());
30406 if (!res)
30407 exception::throw_last_error(saved_ctx);
30408 return manage(res);
30411 isl::val val::negone(isl::ctx ctx)
30413 auto saved_ctx = ctx;
30414 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30415 auto res = isl_val_negone(ctx.release());
30416 if (!res)
30417 exception::throw_last_error(saved_ctx);
30418 return manage(res);
30421 long val::num_si() const
30423 if (!ptr)
30424 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30425 auto saved_ctx = ctx();
30426 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30427 auto res = isl_val_get_num_si(get());
30428 return res;
30431 long val::get_num_si() const
30433 return num_si();
30436 isl::val val::one(isl::ctx ctx)
30438 auto saved_ctx = ctx;
30439 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30440 auto res = isl_val_one(ctx.release());
30441 if (!res)
30442 exception::throw_last_error(saved_ctx);
30443 return manage(res);
30446 isl::val val::pow2() const
30448 if (!ptr)
30449 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30450 auto saved_ctx = ctx();
30451 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30452 auto res = isl_val_pow2(copy());
30453 if (!res)
30454 exception::throw_last_error(saved_ctx);
30455 return manage(res);
30458 int val::sgn() const
30460 if (!ptr)
30461 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30462 auto saved_ctx = ctx();
30463 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30464 auto res = isl_val_sgn(get());
30465 return res;
30468 isl::val val::sub(isl::val v2) const
30470 if (!ptr || v2.is_null())
30471 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30472 auto saved_ctx = ctx();
30473 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30474 auto res = isl_val_sub(copy(), v2.release());
30475 if (!res)
30476 exception::throw_last_error(saved_ctx);
30477 return manage(res);
30480 isl::val val::sub(long v2) const
30482 if (!ptr)
30483 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30484 return this->sub(isl::val(ctx(), v2));
30487 isl::val_list val::to_list() const
30489 if (!ptr)
30490 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30491 auto saved_ctx = ctx();
30492 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30493 auto res = isl_val_to_list(copy());
30494 if (!res)
30495 exception::throw_last_error(saved_ctx);
30496 return manage(res);
30499 isl::val val::trunc() const
30501 if (!ptr)
30502 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30503 auto saved_ctx = ctx();
30504 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30505 auto res = isl_val_trunc(copy());
30506 if (!res)
30507 exception::throw_last_error(saved_ctx);
30508 return manage(res);
30511 isl::val val::zero(isl::ctx ctx)
30513 auto saved_ctx = ctx;
30514 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30515 auto res = isl_val_zero(ctx.release());
30516 if (!res)
30517 exception::throw_last_error(saved_ctx);
30518 return manage(res);
30521 inline std::ostream &operator<<(std::ostream &os, const val &obj)
30523 if (!obj.get())
30524 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30525 auto saved_ctx = isl_val_get_ctx(obj.get());
30526 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30527 char *str = isl_val_to_str(obj.get());
30528 if (!str)
30529 exception::throw_last_error(saved_ctx);
30530 os << str;
30531 free(str);
30532 return os;
30535 // implementations for isl::val_list
30536 val_list manage(__isl_take isl_val_list *ptr) {
30537 if (!ptr)
30538 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30539 return val_list(ptr);
30541 val_list manage_copy(__isl_keep isl_val_list *ptr) {
30542 if (!ptr)
30543 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30544 auto saved_ctx = isl_val_list_get_ctx(ptr);
30545 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30546 ptr = isl_val_list_copy(ptr);
30547 if (!ptr)
30548 exception::throw_last_error(saved_ctx);
30549 return val_list(ptr);
30552 val_list::val_list(__isl_take isl_val_list *ptr)
30553 : ptr(ptr) {}
30555 val_list::val_list()
30556 : ptr(nullptr) {}
30558 val_list::val_list(const val_list &obj)
30559 : ptr(nullptr)
30561 if (!obj.ptr)
30562 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30563 auto saved_ctx = isl_val_list_get_ctx(obj.ptr);
30564 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30565 ptr = obj.copy();
30566 if (!ptr)
30567 exception::throw_last_error(saved_ctx);
30570 val_list::val_list(isl::ctx ctx, int n)
30572 auto saved_ctx = ctx;
30573 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30574 auto res = isl_val_list_alloc(ctx.release(), n);
30575 if (!res)
30576 exception::throw_last_error(saved_ctx);
30577 ptr = res;
30580 val_list::val_list(isl::val el)
30582 if (el.is_null())
30583 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30584 auto saved_ctx = el.ctx();
30585 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30586 auto res = isl_val_list_from_val(el.release());
30587 if (!res)
30588 exception::throw_last_error(saved_ctx);
30589 ptr = res;
30592 val_list::val_list(isl::ctx ctx, const std::string &str)
30594 auto saved_ctx = ctx;
30595 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30596 auto res = isl_val_list_read_from_str(ctx.release(), str.c_str());
30597 if (!res)
30598 exception::throw_last_error(saved_ctx);
30599 ptr = res;
30602 val_list &val_list::operator=(val_list obj) {
30603 std::swap(this->ptr, obj.ptr);
30604 return *this;
30607 val_list::~val_list() {
30608 if (ptr)
30609 isl_val_list_free(ptr);
30612 __isl_give isl_val_list *val_list::copy() const & {
30613 return isl_val_list_copy(ptr);
30616 __isl_keep isl_val_list *val_list::get() const {
30617 return ptr;
30620 __isl_give isl_val_list *val_list::release() {
30621 isl_val_list *tmp = ptr;
30622 ptr = nullptr;
30623 return tmp;
30626 bool val_list::is_null() const {
30627 return ptr == nullptr;
30630 isl::ctx val_list::ctx() const {
30631 return isl::ctx(isl_val_list_get_ctx(ptr));
30634 isl::val_list val_list::add(isl::val el) const
30636 if (!ptr || el.is_null())
30637 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30638 auto saved_ctx = ctx();
30639 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30640 auto res = isl_val_list_add(copy(), el.release());
30641 if (!res)
30642 exception::throw_last_error(saved_ctx);
30643 return manage(res);
30646 isl::val_list val_list::add(long el) const
30648 if (!ptr)
30649 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30650 return this->add(isl::val(ctx(), el));
30653 isl::val val_list::at(int index) const
30655 if (!ptr)
30656 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30657 auto saved_ctx = ctx();
30658 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30659 auto res = isl_val_list_get_at(get(), index);
30660 if (!res)
30661 exception::throw_last_error(saved_ctx);
30662 return manage(res);
30665 isl::val val_list::get_at(int index) const
30667 return at(index);
30670 isl::val_list val_list::clear() const
30672 if (!ptr)
30673 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30674 auto saved_ctx = ctx();
30675 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30676 auto res = isl_val_list_clear(copy());
30677 if (!res)
30678 exception::throw_last_error(saved_ctx);
30679 return manage(res);
30682 isl::val_list val_list::concat(isl::val_list list2) const
30684 if (!ptr || list2.is_null())
30685 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30686 auto saved_ctx = ctx();
30687 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30688 auto res = isl_val_list_concat(copy(), list2.release());
30689 if (!res)
30690 exception::throw_last_error(saved_ctx);
30691 return manage(res);
30694 isl::val_list val_list::drop(unsigned int first, unsigned int n) const
30696 if (!ptr)
30697 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30698 auto saved_ctx = ctx();
30699 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30700 auto res = isl_val_list_drop(copy(), first, n);
30701 if (!res)
30702 exception::throw_last_error(saved_ctx);
30703 return manage(res);
30706 void val_list::foreach(const std::function<void(isl::val)> &fn) const
30708 if (!ptr)
30709 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30710 auto saved_ctx = ctx();
30711 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30712 struct fn_data {
30713 std::function<void(isl::val)> func;
30714 std::exception_ptr eptr;
30715 } fn_data = { fn };
30716 auto fn_lambda = [](isl_val *arg_0, void *arg_1) -> isl_stat {
30717 auto *data = static_cast<struct fn_data *>(arg_1);
30718 ISL_CPP_TRY {
30719 (data->func)(manage(arg_0));
30720 return isl_stat_ok;
30721 } ISL_CPP_CATCH_ALL {
30722 data->eptr = std::current_exception();
30723 return isl_stat_error;
30726 auto res = isl_val_list_foreach(get(), fn_lambda, &fn_data);
30727 if (fn_data.eptr)
30728 std::rethrow_exception(fn_data.eptr);
30729 if (res < 0)
30730 exception::throw_last_error(saved_ctx);
30731 return;
30734 void val_list::foreach_scc(const std::function<bool(isl::val, isl::val)> &follows, const std::function<void(isl::val_list)> &fn) const
30736 if (!ptr)
30737 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30738 auto saved_ctx = ctx();
30739 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30740 struct follows_data {
30741 std::function<bool(isl::val, isl::val)> func;
30742 std::exception_ptr eptr;
30743 } follows_data = { follows };
30744 auto follows_lambda = [](isl_val *arg_0, isl_val *arg_1, void *arg_2) -> isl_bool {
30745 auto *data = static_cast<struct follows_data *>(arg_2);
30746 ISL_CPP_TRY {
30747 auto ret = (data->func)(manage_copy(arg_0), manage_copy(arg_1));
30748 return ret ? isl_bool_true : isl_bool_false;
30749 } ISL_CPP_CATCH_ALL {
30750 data->eptr = std::current_exception();
30751 return isl_bool_error;
30754 struct fn_data {
30755 std::function<void(isl::val_list)> func;
30756 std::exception_ptr eptr;
30757 } fn_data = { fn };
30758 auto fn_lambda = [](isl_val_list *arg_0, void *arg_1) -> isl_stat {
30759 auto *data = static_cast<struct fn_data *>(arg_1);
30760 ISL_CPP_TRY {
30761 (data->func)(manage(arg_0));
30762 return isl_stat_ok;
30763 } ISL_CPP_CATCH_ALL {
30764 data->eptr = std::current_exception();
30765 return isl_stat_error;
30768 auto res = isl_val_list_foreach_scc(get(), follows_lambda, &follows_data, fn_lambda, &fn_data);
30769 if (follows_data.eptr)
30770 std::rethrow_exception(follows_data.eptr);
30771 if (fn_data.eptr)
30772 std::rethrow_exception(fn_data.eptr);
30773 if (res < 0)
30774 exception::throw_last_error(saved_ctx);
30775 return;
30778 isl::val_list val_list::insert(unsigned int pos, isl::val el) const
30780 if (!ptr || el.is_null())
30781 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30782 auto saved_ctx = ctx();
30783 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30784 auto res = isl_val_list_insert(copy(), pos, el.release());
30785 if (!res)
30786 exception::throw_last_error(saved_ctx);
30787 return manage(res);
30790 isl::val_list val_list::insert(unsigned int pos, long el) const
30792 if (!ptr)
30793 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30794 return this->insert(pos, isl::val(ctx(), el));
30797 isl::val_list val_list::set_at(int index, isl::val el) const
30799 if (!ptr || el.is_null())
30800 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30801 auto saved_ctx = ctx();
30802 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30803 auto res = isl_val_list_set_at(copy(), index, el.release());
30804 if (!res)
30805 exception::throw_last_error(saved_ctx);
30806 return manage(res);
30809 isl::val_list val_list::set_at(int index, long el) const
30811 if (!ptr)
30812 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30813 return this->set_at(index, isl::val(ctx(), el));
30816 unsigned val_list::size() const
30818 if (!ptr)
30819 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30820 auto saved_ctx = ctx();
30821 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30822 auto res = isl_val_list_size(get());
30823 if (res < 0)
30824 exception::throw_last_error(saved_ctx);
30825 return res;
30828 inline std::ostream &operator<<(std::ostream &os, const val_list &obj)
30830 if (!obj.get())
30831 exception::throw_invalid("NULL input", __FILE__, __LINE__);
30832 auto saved_ctx = isl_val_list_get_ctx(obj.get());
30833 options_scoped_set_on_error saved_on_error(saved_ctx, exception::on_error);
30834 char *str = isl_val_list_to_str(obj.get());
30835 if (!str)
30836 exception::throw_last_error(saved_ctx);
30837 os << str;
30838 free(str);
30839 return os;
30841 } // namespace isl
30843 #endif /* ISL_CPP */