xref: /netbsd-src/external/mit/isl/dist/include/isl/cpp.h (revision 5971e316fdea024efff6be8f03536623db06833e)
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.
7 
8 #ifndef ISL_CPP
9 #define ISL_CPP
10 
11 #include <isl/ctx.h>
12 #include <isl/options.h>
13 
14 #include <functional>
15 #include <memory>
16 #include <ostream>
17 #include <stdexcept>
18 #include <string>
19 #include <type_traits>
20 
21 #if __cplusplus >= 201703L
22 #include <any>
23 #include <optional>
24 #endif
25 
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.
31  */
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
39 
40 namespace isl {
41 
42 class ctx {
43 	isl_ctx *ptr;
44 public:
ctx(isl_ctx * ctx)45 	/* implicit */ ctx(isl_ctx *ctx) : ptr(ctx) {}
release()46 	isl_ctx *release() {
47 		auto tmp = ptr;
48 		ptr = nullptr;
49 		return tmp;
50 	}
get()51 	isl_ctx *get() {
52 		return ptr;
53 	}
54 #if __cplusplus >= 201703L
free_user(void * user)55 	static void free_user(void *user) {
56 		std::any *p = static_cast<std::any *>(user);
57 		delete p;
58 	}
59 #endif
60 };
61 
62 /* Macros hiding try/catch.
63  * If exceptions are not available, then no exceptions will be thrown and
64  * there is nothing to catch.
65  */
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
73 
74 #if ISL_USE_EXCEPTIONS
75 
76 /* Class capturing isl errors.
77  *
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.
81  */
82 class exception : public std::exception {
83 	std::shared_ptr<std::string> what_str;
84 
85 protected:
86 	inline exception(const char *what_arg, const char *msg,
87 		const char *file, int line);
88 public:
exception()89 	exception() {}
exception(const char * what_arg)90 	exception(const char *what_arg) {
91 		what_str = std::make_shared<std::string>(what_arg);
92 	}
93 	static inline void throw_error(enum isl_error error, const char *msg,
94 		const char *file, int line);
what()95 	virtual const char *what() const noexcept {
96 		return what_str->c_str();
97 	}
98 
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.
104 	 */
105 	static constexpr auto on_error = ISL_ON_ERROR_CONTINUE;
106 	/* Wrapper for throwing an exception with the given message.
107 	 */
throw_invalid(const char * msg,const char * file,int line)108 	static void throw_invalid(const char *msg, const char *file, int line) {
109 		throw_error(isl_error_invalid, msg, file, line);
110 	}
111 	static inline void throw_last_error(ctx ctx);
112 };
113 
114 /* Create an exception of a type described by "what_arg", with
115  * error message "msg" in line "line" of file "file".
116  *
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.
120  */
exception(const char * what_arg,const char * msg,const char * file,int line)121 exception::exception(const char *what_arg, const char *msg, const char *file,
122 	int line)
123 {
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);
129 }
130 
131 class exception_abort : public exception {
132 	friend exception;
exception_abort(const char * msg,const char * file,int line)133 	exception_abort(const char *msg, const char *file, int line) :
134 		exception("execution aborted", msg, file, line) {}
135 };
136 
137 class exception_alloc : public exception {
138 	friend exception;
exception_alloc(const char * msg,const char * file,int line)139 	exception_alloc(const char *msg, const char *file, int line) :
140 		exception("memory allocation failure", msg, file, line) {}
141 };
142 
143 class exception_unknown : public exception {
144 	friend exception;
exception_unknown(const char * msg,const char * file,int line)145 	exception_unknown(const char *msg, const char *file, int line) :
146 		exception("unknown failure", msg, file, line) {}
147 };
148 
149 class exception_internal : public exception {
150 	friend exception;
exception_internal(const char * msg,const char * file,int line)151 	exception_internal(const char *msg, const char *file, int line) :
152 		exception("internal error", msg, file, line) {}
153 };
154 
155 class exception_invalid : public exception {
156 	friend exception;
exception_invalid(const char * msg,const char * file,int line)157 	exception_invalid(const char *msg, const char *file, int line) :
158 		exception("invalid argument", msg, file, line) {}
159 };
160 
161 class exception_quota : public exception {
162 	friend exception;
exception_quota(const char * msg,const char * file,int line)163 	exception_quota(const char *msg, const char *file, int line) :
164 		exception("quota exceeded", msg, file, line) {}
165 };
166 
167 class exception_unsupported : public exception {
168 	friend exception;
exception_unsupported(const char * msg,const char * file,int line)169 	exception_unsupported(const char *msg, const char *file, int line) :
170 		exception("unsupported operation", msg, file, line) {}
171 };
172 
173 /* Throw an exception of the class that corresponds to "error", with
174  * error message "msg" in line "line" of file "file".
175  *
176  * isl_error_none is treated as an invalid error type.
177  */
throw_error(enum isl_error error,const char * msg,const char * file,int line)178 void exception::throw_error(enum isl_error error, const char *msg,
179 	const char *file, int line)
180 {
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);
192 	}
193 
194 	throw exception_invalid("invalid error type", file, line);
195 }
196 
197 /* Throw an exception corresponding to the last error on "ctx" and
198  * reset the error.
199  *
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.
202  */
throw_last_error(ctx ctx)203 void exception::throw_last_error(ctx ctx)
204 {
205 	enum isl_error error;
206 	const char *msg, *file;
207 	int line;
208 
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());
214 
215 	throw_error(error, msg, file, line);
216 }
217 
218 #else
219 
220 #include <stdio.h>
221 #include <stdlib.h>
222 
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.
228 	 */
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.
232 	 */
throw_invalid(const char * msg,const char * file,int line)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();
236 	}
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.
241 	 */
throw_last_error(ctx ctx)242 	static void throw_last_error(ctx ctx) {
243 		abort();
244 	}
245 };
246 
247 #endif
248 
249 /* Helper class for setting the on_error and resetting the option
250  * to the original value when leaving the scope.
251  */
252 class options_scoped_set_on_error {
253 	isl_ctx *ctx;
254 	int saved_on_error;
255 public:
options_scoped_set_on_error(class ctx ctx,int on_error)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);
260 	}
~options_scoped_set_on_error()261 	~options_scoped_set_on_error() {
262 		isl_options_set_on_error(ctx, saved_on_error);
263 	}
264 };
265 
266 } // namespace isl
267 
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>
283 
284 namespace isl {
285 
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;
373 
374 // declarations for isl::aff
375 inline aff manage(__isl_take isl_aff *ptr);
376 inline aff manage_copy(__isl_keep isl_aff *ptr);
377 
378 class aff {
379   friend inline aff manage(__isl_take isl_aff *ptr);
380   friend inline aff manage_copy(__isl_keep isl_aff *ptr);
381 
382 protected:
383   isl_aff *ptr = nullptr;
384 
385   inline explicit aff(__isl_take isl_aff *ptr);
386 
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;
399 
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);
565 };
566 
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);
570 
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);
574 
575 protected:
576   isl_aff_list *ptr = nullptr;
577 
578   inline explicit aff_list(__isl_take isl_aff_list *ptr);
579 
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;
594 
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;
606 };
607 
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);
611 
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);
615 
616 protected:
617   isl_ast_build *ptr = nullptr;
618 
619   inline explicit ast_build(__isl_take isl_ast_build *ptr);
620 
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;
633 
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;
639   };
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;
656 };
657 
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);
661 
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);
665 
666 protected:
667   isl_ast_expr *ptr = nullptr;
668 
669   inline explicit ast_expr(__isl_take isl_ast_expr *ptr);
670 
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;
691 
692   inline std::string to_C_str() const;
693 };
694 
695 // declarations for isl::ast_expr_id
696 
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;
702 
703 protected:
704   inline explicit ast_expr_id(__isl_take isl_ast_expr *ptr);
705 
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;
711 
712   inline isl::id id() const;
713   inline isl::id get_id() const;
714 };
715 
716 // declarations for isl::ast_expr_int
717 
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;
723 
724 protected:
725   inline explicit ast_expr_int(__isl_take isl_ast_expr *ptr);
726 
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;
732 
733   inline isl::val val() const;
734   inline isl::val get_val() const;
735 };
736 
737 // declarations for isl::ast_expr_op
738 
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;
744 
745 protected:
746   inline explicit ast_expr_op(__isl_take isl_ast_expr *ptr);
747 
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;
762 
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;
767 };
768 
769 // declarations for isl::ast_expr_op_access
770 
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;
776 
777 protected:
778   inline explicit ast_expr_op_access(__isl_take isl_ast_expr *ptr);
779 
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;
785 
786 };
787 
788 // declarations for isl::ast_expr_op_add
789 
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;
795 
796 protected:
797   inline explicit ast_expr_op_add(__isl_take isl_ast_expr *ptr);
798 
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;
804 
805 };
806 
807 // declarations for isl::ast_expr_op_address_of
808 
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;
814 
815 protected:
816   inline explicit ast_expr_op_address_of(__isl_take isl_ast_expr *ptr);
817 
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;
823 
824 };
825 
826 // declarations for isl::ast_expr_op_and
827 
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;
833 
834 protected:
835   inline explicit ast_expr_op_and(__isl_take isl_ast_expr *ptr);
836 
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;
842 
843 };
844 
845 // declarations for isl::ast_expr_op_and_then
846 
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;
852 
853 protected:
854   inline explicit ast_expr_op_and_then(__isl_take isl_ast_expr *ptr);
855 
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;
861 
862 };
863 
864 // declarations for isl::ast_expr_op_call
865 
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;
871 
872 protected:
873   inline explicit ast_expr_op_call(__isl_take isl_ast_expr *ptr);
874 
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;
880 
881 };
882 
883 // declarations for isl::ast_expr_op_cond
884 
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;
890 
891 protected:
892   inline explicit ast_expr_op_cond(__isl_take isl_ast_expr *ptr);
893 
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;
899 
900 };
901 
902 // declarations for isl::ast_expr_op_div
903 
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;
909 
910 protected:
911   inline explicit ast_expr_op_div(__isl_take isl_ast_expr *ptr);
912 
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;
918 
919 };
920 
921 // declarations for isl::ast_expr_op_eq
922 
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;
928 
929 protected:
930   inline explicit ast_expr_op_eq(__isl_take isl_ast_expr *ptr);
931 
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;
937 
938 };
939 
940 // declarations for isl::ast_expr_op_fdiv_q
941 
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;
947 
948 protected:
949   inline explicit ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr);
950 
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;
956 
957 };
958 
959 // declarations for isl::ast_expr_op_ge
960 
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;
966 
967 protected:
968   inline explicit ast_expr_op_ge(__isl_take isl_ast_expr *ptr);
969 
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;
975 
976 };
977 
978 // declarations for isl::ast_expr_op_gt
979 
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;
985 
986 protected:
987   inline explicit ast_expr_op_gt(__isl_take isl_ast_expr *ptr);
988 
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;
994 
995 };
996 
997 // declarations for isl::ast_expr_op_le
998 
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;
1004 
1005 protected:
1006   inline explicit ast_expr_op_le(__isl_take isl_ast_expr *ptr);
1007 
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;
1013 
1014 };
1015 
1016 // declarations for isl::ast_expr_op_lt
1017 
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;
1023 
1024 protected:
1025   inline explicit ast_expr_op_lt(__isl_take isl_ast_expr *ptr);
1026 
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;
1032 
1033 };
1034 
1035 // declarations for isl::ast_expr_op_max
1036 
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;
1042 
1043 protected:
1044   inline explicit ast_expr_op_max(__isl_take isl_ast_expr *ptr);
1045 
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;
1051 
1052 };
1053 
1054 // declarations for isl::ast_expr_op_member
1055 
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;
1061 
1062 protected:
1063   inline explicit ast_expr_op_member(__isl_take isl_ast_expr *ptr);
1064 
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;
1070 
1071 };
1072 
1073 // declarations for isl::ast_expr_op_min
1074 
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;
1080 
1081 protected:
1082   inline explicit ast_expr_op_min(__isl_take isl_ast_expr *ptr);
1083 
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;
1089 
1090 };
1091 
1092 // declarations for isl::ast_expr_op_minus
1093 
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;
1099 
1100 protected:
1101   inline explicit ast_expr_op_minus(__isl_take isl_ast_expr *ptr);
1102 
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;
1108 
1109 };
1110 
1111 // declarations for isl::ast_expr_op_mul
1112 
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;
1118 
1119 protected:
1120   inline explicit ast_expr_op_mul(__isl_take isl_ast_expr *ptr);
1121 
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;
1127 
1128 };
1129 
1130 // declarations for isl::ast_expr_op_or
1131 
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;
1137 
1138 protected:
1139   inline explicit ast_expr_op_or(__isl_take isl_ast_expr *ptr);
1140 
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;
1146 
1147 };
1148 
1149 // declarations for isl::ast_expr_op_or_else
1150 
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;
1156 
1157 protected:
1158   inline explicit ast_expr_op_or_else(__isl_take isl_ast_expr *ptr);
1159 
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;
1165 
1166 };
1167 
1168 // declarations for isl::ast_expr_op_pdiv_q
1169 
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;
1175 
1176 protected:
1177   inline explicit ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr);
1178 
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;
1184 
1185 };
1186 
1187 // declarations for isl::ast_expr_op_pdiv_r
1188 
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;
1194 
1195 protected:
1196   inline explicit ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr);
1197 
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;
1203 
1204 };
1205 
1206 // declarations for isl::ast_expr_op_select
1207 
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;
1213 
1214 protected:
1215   inline explicit ast_expr_op_select(__isl_take isl_ast_expr *ptr);
1216 
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;
1222 
1223 };
1224 
1225 // declarations for isl::ast_expr_op_sub
1226 
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;
1232 
1233 protected:
1234   inline explicit ast_expr_op_sub(__isl_take isl_ast_expr *ptr);
1235 
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;
1241 
1242 };
1243 
1244 // declarations for isl::ast_expr_op_zdiv_r
1245 
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;
1251 
1252 protected:
1253   inline explicit ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr);
1254 
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;
1260 
1261 };
1262 
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);
1266 
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);
1270 
1271 protected:
1272   isl_ast_node *ptr = nullptr;
1273 
1274   inline explicit ast_node(__isl_take isl_ast_node *ptr);
1275 
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;
1296 
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;
1300 };
1301 
1302 // declarations for isl::ast_node_block
1303 
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;
1309 
1310 protected:
1311   inline explicit ast_node_block(__isl_take isl_ast_node *ptr);
1312 
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;
1319 
1320   inline isl::ast_node_list children() const;
1321   inline isl::ast_node_list get_children() const;
1322 };
1323 
1324 // declarations for isl::ast_node_for
1325 
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;
1331 
1332 protected:
1333   inline explicit ast_node_for(__isl_take isl_ast_node *ptr);
1334 
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;
1340 
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;
1352 };
1353 
1354 // declarations for isl::ast_node_if
1355 
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;
1361 
1362 protected:
1363   inline explicit ast_node_if(__isl_take isl_ast_node *ptr);
1364 
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;
1370 
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;
1378 };
1379 
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);
1383 
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);
1387 
1388 protected:
1389   isl_ast_node_list *ptr = nullptr;
1390 
1391   inline explicit ast_node_list(__isl_take isl_ast_node_list *ptr);
1392 
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;
1406 
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;
1418 };
1419 
1420 // declarations for isl::ast_node_mark
1421 
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;
1427 
1428 protected:
1429   inline explicit ast_node_mark(__isl_take isl_ast_node *ptr);
1430 
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;
1436 
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;
1441 };
1442 
1443 // declarations for isl::ast_node_user
1444 
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;
1450 
1451 protected:
1452   inline explicit ast_node_user(__isl_take isl_ast_node *ptr);
1453 
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;
1460 
1461   inline isl::ast_expr expr() const;
1462   inline isl::ast_expr get_expr() const;
1463 };
1464 
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);
1468 
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);
1472 
1473 protected:
1474   isl_basic_map *ptr = nullptr;
1475 
1476   inline explicit basic_map(__isl_take isl_basic_map *ptr);
1477 
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;
1490 
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;
1644 };
1645 
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);
1649 
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);
1653 
1654 protected:
1655   isl_basic_set *ptr = nullptr;
1656 
1657   inline explicit basic_set(__isl_take isl_basic_set *ptr);
1658 
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;
1672 
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;
1778 };
1779 
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);
1783 
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);
1787 
1788 protected:
1789   isl_fixed_box *ptr = nullptr;
1790 
1791   inline explicit fixed_box(__isl_take isl_fixed_box *ptr);
1792 
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;
1805 
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;
1813 };
1814 
1815 // declarations for isl::id
1816 inline id manage(__isl_take isl_id *ptr);
1817 inline id manage_copy(__isl_keep isl_id *ptr);
1818 
1819 class id {
1820   friend inline id manage(__isl_take isl_id *ptr);
1821   friend inline id manage_copy(__isl_keep isl_id *ptr);
1822 
1823 protected:
1824   isl_id *ptr = nullptr;
1825 
1826   inline explicit id(__isl_take isl_id *ptr);
1827 
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;
1840 
1841   inline std::string name() const;
1842   inline std::string get_name() const;
1843   inline isl::id_list to_list() const;
1844 
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
1852 };
1853 
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);
1857 
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);
1861 
1862 protected:
1863   isl_id_list *ptr = nullptr;
1864 
1865   inline explicit id_list(__isl_take isl_id_list *ptr);
1866 
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;
1881 
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;
1896 };
1897 
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);
1901 
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);
1905 
1906 protected:
1907   isl_id_to_ast_expr *ptr = nullptr;
1908 
1909   inline explicit id_to_ast_expr(__isl_take isl_id_to_ast_expr *ptr);
1910 
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;
1924 
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;
1928 };
1929 
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);
1933 
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);
1937 
1938 protected:
1939   isl_id_to_id *ptr = nullptr;
1940 
1941   inline explicit id_to_id(__isl_take isl_id_to_id *ptr);
1942 
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;
1956 
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;
1962 };
1963 
1964 // declarations for isl::map
1965 inline map manage(__isl_take isl_map *ptr);
1966 inline map manage_copy(__isl_keep isl_map *ptr);
1967 
1968 class map {
1969   friend inline map manage(__isl_take isl_map *ptr);
1970   friend inline map manage_copy(__isl_keep isl_map *ptr);
1971 
1972 protected:
1973   isl_map *ptr = nullptr;
1974 
1975   inline explicit map(__isl_take isl_map *ptr);
1976 
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;
1990 
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;
2171 };
2172 
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);
2176 
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);
2180 
2181 protected:
2182   isl_map_list *ptr = nullptr;
2183 
2184   inline explicit map_list(__isl_take isl_map_list *ptr);
2185 
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;
2200 
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;
2212 };
2213 
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);
2217 
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);
2221 
2222 protected:
2223   isl_multi_aff *ptr = nullptr;
2224 
2225   inline explicit multi_aff(__isl_take isl_multi_aff *ptr);
2226 
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;
2241 
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);
2375 };
2376 
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);
2380 
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);
2384 
2385 protected:
2386   isl_multi_id *ptr = nullptr;
2387 
2388   inline explicit multi_id(__isl_take isl_multi_id *ptr);
2389 
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;
2403 
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;
2416 };
2417 
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);
2421 
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);
2425 
2426 protected:
2427   isl_multi_pw_aff *ptr = nullptr;
2428 
2429   inline explicit multi_pw_aff(__isl_take isl_multi_pw_aff *ptr);
2430 
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;
2448 
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);
2548 };
2549 
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);
2553 
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);
2557 
2558 protected:
2559   isl_multi_union_pw_aff *ptr = nullptr;
2560 
2561   inline explicit multi_union_pw_aff(__isl_take isl_multi_union_pw_aff *ptr);
2562 
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;
2578 
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);
2616 };
2617 
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);
2621 
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);
2625 
2626 protected:
2627   isl_multi_val *ptr = nullptr;
2628 
2629   inline explicit multi_val(__isl_take isl_multi_val *ptr);
2630 
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;
2644 
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);
2679 };
2680 
2681 // declarations for isl::point
2682 inline point manage(__isl_take isl_point *ptr);
2683 inline point manage_copy(__isl_keep isl_point *ptr);
2684 
2685 class point {
2686   friend inline point manage(__isl_take isl_point *ptr);
2687   friend inline point manage_copy(__isl_keep isl_point *ptr);
2688 
2689 protected:
2690   isl_point *ptr = nullptr;
2691 
2692   inline explicit point(__isl_take isl_point *ptr);
2693 
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;
2705 
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;
2807 };
2808 
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);
2812 
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);
2816 
2817 protected:
2818   isl_pw_aff *ptr = nullptr;
2819 
2820   inline explicit pw_aff(__isl_take isl_pw_aff *ptr);
2821 
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;
2835 
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;
2987 };
2988 
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);
2992 
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);
2996 
2997 protected:
2998   isl_pw_aff_list *ptr = nullptr;
2999 
3000   inline explicit pw_aff_list(__isl_take isl_pw_aff_list *ptr);
3001 
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;
3016 
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;
3028 };
3029 
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);
3033 
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);
3037 
3038 protected:
3039   isl_pw_multi_aff *ptr = nullptr;
3040 
3041   inline explicit pw_multi_aff(__isl_take isl_pw_multi_aff *ptr);
3042 
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;
3057 
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);
3191 };
3192 
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);
3196 
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);
3200 
3201 protected:
3202   isl_pw_multi_aff_list *ptr = nullptr;
3203 
3204   inline explicit pw_multi_aff_list(__isl_take isl_pw_multi_aff_list *ptr);
3205 
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;
3220 
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;
3232 };
3233 
3234 // declarations for isl::schedule
3235 inline schedule manage(__isl_take isl_schedule *ptr);
3236 inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3237 
3238 class schedule {
3239   friend inline schedule manage(__isl_take isl_schedule *ptr);
3240   friend inline schedule manage_copy(__isl_keep isl_schedule *ptr);
3241 
3242 protected:
3243   isl_schedule *ptr = nullptr;
3244 
3245   inline explicit schedule(__isl_take isl_schedule *ptr);
3246 
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;
3259 
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;
3268 };
3269 
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);
3273 
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);
3277 
3278 protected:
3279   isl_schedule_constraints *ptr = nullptr;
3280 
3281   inline explicit schedule_constraints(__isl_take isl_schedule_constraints *ptr);
3282 
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;
3295 
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;
3317 };
3318 
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);
3322 
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);
3326 
3327 protected:
3328   isl_schedule_node *ptr = nullptr;
3329 
3330   inline explicit schedule_node(__isl_take isl_schedule_node *ptr);
3331 
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;
3352 
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;
3401 };
3402 
3403 // declarations for isl::schedule_node_band
3404 
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;
3410 
3411 protected:
3412   inline explicit schedule_node_band(__isl_take isl_schedule_node *ptr);
3413 
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;
3419 
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;
3443 };
3444 
3445 // declarations for isl::schedule_node_context
3446 
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;
3452 
3453 protected:
3454   inline explicit schedule_node_context(__isl_take isl_schedule_node *ptr);
3455 
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;
3461 
3462   inline isl::set context() const;
3463   inline isl::set get_context() const;
3464 };
3465 
3466 // declarations for isl::schedule_node_domain
3467 
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;
3473 
3474 protected:
3475   inline explicit schedule_node_domain(__isl_take isl_schedule_node *ptr);
3476 
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;
3482 
3483   inline isl::union_set domain() const;
3484   inline isl::union_set get_domain() const;
3485 };
3486 
3487 // declarations for isl::schedule_node_expansion
3488 
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;
3494 
3495 protected:
3496   inline explicit schedule_node_expansion(__isl_take isl_schedule_node *ptr);
3497 
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;
3503 
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;
3508 };
3509 
3510 // declarations for isl::schedule_node_extension
3511 
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;
3517 
3518 protected:
3519   inline explicit schedule_node_extension(__isl_take isl_schedule_node *ptr);
3520 
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;
3526 
3527   inline isl::union_map extension() const;
3528   inline isl::union_map get_extension() const;
3529 };
3530 
3531 // declarations for isl::schedule_node_filter
3532 
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;
3538 
3539 protected:
3540   inline explicit schedule_node_filter(__isl_take isl_schedule_node *ptr);
3541 
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;
3547 
3548   inline isl::union_set filter() const;
3549   inline isl::union_set get_filter() const;
3550 };
3551 
3552 // declarations for isl::schedule_node_guard
3553 
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;
3559 
3560 protected:
3561   inline explicit schedule_node_guard(__isl_take isl_schedule_node *ptr);
3562 
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;
3568 
3569   inline isl::set guard() const;
3570   inline isl::set get_guard() const;
3571 };
3572 
3573 // declarations for isl::schedule_node_leaf
3574 
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;
3580 
3581 protected:
3582   inline explicit schedule_node_leaf(__isl_take isl_schedule_node *ptr);
3583 
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;
3589 
3590 };
3591 
3592 // declarations for isl::schedule_node_mark
3593 
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;
3599 
3600 protected:
3601   inline explicit schedule_node_mark(__isl_take isl_schedule_node *ptr);
3602 
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;
3608 
3609 };
3610 
3611 // declarations for isl::schedule_node_sequence
3612 
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;
3618 
3619 protected:
3620   inline explicit schedule_node_sequence(__isl_take isl_schedule_node *ptr);
3621 
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;
3627 
3628 };
3629 
3630 // declarations for isl::schedule_node_set
3631 
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;
3637 
3638 protected:
3639   inline explicit schedule_node_set(__isl_take isl_schedule_node *ptr);
3640 
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;
3646 
3647 };
3648 
3649 // declarations for isl::set
3650 inline set manage(__isl_take isl_set *ptr);
3651 inline set manage_copy(__isl_keep isl_set *ptr);
3652 
3653 class set {
3654   friend inline set manage(__isl_take isl_set *ptr);
3655   friend inline set manage_copy(__isl_keep isl_set *ptr);
3656 
3657 protected:
3658   isl_set *ptr = nullptr;
3659 
3660   inline explicit set(__isl_take isl_set *ptr);
3661 
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;
3676 
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;
3792 };
3793 
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);
3797 
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);
3801 
3802 protected:
3803   isl_set_list *ptr = nullptr;
3804 
3805   inline explicit set_list(__isl_take isl_set_list *ptr);
3806 
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;
3821 
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;
3833 };
3834 
3835 // declarations for isl::space
3836 inline space manage(__isl_take isl_space *ptr);
3837 inline space manage_copy(__isl_keep isl_space *ptr);
3838 
3839 class space {
3840   friend inline space manage(__isl_take isl_space *ptr);
3841   friend inline space manage_copy(__isl_keep isl_space *ptr);
3842 
3843 protected:
3844   isl_space *ptr = nullptr;
3845 
3846   inline explicit space(__isl_take isl_space *ptr);
3847 
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;
3860 
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;
3917 };
3918 
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);
3922 
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);
3926 
3927 protected:
3928   isl_union_access_info *ptr = nullptr;
3929 
3930   inline explicit union_access_info(__isl_take isl_union_access_info *ptr);
3931 
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;
3944 
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;
3951 };
3952 
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);
3956 
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);
3960 
3961 protected:
3962   isl_union_flow *ptr = nullptr;
3963 
3964   inline explicit union_flow(__isl_take isl_union_flow *ptr);
3965 
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;
3977 
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;
3990 };
3991 
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);
3995 
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);
3999 
4000 protected:
4001   isl_union_map *ptr = nullptr;
4002 
4003   inline explicit union_map(__isl_take isl_union_map *ptr);
4004 
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;
4019 
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;
4114 };
4115 
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);
4119 
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);
4123 
4124 protected:
4125   isl_union_pw_aff *ptr = nullptr;
4126 
4127   inline explicit union_pw_aff(__isl_take isl_union_pw_aff *ptr);
4128 
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;
4143 
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;
4216 };
4217 
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);
4221 
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);
4225 
4226 protected:
4227   isl_union_pw_aff_list *ptr = nullptr;
4228 
4229   inline explicit union_pw_aff_list(__isl_take isl_union_pw_aff_list *ptr);
4230 
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;
4245 
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;
4257 };
4258 
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);
4262 
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);
4266 
4267 protected:
4268   isl_union_pw_multi_aff *ptr = nullptr;
4269 
4270   inline explicit union_pw_multi_aff(__isl_take isl_union_pw_multi_aff *ptr);
4271 
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;
4287 
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;
4322 };
4323 
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);
4327 
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);
4331 
4332 protected:
4333   isl_union_set *ptr = nullptr;
4334 
4335   inline explicit union_set(__isl_take isl_union_set *ptr);
4336 
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;
4352 
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;
4394 };
4395 
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);
4399 
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);
4403 
4404 protected:
4405   isl_union_set_list *ptr = nullptr;
4406 
4407   inline explicit union_set_list(__isl_take isl_union_set_list *ptr);
4408 
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;
4423 
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;
4435 };
4436 
4437 // declarations for isl::val
4438 inline val manage(__isl_take isl_val *ptr);
4439 inline val manage_copy(__isl_keep isl_val *ptr);
4440 
4441 class val {
4442   friend inline val manage(__isl_take isl_val *ptr);
4443   friend inline val manage_copy(__isl_keep isl_val *ptr);
4444 
4445 protected:
4446   isl_val *ptr = nullptr;
4447 
4448   inline explicit val(__isl_take isl_val *ptr);
4449 
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;
4463 
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);
4528 };
4529 
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);
4533 
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);
4537 
4538 protected:
4539   isl_val_list *ptr = nullptr;
4540 
4541   inline explicit val_list(__isl_take isl_val_list *ptr);
4542 
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;
4557 
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;
4572 };
4573 
4574 // implementations for isl::aff
manage(__isl_take isl_aff * ptr)4575 aff manage(__isl_take isl_aff *ptr) {
4576   if (!ptr)
4577     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4578   return aff(ptr);
4579 }
manage_copy(__isl_keep isl_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);
4589 }
4590 
aff(__isl_take isl_aff * ptr)4591 aff::aff(__isl_take isl_aff *ptr)
4592     : ptr(ptr) {}
4593 
aff()4594 aff::aff()
4595     : ptr(nullptr) {}
4596 
aff(const aff & obj)4597 aff::aff(const aff &obj)
4598     : ptr(nullptr)
4599 {
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);
4607 }
4608 
aff(isl::ctx ctx,const std::string & str)4609 aff::aff(isl::ctx ctx, const std::string &str)
4610 {
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;
4617 }
4618 
4619 aff &aff::operator=(aff obj) {
4620   std::swap(this->ptr, obj.ptr);
4621   return *this;
4622 }
4623 
~aff()4624 aff::~aff() {
4625   if (ptr)
4626     isl_aff_free(ptr);
4627 }
4628 
copy()4629 __isl_give isl_aff *aff::copy() const & {
4630   return isl_aff_copy(ptr);
4631 }
4632 
get()4633 __isl_keep isl_aff *aff::get() const {
4634   return ptr;
4635 }
4636 
release()4637 __isl_give isl_aff *aff::release() {
4638   isl_aff *tmp = ptr;
4639   ptr = nullptr;
4640   return tmp;
4641 }
4642 
is_null()4643 bool aff::is_null() const {
4644   return ptr == nullptr;
4645 }
4646 
ctx()4647 isl::ctx aff::ctx() const {
4648   return isl::ctx(isl_aff_get_ctx(ptr));
4649 }
4650 
add(isl::aff aff2)4651 isl::aff aff::add(isl::aff aff2) const
4652 {
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);
4661 }
4662 
add(const isl::multi_aff & multi2)4663 isl::multi_aff aff::add(const isl::multi_aff &multi2) const
4664 {
4665   if (!ptr)
4666     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4667   return isl::multi_aff(*this).add(multi2);
4668 }
4669 
add(const isl::multi_pw_aff & multi2)4670 isl::multi_pw_aff aff::add(const isl::multi_pw_aff &multi2) const
4671 {
4672   if (!ptr)
4673     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4674   return isl::pw_aff(*this).add(multi2);
4675 }
4676 
add(const isl::multi_union_pw_aff & multi2)4677 isl::multi_union_pw_aff aff::add(const isl::multi_union_pw_aff &multi2) const
4678 {
4679   if (!ptr)
4680     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4681   return isl::pw_aff(*this).add(multi2);
4682 }
4683 
add(const isl::pw_aff & pwaff2)4684 isl::pw_aff aff::add(const isl::pw_aff &pwaff2) const
4685 {
4686   if (!ptr)
4687     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4688   return isl::pw_aff(*this).add(pwaff2);
4689 }
4690 
add(const isl::pw_multi_aff & pma2)4691 isl::pw_multi_aff aff::add(const isl::pw_multi_aff &pma2) const
4692 {
4693   if (!ptr)
4694     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4695   return isl::pw_aff(*this).add(pma2);
4696 }
4697 
add(const isl::union_pw_aff & upa2)4698 isl::union_pw_aff aff::add(const isl::union_pw_aff &upa2) const
4699 {
4700   if (!ptr)
4701     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4702   return isl::pw_aff(*this).add(upa2);
4703 }
4704 
add(const isl::union_pw_multi_aff & upma2)4705 isl::union_pw_multi_aff aff::add(const isl::union_pw_multi_aff &upma2) const
4706 {
4707   if (!ptr)
4708     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4709   return isl::pw_aff(*this).add(upma2);
4710 }
4711 
add_constant(isl::val v)4712 isl::aff aff::add_constant(isl::val v) const
4713 {
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);
4722 }
4723 
add_constant(long v)4724 isl::aff aff::add_constant(long v) const
4725 {
4726   if (!ptr)
4727     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4728   return this->add_constant(isl::val(ctx(), v));
4729 }
4730 
add_constant(const isl::multi_val & mv)4731 isl::multi_aff aff::add_constant(const isl::multi_val &mv) const
4732 {
4733   if (!ptr)
4734     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4735   return isl::multi_aff(*this).add_constant(mv);
4736 }
4737 
apply(const isl::union_pw_multi_aff & upma2)4738 isl::union_pw_multi_aff aff::apply(const isl::union_pw_multi_aff &upma2) const
4739 {
4740   if (!ptr)
4741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4742   return isl::pw_aff(*this).apply(upma2);
4743 }
4744 
as_aff()4745 isl::aff aff::as_aff() const
4746 {
4747   if (!ptr)
4748     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4749   return isl::pw_aff(*this).as_aff();
4750 }
4751 
as_map()4752 isl::map aff::as_map() const
4753 {
4754   if (!ptr)
4755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4756   return isl::pw_aff(*this).as_map();
4757 }
4758 
as_multi_aff()4759 isl::multi_aff aff::as_multi_aff() const
4760 {
4761   if (!ptr)
4762     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4763   return isl::pw_aff(*this).as_multi_aff();
4764 }
4765 
as_multi_union_pw_aff()4766 isl::multi_union_pw_aff aff::as_multi_union_pw_aff() const
4767 {
4768   if (!ptr)
4769     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4770   return isl::pw_aff(*this).as_multi_union_pw_aff();
4771 }
4772 
as_pw_multi_aff()4773 isl::pw_multi_aff aff::as_pw_multi_aff() const
4774 {
4775   if (!ptr)
4776     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4777   return isl::pw_aff(*this).as_pw_multi_aff();
4778 }
4779 
as_set()4780 isl::set aff::as_set() const
4781 {
4782   if (!ptr)
4783     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4784   return isl::multi_aff(*this).as_set();
4785 }
4786 
as_union_map()4787 isl::union_map aff::as_union_map() const
4788 {
4789   if (!ptr)
4790     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4791   return isl::pw_aff(*this).as_union_map();
4792 }
4793 
at(int pos)4794 isl::aff aff::at(int pos) const
4795 {
4796   if (!ptr)
4797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4798   return isl::multi_aff(*this).at(pos);
4799 }
4800 
bind(isl::id id)4801 isl::basic_set aff::bind(isl::id id) const
4802 {
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);
4811 }
4812 
bind(const std::string & id)4813 isl::basic_set aff::bind(const std::string &id) const
4814 {
4815   if (!ptr)
4816     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4817   return this->bind(isl::id(ctx(), id));
4818 }
4819 
bind(const isl::multi_id & tuple)4820 isl::basic_set aff::bind(const isl::multi_id &tuple) const
4821 {
4822   if (!ptr)
4823     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4824   return isl::multi_aff(*this).bind(tuple);
4825 }
4826 
bind_domain(const isl::multi_id & tuple)4827 isl::pw_aff aff::bind_domain(const isl::multi_id &tuple) const
4828 {
4829   if (!ptr)
4830     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4831   return isl::pw_aff(*this).bind_domain(tuple);
4832 }
4833 
bind_domain_wrapped_domain(const isl::multi_id & tuple)4834 isl::pw_aff aff::bind_domain_wrapped_domain(const isl::multi_id &tuple) const
4835 {
4836   if (!ptr)
4837     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4838   return isl::pw_aff(*this).bind_domain_wrapped_domain(tuple);
4839 }
4840 
ceil()4841 isl::aff aff::ceil() const
4842 {
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);
4851 }
4852 
coalesce()4853 isl::pw_aff aff::coalesce() const
4854 {
4855   if (!ptr)
4856     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4857   return isl::pw_aff(*this).coalesce();
4858 }
4859 
cond(const isl::pw_aff & pwaff_true,const isl::pw_aff & pwaff_false)4860 isl::pw_aff aff::cond(const isl::pw_aff &pwaff_true, const isl::pw_aff &pwaff_false) const
4861 {
4862   if (!ptr)
4863     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4864   return isl::pw_aff(*this).cond(pwaff_true, pwaff_false);
4865 }
4866 
constant_multi_val()4867 isl::multi_val aff::constant_multi_val() const
4868 {
4869   if (!ptr)
4870     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4871   return isl::multi_aff(*this).constant_multi_val();
4872 }
4873 
constant_val()4874 isl::val aff::constant_val() const
4875 {
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);
4884 }
4885 
get_constant_val()4886 isl::val aff::get_constant_val() const
4887 {
4888   return constant_val();
4889 }
4890 
div(isl::aff aff2)4891 isl::aff aff::div(isl::aff aff2) const
4892 {
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);
4901 }
4902 
div(const isl::pw_aff & pa2)4903 isl::pw_aff aff::div(const isl::pw_aff &pa2) const
4904 {
4905   if (!ptr)
4906     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4907   return isl::pw_aff(*this).div(pa2);
4908 }
4909 
domain()4910 isl::set aff::domain() const
4911 {
4912   if (!ptr)
4913     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4914   return isl::pw_aff(*this).domain();
4915 }
4916 
domain_reverse()4917 isl::aff aff::domain_reverse() const
4918 {
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);
4927 }
4928 
drop_unused_params()4929 isl::pw_aff aff::drop_unused_params() const
4930 {
4931   if (!ptr)
4932     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4933   return isl::pw_aff(*this).drop_unused_params();
4934 }
4935 
eq_set(isl::aff aff2)4936 isl::set aff::eq_set(isl::aff aff2) const
4937 {
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);
4946 }
4947 
eq_set(const isl::pw_aff & pwaff2)4948 isl::set aff::eq_set(const isl::pw_aff &pwaff2) const
4949 {
4950   if (!ptr)
4951     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4952   return isl::pw_aff(*this).eq_set(pwaff2);
4953 }
4954 
eval(isl::point pnt)4955 isl::val aff::eval(isl::point pnt) const
4956 {
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);
4965 }
4966 
extract_pw_multi_aff(const isl::space & space)4967 isl::pw_multi_aff aff::extract_pw_multi_aff(const isl::space &space) const
4968 {
4969   if (!ptr)
4970     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4971   return isl::pw_aff(*this).extract_pw_multi_aff(space);
4972 }
4973 
flat_range_product(const isl::multi_aff & multi2)4974 isl::multi_aff aff::flat_range_product(const isl::multi_aff &multi2) const
4975 {
4976   if (!ptr)
4977     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4978   return isl::multi_aff(*this).flat_range_product(multi2);
4979 }
4980 
flat_range_product(const isl::multi_pw_aff & multi2)4981 isl::multi_pw_aff aff::flat_range_product(const isl::multi_pw_aff &multi2) const
4982 {
4983   if (!ptr)
4984     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4985   return isl::pw_aff(*this).flat_range_product(multi2);
4986 }
4987 
flat_range_product(const isl::multi_union_pw_aff & multi2)4988 isl::multi_union_pw_aff aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
4989 {
4990   if (!ptr)
4991     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4992   return isl::pw_aff(*this).flat_range_product(multi2);
4993 }
4994 
flat_range_product(const isl::pw_multi_aff & pma2)4995 isl::pw_multi_aff aff::flat_range_product(const isl::pw_multi_aff &pma2) const
4996 {
4997   if (!ptr)
4998     exception::throw_invalid("NULL input", __FILE__, __LINE__);
4999   return isl::pw_aff(*this).flat_range_product(pma2);
5000 }
5001 
flat_range_product(const isl::union_pw_multi_aff & upma2)5002 isl::union_pw_multi_aff aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
5003 {
5004   if (!ptr)
5005     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5006   return isl::pw_aff(*this).flat_range_product(upma2);
5007 }
5008 
floor()5009 isl::aff aff::floor() const
5010 {
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);
5019 }
5020 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)5021 void aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
5022 {
5023   if (!ptr)
5024     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5025   return isl::pw_aff(*this).foreach_piece(fn);
5026 }
5027 
ge_set(isl::aff aff2)5028 isl::set aff::ge_set(isl::aff aff2) const
5029 {
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);
5038 }
5039 
ge_set(const isl::pw_aff & pwaff2)5040 isl::set aff::ge_set(const isl::pw_aff &pwaff2) const
5041 {
5042   if (!ptr)
5043     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5044   return isl::pw_aff(*this).ge_set(pwaff2);
5045 }
5046 
gist(isl::set context)5047 isl::aff aff::gist(isl::set context) const
5048 {
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);
5057 }
5058 
gist(const isl::union_set & context)5059 isl::union_pw_aff aff::gist(const isl::union_set &context) const
5060 {
5061   if (!ptr)
5062     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5063   return isl::pw_aff(*this).gist(context);
5064 }
5065 
gist(const isl::basic_set & context)5066 isl::aff aff::gist(const isl::basic_set &context) const
5067 {
5068   if (!ptr)
5069     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5070   return this->gist(isl::set(context));
5071 }
5072 
gist(const isl::point & context)5073 isl::aff aff::gist(const isl::point &context) const
5074 {
5075   if (!ptr)
5076     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5077   return this->gist(isl::set(context));
5078 }
5079 
gist_params(isl::set context)5080 isl::aff aff::gist_params(isl::set context) const
5081 {
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);
5090 }
5091 
gt_set(isl::aff aff2)5092 isl::set aff::gt_set(isl::aff aff2) const
5093 {
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);
5102 }
5103 
gt_set(const isl::pw_aff & pwaff2)5104 isl::set aff::gt_set(const isl::pw_aff &pwaff2) const
5105 {
5106   if (!ptr)
5107     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5108   return isl::pw_aff(*this).gt_set(pwaff2);
5109 }
5110 
has_range_tuple_id()5111 bool aff::has_range_tuple_id() const
5112 {
5113   if (!ptr)
5114     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5115   return isl::multi_aff(*this).has_range_tuple_id();
5116 }
5117 
identity()5118 isl::multi_aff aff::identity() const
5119 {
5120   if (!ptr)
5121     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5122   return isl::multi_aff(*this).identity();
5123 }
5124 
insert_domain(const isl::space & domain)5125 isl::pw_aff aff::insert_domain(const isl::space &domain) const
5126 {
5127   if (!ptr)
5128     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5129   return isl::pw_aff(*this).insert_domain(domain);
5130 }
5131 
intersect_domain(const isl::set & set)5132 isl::pw_aff aff::intersect_domain(const isl::set &set) const
5133 {
5134   if (!ptr)
5135     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5136   return isl::pw_aff(*this).intersect_domain(set);
5137 }
5138 
intersect_domain(const isl::space & space)5139 isl::union_pw_aff aff::intersect_domain(const isl::space &space) const
5140 {
5141   if (!ptr)
5142     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5143   return isl::pw_aff(*this).intersect_domain(space);
5144 }
5145 
intersect_domain(const isl::union_set & uset)5146 isl::union_pw_aff aff::intersect_domain(const isl::union_set &uset) const
5147 {
5148   if (!ptr)
5149     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5150   return isl::pw_aff(*this).intersect_domain(uset);
5151 }
5152 
intersect_domain_wrapped_domain(const isl::union_set & uset)5153 isl::union_pw_aff aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
5154 {
5155   if (!ptr)
5156     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5157   return isl::pw_aff(*this).intersect_domain_wrapped_domain(uset);
5158 }
5159 
intersect_domain_wrapped_range(const isl::union_set & uset)5160 isl::union_pw_aff aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
5161 {
5162   if (!ptr)
5163     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5164   return isl::pw_aff(*this).intersect_domain_wrapped_range(uset);
5165 }
5166 
intersect_params(const isl::set & set)5167 isl::pw_aff aff::intersect_params(const isl::set &set) const
5168 {
5169   if (!ptr)
5170     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5171   return isl::pw_aff(*this).intersect_params(set);
5172 }
5173 
involves_locals()5174 bool aff::involves_locals() const
5175 {
5176   if (!ptr)
5177     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5178   return isl::multi_aff(*this).involves_locals();
5179 }
5180 
involves_nan()5181 bool aff::involves_nan() const
5182 {
5183   if (!ptr)
5184     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5185   return isl::multi_aff(*this).involves_nan();
5186 }
5187 
involves_param(const isl::id & id)5188 bool aff::involves_param(const isl::id &id) const
5189 {
5190   if (!ptr)
5191     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5192   return isl::pw_aff(*this).involves_param(id);
5193 }
5194 
involves_param(const std::string & id)5195 bool aff::involves_param(const std::string &id) const
5196 {
5197   if (!ptr)
5198     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5199   return this->involves_param(isl::id(ctx(), id));
5200 }
5201 
involves_param(const isl::id_list & list)5202 bool aff::involves_param(const isl::id_list &list) const
5203 {
5204   if (!ptr)
5205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5206   return isl::pw_aff(*this).involves_param(list);
5207 }
5208 
is_cst()5209 bool aff::is_cst() const
5210 {
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;
5219 }
5220 
isa_aff()5221 bool aff::isa_aff() const
5222 {
5223   if (!ptr)
5224     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5225   return isl::pw_aff(*this).isa_aff();
5226 }
5227 
isa_multi_aff()5228 bool aff::isa_multi_aff() const
5229 {
5230   if (!ptr)
5231     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5232   return isl::pw_aff(*this).isa_multi_aff();
5233 }
5234 
isa_pw_multi_aff()5235 bool aff::isa_pw_multi_aff() const
5236 {
5237   if (!ptr)
5238     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5239   return isl::pw_aff(*this).isa_pw_multi_aff();
5240 }
5241 
le_set(isl::aff aff2)5242 isl::set aff::le_set(isl::aff aff2) const
5243 {
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);
5252 }
5253 
le_set(const isl::pw_aff & pwaff2)5254 isl::set aff::le_set(const isl::pw_aff &pwaff2) const
5255 {
5256   if (!ptr)
5257     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5258   return isl::pw_aff(*this).le_set(pwaff2);
5259 }
5260 
list()5261 isl::aff_list aff::list() const
5262 {
5263   if (!ptr)
5264     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5265   return isl::multi_aff(*this).list();
5266 }
5267 
lt_set(isl::aff aff2)5268 isl::set aff::lt_set(isl::aff aff2) const
5269 {
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);
5278 }
5279 
lt_set(const isl::pw_aff & pwaff2)5280 isl::set aff::lt_set(const isl::pw_aff &pwaff2) const
5281 {
5282   if (!ptr)
5283     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5284   return isl::pw_aff(*this).lt_set(pwaff2);
5285 }
5286 
max(const isl::multi_pw_aff & multi2)5287 isl::multi_pw_aff aff::max(const isl::multi_pw_aff &multi2) const
5288 {
5289   if (!ptr)
5290     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5291   return isl::pw_aff(*this).max(multi2);
5292 }
5293 
max(const isl::pw_aff & pwaff2)5294 isl::pw_aff aff::max(const isl::pw_aff &pwaff2) const
5295 {
5296   if (!ptr)
5297     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5298   return isl::pw_aff(*this).max(pwaff2);
5299 }
5300 
max_multi_val()5301 isl::multi_val aff::max_multi_val() const
5302 {
5303   if (!ptr)
5304     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5305   return isl::pw_aff(*this).max_multi_val();
5306 }
5307 
max_val()5308 isl::val aff::max_val() const
5309 {
5310   if (!ptr)
5311     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5312   return isl::pw_aff(*this).max_val();
5313 }
5314 
min(const isl::multi_pw_aff & multi2)5315 isl::multi_pw_aff aff::min(const isl::multi_pw_aff &multi2) const
5316 {
5317   if (!ptr)
5318     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5319   return isl::pw_aff(*this).min(multi2);
5320 }
5321 
min(const isl::pw_aff & pwaff2)5322 isl::pw_aff aff::min(const isl::pw_aff &pwaff2) const
5323 {
5324   if (!ptr)
5325     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5326   return isl::pw_aff(*this).min(pwaff2);
5327 }
5328 
min_multi_val()5329 isl::multi_val aff::min_multi_val() const
5330 {
5331   if (!ptr)
5332     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5333   return isl::pw_aff(*this).min_multi_val();
5334 }
5335 
min_val()5336 isl::val aff::min_val() const
5337 {
5338   if (!ptr)
5339     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5340   return isl::pw_aff(*this).min_val();
5341 }
5342 
mod(isl::val mod)5343 isl::aff aff::mod(isl::val mod) const
5344 {
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);
5353 }
5354 
mod(long mod)5355 isl::aff aff::mod(long mod) const
5356 {
5357   if (!ptr)
5358     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5359   return this->mod(isl::val(ctx(), mod));
5360 }
5361 
mul(isl::aff aff2)5362 isl::aff aff::mul(isl::aff aff2) const
5363 {
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);
5372 }
5373 
mul(const isl::pw_aff & pwaff2)5374 isl::pw_aff aff::mul(const isl::pw_aff &pwaff2) const
5375 {
5376   if (!ptr)
5377     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5378   return isl::pw_aff(*this).mul(pwaff2);
5379 }
5380 
n_piece()5381 unsigned aff::n_piece() const
5382 {
5383   if (!ptr)
5384     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5385   return isl::pw_aff(*this).n_piece();
5386 }
5387 
ne_set(isl::aff aff2)5388 isl::set aff::ne_set(isl::aff aff2) const
5389 {
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);
5398 }
5399 
ne_set(const isl::pw_aff & pwaff2)5400 isl::set aff::ne_set(const isl::pw_aff &pwaff2) const
5401 {
5402   if (!ptr)
5403     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5404   return isl::pw_aff(*this).ne_set(pwaff2);
5405 }
5406 
neg()5407 isl::aff aff::neg() const
5408 {
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);
5417 }
5418 
params()5419 isl::set aff::params() const
5420 {
5421   if (!ptr)
5422     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5423   return isl::pw_aff(*this).params();
5424 }
5425 
plain_is_empty()5426 bool aff::plain_is_empty() const
5427 {
5428   if (!ptr)
5429     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5430   return isl::pw_aff(*this).plain_is_empty();
5431 }
5432 
plain_is_equal(const isl::aff & aff2)5433 bool aff::plain_is_equal(const isl::aff &aff2) const
5434 {
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;
5443 }
5444 
plain_is_equal(const isl::multi_aff & multi2)5445 bool aff::plain_is_equal(const isl::multi_aff &multi2) const
5446 {
5447   if (!ptr)
5448     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5449   return isl::multi_aff(*this).plain_is_equal(multi2);
5450 }
5451 
plain_is_equal(const isl::multi_pw_aff & multi2)5452 bool aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
5453 {
5454   if (!ptr)
5455     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5456   return isl::pw_aff(*this).plain_is_equal(multi2);
5457 }
5458 
plain_is_equal(const isl::multi_union_pw_aff & multi2)5459 bool aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
5460 {
5461   if (!ptr)
5462     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5463   return isl::pw_aff(*this).plain_is_equal(multi2);
5464 }
5465 
plain_is_equal(const isl::pw_aff & pwaff2)5466 bool aff::plain_is_equal(const isl::pw_aff &pwaff2) const
5467 {
5468   if (!ptr)
5469     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5470   return isl::pw_aff(*this).plain_is_equal(pwaff2);
5471 }
5472 
plain_is_equal(const isl::pw_multi_aff & pma2)5473 bool aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
5474 {
5475   if (!ptr)
5476     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5477   return isl::pw_aff(*this).plain_is_equal(pma2);
5478 }
5479 
plain_is_equal(const isl::union_pw_aff & upa2)5480 bool aff::plain_is_equal(const isl::union_pw_aff &upa2) const
5481 {
5482   if (!ptr)
5483     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5484   return isl::pw_aff(*this).plain_is_equal(upa2);
5485 }
5486 
plain_is_equal(const isl::union_pw_multi_aff & upma2)5487 bool aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
5488 {
5489   if (!ptr)
5490     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5491   return isl::pw_aff(*this).plain_is_equal(upma2);
5492 }
5493 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)5494 isl::pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
5495 {
5496   if (!ptr)
5497     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5498   return isl::pw_aff(*this).preimage_domain_wrapped_domain(pma2);
5499 }
5500 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)5501 isl::union_pw_multi_aff aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
5502 {
5503   if (!ptr)
5504     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5505   return isl::pw_aff(*this).preimage_domain_wrapped_domain(upma2);
5506 }
5507 
product(const isl::multi_aff & multi2)5508 isl::multi_aff aff::product(const isl::multi_aff &multi2) const
5509 {
5510   if (!ptr)
5511     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5512   return isl::multi_aff(*this).product(multi2);
5513 }
5514 
product(const isl::multi_pw_aff & multi2)5515 isl::multi_pw_aff aff::product(const isl::multi_pw_aff &multi2) const
5516 {
5517   if (!ptr)
5518     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5519   return isl::pw_aff(*this).product(multi2);
5520 }
5521 
product(const isl::pw_multi_aff & pma2)5522 isl::pw_multi_aff aff::product(const isl::pw_multi_aff &pma2) const
5523 {
5524   if (!ptr)
5525     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5526   return isl::pw_aff(*this).product(pma2);
5527 }
5528 
pullback(isl::multi_aff ma)5529 isl::aff aff::pullback(isl::multi_aff ma) const
5530 {
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);
5539 }
5540 
pullback(const isl::multi_pw_aff & mpa)5541 isl::pw_aff aff::pullback(const isl::multi_pw_aff &mpa) const
5542 {
5543   if (!ptr)
5544     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5545   return isl::pw_aff(*this).pullback(mpa);
5546 }
5547 
pullback(const isl::pw_multi_aff & pma)5548 isl::pw_aff aff::pullback(const isl::pw_multi_aff &pma) const
5549 {
5550   if (!ptr)
5551     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5552   return isl::pw_aff(*this).pullback(pma);
5553 }
5554 
pullback(const isl::union_pw_multi_aff & upma)5555 isl::union_pw_aff aff::pullback(const isl::union_pw_multi_aff &upma) const
5556 {
5557   if (!ptr)
5558     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5559   return isl::pw_aff(*this).pullback(upma);
5560 }
5561 
pullback(const isl::aff & ma)5562 isl::aff aff::pullback(const isl::aff &ma) const
5563 {
5564   if (!ptr)
5565     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5566   return this->pullback(isl::multi_aff(ma));
5567 }
5568 
pw_multi_aff_list()5569 isl::pw_multi_aff_list aff::pw_multi_aff_list() const
5570 {
5571   if (!ptr)
5572     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5573   return isl::pw_aff(*this).pw_multi_aff_list();
5574 }
5575 
range_factor_domain()5576 isl::pw_multi_aff aff::range_factor_domain() const
5577 {
5578   if (!ptr)
5579     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5580   return isl::pw_aff(*this).range_factor_domain();
5581 }
5582 
range_factor_range()5583 isl::pw_multi_aff aff::range_factor_range() const
5584 {
5585   if (!ptr)
5586     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5587   return isl::pw_aff(*this).range_factor_range();
5588 }
5589 
range_product(const isl::multi_aff & multi2)5590 isl::multi_aff aff::range_product(const isl::multi_aff &multi2) const
5591 {
5592   if (!ptr)
5593     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5594   return isl::multi_aff(*this).range_product(multi2);
5595 }
5596 
range_product(const isl::multi_pw_aff & multi2)5597 isl::multi_pw_aff aff::range_product(const isl::multi_pw_aff &multi2) const
5598 {
5599   if (!ptr)
5600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5601   return isl::pw_aff(*this).range_product(multi2);
5602 }
5603 
range_product(const isl::multi_union_pw_aff & multi2)5604 isl::multi_union_pw_aff aff::range_product(const isl::multi_union_pw_aff &multi2) const
5605 {
5606   if (!ptr)
5607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5608   return isl::pw_aff(*this).range_product(multi2);
5609 }
5610 
range_product(const isl::pw_multi_aff & pma2)5611 isl::pw_multi_aff aff::range_product(const isl::pw_multi_aff &pma2) const
5612 {
5613   if (!ptr)
5614     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5615   return isl::pw_aff(*this).range_product(pma2);
5616 }
5617 
range_product(const isl::union_pw_multi_aff & upma2)5618 isl::union_pw_multi_aff aff::range_product(const isl::union_pw_multi_aff &upma2) const
5619 {
5620   if (!ptr)
5621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5622   return isl::pw_aff(*this).range_product(upma2);
5623 }
5624 
range_tuple_id()5625 isl::id aff::range_tuple_id() const
5626 {
5627   if (!ptr)
5628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5629   return isl::multi_aff(*this).range_tuple_id();
5630 }
5631 
reset_range_tuple_id()5632 isl::multi_aff aff::reset_range_tuple_id() const
5633 {
5634   if (!ptr)
5635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5636   return isl::multi_aff(*this).reset_range_tuple_id();
5637 }
5638 
scale(isl::val v)5639 isl::aff aff::scale(isl::val v) const
5640 {
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);
5649 }
5650 
scale(long v)5651 isl::aff aff::scale(long v) const
5652 {
5653   if (!ptr)
5654     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5655   return this->scale(isl::val(ctx(), v));
5656 }
5657 
scale(const isl::multi_val & mv)5658 isl::multi_aff aff::scale(const isl::multi_val &mv) const
5659 {
5660   if (!ptr)
5661     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5662   return isl::multi_aff(*this).scale(mv);
5663 }
5664 
scale_down(isl::val v)5665 isl::aff aff::scale_down(isl::val v) const
5666 {
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);
5675 }
5676 
scale_down(long v)5677 isl::aff aff::scale_down(long v) const
5678 {
5679   if (!ptr)
5680     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5681   return this->scale_down(isl::val(ctx(), v));
5682 }
5683 
scale_down(const isl::multi_val & mv)5684 isl::multi_aff aff::scale_down(const isl::multi_val &mv) const
5685 {
5686   if (!ptr)
5687     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5688   return isl::multi_aff(*this).scale_down(mv);
5689 }
5690 
set_at(int pos,const isl::aff & el)5691 isl::multi_aff aff::set_at(int pos, const isl::aff &el) const
5692 {
5693   if (!ptr)
5694     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5695   return isl::multi_aff(*this).set_at(pos, el);
5696 }
5697 
set_at(int pos,const isl::pw_aff & el)5698 isl::multi_pw_aff aff::set_at(int pos, const isl::pw_aff &el) const
5699 {
5700   if (!ptr)
5701     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5702   return isl::pw_aff(*this).set_at(pos, el);
5703 }
5704 
set_at(int pos,const isl::union_pw_aff & el)5705 isl::multi_union_pw_aff aff::set_at(int pos, const isl::union_pw_aff &el) const
5706 {
5707   if (!ptr)
5708     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5709   return isl::pw_aff(*this).set_at(pos, el);
5710 }
5711 
set_range_tuple(const isl::id & id)5712 isl::multi_aff aff::set_range_tuple(const isl::id &id) const
5713 {
5714   if (!ptr)
5715     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5716   return isl::multi_aff(*this).set_range_tuple(id);
5717 }
5718 
set_range_tuple(const std::string & id)5719 isl::multi_aff aff::set_range_tuple(const std::string &id) const
5720 {
5721   if (!ptr)
5722     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5723   return this->set_range_tuple(isl::id(ctx(), id));
5724 }
5725 
size()5726 unsigned aff::size() const
5727 {
5728   if (!ptr)
5729     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5730   return isl::multi_aff(*this).size();
5731 }
5732 
space()5733 isl::space aff::space() const
5734 {
5735   if (!ptr)
5736     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5737   return isl::pw_aff(*this).space();
5738 }
5739 
sub(isl::aff aff2)5740 isl::aff aff::sub(isl::aff aff2) const
5741 {
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);
5750 }
5751 
sub(const isl::multi_aff & multi2)5752 isl::multi_aff aff::sub(const isl::multi_aff &multi2) const
5753 {
5754   if (!ptr)
5755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5756   return isl::multi_aff(*this).sub(multi2);
5757 }
5758 
sub(const isl::multi_pw_aff & multi2)5759 isl::multi_pw_aff aff::sub(const isl::multi_pw_aff &multi2) const
5760 {
5761   if (!ptr)
5762     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5763   return isl::pw_aff(*this).sub(multi2);
5764 }
5765 
sub(const isl::multi_union_pw_aff & multi2)5766 isl::multi_union_pw_aff aff::sub(const isl::multi_union_pw_aff &multi2) const
5767 {
5768   if (!ptr)
5769     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5770   return isl::pw_aff(*this).sub(multi2);
5771 }
5772 
sub(const isl::pw_aff & pwaff2)5773 isl::pw_aff aff::sub(const isl::pw_aff &pwaff2) const
5774 {
5775   if (!ptr)
5776     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5777   return isl::pw_aff(*this).sub(pwaff2);
5778 }
5779 
sub(const isl::pw_multi_aff & pma2)5780 isl::pw_multi_aff aff::sub(const isl::pw_multi_aff &pma2) const
5781 {
5782   if (!ptr)
5783     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5784   return isl::pw_aff(*this).sub(pma2);
5785 }
5786 
sub(const isl::union_pw_aff & upa2)5787 isl::union_pw_aff aff::sub(const isl::union_pw_aff &upa2) const
5788 {
5789   if (!ptr)
5790     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5791   return isl::pw_aff(*this).sub(upa2);
5792 }
5793 
sub(const isl::union_pw_multi_aff & upma2)5794 isl::union_pw_multi_aff aff::sub(const isl::union_pw_multi_aff &upma2) const
5795 {
5796   if (!ptr)
5797     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5798   return isl::pw_aff(*this).sub(upma2);
5799 }
5800 
subtract_domain(const isl::set & set)5801 isl::pw_aff aff::subtract_domain(const isl::set &set) const
5802 {
5803   if (!ptr)
5804     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5805   return isl::pw_aff(*this).subtract_domain(set);
5806 }
5807 
subtract_domain(const isl::space & space)5808 isl::union_pw_aff aff::subtract_domain(const isl::space &space) const
5809 {
5810   if (!ptr)
5811     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5812   return isl::pw_aff(*this).subtract_domain(space);
5813 }
5814 
subtract_domain(const isl::union_set & uset)5815 isl::union_pw_aff aff::subtract_domain(const isl::union_set &uset) const
5816 {
5817   if (!ptr)
5818     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5819   return isl::pw_aff(*this).subtract_domain(uset);
5820 }
5821 
tdiv_q(const isl::pw_aff & pa2)5822 isl::pw_aff aff::tdiv_q(const isl::pw_aff &pa2) const
5823 {
5824   if (!ptr)
5825     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5826   return isl::pw_aff(*this).tdiv_q(pa2);
5827 }
5828 
tdiv_r(const isl::pw_aff & pa2)5829 isl::pw_aff aff::tdiv_r(const isl::pw_aff &pa2) const
5830 {
5831   if (!ptr)
5832     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5833   return isl::pw_aff(*this).tdiv_r(pa2);
5834 }
5835 
to_list()5836 isl::aff_list aff::to_list() const
5837 {
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);
5846 }
5847 
to_multi_pw_aff()5848 isl::multi_pw_aff aff::to_multi_pw_aff() const
5849 {
5850   if (!ptr)
5851     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5852   return isl::multi_aff(*this).to_multi_pw_aff();
5853 }
5854 
to_multi_union_pw_aff()5855 isl::multi_union_pw_aff aff::to_multi_union_pw_aff() const
5856 {
5857   if (!ptr)
5858     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5859   return isl::multi_aff(*this).to_multi_union_pw_aff();
5860 }
5861 
to_pw_multi_aff()5862 isl::pw_multi_aff aff::to_pw_multi_aff() const
5863 {
5864   if (!ptr)
5865     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5866   return isl::multi_aff(*this).to_pw_multi_aff();
5867 }
5868 
to_union_pw_aff()5869 isl::union_pw_aff aff::to_union_pw_aff() const
5870 {
5871   if (!ptr)
5872     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5873   return isl::pw_aff(*this).to_union_pw_aff();
5874 }
5875 
to_union_pw_multi_aff()5876 isl::union_pw_multi_aff aff::to_union_pw_multi_aff() const
5877 {
5878   if (!ptr)
5879     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5880   return isl::pw_aff(*this).to_union_pw_multi_aff();
5881 }
5882 
unbind_params_insert_domain(isl::multi_id domain)5883 isl::aff aff::unbind_params_insert_domain(isl::multi_id domain) const
5884 {
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);
5893 }
5894 
union_add(const isl::multi_pw_aff & mpa2)5895 isl::multi_pw_aff aff::union_add(const isl::multi_pw_aff &mpa2) const
5896 {
5897   if (!ptr)
5898     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5899   return isl::pw_aff(*this).union_add(mpa2);
5900 }
5901 
union_add(const isl::multi_union_pw_aff & mupa2)5902 isl::multi_union_pw_aff aff::union_add(const isl::multi_union_pw_aff &mupa2) const
5903 {
5904   if (!ptr)
5905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5906   return isl::pw_aff(*this).union_add(mupa2);
5907 }
5908 
union_add(const isl::pw_aff & pwaff2)5909 isl::pw_aff aff::union_add(const isl::pw_aff &pwaff2) const
5910 {
5911   if (!ptr)
5912     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5913   return isl::pw_aff(*this).union_add(pwaff2);
5914 }
5915 
union_add(const isl::pw_multi_aff & pma2)5916 isl::pw_multi_aff aff::union_add(const isl::pw_multi_aff &pma2) const
5917 {
5918   if (!ptr)
5919     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5920   return isl::pw_aff(*this).union_add(pma2);
5921 }
5922 
union_add(const isl::union_pw_aff & upa2)5923 isl::union_pw_aff aff::union_add(const isl::union_pw_aff &upa2) const
5924 {
5925   if (!ptr)
5926     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5927   return isl::pw_aff(*this).union_add(upa2);
5928 }
5929 
union_add(const isl::union_pw_multi_aff & upma2)5930 isl::union_pw_multi_aff aff::union_add(const isl::union_pw_multi_aff &upma2) const
5931 {
5932   if (!ptr)
5933     exception::throw_invalid("NULL input", __FILE__, __LINE__);
5934   return isl::pw_aff(*this).union_add(upma2);
5935 }
5936 
zero_on_domain(isl::space space)5937 isl::aff aff::zero_on_domain(isl::space space)
5938 {
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);
5947 }
5948 
5949 inline std::ostream &operator<<(std::ostream &os, const aff &obj)
5950 {
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;
5961 }
5962 
5963 // implementations for isl::aff_list
manage(__isl_take isl_aff_list * ptr)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);
5968 }
manage_copy(__isl_keep isl_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);
5978 }
5979 
aff_list(__isl_take isl_aff_list * ptr)5980 aff_list::aff_list(__isl_take isl_aff_list *ptr)
5981     : ptr(ptr) {}
5982 
aff_list()5983 aff_list::aff_list()
5984     : ptr(nullptr) {}
5985 
aff_list(const aff_list & obj)5986 aff_list::aff_list(const aff_list &obj)
5987     : ptr(nullptr)
5988 {
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);
5996 }
5997 
aff_list(isl::ctx ctx,int n)5998 aff_list::aff_list(isl::ctx ctx, int n)
5999 {
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;
6006 }
6007 
aff_list(isl::aff el)6008 aff_list::aff_list(isl::aff el)
6009 {
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;
6018 }
6019 
aff_list(isl::ctx ctx,const std::string & str)6020 aff_list::aff_list(isl::ctx ctx, const std::string &str)
6021 {
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;
6028 }
6029 
6030 aff_list &aff_list::operator=(aff_list obj) {
6031   std::swap(this->ptr, obj.ptr);
6032   return *this;
6033 }
6034 
~aff_list()6035 aff_list::~aff_list() {
6036   if (ptr)
6037     isl_aff_list_free(ptr);
6038 }
6039 
copy()6040 __isl_give isl_aff_list *aff_list::copy() const & {
6041   return isl_aff_list_copy(ptr);
6042 }
6043 
get()6044 __isl_keep isl_aff_list *aff_list::get() const {
6045   return ptr;
6046 }
6047 
release()6048 __isl_give isl_aff_list *aff_list::release() {
6049   isl_aff_list *tmp = ptr;
6050   ptr = nullptr;
6051   return tmp;
6052 }
6053 
is_null()6054 bool aff_list::is_null() const {
6055   return ptr == nullptr;
6056 }
6057 
ctx()6058 isl::ctx aff_list::ctx() const {
6059   return isl::ctx(isl_aff_list_get_ctx(ptr));
6060 }
6061 
add(isl::aff el)6062 isl::aff_list aff_list::add(isl::aff el) const
6063 {
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);
6072 }
6073 
at(int index)6074 isl::aff aff_list::at(int index) const
6075 {
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);
6084 }
6085 
get_at(int index)6086 isl::aff aff_list::get_at(int index) const
6087 {
6088   return at(index);
6089 }
6090 
clear()6091 isl::aff_list aff_list::clear() const
6092 {
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);
6101 }
6102 
concat(isl::aff_list list2)6103 isl::aff_list aff_list::concat(isl::aff_list list2) const
6104 {
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);
6113 }
6114 
drop(unsigned int first,unsigned int n)6115 isl::aff_list aff_list::drop(unsigned int first, unsigned int n) const
6116 {
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);
6125 }
6126 
foreach(const std::function<void (isl::aff)> & fn)6127 void aff_list::foreach(const std::function<void(isl::aff)> &fn) const
6128 {
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;
6145     }
6146   };
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;
6153 }
6154 
foreach_scc(const std::function<bool (isl::aff,isl::aff)> & follows,const std::function<void (isl::aff_list)> & fn)6155 void aff_list::foreach_scc(const std::function<bool(isl::aff, isl::aff)> &follows, const std::function<void(isl::aff_list)> &fn) const
6156 {
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;
6173     }
6174   };
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;
6187     }
6188   };
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;
6197 }
6198 
insert(unsigned int pos,isl::aff el)6199 isl::aff_list aff_list::insert(unsigned int pos, isl::aff el) const
6200 {
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);
6209 }
6210 
set_at(int index,isl::aff el)6211 isl::aff_list aff_list::set_at(int index, isl::aff el) const
6212 {
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);
6221 }
6222 
size()6223 unsigned aff_list::size() const
6224 {
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;
6233 }
6234 
6235 inline std::ostream &operator<<(std::ostream &os, const aff_list &obj)
6236 {
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;
6247 }
6248 
6249 // implementations for isl::ast_build
manage(__isl_take isl_ast_build * ptr)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);
6254 }
manage_copy(__isl_keep isl_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);
6264 }
6265 
ast_build(__isl_take isl_ast_build * ptr)6266 ast_build::ast_build(__isl_take isl_ast_build *ptr)
6267     : ptr(ptr) {}
6268 
ast_build()6269 ast_build::ast_build()
6270     : ptr(nullptr) {}
6271 
ast_build(const ast_build & obj)6272 ast_build::ast_build(const ast_build &obj)
6273     : ptr(nullptr)
6274 {
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);
6283 }
6284 
ast_build(isl::ctx ctx)6285 ast_build::ast_build(isl::ctx ctx)
6286 {
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;
6293 }
6294 
6295 ast_build &ast_build::operator=(ast_build obj) {
6296   std::swap(this->ptr, obj.ptr);
6297   copy_callbacks(obj);
6298   return *this;
6299 }
6300 
~ast_build()6301 ast_build::~ast_build() {
6302   if (ptr)
6303     isl_ast_build_free(ptr);
6304 }
6305 
copy()6306 __isl_give isl_ast_build *ast_build::copy() const & {
6307   return isl_ast_build_copy(ptr);
6308 }
6309 
get()6310 __isl_keep isl_ast_build *ast_build::get() const {
6311   return ptr;
6312 }
6313 
release()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;
6320 }
6321 
is_null()6322 bool ast_build::is_null() const {
6323   return ptr == nullptr;
6324 }
6325 
ctx()6326 isl::ctx ast_build::ctx() const {
6327   return isl::ctx(isl_ast_build_get_ctx(ptr));
6328 }
6329 
copy_callbacks(const ast_build & obj)6330 ast_build &ast_build::copy_callbacks(const ast_build &obj)
6331 {
6332   at_each_domain_data = obj.at_each_domain_data;
6333   return *this;
6334 }
6335 
at_each_domain(isl_ast_node * arg_0,isl_ast_build * arg_1,void * arg_2)6336 isl_ast_node *ast_build::at_each_domain(isl_ast_node *arg_0, isl_ast_build *arg_1, void *arg_2)
6337 {
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;
6345   }
6346 }
6347 
set_at_each_domain_data(const std::function<isl::ast_node (isl::ast_node,isl::ast_build)> & fn)6348 void ast_build::set_at_each_domain_data(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn)
6349 {
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);
6359 }
6360 
set_at_each_domain(const std::function<isl::ast_node (isl::ast_node,isl::ast_build)> & fn)6361 isl::ast_build ast_build::set_at_each_domain(const std::function<isl::ast_node(isl::ast_node, isl::ast_build)> &fn) const
6362 {
6363   auto copy = *this;
6364   copy.set_at_each_domain_data(fn);
6365   return copy;
6366 }
6367 
access_from(isl::multi_pw_aff mpa)6368 isl::ast_expr ast_build::access_from(isl::multi_pw_aff mpa) const
6369 {
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);
6379   }
6380   if (!res)
6381     exception::throw_last_error(saved_ctx);
6382   return manage(res);
6383 }
6384 
access_from(isl::pw_multi_aff pma)6385 isl::ast_expr ast_build::access_from(isl::pw_multi_aff pma) const
6386 {
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);
6396   }
6397   if (!res)
6398     exception::throw_last_error(saved_ctx);
6399   return manage(res);
6400 }
6401 
call_from(isl::multi_pw_aff mpa)6402 isl::ast_expr ast_build::call_from(isl::multi_pw_aff mpa) const
6403 {
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);
6413   }
6414   if (!res)
6415     exception::throw_last_error(saved_ctx);
6416   return manage(res);
6417 }
6418 
call_from(isl::pw_multi_aff pma)6419 isl::ast_expr ast_build::call_from(isl::pw_multi_aff pma) const
6420 {
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);
6430   }
6431   if (!res)
6432     exception::throw_last_error(saved_ctx);
6433   return manage(res);
6434 }
6435 
expr_from(isl::pw_aff pa)6436 isl::ast_expr ast_build::expr_from(isl::pw_aff pa) const
6437 {
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);
6447   }
6448   if (!res)
6449     exception::throw_last_error(saved_ctx);
6450   return manage(res);
6451 }
6452 
expr_from(isl::set set)6453 isl::ast_expr ast_build::expr_from(isl::set set) const
6454 {
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);
6464   }
6465   if (!res)
6466     exception::throw_last_error(saved_ctx);
6467   return manage(res);
6468 }
6469 
from_context(isl::set set)6470 isl::ast_build ast_build::from_context(isl::set set)
6471 {
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);
6480 }
6481 
node_from(isl::schedule schedule)6482 isl::ast_node ast_build::node_from(isl::schedule schedule) const
6483 {
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);
6493   }
6494   if (!res)
6495     exception::throw_last_error(saved_ctx);
6496   return manage(res);
6497 }
6498 
node_from_schedule_map(isl::union_map schedule)6499 isl::ast_node ast_build::node_from_schedule_map(isl::union_map schedule) const
6500 {
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);
6510   }
6511   if (!res)
6512     exception::throw_last_error(saved_ctx);
6513   return manage(res);
6514 }
6515 
schedule()6516 isl::union_map ast_build::schedule() const
6517 {
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);
6527   }
6528   if (!res)
6529     exception::throw_last_error(saved_ctx);
6530   return manage(res);
6531 }
6532 
get_schedule()6533 isl::union_map ast_build::get_schedule() const
6534 {
6535   return schedule();
6536 }
6537 
6538 // implementations for isl::ast_expr
manage(__isl_take isl_ast_expr * ptr)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);
6543 }
manage_copy(__isl_keep isl_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);
6553 }
6554 
ast_expr(__isl_take isl_ast_expr * ptr)6555 ast_expr::ast_expr(__isl_take isl_ast_expr *ptr)
6556     : ptr(ptr) {}
6557 
ast_expr()6558 ast_expr::ast_expr()
6559     : ptr(nullptr) {}
6560 
ast_expr(const ast_expr & obj)6561 ast_expr::ast_expr(const ast_expr &obj)
6562     : ptr(nullptr)
6563 {
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);
6571 }
6572 
6573 ast_expr &ast_expr::operator=(ast_expr obj) {
6574   std::swap(this->ptr, obj.ptr);
6575   return *this;
6576 }
6577 
~ast_expr()6578 ast_expr::~ast_expr() {
6579   if (ptr)
6580     isl_ast_expr_free(ptr);
6581 }
6582 
copy()6583 __isl_give isl_ast_expr *ast_expr::copy() const & {
6584   return isl_ast_expr_copy(ptr);
6585 }
6586 
get()6587 __isl_keep isl_ast_expr *ast_expr::get() const {
6588   return ptr;
6589 }
6590 
release()6591 __isl_give isl_ast_expr *ast_expr::release() {
6592   isl_ast_expr *tmp = ptr;
6593   ptr = nullptr;
6594   return tmp;
6595 }
6596 
is_null()6597 bool ast_expr::is_null() const {
6598   return ptr == nullptr;
6599 }
6600 
6601 template <typename T, typename>
isa_type(T subtype)6602 bool ast_expr::isa_type(T subtype) const
6603 {
6604   if (is_null())
6605     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6606   return isl_ast_expr_get_type(get()) == subtype;
6607 }
6608 template <class T>
isa()6609 bool ast_expr::isa() const
6610 {
6611   return isa_type<decltype(T::type)>(T::type);
6612 }
6613 template <class T>
as()6614 T ast_expr::as() const
6615 {
6616  if (!isa<T>())
6617     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6618   return T(copy());
6619 }
6620 
ctx()6621 isl::ctx ast_expr::ctx() const {
6622   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6623 }
6624 
to_C_str()6625 std::string ast_expr::to_C_str() const
6626 {
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;
6635 }
6636 
6637 inline std::ostream &operator<<(std::ostream &os, const ast_expr &obj)
6638 {
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;
6649 }
6650 
6651 // implementations for isl::ast_expr_id
ast_expr_id(__isl_take isl_ast_expr * ptr)6652 ast_expr_id::ast_expr_id(__isl_take isl_ast_expr *ptr)
6653     : ast_expr(ptr) {}
6654 
ast_expr_id()6655 ast_expr_id::ast_expr_id()
6656     : ast_expr() {}
6657 
ast_expr_id(const ast_expr_id & obj)6658 ast_expr_id::ast_expr_id(const ast_expr_id &obj)
6659     : ast_expr(obj)
6660 {
6661 }
6662 
6663 ast_expr_id &ast_expr_id::operator=(ast_expr_id obj) {
6664   std::swap(this->ptr, obj.ptr);
6665   return *this;
6666 }
6667 
ctx()6668 isl::ctx ast_expr_id::ctx() const {
6669   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6670 }
6671 
id()6672 isl::id ast_expr_id::id() const
6673 {
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);
6682 }
6683 
get_id()6684 isl::id ast_expr_id::get_id() const
6685 {
6686   return id();
6687 }
6688 
6689 inline std::ostream &operator<<(std::ostream &os, const ast_expr_id &obj)
6690 {
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;
6701 }
6702 
6703 // implementations for isl::ast_expr_int
ast_expr_int(__isl_take isl_ast_expr * ptr)6704 ast_expr_int::ast_expr_int(__isl_take isl_ast_expr *ptr)
6705     : ast_expr(ptr) {}
6706 
ast_expr_int()6707 ast_expr_int::ast_expr_int()
6708     : ast_expr() {}
6709 
ast_expr_int(const ast_expr_int & obj)6710 ast_expr_int::ast_expr_int(const ast_expr_int &obj)
6711     : ast_expr(obj)
6712 {
6713 }
6714 
6715 ast_expr_int &ast_expr_int::operator=(ast_expr_int obj) {
6716   std::swap(this->ptr, obj.ptr);
6717   return *this;
6718 }
6719 
ctx()6720 isl::ctx ast_expr_int::ctx() const {
6721   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6722 }
6723 
val()6724 isl::val ast_expr_int::val() const
6725 {
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);
6734 }
6735 
get_val()6736 isl::val ast_expr_int::get_val() const
6737 {
6738   return val();
6739 }
6740 
6741 inline std::ostream &operator<<(std::ostream &os, const ast_expr_int &obj)
6742 {
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;
6753 }
6754 
6755 // implementations for isl::ast_expr_op
ast_expr_op(__isl_take isl_ast_expr * ptr)6756 ast_expr_op::ast_expr_op(__isl_take isl_ast_expr *ptr)
6757     : ast_expr(ptr) {}
6758 
ast_expr_op()6759 ast_expr_op::ast_expr_op()
6760     : ast_expr() {}
6761 
ast_expr_op(const ast_expr_op & obj)6762 ast_expr_op::ast_expr_op(const ast_expr_op &obj)
6763     : ast_expr(obj)
6764 {
6765 }
6766 
6767 ast_expr_op &ast_expr_op::operator=(ast_expr_op obj) {
6768   std::swap(this->ptr, obj.ptr);
6769   return *this;
6770 }
6771 
6772 template <typename T, typename>
isa_type(T subtype)6773 bool ast_expr_op::isa_type(T subtype) const
6774 {
6775   if (is_null())
6776     exception::throw_invalid("NULL input", __FILE__, __LINE__);
6777   return isl_ast_expr_op_get_type(get()) == subtype;
6778 }
6779 template <class T>
isa()6780 bool ast_expr_op::isa() const
6781 {
6782   return isa_type<decltype(T::type)>(T::type);
6783 }
6784 template <class T>
as()6785 T ast_expr_op::as() const
6786 {
6787  if (!isa<T>())
6788     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
6789   return T(copy());
6790 }
6791 
ctx()6792 isl::ctx ast_expr_op::ctx() const {
6793   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6794 }
6795 
arg(int pos)6796 isl::ast_expr ast_expr_op::arg(int pos) const
6797 {
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);
6806 }
6807 
get_arg(int pos)6808 isl::ast_expr ast_expr_op::get_arg(int pos) const
6809 {
6810   return arg(pos);
6811 }
6812 
n_arg()6813 unsigned ast_expr_op::n_arg() const
6814 {
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;
6823 }
6824 
get_n_arg()6825 unsigned ast_expr_op::get_n_arg() const
6826 {
6827   return n_arg();
6828 }
6829 
6830 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op &obj)
6831 {
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;
6842 }
6843 
6844 // implementations for isl::ast_expr_op_access
ast_expr_op_access(__isl_take isl_ast_expr * ptr)6845 ast_expr_op_access::ast_expr_op_access(__isl_take isl_ast_expr *ptr)
6846     : ast_expr_op(ptr) {}
6847 
ast_expr_op_access()6848 ast_expr_op_access::ast_expr_op_access()
6849     : ast_expr_op() {}
6850 
ast_expr_op_access(const ast_expr_op_access & obj)6851 ast_expr_op_access::ast_expr_op_access(const ast_expr_op_access &obj)
6852     : ast_expr_op(obj)
6853 {
6854 }
6855 
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;
6859 }
6860 
ctx()6861 isl::ctx ast_expr_op_access::ctx() const {
6862   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6863 }
6864 
6865 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_access &obj)
6866 {
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;
6877 }
6878 
6879 // implementations for isl::ast_expr_op_add
ast_expr_op_add(__isl_take isl_ast_expr * ptr)6880 ast_expr_op_add::ast_expr_op_add(__isl_take isl_ast_expr *ptr)
6881     : ast_expr_op(ptr) {}
6882 
ast_expr_op_add()6883 ast_expr_op_add::ast_expr_op_add()
6884     : ast_expr_op() {}
6885 
ast_expr_op_add(const ast_expr_op_add & obj)6886 ast_expr_op_add::ast_expr_op_add(const ast_expr_op_add &obj)
6887     : ast_expr_op(obj)
6888 {
6889 }
6890 
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;
6894 }
6895 
ctx()6896 isl::ctx ast_expr_op_add::ctx() const {
6897   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6898 }
6899 
6900 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_add &obj)
6901 {
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;
6912 }
6913 
6914 // implementations for isl::ast_expr_op_address_of
ast_expr_op_address_of(__isl_take isl_ast_expr * ptr)6915 ast_expr_op_address_of::ast_expr_op_address_of(__isl_take isl_ast_expr *ptr)
6916     : ast_expr_op(ptr) {}
6917 
ast_expr_op_address_of()6918 ast_expr_op_address_of::ast_expr_op_address_of()
6919     : ast_expr_op() {}
6920 
ast_expr_op_address_of(const ast_expr_op_address_of & obj)6921 ast_expr_op_address_of::ast_expr_op_address_of(const ast_expr_op_address_of &obj)
6922     : ast_expr_op(obj)
6923 {
6924 }
6925 
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;
6929 }
6930 
ctx()6931 isl::ctx ast_expr_op_address_of::ctx() const {
6932   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6933 }
6934 
6935 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_address_of &obj)
6936 {
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;
6947 }
6948 
6949 // implementations for isl::ast_expr_op_and
ast_expr_op_and(__isl_take isl_ast_expr * ptr)6950 ast_expr_op_and::ast_expr_op_and(__isl_take isl_ast_expr *ptr)
6951     : ast_expr_op(ptr) {}
6952 
ast_expr_op_and()6953 ast_expr_op_and::ast_expr_op_and()
6954     : ast_expr_op() {}
6955 
ast_expr_op_and(const ast_expr_op_and & obj)6956 ast_expr_op_and::ast_expr_op_and(const ast_expr_op_and &obj)
6957     : ast_expr_op(obj)
6958 {
6959 }
6960 
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;
6964 }
6965 
ctx()6966 isl::ctx ast_expr_op_and::ctx() const {
6967   return isl::ctx(isl_ast_expr_get_ctx(ptr));
6968 }
6969 
6970 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and &obj)
6971 {
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;
6982 }
6983 
6984 // implementations for isl::ast_expr_op_and_then
ast_expr_op_and_then(__isl_take isl_ast_expr * ptr)6985 ast_expr_op_and_then::ast_expr_op_and_then(__isl_take isl_ast_expr *ptr)
6986     : ast_expr_op(ptr) {}
6987 
ast_expr_op_and_then()6988 ast_expr_op_and_then::ast_expr_op_and_then()
6989     : ast_expr_op() {}
6990 
ast_expr_op_and_then(const ast_expr_op_and_then & obj)6991 ast_expr_op_and_then::ast_expr_op_and_then(const ast_expr_op_and_then &obj)
6992     : ast_expr_op(obj)
6993 {
6994 }
6995 
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;
6999 }
7000 
ctx()7001 isl::ctx ast_expr_op_and_then::ctx() const {
7002   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7003 }
7004 
7005 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_and_then &obj)
7006 {
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;
7017 }
7018 
7019 // implementations for isl::ast_expr_op_call
ast_expr_op_call(__isl_take isl_ast_expr * ptr)7020 ast_expr_op_call::ast_expr_op_call(__isl_take isl_ast_expr *ptr)
7021     : ast_expr_op(ptr) {}
7022 
ast_expr_op_call()7023 ast_expr_op_call::ast_expr_op_call()
7024     : ast_expr_op() {}
7025 
ast_expr_op_call(const ast_expr_op_call & obj)7026 ast_expr_op_call::ast_expr_op_call(const ast_expr_op_call &obj)
7027     : ast_expr_op(obj)
7028 {
7029 }
7030 
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;
7034 }
7035 
ctx()7036 isl::ctx ast_expr_op_call::ctx() const {
7037   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7038 }
7039 
7040 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_call &obj)
7041 {
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;
7052 }
7053 
7054 // implementations for isl::ast_expr_op_cond
ast_expr_op_cond(__isl_take isl_ast_expr * ptr)7055 ast_expr_op_cond::ast_expr_op_cond(__isl_take isl_ast_expr *ptr)
7056     : ast_expr_op(ptr) {}
7057 
ast_expr_op_cond()7058 ast_expr_op_cond::ast_expr_op_cond()
7059     : ast_expr_op() {}
7060 
ast_expr_op_cond(const ast_expr_op_cond & obj)7061 ast_expr_op_cond::ast_expr_op_cond(const ast_expr_op_cond &obj)
7062     : ast_expr_op(obj)
7063 {
7064 }
7065 
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;
7069 }
7070 
ctx()7071 isl::ctx ast_expr_op_cond::ctx() const {
7072   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7073 }
7074 
7075 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_cond &obj)
7076 {
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;
7087 }
7088 
7089 // implementations for isl::ast_expr_op_div
ast_expr_op_div(__isl_take isl_ast_expr * ptr)7090 ast_expr_op_div::ast_expr_op_div(__isl_take isl_ast_expr *ptr)
7091     : ast_expr_op(ptr) {}
7092 
ast_expr_op_div()7093 ast_expr_op_div::ast_expr_op_div()
7094     : ast_expr_op() {}
7095 
ast_expr_op_div(const ast_expr_op_div & obj)7096 ast_expr_op_div::ast_expr_op_div(const ast_expr_op_div &obj)
7097     : ast_expr_op(obj)
7098 {
7099 }
7100 
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;
7104 }
7105 
ctx()7106 isl::ctx ast_expr_op_div::ctx() const {
7107   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7108 }
7109 
7110 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_div &obj)
7111 {
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;
7122 }
7123 
7124 // implementations for isl::ast_expr_op_eq
ast_expr_op_eq(__isl_take isl_ast_expr * ptr)7125 ast_expr_op_eq::ast_expr_op_eq(__isl_take isl_ast_expr *ptr)
7126     : ast_expr_op(ptr) {}
7127 
ast_expr_op_eq()7128 ast_expr_op_eq::ast_expr_op_eq()
7129     : ast_expr_op() {}
7130 
ast_expr_op_eq(const ast_expr_op_eq & obj)7131 ast_expr_op_eq::ast_expr_op_eq(const ast_expr_op_eq &obj)
7132     : ast_expr_op(obj)
7133 {
7134 }
7135 
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;
7139 }
7140 
ctx()7141 isl::ctx ast_expr_op_eq::ctx() const {
7142   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7143 }
7144 
7145 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_eq &obj)
7146 {
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;
7157 }
7158 
7159 // implementations for isl::ast_expr_op_fdiv_q
ast_expr_op_fdiv_q(__isl_take isl_ast_expr * ptr)7160 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(__isl_take isl_ast_expr *ptr)
7161     : ast_expr_op(ptr) {}
7162 
ast_expr_op_fdiv_q()7163 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q()
7164     : ast_expr_op() {}
7165 
ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q & obj)7166 ast_expr_op_fdiv_q::ast_expr_op_fdiv_q(const ast_expr_op_fdiv_q &obj)
7167     : ast_expr_op(obj)
7168 {
7169 }
7170 
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;
7174 }
7175 
ctx()7176 isl::ctx ast_expr_op_fdiv_q::ctx() const {
7177   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7178 }
7179 
7180 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_fdiv_q &obj)
7181 {
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;
7192 }
7193 
7194 // implementations for isl::ast_expr_op_ge
ast_expr_op_ge(__isl_take isl_ast_expr * ptr)7195 ast_expr_op_ge::ast_expr_op_ge(__isl_take isl_ast_expr *ptr)
7196     : ast_expr_op(ptr) {}
7197 
ast_expr_op_ge()7198 ast_expr_op_ge::ast_expr_op_ge()
7199     : ast_expr_op() {}
7200 
ast_expr_op_ge(const ast_expr_op_ge & obj)7201 ast_expr_op_ge::ast_expr_op_ge(const ast_expr_op_ge &obj)
7202     : ast_expr_op(obj)
7203 {
7204 }
7205 
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;
7209 }
7210 
ctx()7211 isl::ctx ast_expr_op_ge::ctx() const {
7212   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7213 }
7214 
7215 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_ge &obj)
7216 {
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;
7227 }
7228 
7229 // implementations for isl::ast_expr_op_gt
ast_expr_op_gt(__isl_take isl_ast_expr * ptr)7230 ast_expr_op_gt::ast_expr_op_gt(__isl_take isl_ast_expr *ptr)
7231     : ast_expr_op(ptr) {}
7232 
ast_expr_op_gt()7233 ast_expr_op_gt::ast_expr_op_gt()
7234     : ast_expr_op() {}
7235 
ast_expr_op_gt(const ast_expr_op_gt & obj)7236 ast_expr_op_gt::ast_expr_op_gt(const ast_expr_op_gt &obj)
7237     : ast_expr_op(obj)
7238 {
7239 }
7240 
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;
7244 }
7245 
ctx()7246 isl::ctx ast_expr_op_gt::ctx() const {
7247   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7248 }
7249 
7250 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_gt &obj)
7251 {
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;
7262 }
7263 
7264 // implementations for isl::ast_expr_op_le
ast_expr_op_le(__isl_take isl_ast_expr * ptr)7265 ast_expr_op_le::ast_expr_op_le(__isl_take isl_ast_expr *ptr)
7266     : ast_expr_op(ptr) {}
7267 
ast_expr_op_le()7268 ast_expr_op_le::ast_expr_op_le()
7269     : ast_expr_op() {}
7270 
ast_expr_op_le(const ast_expr_op_le & obj)7271 ast_expr_op_le::ast_expr_op_le(const ast_expr_op_le &obj)
7272     : ast_expr_op(obj)
7273 {
7274 }
7275 
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;
7279 }
7280 
ctx()7281 isl::ctx ast_expr_op_le::ctx() const {
7282   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7283 }
7284 
7285 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_le &obj)
7286 {
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;
7297 }
7298 
7299 // implementations for isl::ast_expr_op_lt
ast_expr_op_lt(__isl_take isl_ast_expr * ptr)7300 ast_expr_op_lt::ast_expr_op_lt(__isl_take isl_ast_expr *ptr)
7301     : ast_expr_op(ptr) {}
7302 
ast_expr_op_lt()7303 ast_expr_op_lt::ast_expr_op_lt()
7304     : ast_expr_op() {}
7305 
ast_expr_op_lt(const ast_expr_op_lt & obj)7306 ast_expr_op_lt::ast_expr_op_lt(const ast_expr_op_lt &obj)
7307     : ast_expr_op(obj)
7308 {
7309 }
7310 
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;
7314 }
7315 
ctx()7316 isl::ctx ast_expr_op_lt::ctx() const {
7317   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7318 }
7319 
7320 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_lt &obj)
7321 {
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;
7332 }
7333 
7334 // implementations for isl::ast_expr_op_max
ast_expr_op_max(__isl_take isl_ast_expr * ptr)7335 ast_expr_op_max::ast_expr_op_max(__isl_take isl_ast_expr *ptr)
7336     : ast_expr_op(ptr) {}
7337 
ast_expr_op_max()7338 ast_expr_op_max::ast_expr_op_max()
7339     : ast_expr_op() {}
7340 
ast_expr_op_max(const ast_expr_op_max & obj)7341 ast_expr_op_max::ast_expr_op_max(const ast_expr_op_max &obj)
7342     : ast_expr_op(obj)
7343 {
7344 }
7345 
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;
7349 }
7350 
ctx()7351 isl::ctx ast_expr_op_max::ctx() const {
7352   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7353 }
7354 
7355 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_max &obj)
7356 {
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;
7367 }
7368 
7369 // implementations for isl::ast_expr_op_member
ast_expr_op_member(__isl_take isl_ast_expr * ptr)7370 ast_expr_op_member::ast_expr_op_member(__isl_take isl_ast_expr *ptr)
7371     : ast_expr_op(ptr) {}
7372 
ast_expr_op_member()7373 ast_expr_op_member::ast_expr_op_member()
7374     : ast_expr_op() {}
7375 
ast_expr_op_member(const ast_expr_op_member & obj)7376 ast_expr_op_member::ast_expr_op_member(const ast_expr_op_member &obj)
7377     : ast_expr_op(obj)
7378 {
7379 }
7380 
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;
7384 }
7385 
ctx()7386 isl::ctx ast_expr_op_member::ctx() const {
7387   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7388 }
7389 
7390 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_member &obj)
7391 {
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;
7402 }
7403 
7404 // implementations for isl::ast_expr_op_min
ast_expr_op_min(__isl_take isl_ast_expr * ptr)7405 ast_expr_op_min::ast_expr_op_min(__isl_take isl_ast_expr *ptr)
7406     : ast_expr_op(ptr) {}
7407 
ast_expr_op_min()7408 ast_expr_op_min::ast_expr_op_min()
7409     : ast_expr_op() {}
7410 
ast_expr_op_min(const ast_expr_op_min & obj)7411 ast_expr_op_min::ast_expr_op_min(const ast_expr_op_min &obj)
7412     : ast_expr_op(obj)
7413 {
7414 }
7415 
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;
7419 }
7420 
ctx()7421 isl::ctx ast_expr_op_min::ctx() const {
7422   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7423 }
7424 
7425 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_min &obj)
7426 {
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;
7437 }
7438 
7439 // implementations for isl::ast_expr_op_minus
ast_expr_op_minus(__isl_take isl_ast_expr * ptr)7440 ast_expr_op_minus::ast_expr_op_minus(__isl_take isl_ast_expr *ptr)
7441     : ast_expr_op(ptr) {}
7442 
ast_expr_op_minus()7443 ast_expr_op_minus::ast_expr_op_minus()
7444     : ast_expr_op() {}
7445 
ast_expr_op_minus(const ast_expr_op_minus & obj)7446 ast_expr_op_minus::ast_expr_op_minus(const ast_expr_op_minus &obj)
7447     : ast_expr_op(obj)
7448 {
7449 }
7450 
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;
7454 }
7455 
ctx()7456 isl::ctx ast_expr_op_minus::ctx() const {
7457   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7458 }
7459 
7460 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_minus &obj)
7461 {
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;
7472 }
7473 
7474 // implementations for isl::ast_expr_op_mul
ast_expr_op_mul(__isl_take isl_ast_expr * ptr)7475 ast_expr_op_mul::ast_expr_op_mul(__isl_take isl_ast_expr *ptr)
7476     : ast_expr_op(ptr) {}
7477 
ast_expr_op_mul()7478 ast_expr_op_mul::ast_expr_op_mul()
7479     : ast_expr_op() {}
7480 
ast_expr_op_mul(const ast_expr_op_mul & obj)7481 ast_expr_op_mul::ast_expr_op_mul(const ast_expr_op_mul &obj)
7482     : ast_expr_op(obj)
7483 {
7484 }
7485 
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;
7489 }
7490 
ctx()7491 isl::ctx ast_expr_op_mul::ctx() const {
7492   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7493 }
7494 
7495 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_mul &obj)
7496 {
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;
7507 }
7508 
7509 // implementations for isl::ast_expr_op_or
ast_expr_op_or(__isl_take isl_ast_expr * ptr)7510 ast_expr_op_or::ast_expr_op_or(__isl_take isl_ast_expr *ptr)
7511     : ast_expr_op(ptr) {}
7512 
ast_expr_op_or()7513 ast_expr_op_or::ast_expr_op_or()
7514     : ast_expr_op() {}
7515 
ast_expr_op_or(const ast_expr_op_or & obj)7516 ast_expr_op_or::ast_expr_op_or(const ast_expr_op_or &obj)
7517     : ast_expr_op(obj)
7518 {
7519 }
7520 
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;
7524 }
7525 
ctx()7526 isl::ctx ast_expr_op_or::ctx() const {
7527   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7528 }
7529 
7530 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or &obj)
7531 {
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;
7542 }
7543 
7544 // implementations for isl::ast_expr_op_or_else
ast_expr_op_or_else(__isl_take isl_ast_expr * ptr)7545 ast_expr_op_or_else::ast_expr_op_or_else(__isl_take isl_ast_expr *ptr)
7546     : ast_expr_op(ptr) {}
7547 
ast_expr_op_or_else()7548 ast_expr_op_or_else::ast_expr_op_or_else()
7549     : ast_expr_op() {}
7550 
ast_expr_op_or_else(const ast_expr_op_or_else & obj)7551 ast_expr_op_or_else::ast_expr_op_or_else(const ast_expr_op_or_else &obj)
7552     : ast_expr_op(obj)
7553 {
7554 }
7555 
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;
7559 }
7560 
ctx()7561 isl::ctx ast_expr_op_or_else::ctx() const {
7562   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7563 }
7564 
7565 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_or_else &obj)
7566 {
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;
7577 }
7578 
7579 // implementations for isl::ast_expr_op_pdiv_q
ast_expr_op_pdiv_q(__isl_take isl_ast_expr * ptr)7580 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(__isl_take isl_ast_expr *ptr)
7581     : ast_expr_op(ptr) {}
7582 
ast_expr_op_pdiv_q()7583 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q()
7584     : ast_expr_op() {}
7585 
ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q & obj)7586 ast_expr_op_pdiv_q::ast_expr_op_pdiv_q(const ast_expr_op_pdiv_q &obj)
7587     : ast_expr_op(obj)
7588 {
7589 }
7590 
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;
7594 }
7595 
ctx()7596 isl::ctx ast_expr_op_pdiv_q::ctx() const {
7597   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7598 }
7599 
7600 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_q &obj)
7601 {
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;
7612 }
7613 
7614 // implementations for isl::ast_expr_op_pdiv_r
ast_expr_op_pdiv_r(__isl_take isl_ast_expr * ptr)7615 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(__isl_take isl_ast_expr *ptr)
7616     : ast_expr_op(ptr) {}
7617 
ast_expr_op_pdiv_r()7618 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r()
7619     : ast_expr_op() {}
7620 
ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r & obj)7621 ast_expr_op_pdiv_r::ast_expr_op_pdiv_r(const ast_expr_op_pdiv_r &obj)
7622     : ast_expr_op(obj)
7623 {
7624 }
7625 
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;
7629 }
7630 
ctx()7631 isl::ctx ast_expr_op_pdiv_r::ctx() const {
7632   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7633 }
7634 
7635 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_pdiv_r &obj)
7636 {
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;
7647 }
7648 
7649 // implementations for isl::ast_expr_op_select
ast_expr_op_select(__isl_take isl_ast_expr * ptr)7650 ast_expr_op_select::ast_expr_op_select(__isl_take isl_ast_expr *ptr)
7651     : ast_expr_op(ptr) {}
7652 
ast_expr_op_select()7653 ast_expr_op_select::ast_expr_op_select()
7654     : ast_expr_op() {}
7655 
ast_expr_op_select(const ast_expr_op_select & obj)7656 ast_expr_op_select::ast_expr_op_select(const ast_expr_op_select &obj)
7657     : ast_expr_op(obj)
7658 {
7659 }
7660 
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;
7664 }
7665 
ctx()7666 isl::ctx ast_expr_op_select::ctx() const {
7667   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7668 }
7669 
7670 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_select &obj)
7671 {
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;
7682 }
7683 
7684 // implementations for isl::ast_expr_op_sub
ast_expr_op_sub(__isl_take isl_ast_expr * ptr)7685 ast_expr_op_sub::ast_expr_op_sub(__isl_take isl_ast_expr *ptr)
7686     : ast_expr_op(ptr) {}
7687 
ast_expr_op_sub()7688 ast_expr_op_sub::ast_expr_op_sub()
7689     : ast_expr_op() {}
7690 
ast_expr_op_sub(const ast_expr_op_sub & obj)7691 ast_expr_op_sub::ast_expr_op_sub(const ast_expr_op_sub &obj)
7692     : ast_expr_op(obj)
7693 {
7694 }
7695 
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;
7699 }
7700 
ctx()7701 isl::ctx ast_expr_op_sub::ctx() const {
7702   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7703 }
7704 
7705 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_sub &obj)
7706 {
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;
7717 }
7718 
7719 // implementations for isl::ast_expr_op_zdiv_r
ast_expr_op_zdiv_r(__isl_take isl_ast_expr * ptr)7720 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(__isl_take isl_ast_expr *ptr)
7721     : ast_expr_op(ptr) {}
7722 
ast_expr_op_zdiv_r()7723 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r()
7724     : ast_expr_op() {}
7725 
ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r & obj)7726 ast_expr_op_zdiv_r::ast_expr_op_zdiv_r(const ast_expr_op_zdiv_r &obj)
7727     : ast_expr_op(obj)
7728 {
7729 }
7730 
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;
7734 }
7735 
ctx()7736 isl::ctx ast_expr_op_zdiv_r::ctx() const {
7737   return isl::ctx(isl_ast_expr_get_ctx(ptr));
7738 }
7739 
7740 inline std::ostream &operator<<(std::ostream &os, const ast_expr_op_zdiv_r &obj)
7741 {
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;
7752 }
7753 
7754 // implementations for isl::ast_node
manage(__isl_take isl_ast_node * ptr)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);
7759 }
manage_copy(__isl_keep isl_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);
7769 }
7770 
ast_node(__isl_take isl_ast_node * ptr)7771 ast_node::ast_node(__isl_take isl_ast_node *ptr)
7772     : ptr(ptr) {}
7773 
ast_node()7774 ast_node::ast_node()
7775     : ptr(nullptr) {}
7776 
ast_node(const ast_node & obj)7777 ast_node::ast_node(const ast_node &obj)
7778     : ptr(nullptr)
7779 {
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);
7787 }
7788 
7789 ast_node &ast_node::operator=(ast_node obj) {
7790   std::swap(this->ptr, obj.ptr);
7791   return *this;
7792 }
7793 
~ast_node()7794 ast_node::~ast_node() {
7795   if (ptr)
7796     isl_ast_node_free(ptr);
7797 }
7798 
copy()7799 __isl_give isl_ast_node *ast_node::copy() const & {
7800   return isl_ast_node_copy(ptr);
7801 }
7802 
get()7803 __isl_keep isl_ast_node *ast_node::get() const {
7804   return ptr;
7805 }
7806 
release()7807 __isl_give isl_ast_node *ast_node::release() {
7808   isl_ast_node *tmp = ptr;
7809   ptr = nullptr;
7810   return tmp;
7811 }
7812 
is_null()7813 bool ast_node::is_null() const {
7814   return ptr == nullptr;
7815 }
7816 
7817 template <typename T, typename>
isa_type(T subtype)7818 bool ast_node::isa_type(T subtype) const
7819 {
7820   if (is_null())
7821     exception::throw_invalid("NULL input", __FILE__, __LINE__);
7822   return isl_ast_node_get_type(get()) == subtype;
7823 }
7824 template <class T>
isa()7825 bool ast_node::isa() const
7826 {
7827   return isa_type<decltype(T::type)>(T::type);
7828 }
7829 template <class T>
as()7830 T ast_node::as() const
7831 {
7832  if (!isa<T>())
7833     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
7834   return T(copy());
7835 }
7836 
ctx()7837 isl::ctx ast_node::ctx() const {
7838   return isl::ctx(isl_ast_node_get_ctx(ptr));
7839 }
7840 
map_descendant_bottom_up(const std::function<isl::ast_node (isl::ast_node)> & fn)7841 isl::ast_node ast_node::map_descendant_bottom_up(const std::function<isl::ast_node(isl::ast_node)> &fn) const
7842 {
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;
7859     }
7860   };
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);
7867 }
7868 
to_C_str()7869 std::string ast_node::to_C_str() const
7870 {
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;
7879 }
7880 
to_list()7881 isl::ast_node_list ast_node::to_list() const
7882 {
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);
7891 }
7892 
7893 inline std::ostream &operator<<(std::ostream &os, const ast_node &obj)
7894 {
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;
7905 }
7906 
7907 // implementations for isl::ast_node_block
ast_node_block(__isl_take isl_ast_node * ptr)7908 ast_node_block::ast_node_block(__isl_take isl_ast_node *ptr)
7909     : ast_node(ptr) {}
7910 
ast_node_block()7911 ast_node_block::ast_node_block()
7912     : ast_node() {}
7913 
ast_node_block(const ast_node_block & obj)7914 ast_node_block::ast_node_block(const ast_node_block &obj)
7915     : ast_node(obj)
7916 {
7917 }
7918 
ast_node_block(isl::ast_node_list list)7919 ast_node_block::ast_node_block(isl::ast_node_list list)
7920 {
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;
7929 }
7930 
7931 ast_node_block &ast_node_block::operator=(ast_node_block obj) {
7932   std::swap(this->ptr, obj.ptr);
7933   return *this;
7934 }
7935 
ctx()7936 isl::ctx ast_node_block::ctx() const {
7937   return isl::ctx(isl_ast_node_get_ctx(ptr));
7938 }
7939 
children()7940 isl::ast_node_list ast_node_block::children() const
7941 {
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);
7950 }
7951 
get_children()7952 isl::ast_node_list ast_node_block::get_children() const
7953 {
7954   return children();
7955 }
7956 
7957 inline std::ostream &operator<<(std::ostream &os, const ast_node_block &obj)
7958 {
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;
7969 }
7970 
7971 // implementations for isl::ast_node_for
ast_node_for(__isl_take isl_ast_node * ptr)7972 ast_node_for::ast_node_for(__isl_take isl_ast_node *ptr)
7973     : ast_node(ptr) {}
7974 
ast_node_for()7975 ast_node_for::ast_node_for()
7976     : ast_node() {}
7977 
ast_node_for(const ast_node_for & obj)7978 ast_node_for::ast_node_for(const ast_node_for &obj)
7979     : ast_node(obj)
7980 {
7981 }
7982 
7983 ast_node_for &ast_node_for::operator=(ast_node_for obj) {
7984   std::swap(this->ptr, obj.ptr);
7985   return *this;
7986 }
7987 
ctx()7988 isl::ctx ast_node_for::ctx() const {
7989   return isl::ctx(isl_ast_node_get_ctx(ptr));
7990 }
7991 
body()7992 isl::ast_node ast_node_for::body() const
7993 {
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);
8002 }
8003 
get_body()8004 isl::ast_node ast_node_for::get_body() const
8005 {
8006   return body();
8007 }
8008 
cond()8009 isl::ast_expr ast_node_for::cond() const
8010 {
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);
8019 }
8020 
get_cond()8021 isl::ast_expr ast_node_for::get_cond() const
8022 {
8023   return cond();
8024 }
8025 
inc()8026 isl::ast_expr ast_node_for::inc() const
8027 {
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);
8036 }
8037 
get_inc()8038 isl::ast_expr ast_node_for::get_inc() const
8039 {
8040   return inc();
8041 }
8042 
init()8043 isl::ast_expr ast_node_for::init() const
8044 {
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);
8053 }
8054 
get_init()8055 isl::ast_expr ast_node_for::get_init() const
8056 {
8057   return init();
8058 }
8059 
is_degenerate()8060 bool ast_node_for::is_degenerate() const
8061 {
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;
8070 }
8071 
iterator()8072 isl::ast_expr ast_node_for::iterator() const
8073 {
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);
8082 }
8083 
get_iterator()8084 isl::ast_expr ast_node_for::get_iterator() const
8085 {
8086   return iterator();
8087 }
8088 
8089 inline std::ostream &operator<<(std::ostream &os, const ast_node_for &obj)
8090 {
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;
8101 }
8102 
8103 // implementations for isl::ast_node_if
ast_node_if(__isl_take isl_ast_node * ptr)8104 ast_node_if::ast_node_if(__isl_take isl_ast_node *ptr)
8105     : ast_node(ptr) {}
8106 
ast_node_if()8107 ast_node_if::ast_node_if()
8108     : ast_node() {}
8109 
ast_node_if(const ast_node_if & obj)8110 ast_node_if::ast_node_if(const ast_node_if &obj)
8111     : ast_node(obj)
8112 {
8113 }
8114 
8115 ast_node_if &ast_node_if::operator=(ast_node_if obj) {
8116   std::swap(this->ptr, obj.ptr);
8117   return *this;
8118 }
8119 
ctx()8120 isl::ctx ast_node_if::ctx() const {
8121   return isl::ctx(isl_ast_node_get_ctx(ptr));
8122 }
8123 
cond()8124 isl::ast_expr ast_node_if::cond() const
8125 {
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);
8134 }
8135 
get_cond()8136 isl::ast_expr ast_node_if::get_cond() const
8137 {
8138   return cond();
8139 }
8140 
else_node()8141 isl::ast_node ast_node_if::else_node() const
8142 {
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);
8151 }
8152 
get_else_node()8153 isl::ast_node ast_node_if::get_else_node() const
8154 {
8155   return else_node();
8156 }
8157 
has_else_node()8158 bool ast_node_if::has_else_node() const
8159 {
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;
8168 }
8169 
then_node()8170 isl::ast_node ast_node_if::then_node() const
8171 {
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);
8180 }
8181 
get_then_node()8182 isl::ast_node ast_node_if::get_then_node() const
8183 {
8184   return then_node();
8185 }
8186 
8187 inline std::ostream &operator<<(std::ostream &os, const ast_node_if &obj)
8188 {
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;
8199 }
8200 
8201 // implementations for isl::ast_node_list
manage(__isl_take isl_ast_node_list * ptr)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);
8206 }
manage_copy(__isl_keep isl_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);
8216 }
8217 
ast_node_list(__isl_take isl_ast_node_list * ptr)8218 ast_node_list::ast_node_list(__isl_take isl_ast_node_list *ptr)
8219     : ptr(ptr) {}
8220 
ast_node_list()8221 ast_node_list::ast_node_list()
8222     : ptr(nullptr) {}
8223 
ast_node_list(const ast_node_list & obj)8224 ast_node_list::ast_node_list(const ast_node_list &obj)
8225     : ptr(nullptr)
8226 {
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);
8234 }
8235 
ast_node_list(isl::ctx ctx,int n)8236 ast_node_list::ast_node_list(isl::ctx ctx, int n)
8237 {
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;
8244 }
8245 
ast_node_list(isl::ast_node el)8246 ast_node_list::ast_node_list(isl::ast_node el)
8247 {
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;
8256 }
8257 
8258 ast_node_list &ast_node_list::operator=(ast_node_list obj) {
8259   std::swap(this->ptr, obj.ptr);
8260   return *this;
8261 }
8262 
~ast_node_list()8263 ast_node_list::~ast_node_list() {
8264   if (ptr)
8265     isl_ast_node_list_free(ptr);
8266 }
8267 
copy()8268 __isl_give isl_ast_node_list *ast_node_list::copy() const & {
8269   return isl_ast_node_list_copy(ptr);
8270 }
8271 
get()8272 __isl_keep isl_ast_node_list *ast_node_list::get() const {
8273   return ptr;
8274 }
8275 
release()8276 __isl_give isl_ast_node_list *ast_node_list::release() {
8277   isl_ast_node_list *tmp = ptr;
8278   ptr = nullptr;
8279   return tmp;
8280 }
8281 
is_null()8282 bool ast_node_list::is_null() const {
8283   return ptr == nullptr;
8284 }
8285 
ctx()8286 isl::ctx ast_node_list::ctx() const {
8287   return isl::ctx(isl_ast_node_list_get_ctx(ptr));
8288 }
8289 
add(isl::ast_node el)8290 isl::ast_node_list ast_node_list::add(isl::ast_node el) const
8291 {
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);
8300 }
8301 
at(int index)8302 isl::ast_node ast_node_list::at(int index) const
8303 {
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);
8312 }
8313 
get_at(int index)8314 isl::ast_node ast_node_list::get_at(int index) const
8315 {
8316   return at(index);
8317 }
8318 
clear()8319 isl::ast_node_list ast_node_list::clear() const
8320 {
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);
8329 }
8330 
concat(isl::ast_node_list list2)8331 isl::ast_node_list ast_node_list::concat(isl::ast_node_list list2) const
8332 {
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);
8341 }
8342 
drop(unsigned int first,unsigned int n)8343 isl::ast_node_list ast_node_list::drop(unsigned int first, unsigned int n) const
8344 {
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);
8353 }
8354 
foreach(const std::function<void (isl::ast_node)> & fn)8355 void ast_node_list::foreach(const std::function<void(isl::ast_node)> &fn) const
8356 {
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;
8373     }
8374   };
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;
8381 }
8382 
foreach_scc(const std::function<bool (isl::ast_node,isl::ast_node)> & follows,const std::function<void (isl::ast_node_list)> & fn)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
8384 {
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;
8401     }
8402   };
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;
8415     }
8416   };
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;
8425 }
8426 
insert(unsigned int pos,isl::ast_node el)8427 isl::ast_node_list ast_node_list::insert(unsigned int pos, isl::ast_node el) const
8428 {
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);
8437 }
8438 
set_at(int index,isl::ast_node el)8439 isl::ast_node_list ast_node_list::set_at(int index, isl::ast_node el) const
8440 {
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);
8449 }
8450 
size()8451 unsigned ast_node_list::size() const
8452 {
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;
8461 }
8462 
8463 inline std::ostream &operator<<(std::ostream &os, const ast_node_list &obj)
8464 {
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;
8475 }
8476 
8477 // implementations for isl::ast_node_mark
ast_node_mark(__isl_take isl_ast_node * ptr)8478 ast_node_mark::ast_node_mark(__isl_take isl_ast_node *ptr)
8479     : ast_node(ptr) {}
8480 
ast_node_mark()8481 ast_node_mark::ast_node_mark()
8482     : ast_node() {}
8483 
ast_node_mark(const ast_node_mark & obj)8484 ast_node_mark::ast_node_mark(const ast_node_mark &obj)
8485     : ast_node(obj)
8486 {
8487 }
8488 
8489 ast_node_mark &ast_node_mark::operator=(ast_node_mark obj) {
8490   std::swap(this->ptr, obj.ptr);
8491   return *this;
8492 }
8493 
ctx()8494 isl::ctx ast_node_mark::ctx() const {
8495   return isl::ctx(isl_ast_node_get_ctx(ptr));
8496 }
8497 
id()8498 isl::id ast_node_mark::id() const
8499 {
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);
8508 }
8509 
get_id()8510 isl::id ast_node_mark::get_id() const
8511 {
8512   return id();
8513 }
8514 
node()8515 isl::ast_node ast_node_mark::node() const
8516 {
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);
8525 }
8526 
get_node()8527 isl::ast_node ast_node_mark::get_node() const
8528 {
8529   return node();
8530 }
8531 
8532 inline std::ostream &operator<<(std::ostream &os, const ast_node_mark &obj)
8533 {
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;
8544 }
8545 
8546 // implementations for isl::ast_node_user
ast_node_user(__isl_take isl_ast_node * ptr)8547 ast_node_user::ast_node_user(__isl_take isl_ast_node *ptr)
8548     : ast_node(ptr) {}
8549 
ast_node_user()8550 ast_node_user::ast_node_user()
8551     : ast_node() {}
8552 
ast_node_user(const ast_node_user & obj)8553 ast_node_user::ast_node_user(const ast_node_user &obj)
8554     : ast_node(obj)
8555 {
8556 }
8557 
ast_node_user(isl::ast_expr expr)8558 ast_node_user::ast_node_user(isl::ast_expr expr)
8559 {
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;
8568 }
8569 
8570 ast_node_user &ast_node_user::operator=(ast_node_user obj) {
8571   std::swap(this->ptr, obj.ptr);
8572   return *this;
8573 }
8574 
ctx()8575 isl::ctx ast_node_user::ctx() const {
8576   return isl::ctx(isl_ast_node_get_ctx(ptr));
8577 }
8578 
expr()8579 isl::ast_expr ast_node_user::expr() const
8580 {
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);
8589 }
8590 
get_expr()8591 isl::ast_expr ast_node_user::get_expr() const
8592 {
8593   return expr();
8594 }
8595 
8596 inline std::ostream &operator<<(std::ostream &os, const ast_node_user &obj)
8597 {
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;
8608 }
8609 
8610 // implementations for isl::basic_map
manage(__isl_take isl_basic_map * ptr)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);
8615 }
manage_copy(__isl_keep isl_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);
8625 }
8626 
basic_map(__isl_take isl_basic_map * ptr)8627 basic_map::basic_map(__isl_take isl_basic_map *ptr)
8628     : ptr(ptr) {}
8629 
basic_map()8630 basic_map::basic_map()
8631     : ptr(nullptr) {}
8632 
basic_map(const basic_map & obj)8633 basic_map::basic_map(const basic_map &obj)
8634     : ptr(nullptr)
8635 {
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);
8643 }
8644 
basic_map(isl::ctx ctx,const std::string & str)8645 basic_map::basic_map(isl::ctx ctx, const std::string &str)
8646 {
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;
8653 }
8654 
8655 basic_map &basic_map::operator=(basic_map obj) {
8656   std::swap(this->ptr, obj.ptr);
8657   return *this;
8658 }
8659 
~basic_map()8660 basic_map::~basic_map() {
8661   if (ptr)
8662     isl_basic_map_free(ptr);
8663 }
8664 
copy()8665 __isl_give isl_basic_map *basic_map::copy() const & {
8666   return isl_basic_map_copy(ptr);
8667 }
8668 
get()8669 __isl_keep isl_basic_map *basic_map::get() const {
8670   return ptr;
8671 }
8672 
release()8673 __isl_give isl_basic_map *basic_map::release() {
8674   isl_basic_map *tmp = ptr;
8675   ptr = nullptr;
8676   return tmp;
8677 }
8678 
is_null()8679 bool basic_map::is_null() const {
8680   return ptr == nullptr;
8681 }
8682 
ctx()8683 isl::ctx basic_map::ctx() const {
8684   return isl::ctx(isl_basic_map_get_ctx(ptr));
8685 }
8686 
affine_hull()8687 isl::basic_map basic_map::affine_hull() const
8688 {
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);
8697 }
8698 
apply_domain(isl::basic_map bmap2)8699 isl::basic_map basic_map::apply_domain(isl::basic_map bmap2) const
8700 {
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);
8709 }
8710 
apply_domain(const isl::map & map2)8711 isl::map basic_map::apply_domain(const isl::map &map2) const
8712 {
8713   if (!ptr)
8714     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8715   return isl::map(*this).apply_domain(map2);
8716 }
8717 
apply_domain(const isl::union_map & umap2)8718 isl::union_map basic_map::apply_domain(const isl::union_map &umap2) const
8719 {
8720   if (!ptr)
8721     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8722   return isl::map(*this).apply_domain(umap2);
8723 }
8724 
apply_range(isl::basic_map bmap2)8725 isl::basic_map basic_map::apply_range(isl::basic_map bmap2) const
8726 {
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);
8735 }
8736 
apply_range(const isl::map & map2)8737 isl::map basic_map::apply_range(const isl::map &map2) const
8738 {
8739   if (!ptr)
8740     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8741   return isl::map(*this).apply_range(map2);
8742 }
8743 
apply_range(const isl::union_map & umap2)8744 isl::union_map basic_map::apply_range(const isl::union_map &umap2) const
8745 {
8746   if (!ptr)
8747     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8748   return isl::map(*this).apply_range(umap2);
8749 }
8750 
as_map()8751 isl::map basic_map::as_map() const
8752 {
8753   if (!ptr)
8754     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8755   return isl::map(*this).as_map();
8756 }
8757 
as_multi_union_pw_aff()8758 isl::multi_union_pw_aff basic_map::as_multi_union_pw_aff() const
8759 {
8760   if (!ptr)
8761     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8762   return isl::map(*this).as_multi_union_pw_aff();
8763 }
8764 
as_pw_multi_aff()8765 isl::pw_multi_aff basic_map::as_pw_multi_aff() const
8766 {
8767   if (!ptr)
8768     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8769   return isl::map(*this).as_pw_multi_aff();
8770 }
8771 
as_union_pw_multi_aff()8772 isl::union_pw_multi_aff basic_map::as_union_pw_multi_aff() const
8773 {
8774   if (!ptr)
8775     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8776   return isl::map(*this).as_union_pw_multi_aff();
8777 }
8778 
bind_domain(const isl::multi_id & tuple)8779 isl::set basic_map::bind_domain(const isl::multi_id &tuple) const
8780 {
8781   if (!ptr)
8782     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8783   return isl::map(*this).bind_domain(tuple);
8784 }
8785 
bind_range(const isl::multi_id & tuple)8786 isl::set basic_map::bind_range(const isl::multi_id &tuple) const
8787 {
8788   if (!ptr)
8789     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8790   return isl::map(*this).bind_range(tuple);
8791 }
8792 
coalesce()8793 isl::map basic_map::coalesce() const
8794 {
8795   if (!ptr)
8796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8797   return isl::map(*this).coalesce();
8798 }
8799 
complement()8800 isl::map basic_map::complement() const
8801 {
8802   if (!ptr)
8803     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8804   return isl::map(*this).complement();
8805 }
8806 
compute_divs()8807 isl::union_map basic_map::compute_divs() const
8808 {
8809   if (!ptr)
8810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8811   return isl::map(*this).compute_divs();
8812 }
8813 
curry()8814 isl::map basic_map::curry() const
8815 {
8816   if (!ptr)
8817     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8818   return isl::map(*this).curry();
8819 }
8820 
deltas()8821 isl::basic_set basic_map::deltas() const
8822 {
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);
8831 }
8832 
detect_equalities()8833 isl::basic_map basic_map::detect_equalities() const
8834 {
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);
8843 }
8844 
domain()8845 isl::set basic_map::domain() const
8846 {
8847   if (!ptr)
8848     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8849   return isl::map(*this).domain();
8850 }
8851 
domain_factor_domain()8852 isl::map basic_map::domain_factor_domain() const
8853 {
8854   if (!ptr)
8855     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8856   return isl::map(*this).domain_factor_domain();
8857 }
8858 
domain_factor_range()8859 isl::map basic_map::domain_factor_range() const
8860 {
8861   if (!ptr)
8862     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8863   return isl::map(*this).domain_factor_range();
8864 }
8865 
domain_map()8866 isl::union_map basic_map::domain_map() const
8867 {
8868   if (!ptr)
8869     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8870   return isl::map(*this).domain_map();
8871 }
8872 
domain_map_union_pw_multi_aff()8873 isl::union_pw_multi_aff basic_map::domain_map_union_pw_multi_aff() const
8874 {
8875   if (!ptr)
8876     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8877   return isl::map(*this).domain_map_union_pw_multi_aff();
8878 }
8879 
domain_product(const isl::map & map2)8880 isl::map basic_map::domain_product(const isl::map &map2) const
8881 {
8882   if (!ptr)
8883     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8884   return isl::map(*this).domain_product(map2);
8885 }
8886 
domain_product(const isl::union_map & umap2)8887 isl::union_map basic_map::domain_product(const isl::union_map &umap2) const
8888 {
8889   if (!ptr)
8890     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8891   return isl::map(*this).domain_product(umap2);
8892 }
8893 
domain_reverse()8894 isl::map basic_map::domain_reverse() const
8895 {
8896   if (!ptr)
8897     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8898   return isl::map(*this).domain_reverse();
8899 }
8900 
domain_tuple_dim()8901 unsigned basic_map::domain_tuple_dim() const
8902 {
8903   if (!ptr)
8904     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8905   return isl::map(*this).domain_tuple_dim();
8906 }
8907 
domain_tuple_id()8908 isl::id basic_map::domain_tuple_id() const
8909 {
8910   if (!ptr)
8911     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8912   return isl::map(*this).domain_tuple_id();
8913 }
8914 
drop_unused_params()8915 isl::map basic_map::drop_unused_params() const
8916 {
8917   if (!ptr)
8918     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8919   return isl::map(*this).drop_unused_params();
8920 }
8921 
eq_at(const isl::multi_pw_aff & mpa)8922 isl::map basic_map::eq_at(const isl::multi_pw_aff &mpa) const
8923 {
8924   if (!ptr)
8925     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8926   return isl::map(*this).eq_at(mpa);
8927 }
8928 
eq_at(const isl::multi_union_pw_aff & mupa)8929 isl::union_map basic_map::eq_at(const isl::multi_union_pw_aff &mupa) const
8930 {
8931   if (!ptr)
8932     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8933   return isl::map(*this).eq_at(mupa);
8934 }
8935 
every_map(const std::function<bool (isl::map)> & test)8936 bool basic_map::every_map(const std::function<bool(isl::map)> &test) const
8937 {
8938   if (!ptr)
8939     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8940   return isl::map(*this).every_map(test);
8941 }
8942 
extract_map(const isl::space & space)8943 isl::map basic_map::extract_map(const isl::space &space) const
8944 {
8945   if (!ptr)
8946     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8947   return isl::map(*this).extract_map(space);
8948 }
8949 
factor_domain()8950 isl::map basic_map::factor_domain() const
8951 {
8952   if (!ptr)
8953     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8954   return isl::map(*this).factor_domain();
8955 }
8956 
factor_range()8957 isl::map basic_map::factor_range() const
8958 {
8959   if (!ptr)
8960     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8961   return isl::map(*this).factor_range();
8962 }
8963 
fixed_power(const isl::val & exp)8964 isl::map basic_map::fixed_power(const isl::val &exp) const
8965 {
8966   if (!ptr)
8967     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8968   return isl::map(*this).fixed_power(exp);
8969 }
8970 
fixed_power(long exp)8971 isl::map basic_map::fixed_power(long exp) const
8972 {
8973   if (!ptr)
8974     exception::throw_invalid("NULL input", __FILE__, __LINE__);
8975   return this->fixed_power(isl::val(ctx(), exp));
8976 }
8977 
flatten()8978 isl::basic_map basic_map::flatten() const
8979 {
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);
8988 }
8989 
flatten_domain()8990 isl::basic_map basic_map::flatten_domain() const
8991 {
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);
9000 }
9001 
flatten_range()9002 isl::basic_map basic_map::flatten_range() const
9003 {
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);
9012 }
9013 
foreach_basic_map(const std::function<void (isl::basic_map)> & fn)9014 void basic_map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
9015 {
9016   if (!ptr)
9017     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9018   return isl::map(*this).foreach_basic_map(fn);
9019 }
9020 
foreach_map(const std::function<void (isl::map)> & fn)9021 void basic_map::foreach_map(const std::function<void(isl::map)> &fn) const
9022 {
9023   if (!ptr)
9024     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9025   return isl::map(*this).foreach_map(fn);
9026 }
9027 
gist(isl::basic_map context)9028 isl::basic_map basic_map::gist(isl::basic_map context) const
9029 {
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);
9038 }
9039 
gist(const isl::map & context)9040 isl::map basic_map::gist(const isl::map &context) const
9041 {
9042   if (!ptr)
9043     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9044   return isl::map(*this).gist(context);
9045 }
9046 
gist(const isl::union_map & context)9047 isl::union_map basic_map::gist(const isl::union_map &context) const
9048 {
9049   if (!ptr)
9050     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9051   return isl::map(*this).gist(context);
9052 }
9053 
gist_domain(const isl::set & context)9054 isl::map basic_map::gist_domain(const isl::set &context) const
9055 {
9056   if (!ptr)
9057     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9058   return isl::map(*this).gist_domain(context);
9059 }
9060 
gist_domain(const isl::union_set & uset)9061 isl::union_map basic_map::gist_domain(const isl::union_set &uset) const
9062 {
9063   if (!ptr)
9064     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9065   return isl::map(*this).gist_domain(uset);
9066 }
9067 
gist_params(const isl::set & context)9068 isl::map basic_map::gist_params(const isl::set &context) const
9069 {
9070   if (!ptr)
9071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9072   return isl::map(*this).gist_params(context);
9073 }
9074 
gist_range(const isl::union_set & uset)9075 isl::union_map basic_map::gist_range(const isl::union_set &uset) const
9076 {
9077   if (!ptr)
9078     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9079   return isl::map(*this).gist_range(uset);
9080 }
9081 
has_domain_tuple_id()9082 bool basic_map::has_domain_tuple_id() const
9083 {
9084   if (!ptr)
9085     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9086   return isl::map(*this).has_domain_tuple_id();
9087 }
9088 
has_range_tuple_id()9089 bool basic_map::has_range_tuple_id() const
9090 {
9091   if (!ptr)
9092     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9093   return isl::map(*this).has_range_tuple_id();
9094 }
9095 
intersect(isl::basic_map bmap2)9096 isl::basic_map basic_map::intersect(isl::basic_map bmap2) const
9097 {
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);
9106 }
9107 
intersect(const isl::map & map2)9108 isl::map basic_map::intersect(const isl::map &map2) const
9109 {
9110   if (!ptr)
9111     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9112   return isl::map(*this).intersect(map2);
9113 }
9114 
intersect(const isl::union_map & umap2)9115 isl::union_map basic_map::intersect(const isl::union_map &umap2) const
9116 {
9117   if (!ptr)
9118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9119   return isl::map(*this).intersect(umap2);
9120 }
9121 
intersect_domain(isl::basic_set bset)9122 isl::basic_map basic_map::intersect_domain(isl::basic_set bset) const
9123 {
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);
9132 }
9133 
intersect_domain(const isl::set & set)9134 isl::map basic_map::intersect_domain(const isl::set &set) const
9135 {
9136   if (!ptr)
9137     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9138   return isl::map(*this).intersect_domain(set);
9139 }
9140 
intersect_domain(const isl::space & space)9141 isl::union_map basic_map::intersect_domain(const isl::space &space) const
9142 {
9143   if (!ptr)
9144     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9145   return isl::map(*this).intersect_domain(space);
9146 }
9147 
intersect_domain(const isl::union_set & uset)9148 isl::union_map basic_map::intersect_domain(const isl::union_set &uset) const
9149 {
9150   if (!ptr)
9151     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9152   return isl::map(*this).intersect_domain(uset);
9153 }
9154 
intersect_domain(const isl::point & bset)9155 isl::basic_map basic_map::intersect_domain(const isl::point &bset) const
9156 {
9157   if (!ptr)
9158     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9159   return this->intersect_domain(isl::basic_set(bset));
9160 }
9161 
intersect_domain_factor_domain(const isl::map & factor)9162 isl::map basic_map::intersect_domain_factor_domain(const isl::map &factor) const
9163 {
9164   if (!ptr)
9165     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9166   return isl::map(*this).intersect_domain_factor_domain(factor);
9167 }
9168 
intersect_domain_factor_domain(const isl::union_map & factor)9169 isl::union_map basic_map::intersect_domain_factor_domain(const isl::union_map &factor) const
9170 {
9171   if (!ptr)
9172     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9173   return isl::map(*this).intersect_domain_factor_domain(factor);
9174 }
9175 
intersect_domain_factor_range(const isl::map & factor)9176 isl::map basic_map::intersect_domain_factor_range(const isl::map &factor) const
9177 {
9178   if (!ptr)
9179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9180   return isl::map(*this).intersect_domain_factor_range(factor);
9181 }
9182 
intersect_domain_factor_range(const isl::union_map & factor)9183 isl::union_map basic_map::intersect_domain_factor_range(const isl::union_map &factor) const
9184 {
9185   if (!ptr)
9186     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9187   return isl::map(*this).intersect_domain_factor_range(factor);
9188 }
9189 
intersect_domain_wrapped_domain(const isl::set & domain)9190 isl::map basic_map::intersect_domain_wrapped_domain(const isl::set &domain) const
9191 {
9192   if (!ptr)
9193     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9194   return isl::map(*this).intersect_domain_wrapped_domain(domain);
9195 }
9196 
intersect_domain_wrapped_domain(const isl::union_set & domain)9197 isl::union_map basic_map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
9198 {
9199   if (!ptr)
9200     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9201   return isl::map(*this).intersect_domain_wrapped_domain(domain);
9202 }
9203 
intersect_params(const isl::set & params)9204 isl::map basic_map::intersect_params(const isl::set &params) const
9205 {
9206   if (!ptr)
9207     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9208   return isl::map(*this).intersect_params(params);
9209 }
9210 
intersect_range(isl::basic_set bset)9211 isl::basic_map basic_map::intersect_range(isl::basic_set bset) const
9212 {
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);
9221 }
9222 
intersect_range(const isl::set & set)9223 isl::map basic_map::intersect_range(const isl::set &set) const
9224 {
9225   if (!ptr)
9226     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9227   return isl::map(*this).intersect_range(set);
9228 }
9229 
intersect_range(const isl::space & space)9230 isl::union_map basic_map::intersect_range(const isl::space &space) const
9231 {
9232   if (!ptr)
9233     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9234   return isl::map(*this).intersect_range(space);
9235 }
9236 
intersect_range(const isl::union_set & uset)9237 isl::union_map basic_map::intersect_range(const isl::union_set &uset) const
9238 {
9239   if (!ptr)
9240     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9241   return isl::map(*this).intersect_range(uset);
9242 }
9243 
intersect_range(const isl::point & bset)9244 isl::basic_map basic_map::intersect_range(const isl::point &bset) const
9245 {
9246   if (!ptr)
9247     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9248   return this->intersect_range(isl::basic_set(bset));
9249 }
9250 
intersect_range_factor_domain(const isl::map & factor)9251 isl::map basic_map::intersect_range_factor_domain(const isl::map &factor) const
9252 {
9253   if (!ptr)
9254     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9255   return isl::map(*this).intersect_range_factor_domain(factor);
9256 }
9257 
intersect_range_factor_domain(const isl::union_map & factor)9258 isl::union_map basic_map::intersect_range_factor_domain(const isl::union_map &factor) const
9259 {
9260   if (!ptr)
9261     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9262   return isl::map(*this).intersect_range_factor_domain(factor);
9263 }
9264 
intersect_range_factor_range(const isl::map & factor)9265 isl::map basic_map::intersect_range_factor_range(const isl::map &factor) const
9266 {
9267   if (!ptr)
9268     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9269   return isl::map(*this).intersect_range_factor_range(factor);
9270 }
9271 
intersect_range_factor_range(const isl::union_map & factor)9272 isl::union_map basic_map::intersect_range_factor_range(const isl::union_map &factor) const
9273 {
9274   if (!ptr)
9275     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9276   return isl::map(*this).intersect_range_factor_range(factor);
9277 }
9278 
intersect_range_wrapped_domain(const isl::set & domain)9279 isl::map basic_map::intersect_range_wrapped_domain(const isl::set &domain) const
9280 {
9281   if (!ptr)
9282     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9283   return isl::map(*this).intersect_range_wrapped_domain(domain);
9284 }
9285 
intersect_range_wrapped_domain(const isl::union_set & domain)9286 isl::union_map basic_map::intersect_range_wrapped_domain(const isl::union_set &domain) const
9287 {
9288   if (!ptr)
9289     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9290   return isl::map(*this).intersect_range_wrapped_domain(domain);
9291 }
9292 
is_bijective()9293 bool basic_map::is_bijective() const
9294 {
9295   if (!ptr)
9296     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9297   return isl::map(*this).is_bijective();
9298 }
9299 
is_disjoint(const isl::map & map2)9300 bool basic_map::is_disjoint(const isl::map &map2) const
9301 {
9302   if (!ptr)
9303     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9304   return isl::map(*this).is_disjoint(map2);
9305 }
9306 
is_disjoint(const isl::union_map & umap2)9307 bool basic_map::is_disjoint(const isl::union_map &umap2) const
9308 {
9309   if (!ptr)
9310     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9311   return isl::map(*this).is_disjoint(umap2);
9312 }
9313 
is_empty()9314 bool basic_map::is_empty() const
9315 {
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;
9324 }
9325 
is_equal(const isl::basic_map & bmap2)9326 bool basic_map::is_equal(const isl::basic_map &bmap2) const
9327 {
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;
9336 }
9337 
is_equal(const isl::map & map2)9338 bool basic_map::is_equal(const isl::map &map2) const
9339 {
9340   if (!ptr)
9341     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9342   return isl::map(*this).is_equal(map2);
9343 }
9344 
is_equal(const isl::union_map & umap2)9345 bool basic_map::is_equal(const isl::union_map &umap2) const
9346 {
9347   if (!ptr)
9348     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9349   return isl::map(*this).is_equal(umap2);
9350 }
9351 
is_injective()9352 bool basic_map::is_injective() const
9353 {
9354   if (!ptr)
9355     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9356   return isl::map(*this).is_injective();
9357 }
9358 
is_single_valued()9359 bool basic_map::is_single_valued() const
9360 {
9361   if (!ptr)
9362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9363   return isl::map(*this).is_single_valued();
9364 }
9365 
is_strict_subset(const isl::map & map2)9366 bool basic_map::is_strict_subset(const isl::map &map2) const
9367 {
9368   if (!ptr)
9369     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9370   return isl::map(*this).is_strict_subset(map2);
9371 }
9372 
is_strict_subset(const isl::union_map & umap2)9373 bool basic_map::is_strict_subset(const isl::union_map &umap2) const
9374 {
9375   if (!ptr)
9376     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9377   return isl::map(*this).is_strict_subset(umap2);
9378 }
9379 
is_subset(const isl::basic_map & bmap2)9380 bool basic_map::is_subset(const isl::basic_map &bmap2) const
9381 {
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;
9390 }
9391 
is_subset(const isl::map & map2)9392 bool basic_map::is_subset(const isl::map &map2) const
9393 {
9394   if (!ptr)
9395     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9396   return isl::map(*this).is_subset(map2);
9397 }
9398 
is_subset(const isl::union_map & umap2)9399 bool basic_map::is_subset(const isl::union_map &umap2) const
9400 {
9401   if (!ptr)
9402     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9403   return isl::map(*this).is_subset(umap2);
9404 }
9405 
isa_map()9406 bool basic_map::isa_map() const
9407 {
9408   if (!ptr)
9409     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9410   return isl::map(*this).isa_map();
9411 }
9412 
lex_ge_at(const isl::multi_pw_aff & mpa)9413 isl::map basic_map::lex_ge_at(const isl::multi_pw_aff &mpa) const
9414 {
9415   if (!ptr)
9416     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9417   return isl::map(*this).lex_ge_at(mpa);
9418 }
9419 
lex_gt_at(const isl::multi_pw_aff & mpa)9420 isl::map basic_map::lex_gt_at(const isl::multi_pw_aff &mpa) const
9421 {
9422   if (!ptr)
9423     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9424   return isl::map(*this).lex_gt_at(mpa);
9425 }
9426 
lex_le_at(const isl::multi_pw_aff & mpa)9427 isl::map basic_map::lex_le_at(const isl::multi_pw_aff &mpa) const
9428 {
9429   if (!ptr)
9430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9431   return isl::map(*this).lex_le_at(mpa);
9432 }
9433 
lex_lt_at(const isl::multi_pw_aff & mpa)9434 isl::map basic_map::lex_lt_at(const isl::multi_pw_aff &mpa) const
9435 {
9436   if (!ptr)
9437     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9438   return isl::map(*this).lex_lt_at(mpa);
9439 }
9440 
lexmax()9441 isl::map basic_map::lexmax() const
9442 {
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);
9451 }
9452 
lexmax_pw_multi_aff()9453 isl::pw_multi_aff basic_map::lexmax_pw_multi_aff() const
9454 {
9455   if (!ptr)
9456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9457   return isl::map(*this).lexmax_pw_multi_aff();
9458 }
9459 
lexmin()9460 isl::map basic_map::lexmin() const
9461 {
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);
9470 }
9471 
lexmin_pw_multi_aff()9472 isl::pw_multi_aff basic_map::lexmin_pw_multi_aff() const
9473 {
9474   if (!ptr)
9475     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9476   return isl::map(*this).lexmin_pw_multi_aff();
9477 }
9478 
lower_bound(const isl::multi_pw_aff & lower)9479 isl::map basic_map::lower_bound(const isl::multi_pw_aff &lower) const
9480 {
9481   if (!ptr)
9482     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9483   return isl::map(*this).lower_bound(lower);
9484 }
9485 
map_list()9486 isl::map_list basic_map::map_list() const
9487 {
9488   if (!ptr)
9489     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9490   return isl::map(*this).map_list();
9491 }
9492 
max_multi_pw_aff()9493 isl::multi_pw_aff basic_map::max_multi_pw_aff() const
9494 {
9495   if (!ptr)
9496     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9497   return isl::map(*this).max_multi_pw_aff();
9498 }
9499 
min_multi_pw_aff()9500 isl::multi_pw_aff basic_map::min_multi_pw_aff() const
9501 {
9502   if (!ptr)
9503     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9504   return isl::map(*this).min_multi_pw_aff();
9505 }
9506 
n_basic_map()9507 unsigned basic_map::n_basic_map() const
9508 {
9509   if (!ptr)
9510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9511   return isl::map(*this).n_basic_map();
9512 }
9513 
params()9514 isl::set basic_map::params() const
9515 {
9516   if (!ptr)
9517     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9518   return isl::map(*this).params();
9519 }
9520 
polyhedral_hull()9521 isl::basic_map basic_map::polyhedral_hull() const
9522 {
9523   if (!ptr)
9524     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9525   return isl::map(*this).polyhedral_hull();
9526 }
9527 
preimage_domain(const isl::multi_aff & ma)9528 isl::map basic_map::preimage_domain(const isl::multi_aff &ma) const
9529 {
9530   if (!ptr)
9531     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9532   return isl::map(*this).preimage_domain(ma);
9533 }
9534 
preimage_domain(const isl::multi_pw_aff & mpa)9535 isl::map basic_map::preimage_domain(const isl::multi_pw_aff &mpa) const
9536 {
9537   if (!ptr)
9538     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9539   return isl::map(*this).preimage_domain(mpa);
9540 }
9541 
preimage_domain(const isl::pw_multi_aff & pma)9542 isl::map basic_map::preimage_domain(const isl::pw_multi_aff &pma) const
9543 {
9544   if (!ptr)
9545     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9546   return isl::map(*this).preimage_domain(pma);
9547 }
9548 
preimage_domain(const isl::union_pw_multi_aff & upma)9549 isl::union_map basic_map::preimage_domain(const isl::union_pw_multi_aff &upma) const
9550 {
9551   if (!ptr)
9552     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9553   return isl::map(*this).preimage_domain(upma);
9554 }
9555 
preimage_range(const isl::multi_aff & ma)9556 isl::map basic_map::preimage_range(const isl::multi_aff &ma) const
9557 {
9558   if (!ptr)
9559     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9560   return isl::map(*this).preimage_range(ma);
9561 }
9562 
preimage_range(const isl::pw_multi_aff & pma)9563 isl::map basic_map::preimage_range(const isl::pw_multi_aff &pma) const
9564 {
9565   if (!ptr)
9566     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9567   return isl::map(*this).preimage_range(pma);
9568 }
9569 
preimage_range(const isl::union_pw_multi_aff & upma)9570 isl::union_map basic_map::preimage_range(const isl::union_pw_multi_aff &upma) const
9571 {
9572   if (!ptr)
9573     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9574   return isl::map(*this).preimage_range(upma);
9575 }
9576 
product(const isl::map & map2)9577 isl::map basic_map::product(const isl::map &map2) const
9578 {
9579   if (!ptr)
9580     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9581   return isl::map(*this).product(map2);
9582 }
9583 
product(const isl::union_map & umap2)9584 isl::union_map basic_map::product(const isl::union_map &umap2) const
9585 {
9586   if (!ptr)
9587     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9588   return isl::map(*this).product(umap2);
9589 }
9590 
project_out_all_params()9591 isl::map basic_map::project_out_all_params() const
9592 {
9593   if (!ptr)
9594     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9595   return isl::map(*this).project_out_all_params();
9596 }
9597 
project_out_param(const isl::id & id)9598 isl::map basic_map::project_out_param(const isl::id &id) const
9599 {
9600   if (!ptr)
9601     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9602   return isl::map(*this).project_out_param(id);
9603 }
9604 
project_out_param(const std::string & id)9605 isl::map basic_map::project_out_param(const std::string &id) const
9606 {
9607   if (!ptr)
9608     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9609   return this->project_out_param(isl::id(ctx(), id));
9610 }
9611 
project_out_param(const isl::id_list & list)9612 isl::map basic_map::project_out_param(const isl::id_list &list) const
9613 {
9614   if (!ptr)
9615     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9616   return isl::map(*this).project_out_param(list);
9617 }
9618 
range()9619 isl::set basic_map::range() const
9620 {
9621   if (!ptr)
9622     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9623   return isl::map(*this).range();
9624 }
9625 
range_factor_domain()9626 isl::map basic_map::range_factor_domain() const
9627 {
9628   if (!ptr)
9629     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9630   return isl::map(*this).range_factor_domain();
9631 }
9632 
range_factor_range()9633 isl::map basic_map::range_factor_range() const
9634 {
9635   if (!ptr)
9636     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9637   return isl::map(*this).range_factor_range();
9638 }
9639 
range_lattice_tile()9640 isl::fixed_box basic_map::range_lattice_tile() const
9641 {
9642   if (!ptr)
9643     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9644   return isl::map(*this).range_lattice_tile();
9645 }
9646 
range_map()9647 isl::union_map basic_map::range_map() const
9648 {
9649   if (!ptr)
9650     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9651   return isl::map(*this).range_map();
9652 }
9653 
range_product(const isl::map & map2)9654 isl::map basic_map::range_product(const isl::map &map2) const
9655 {
9656   if (!ptr)
9657     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9658   return isl::map(*this).range_product(map2);
9659 }
9660 
range_product(const isl::union_map & umap2)9661 isl::union_map basic_map::range_product(const isl::union_map &umap2) const
9662 {
9663   if (!ptr)
9664     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9665   return isl::map(*this).range_product(umap2);
9666 }
9667 
range_reverse()9668 isl::map basic_map::range_reverse() const
9669 {
9670   if (!ptr)
9671     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9672   return isl::map(*this).range_reverse();
9673 }
9674 
range_simple_fixed_box_hull()9675 isl::fixed_box basic_map::range_simple_fixed_box_hull() const
9676 {
9677   if (!ptr)
9678     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9679   return isl::map(*this).range_simple_fixed_box_hull();
9680 }
9681 
range_tuple_dim()9682 unsigned basic_map::range_tuple_dim() const
9683 {
9684   if (!ptr)
9685     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9686   return isl::map(*this).range_tuple_dim();
9687 }
9688 
range_tuple_id()9689 isl::id basic_map::range_tuple_id() const
9690 {
9691   if (!ptr)
9692     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9693   return isl::map(*this).range_tuple_id();
9694 }
9695 
reverse()9696 isl::basic_map basic_map::reverse() const
9697 {
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);
9706 }
9707 
sample()9708 isl::basic_map basic_map::sample() const
9709 {
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);
9718 }
9719 
set_domain_tuple(const isl::id & id)9720 isl::map basic_map::set_domain_tuple(const isl::id &id) const
9721 {
9722   if (!ptr)
9723     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9724   return isl::map(*this).set_domain_tuple(id);
9725 }
9726 
set_domain_tuple(const std::string & id)9727 isl::map basic_map::set_domain_tuple(const std::string &id) const
9728 {
9729   if (!ptr)
9730     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9731   return this->set_domain_tuple(isl::id(ctx(), id));
9732 }
9733 
set_range_tuple(const isl::id & id)9734 isl::map basic_map::set_range_tuple(const isl::id &id) const
9735 {
9736   if (!ptr)
9737     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9738   return isl::map(*this).set_range_tuple(id);
9739 }
9740 
set_range_tuple(const std::string & id)9741 isl::map basic_map::set_range_tuple(const std::string &id) const
9742 {
9743   if (!ptr)
9744     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9745   return this->set_range_tuple(isl::id(ctx(), id));
9746 }
9747 
space()9748 isl::space basic_map::space() const
9749 {
9750   if (!ptr)
9751     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9752   return isl::map(*this).space();
9753 }
9754 
subtract(const isl::map & map2)9755 isl::map basic_map::subtract(const isl::map &map2) const
9756 {
9757   if (!ptr)
9758     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9759   return isl::map(*this).subtract(map2);
9760 }
9761 
subtract(const isl::union_map & umap2)9762 isl::union_map basic_map::subtract(const isl::union_map &umap2) const
9763 {
9764   if (!ptr)
9765     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9766   return isl::map(*this).subtract(umap2);
9767 }
9768 
subtract_domain(const isl::union_set & dom)9769 isl::union_map basic_map::subtract_domain(const isl::union_set &dom) const
9770 {
9771   if (!ptr)
9772     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9773   return isl::map(*this).subtract_domain(dom);
9774 }
9775 
subtract_range(const isl::union_set & dom)9776 isl::union_map basic_map::subtract_range(const isl::union_set &dom) const
9777 {
9778   if (!ptr)
9779     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9780   return isl::map(*this).subtract_range(dom);
9781 }
9782 
to_list()9783 isl::map_list basic_map::to_list() const
9784 {
9785   if (!ptr)
9786     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9787   return isl::map(*this).to_list();
9788 }
9789 
to_union_map()9790 isl::union_map basic_map::to_union_map() const
9791 {
9792   if (!ptr)
9793     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9794   return isl::map(*this).to_union_map();
9795 }
9796 
uncurry()9797 isl::map basic_map::uncurry() const
9798 {
9799   if (!ptr)
9800     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9801   return isl::map(*this).uncurry();
9802 }
9803 
unite(isl::basic_map bmap2)9804 isl::map basic_map::unite(isl::basic_map bmap2) const
9805 {
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);
9814 }
9815 
unite(const isl::map & map2)9816 isl::map basic_map::unite(const isl::map &map2) const
9817 {
9818   if (!ptr)
9819     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9820   return isl::map(*this).unite(map2);
9821 }
9822 
unite(const isl::union_map & umap2)9823 isl::union_map basic_map::unite(const isl::union_map &umap2) const
9824 {
9825   if (!ptr)
9826     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9827   return isl::map(*this).unite(umap2);
9828 }
9829 
unshifted_simple_hull()9830 isl::basic_map basic_map::unshifted_simple_hull() const
9831 {
9832   if (!ptr)
9833     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9834   return isl::map(*this).unshifted_simple_hull();
9835 }
9836 
upper_bound(const isl::multi_pw_aff & upper)9837 isl::map basic_map::upper_bound(const isl::multi_pw_aff &upper) const
9838 {
9839   if (!ptr)
9840     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9841   return isl::map(*this).upper_bound(upper);
9842 }
9843 
wrap()9844 isl::set basic_map::wrap() const
9845 {
9846   if (!ptr)
9847     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9848   return isl::map(*this).wrap();
9849 }
9850 
zip()9851 isl::map basic_map::zip() const
9852 {
9853   if (!ptr)
9854     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9855   return isl::map(*this).zip();
9856 }
9857 
9858 inline std::ostream &operator<<(std::ostream &os, const basic_map &obj)
9859 {
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;
9870 }
9871 
9872 // implementations for isl::basic_set
manage(__isl_take isl_basic_set * ptr)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);
9877 }
manage_copy(__isl_keep isl_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);
9887 }
9888 
basic_set(__isl_take isl_basic_set * ptr)9889 basic_set::basic_set(__isl_take isl_basic_set *ptr)
9890     : ptr(ptr) {}
9891 
basic_set()9892 basic_set::basic_set()
9893     : ptr(nullptr) {}
9894 
basic_set(const basic_set & obj)9895 basic_set::basic_set(const basic_set &obj)
9896     : ptr(nullptr)
9897 {
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);
9905 }
9906 
basic_set(isl::point pnt)9907 basic_set::basic_set(isl::point pnt)
9908 {
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;
9917 }
9918 
basic_set(isl::ctx ctx,const std::string & str)9919 basic_set::basic_set(isl::ctx ctx, const std::string &str)
9920 {
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;
9927 }
9928 
9929 basic_set &basic_set::operator=(basic_set obj) {
9930   std::swap(this->ptr, obj.ptr);
9931   return *this;
9932 }
9933 
~basic_set()9934 basic_set::~basic_set() {
9935   if (ptr)
9936     isl_basic_set_free(ptr);
9937 }
9938 
copy()9939 __isl_give isl_basic_set *basic_set::copy() const & {
9940   return isl_basic_set_copy(ptr);
9941 }
9942 
get()9943 __isl_keep isl_basic_set *basic_set::get() const {
9944   return ptr;
9945 }
9946 
release()9947 __isl_give isl_basic_set *basic_set::release() {
9948   isl_basic_set *tmp = ptr;
9949   ptr = nullptr;
9950   return tmp;
9951 }
9952 
is_null()9953 bool basic_set::is_null() const {
9954   return ptr == nullptr;
9955 }
9956 
ctx()9957 isl::ctx basic_set::ctx() const {
9958   return isl::ctx(isl_basic_set_get_ctx(ptr));
9959 }
9960 
affine_hull()9961 isl::basic_set basic_set::affine_hull() const
9962 {
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);
9971 }
9972 
apply(isl::basic_map bmap)9973 isl::basic_set basic_set::apply(isl::basic_map bmap) const
9974 {
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);
9983 }
9984 
apply(const isl::map & map)9985 isl::set basic_set::apply(const isl::map &map) const
9986 {
9987   if (!ptr)
9988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9989   return isl::set(*this).apply(map);
9990 }
9991 
apply(const isl::union_map & umap)9992 isl::union_set basic_set::apply(const isl::union_map &umap) const
9993 {
9994   if (!ptr)
9995     exception::throw_invalid("NULL input", __FILE__, __LINE__);
9996   return isl::set(*this).apply(umap);
9997 }
9998 
as_pw_multi_aff()9999 isl::pw_multi_aff basic_set::as_pw_multi_aff() const
10000 {
10001   if (!ptr)
10002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10003   return isl::set(*this).as_pw_multi_aff();
10004 }
10005 
as_set()10006 isl::set basic_set::as_set() const
10007 {
10008   if (!ptr)
10009     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10010   return isl::set(*this).as_set();
10011 }
10012 
bind(const isl::multi_id & tuple)10013 isl::set basic_set::bind(const isl::multi_id &tuple) const
10014 {
10015   if (!ptr)
10016     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10017   return isl::set(*this).bind(tuple);
10018 }
10019 
coalesce()10020 isl::set basic_set::coalesce() const
10021 {
10022   if (!ptr)
10023     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10024   return isl::set(*this).coalesce();
10025 }
10026 
complement()10027 isl::set basic_set::complement() const
10028 {
10029   if (!ptr)
10030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10031   return isl::set(*this).complement();
10032 }
10033 
compute_divs()10034 isl::union_set basic_set::compute_divs() const
10035 {
10036   if (!ptr)
10037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10038   return isl::set(*this).compute_divs();
10039 }
10040 
detect_equalities()10041 isl::basic_set basic_set::detect_equalities() const
10042 {
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);
10051 }
10052 
dim_max_val(int pos)10053 isl::val basic_set::dim_max_val(int pos) const
10054 {
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);
10063 }
10064 
dim_min_val(int pos)10065 isl::val basic_set::dim_min_val(int pos) const
10066 {
10067   if (!ptr)
10068     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10069   return isl::set(*this).dim_min_val(pos);
10070 }
10071 
drop_unused_params()10072 isl::set basic_set::drop_unused_params() const
10073 {
10074   if (!ptr)
10075     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10076   return isl::set(*this).drop_unused_params();
10077 }
10078 
every_set(const std::function<bool (isl::set)> & test)10079 bool basic_set::every_set(const std::function<bool(isl::set)> &test) const
10080 {
10081   if (!ptr)
10082     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10083   return isl::set(*this).every_set(test);
10084 }
10085 
extract_set(const isl::space & space)10086 isl::set basic_set::extract_set(const isl::space &space) const
10087 {
10088   if (!ptr)
10089     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10090   return isl::set(*this).extract_set(space);
10091 }
10092 
flatten()10093 isl::basic_set basic_set::flatten() const
10094 {
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);
10103 }
10104 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)10105 void basic_set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
10106 {
10107   if (!ptr)
10108     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10109   return isl::set(*this).foreach_basic_set(fn);
10110 }
10111 
foreach_point(const std::function<void (isl::point)> & fn)10112 void basic_set::foreach_point(const std::function<void(isl::point)> &fn) const
10113 {
10114   if (!ptr)
10115     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10116   return isl::set(*this).foreach_point(fn);
10117 }
10118 
foreach_set(const std::function<void (isl::set)> & fn)10119 void basic_set::foreach_set(const std::function<void(isl::set)> &fn) const
10120 {
10121   if (!ptr)
10122     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10123   return isl::set(*this).foreach_set(fn);
10124 }
10125 
gist(isl::basic_set context)10126 isl::basic_set basic_set::gist(isl::basic_set context) const
10127 {
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);
10136 }
10137 
gist(const isl::set & context)10138 isl::set basic_set::gist(const isl::set &context) const
10139 {
10140   if (!ptr)
10141     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10142   return isl::set(*this).gist(context);
10143 }
10144 
gist(const isl::union_set & context)10145 isl::union_set basic_set::gist(const isl::union_set &context) const
10146 {
10147   if (!ptr)
10148     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10149   return isl::set(*this).gist(context);
10150 }
10151 
gist(const isl::point & context)10152 isl::basic_set basic_set::gist(const isl::point &context) const
10153 {
10154   if (!ptr)
10155     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10156   return this->gist(isl::basic_set(context));
10157 }
10158 
gist_params(const isl::set & context)10159 isl::set basic_set::gist_params(const isl::set &context) const
10160 {
10161   if (!ptr)
10162     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10163   return isl::set(*this).gist_params(context);
10164 }
10165 
identity()10166 isl::map basic_set::identity() const
10167 {
10168   if (!ptr)
10169     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10170   return isl::set(*this).identity();
10171 }
10172 
indicator_function()10173 isl::pw_aff basic_set::indicator_function() const
10174 {
10175   if (!ptr)
10176     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10177   return isl::set(*this).indicator_function();
10178 }
10179 
insert_domain(const isl::space & domain)10180 isl::map basic_set::insert_domain(const isl::space &domain) const
10181 {
10182   if (!ptr)
10183     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10184   return isl::set(*this).insert_domain(domain);
10185 }
10186 
intersect(isl::basic_set bset2)10187 isl::basic_set basic_set::intersect(isl::basic_set bset2) const
10188 {
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);
10197 }
10198 
intersect(const isl::set & set2)10199 isl::set basic_set::intersect(const isl::set &set2) const
10200 {
10201   if (!ptr)
10202     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10203   return isl::set(*this).intersect(set2);
10204 }
10205 
intersect(const isl::union_set & uset2)10206 isl::union_set basic_set::intersect(const isl::union_set &uset2) const
10207 {
10208   if (!ptr)
10209     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10210   return isl::set(*this).intersect(uset2);
10211 }
10212 
intersect(const isl::point & bset2)10213 isl::basic_set basic_set::intersect(const isl::point &bset2) const
10214 {
10215   if (!ptr)
10216     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10217   return this->intersect(isl::basic_set(bset2));
10218 }
10219 
intersect_params(isl::basic_set bset2)10220 isl::basic_set basic_set::intersect_params(isl::basic_set bset2) const
10221 {
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);
10230 }
10231 
intersect_params(const isl::set & params)10232 isl::set basic_set::intersect_params(const isl::set &params) const
10233 {
10234   if (!ptr)
10235     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10236   return isl::set(*this).intersect_params(params);
10237 }
10238 
intersect_params(const isl::point & bset2)10239 isl::basic_set basic_set::intersect_params(const isl::point &bset2) const
10240 {
10241   if (!ptr)
10242     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10243   return this->intersect_params(isl::basic_set(bset2));
10244 }
10245 
involves_locals()10246 bool basic_set::involves_locals() const
10247 {
10248   if (!ptr)
10249     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10250   return isl::set(*this).involves_locals();
10251 }
10252 
is_disjoint(const isl::set & set2)10253 bool basic_set::is_disjoint(const isl::set &set2) const
10254 {
10255   if (!ptr)
10256     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10257   return isl::set(*this).is_disjoint(set2);
10258 }
10259 
is_disjoint(const isl::union_set & uset2)10260 bool basic_set::is_disjoint(const isl::union_set &uset2) const
10261 {
10262   if (!ptr)
10263     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10264   return isl::set(*this).is_disjoint(uset2);
10265 }
10266 
is_empty()10267 bool basic_set::is_empty() const
10268 {
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;
10277 }
10278 
is_equal(const isl::basic_set & bset2)10279 bool basic_set::is_equal(const isl::basic_set &bset2) const
10280 {
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;
10289 }
10290 
is_equal(const isl::set & set2)10291 bool basic_set::is_equal(const isl::set &set2) const
10292 {
10293   if (!ptr)
10294     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10295   return isl::set(*this).is_equal(set2);
10296 }
10297 
is_equal(const isl::union_set & uset2)10298 bool basic_set::is_equal(const isl::union_set &uset2) const
10299 {
10300   if (!ptr)
10301     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10302   return isl::set(*this).is_equal(uset2);
10303 }
10304 
is_equal(const isl::point & bset2)10305 bool basic_set::is_equal(const isl::point &bset2) const
10306 {
10307   if (!ptr)
10308     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10309   return this->is_equal(isl::basic_set(bset2));
10310 }
10311 
is_singleton()10312 bool basic_set::is_singleton() const
10313 {
10314   if (!ptr)
10315     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10316   return isl::set(*this).is_singleton();
10317 }
10318 
is_strict_subset(const isl::set & set2)10319 bool basic_set::is_strict_subset(const isl::set &set2) const
10320 {
10321   if (!ptr)
10322     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10323   return isl::set(*this).is_strict_subset(set2);
10324 }
10325 
is_strict_subset(const isl::union_set & uset2)10326 bool basic_set::is_strict_subset(const isl::union_set &uset2) const
10327 {
10328   if (!ptr)
10329     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10330   return isl::set(*this).is_strict_subset(uset2);
10331 }
10332 
is_subset(const isl::basic_set & bset2)10333 bool basic_set::is_subset(const isl::basic_set &bset2) const
10334 {
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;
10343 }
10344 
is_subset(const isl::set & set2)10345 bool basic_set::is_subset(const isl::set &set2) const
10346 {
10347   if (!ptr)
10348     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10349   return isl::set(*this).is_subset(set2);
10350 }
10351 
is_subset(const isl::union_set & uset2)10352 bool basic_set::is_subset(const isl::union_set &uset2) const
10353 {
10354   if (!ptr)
10355     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10356   return isl::set(*this).is_subset(uset2);
10357 }
10358 
is_subset(const isl::point & bset2)10359 bool basic_set::is_subset(const isl::point &bset2) const
10360 {
10361   if (!ptr)
10362     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10363   return this->is_subset(isl::basic_set(bset2));
10364 }
10365 
is_wrapping()10366 bool basic_set::is_wrapping() const
10367 {
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;
10376 }
10377 
isa_set()10378 bool basic_set::isa_set() const
10379 {
10380   if (!ptr)
10381     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10382   return isl::set(*this).isa_set();
10383 }
10384 
lattice_tile()10385 isl::fixed_box basic_set::lattice_tile() const
10386 {
10387   if (!ptr)
10388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10389   return isl::set(*this).lattice_tile();
10390 }
10391 
lexmax()10392 isl::set basic_set::lexmax() const
10393 {
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);
10402 }
10403 
lexmax_pw_multi_aff()10404 isl::pw_multi_aff basic_set::lexmax_pw_multi_aff() const
10405 {
10406   if (!ptr)
10407     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10408   return isl::set(*this).lexmax_pw_multi_aff();
10409 }
10410 
lexmin()10411 isl::set basic_set::lexmin() const
10412 {
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);
10421 }
10422 
lexmin_pw_multi_aff()10423 isl::pw_multi_aff basic_set::lexmin_pw_multi_aff() const
10424 {
10425   if (!ptr)
10426     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10427   return isl::set(*this).lexmin_pw_multi_aff();
10428 }
10429 
lower_bound(const isl::multi_pw_aff & lower)10430 isl::set basic_set::lower_bound(const isl::multi_pw_aff &lower) const
10431 {
10432   if (!ptr)
10433     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10434   return isl::set(*this).lower_bound(lower);
10435 }
10436 
lower_bound(const isl::multi_val & lower)10437 isl::set basic_set::lower_bound(const isl::multi_val &lower) const
10438 {
10439   if (!ptr)
10440     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10441   return isl::set(*this).lower_bound(lower);
10442 }
10443 
max_multi_pw_aff()10444 isl::multi_pw_aff basic_set::max_multi_pw_aff() const
10445 {
10446   if (!ptr)
10447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10448   return isl::set(*this).max_multi_pw_aff();
10449 }
10450 
max_val(const isl::aff & obj)10451 isl::val basic_set::max_val(const isl::aff &obj) const
10452 {
10453   if (!ptr)
10454     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10455   return isl::set(*this).max_val(obj);
10456 }
10457 
min_multi_pw_aff()10458 isl::multi_pw_aff basic_set::min_multi_pw_aff() const
10459 {
10460   if (!ptr)
10461     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10462   return isl::set(*this).min_multi_pw_aff();
10463 }
10464 
min_val(const isl::aff & obj)10465 isl::val basic_set::min_val(const isl::aff &obj) const
10466 {
10467   if (!ptr)
10468     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10469   return isl::set(*this).min_val(obj);
10470 }
10471 
n_basic_set()10472 unsigned basic_set::n_basic_set() const
10473 {
10474   if (!ptr)
10475     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10476   return isl::set(*this).n_basic_set();
10477 }
10478 
param_pw_aff_on_domain(const isl::id & id)10479 isl::pw_aff basic_set::param_pw_aff_on_domain(const isl::id &id) const
10480 {
10481   if (!ptr)
10482     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10483   return isl::set(*this).param_pw_aff_on_domain(id);
10484 }
10485 
param_pw_aff_on_domain(const std::string & id)10486 isl::pw_aff basic_set::param_pw_aff_on_domain(const std::string &id) const
10487 {
10488   if (!ptr)
10489     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10490   return this->param_pw_aff_on_domain(isl::id(ctx(), id));
10491 }
10492 
params()10493 isl::basic_set basic_set::params() const
10494 {
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);
10503 }
10504 
plain_multi_val_if_fixed()10505 isl::multi_val basic_set::plain_multi_val_if_fixed() const
10506 {
10507   if (!ptr)
10508     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10509   return isl::set(*this).plain_multi_val_if_fixed();
10510 }
10511 
polyhedral_hull()10512 isl::basic_set basic_set::polyhedral_hull() const
10513 {
10514   if (!ptr)
10515     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10516   return isl::set(*this).polyhedral_hull();
10517 }
10518 
preimage(const isl::multi_aff & ma)10519 isl::set basic_set::preimage(const isl::multi_aff &ma) const
10520 {
10521   if (!ptr)
10522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10523   return isl::set(*this).preimage(ma);
10524 }
10525 
preimage(const isl::multi_pw_aff & mpa)10526 isl::set basic_set::preimage(const isl::multi_pw_aff &mpa) const
10527 {
10528   if (!ptr)
10529     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10530   return isl::set(*this).preimage(mpa);
10531 }
10532 
preimage(const isl::pw_multi_aff & pma)10533 isl::set basic_set::preimage(const isl::pw_multi_aff &pma) const
10534 {
10535   if (!ptr)
10536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10537   return isl::set(*this).preimage(pma);
10538 }
10539 
preimage(const isl::union_pw_multi_aff & upma)10540 isl::union_set basic_set::preimage(const isl::union_pw_multi_aff &upma) const
10541 {
10542   if (!ptr)
10543     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10544   return isl::set(*this).preimage(upma);
10545 }
10546 
product(const isl::set & set2)10547 isl::set basic_set::product(const isl::set &set2) const
10548 {
10549   if (!ptr)
10550     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10551   return isl::set(*this).product(set2);
10552 }
10553 
project_out_all_params()10554 isl::set basic_set::project_out_all_params() const
10555 {
10556   if (!ptr)
10557     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10558   return isl::set(*this).project_out_all_params();
10559 }
10560 
project_out_param(const isl::id & id)10561 isl::set basic_set::project_out_param(const isl::id &id) const
10562 {
10563   if (!ptr)
10564     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10565   return isl::set(*this).project_out_param(id);
10566 }
10567 
project_out_param(const std::string & id)10568 isl::set basic_set::project_out_param(const std::string &id) const
10569 {
10570   if (!ptr)
10571     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10572   return this->project_out_param(isl::id(ctx(), id));
10573 }
10574 
project_out_param(const isl::id_list & list)10575 isl::set basic_set::project_out_param(const isl::id_list &list) const
10576 {
10577   if (!ptr)
10578     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10579   return isl::set(*this).project_out_param(list);
10580 }
10581 
pw_aff_on_domain(const isl::val & v)10582 isl::pw_aff basic_set::pw_aff_on_domain(const isl::val &v) const
10583 {
10584   if (!ptr)
10585     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10586   return isl::set(*this).pw_aff_on_domain(v);
10587 }
10588 
pw_aff_on_domain(long v)10589 isl::pw_aff basic_set::pw_aff_on_domain(long v) const
10590 {
10591   if (!ptr)
10592     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10593   return this->pw_aff_on_domain(isl::val(ctx(), v));
10594 }
10595 
pw_multi_aff_on_domain(const isl::multi_val & mv)10596 isl::pw_multi_aff basic_set::pw_multi_aff_on_domain(const isl::multi_val &mv) const
10597 {
10598   if (!ptr)
10599     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10600   return isl::set(*this).pw_multi_aff_on_domain(mv);
10601 }
10602 
sample()10603 isl::basic_set basic_set::sample() const
10604 {
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);
10613 }
10614 
sample_point()10615 isl::point basic_set::sample_point() const
10616 {
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);
10625 }
10626 
set_list()10627 isl::set_list basic_set::set_list() const
10628 {
10629   if (!ptr)
10630     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10631   return isl::set(*this).set_list();
10632 }
10633 
simple_fixed_box_hull()10634 isl::fixed_box basic_set::simple_fixed_box_hull() const
10635 {
10636   if (!ptr)
10637     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10638   return isl::set(*this).simple_fixed_box_hull();
10639 }
10640 
space()10641 isl::space basic_set::space() const
10642 {
10643   if (!ptr)
10644     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10645   return isl::set(*this).space();
10646 }
10647 
stride(int pos)10648 isl::val basic_set::stride(int pos) const
10649 {
10650   if (!ptr)
10651     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10652   return isl::set(*this).stride(pos);
10653 }
10654 
subtract(const isl::set & set2)10655 isl::set basic_set::subtract(const isl::set &set2) const
10656 {
10657   if (!ptr)
10658     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10659   return isl::set(*this).subtract(set2);
10660 }
10661 
subtract(const isl::union_set & uset2)10662 isl::union_set basic_set::subtract(const isl::union_set &uset2) const
10663 {
10664   if (!ptr)
10665     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10666   return isl::set(*this).subtract(uset2);
10667 }
10668 
to_list()10669 isl::set_list basic_set::to_list() const
10670 {
10671   if (!ptr)
10672     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10673   return isl::set(*this).to_list();
10674 }
10675 
to_set()10676 isl::set basic_set::to_set() const
10677 {
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);
10686 }
10687 
to_union_set()10688 isl::union_set basic_set::to_union_set() const
10689 {
10690   if (!ptr)
10691     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10692   return isl::set(*this).to_union_set();
10693 }
10694 
translation()10695 isl::map basic_set::translation() const
10696 {
10697   if (!ptr)
10698     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10699   return isl::set(*this).translation();
10700 }
10701 
tuple_dim()10702 unsigned basic_set::tuple_dim() const
10703 {
10704   if (!ptr)
10705     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10706   return isl::set(*this).tuple_dim();
10707 }
10708 
unbind_params(const isl::multi_id & tuple)10709 isl::set basic_set::unbind_params(const isl::multi_id &tuple) const
10710 {
10711   if (!ptr)
10712     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10713   return isl::set(*this).unbind_params(tuple);
10714 }
10715 
unbind_params_insert_domain(const isl::multi_id & domain)10716 isl::map basic_set::unbind_params_insert_domain(const isl::multi_id &domain) const
10717 {
10718   if (!ptr)
10719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10720   return isl::set(*this).unbind_params_insert_domain(domain);
10721 }
10722 
unite(isl::basic_set bset2)10723 isl::set basic_set::unite(isl::basic_set bset2) const
10724 {
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);
10733 }
10734 
unite(const isl::set & set2)10735 isl::set basic_set::unite(const isl::set &set2) const
10736 {
10737   if (!ptr)
10738     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10739   return isl::set(*this).unite(set2);
10740 }
10741 
unite(const isl::union_set & uset2)10742 isl::union_set basic_set::unite(const isl::union_set &uset2) const
10743 {
10744   if (!ptr)
10745     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10746   return isl::set(*this).unite(uset2);
10747 }
10748 
unite(const isl::point & bset2)10749 isl::set basic_set::unite(const isl::point &bset2) const
10750 {
10751   if (!ptr)
10752     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10753   return this->unite(isl::basic_set(bset2));
10754 }
10755 
unshifted_simple_hull()10756 isl::basic_set basic_set::unshifted_simple_hull() const
10757 {
10758   if (!ptr)
10759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10760   return isl::set(*this).unshifted_simple_hull();
10761 }
10762 
unwrap()10763 isl::map basic_set::unwrap() const
10764 {
10765   if (!ptr)
10766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10767   return isl::set(*this).unwrap();
10768 }
10769 
upper_bound(const isl::multi_pw_aff & upper)10770 isl::set basic_set::upper_bound(const isl::multi_pw_aff &upper) const
10771 {
10772   if (!ptr)
10773     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10774   return isl::set(*this).upper_bound(upper);
10775 }
10776 
upper_bound(const isl::multi_val & upper)10777 isl::set basic_set::upper_bound(const isl::multi_val &upper) const
10778 {
10779   if (!ptr)
10780     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10781   return isl::set(*this).upper_bound(upper);
10782 }
10783 
wrapped_reverse()10784 isl::set basic_set::wrapped_reverse() const
10785 {
10786   if (!ptr)
10787     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10788   return isl::set(*this).wrapped_reverse();
10789 }
10790 
10791 inline std::ostream &operator<<(std::ostream &os, const basic_set &obj)
10792 {
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;
10803 }
10804 
10805 // implementations for isl::fixed_box
manage(__isl_take isl_fixed_box * ptr)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);
10810 }
manage_copy(__isl_keep isl_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);
10820 }
10821 
fixed_box(__isl_take isl_fixed_box * ptr)10822 fixed_box::fixed_box(__isl_take isl_fixed_box *ptr)
10823     : ptr(ptr) {}
10824 
fixed_box()10825 fixed_box::fixed_box()
10826     : ptr(nullptr) {}
10827 
fixed_box(const fixed_box & obj)10828 fixed_box::fixed_box(const fixed_box &obj)
10829     : ptr(nullptr)
10830 {
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);
10838 }
10839 
fixed_box(isl::ctx ctx,const std::string & str)10840 fixed_box::fixed_box(isl::ctx ctx, const std::string &str)
10841 {
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;
10848 }
10849 
10850 fixed_box &fixed_box::operator=(fixed_box obj) {
10851   std::swap(this->ptr, obj.ptr);
10852   return *this;
10853 }
10854 
~fixed_box()10855 fixed_box::~fixed_box() {
10856   if (ptr)
10857     isl_fixed_box_free(ptr);
10858 }
10859 
copy()10860 __isl_give isl_fixed_box *fixed_box::copy() const & {
10861   return isl_fixed_box_copy(ptr);
10862 }
10863 
get()10864 __isl_keep isl_fixed_box *fixed_box::get() const {
10865   return ptr;
10866 }
10867 
release()10868 __isl_give isl_fixed_box *fixed_box::release() {
10869   isl_fixed_box *tmp = ptr;
10870   ptr = nullptr;
10871   return tmp;
10872 }
10873 
is_null()10874 bool fixed_box::is_null() const {
10875   return ptr == nullptr;
10876 }
10877 
ctx()10878 isl::ctx fixed_box::ctx() const {
10879   return isl::ctx(isl_fixed_box_get_ctx(ptr));
10880 }
10881 
is_valid()10882 bool fixed_box::is_valid() const
10883 {
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;
10892 }
10893 
offset()10894 isl::multi_aff fixed_box::offset() const
10895 {
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);
10904 }
10905 
get_offset()10906 isl::multi_aff fixed_box::get_offset() const
10907 {
10908   return offset();
10909 }
10910 
size()10911 isl::multi_val fixed_box::size() const
10912 {
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);
10921 }
10922 
get_size()10923 isl::multi_val fixed_box::get_size() const
10924 {
10925   return size();
10926 }
10927 
space()10928 isl::space fixed_box::space() const
10929 {
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);
10938 }
10939 
get_space()10940 isl::space fixed_box::get_space() const
10941 {
10942   return space();
10943 }
10944 
10945 inline std::ostream &operator<<(std::ostream &os, const fixed_box &obj)
10946 {
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;
10957 }
10958 
10959 // implementations for isl::id
manage(__isl_take isl_id * ptr)10960 id manage(__isl_take isl_id *ptr) {
10961   if (!ptr)
10962     exception::throw_invalid("NULL input", __FILE__, __LINE__);
10963   return id(ptr);
10964 }
manage_copy(__isl_keep isl_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);
10974 }
10975 
id(__isl_take isl_id * ptr)10976 id::id(__isl_take isl_id *ptr)
10977     : ptr(ptr) {}
10978 
id()10979 id::id()
10980     : ptr(nullptr) {}
10981 
id(const id & obj)10982 id::id(const id &obj)
10983     : ptr(nullptr)
10984 {
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);
10992 }
10993 
id(isl::ctx ctx,const std::string & str)10994 id::id(isl::ctx ctx, const std::string &str)
10995 {
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;
11002 }
11003 
11004 id &id::operator=(id obj) {
11005   std::swap(this->ptr, obj.ptr);
11006   return *this;
11007 }
11008 
~id()11009 id::~id() {
11010   if (ptr)
11011     isl_id_free(ptr);
11012 }
11013 
copy()11014 __isl_give isl_id *id::copy() const & {
11015   return isl_id_copy(ptr);
11016 }
11017 
get()11018 __isl_keep isl_id *id::get() const {
11019   return ptr;
11020 }
11021 
release()11022 __isl_give isl_id *id::release() {
11023   isl_id *tmp = ptr;
11024   ptr = nullptr;
11025   return tmp;
11026 }
11027 
is_null()11028 bool id::is_null() const {
11029   return ptr == nullptr;
11030 }
11031 
ctx()11032 isl::ctx id::ctx() const {
11033   return isl::ctx(isl_id_get_ctx(ptr));
11034 }
11035 
name()11036 std::string id::name() const
11037 {
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;
11045 }
11046 
get_name()11047 std::string id::get_name() const
11048 {
11049   return name();
11050 }
11051 
to_list()11052 isl::id_list id::to_list() const
11053 {
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);
11062 }
11063 
11064 #if __cplusplus >= 201703L
id(isl::ctx ctx,const std::string & str,const std::any & any)11065 id::id(isl::ctx ctx, const std::string &str, const std::any &any)
11066 {
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);
11075   }
11076   ptr = res;
11077 }
11078 
11079 template <class T>
try_user()11080 std::optional<T> id::try_user() const
11081 {
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;
11093 }
11094 
11095 template <class T>
user()11096 T id::user() const
11097 {
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;
11109 }
11110 #endif
11111 
11112 inline std::ostream &operator<<(std::ostream &os, const id &obj)
11113 {
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;
11124 }
11125 
11126 // implementations for isl::id_list
manage(__isl_take isl_id_list * ptr)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);
11131 }
manage_copy(__isl_keep isl_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);
11141 }
11142 
id_list(__isl_take isl_id_list * ptr)11143 id_list::id_list(__isl_take isl_id_list *ptr)
11144     : ptr(ptr) {}
11145 
id_list()11146 id_list::id_list()
11147     : ptr(nullptr) {}
11148 
id_list(const id_list & obj)11149 id_list::id_list(const id_list &obj)
11150     : ptr(nullptr)
11151 {
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);
11159 }
11160 
id_list(isl::ctx ctx,int n)11161 id_list::id_list(isl::ctx ctx, int n)
11162 {
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;
11169 }
11170 
id_list(isl::id el)11171 id_list::id_list(isl::id el)
11172 {
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;
11181 }
11182 
id_list(isl::ctx ctx,const std::string & str)11183 id_list::id_list(isl::ctx ctx, const std::string &str)
11184 {
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;
11191 }
11192 
11193 id_list &id_list::operator=(id_list obj) {
11194   std::swap(this->ptr, obj.ptr);
11195   return *this;
11196 }
11197 
~id_list()11198 id_list::~id_list() {
11199   if (ptr)
11200     isl_id_list_free(ptr);
11201 }
11202 
copy()11203 __isl_give isl_id_list *id_list::copy() const & {
11204   return isl_id_list_copy(ptr);
11205 }
11206 
get()11207 __isl_keep isl_id_list *id_list::get() const {
11208   return ptr;
11209 }
11210 
release()11211 __isl_give isl_id_list *id_list::release() {
11212   isl_id_list *tmp = ptr;
11213   ptr = nullptr;
11214   return tmp;
11215 }
11216 
is_null()11217 bool id_list::is_null() const {
11218   return ptr == nullptr;
11219 }
11220 
ctx()11221 isl::ctx id_list::ctx() const {
11222   return isl::ctx(isl_id_list_get_ctx(ptr));
11223 }
11224 
add(isl::id el)11225 isl::id_list id_list::add(isl::id el) const
11226 {
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);
11235 }
11236 
add(const std::string & el)11237 isl::id_list id_list::add(const std::string &el) const
11238 {
11239   if (!ptr)
11240     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11241   return this->add(isl::id(ctx(), el));
11242 }
11243 
at(int index)11244 isl::id id_list::at(int index) const
11245 {
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);
11254 }
11255 
get_at(int index)11256 isl::id id_list::get_at(int index) const
11257 {
11258   return at(index);
11259 }
11260 
clear()11261 isl::id_list id_list::clear() const
11262 {
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);
11271 }
11272 
concat(isl::id_list list2)11273 isl::id_list id_list::concat(isl::id_list list2) const
11274 {
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);
11283 }
11284 
drop(unsigned int first,unsigned int n)11285 isl::id_list id_list::drop(unsigned int first, unsigned int n) const
11286 {
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);
11295 }
11296 
foreach(const std::function<void (isl::id)> & fn)11297 void id_list::foreach(const std::function<void(isl::id)> &fn) const
11298 {
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;
11315     }
11316   };
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;
11323 }
11324 
foreach_scc(const std::function<bool (isl::id,isl::id)> & follows,const std::function<void (isl::id_list)> & fn)11325 void id_list::foreach_scc(const std::function<bool(isl::id, isl::id)> &follows, const std::function<void(isl::id_list)> &fn) const
11326 {
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;
11343     }
11344   };
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;
11357     }
11358   };
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;
11367 }
11368 
insert(unsigned int pos,isl::id el)11369 isl::id_list id_list::insert(unsigned int pos, isl::id el) const
11370 {
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);
11379 }
11380 
insert(unsigned int pos,const std::string & el)11381 isl::id_list id_list::insert(unsigned int pos, const std::string &el) const
11382 {
11383   if (!ptr)
11384     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11385   return this->insert(pos, isl::id(ctx(), el));
11386 }
11387 
set_at(int index,isl::id el)11388 isl::id_list id_list::set_at(int index, isl::id el) const
11389 {
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);
11398 }
11399 
set_at(int index,const std::string & el)11400 isl::id_list id_list::set_at(int index, const std::string &el) const
11401 {
11402   if (!ptr)
11403     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11404   return this->set_at(index, isl::id(ctx(), el));
11405 }
11406 
size()11407 unsigned id_list::size() const
11408 {
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;
11417 }
11418 
11419 inline std::ostream &operator<<(std::ostream &os, const id_list &obj)
11420 {
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;
11431 }
11432 
11433 // implementations for isl::id_to_ast_expr
manage(__isl_take isl_id_to_ast_expr * ptr)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);
11438 }
manage_copy(__isl_keep isl_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);
11448 }
11449 
id_to_ast_expr(__isl_take isl_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) {}
11452 
id_to_ast_expr()11453 id_to_ast_expr::id_to_ast_expr()
11454     : ptr(nullptr) {}
11455 
id_to_ast_expr(const id_to_ast_expr & obj)11456 id_to_ast_expr::id_to_ast_expr(const id_to_ast_expr &obj)
11457     : ptr(nullptr)
11458 {
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);
11466 }
11467 
id_to_ast_expr(isl::ctx ctx,int min_size)11468 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, int min_size)
11469 {
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;
11476 }
11477 
id_to_ast_expr(isl::ctx ctx,const std::string & str)11478 id_to_ast_expr::id_to_ast_expr(isl::ctx ctx, const std::string &str)
11479 {
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;
11486 }
11487 
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;
11491 }
11492 
~id_to_ast_expr()11493 id_to_ast_expr::~id_to_ast_expr() {
11494   if (ptr)
11495     isl_id_to_ast_expr_free(ptr);
11496 }
11497 
copy()11498 __isl_give isl_id_to_ast_expr *id_to_ast_expr::copy() const & {
11499   return isl_id_to_ast_expr_copy(ptr);
11500 }
11501 
get()11502 __isl_keep isl_id_to_ast_expr *id_to_ast_expr::get() const {
11503   return ptr;
11504 }
11505 
release()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;
11510 }
11511 
is_null()11512 bool id_to_ast_expr::is_null() const {
11513   return ptr == nullptr;
11514 }
11515 
ctx()11516 isl::ctx id_to_ast_expr::ctx() const {
11517   return isl::ctx(isl_id_to_ast_expr_get_ctx(ptr));
11518 }
11519 
is_equal(const isl::id_to_ast_expr & hmap2)11520 bool id_to_ast_expr::is_equal(const isl::id_to_ast_expr &hmap2) const
11521 {
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;
11530 }
11531 
set(isl::id key,isl::ast_expr val)11532 isl::id_to_ast_expr id_to_ast_expr::set(isl::id key, isl::ast_expr val) const
11533 {
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);
11542 }
11543 
set(const std::string & key,const isl::ast_expr & val)11544 isl::id_to_ast_expr id_to_ast_expr::set(const std::string &key, const isl::ast_expr &val) const
11545 {
11546   if (!ptr)
11547     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11548   return this->set(isl::id(ctx(), key), val);
11549 }
11550 
11551 inline std::ostream &operator<<(std::ostream &os, const id_to_ast_expr &obj)
11552 {
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;
11563 }
11564 
11565 // implementations for isl::id_to_id
manage(__isl_take isl_id_to_id * ptr)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);
11570 }
manage_copy(__isl_keep isl_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);
11580 }
11581 
id_to_id(__isl_take isl_id_to_id * ptr)11582 id_to_id::id_to_id(__isl_take isl_id_to_id *ptr)
11583     : ptr(ptr) {}
11584 
id_to_id()11585 id_to_id::id_to_id()
11586     : ptr(nullptr) {}
11587 
id_to_id(const id_to_id & obj)11588 id_to_id::id_to_id(const id_to_id &obj)
11589     : ptr(nullptr)
11590 {
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);
11598 }
11599 
id_to_id(isl::ctx ctx,int min_size)11600 id_to_id::id_to_id(isl::ctx ctx, int min_size)
11601 {
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;
11608 }
11609 
id_to_id(isl::ctx ctx,const std::string & str)11610 id_to_id::id_to_id(isl::ctx ctx, const std::string &str)
11611 {
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;
11618 }
11619 
11620 id_to_id &id_to_id::operator=(id_to_id obj) {
11621   std::swap(this->ptr, obj.ptr);
11622   return *this;
11623 }
11624 
~id_to_id()11625 id_to_id::~id_to_id() {
11626   if (ptr)
11627     isl_id_to_id_free(ptr);
11628 }
11629 
copy()11630 __isl_give isl_id_to_id *id_to_id::copy() const & {
11631   return isl_id_to_id_copy(ptr);
11632 }
11633 
get()11634 __isl_keep isl_id_to_id *id_to_id::get() const {
11635   return ptr;
11636 }
11637 
release()11638 __isl_give isl_id_to_id *id_to_id::release() {
11639   isl_id_to_id *tmp = ptr;
11640   ptr = nullptr;
11641   return tmp;
11642 }
11643 
is_null()11644 bool id_to_id::is_null() const {
11645   return ptr == nullptr;
11646 }
11647 
ctx()11648 isl::ctx id_to_id::ctx() const {
11649   return isl::ctx(isl_id_to_id_get_ctx(ptr));
11650 }
11651 
is_equal(const isl::id_to_id & hmap2)11652 bool id_to_id::is_equal(const isl::id_to_id &hmap2) const
11653 {
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;
11662 }
11663 
set(isl::id key,isl::id val)11664 isl::id_to_id id_to_id::set(isl::id key, isl::id val) const
11665 {
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);
11674 }
11675 
set(const isl::id & key,const std::string & val)11676 isl::id_to_id id_to_id::set(const isl::id &key, const std::string &val) const
11677 {
11678   if (!ptr)
11679     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11680   return this->set(key, isl::id(ctx(), val));
11681 }
11682 
set(const std::string & key,const isl::id & val)11683 isl::id_to_id id_to_id::set(const std::string &key, const isl::id &val) const
11684 {
11685   if (!ptr)
11686     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11687   return this->set(isl::id(ctx(), key), val);
11688 }
11689 
set(const std::string & key,const std::string & val)11690 isl::id_to_id id_to_id::set(const std::string &key, const std::string &val) const
11691 {
11692   if (!ptr)
11693     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11694   return this->set(isl::id(ctx(), key), isl::id(ctx(), val));
11695 }
11696 
11697 inline std::ostream &operator<<(std::ostream &os, const id_to_id &obj)
11698 {
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;
11709 }
11710 
11711 // implementations for isl::map
manage(__isl_take isl_map * ptr)11712 map manage(__isl_take isl_map *ptr) {
11713   if (!ptr)
11714     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11715   return map(ptr);
11716 }
manage_copy(__isl_keep isl_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);
11726 }
11727 
map(__isl_take isl_map * ptr)11728 map::map(__isl_take isl_map *ptr)
11729     : ptr(ptr) {}
11730 
map()11731 map::map()
11732     : ptr(nullptr) {}
11733 
map(const map & obj)11734 map::map(const map &obj)
11735     : ptr(nullptr)
11736 {
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);
11744 }
11745 
map(isl::basic_map bmap)11746 map::map(isl::basic_map bmap)
11747 {
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;
11756 }
11757 
map(isl::ctx ctx,const std::string & str)11758 map::map(isl::ctx ctx, const std::string &str)
11759 {
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;
11766 }
11767 
11768 map &map::operator=(map obj) {
11769   std::swap(this->ptr, obj.ptr);
11770   return *this;
11771 }
11772 
~map()11773 map::~map() {
11774   if (ptr)
11775     isl_map_free(ptr);
11776 }
11777 
copy()11778 __isl_give isl_map *map::copy() const & {
11779   return isl_map_copy(ptr);
11780 }
11781 
get()11782 __isl_keep isl_map *map::get() const {
11783   return ptr;
11784 }
11785 
release()11786 __isl_give isl_map *map::release() {
11787   isl_map *tmp = ptr;
11788   ptr = nullptr;
11789   return tmp;
11790 }
11791 
is_null()11792 bool map::is_null() const {
11793   return ptr == nullptr;
11794 }
11795 
ctx()11796 isl::ctx map::ctx() const {
11797   return isl::ctx(isl_map_get_ctx(ptr));
11798 }
11799 
affine_hull()11800 isl::basic_map map::affine_hull() const
11801 {
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);
11810 }
11811 
apply_domain(isl::map map2)11812 isl::map map::apply_domain(isl::map map2) const
11813 {
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);
11822 }
11823 
apply_domain(const isl::union_map & umap2)11824 isl::union_map map::apply_domain(const isl::union_map &umap2) const
11825 {
11826   if (!ptr)
11827     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11828   return isl::union_map(*this).apply_domain(umap2);
11829 }
11830 
apply_domain(const isl::basic_map & map2)11831 isl::map map::apply_domain(const isl::basic_map &map2) const
11832 {
11833   if (!ptr)
11834     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11835   return this->apply_domain(isl::map(map2));
11836 }
11837 
apply_range(isl::map map2)11838 isl::map map::apply_range(isl::map map2) const
11839 {
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);
11848 }
11849 
apply_range(const isl::union_map & umap2)11850 isl::union_map map::apply_range(const isl::union_map &umap2) const
11851 {
11852   if (!ptr)
11853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11854   return isl::union_map(*this).apply_range(umap2);
11855 }
11856 
apply_range(const isl::basic_map & map2)11857 isl::map map::apply_range(const isl::basic_map &map2) const
11858 {
11859   if (!ptr)
11860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11861   return this->apply_range(isl::map(map2));
11862 }
11863 
as_map()11864 isl::map map::as_map() const
11865 {
11866   if (!ptr)
11867     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11868   return isl::union_map(*this).as_map();
11869 }
11870 
as_multi_union_pw_aff()11871 isl::multi_union_pw_aff map::as_multi_union_pw_aff() const
11872 {
11873   if (!ptr)
11874     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11875   return isl::union_map(*this).as_multi_union_pw_aff();
11876 }
11877 
as_pw_multi_aff()11878 isl::pw_multi_aff map::as_pw_multi_aff() const
11879 {
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);
11888 }
11889 
as_union_pw_multi_aff()11890 isl::union_pw_multi_aff map::as_union_pw_multi_aff() const
11891 {
11892   if (!ptr)
11893     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11894   return isl::union_map(*this).as_union_pw_multi_aff();
11895 }
11896 
bind_domain(isl::multi_id tuple)11897 isl::set map::bind_domain(isl::multi_id tuple) const
11898 {
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);
11907 }
11908 
bind_range(isl::multi_id tuple)11909 isl::set map::bind_range(isl::multi_id tuple) const
11910 {
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);
11919 }
11920 
coalesce()11921 isl::map map::coalesce() const
11922 {
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);
11931 }
11932 
complement()11933 isl::map map::complement() const
11934 {
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);
11943 }
11944 
compute_divs()11945 isl::union_map map::compute_divs() const
11946 {
11947   if (!ptr)
11948     exception::throw_invalid("NULL input", __FILE__, __LINE__);
11949   return isl::union_map(*this).compute_divs();
11950 }
11951 
curry()11952 isl::map map::curry() const
11953 {
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);
11962 }
11963 
deltas()11964 isl::set map::deltas() const
11965 {
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);
11974 }
11975 
detect_equalities()11976 isl::map map::detect_equalities() const
11977 {
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);
11986 }
11987 
domain()11988 isl::set map::domain() const
11989 {
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);
11998 }
11999 
domain_factor_domain()12000 isl::map map::domain_factor_domain() const
12001 {
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);
12010 }
12011 
domain_factor_range()12012 isl::map map::domain_factor_range() const
12013 {
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);
12022 }
12023 
domain_map()12024 isl::union_map map::domain_map() const
12025 {
12026   if (!ptr)
12027     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12028   return isl::union_map(*this).domain_map();
12029 }
12030 
domain_map_union_pw_multi_aff()12031 isl::union_pw_multi_aff map::domain_map_union_pw_multi_aff() const
12032 {
12033   if (!ptr)
12034     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12035   return isl::union_map(*this).domain_map_union_pw_multi_aff();
12036 }
12037 
domain_product(isl::map map2)12038 isl::map map::domain_product(isl::map map2) const
12039 {
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);
12048 }
12049 
domain_product(const isl::union_map & umap2)12050 isl::union_map map::domain_product(const isl::union_map &umap2) const
12051 {
12052   if (!ptr)
12053     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12054   return isl::union_map(*this).domain_product(umap2);
12055 }
12056 
domain_product(const isl::basic_map & map2)12057 isl::map map::domain_product(const isl::basic_map &map2) const
12058 {
12059   if (!ptr)
12060     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12061   return this->domain_product(isl::map(map2));
12062 }
12063 
domain_reverse()12064 isl::map map::domain_reverse() const
12065 {
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);
12074 }
12075 
domain_tuple_dim()12076 unsigned map::domain_tuple_dim() const
12077 {
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;
12086 }
12087 
domain_tuple_id()12088 isl::id map::domain_tuple_id() const
12089 {
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);
12098 }
12099 
get_domain_tuple_id()12100 isl::id map::get_domain_tuple_id() const
12101 {
12102   return domain_tuple_id();
12103 }
12104 
drop_unused_params()12105 isl::map map::drop_unused_params() const
12106 {
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);
12115 }
12116 
empty(isl::space space)12117 isl::map map::empty(isl::space space)
12118 {
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);
12127 }
12128 
eq_at(isl::multi_pw_aff mpa)12129 isl::map map::eq_at(isl::multi_pw_aff mpa) const
12130 {
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);
12139 }
12140 
eq_at(const isl::multi_union_pw_aff & mupa)12141 isl::union_map map::eq_at(const isl::multi_union_pw_aff &mupa) const
12142 {
12143   if (!ptr)
12144     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12145   return isl::union_map(*this).eq_at(mupa);
12146 }
12147 
eq_at(const isl::aff & mpa)12148 isl::map map::eq_at(const isl::aff &mpa) const
12149 {
12150   if (!ptr)
12151     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12152   return this->eq_at(isl::multi_pw_aff(mpa));
12153 }
12154 
eq_at(const isl::multi_aff & mpa)12155 isl::map map::eq_at(const isl::multi_aff &mpa) const
12156 {
12157   if (!ptr)
12158     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12159   return this->eq_at(isl::multi_pw_aff(mpa));
12160 }
12161 
eq_at(const isl::pw_aff & mpa)12162 isl::map map::eq_at(const isl::pw_aff &mpa) const
12163 {
12164   if (!ptr)
12165     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12166   return this->eq_at(isl::multi_pw_aff(mpa));
12167 }
12168 
eq_at(const isl::pw_multi_aff & mpa)12169 isl::map map::eq_at(const isl::pw_multi_aff &mpa) const
12170 {
12171   if (!ptr)
12172     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12173   return this->eq_at(isl::multi_pw_aff(mpa));
12174 }
12175 
every_map(const std::function<bool (isl::map)> & test)12176 bool map::every_map(const std::function<bool(isl::map)> &test) const
12177 {
12178   if (!ptr)
12179     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12180   return isl::union_map(*this).every_map(test);
12181 }
12182 
extract_map(const isl::space & space)12183 isl::map map::extract_map(const isl::space &space) const
12184 {
12185   if (!ptr)
12186     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12187   return isl::union_map(*this).extract_map(space);
12188 }
12189 
factor_domain()12190 isl::map map::factor_domain() const
12191 {
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);
12200 }
12201 
factor_range()12202 isl::map map::factor_range() const
12203 {
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);
12212 }
12213 
fixed_power(isl::val exp)12214 isl::map map::fixed_power(isl::val exp) const
12215 {
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);
12224 }
12225 
fixed_power(long exp)12226 isl::map map::fixed_power(long exp) const
12227 {
12228   if (!ptr)
12229     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12230   return this->fixed_power(isl::val(ctx(), exp));
12231 }
12232 
flatten()12233 isl::map map::flatten() const
12234 {
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);
12243 }
12244 
flatten_domain()12245 isl::map map::flatten_domain() const
12246 {
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);
12255 }
12256 
flatten_range()12257 isl::map map::flatten_range() const
12258 {
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);
12267 }
12268 
foreach_basic_map(const std::function<void (isl::basic_map)> & fn)12269 void map::foreach_basic_map(const std::function<void(isl::basic_map)> &fn) const
12270 {
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;
12287     }
12288   };
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;
12295 }
12296 
foreach_map(const std::function<void (isl::map)> & fn)12297 void map::foreach_map(const std::function<void(isl::map)> &fn) const
12298 {
12299   if (!ptr)
12300     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12301   return isl::union_map(*this).foreach_map(fn);
12302 }
12303 
gist(isl::map context)12304 isl::map map::gist(isl::map context) const
12305 {
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);
12314 }
12315 
gist(const isl::union_map & context)12316 isl::union_map map::gist(const isl::union_map &context) const
12317 {
12318   if (!ptr)
12319     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12320   return isl::union_map(*this).gist(context);
12321 }
12322 
gist(const isl::basic_map & context)12323 isl::map map::gist(const isl::basic_map &context) const
12324 {
12325   if (!ptr)
12326     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12327   return this->gist(isl::map(context));
12328 }
12329 
gist_domain(isl::set context)12330 isl::map map::gist_domain(isl::set context) const
12331 {
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);
12340 }
12341 
gist_domain(const isl::union_set & uset)12342 isl::union_map map::gist_domain(const isl::union_set &uset) const
12343 {
12344   if (!ptr)
12345     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12346   return isl::union_map(*this).gist_domain(uset);
12347 }
12348 
gist_domain(const isl::basic_set & context)12349 isl::map map::gist_domain(const isl::basic_set &context) const
12350 {
12351   if (!ptr)
12352     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12353   return this->gist_domain(isl::set(context));
12354 }
12355 
gist_domain(const isl::point & context)12356 isl::map map::gist_domain(const isl::point &context) const
12357 {
12358   if (!ptr)
12359     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12360   return this->gist_domain(isl::set(context));
12361 }
12362 
gist_params(isl::set context)12363 isl::map map::gist_params(isl::set context) const
12364 {
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);
12373 }
12374 
gist_range(const isl::union_set & uset)12375 isl::union_map map::gist_range(const isl::union_set &uset) const
12376 {
12377   if (!ptr)
12378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12379   return isl::union_map(*this).gist_range(uset);
12380 }
12381 
has_domain_tuple_id()12382 bool map::has_domain_tuple_id() const
12383 {
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;
12392 }
12393 
has_range_tuple_id()12394 bool map::has_range_tuple_id() const
12395 {
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;
12404 }
12405 
intersect(isl::map map2)12406 isl::map map::intersect(isl::map map2) const
12407 {
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);
12416 }
12417 
intersect(const isl::union_map & umap2)12418 isl::union_map map::intersect(const isl::union_map &umap2) const
12419 {
12420   if (!ptr)
12421     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12422   return isl::union_map(*this).intersect(umap2);
12423 }
12424 
intersect(const isl::basic_map & map2)12425 isl::map map::intersect(const isl::basic_map &map2) const
12426 {
12427   if (!ptr)
12428     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12429   return this->intersect(isl::map(map2));
12430 }
12431 
intersect_domain(isl::set set)12432 isl::map map::intersect_domain(isl::set set) const
12433 {
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);
12442 }
12443 
intersect_domain(const isl::space & space)12444 isl::union_map map::intersect_domain(const isl::space &space) const
12445 {
12446   if (!ptr)
12447     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12448   return isl::union_map(*this).intersect_domain(space);
12449 }
12450 
intersect_domain(const isl::union_set & uset)12451 isl::union_map map::intersect_domain(const isl::union_set &uset) const
12452 {
12453   if (!ptr)
12454     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12455   return isl::union_map(*this).intersect_domain(uset);
12456 }
12457 
intersect_domain(const isl::basic_set & set)12458 isl::map map::intersect_domain(const isl::basic_set &set) const
12459 {
12460   if (!ptr)
12461     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12462   return this->intersect_domain(isl::set(set));
12463 }
12464 
intersect_domain(const isl::point & set)12465 isl::map map::intersect_domain(const isl::point &set) const
12466 {
12467   if (!ptr)
12468     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12469   return this->intersect_domain(isl::set(set));
12470 }
12471 
intersect_domain_factor_domain(isl::map factor)12472 isl::map map::intersect_domain_factor_domain(isl::map factor) const
12473 {
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);
12482 }
12483 
intersect_domain_factor_domain(const isl::union_map & factor)12484 isl::union_map map::intersect_domain_factor_domain(const isl::union_map &factor) const
12485 {
12486   if (!ptr)
12487     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12488   return isl::union_map(*this).intersect_domain_factor_domain(factor);
12489 }
12490 
intersect_domain_factor_domain(const isl::basic_map & factor)12491 isl::map map::intersect_domain_factor_domain(const isl::basic_map &factor) const
12492 {
12493   if (!ptr)
12494     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12495   return this->intersect_domain_factor_domain(isl::map(factor));
12496 }
12497 
intersect_domain_factor_range(isl::map factor)12498 isl::map map::intersect_domain_factor_range(isl::map factor) const
12499 {
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);
12508 }
12509 
intersect_domain_factor_range(const isl::union_map & factor)12510 isl::union_map map::intersect_domain_factor_range(const isl::union_map &factor) const
12511 {
12512   if (!ptr)
12513     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12514   return isl::union_map(*this).intersect_domain_factor_range(factor);
12515 }
12516 
intersect_domain_factor_range(const isl::basic_map & factor)12517 isl::map map::intersect_domain_factor_range(const isl::basic_map &factor) const
12518 {
12519   if (!ptr)
12520     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12521   return this->intersect_domain_factor_range(isl::map(factor));
12522 }
12523 
intersect_domain_wrapped_domain(isl::set domain)12524 isl::map map::intersect_domain_wrapped_domain(isl::set domain) const
12525 {
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);
12534 }
12535 
intersect_domain_wrapped_domain(const isl::union_set & domain)12536 isl::union_map map::intersect_domain_wrapped_domain(const isl::union_set &domain) const
12537 {
12538   if (!ptr)
12539     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12540   return isl::union_map(*this).intersect_domain_wrapped_domain(domain);
12541 }
12542 
intersect_domain_wrapped_domain(const isl::basic_set & domain)12543 isl::map map::intersect_domain_wrapped_domain(const isl::basic_set &domain) const
12544 {
12545   if (!ptr)
12546     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12547   return this->intersect_domain_wrapped_domain(isl::set(domain));
12548 }
12549 
intersect_domain_wrapped_domain(const isl::point & domain)12550 isl::map map::intersect_domain_wrapped_domain(const isl::point &domain) const
12551 {
12552   if (!ptr)
12553     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12554   return this->intersect_domain_wrapped_domain(isl::set(domain));
12555 }
12556 
intersect_params(isl::set params)12557 isl::map map::intersect_params(isl::set params) const
12558 {
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);
12567 }
12568 
intersect_range(isl::set set)12569 isl::map map::intersect_range(isl::set set) const
12570 {
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);
12579 }
12580 
intersect_range(const isl::space & space)12581 isl::union_map map::intersect_range(const isl::space &space) const
12582 {
12583   if (!ptr)
12584     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12585   return isl::union_map(*this).intersect_range(space);
12586 }
12587 
intersect_range(const isl::union_set & uset)12588 isl::union_map map::intersect_range(const isl::union_set &uset) const
12589 {
12590   if (!ptr)
12591     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12592   return isl::union_map(*this).intersect_range(uset);
12593 }
12594 
intersect_range(const isl::basic_set & set)12595 isl::map map::intersect_range(const isl::basic_set &set) const
12596 {
12597   if (!ptr)
12598     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12599   return this->intersect_range(isl::set(set));
12600 }
12601 
intersect_range(const isl::point & set)12602 isl::map map::intersect_range(const isl::point &set) const
12603 {
12604   if (!ptr)
12605     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12606   return this->intersect_range(isl::set(set));
12607 }
12608 
intersect_range_factor_domain(isl::map factor)12609 isl::map map::intersect_range_factor_domain(isl::map factor) const
12610 {
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);
12619 }
12620 
intersect_range_factor_domain(const isl::union_map & factor)12621 isl::union_map map::intersect_range_factor_domain(const isl::union_map &factor) const
12622 {
12623   if (!ptr)
12624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12625   return isl::union_map(*this).intersect_range_factor_domain(factor);
12626 }
12627 
intersect_range_factor_domain(const isl::basic_map & factor)12628 isl::map map::intersect_range_factor_domain(const isl::basic_map &factor) const
12629 {
12630   if (!ptr)
12631     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12632   return this->intersect_range_factor_domain(isl::map(factor));
12633 }
12634 
intersect_range_factor_range(isl::map factor)12635 isl::map map::intersect_range_factor_range(isl::map factor) const
12636 {
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);
12645 }
12646 
intersect_range_factor_range(const isl::union_map & factor)12647 isl::union_map map::intersect_range_factor_range(const isl::union_map &factor) const
12648 {
12649   if (!ptr)
12650     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12651   return isl::union_map(*this).intersect_range_factor_range(factor);
12652 }
12653 
intersect_range_factor_range(const isl::basic_map & factor)12654 isl::map map::intersect_range_factor_range(const isl::basic_map &factor) const
12655 {
12656   if (!ptr)
12657     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12658   return this->intersect_range_factor_range(isl::map(factor));
12659 }
12660 
intersect_range_wrapped_domain(isl::set domain)12661 isl::map map::intersect_range_wrapped_domain(isl::set domain) const
12662 {
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);
12671 }
12672 
intersect_range_wrapped_domain(const isl::union_set & domain)12673 isl::union_map map::intersect_range_wrapped_domain(const isl::union_set &domain) const
12674 {
12675   if (!ptr)
12676     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12677   return isl::union_map(*this).intersect_range_wrapped_domain(domain);
12678 }
12679 
intersect_range_wrapped_domain(const isl::basic_set & domain)12680 isl::map map::intersect_range_wrapped_domain(const isl::basic_set &domain) const
12681 {
12682   if (!ptr)
12683     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12684   return this->intersect_range_wrapped_domain(isl::set(domain));
12685 }
12686 
intersect_range_wrapped_domain(const isl::point & domain)12687 isl::map map::intersect_range_wrapped_domain(const isl::point &domain) const
12688 {
12689   if (!ptr)
12690     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12691   return this->intersect_range_wrapped_domain(isl::set(domain));
12692 }
12693 
is_bijective()12694 bool map::is_bijective() const
12695 {
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;
12704 }
12705 
is_disjoint(const isl::map & map2)12706 bool map::is_disjoint(const isl::map &map2) const
12707 {
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;
12716 }
12717 
is_disjoint(const isl::union_map & umap2)12718 bool map::is_disjoint(const isl::union_map &umap2) const
12719 {
12720   if (!ptr)
12721     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12722   return isl::union_map(*this).is_disjoint(umap2);
12723 }
12724 
is_disjoint(const isl::basic_map & map2)12725 bool map::is_disjoint(const isl::basic_map &map2) const
12726 {
12727   if (!ptr)
12728     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12729   return this->is_disjoint(isl::map(map2));
12730 }
12731 
is_empty()12732 bool map::is_empty() const
12733 {
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;
12742 }
12743 
is_equal(const isl::map & map2)12744 bool map::is_equal(const isl::map &map2) const
12745 {
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;
12754 }
12755 
is_equal(const isl::union_map & umap2)12756 bool map::is_equal(const isl::union_map &umap2) const
12757 {
12758   if (!ptr)
12759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12760   return isl::union_map(*this).is_equal(umap2);
12761 }
12762 
is_equal(const isl::basic_map & map2)12763 bool map::is_equal(const isl::basic_map &map2) const
12764 {
12765   if (!ptr)
12766     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12767   return this->is_equal(isl::map(map2));
12768 }
12769 
is_injective()12770 bool map::is_injective() const
12771 {
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;
12780 }
12781 
is_single_valued()12782 bool map::is_single_valued() const
12783 {
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;
12792 }
12793 
is_strict_subset(const isl::map & map2)12794 bool map::is_strict_subset(const isl::map &map2) const
12795 {
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;
12804 }
12805 
is_strict_subset(const isl::union_map & umap2)12806 bool map::is_strict_subset(const isl::union_map &umap2) const
12807 {
12808   if (!ptr)
12809     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12810   return isl::union_map(*this).is_strict_subset(umap2);
12811 }
12812 
is_strict_subset(const isl::basic_map & map2)12813 bool map::is_strict_subset(const isl::basic_map &map2) const
12814 {
12815   if (!ptr)
12816     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12817   return this->is_strict_subset(isl::map(map2));
12818 }
12819 
is_subset(const isl::map & map2)12820 bool map::is_subset(const isl::map &map2) const
12821 {
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;
12830 }
12831 
is_subset(const isl::union_map & umap2)12832 bool map::is_subset(const isl::union_map &umap2) const
12833 {
12834   if (!ptr)
12835     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12836   return isl::union_map(*this).is_subset(umap2);
12837 }
12838 
is_subset(const isl::basic_map & map2)12839 bool map::is_subset(const isl::basic_map &map2) const
12840 {
12841   if (!ptr)
12842     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12843   return this->is_subset(isl::map(map2));
12844 }
12845 
isa_map()12846 bool map::isa_map() const
12847 {
12848   if (!ptr)
12849     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12850   return isl::union_map(*this).isa_map();
12851 }
12852 
lex_ge_at(isl::multi_pw_aff mpa)12853 isl::map map::lex_ge_at(isl::multi_pw_aff mpa) const
12854 {
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);
12863 }
12864 
lex_gt_at(isl::multi_pw_aff mpa)12865 isl::map map::lex_gt_at(isl::multi_pw_aff mpa) const
12866 {
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);
12875 }
12876 
lex_le_at(isl::multi_pw_aff mpa)12877 isl::map map::lex_le_at(isl::multi_pw_aff mpa) const
12878 {
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);
12887 }
12888 
lex_lt_at(isl::multi_pw_aff mpa)12889 isl::map map::lex_lt_at(isl::multi_pw_aff mpa) const
12890 {
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);
12899 }
12900 
lexmax()12901 isl::map map::lexmax() const
12902 {
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);
12911 }
12912 
lexmax_pw_multi_aff()12913 isl::pw_multi_aff map::lexmax_pw_multi_aff() const
12914 {
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);
12923 }
12924 
lexmin()12925 isl::map map::lexmin() const
12926 {
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);
12935 }
12936 
lexmin_pw_multi_aff()12937 isl::pw_multi_aff map::lexmin_pw_multi_aff() const
12938 {
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);
12947 }
12948 
lower_bound(isl::multi_pw_aff lower)12949 isl::map map::lower_bound(isl::multi_pw_aff lower) const
12950 {
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);
12959 }
12960 
map_list()12961 isl::map_list map::map_list() const
12962 {
12963   if (!ptr)
12964     exception::throw_invalid("NULL input", __FILE__, __LINE__);
12965   return isl::union_map(*this).map_list();
12966 }
12967 
max_multi_pw_aff()12968 isl::multi_pw_aff map::max_multi_pw_aff() const
12969 {
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);
12978 }
12979 
min_multi_pw_aff()12980 isl::multi_pw_aff map::min_multi_pw_aff() const
12981 {
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);
12990 }
12991 
n_basic_map()12992 unsigned map::n_basic_map() const
12993 {
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;
13002 }
13003 
params()13004 isl::set map::params() const
13005 {
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);
13014 }
13015 
polyhedral_hull()13016 isl::basic_map map::polyhedral_hull() const
13017 {
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);
13026 }
13027 
preimage_domain(isl::multi_aff ma)13028 isl::map map::preimage_domain(isl::multi_aff ma) const
13029 {
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);
13038 }
13039 
preimage_domain(isl::multi_pw_aff mpa)13040 isl::map map::preimage_domain(isl::multi_pw_aff mpa) const
13041 {
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);
13050 }
13051 
preimage_domain(isl::pw_multi_aff pma)13052 isl::map map::preimage_domain(isl::pw_multi_aff pma) const
13053 {
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);
13062 }
13063 
preimage_domain(const isl::union_pw_multi_aff & upma)13064 isl::union_map map::preimage_domain(const isl::union_pw_multi_aff &upma) const
13065 {
13066   if (!ptr)
13067     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13068   return isl::union_map(*this).preimage_domain(upma);
13069 }
13070 
preimage_range(isl::multi_aff ma)13071 isl::map map::preimage_range(isl::multi_aff ma) const
13072 {
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);
13081 }
13082 
preimage_range(isl::pw_multi_aff pma)13083 isl::map map::preimage_range(isl::pw_multi_aff pma) const
13084 {
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);
13093 }
13094 
preimage_range(const isl::union_pw_multi_aff & upma)13095 isl::union_map map::preimage_range(const isl::union_pw_multi_aff &upma) const
13096 {
13097   if (!ptr)
13098     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13099   return isl::union_map(*this).preimage_range(upma);
13100 }
13101 
product(isl::map map2)13102 isl::map map::product(isl::map map2) const
13103 {
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);
13112 }
13113 
product(const isl::union_map & umap2)13114 isl::union_map map::product(const isl::union_map &umap2) const
13115 {
13116   if (!ptr)
13117     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13118   return isl::union_map(*this).product(umap2);
13119 }
13120 
product(const isl::basic_map & map2)13121 isl::map map::product(const isl::basic_map &map2) const
13122 {
13123   if (!ptr)
13124     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13125   return this->product(isl::map(map2));
13126 }
13127 
project_out_all_params()13128 isl::map map::project_out_all_params() const
13129 {
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);
13138 }
13139 
project_out_param(isl::id id)13140 isl::map map::project_out_param(isl::id id) const
13141 {
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);
13150 }
13151 
project_out_param(const std::string & id)13152 isl::map map::project_out_param(const std::string &id) const
13153 {
13154   if (!ptr)
13155     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13156   return this->project_out_param(isl::id(ctx(), id));
13157 }
13158 
project_out_param(isl::id_list list)13159 isl::map map::project_out_param(isl::id_list list) const
13160 {
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);
13169 }
13170 
range()13171 isl::set map::range() const
13172 {
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);
13181 }
13182 
range_factor_domain()13183 isl::map map::range_factor_domain() const
13184 {
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);
13193 }
13194 
range_factor_range()13195 isl::map map::range_factor_range() const
13196 {
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);
13205 }
13206 
range_lattice_tile()13207 isl::fixed_box map::range_lattice_tile() const
13208 {
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);
13217 }
13218 
get_range_lattice_tile()13219 isl::fixed_box map::get_range_lattice_tile() const
13220 {
13221   return range_lattice_tile();
13222 }
13223 
range_map()13224 isl::union_map map::range_map() const
13225 {
13226   if (!ptr)
13227     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13228   return isl::union_map(*this).range_map();
13229 }
13230 
range_product(isl::map map2)13231 isl::map map::range_product(isl::map map2) const
13232 {
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);
13241 }
13242 
range_product(const isl::union_map & umap2)13243 isl::union_map map::range_product(const isl::union_map &umap2) const
13244 {
13245   if (!ptr)
13246     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13247   return isl::union_map(*this).range_product(umap2);
13248 }
13249 
range_product(const isl::basic_map & map2)13250 isl::map map::range_product(const isl::basic_map &map2) const
13251 {
13252   if (!ptr)
13253     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13254   return this->range_product(isl::map(map2));
13255 }
13256 
range_reverse()13257 isl::map map::range_reverse() const
13258 {
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);
13267 }
13268 
range_simple_fixed_box_hull()13269 isl::fixed_box map::range_simple_fixed_box_hull() const
13270 {
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);
13279 }
13280 
get_range_simple_fixed_box_hull()13281 isl::fixed_box map::get_range_simple_fixed_box_hull() const
13282 {
13283   return range_simple_fixed_box_hull();
13284 }
13285 
range_tuple_dim()13286 unsigned map::range_tuple_dim() const
13287 {
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;
13296 }
13297 
range_tuple_id()13298 isl::id map::range_tuple_id() const
13299 {
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);
13308 }
13309 
get_range_tuple_id()13310 isl::id map::get_range_tuple_id() const
13311 {
13312   return range_tuple_id();
13313 }
13314 
reverse()13315 isl::map map::reverse() const
13316 {
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);
13325 }
13326 
sample()13327 isl::basic_map map::sample() const
13328 {
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);
13337 }
13338 
set_domain_tuple(isl::id id)13339 isl::map map::set_domain_tuple(isl::id id) const
13340 {
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);
13349 }
13350 
set_domain_tuple(const std::string & id)13351 isl::map map::set_domain_tuple(const std::string &id) const
13352 {
13353   if (!ptr)
13354     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13355   return this->set_domain_tuple(isl::id(ctx(), id));
13356 }
13357 
set_range_tuple(isl::id id)13358 isl::map map::set_range_tuple(isl::id id) const
13359 {
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);
13368 }
13369 
set_range_tuple(const std::string & id)13370 isl::map map::set_range_tuple(const std::string &id) const
13371 {
13372   if (!ptr)
13373     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13374   return this->set_range_tuple(isl::id(ctx(), id));
13375 }
13376 
space()13377 isl::space map::space() const
13378 {
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);
13387 }
13388 
get_space()13389 isl::space map::get_space() const
13390 {
13391   return space();
13392 }
13393 
subtract(isl::map map2)13394 isl::map map::subtract(isl::map map2) const
13395 {
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);
13404 }
13405 
subtract(const isl::union_map & umap2)13406 isl::union_map map::subtract(const isl::union_map &umap2) const
13407 {
13408   if (!ptr)
13409     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13410   return isl::union_map(*this).subtract(umap2);
13411 }
13412 
subtract(const isl::basic_map & map2)13413 isl::map map::subtract(const isl::basic_map &map2) const
13414 {
13415   if (!ptr)
13416     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13417   return this->subtract(isl::map(map2));
13418 }
13419 
subtract_domain(const isl::union_set & dom)13420 isl::union_map map::subtract_domain(const isl::union_set &dom) const
13421 {
13422   if (!ptr)
13423     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13424   return isl::union_map(*this).subtract_domain(dom);
13425 }
13426 
subtract_range(const isl::union_set & dom)13427 isl::union_map map::subtract_range(const isl::union_set &dom) const
13428 {
13429   if (!ptr)
13430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13431   return isl::union_map(*this).subtract_range(dom);
13432 }
13433 
to_list()13434 isl::map_list map::to_list() const
13435 {
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);
13444 }
13445 
to_union_map()13446 isl::union_map map::to_union_map() const
13447 {
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);
13456 }
13457 
uncurry()13458 isl::map map::uncurry() const
13459 {
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);
13468 }
13469 
unite(isl::map map2)13470 isl::map map::unite(isl::map map2) const
13471 {
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);
13480 }
13481 
unite(const isl::union_map & umap2)13482 isl::union_map map::unite(const isl::union_map &umap2) const
13483 {
13484   if (!ptr)
13485     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13486   return isl::union_map(*this).unite(umap2);
13487 }
13488 
unite(const isl::basic_map & map2)13489 isl::map map::unite(const isl::basic_map &map2) const
13490 {
13491   if (!ptr)
13492     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13493   return this->unite(isl::map(map2));
13494 }
13495 
universe(isl::space space)13496 isl::map map::universe(isl::space space)
13497 {
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);
13506 }
13507 
unshifted_simple_hull()13508 isl::basic_map map::unshifted_simple_hull() const
13509 {
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);
13518 }
13519 
upper_bound(isl::multi_pw_aff upper)13520 isl::map map::upper_bound(isl::multi_pw_aff upper) const
13521 {
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);
13530 }
13531 
wrap()13532 isl::set map::wrap() const
13533 {
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);
13542 }
13543 
zip()13544 isl::map map::zip() const
13545 {
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);
13554 }
13555 
13556 inline std::ostream &operator<<(std::ostream &os, const map &obj)
13557 {
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;
13568 }
13569 
13570 // implementations for isl::map_list
manage(__isl_take isl_map_list * ptr)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);
13575 }
manage_copy(__isl_keep isl_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);
13585 }
13586 
map_list(__isl_take isl_map_list * ptr)13587 map_list::map_list(__isl_take isl_map_list *ptr)
13588     : ptr(ptr) {}
13589 
map_list()13590 map_list::map_list()
13591     : ptr(nullptr) {}
13592 
map_list(const map_list & obj)13593 map_list::map_list(const map_list &obj)
13594     : ptr(nullptr)
13595 {
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);
13603 }
13604 
map_list(isl::ctx ctx,int n)13605 map_list::map_list(isl::ctx ctx, int n)
13606 {
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;
13613 }
13614 
map_list(isl::map el)13615 map_list::map_list(isl::map el)
13616 {
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;
13625 }
13626 
map_list(isl::ctx ctx,const std::string & str)13627 map_list::map_list(isl::ctx ctx, const std::string &str)
13628 {
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;
13635 }
13636 
13637 map_list &map_list::operator=(map_list obj) {
13638   std::swap(this->ptr, obj.ptr);
13639   return *this;
13640 }
13641 
~map_list()13642 map_list::~map_list() {
13643   if (ptr)
13644     isl_map_list_free(ptr);
13645 }
13646 
copy()13647 __isl_give isl_map_list *map_list::copy() const & {
13648   return isl_map_list_copy(ptr);
13649 }
13650 
get()13651 __isl_keep isl_map_list *map_list::get() const {
13652   return ptr;
13653 }
13654 
release()13655 __isl_give isl_map_list *map_list::release() {
13656   isl_map_list *tmp = ptr;
13657   ptr = nullptr;
13658   return tmp;
13659 }
13660 
is_null()13661 bool map_list::is_null() const {
13662   return ptr == nullptr;
13663 }
13664 
ctx()13665 isl::ctx map_list::ctx() const {
13666   return isl::ctx(isl_map_list_get_ctx(ptr));
13667 }
13668 
add(isl::map el)13669 isl::map_list map_list::add(isl::map el) const
13670 {
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);
13679 }
13680 
at(int index)13681 isl::map map_list::at(int index) const
13682 {
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);
13691 }
13692 
get_at(int index)13693 isl::map map_list::get_at(int index) const
13694 {
13695   return at(index);
13696 }
13697 
clear()13698 isl::map_list map_list::clear() const
13699 {
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);
13708 }
13709 
concat(isl::map_list list2)13710 isl::map_list map_list::concat(isl::map_list list2) const
13711 {
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);
13720 }
13721 
drop(unsigned int first,unsigned int n)13722 isl::map_list map_list::drop(unsigned int first, unsigned int n) const
13723 {
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);
13732 }
13733 
foreach(const std::function<void (isl::map)> & fn)13734 void map_list::foreach(const std::function<void(isl::map)> &fn) const
13735 {
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;
13752     }
13753   };
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;
13760 }
13761 
foreach_scc(const std::function<bool (isl::map,isl::map)> & follows,const std::function<void (isl::map_list)> & fn)13762 void map_list::foreach_scc(const std::function<bool(isl::map, isl::map)> &follows, const std::function<void(isl::map_list)> &fn) const
13763 {
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;
13780     }
13781   };
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;
13794     }
13795   };
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;
13804 }
13805 
insert(unsigned int pos,isl::map el)13806 isl::map_list map_list::insert(unsigned int pos, isl::map el) const
13807 {
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);
13816 }
13817 
set_at(int index,isl::map el)13818 isl::map_list map_list::set_at(int index, isl::map el) const
13819 {
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);
13828 }
13829 
size()13830 unsigned map_list::size() const
13831 {
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;
13840 }
13841 
13842 inline std::ostream &operator<<(std::ostream &os, const map_list &obj)
13843 {
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;
13854 }
13855 
13856 // implementations for isl::multi_aff
manage(__isl_take isl_multi_aff * ptr)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);
13861 }
manage_copy(__isl_keep isl_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);
13871 }
13872 
multi_aff(__isl_take isl_multi_aff * ptr)13873 multi_aff::multi_aff(__isl_take isl_multi_aff *ptr)
13874     : ptr(ptr) {}
13875 
multi_aff()13876 multi_aff::multi_aff()
13877     : ptr(nullptr) {}
13878 
multi_aff(const multi_aff & obj)13879 multi_aff::multi_aff(const multi_aff &obj)
13880     : ptr(nullptr)
13881 {
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);
13889 }
13890 
multi_aff(isl::aff aff)13891 multi_aff::multi_aff(isl::aff aff)
13892 {
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;
13901 }
13902 
multi_aff(isl::space space,isl::aff_list list)13903 multi_aff::multi_aff(isl::space space, isl::aff_list list)
13904 {
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;
13913 }
13914 
multi_aff(isl::ctx ctx,const std::string & str)13915 multi_aff::multi_aff(isl::ctx ctx, const std::string &str)
13916 {
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;
13923 }
13924 
13925 multi_aff &multi_aff::operator=(multi_aff obj) {
13926   std::swap(this->ptr, obj.ptr);
13927   return *this;
13928 }
13929 
~multi_aff()13930 multi_aff::~multi_aff() {
13931   if (ptr)
13932     isl_multi_aff_free(ptr);
13933 }
13934 
copy()13935 __isl_give isl_multi_aff *multi_aff::copy() const & {
13936   return isl_multi_aff_copy(ptr);
13937 }
13938 
get()13939 __isl_keep isl_multi_aff *multi_aff::get() const {
13940   return ptr;
13941 }
13942 
release()13943 __isl_give isl_multi_aff *multi_aff::release() {
13944   isl_multi_aff *tmp = ptr;
13945   ptr = nullptr;
13946   return tmp;
13947 }
13948 
is_null()13949 bool multi_aff::is_null() const {
13950   return ptr == nullptr;
13951 }
13952 
ctx()13953 isl::ctx multi_aff::ctx() const {
13954   return isl::ctx(isl_multi_aff_get_ctx(ptr));
13955 }
13956 
add(isl::multi_aff multi2)13957 isl::multi_aff multi_aff::add(isl::multi_aff multi2) const
13958 {
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);
13967 }
13968 
add(const isl::multi_pw_aff & multi2)13969 isl::multi_pw_aff multi_aff::add(const isl::multi_pw_aff &multi2) const
13970 {
13971   if (!ptr)
13972     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13973   return isl::pw_multi_aff(*this).add(multi2);
13974 }
13975 
add(const isl::multi_union_pw_aff & multi2)13976 isl::multi_union_pw_aff multi_aff::add(const isl::multi_union_pw_aff &multi2) const
13977 {
13978   if (!ptr)
13979     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13980   return isl::pw_multi_aff(*this).add(multi2);
13981 }
13982 
add(const isl::pw_multi_aff & pma2)13983 isl::pw_multi_aff multi_aff::add(const isl::pw_multi_aff &pma2) const
13984 {
13985   if (!ptr)
13986     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13987   return isl::pw_multi_aff(*this).add(pma2);
13988 }
13989 
add(const isl::union_pw_multi_aff & upma2)13990 isl::union_pw_multi_aff multi_aff::add(const isl::union_pw_multi_aff &upma2) const
13991 {
13992   if (!ptr)
13993     exception::throw_invalid("NULL input", __FILE__, __LINE__);
13994   return isl::pw_multi_aff(*this).add(upma2);
13995 }
13996 
add(const isl::aff & multi2)13997 isl::multi_aff multi_aff::add(const isl::aff &multi2) const
13998 {
13999   if (!ptr)
14000     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14001   return this->add(isl::multi_aff(multi2));
14002 }
14003 
add_constant(isl::multi_val mv)14004 isl::multi_aff multi_aff::add_constant(isl::multi_val mv) const
14005 {
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);
14014 }
14015 
add_constant(isl::val v)14016 isl::multi_aff multi_aff::add_constant(isl::val v) const
14017 {
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);
14026 }
14027 
add_constant(long v)14028 isl::multi_aff multi_aff::add_constant(long v) const
14029 {
14030   if (!ptr)
14031     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14032   return this->add_constant(isl::val(ctx(), v));
14033 }
14034 
apply(const isl::union_pw_multi_aff & upma2)14035 isl::union_pw_multi_aff multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
14036 {
14037   if (!ptr)
14038     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14039   return isl::pw_multi_aff(*this).apply(upma2);
14040 }
14041 
as_map()14042 isl::map multi_aff::as_map() const
14043 {
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);
14052 }
14053 
as_multi_aff()14054 isl::multi_aff multi_aff::as_multi_aff() const
14055 {
14056   if (!ptr)
14057     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14058   return isl::pw_multi_aff(*this).as_multi_aff();
14059 }
14060 
as_multi_union_pw_aff()14061 isl::multi_union_pw_aff multi_aff::as_multi_union_pw_aff() const
14062 {
14063   if (!ptr)
14064     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14065   return isl::pw_multi_aff(*this).as_multi_union_pw_aff();
14066 }
14067 
as_pw_multi_aff()14068 isl::pw_multi_aff multi_aff::as_pw_multi_aff() const
14069 {
14070   if (!ptr)
14071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14072   return isl::pw_multi_aff(*this).as_pw_multi_aff();
14073 }
14074 
as_set()14075 isl::set multi_aff::as_set() const
14076 {
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);
14085 }
14086 
as_union_map()14087 isl::union_map multi_aff::as_union_map() const
14088 {
14089   if (!ptr)
14090     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14091   return isl::pw_multi_aff(*this).as_union_map();
14092 }
14093 
at(int pos)14094 isl::aff multi_aff::at(int pos) const
14095 {
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);
14104 }
14105 
get_at(int pos)14106 isl::aff multi_aff::get_at(int pos) const
14107 {
14108   return at(pos);
14109 }
14110 
bind(isl::multi_id tuple)14111 isl::basic_set multi_aff::bind(isl::multi_id tuple) const
14112 {
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);
14121 }
14122 
bind_domain(isl::multi_id tuple)14123 isl::multi_aff multi_aff::bind_domain(isl::multi_id tuple) const
14124 {
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);
14133 }
14134 
bind_domain_wrapped_domain(isl::multi_id tuple)14135 isl::multi_aff multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
14136 {
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);
14145 }
14146 
coalesce()14147 isl::pw_multi_aff multi_aff::coalesce() const
14148 {
14149   if (!ptr)
14150     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14151   return isl::pw_multi_aff(*this).coalesce();
14152 }
14153 
constant_multi_val()14154 isl::multi_val multi_aff::constant_multi_val() const
14155 {
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);
14164 }
14165 
get_constant_multi_val()14166 isl::multi_val multi_aff::get_constant_multi_val() const
14167 {
14168   return constant_multi_val();
14169 }
14170 
domain()14171 isl::set multi_aff::domain() const
14172 {
14173   if (!ptr)
14174     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14175   return isl::pw_multi_aff(*this).domain();
14176 }
14177 
domain_map(isl::space space)14178 isl::multi_aff multi_aff::domain_map(isl::space space)
14179 {
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);
14188 }
14189 
domain_reverse()14190 isl::multi_aff multi_aff::domain_reverse() const
14191 {
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);
14200 }
14201 
drop_unused_params()14202 isl::pw_multi_aff multi_aff::drop_unused_params() const
14203 {
14204   if (!ptr)
14205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14206   return isl::pw_multi_aff(*this).drop_unused_params();
14207 }
14208 
extract_pw_multi_aff(const isl::space & space)14209 isl::pw_multi_aff multi_aff::extract_pw_multi_aff(const isl::space &space) const
14210 {
14211   if (!ptr)
14212     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14213   return isl::pw_multi_aff(*this).extract_pw_multi_aff(space);
14214 }
14215 
flat_range_product(isl::multi_aff multi2)14216 isl::multi_aff multi_aff::flat_range_product(isl::multi_aff multi2) const
14217 {
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);
14226 }
14227 
flat_range_product(const isl::multi_pw_aff & multi2)14228 isl::multi_pw_aff multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
14229 {
14230   if (!ptr)
14231     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14232   return isl::pw_multi_aff(*this).flat_range_product(multi2);
14233 }
14234 
flat_range_product(const isl::multi_union_pw_aff & multi2)14235 isl::multi_union_pw_aff multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
14236 {
14237   if (!ptr)
14238     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14239   return isl::pw_multi_aff(*this).flat_range_product(multi2);
14240 }
14241 
flat_range_product(const isl::pw_multi_aff & pma2)14242 isl::pw_multi_aff multi_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
14243 {
14244   if (!ptr)
14245     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14246   return isl::pw_multi_aff(*this).flat_range_product(pma2);
14247 }
14248 
flat_range_product(const isl::union_pw_multi_aff & upma2)14249 isl::union_pw_multi_aff multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
14250 {
14251   if (!ptr)
14252     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14253   return isl::pw_multi_aff(*this).flat_range_product(upma2);
14254 }
14255 
flat_range_product(const isl::aff & multi2)14256 isl::multi_aff multi_aff::flat_range_product(const isl::aff &multi2) const
14257 {
14258   if (!ptr)
14259     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14260   return this->flat_range_product(isl::multi_aff(multi2));
14261 }
14262 
floor()14263 isl::multi_aff multi_aff::floor() const
14264 {
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);
14273 }
14274 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)14275 void multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
14276 {
14277   if (!ptr)
14278     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14279   return isl::pw_multi_aff(*this).foreach_piece(fn);
14280 }
14281 
gist(isl::set context)14282 isl::multi_aff multi_aff::gist(isl::set context) const
14283 {
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);
14292 }
14293 
gist(const isl::union_set & context)14294 isl::union_pw_multi_aff multi_aff::gist(const isl::union_set &context) const
14295 {
14296   if (!ptr)
14297     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14298   return isl::pw_multi_aff(*this).gist(context);
14299 }
14300 
gist(const isl::basic_set & context)14301 isl::multi_aff multi_aff::gist(const isl::basic_set &context) const
14302 {
14303   if (!ptr)
14304     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14305   return this->gist(isl::set(context));
14306 }
14307 
gist(const isl::point & context)14308 isl::multi_aff multi_aff::gist(const isl::point &context) const
14309 {
14310   if (!ptr)
14311     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14312   return this->gist(isl::set(context));
14313 }
14314 
gist_params(isl::set context)14315 isl::multi_aff multi_aff::gist_params(isl::set context) const
14316 {
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);
14325 }
14326 
has_range_tuple_id()14327 bool multi_aff::has_range_tuple_id() const
14328 {
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;
14337 }
14338 
identity()14339 isl::multi_aff multi_aff::identity() const
14340 {
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);
14349 }
14350 
identity_on_domain(isl::space space)14351 isl::multi_aff multi_aff::identity_on_domain(isl::space space)
14352 {
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);
14361 }
14362 
insert_domain(isl::space domain)14363 isl::multi_aff multi_aff::insert_domain(isl::space domain) const
14364 {
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);
14373 }
14374 
intersect_domain(const isl::set & set)14375 isl::pw_multi_aff multi_aff::intersect_domain(const isl::set &set) const
14376 {
14377   if (!ptr)
14378     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14379   return isl::pw_multi_aff(*this).intersect_domain(set);
14380 }
14381 
intersect_domain(const isl::space & space)14382 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::space &space) const
14383 {
14384   if (!ptr)
14385     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14386   return isl::pw_multi_aff(*this).intersect_domain(space);
14387 }
14388 
intersect_domain(const isl::union_set & uset)14389 isl::union_pw_multi_aff multi_aff::intersect_domain(const isl::union_set &uset) const
14390 {
14391   if (!ptr)
14392     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14393   return isl::pw_multi_aff(*this).intersect_domain(uset);
14394 }
14395 
intersect_domain_wrapped_domain(const isl::union_set & uset)14396 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
14397 {
14398   if (!ptr)
14399     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14400   return isl::pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
14401 }
14402 
intersect_domain_wrapped_range(const isl::union_set & uset)14403 isl::union_pw_multi_aff multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
14404 {
14405   if (!ptr)
14406     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14407   return isl::pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
14408 }
14409 
intersect_params(const isl::set & set)14410 isl::pw_multi_aff multi_aff::intersect_params(const isl::set &set) const
14411 {
14412   if (!ptr)
14413     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14414   return isl::pw_multi_aff(*this).intersect_params(set);
14415 }
14416 
involves_locals()14417 bool multi_aff::involves_locals() const
14418 {
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;
14427 }
14428 
involves_nan()14429 bool multi_aff::involves_nan() const
14430 {
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;
14439 }
14440 
involves_param(const isl::id & id)14441 bool multi_aff::involves_param(const isl::id &id) const
14442 {
14443   if (!ptr)
14444     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14445   return isl::pw_multi_aff(*this).involves_param(id);
14446 }
14447 
involves_param(const std::string & id)14448 bool multi_aff::involves_param(const std::string &id) const
14449 {
14450   if (!ptr)
14451     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14452   return this->involves_param(isl::id(ctx(), id));
14453 }
14454 
involves_param(const isl::id_list & list)14455 bool multi_aff::involves_param(const isl::id_list &list) const
14456 {
14457   if (!ptr)
14458     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14459   return isl::pw_multi_aff(*this).involves_param(list);
14460 }
14461 
isa_multi_aff()14462 bool multi_aff::isa_multi_aff() const
14463 {
14464   if (!ptr)
14465     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14466   return isl::pw_multi_aff(*this).isa_multi_aff();
14467 }
14468 
isa_pw_multi_aff()14469 bool multi_aff::isa_pw_multi_aff() const
14470 {
14471   if (!ptr)
14472     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14473   return isl::pw_multi_aff(*this).isa_pw_multi_aff();
14474 }
14475 
list()14476 isl::aff_list multi_aff::list() const
14477 {
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);
14486 }
14487 
get_list()14488 isl::aff_list multi_aff::get_list() const
14489 {
14490   return list();
14491 }
14492 
max(const isl::multi_pw_aff & multi2)14493 isl::multi_pw_aff multi_aff::max(const isl::multi_pw_aff &multi2) const
14494 {
14495   if (!ptr)
14496     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14497   return isl::pw_multi_aff(*this).max(multi2);
14498 }
14499 
max_multi_val()14500 isl::multi_val multi_aff::max_multi_val() const
14501 {
14502   if (!ptr)
14503     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14504   return isl::pw_multi_aff(*this).max_multi_val();
14505 }
14506 
min(const isl::multi_pw_aff & multi2)14507 isl::multi_pw_aff multi_aff::min(const isl::multi_pw_aff &multi2) const
14508 {
14509   if (!ptr)
14510     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14511   return isl::pw_multi_aff(*this).min(multi2);
14512 }
14513 
min_multi_val()14514 isl::multi_val multi_aff::min_multi_val() const
14515 {
14516   if (!ptr)
14517     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14518   return isl::pw_multi_aff(*this).min_multi_val();
14519 }
14520 
multi_val_on_domain(isl::space space,isl::multi_val mv)14521 isl::multi_aff multi_aff::multi_val_on_domain(isl::space space, isl::multi_val mv)
14522 {
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);
14531 }
14532 
n_piece()14533 unsigned multi_aff::n_piece() const
14534 {
14535   if (!ptr)
14536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14537   return isl::pw_multi_aff(*this).n_piece();
14538 }
14539 
neg()14540 isl::multi_aff multi_aff::neg() const
14541 {
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);
14550 }
14551 
plain_is_empty()14552 bool multi_aff::plain_is_empty() const
14553 {
14554   if (!ptr)
14555     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14556   return isl::pw_multi_aff(*this).plain_is_empty();
14557 }
14558 
plain_is_equal(const isl::multi_aff & multi2)14559 bool multi_aff::plain_is_equal(const isl::multi_aff &multi2) const
14560 {
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;
14569 }
14570 
plain_is_equal(const isl::multi_pw_aff & multi2)14571 bool multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
14572 {
14573   if (!ptr)
14574     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14575   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14576 }
14577 
plain_is_equal(const isl::multi_union_pw_aff & multi2)14578 bool multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
14579 {
14580   if (!ptr)
14581     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14582   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
14583 }
14584 
plain_is_equal(const isl::pw_multi_aff & pma2)14585 bool multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
14586 {
14587   if (!ptr)
14588     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14589   return isl::pw_multi_aff(*this).plain_is_equal(pma2);
14590 }
14591 
plain_is_equal(const isl::union_pw_multi_aff & upma2)14592 bool multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
14593 {
14594   if (!ptr)
14595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14596   return isl::pw_multi_aff(*this).plain_is_equal(upma2);
14597 }
14598 
plain_is_equal(const isl::aff & multi2)14599 bool multi_aff::plain_is_equal(const isl::aff &multi2) const
14600 {
14601   if (!ptr)
14602     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14603   return this->plain_is_equal(isl::multi_aff(multi2));
14604 }
14605 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)14606 isl::pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
14607 {
14608   if (!ptr)
14609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14610   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
14611 }
14612 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)14613 isl::union_pw_multi_aff multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
14614 {
14615   if (!ptr)
14616     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14617   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
14618 }
14619 
product(isl::multi_aff multi2)14620 isl::multi_aff multi_aff::product(isl::multi_aff multi2) const
14621 {
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);
14630 }
14631 
product(const isl::multi_pw_aff & multi2)14632 isl::multi_pw_aff multi_aff::product(const isl::multi_pw_aff &multi2) const
14633 {
14634   if (!ptr)
14635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14636   return isl::pw_multi_aff(*this).product(multi2);
14637 }
14638 
product(const isl::pw_multi_aff & pma2)14639 isl::pw_multi_aff multi_aff::product(const isl::pw_multi_aff &pma2) const
14640 {
14641   if (!ptr)
14642     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14643   return isl::pw_multi_aff(*this).product(pma2);
14644 }
14645 
product(const isl::aff & multi2)14646 isl::multi_aff multi_aff::product(const isl::aff &multi2) const
14647 {
14648   if (!ptr)
14649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14650   return this->product(isl::multi_aff(multi2));
14651 }
14652 
pullback(isl::multi_aff ma2)14653 isl::multi_aff multi_aff::pullback(isl::multi_aff ma2) const
14654 {
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);
14663 }
14664 
pullback(const isl::multi_pw_aff & mpa2)14665 isl::multi_pw_aff multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
14666 {
14667   if (!ptr)
14668     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14669   return isl::pw_multi_aff(*this).pullback(mpa2);
14670 }
14671 
pullback(const isl::pw_multi_aff & pma2)14672 isl::pw_multi_aff multi_aff::pullback(const isl::pw_multi_aff &pma2) const
14673 {
14674   if (!ptr)
14675     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14676   return isl::pw_multi_aff(*this).pullback(pma2);
14677 }
14678 
pullback(const isl::union_pw_multi_aff & upma2)14679 isl::union_pw_multi_aff multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
14680 {
14681   if (!ptr)
14682     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14683   return isl::pw_multi_aff(*this).pullback(upma2);
14684 }
14685 
pullback(const isl::aff & ma2)14686 isl::multi_aff multi_aff::pullback(const isl::aff &ma2) const
14687 {
14688   if (!ptr)
14689     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14690   return this->pullback(isl::multi_aff(ma2));
14691 }
14692 
pw_multi_aff_list()14693 isl::pw_multi_aff_list multi_aff::pw_multi_aff_list() const
14694 {
14695   if (!ptr)
14696     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14697   return isl::pw_multi_aff(*this).pw_multi_aff_list();
14698 }
14699 
range_factor_domain()14700 isl::pw_multi_aff multi_aff::range_factor_domain() const
14701 {
14702   if (!ptr)
14703     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14704   return isl::pw_multi_aff(*this).range_factor_domain();
14705 }
14706 
range_factor_range()14707 isl::pw_multi_aff multi_aff::range_factor_range() const
14708 {
14709   if (!ptr)
14710     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14711   return isl::pw_multi_aff(*this).range_factor_range();
14712 }
14713 
range_map(isl::space space)14714 isl::multi_aff multi_aff::range_map(isl::space space)
14715 {
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);
14724 }
14725 
range_product(isl::multi_aff multi2)14726 isl::multi_aff multi_aff::range_product(isl::multi_aff multi2) const
14727 {
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);
14736 }
14737 
range_product(const isl::multi_pw_aff & multi2)14738 isl::multi_pw_aff multi_aff::range_product(const isl::multi_pw_aff &multi2) const
14739 {
14740   if (!ptr)
14741     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14742   return isl::pw_multi_aff(*this).range_product(multi2);
14743 }
14744 
range_product(const isl::multi_union_pw_aff & multi2)14745 isl::multi_union_pw_aff multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
14746 {
14747   if (!ptr)
14748     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14749   return isl::pw_multi_aff(*this).range_product(multi2);
14750 }
14751 
range_product(const isl::pw_multi_aff & pma2)14752 isl::pw_multi_aff multi_aff::range_product(const isl::pw_multi_aff &pma2) const
14753 {
14754   if (!ptr)
14755     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14756   return isl::pw_multi_aff(*this).range_product(pma2);
14757 }
14758 
range_product(const isl::union_pw_multi_aff & upma2)14759 isl::union_pw_multi_aff multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
14760 {
14761   if (!ptr)
14762     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14763   return isl::pw_multi_aff(*this).range_product(upma2);
14764 }
14765 
range_product(const isl::aff & multi2)14766 isl::multi_aff multi_aff::range_product(const isl::aff &multi2) const
14767 {
14768   if (!ptr)
14769     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14770   return this->range_product(isl::multi_aff(multi2));
14771 }
14772 
range_tuple_id()14773 isl::id multi_aff::range_tuple_id() const
14774 {
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);
14783 }
14784 
get_range_tuple_id()14785 isl::id multi_aff::get_range_tuple_id() const
14786 {
14787   return range_tuple_id();
14788 }
14789 
reset_range_tuple_id()14790 isl::multi_aff multi_aff::reset_range_tuple_id() const
14791 {
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);
14800 }
14801 
scale(isl::multi_val mv)14802 isl::multi_aff multi_aff::scale(isl::multi_val mv) const
14803 {
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);
14812 }
14813 
scale(isl::val v)14814 isl::multi_aff multi_aff::scale(isl::val v) const
14815 {
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);
14824 }
14825 
scale(long v)14826 isl::multi_aff multi_aff::scale(long v) const
14827 {
14828   if (!ptr)
14829     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14830   return this->scale(isl::val(ctx(), v));
14831 }
14832 
scale_down(isl::multi_val mv)14833 isl::multi_aff multi_aff::scale_down(isl::multi_val mv) const
14834 {
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);
14843 }
14844 
scale_down(isl::val v)14845 isl::multi_aff multi_aff::scale_down(isl::val v) const
14846 {
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);
14855 }
14856 
scale_down(long v)14857 isl::multi_aff multi_aff::scale_down(long v) const
14858 {
14859   if (!ptr)
14860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14861   return this->scale_down(isl::val(ctx(), v));
14862 }
14863 
set_at(int pos,isl::aff el)14864 isl::multi_aff multi_aff::set_at(int pos, isl::aff el) const
14865 {
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);
14874 }
14875 
set_at(int pos,const isl::pw_aff & el)14876 isl::multi_pw_aff multi_aff::set_at(int pos, const isl::pw_aff &el) const
14877 {
14878   if (!ptr)
14879     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14880   return isl::pw_multi_aff(*this).set_at(pos, el);
14881 }
14882 
set_at(int pos,const isl::union_pw_aff & el)14883 isl::multi_union_pw_aff multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
14884 {
14885   if (!ptr)
14886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14887   return isl::pw_multi_aff(*this).set_at(pos, el);
14888 }
14889 
set_range_tuple(isl::id id)14890 isl::multi_aff multi_aff::set_range_tuple(isl::id id) const
14891 {
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);
14900 }
14901 
set_range_tuple(const std::string & id)14902 isl::multi_aff multi_aff::set_range_tuple(const std::string &id) const
14903 {
14904   if (!ptr)
14905     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14906   return this->set_range_tuple(isl::id(ctx(), id));
14907 }
14908 
size()14909 unsigned multi_aff::size() const
14910 {
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;
14919 }
14920 
space()14921 isl::space multi_aff::space() const
14922 {
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);
14931 }
14932 
get_space()14933 isl::space multi_aff::get_space() const
14934 {
14935   return space();
14936 }
14937 
sub(isl::multi_aff multi2)14938 isl::multi_aff multi_aff::sub(isl::multi_aff multi2) const
14939 {
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);
14948 }
14949 
sub(const isl::multi_pw_aff & multi2)14950 isl::multi_pw_aff multi_aff::sub(const isl::multi_pw_aff &multi2) const
14951 {
14952   if (!ptr)
14953     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14954   return isl::pw_multi_aff(*this).sub(multi2);
14955 }
14956 
sub(const isl::multi_union_pw_aff & multi2)14957 isl::multi_union_pw_aff multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
14958 {
14959   if (!ptr)
14960     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14961   return isl::pw_multi_aff(*this).sub(multi2);
14962 }
14963 
sub(const isl::pw_multi_aff & pma2)14964 isl::pw_multi_aff multi_aff::sub(const isl::pw_multi_aff &pma2) const
14965 {
14966   if (!ptr)
14967     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14968   return isl::pw_multi_aff(*this).sub(pma2);
14969 }
14970 
sub(const isl::union_pw_multi_aff & upma2)14971 isl::union_pw_multi_aff multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
14972 {
14973   if (!ptr)
14974     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14975   return isl::pw_multi_aff(*this).sub(upma2);
14976 }
14977 
sub(const isl::aff & multi2)14978 isl::multi_aff multi_aff::sub(const isl::aff &multi2) const
14979 {
14980   if (!ptr)
14981     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14982   return this->sub(isl::multi_aff(multi2));
14983 }
14984 
subtract_domain(const isl::set & set)14985 isl::pw_multi_aff multi_aff::subtract_domain(const isl::set &set) const
14986 {
14987   if (!ptr)
14988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14989   return isl::pw_multi_aff(*this).subtract_domain(set);
14990 }
14991 
subtract_domain(const isl::space & space)14992 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::space &space) const
14993 {
14994   if (!ptr)
14995     exception::throw_invalid("NULL input", __FILE__, __LINE__);
14996   return isl::pw_multi_aff(*this).subtract_domain(space);
14997 }
14998 
subtract_domain(const isl::union_set & uset)14999 isl::union_pw_multi_aff multi_aff::subtract_domain(const isl::union_set &uset) const
15000 {
15001   if (!ptr)
15002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15003   return isl::pw_multi_aff(*this).subtract_domain(uset);
15004 }
15005 
to_list()15006 isl::pw_multi_aff_list multi_aff::to_list() const
15007 {
15008   if (!ptr)
15009     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15010   return isl::pw_multi_aff(*this).to_list();
15011 }
15012 
to_multi_pw_aff()15013 isl::multi_pw_aff multi_aff::to_multi_pw_aff() const
15014 {
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);
15023 }
15024 
to_multi_union_pw_aff()15025 isl::multi_union_pw_aff multi_aff::to_multi_union_pw_aff() const
15026 {
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);
15035 }
15036 
to_pw_multi_aff()15037 isl::pw_multi_aff multi_aff::to_pw_multi_aff() const
15038 {
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);
15047 }
15048 
to_union_pw_multi_aff()15049 isl::union_pw_multi_aff multi_aff::to_union_pw_multi_aff() const
15050 {
15051   if (!ptr)
15052     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15053   return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
15054 }
15055 
unbind_params_insert_domain(isl::multi_id domain)15056 isl::multi_aff multi_aff::unbind_params_insert_domain(isl::multi_id domain) const
15057 {
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);
15066 }
15067 
union_add(const isl::multi_pw_aff & mpa2)15068 isl::multi_pw_aff multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
15069 {
15070   if (!ptr)
15071     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15072   return isl::pw_multi_aff(*this).union_add(mpa2);
15073 }
15074 
union_add(const isl::multi_union_pw_aff & mupa2)15075 isl::multi_union_pw_aff multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
15076 {
15077   if (!ptr)
15078     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15079   return isl::pw_multi_aff(*this).union_add(mupa2);
15080 }
15081 
union_add(const isl::pw_multi_aff & pma2)15082 isl::pw_multi_aff multi_aff::union_add(const isl::pw_multi_aff &pma2) const
15083 {
15084   if (!ptr)
15085     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15086   return isl::pw_multi_aff(*this).union_add(pma2);
15087 }
15088 
union_add(const isl::union_pw_multi_aff & upma2)15089 isl::union_pw_multi_aff multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
15090 {
15091   if (!ptr)
15092     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15093   return isl::pw_multi_aff(*this).union_add(upma2);
15094 }
15095 
zero(isl::space space)15096 isl::multi_aff multi_aff::zero(isl::space space)
15097 {
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);
15106 }
15107 
15108 inline std::ostream &operator<<(std::ostream &os, const multi_aff &obj)
15109 {
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;
15120 }
15121 
15122 // implementations for isl::multi_id
manage(__isl_take isl_multi_id * ptr)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);
15127 }
manage_copy(__isl_keep isl_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);
15137 }
15138 
multi_id(__isl_take isl_multi_id * ptr)15139 multi_id::multi_id(__isl_take isl_multi_id *ptr)
15140     : ptr(ptr) {}
15141 
multi_id()15142 multi_id::multi_id()
15143     : ptr(nullptr) {}
15144 
multi_id(const multi_id & obj)15145 multi_id::multi_id(const multi_id &obj)
15146     : ptr(nullptr)
15147 {
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);
15155 }
15156 
multi_id(isl::space space,isl::id_list list)15157 multi_id::multi_id(isl::space space, isl::id_list list)
15158 {
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;
15167 }
15168 
multi_id(isl::ctx ctx,const std::string & str)15169 multi_id::multi_id(isl::ctx ctx, const std::string &str)
15170 {
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;
15177 }
15178 
15179 multi_id &multi_id::operator=(multi_id obj) {
15180   std::swap(this->ptr, obj.ptr);
15181   return *this;
15182 }
15183 
~multi_id()15184 multi_id::~multi_id() {
15185   if (ptr)
15186     isl_multi_id_free(ptr);
15187 }
15188 
copy()15189 __isl_give isl_multi_id *multi_id::copy() const & {
15190   return isl_multi_id_copy(ptr);
15191 }
15192 
get()15193 __isl_keep isl_multi_id *multi_id::get() const {
15194   return ptr;
15195 }
15196 
release()15197 __isl_give isl_multi_id *multi_id::release() {
15198   isl_multi_id *tmp = ptr;
15199   ptr = nullptr;
15200   return tmp;
15201 }
15202 
is_null()15203 bool multi_id::is_null() const {
15204   return ptr == nullptr;
15205 }
15206 
ctx()15207 isl::ctx multi_id::ctx() const {
15208   return isl::ctx(isl_multi_id_get_ctx(ptr));
15209 }
15210 
at(int pos)15211 isl::id multi_id::at(int pos) const
15212 {
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);
15221 }
15222 
get_at(int pos)15223 isl::id multi_id::get_at(int pos) const
15224 {
15225   return at(pos);
15226 }
15227 
flat_range_product(isl::multi_id multi2)15228 isl::multi_id multi_id::flat_range_product(isl::multi_id multi2) const
15229 {
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);
15238 }
15239 
list()15240 isl::id_list multi_id::list() const
15241 {
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);
15250 }
15251 
get_list()15252 isl::id_list multi_id::get_list() const
15253 {
15254   return list();
15255 }
15256 
plain_is_equal(const isl::multi_id & multi2)15257 bool multi_id::plain_is_equal(const isl::multi_id &multi2) const
15258 {
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;
15267 }
15268 
range_product(isl::multi_id multi2)15269 isl::multi_id multi_id::range_product(isl::multi_id multi2) const
15270 {
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);
15279 }
15280 
set_at(int pos,isl::id el)15281 isl::multi_id multi_id::set_at(int pos, isl::id el) const
15282 {
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);
15291 }
15292 
set_at(int pos,const std::string & el)15293 isl::multi_id multi_id::set_at(int pos, const std::string &el) const
15294 {
15295   if (!ptr)
15296     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15297   return this->set_at(pos, isl::id(ctx(), el));
15298 }
15299 
size()15300 unsigned multi_id::size() const
15301 {
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;
15310 }
15311 
space()15312 isl::space multi_id::space() const
15313 {
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);
15322 }
15323 
get_space()15324 isl::space multi_id::get_space() const
15325 {
15326   return space();
15327 }
15328 
15329 inline std::ostream &operator<<(std::ostream &os, const multi_id &obj)
15330 {
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;
15341 }
15342 
15343 // implementations for isl::multi_pw_aff
manage(__isl_take isl_multi_pw_aff * ptr)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);
15348 }
manage_copy(__isl_keep isl_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);
15358 }
15359 
multi_pw_aff(__isl_take isl_multi_pw_aff * ptr)15360 multi_pw_aff::multi_pw_aff(__isl_take isl_multi_pw_aff *ptr)
15361     : ptr(ptr) {}
15362 
multi_pw_aff()15363 multi_pw_aff::multi_pw_aff()
15364     : ptr(nullptr) {}
15365 
multi_pw_aff(const multi_pw_aff & obj)15366 multi_pw_aff::multi_pw_aff(const multi_pw_aff &obj)
15367     : ptr(nullptr)
15368 {
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);
15376 }
15377 
multi_pw_aff(isl::aff aff)15378 multi_pw_aff::multi_pw_aff(isl::aff aff)
15379 {
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;
15388 }
15389 
multi_pw_aff(isl::multi_aff ma)15390 multi_pw_aff::multi_pw_aff(isl::multi_aff ma)
15391 {
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;
15400 }
15401 
multi_pw_aff(isl::pw_aff pa)15402 multi_pw_aff::multi_pw_aff(isl::pw_aff pa)
15403 {
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;
15412 }
15413 
multi_pw_aff(isl::space space,isl::pw_aff_list list)15414 multi_pw_aff::multi_pw_aff(isl::space space, isl::pw_aff_list list)
15415 {
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;
15424 }
15425 
multi_pw_aff(isl::pw_multi_aff pma)15426 multi_pw_aff::multi_pw_aff(isl::pw_multi_aff pma)
15427 {
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;
15436 }
15437 
multi_pw_aff(isl::ctx ctx,const std::string & str)15438 multi_pw_aff::multi_pw_aff(isl::ctx ctx, const std::string &str)
15439 {
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;
15446 }
15447 
15448 multi_pw_aff &multi_pw_aff::operator=(multi_pw_aff obj) {
15449   std::swap(this->ptr, obj.ptr);
15450   return *this;
15451 }
15452 
~multi_pw_aff()15453 multi_pw_aff::~multi_pw_aff() {
15454   if (ptr)
15455     isl_multi_pw_aff_free(ptr);
15456 }
15457 
copy()15458 __isl_give isl_multi_pw_aff *multi_pw_aff::copy() const & {
15459   return isl_multi_pw_aff_copy(ptr);
15460 }
15461 
get()15462 __isl_keep isl_multi_pw_aff *multi_pw_aff::get() const {
15463   return ptr;
15464 }
15465 
release()15466 __isl_give isl_multi_pw_aff *multi_pw_aff::release() {
15467   isl_multi_pw_aff *tmp = ptr;
15468   ptr = nullptr;
15469   return tmp;
15470 }
15471 
is_null()15472 bool multi_pw_aff::is_null() const {
15473   return ptr == nullptr;
15474 }
15475 
ctx()15476 isl::ctx multi_pw_aff::ctx() const {
15477   return isl::ctx(isl_multi_pw_aff_get_ctx(ptr));
15478 }
15479 
add(isl::multi_pw_aff multi2)15480 isl::multi_pw_aff multi_pw_aff::add(isl::multi_pw_aff multi2) const
15481 {
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);
15490 }
15491 
add(const isl::multi_union_pw_aff & multi2)15492 isl::multi_union_pw_aff multi_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
15493 {
15494   if (!ptr)
15495     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15496   return isl::multi_union_pw_aff(*this).add(multi2);
15497 }
15498 
add(const isl::aff & multi2)15499 isl::multi_pw_aff multi_pw_aff::add(const isl::aff &multi2) const
15500 {
15501   if (!ptr)
15502     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15503   return this->add(isl::multi_pw_aff(multi2));
15504 }
15505 
add(const isl::multi_aff & multi2)15506 isl::multi_pw_aff multi_pw_aff::add(const isl::multi_aff &multi2) const
15507 {
15508   if (!ptr)
15509     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15510   return this->add(isl::multi_pw_aff(multi2));
15511 }
15512 
add(const isl::pw_aff & multi2)15513 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_aff &multi2) const
15514 {
15515   if (!ptr)
15516     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15517   return this->add(isl::multi_pw_aff(multi2));
15518 }
15519 
add(const isl::pw_multi_aff & multi2)15520 isl::multi_pw_aff multi_pw_aff::add(const isl::pw_multi_aff &multi2) const
15521 {
15522   if (!ptr)
15523     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15524   return this->add(isl::multi_pw_aff(multi2));
15525 }
15526 
add_constant(isl::multi_val mv)15527 isl::multi_pw_aff multi_pw_aff::add_constant(isl::multi_val mv) const
15528 {
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);
15537 }
15538 
add_constant(isl::val v)15539 isl::multi_pw_aff multi_pw_aff::add_constant(isl::val v) const
15540 {
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);
15549 }
15550 
add_constant(long v)15551 isl::multi_pw_aff multi_pw_aff::add_constant(long v) const
15552 {
15553   if (!ptr)
15554     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15555   return this->add_constant(isl::val(ctx(), v));
15556 }
15557 
as_map()15558 isl::map multi_pw_aff::as_map() const
15559 {
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);
15568 }
15569 
as_multi_aff()15570 isl::multi_aff multi_pw_aff::as_multi_aff() const
15571 {
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);
15580 }
15581 
as_set()15582 isl::set multi_pw_aff::as_set() const
15583 {
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);
15592 }
15593 
at(int pos)15594 isl::pw_aff multi_pw_aff::at(int pos) const
15595 {
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);
15604 }
15605 
get_at(int pos)15606 isl::pw_aff multi_pw_aff::get_at(int pos) const
15607 {
15608   return at(pos);
15609 }
15610 
bind(isl::multi_id tuple)15611 isl::set multi_pw_aff::bind(isl::multi_id tuple) const
15612 {
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);
15621 }
15622 
bind_domain(isl::multi_id tuple)15623 isl::multi_pw_aff multi_pw_aff::bind_domain(isl::multi_id tuple) const
15624 {
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);
15633 }
15634 
bind_domain_wrapped_domain(isl::multi_id tuple)15635 isl::multi_pw_aff multi_pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
15636 {
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);
15645 }
15646 
coalesce()15647 isl::multi_pw_aff multi_pw_aff::coalesce() const
15648 {
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);
15657 }
15658 
domain()15659 isl::set multi_pw_aff::domain() const
15660 {
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);
15669 }
15670 
domain_reverse()15671 isl::multi_pw_aff multi_pw_aff::domain_reverse() const
15672 {
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);
15681 }
15682 
flat_range_product(isl::multi_pw_aff multi2)15683 isl::multi_pw_aff multi_pw_aff::flat_range_product(isl::multi_pw_aff multi2) const
15684 {
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);
15693 }
15694 
flat_range_product(const isl::multi_union_pw_aff & multi2)15695 isl::multi_union_pw_aff multi_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
15696 {
15697   if (!ptr)
15698     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15699   return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
15700 }
15701 
flat_range_product(const isl::aff & multi2)15702 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::aff &multi2) const
15703 {
15704   if (!ptr)
15705     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15706   return this->flat_range_product(isl::multi_pw_aff(multi2));
15707 }
15708 
flat_range_product(const isl::multi_aff & multi2)15709 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::multi_aff &multi2) const
15710 {
15711   if (!ptr)
15712     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15713   return this->flat_range_product(isl::multi_pw_aff(multi2));
15714 }
15715 
flat_range_product(const isl::pw_aff & multi2)15716 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_aff &multi2) const
15717 {
15718   if (!ptr)
15719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15720   return this->flat_range_product(isl::multi_pw_aff(multi2));
15721 }
15722 
flat_range_product(const isl::pw_multi_aff & multi2)15723 isl::multi_pw_aff multi_pw_aff::flat_range_product(const isl::pw_multi_aff &multi2) const
15724 {
15725   if (!ptr)
15726     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15727   return this->flat_range_product(isl::multi_pw_aff(multi2));
15728 }
15729 
gist(isl::set set)15730 isl::multi_pw_aff multi_pw_aff::gist(isl::set set) const
15731 {
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);
15740 }
15741 
gist(const isl::union_set & context)15742 isl::multi_union_pw_aff multi_pw_aff::gist(const isl::union_set &context) const
15743 {
15744   if (!ptr)
15745     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15746   return isl::multi_union_pw_aff(*this).gist(context);
15747 }
15748 
gist(const isl::basic_set & set)15749 isl::multi_pw_aff multi_pw_aff::gist(const isl::basic_set &set) const
15750 {
15751   if (!ptr)
15752     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15753   return this->gist(isl::set(set));
15754 }
15755 
gist(const isl::point & set)15756 isl::multi_pw_aff multi_pw_aff::gist(const isl::point &set) const
15757 {
15758   if (!ptr)
15759     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15760   return this->gist(isl::set(set));
15761 }
15762 
gist_params(isl::set set)15763 isl::multi_pw_aff multi_pw_aff::gist_params(isl::set set) const
15764 {
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);
15773 }
15774 
has_range_tuple_id()15775 bool multi_pw_aff::has_range_tuple_id() const
15776 {
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;
15785 }
15786 
identity()15787 isl::multi_pw_aff multi_pw_aff::identity() const
15788 {
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);
15797 }
15798 
identity_on_domain(isl::space space)15799 isl::multi_pw_aff multi_pw_aff::identity_on_domain(isl::space space)
15800 {
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);
15809 }
15810 
insert_domain(isl::space domain)15811 isl::multi_pw_aff multi_pw_aff::insert_domain(isl::space domain) const
15812 {
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);
15821 }
15822 
intersect_domain(isl::set domain)15823 isl::multi_pw_aff multi_pw_aff::intersect_domain(isl::set domain) const
15824 {
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);
15833 }
15834 
intersect_domain(const isl::union_set & uset)15835 isl::multi_union_pw_aff multi_pw_aff::intersect_domain(const isl::union_set &uset) const
15836 {
15837   if (!ptr)
15838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15839   return isl::multi_union_pw_aff(*this).intersect_domain(uset);
15840 }
15841 
intersect_domain(const isl::basic_set & domain)15842 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::basic_set &domain) const
15843 {
15844   if (!ptr)
15845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15846   return this->intersect_domain(isl::set(domain));
15847 }
15848 
intersect_domain(const isl::point & domain)15849 isl::multi_pw_aff multi_pw_aff::intersect_domain(const isl::point &domain) const
15850 {
15851   if (!ptr)
15852     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15853   return this->intersect_domain(isl::set(domain));
15854 }
15855 
intersect_params(isl::set set)15856 isl::multi_pw_aff multi_pw_aff::intersect_params(isl::set set) const
15857 {
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);
15866 }
15867 
involves_nan()15868 bool multi_pw_aff::involves_nan() const
15869 {
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;
15878 }
15879 
involves_param(const isl::id & id)15880 bool multi_pw_aff::involves_param(const isl::id &id) const
15881 {
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;
15890 }
15891 
involves_param(const std::string & id)15892 bool multi_pw_aff::involves_param(const std::string &id) const
15893 {
15894   if (!ptr)
15895     exception::throw_invalid("NULL input", __FILE__, __LINE__);
15896   return this->involves_param(isl::id(ctx(), id));
15897 }
15898 
involves_param(const isl::id_list & list)15899 bool multi_pw_aff::involves_param(const isl::id_list &list) const
15900 {
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;
15909 }
15910 
isa_multi_aff()15911 bool multi_pw_aff::isa_multi_aff() const
15912 {
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;
15921 }
15922 
list()15923 isl::pw_aff_list multi_pw_aff::list() const
15924 {
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);
15933 }
15934 
get_list()15935 isl::pw_aff_list multi_pw_aff::get_list() const
15936 {
15937   return list();
15938 }
15939 
max(isl::multi_pw_aff multi2)15940 isl::multi_pw_aff multi_pw_aff::max(isl::multi_pw_aff multi2) const
15941 {
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);
15950 }
15951 
max_multi_val()15952 isl::multi_val multi_pw_aff::max_multi_val() const
15953 {
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);
15962 }
15963 
min(isl::multi_pw_aff multi2)15964 isl::multi_pw_aff multi_pw_aff::min(isl::multi_pw_aff multi2) const
15965 {
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);
15974 }
15975 
min_multi_val()15976 isl::multi_val multi_pw_aff::min_multi_val() const
15977 {
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);
15986 }
15987 
neg()15988 isl::multi_pw_aff multi_pw_aff::neg() const
15989 {
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);
15998 }
15999 
plain_is_equal(const isl::multi_pw_aff & multi2)16000 bool multi_pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
16001 {
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;
16010 }
16011 
plain_is_equal(const isl::multi_union_pw_aff & multi2)16012 bool multi_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16013 {
16014   if (!ptr)
16015     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16016   return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
16017 }
16018 
plain_is_equal(const isl::aff & multi2)16019 bool multi_pw_aff::plain_is_equal(const isl::aff &multi2) const
16020 {
16021   if (!ptr)
16022     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16023   return this->plain_is_equal(isl::multi_pw_aff(multi2));
16024 }
16025 
plain_is_equal(const isl::multi_aff & multi2)16026 bool multi_pw_aff::plain_is_equal(const isl::multi_aff &multi2) const
16027 {
16028   if (!ptr)
16029     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16030   return this->plain_is_equal(isl::multi_pw_aff(multi2));
16031 }
16032 
plain_is_equal(const isl::pw_aff & multi2)16033 bool multi_pw_aff::plain_is_equal(const isl::pw_aff &multi2) const
16034 {
16035   if (!ptr)
16036     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16037   return this->plain_is_equal(isl::multi_pw_aff(multi2));
16038 }
16039 
plain_is_equal(const isl::pw_multi_aff & multi2)16040 bool multi_pw_aff::plain_is_equal(const isl::pw_multi_aff &multi2) const
16041 {
16042   if (!ptr)
16043     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16044   return this->plain_is_equal(isl::multi_pw_aff(multi2));
16045 }
16046 
product(isl::multi_pw_aff multi2)16047 isl::multi_pw_aff multi_pw_aff::product(isl::multi_pw_aff multi2) const
16048 {
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);
16057 }
16058 
pullback(isl::multi_aff ma)16059 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_aff ma) const
16060 {
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);
16069 }
16070 
pullback(isl::multi_pw_aff mpa2)16071 isl::multi_pw_aff multi_pw_aff::pullback(isl::multi_pw_aff mpa2) const
16072 {
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);
16081 }
16082 
pullback(isl::pw_multi_aff pma)16083 isl::multi_pw_aff multi_pw_aff::pullback(isl::pw_multi_aff pma) const
16084 {
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);
16093 }
16094 
pullback(const isl::union_pw_multi_aff & upma)16095 isl::multi_union_pw_aff multi_pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
16096 {
16097   if (!ptr)
16098     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16099   return isl::multi_union_pw_aff(*this).pullback(upma);
16100 }
16101 
range_product(isl::multi_pw_aff multi2)16102 isl::multi_pw_aff multi_pw_aff::range_product(isl::multi_pw_aff multi2) const
16103 {
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);
16112 }
16113 
range_product(const isl::multi_union_pw_aff & multi2)16114 isl::multi_union_pw_aff multi_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
16115 {
16116   if (!ptr)
16117     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16118   return isl::multi_union_pw_aff(*this).range_product(multi2);
16119 }
16120 
range_product(const isl::aff & multi2)16121 isl::multi_pw_aff multi_pw_aff::range_product(const isl::aff &multi2) const
16122 {
16123   if (!ptr)
16124     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16125   return this->range_product(isl::multi_pw_aff(multi2));
16126 }
16127 
range_product(const isl::multi_aff & multi2)16128 isl::multi_pw_aff multi_pw_aff::range_product(const isl::multi_aff &multi2) const
16129 {
16130   if (!ptr)
16131     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16132   return this->range_product(isl::multi_pw_aff(multi2));
16133 }
16134 
range_product(const isl::pw_aff & multi2)16135 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_aff &multi2) const
16136 {
16137   if (!ptr)
16138     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16139   return this->range_product(isl::multi_pw_aff(multi2));
16140 }
16141 
range_product(const isl::pw_multi_aff & multi2)16142 isl::multi_pw_aff multi_pw_aff::range_product(const isl::pw_multi_aff &multi2) const
16143 {
16144   if (!ptr)
16145     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16146   return this->range_product(isl::multi_pw_aff(multi2));
16147 }
16148 
range_tuple_id()16149 isl::id multi_pw_aff::range_tuple_id() const
16150 {
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);
16159 }
16160 
get_range_tuple_id()16161 isl::id multi_pw_aff::get_range_tuple_id() const
16162 {
16163   return range_tuple_id();
16164 }
16165 
reset_range_tuple_id()16166 isl::multi_pw_aff multi_pw_aff::reset_range_tuple_id() const
16167 {
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);
16176 }
16177 
scale(isl::multi_val mv)16178 isl::multi_pw_aff multi_pw_aff::scale(isl::multi_val mv) const
16179 {
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);
16188 }
16189 
scale(isl::val v)16190 isl::multi_pw_aff multi_pw_aff::scale(isl::val v) const
16191 {
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);
16200 }
16201 
scale(long v)16202 isl::multi_pw_aff multi_pw_aff::scale(long v) const
16203 {
16204   if (!ptr)
16205     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16206   return this->scale(isl::val(ctx(), v));
16207 }
16208 
scale_down(isl::multi_val mv)16209 isl::multi_pw_aff multi_pw_aff::scale_down(isl::multi_val mv) const
16210 {
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);
16219 }
16220 
scale_down(isl::val v)16221 isl::multi_pw_aff multi_pw_aff::scale_down(isl::val v) const
16222 {
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);
16231 }
16232 
scale_down(long v)16233 isl::multi_pw_aff multi_pw_aff::scale_down(long v) const
16234 {
16235   if (!ptr)
16236     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16237   return this->scale_down(isl::val(ctx(), v));
16238 }
16239 
set_at(int pos,isl::pw_aff el)16240 isl::multi_pw_aff multi_pw_aff::set_at(int pos, isl::pw_aff el) const
16241 {
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);
16250 }
16251 
set_at(int pos,const isl::union_pw_aff & el)16252 isl::multi_union_pw_aff multi_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
16253 {
16254   if (!ptr)
16255     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16256   return isl::multi_union_pw_aff(*this).set_at(pos, el);
16257 }
16258 
set_range_tuple(isl::id id)16259 isl::multi_pw_aff multi_pw_aff::set_range_tuple(isl::id id) const
16260 {
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);
16269 }
16270 
set_range_tuple(const std::string & id)16271 isl::multi_pw_aff multi_pw_aff::set_range_tuple(const std::string &id) const
16272 {
16273   if (!ptr)
16274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16275   return this->set_range_tuple(isl::id(ctx(), id));
16276 }
16277 
size()16278 unsigned multi_pw_aff::size() const
16279 {
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;
16288 }
16289 
space()16290 isl::space multi_pw_aff::space() const
16291 {
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);
16300 }
16301 
get_space()16302 isl::space multi_pw_aff::get_space() const
16303 {
16304   return space();
16305 }
16306 
sub(isl::multi_pw_aff multi2)16307 isl::multi_pw_aff multi_pw_aff::sub(isl::multi_pw_aff multi2) const
16308 {
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);
16317 }
16318 
sub(const isl::multi_union_pw_aff & multi2)16319 isl::multi_union_pw_aff multi_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
16320 {
16321   if (!ptr)
16322     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16323   return isl::multi_union_pw_aff(*this).sub(multi2);
16324 }
16325 
sub(const isl::aff & multi2)16326 isl::multi_pw_aff multi_pw_aff::sub(const isl::aff &multi2) const
16327 {
16328   if (!ptr)
16329     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16330   return this->sub(isl::multi_pw_aff(multi2));
16331 }
16332 
sub(const isl::multi_aff & multi2)16333 isl::multi_pw_aff multi_pw_aff::sub(const isl::multi_aff &multi2) const
16334 {
16335   if (!ptr)
16336     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16337   return this->sub(isl::multi_pw_aff(multi2));
16338 }
16339 
sub(const isl::pw_aff & multi2)16340 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_aff &multi2) const
16341 {
16342   if (!ptr)
16343     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16344   return this->sub(isl::multi_pw_aff(multi2));
16345 }
16346 
sub(const isl::pw_multi_aff & multi2)16347 isl::multi_pw_aff multi_pw_aff::sub(const isl::pw_multi_aff &multi2) const
16348 {
16349   if (!ptr)
16350     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16351   return this->sub(isl::multi_pw_aff(multi2));
16352 }
16353 
unbind_params_insert_domain(isl::multi_id domain)16354 isl::multi_pw_aff multi_pw_aff::unbind_params_insert_domain(isl::multi_id domain) const
16355 {
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);
16364 }
16365 
union_add(isl::multi_pw_aff mpa2)16366 isl::multi_pw_aff multi_pw_aff::union_add(isl::multi_pw_aff mpa2) const
16367 {
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);
16376 }
16377 
union_add(const isl::multi_union_pw_aff & mupa2)16378 isl::multi_union_pw_aff multi_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
16379 {
16380   if (!ptr)
16381     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16382   return isl::multi_union_pw_aff(*this).union_add(mupa2);
16383 }
16384 
union_add(const isl::aff & mpa2)16385 isl::multi_pw_aff multi_pw_aff::union_add(const isl::aff &mpa2) const
16386 {
16387   if (!ptr)
16388     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16389   return this->union_add(isl::multi_pw_aff(mpa2));
16390 }
16391 
union_add(const isl::multi_aff & mpa2)16392 isl::multi_pw_aff multi_pw_aff::union_add(const isl::multi_aff &mpa2) const
16393 {
16394   if (!ptr)
16395     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16396   return this->union_add(isl::multi_pw_aff(mpa2));
16397 }
16398 
union_add(const isl::pw_aff & mpa2)16399 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_aff &mpa2) const
16400 {
16401   if (!ptr)
16402     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16403   return this->union_add(isl::multi_pw_aff(mpa2));
16404 }
16405 
union_add(const isl::pw_multi_aff & mpa2)16406 isl::multi_pw_aff multi_pw_aff::union_add(const isl::pw_multi_aff &mpa2) const
16407 {
16408   if (!ptr)
16409     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16410   return this->union_add(isl::multi_pw_aff(mpa2));
16411 }
16412 
zero(isl::space space)16413 isl::multi_pw_aff multi_pw_aff::zero(isl::space space)
16414 {
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);
16423 }
16424 
16425 inline std::ostream &operator<<(std::ostream &os, const multi_pw_aff &obj)
16426 {
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;
16437 }
16438 
16439 // implementations for isl::multi_union_pw_aff
manage(__isl_take isl_multi_union_pw_aff * ptr)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);
16444 }
manage_copy(__isl_keep isl_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);
16454 }
16455 
multi_union_pw_aff(__isl_take isl_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) {}
16458 
multi_union_pw_aff()16459 multi_union_pw_aff::multi_union_pw_aff()
16460     : ptr(nullptr) {}
16461 
multi_union_pw_aff(const multi_union_pw_aff & obj)16462 multi_union_pw_aff::multi_union_pw_aff(const multi_union_pw_aff &obj)
16463     : ptr(nullptr)
16464 {
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);
16472 }
16473 
multi_union_pw_aff(isl::multi_pw_aff mpa)16474 multi_union_pw_aff::multi_union_pw_aff(isl::multi_pw_aff mpa)
16475 {
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;
16484 }
16485 
multi_union_pw_aff(isl::union_pw_aff upa)16486 multi_union_pw_aff::multi_union_pw_aff(isl::union_pw_aff upa)
16487 {
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;
16496 }
16497 
multi_union_pw_aff(isl::space space,isl::union_pw_aff_list list)16498 multi_union_pw_aff::multi_union_pw_aff(isl::space space, isl::union_pw_aff_list list)
16499 {
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;
16508 }
16509 
multi_union_pw_aff(isl::ctx ctx,const std::string & str)16510 multi_union_pw_aff::multi_union_pw_aff(isl::ctx ctx, const std::string &str)
16511 {
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;
16518 }
16519 
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;
16523 }
16524 
~multi_union_pw_aff()16525 multi_union_pw_aff::~multi_union_pw_aff() {
16526   if (ptr)
16527     isl_multi_union_pw_aff_free(ptr);
16528 }
16529 
copy()16530 __isl_give isl_multi_union_pw_aff *multi_union_pw_aff::copy() const & {
16531   return isl_multi_union_pw_aff_copy(ptr);
16532 }
16533 
get()16534 __isl_keep isl_multi_union_pw_aff *multi_union_pw_aff::get() const {
16535   return ptr;
16536 }
16537 
release()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;
16542 }
16543 
is_null()16544 bool multi_union_pw_aff::is_null() const {
16545   return ptr == nullptr;
16546 }
16547 
ctx()16548 isl::ctx multi_union_pw_aff::ctx() const {
16549   return isl::ctx(isl_multi_union_pw_aff_get_ctx(ptr));
16550 }
16551 
add(isl::multi_union_pw_aff multi2)16552 isl::multi_union_pw_aff multi_union_pw_aff::add(isl::multi_union_pw_aff multi2) const
16553 {
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);
16562 }
16563 
at(int pos)16564 isl::union_pw_aff multi_union_pw_aff::at(int pos) const
16565 {
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);
16574 }
16575 
get_at(int pos)16576 isl::union_pw_aff multi_union_pw_aff::get_at(int pos) const
16577 {
16578   return at(pos);
16579 }
16580 
bind(isl::multi_id tuple)16581 isl::union_set multi_union_pw_aff::bind(isl::multi_id tuple) const
16582 {
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);
16591 }
16592 
coalesce()16593 isl::multi_union_pw_aff multi_union_pw_aff::coalesce() const
16594 {
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);
16603 }
16604 
domain()16605 isl::union_set multi_union_pw_aff::domain() const
16606 {
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);
16615 }
16616 
flat_range_product(isl::multi_union_pw_aff multi2)16617 isl::multi_union_pw_aff multi_union_pw_aff::flat_range_product(isl::multi_union_pw_aff multi2) const
16618 {
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);
16627 }
16628 
gist(isl::union_set context)16629 isl::multi_union_pw_aff multi_union_pw_aff::gist(isl::union_set context) const
16630 {
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);
16639 }
16640 
gist_params(isl::set context)16641 isl::multi_union_pw_aff multi_union_pw_aff::gist_params(isl::set context) const
16642 {
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);
16651 }
16652 
has_range_tuple_id()16653 bool multi_union_pw_aff::has_range_tuple_id() const
16654 {
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;
16663 }
16664 
intersect_domain(isl::union_set uset)16665 isl::multi_union_pw_aff multi_union_pw_aff::intersect_domain(isl::union_set uset) const
16666 {
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);
16675 }
16676 
intersect_params(isl::set params)16677 isl::multi_union_pw_aff multi_union_pw_aff::intersect_params(isl::set params) const
16678 {
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);
16687 }
16688 
involves_nan()16689 bool multi_union_pw_aff::involves_nan() const
16690 {
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;
16699 }
16700 
list()16701 isl::union_pw_aff_list multi_union_pw_aff::list() const
16702 {
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);
16711 }
16712 
get_list()16713 isl::union_pw_aff_list multi_union_pw_aff::get_list() const
16714 {
16715   return list();
16716 }
16717 
neg()16718 isl::multi_union_pw_aff multi_union_pw_aff::neg() const
16719 {
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);
16728 }
16729 
plain_is_equal(const isl::multi_union_pw_aff & multi2)16730 bool multi_union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
16731 {
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;
16740 }
16741 
pullback(isl::union_pw_multi_aff upma)16742 isl::multi_union_pw_aff multi_union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
16743 {
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);
16752 }
16753 
range_product(isl::multi_union_pw_aff multi2)16754 isl::multi_union_pw_aff multi_union_pw_aff::range_product(isl::multi_union_pw_aff multi2) const
16755 {
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);
16764 }
16765 
range_tuple_id()16766 isl::id multi_union_pw_aff::range_tuple_id() const
16767 {
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);
16776 }
16777 
get_range_tuple_id()16778 isl::id multi_union_pw_aff::get_range_tuple_id() const
16779 {
16780   return range_tuple_id();
16781 }
16782 
reset_range_tuple_id()16783 isl::multi_union_pw_aff multi_union_pw_aff::reset_range_tuple_id() const
16784 {
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);
16793 }
16794 
scale(isl::multi_val mv)16795 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::multi_val mv) const
16796 {
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);
16805 }
16806 
scale(isl::val v)16807 isl::multi_union_pw_aff multi_union_pw_aff::scale(isl::val v) const
16808 {
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);
16817 }
16818 
scale(long v)16819 isl::multi_union_pw_aff multi_union_pw_aff::scale(long v) const
16820 {
16821   if (!ptr)
16822     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16823   return this->scale(isl::val(ctx(), v));
16824 }
16825 
scale_down(isl::multi_val mv)16826 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::multi_val mv) const
16827 {
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);
16836 }
16837 
scale_down(isl::val v)16838 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(isl::val v) const
16839 {
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);
16848 }
16849 
scale_down(long v)16850 isl::multi_union_pw_aff multi_union_pw_aff::scale_down(long v) const
16851 {
16852   if (!ptr)
16853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16854   return this->scale_down(isl::val(ctx(), v));
16855 }
16856 
set_at(int pos,isl::union_pw_aff el)16857 isl::multi_union_pw_aff multi_union_pw_aff::set_at(int pos, isl::union_pw_aff el) const
16858 {
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);
16867 }
16868 
set_range_tuple(isl::id id)16869 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(isl::id id) const
16870 {
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);
16879 }
16880 
set_range_tuple(const std::string & id)16881 isl::multi_union_pw_aff multi_union_pw_aff::set_range_tuple(const std::string &id) const
16882 {
16883   if (!ptr)
16884     exception::throw_invalid("NULL input", __FILE__, __LINE__);
16885   return this->set_range_tuple(isl::id(ctx(), id));
16886 }
16887 
size()16888 unsigned multi_union_pw_aff::size() const
16889 {
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;
16898 }
16899 
space()16900 isl::space multi_union_pw_aff::space() const
16901 {
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);
16910 }
16911 
get_space()16912 isl::space multi_union_pw_aff::get_space() const
16913 {
16914   return space();
16915 }
16916 
sub(isl::multi_union_pw_aff multi2)16917 isl::multi_union_pw_aff multi_union_pw_aff::sub(isl::multi_union_pw_aff multi2) const
16918 {
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);
16927 }
16928 
union_add(isl::multi_union_pw_aff mupa2)16929 isl::multi_union_pw_aff multi_union_pw_aff::union_add(isl::multi_union_pw_aff mupa2) const
16930 {
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);
16939 }
16940 
zero(isl::space space)16941 isl::multi_union_pw_aff multi_union_pw_aff::zero(isl::space space)
16942 {
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);
16951 }
16952 
16953 inline std::ostream &operator<<(std::ostream &os, const multi_union_pw_aff &obj)
16954 {
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;
16965 }
16966 
16967 // implementations for isl::multi_val
manage(__isl_take isl_multi_val * ptr)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);
16972 }
manage_copy(__isl_keep isl_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);
16982 }
16983 
multi_val(__isl_take isl_multi_val * ptr)16984 multi_val::multi_val(__isl_take isl_multi_val *ptr)
16985     : ptr(ptr) {}
16986 
multi_val()16987 multi_val::multi_val()
16988     : ptr(nullptr) {}
16989 
multi_val(const multi_val & obj)16990 multi_val::multi_val(const multi_val &obj)
16991     : ptr(nullptr)
16992 {
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);
17000 }
17001 
multi_val(isl::space space,isl::val_list list)17002 multi_val::multi_val(isl::space space, isl::val_list list)
17003 {
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;
17012 }
17013 
multi_val(isl::ctx ctx,const std::string & str)17014 multi_val::multi_val(isl::ctx ctx, const std::string &str)
17015 {
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;
17022 }
17023 
17024 multi_val &multi_val::operator=(multi_val obj) {
17025   std::swap(this->ptr, obj.ptr);
17026   return *this;
17027 }
17028 
~multi_val()17029 multi_val::~multi_val() {
17030   if (ptr)
17031     isl_multi_val_free(ptr);
17032 }
17033 
copy()17034 __isl_give isl_multi_val *multi_val::copy() const & {
17035   return isl_multi_val_copy(ptr);
17036 }
17037 
get()17038 __isl_keep isl_multi_val *multi_val::get() const {
17039   return ptr;
17040 }
17041 
release()17042 __isl_give isl_multi_val *multi_val::release() {
17043   isl_multi_val *tmp = ptr;
17044   ptr = nullptr;
17045   return tmp;
17046 }
17047 
is_null()17048 bool multi_val::is_null() const {
17049   return ptr == nullptr;
17050 }
17051 
ctx()17052 isl::ctx multi_val::ctx() const {
17053   return isl::ctx(isl_multi_val_get_ctx(ptr));
17054 }
17055 
add(isl::multi_val multi2)17056 isl::multi_val multi_val::add(isl::multi_val multi2) const
17057 {
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);
17066 }
17067 
add(isl::val v)17068 isl::multi_val multi_val::add(isl::val v) const
17069 {
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);
17078 }
17079 
add(long v)17080 isl::multi_val multi_val::add(long v) const
17081 {
17082   if (!ptr)
17083     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17084   return this->add(isl::val(ctx(), v));
17085 }
17086 
at(int pos)17087 isl::val multi_val::at(int pos) const
17088 {
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);
17097 }
17098 
get_at(int pos)17099 isl::val multi_val::get_at(int pos) const
17100 {
17101   return at(pos);
17102 }
17103 
flat_range_product(isl::multi_val multi2)17104 isl::multi_val multi_val::flat_range_product(isl::multi_val multi2) const
17105 {
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);
17114 }
17115 
has_range_tuple_id()17116 bool multi_val::has_range_tuple_id() const
17117 {
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;
17126 }
17127 
involves_nan()17128 bool multi_val::involves_nan() const
17129 {
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;
17138 }
17139 
list()17140 isl::val_list multi_val::list() const
17141 {
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);
17150 }
17151 
get_list()17152 isl::val_list multi_val::get_list() const
17153 {
17154   return list();
17155 }
17156 
max(isl::multi_val multi2)17157 isl::multi_val multi_val::max(isl::multi_val multi2) const
17158 {
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);
17167 }
17168 
min(isl::multi_val multi2)17169 isl::multi_val multi_val::min(isl::multi_val multi2) const
17170 {
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);
17179 }
17180 
neg()17181 isl::multi_val multi_val::neg() const
17182 {
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);
17191 }
17192 
plain_is_equal(const isl::multi_val & multi2)17193 bool multi_val::plain_is_equal(const isl::multi_val &multi2) const
17194 {
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;
17203 }
17204 
product(isl::multi_val multi2)17205 isl::multi_val multi_val::product(isl::multi_val multi2) const
17206 {
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);
17215 }
17216 
range_product(isl::multi_val multi2)17217 isl::multi_val multi_val::range_product(isl::multi_val multi2) const
17218 {
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);
17227 }
17228 
range_tuple_id()17229 isl::id multi_val::range_tuple_id() const
17230 {
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);
17239 }
17240 
get_range_tuple_id()17241 isl::id multi_val::get_range_tuple_id() const
17242 {
17243   return range_tuple_id();
17244 }
17245 
reset_range_tuple_id()17246 isl::multi_val multi_val::reset_range_tuple_id() const
17247 {
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);
17256 }
17257 
scale(isl::multi_val mv)17258 isl::multi_val multi_val::scale(isl::multi_val mv) const
17259 {
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);
17268 }
17269 
scale(isl::val v)17270 isl::multi_val multi_val::scale(isl::val v) const
17271 {
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);
17280 }
17281 
scale(long v)17282 isl::multi_val multi_val::scale(long v) const
17283 {
17284   if (!ptr)
17285     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17286   return this->scale(isl::val(ctx(), v));
17287 }
17288 
scale_down(isl::multi_val mv)17289 isl::multi_val multi_val::scale_down(isl::multi_val mv) const
17290 {
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);
17299 }
17300 
scale_down(isl::val v)17301 isl::multi_val multi_val::scale_down(isl::val v) const
17302 {
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);
17311 }
17312 
scale_down(long v)17313 isl::multi_val multi_val::scale_down(long v) const
17314 {
17315   if (!ptr)
17316     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17317   return this->scale_down(isl::val(ctx(), v));
17318 }
17319 
set_at(int pos,isl::val el)17320 isl::multi_val multi_val::set_at(int pos, isl::val el) const
17321 {
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);
17330 }
17331 
set_at(int pos,long el)17332 isl::multi_val multi_val::set_at(int pos, long el) const
17333 {
17334   if (!ptr)
17335     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17336   return this->set_at(pos, isl::val(ctx(), el));
17337 }
17338 
set_range_tuple(isl::id id)17339 isl::multi_val multi_val::set_range_tuple(isl::id id) const
17340 {
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);
17349 }
17350 
set_range_tuple(const std::string & id)17351 isl::multi_val multi_val::set_range_tuple(const std::string &id) const
17352 {
17353   if (!ptr)
17354     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17355   return this->set_range_tuple(isl::id(ctx(), id));
17356 }
17357 
size()17358 unsigned multi_val::size() const
17359 {
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;
17368 }
17369 
space()17370 isl::space multi_val::space() const
17371 {
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);
17380 }
17381 
get_space()17382 isl::space multi_val::get_space() const
17383 {
17384   return space();
17385 }
17386 
sub(isl::multi_val multi2)17387 isl::multi_val multi_val::sub(isl::multi_val multi2) const
17388 {
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);
17397 }
17398 
zero(isl::space space)17399 isl::multi_val multi_val::zero(isl::space space)
17400 {
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);
17409 }
17410 
17411 inline std::ostream &operator<<(std::ostream &os, const multi_val &obj)
17412 {
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;
17423 }
17424 
17425 // implementations for isl::point
manage(__isl_take isl_point * ptr)17426 point manage(__isl_take isl_point *ptr) {
17427   if (!ptr)
17428     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17429   return point(ptr);
17430 }
manage_copy(__isl_keep isl_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);
17440 }
17441 
point(__isl_take isl_point * ptr)17442 point::point(__isl_take isl_point *ptr)
17443     : ptr(ptr) {}
17444 
point()17445 point::point()
17446     : ptr(nullptr) {}
17447 
point(const point & obj)17448 point::point(const point &obj)
17449     : ptr(nullptr)
17450 {
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);
17458 }
17459 
17460 point &point::operator=(point obj) {
17461   std::swap(this->ptr, obj.ptr);
17462   return *this;
17463 }
17464 
~point()17465 point::~point() {
17466   if (ptr)
17467     isl_point_free(ptr);
17468 }
17469 
copy()17470 __isl_give isl_point *point::copy() const & {
17471   return isl_point_copy(ptr);
17472 }
17473 
get()17474 __isl_keep isl_point *point::get() const {
17475   return ptr;
17476 }
17477 
release()17478 __isl_give isl_point *point::release() {
17479   isl_point *tmp = ptr;
17480   ptr = nullptr;
17481   return tmp;
17482 }
17483 
is_null()17484 bool point::is_null() const {
17485   return ptr == nullptr;
17486 }
17487 
ctx()17488 isl::ctx point::ctx() const {
17489   return isl::ctx(isl_point_get_ctx(ptr));
17490 }
17491 
affine_hull()17492 isl::basic_set point::affine_hull() const
17493 {
17494   if (!ptr)
17495     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17496   return isl::basic_set(*this).affine_hull();
17497 }
17498 
apply(const isl::basic_map & bmap)17499 isl::basic_set point::apply(const isl::basic_map &bmap) const
17500 {
17501   if (!ptr)
17502     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17503   return isl::basic_set(*this).apply(bmap);
17504 }
17505 
apply(const isl::map & map)17506 isl::set point::apply(const isl::map &map) const
17507 {
17508   if (!ptr)
17509     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17510   return isl::basic_set(*this).apply(map);
17511 }
17512 
apply(const isl::union_map & umap)17513 isl::union_set point::apply(const isl::union_map &umap) const
17514 {
17515   if (!ptr)
17516     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17517   return isl::basic_set(*this).apply(umap);
17518 }
17519 
as_pw_multi_aff()17520 isl::pw_multi_aff point::as_pw_multi_aff() const
17521 {
17522   if (!ptr)
17523     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17524   return isl::basic_set(*this).as_pw_multi_aff();
17525 }
17526 
as_set()17527 isl::set point::as_set() const
17528 {
17529   if (!ptr)
17530     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17531   return isl::basic_set(*this).as_set();
17532 }
17533 
bind(const isl::multi_id & tuple)17534 isl::set point::bind(const isl::multi_id &tuple) const
17535 {
17536   if (!ptr)
17537     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17538   return isl::basic_set(*this).bind(tuple);
17539 }
17540 
coalesce()17541 isl::set point::coalesce() const
17542 {
17543   if (!ptr)
17544     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17545   return isl::basic_set(*this).coalesce();
17546 }
17547 
complement()17548 isl::set point::complement() const
17549 {
17550   if (!ptr)
17551     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17552   return isl::basic_set(*this).complement();
17553 }
17554 
compute_divs()17555 isl::union_set point::compute_divs() const
17556 {
17557   if (!ptr)
17558     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17559   return isl::basic_set(*this).compute_divs();
17560 }
17561 
detect_equalities()17562 isl::basic_set point::detect_equalities() const
17563 {
17564   if (!ptr)
17565     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17566   return isl::basic_set(*this).detect_equalities();
17567 }
17568 
dim_max_val(int pos)17569 isl::val point::dim_max_val(int pos) const
17570 {
17571   if (!ptr)
17572     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17573   return isl::basic_set(*this).dim_max_val(pos);
17574 }
17575 
dim_min_val(int pos)17576 isl::val point::dim_min_val(int pos) const
17577 {
17578   if (!ptr)
17579     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17580   return isl::basic_set(*this).dim_min_val(pos);
17581 }
17582 
drop_unused_params()17583 isl::set point::drop_unused_params() const
17584 {
17585   if (!ptr)
17586     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17587   return isl::basic_set(*this).drop_unused_params();
17588 }
17589 
every_set(const std::function<bool (isl::set)> & test)17590 bool point::every_set(const std::function<bool(isl::set)> &test) const
17591 {
17592   if (!ptr)
17593     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17594   return isl::basic_set(*this).every_set(test);
17595 }
17596 
extract_set(const isl::space & space)17597 isl::set point::extract_set(const isl::space &space) const
17598 {
17599   if (!ptr)
17600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17601   return isl::basic_set(*this).extract_set(space);
17602 }
17603 
flatten()17604 isl::basic_set point::flatten() const
17605 {
17606   if (!ptr)
17607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17608   return isl::basic_set(*this).flatten();
17609 }
17610 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)17611 void point::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
17612 {
17613   if (!ptr)
17614     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17615   return isl::basic_set(*this).foreach_basic_set(fn);
17616 }
17617 
foreach_point(const std::function<void (isl::point)> & fn)17618 void point::foreach_point(const std::function<void(isl::point)> &fn) const
17619 {
17620   if (!ptr)
17621     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17622   return isl::basic_set(*this).foreach_point(fn);
17623 }
17624 
foreach_set(const std::function<void (isl::set)> & fn)17625 void point::foreach_set(const std::function<void(isl::set)> &fn) const
17626 {
17627   if (!ptr)
17628     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17629   return isl::basic_set(*this).foreach_set(fn);
17630 }
17631 
gist(const isl::basic_set & context)17632 isl::basic_set point::gist(const isl::basic_set &context) const
17633 {
17634   if (!ptr)
17635     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17636   return isl::basic_set(*this).gist(context);
17637 }
17638 
gist(const isl::set & context)17639 isl::set point::gist(const isl::set &context) const
17640 {
17641   if (!ptr)
17642     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17643   return isl::basic_set(*this).gist(context);
17644 }
17645 
gist(const isl::union_set & context)17646 isl::union_set point::gist(const isl::union_set &context) const
17647 {
17648   if (!ptr)
17649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17650   return isl::basic_set(*this).gist(context);
17651 }
17652 
gist_params(const isl::set & context)17653 isl::set point::gist_params(const isl::set &context) const
17654 {
17655   if (!ptr)
17656     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17657   return isl::basic_set(*this).gist_params(context);
17658 }
17659 
identity()17660 isl::map point::identity() const
17661 {
17662   if (!ptr)
17663     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17664   return isl::basic_set(*this).identity();
17665 }
17666 
indicator_function()17667 isl::pw_aff point::indicator_function() const
17668 {
17669   if (!ptr)
17670     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17671   return isl::basic_set(*this).indicator_function();
17672 }
17673 
insert_domain(const isl::space & domain)17674 isl::map point::insert_domain(const isl::space &domain) const
17675 {
17676   if (!ptr)
17677     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17678   return isl::basic_set(*this).insert_domain(domain);
17679 }
17680 
intersect(const isl::basic_set & bset2)17681 isl::basic_set point::intersect(const isl::basic_set &bset2) const
17682 {
17683   if (!ptr)
17684     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17685   return isl::basic_set(*this).intersect(bset2);
17686 }
17687 
intersect(const isl::set & set2)17688 isl::set point::intersect(const isl::set &set2) const
17689 {
17690   if (!ptr)
17691     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17692   return isl::basic_set(*this).intersect(set2);
17693 }
17694 
intersect(const isl::union_set & uset2)17695 isl::union_set point::intersect(const isl::union_set &uset2) const
17696 {
17697   if (!ptr)
17698     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17699   return isl::basic_set(*this).intersect(uset2);
17700 }
17701 
intersect_params(const isl::basic_set & bset2)17702 isl::basic_set point::intersect_params(const isl::basic_set &bset2) const
17703 {
17704   if (!ptr)
17705     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17706   return isl::basic_set(*this).intersect_params(bset2);
17707 }
17708 
intersect_params(const isl::set & params)17709 isl::set point::intersect_params(const isl::set &params) const
17710 {
17711   if (!ptr)
17712     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17713   return isl::basic_set(*this).intersect_params(params);
17714 }
17715 
involves_locals()17716 bool point::involves_locals() const
17717 {
17718   if (!ptr)
17719     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17720   return isl::basic_set(*this).involves_locals();
17721 }
17722 
is_disjoint(const isl::set & set2)17723 bool point::is_disjoint(const isl::set &set2) const
17724 {
17725   if (!ptr)
17726     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17727   return isl::basic_set(*this).is_disjoint(set2);
17728 }
17729 
is_disjoint(const isl::union_set & uset2)17730 bool point::is_disjoint(const isl::union_set &uset2) const
17731 {
17732   if (!ptr)
17733     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17734   return isl::basic_set(*this).is_disjoint(uset2);
17735 }
17736 
is_empty()17737 bool point::is_empty() const
17738 {
17739   if (!ptr)
17740     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17741   return isl::basic_set(*this).is_empty();
17742 }
17743 
is_equal(const isl::basic_set & bset2)17744 bool point::is_equal(const isl::basic_set &bset2) const
17745 {
17746   if (!ptr)
17747     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17748   return isl::basic_set(*this).is_equal(bset2);
17749 }
17750 
is_equal(const isl::set & set2)17751 bool point::is_equal(const isl::set &set2) const
17752 {
17753   if (!ptr)
17754     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17755   return isl::basic_set(*this).is_equal(set2);
17756 }
17757 
is_equal(const isl::union_set & uset2)17758 bool point::is_equal(const isl::union_set &uset2) const
17759 {
17760   if (!ptr)
17761     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17762   return isl::basic_set(*this).is_equal(uset2);
17763 }
17764 
is_singleton()17765 bool point::is_singleton() const
17766 {
17767   if (!ptr)
17768     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17769   return isl::basic_set(*this).is_singleton();
17770 }
17771 
is_strict_subset(const isl::set & set2)17772 bool point::is_strict_subset(const isl::set &set2) const
17773 {
17774   if (!ptr)
17775     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17776   return isl::basic_set(*this).is_strict_subset(set2);
17777 }
17778 
is_strict_subset(const isl::union_set & uset2)17779 bool point::is_strict_subset(const isl::union_set &uset2) const
17780 {
17781   if (!ptr)
17782     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17783   return isl::basic_set(*this).is_strict_subset(uset2);
17784 }
17785 
is_subset(const isl::basic_set & bset2)17786 bool point::is_subset(const isl::basic_set &bset2) const
17787 {
17788   if (!ptr)
17789     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17790   return isl::basic_set(*this).is_subset(bset2);
17791 }
17792 
is_subset(const isl::set & set2)17793 bool point::is_subset(const isl::set &set2) const
17794 {
17795   if (!ptr)
17796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17797   return isl::basic_set(*this).is_subset(set2);
17798 }
17799 
is_subset(const isl::union_set & uset2)17800 bool point::is_subset(const isl::union_set &uset2) const
17801 {
17802   if (!ptr)
17803     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17804   return isl::basic_set(*this).is_subset(uset2);
17805 }
17806 
is_wrapping()17807 bool point::is_wrapping() const
17808 {
17809   if (!ptr)
17810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17811   return isl::basic_set(*this).is_wrapping();
17812 }
17813 
isa_set()17814 bool point::isa_set() const
17815 {
17816   if (!ptr)
17817     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17818   return isl::basic_set(*this).isa_set();
17819 }
17820 
lattice_tile()17821 isl::fixed_box point::lattice_tile() const
17822 {
17823   if (!ptr)
17824     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17825   return isl::basic_set(*this).lattice_tile();
17826 }
17827 
lexmax()17828 isl::set point::lexmax() const
17829 {
17830   if (!ptr)
17831     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17832   return isl::basic_set(*this).lexmax();
17833 }
17834 
lexmax_pw_multi_aff()17835 isl::pw_multi_aff point::lexmax_pw_multi_aff() const
17836 {
17837   if (!ptr)
17838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17839   return isl::basic_set(*this).lexmax_pw_multi_aff();
17840 }
17841 
lexmin()17842 isl::set point::lexmin() const
17843 {
17844   if (!ptr)
17845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17846   return isl::basic_set(*this).lexmin();
17847 }
17848 
lexmin_pw_multi_aff()17849 isl::pw_multi_aff point::lexmin_pw_multi_aff() const
17850 {
17851   if (!ptr)
17852     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17853   return isl::basic_set(*this).lexmin_pw_multi_aff();
17854 }
17855 
lower_bound(const isl::multi_pw_aff & lower)17856 isl::set point::lower_bound(const isl::multi_pw_aff &lower) const
17857 {
17858   if (!ptr)
17859     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17860   return isl::basic_set(*this).lower_bound(lower);
17861 }
17862 
lower_bound(const isl::multi_val & lower)17863 isl::set point::lower_bound(const isl::multi_val &lower) const
17864 {
17865   if (!ptr)
17866     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17867   return isl::basic_set(*this).lower_bound(lower);
17868 }
17869 
max_multi_pw_aff()17870 isl::multi_pw_aff point::max_multi_pw_aff() const
17871 {
17872   if (!ptr)
17873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17874   return isl::basic_set(*this).max_multi_pw_aff();
17875 }
17876 
max_val(const isl::aff & obj)17877 isl::val point::max_val(const isl::aff &obj) const
17878 {
17879   if (!ptr)
17880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17881   return isl::basic_set(*this).max_val(obj);
17882 }
17883 
min_multi_pw_aff()17884 isl::multi_pw_aff point::min_multi_pw_aff() const
17885 {
17886   if (!ptr)
17887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17888   return isl::basic_set(*this).min_multi_pw_aff();
17889 }
17890 
min_val(const isl::aff & obj)17891 isl::val point::min_val(const isl::aff &obj) const
17892 {
17893   if (!ptr)
17894     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17895   return isl::basic_set(*this).min_val(obj);
17896 }
17897 
multi_val()17898 isl::multi_val point::multi_val() const
17899 {
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);
17908 }
17909 
get_multi_val()17910 isl::multi_val point::get_multi_val() const
17911 {
17912   return multi_val();
17913 }
17914 
n_basic_set()17915 unsigned point::n_basic_set() const
17916 {
17917   if (!ptr)
17918     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17919   return isl::basic_set(*this).n_basic_set();
17920 }
17921 
param_pw_aff_on_domain(const isl::id & id)17922 isl::pw_aff point::param_pw_aff_on_domain(const isl::id &id) const
17923 {
17924   if (!ptr)
17925     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17926   return isl::basic_set(*this).param_pw_aff_on_domain(id);
17927 }
17928 
param_pw_aff_on_domain(const std::string & id)17929 isl::pw_aff point::param_pw_aff_on_domain(const std::string &id) const
17930 {
17931   if (!ptr)
17932     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17933   return this->param_pw_aff_on_domain(isl::id(ctx(), id));
17934 }
17935 
params()17936 isl::basic_set point::params() const
17937 {
17938   if (!ptr)
17939     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17940   return isl::basic_set(*this).params();
17941 }
17942 
plain_multi_val_if_fixed()17943 isl::multi_val point::plain_multi_val_if_fixed() const
17944 {
17945   if (!ptr)
17946     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17947   return isl::basic_set(*this).plain_multi_val_if_fixed();
17948 }
17949 
polyhedral_hull()17950 isl::basic_set point::polyhedral_hull() const
17951 {
17952   if (!ptr)
17953     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17954   return isl::basic_set(*this).polyhedral_hull();
17955 }
17956 
preimage(const isl::multi_aff & ma)17957 isl::set point::preimage(const isl::multi_aff &ma) const
17958 {
17959   if (!ptr)
17960     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17961   return isl::basic_set(*this).preimage(ma);
17962 }
17963 
preimage(const isl::multi_pw_aff & mpa)17964 isl::set point::preimage(const isl::multi_pw_aff &mpa) const
17965 {
17966   if (!ptr)
17967     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17968   return isl::basic_set(*this).preimage(mpa);
17969 }
17970 
preimage(const isl::pw_multi_aff & pma)17971 isl::set point::preimage(const isl::pw_multi_aff &pma) const
17972 {
17973   if (!ptr)
17974     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17975   return isl::basic_set(*this).preimage(pma);
17976 }
17977 
preimage(const isl::union_pw_multi_aff & upma)17978 isl::union_set point::preimage(const isl::union_pw_multi_aff &upma) const
17979 {
17980   if (!ptr)
17981     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17982   return isl::basic_set(*this).preimage(upma);
17983 }
17984 
product(const isl::set & set2)17985 isl::set point::product(const isl::set &set2) const
17986 {
17987   if (!ptr)
17988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17989   return isl::basic_set(*this).product(set2);
17990 }
17991 
project_out_all_params()17992 isl::set point::project_out_all_params() const
17993 {
17994   if (!ptr)
17995     exception::throw_invalid("NULL input", __FILE__, __LINE__);
17996   return isl::basic_set(*this).project_out_all_params();
17997 }
17998 
project_out_param(const isl::id & id)17999 isl::set point::project_out_param(const isl::id &id) const
18000 {
18001   if (!ptr)
18002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18003   return isl::basic_set(*this).project_out_param(id);
18004 }
18005 
project_out_param(const std::string & id)18006 isl::set point::project_out_param(const std::string &id) const
18007 {
18008   if (!ptr)
18009     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18010   return this->project_out_param(isl::id(ctx(), id));
18011 }
18012 
project_out_param(const isl::id_list & list)18013 isl::set point::project_out_param(const isl::id_list &list) const
18014 {
18015   if (!ptr)
18016     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18017   return isl::basic_set(*this).project_out_param(list);
18018 }
18019 
pw_aff_on_domain(const isl::val & v)18020 isl::pw_aff point::pw_aff_on_domain(const isl::val &v) const
18021 {
18022   if (!ptr)
18023     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18024   return isl::basic_set(*this).pw_aff_on_domain(v);
18025 }
18026 
pw_aff_on_domain(long v)18027 isl::pw_aff point::pw_aff_on_domain(long v) const
18028 {
18029   if (!ptr)
18030     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18031   return this->pw_aff_on_domain(isl::val(ctx(), v));
18032 }
18033 
pw_multi_aff_on_domain(const isl::multi_val & mv)18034 isl::pw_multi_aff point::pw_multi_aff_on_domain(const isl::multi_val &mv) const
18035 {
18036   if (!ptr)
18037     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18038   return isl::basic_set(*this).pw_multi_aff_on_domain(mv);
18039 }
18040 
sample()18041 isl::basic_set point::sample() const
18042 {
18043   if (!ptr)
18044     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18045   return isl::basic_set(*this).sample();
18046 }
18047 
sample_point()18048 isl::point point::sample_point() const
18049 {
18050   if (!ptr)
18051     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18052   return isl::basic_set(*this).sample_point();
18053 }
18054 
set_list()18055 isl::set_list point::set_list() const
18056 {
18057   if (!ptr)
18058     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18059   return isl::basic_set(*this).set_list();
18060 }
18061 
simple_fixed_box_hull()18062 isl::fixed_box point::simple_fixed_box_hull() const
18063 {
18064   if (!ptr)
18065     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18066   return isl::basic_set(*this).simple_fixed_box_hull();
18067 }
18068 
space()18069 isl::space point::space() const
18070 {
18071   if (!ptr)
18072     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18073   return isl::basic_set(*this).space();
18074 }
18075 
stride(int pos)18076 isl::val point::stride(int pos) const
18077 {
18078   if (!ptr)
18079     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18080   return isl::basic_set(*this).stride(pos);
18081 }
18082 
subtract(const isl::set & set2)18083 isl::set point::subtract(const isl::set &set2) const
18084 {
18085   if (!ptr)
18086     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18087   return isl::basic_set(*this).subtract(set2);
18088 }
18089 
subtract(const isl::union_set & uset2)18090 isl::union_set point::subtract(const isl::union_set &uset2) const
18091 {
18092   if (!ptr)
18093     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18094   return isl::basic_set(*this).subtract(uset2);
18095 }
18096 
to_list()18097 isl::set_list point::to_list() const
18098 {
18099   if (!ptr)
18100     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18101   return isl::basic_set(*this).to_list();
18102 }
18103 
to_set()18104 isl::set point::to_set() const
18105 {
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);
18114 }
18115 
to_union_set()18116 isl::union_set point::to_union_set() const
18117 {
18118   if (!ptr)
18119     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18120   return isl::basic_set(*this).to_union_set();
18121 }
18122 
translation()18123 isl::map point::translation() const
18124 {
18125   if (!ptr)
18126     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18127   return isl::basic_set(*this).translation();
18128 }
18129 
tuple_dim()18130 unsigned point::tuple_dim() const
18131 {
18132   if (!ptr)
18133     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18134   return isl::basic_set(*this).tuple_dim();
18135 }
18136 
unbind_params(const isl::multi_id & tuple)18137 isl::set point::unbind_params(const isl::multi_id &tuple) const
18138 {
18139   if (!ptr)
18140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18141   return isl::basic_set(*this).unbind_params(tuple);
18142 }
18143 
unbind_params_insert_domain(const isl::multi_id & domain)18144 isl::map point::unbind_params_insert_domain(const isl::multi_id &domain) const
18145 {
18146   if (!ptr)
18147     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18148   return isl::basic_set(*this).unbind_params_insert_domain(domain);
18149 }
18150 
unite(const isl::basic_set & bset2)18151 isl::set point::unite(const isl::basic_set &bset2) const
18152 {
18153   if (!ptr)
18154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18155   return isl::basic_set(*this).unite(bset2);
18156 }
18157 
unite(const isl::set & set2)18158 isl::set point::unite(const isl::set &set2) const
18159 {
18160   if (!ptr)
18161     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18162   return isl::basic_set(*this).unite(set2);
18163 }
18164 
unite(const isl::union_set & uset2)18165 isl::union_set point::unite(const isl::union_set &uset2) const
18166 {
18167   if (!ptr)
18168     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18169   return isl::basic_set(*this).unite(uset2);
18170 }
18171 
unshifted_simple_hull()18172 isl::basic_set point::unshifted_simple_hull() const
18173 {
18174   if (!ptr)
18175     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18176   return isl::basic_set(*this).unshifted_simple_hull();
18177 }
18178 
unwrap()18179 isl::map point::unwrap() const
18180 {
18181   if (!ptr)
18182     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18183   return isl::basic_set(*this).unwrap();
18184 }
18185 
upper_bound(const isl::multi_pw_aff & upper)18186 isl::set point::upper_bound(const isl::multi_pw_aff &upper) const
18187 {
18188   if (!ptr)
18189     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18190   return isl::basic_set(*this).upper_bound(upper);
18191 }
18192 
upper_bound(const isl::multi_val & upper)18193 isl::set point::upper_bound(const isl::multi_val &upper) const
18194 {
18195   if (!ptr)
18196     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18197   return isl::basic_set(*this).upper_bound(upper);
18198 }
18199 
wrapped_reverse()18200 isl::set point::wrapped_reverse() const
18201 {
18202   if (!ptr)
18203     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18204   return isl::basic_set(*this).wrapped_reverse();
18205 }
18206 
18207 inline std::ostream &operator<<(std::ostream &os, const point &obj)
18208 {
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;
18219 }
18220 
18221 // implementations for isl::pw_aff
manage(__isl_take isl_pw_aff * ptr)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);
18226 }
manage_copy(__isl_keep isl_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);
18236 }
18237 
pw_aff(__isl_take isl_pw_aff * ptr)18238 pw_aff::pw_aff(__isl_take isl_pw_aff *ptr)
18239     : ptr(ptr) {}
18240 
pw_aff()18241 pw_aff::pw_aff()
18242     : ptr(nullptr) {}
18243 
pw_aff(const pw_aff & obj)18244 pw_aff::pw_aff(const pw_aff &obj)
18245     : ptr(nullptr)
18246 {
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);
18254 }
18255 
pw_aff(isl::aff aff)18256 pw_aff::pw_aff(isl::aff aff)
18257 {
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;
18266 }
18267 
pw_aff(isl::ctx ctx,const std::string & str)18268 pw_aff::pw_aff(isl::ctx ctx, const std::string &str)
18269 {
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;
18276 }
18277 
18278 pw_aff &pw_aff::operator=(pw_aff obj) {
18279   std::swap(this->ptr, obj.ptr);
18280   return *this;
18281 }
18282 
~pw_aff()18283 pw_aff::~pw_aff() {
18284   if (ptr)
18285     isl_pw_aff_free(ptr);
18286 }
18287 
copy()18288 __isl_give isl_pw_aff *pw_aff::copy() const & {
18289   return isl_pw_aff_copy(ptr);
18290 }
18291 
get()18292 __isl_keep isl_pw_aff *pw_aff::get() const {
18293   return ptr;
18294 }
18295 
release()18296 __isl_give isl_pw_aff *pw_aff::release() {
18297   isl_pw_aff *tmp = ptr;
18298   ptr = nullptr;
18299   return tmp;
18300 }
18301 
is_null()18302 bool pw_aff::is_null() const {
18303   return ptr == nullptr;
18304 }
18305 
ctx()18306 isl::ctx pw_aff::ctx() const {
18307   return isl::ctx(isl_pw_aff_get_ctx(ptr));
18308 }
18309 
add(const isl::multi_pw_aff & multi2)18310 isl::multi_pw_aff pw_aff::add(const isl::multi_pw_aff &multi2) const
18311 {
18312   if (!ptr)
18313     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18314   return isl::pw_multi_aff(*this).add(multi2);
18315 }
18316 
add(const isl::multi_union_pw_aff & multi2)18317 isl::multi_union_pw_aff pw_aff::add(const isl::multi_union_pw_aff &multi2) const
18318 {
18319   if (!ptr)
18320     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18321   return isl::union_pw_aff(*this).add(multi2);
18322 }
18323 
add(isl::pw_aff pwaff2)18324 isl::pw_aff pw_aff::add(isl::pw_aff pwaff2) const
18325 {
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);
18334 }
18335 
add(const isl::pw_multi_aff & pma2)18336 isl::pw_multi_aff pw_aff::add(const isl::pw_multi_aff &pma2) const
18337 {
18338   if (!ptr)
18339     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18340   return isl::pw_multi_aff(*this).add(pma2);
18341 }
18342 
add(const isl::union_pw_aff & upa2)18343 isl::union_pw_aff pw_aff::add(const isl::union_pw_aff &upa2) const
18344 {
18345   if (!ptr)
18346     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18347   return isl::union_pw_aff(*this).add(upa2);
18348 }
18349 
add(const isl::union_pw_multi_aff & upma2)18350 isl::union_pw_multi_aff pw_aff::add(const isl::union_pw_multi_aff &upma2) const
18351 {
18352   if (!ptr)
18353     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18354   return isl::union_pw_aff(*this).add(upma2);
18355 }
18356 
add(const isl::aff & pwaff2)18357 isl::pw_aff pw_aff::add(const isl::aff &pwaff2) const
18358 {
18359   if (!ptr)
18360     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18361   return this->add(isl::pw_aff(pwaff2));
18362 }
18363 
add_constant(isl::val v)18364 isl::pw_aff pw_aff::add_constant(isl::val v) const
18365 {
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);
18374 }
18375 
add_constant(long v)18376 isl::pw_aff pw_aff::add_constant(long v) const
18377 {
18378   if (!ptr)
18379     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18380   return this->add_constant(isl::val(ctx(), v));
18381 }
18382 
add_constant(const isl::multi_val & mv)18383 isl::pw_multi_aff pw_aff::add_constant(const isl::multi_val &mv) const
18384 {
18385   if (!ptr)
18386     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18387   return isl::pw_multi_aff(*this).add_constant(mv);
18388 }
18389 
apply(const isl::union_pw_multi_aff & upma2)18390 isl::union_pw_multi_aff pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
18391 {
18392   if (!ptr)
18393     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18394   return isl::union_pw_aff(*this).apply(upma2);
18395 }
18396 
as_aff()18397 isl::aff pw_aff::as_aff() const
18398 {
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);
18407 }
18408 
as_map()18409 isl::map pw_aff::as_map() const
18410 {
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);
18419 }
18420 
as_multi_aff()18421 isl::multi_aff pw_aff::as_multi_aff() const
18422 {
18423   if (!ptr)
18424     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18425   return isl::pw_multi_aff(*this).as_multi_aff();
18426 }
18427 
as_multi_union_pw_aff()18428 isl::multi_union_pw_aff pw_aff::as_multi_union_pw_aff() const
18429 {
18430   if (!ptr)
18431     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18432   return isl::union_pw_aff(*this).as_multi_union_pw_aff();
18433 }
18434 
as_pw_multi_aff()18435 isl::pw_multi_aff pw_aff::as_pw_multi_aff() const
18436 {
18437   if (!ptr)
18438     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18439   return isl::union_pw_aff(*this).as_pw_multi_aff();
18440 }
18441 
as_set()18442 isl::set pw_aff::as_set() const
18443 {
18444   if (!ptr)
18445     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18446   return isl::pw_multi_aff(*this).as_set();
18447 }
18448 
as_union_map()18449 isl::union_map pw_aff::as_union_map() const
18450 {
18451   if (!ptr)
18452     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18453   return isl::union_pw_aff(*this).as_union_map();
18454 }
18455 
at(int pos)18456 isl::pw_aff pw_aff::at(int pos) const
18457 {
18458   if (!ptr)
18459     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18460   return isl::pw_multi_aff(*this).at(pos);
18461 }
18462 
bind(const isl::multi_id & tuple)18463 isl::set pw_aff::bind(const isl::multi_id &tuple) const
18464 {
18465   if (!ptr)
18466     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18467   return isl::multi_pw_aff(*this).bind(tuple);
18468 }
18469 
bind(isl::id id)18470 isl::set pw_aff::bind(isl::id id) const
18471 {
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);
18480 }
18481 
bind(const std::string & id)18482 isl::set pw_aff::bind(const std::string &id) const
18483 {
18484   if (!ptr)
18485     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18486   return this->bind(isl::id(ctx(), id));
18487 }
18488 
bind_domain(isl::multi_id tuple)18489 isl::pw_aff pw_aff::bind_domain(isl::multi_id tuple) const
18490 {
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);
18499 }
18500 
bind_domain_wrapped_domain(isl::multi_id tuple)18501 isl::pw_aff pw_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
18502 {
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);
18511 }
18512 
ceil()18513 isl::pw_aff pw_aff::ceil() const
18514 {
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);
18523 }
18524 
coalesce()18525 isl::pw_aff pw_aff::coalesce() const
18526 {
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);
18535 }
18536 
cond(isl::pw_aff pwaff_true,isl::pw_aff pwaff_false)18537 isl::pw_aff pw_aff::cond(isl::pw_aff pwaff_true, isl::pw_aff pwaff_false) const
18538 {
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);
18547 }
18548 
div(isl::pw_aff pa2)18549 isl::pw_aff pw_aff::div(isl::pw_aff pa2) const
18550 {
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);
18559 }
18560 
domain()18561 isl::set pw_aff::domain() const
18562 {
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);
18571 }
18572 
domain_reverse()18573 isl::pw_aff pw_aff::domain_reverse() const
18574 {
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);
18583 }
18584 
drop_unused_params()18585 isl::pw_aff pw_aff::drop_unused_params() const
18586 {
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);
18595 }
18596 
eq_set(isl::pw_aff pwaff2)18597 isl::set pw_aff::eq_set(isl::pw_aff pwaff2) const
18598 {
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);
18607 }
18608 
eval(isl::point pnt)18609 isl::val pw_aff::eval(isl::point pnt) const
18610 {
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);
18619 }
18620 
extract_pw_multi_aff(const isl::space & space)18621 isl::pw_multi_aff pw_aff::extract_pw_multi_aff(const isl::space &space) const
18622 {
18623   if (!ptr)
18624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18625   return isl::union_pw_aff(*this).extract_pw_multi_aff(space);
18626 }
18627 
flat_range_product(const isl::multi_pw_aff & multi2)18628 isl::multi_pw_aff pw_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
18629 {
18630   if (!ptr)
18631     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18632   return isl::pw_multi_aff(*this).flat_range_product(multi2);
18633 }
18634 
flat_range_product(const isl::multi_union_pw_aff & multi2)18635 isl::multi_union_pw_aff pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
18636 {
18637   if (!ptr)
18638     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18639   return isl::union_pw_aff(*this).flat_range_product(multi2);
18640 }
18641 
flat_range_product(const isl::pw_multi_aff & pma2)18642 isl::pw_multi_aff pw_aff::flat_range_product(const isl::pw_multi_aff &pma2) const
18643 {
18644   if (!ptr)
18645     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18646   return isl::pw_multi_aff(*this).flat_range_product(pma2);
18647 }
18648 
flat_range_product(const isl::union_pw_multi_aff & upma2)18649 isl::union_pw_multi_aff pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
18650 {
18651   if (!ptr)
18652     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18653   return isl::union_pw_aff(*this).flat_range_product(upma2);
18654 }
18655 
floor()18656 isl::pw_aff pw_aff::floor() const
18657 {
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);
18666 }
18667 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)18668 void pw_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
18669 {
18670   if (!ptr)
18671     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18672   return isl::pw_multi_aff(*this).foreach_piece(fn);
18673 }
18674 
ge_set(isl::pw_aff pwaff2)18675 isl::set pw_aff::ge_set(isl::pw_aff pwaff2) const
18676 {
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);
18685 }
18686 
gist(isl::set context)18687 isl::pw_aff pw_aff::gist(isl::set context) const
18688 {
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);
18697 }
18698 
gist(const isl::union_set & context)18699 isl::union_pw_aff pw_aff::gist(const isl::union_set &context) const
18700 {
18701   if (!ptr)
18702     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18703   return isl::union_pw_aff(*this).gist(context);
18704 }
18705 
gist(const isl::basic_set & context)18706 isl::pw_aff pw_aff::gist(const isl::basic_set &context) const
18707 {
18708   if (!ptr)
18709     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18710   return this->gist(isl::set(context));
18711 }
18712 
gist(const isl::point & context)18713 isl::pw_aff pw_aff::gist(const isl::point &context) const
18714 {
18715   if (!ptr)
18716     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18717   return this->gist(isl::set(context));
18718 }
18719 
gist_params(isl::set context)18720 isl::pw_aff pw_aff::gist_params(isl::set context) const
18721 {
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);
18730 }
18731 
gt_set(isl::pw_aff pwaff2)18732 isl::set pw_aff::gt_set(isl::pw_aff pwaff2) const
18733 {
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);
18742 }
18743 
has_range_tuple_id()18744 bool pw_aff::has_range_tuple_id() const
18745 {
18746   if (!ptr)
18747     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18748   return isl::pw_multi_aff(*this).has_range_tuple_id();
18749 }
18750 
identity()18751 isl::multi_pw_aff pw_aff::identity() const
18752 {
18753   if (!ptr)
18754     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18755   return isl::pw_multi_aff(*this).identity();
18756 }
18757 
insert_domain(isl::space domain)18758 isl::pw_aff pw_aff::insert_domain(isl::space domain) const
18759 {
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);
18768 }
18769 
intersect_domain(isl::set set)18770 isl::pw_aff pw_aff::intersect_domain(isl::set set) const
18771 {
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);
18780 }
18781 
intersect_domain(const isl::space & space)18782 isl::union_pw_aff pw_aff::intersect_domain(const isl::space &space) const
18783 {
18784   if (!ptr)
18785     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18786   return isl::union_pw_aff(*this).intersect_domain(space);
18787 }
18788 
intersect_domain(const isl::union_set & uset)18789 isl::union_pw_aff pw_aff::intersect_domain(const isl::union_set &uset) const
18790 {
18791   if (!ptr)
18792     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18793   return isl::union_pw_aff(*this).intersect_domain(uset);
18794 }
18795 
intersect_domain(const isl::basic_set & set)18796 isl::pw_aff pw_aff::intersect_domain(const isl::basic_set &set) const
18797 {
18798   if (!ptr)
18799     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18800   return this->intersect_domain(isl::set(set));
18801 }
18802 
intersect_domain(const isl::point & set)18803 isl::pw_aff pw_aff::intersect_domain(const isl::point &set) const
18804 {
18805   if (!ptr)
18806     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18807   return this->intersect_domain(isl::set(set));
18808 }
18809 
intersect_domain_wrapped_domain(const isl::union_set & uset)18810 isl::union_pw_aff pw_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
18811 {
18812   if (!ptr)
18813     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18814   return isl::union_pw_aff(*this).intersect_domain_wrapped_domain(uset);
18815 }
18816 
intersect_domain_wrapped_range(const isl::union_set & uset)18817 isl::union_pw_aff pw_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
18818 {
18819   if (!ptr)
18820     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18821   return isl::union_pw_aff(*this).intersect_domain_wrapped_range(uset);
18822 }
18823 
intersect_params(isl::set set)18824 isl::pw_aff pw_aff::intersect_params(isl::set set) const
18825 {
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);
18834 }
18835 
involves_locals()18836 bool pw_aff::involves_locals() const
18837 {
18838   if (!ptr)
18839     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18840   return isl::pw_multi_aff(*this).involves_locals();
18841 }
18842 
involves_nan()18843 bool pw_aff::involves_nan() const
18844 {
18845   if (!ptr)
18846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18847   return isl::multi_pw_aff(*this).involves_nan();
18848 }
18849 
involves_param(const isl::id & id)18850 bool pw_aff::involves_param(const isl::id &id) const
18851 {
18852   if (!ptr)
18853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18854   return isl::pw_multi_aff(*this).involves_param(id);
18855 }
18856 
involves_param(const std::string & id)18857 bool pw_aff::involves_param(const std::string &id) const
18858 {
18859   if (!ptr)
18860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18861   return this->involves_param(isl::id(ctx(), id));
18862 }
18863 
involves_param(const isl::id_list & list)18864 bool pw_aff::involves_param(const isl::id_list &list) const
18865 {
18866   if (!ptr)
18867     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18868   return isl::pw_multi_aff(*this).involves_param(list);
18869 }
18870 
isa_aff()18871 bool pw_aff::isa_aff() const
18872 {
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;
18881 }
18882 
isa_multi_aff()18883 bool pw_aff::isa_multi_aff() const
18884 {
18885   if (!ptr)
18886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18887   return isl::pw_multi_aff(*this).isa_multi_aff();
18888 }
18889 
isa_pw_multi_aff()18890 bool pw_aff::isa_pw_multi_aff() const
18891 {
18892   if (!ptr)
18893     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18894   return isl::union_pw_aff(*this).isa_pw_multi_aff();
18895 }
18896 
le_set(isl::pw_aff pwaff2)18897 isl::set pw_aff::le_set(isl::pw_aff pwaff2) const
18898 {
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);
18907 }
18908 
list()18909 isl::pw_aff_list pw_aff::list() const
18910 {
18911   if (!ptr)
18912     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18913   return isl::multi_pw_aff(*this).list();
18914 }
18915 
lt_set(isl::pw_aff pwaff2)18916 isl::set pw_aff::lt_set(isl::pw_aff pwaff2) const
18917 {
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);
18926 }
18927 
max(const isl::multi_pw_aff & multi2)18928 isl::multi_pw_aff pw_aff::max(const isl::multi_pw_aff &multi2) const
18929 {
18930   if (!ptr)
18931     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18932   return isl::pw_multi_aff(*this).max(multi2);
18933 }
18934 
max(isl::pw_aff pwaff2)18935 isl::pw_aff pw_aff::max(isl::pw_aff pwaff2) const
18936 {
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);
18945 }
18946 
max(const isl::aff & pwaff2)18947 isl::pw_aff pw_aff::max(const isl::aff &pwaff2) const
18948 {
18949   if (!ptr)
18950     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18951   return this->max(isl::pw_aff(pwaff2));
18952 }
18953 
max_multi_val()18954 isl::multi_val pw_aff::max_multi_val() const
18955 {
18956   if (!ptr)
18957     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18958   return isl::pw_multi_aff(*this).max_multi_val();
18959 }
18960 
max_val()18961 isl::val pw_aff::max_val() const
18962 {
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);
18971 }
18972 
min(const isl::multi_pw_aff & multi2)18973 isl::multi_pw_aff pw_aff::min(const isl::multi_pw_aff &multi2) const
18974 {
18975   if (!ptr)
18976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18977   return isl::pw_multi_aff(*this).min(multi2);
18978 }
18979 
min(isl::pw_aff pwaff2)18980 isl::pw_aff pw_aff::min(isl::pw_aff pwaff2) const
18981 {
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);
18990 }
18991 
min(const isl::aff & pwaff2)18992 isl::pw_aff pw_aff::min(const isl::aff &pwaff2) const
18993 {
18994   if (!ptr)
18995     exception::throw_invalid("NULL input", __FILE__, __LINE__);
18996   return this->min(isl::pw_aff(pwaff2));
18997 }
18998 
min_multi_val()18999 isl::multi_val pw_aff::min_multi_val() const
19000 {
19001   if (!ptr)
19002     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19003   return isl::pw_multi_aff(*this).min_multi_val();
19004 }
19005 
min_val()19006 isl::val pw_aff::min_val() const
19007 {
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);
19016 }
19017 
mod(isl::val mod)19018 isl::pw_aff pw_aff::mod(isl::val mod) const
19019 {
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);
19028 }
19029 
mod(long mod)19030 isl::pw_aff pw_aff::mod(long mod) const
19031 {
19032   if (!ptr)
19033     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19034   return this->mod(isl::val(ctx(), mod));
19035 }
19036 
mul(isl::pw_aff pwaff2)19037 isl::pw_aff pw_aff::mul(isl::pw_aff pwaff2) const
19038 {
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);
19047 }
19048 
n_piece()19049 unsigned pw_aff::n_piece() const
19050 {
19051   if (!ptr)
19052     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19053   return isl::pw_multi_aff(*this).n_piece();
19054 }
19055 
ne_set(isl::pw_aff pwaff2)19056 isl::set pw_aff::ne_set(isl::pw_aff pwaff2) const
19057 {
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);
19066 }
19067 
neg()19068 isl::pw_aff pw_aff::neg() const
19069 {
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);
19078 }
19079 
param_on_domain(isl::set domain,isl::id id)19080 isl::pw_aff pw_aff::param_on_domain(isl::set domain, isl::id id)
19081 {
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);
19090 }
19091 
params()19092 isl::set pw_aff::params() const
19093 {
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);
19102 }
19103 
plain_is_empty()19104 bool pw_aff::plain_is_empty() const
19105 {
19106   if (!ptr)
19107     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19108   return isl::union_pw_aff(*this).plain_is_empty();
19109 }
19110 
plain_is_equal(const isl::multi_pw_aff & multi2)19111 bool pw_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
19112 {
19113   if (!ptr)
19114     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19115   return isl::pw_multi_aff(*this).plain_is_equal(multi2);
19116 }
19117 
plain_is_equal(const isl::multi_union_pw_aff & multi2)19118 bool pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
19119 {
19120   if (!ptr)
19121     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19122   return isl::union_pw_aff(*this).plain_is_equal(multi2);
19123 }
19124 
plain_is_equal(const isl::pw_aff & pwaff2)19125 bool pw_aff::plain_is_equal(const isl::pw_aff &pwaff2) const
19126 {
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;
19135 }
19136 
plain_is_equal(const isl::pw_multi_aff & pma2)19137 bool pw_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
19138 {
19139   if (!ptr)
19140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19141   return isl::pw_multi_aff(*this).plain_is_equal(pma2);
19142 }
19143 
plain_is_equal(const isl::union_pw_aff & upa2)19144 bool pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
19145 {
19146   if (!ptr)
19147     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19148   return isl::union_pw_aff(*this).plain_is_equal(upa2);
19149 }
19150 
plain_is_equal(const isl::union_pw_multi_aff & upma2)19151 bool pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
19152 {
19153   if (!ptr)
19154     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19155   return isl::union_pw_aff(*this).plain_is_equal(upma2);
19156 }
19157 
plain_is_equal(const isl::aff & pwaff2)19158 bool pw_aff::plain_is_equal(const isl::aff &pwaff2) const
19159 {
19160   if (!ptr)
19161     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19162   return this->plain_is_equal(isl::pw_aff(pwaff2));
19163 }
19164 
preimage_domain_wrapped_domain(const isl::pw_multi_aff & pma2)19165 isl::pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::pw_multi_aff &pma2) const
19166 {
19167   if (!ptr)
19168     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19169   return isl::pw_multi_aff(*this).preimage_domain_wrapped_domain(pma2);
19170 }
19171 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)19172 isl::union_pw_multi_aff pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
19173 {
19174   if (!ptr)
19175     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19176   return isl::union_pw_aff(*this).preimage_domain_wrapped_domain(upma2);
19177 }
19178 
product(const isl::multi_pw_aff & multi2)19179 isl::multi_pw_aff pw_aff::product(const isl::multi_pw_aff &multi2) const
19180 {
19181   if (!ptr)
19182     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19183   return isl::pw_multi_aff(*this).product(multi2);
19184 }
19185 
product(const isl::pw_multi_aff & pma2)19186 isl::pw_multi_aff pw_aff::product(const isl::pw_multi_aff &pma2) const
19187 {
19188   if (!ptr)
19189     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19190   return isl::pw_multi_aff(*this).product(pma2);
19191 }
19192 
pullback(isl::multi_aff ma)19193 isl::pw_aff pw_aff::pullback(isl::multi_aff ma) const
19194 {
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);
19203 }
19204 
pullback(isl::multi_pw_aff mpa)19205 isl::pw_aff pw_aff::pullback(isl::multi_pw_aff mpa) const
19206 {
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);
19215 }
19216 
pullback(isl::pw_multi_aff pma)19217 isl::pw_aff pw_aff::pullback(isl::pw_multi_aff pma) const
19218 {
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);
19227 }
19228 
pullback(const isl::union_pw_multi_aff & upma)19229 isl::union_pw_aff pw_aff::pullback(const isl::union_pw_multi_aff &upma) const
19230 {
19231   if (!ptr)
19232     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19233   return isl::union_pw_aff(*this).pullback(upma);
19234 }
19235 
pw_multi_aff_list()19236 isl::pw_multi_aff_list pw_aff::pw_multi_aff_list() const
19237 {
19238   if (!ptr)
19239     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19240   return isl::union_pw_aff(*this).pw_multi_aff_list();
19241 }
19242 
range_factor_domain()19243 isl::pw_multi_aff pw_aff::range_factor_domain() const
19244 {
19245   if (!ptr)
19246     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19247   return isl::pw_multi_aff(*this).range_factor_domain();
19248 }
19249 
range_factor_range()19250 isl::pw_multi_aff pw_aff::range_factor_range() const
19251 {
19252   if (!ptr)
19253     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19254   return isl::pw_multi_aff(*this).range_factor_range();
19255 }
19256 
range_product(const isl::multi_pw_aff & multi2)19257 isl::multi_pw_aff pw_aff::range_product(const isl::multi_pw_aff &multi2) const
19258 {
19259   if (!ptr)
19260     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19261   return isl::pw_multi_aff(*this).range_product(multi2);
19262 }
19263 
range_product(const isl::multi_union_pw_aff & multi2)19264 isl::multi_union_pw_aff pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
19265 {
19266   if (!ptr)
19267     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19268   return isl::union_pw_aff(*this).range_product(multi2);
19269 }
19270 
range_product(const isl::pw_multi_aff & pma2)19271 isl::pw_multi_aff pw_aff::range_product(const isl::pw_multi_aff &pma2) const
19272 {
19273   if (!ptr)
19274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19275   return isl::pw_multi_aff(*this).range_product(pma2);
19276 }
19277 
range_product(const isl::union_pw_multi_aff & upma2)19278 isl::union_pw_multi_aff pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
19279 {
19280   if (!ptr)
19281     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19282   return isl::union_pw_aff(*this).range_product(upma2);
19283 }
19284 
range_tuple_id()19285 isl::id pw_aff::range_tuple_id() const
19286 {
19287   if (!ptr)
19288     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19289   return isl::pw_multi_aff(*this).range_tuple_id();
19290 }
19291 
reset_range_tuple_id()19292 isl::multi_pw_aff pw_aff::reset_range_tuple_id() const
19293 {
19294   if (!ptr)
19295     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19296   return isl::multi_pw_aff(*this).reset_range_tuple_id();
19297 }
19298 
scale(isl::val v)19299 isl::pw_aff pw_aff::scale(isl::val v) const
19300 {
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);
19309 }
19310 
scale(long v)19311 isl::pw_aff pw_aff::scale(long v) const
19312 {
19313   if (!ptr)
19314     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19315   return this->scale(isl::val(ctx(), v));
19316 }
19317 
scale(const isl::multi_val & mv)19318 isl::pw_multi_aff pw_aff::scale(const isl::multi_val &mv) const
19319 {
19320   if (!ptr)
19321     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19322   return isl::pw_multi_aff(*this).scale(mv);
19323 }
19324 
scale_down(isl::val f)19325 isl::pw_aff pw_aff::scale_down(isl::val f) const
19326 {
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);
19335 }
19336 
scale_down(long f)19337 isl::pw_aff pw_aff::scale_down(long f) const
19338 {
19339   if (!ptr)
19340     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19341   return this->scale_down(isl::val(ctx(), f));
19342 }
19343 
scale_down(const isl::multi_val & mv)19344 isl::pw_multi_aff pw_aff::scale_down(const isl::multi_val &mv) const
19345 {
19346   if (!ptr)
19347     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19348   return isl::pw_multi_aff(*this).scale_down(mv);
19349 }
19350 
set_at(int pos,const isl::pw_aff & el)19351 isl::multi_pw_aff pw_aff::set_at(int pos, const isl::pw_aff &el) const
19352 {
19353   if (!ptr)
19354     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19355   return isl::pw_multi_aff(*this).set_at(pos, el);
19356 }
19357 
set_at(int pos,const isl::union_pw_aff & el)19358 isl::multi_union_pw_aff pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
19359 {
19360   if (!ptr)
19361     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19362   return isl::union_pw_aff(*this).set_at(pos, el);
19363 }
19364 
set_range_tuple(const isl::id & id)19365 isl::pw_multi_aff pw_aff::set_range_tuple(const isl::id &id) const
19366 {
19367   if (!ptr)
19368     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19369   return isl::pw_multi_aff(*this).set_range_tuple(id);
19370 }
19371 
set_range_tuple(const std::string & id)19372 isl::pw_multi_aff pw_aff::set_range_tuple(const std::string &id) const
19373 {
19374   if (!ptr)
19375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19376   return this->set_range_tuple(isl::id(ctx(), id));
19377 }
19378 
size()19379 unsigned pw_aff::size() const
19380 {
19381   if (!ptr)
19382     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19383   return isl::multi_pw_aff(*this).size();
19384 }
19385 
space()19386 isl::space pw_aff::space() const
19387 {
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);
19396 }
19397 
get_space()19398 isl::space pw_aff::get_space() const
19399 {
19400   return space();
19401 }
19402 
sub(const isl::multi_pw_aff & multi2)19403 isl::multi_pw_aff pw_aff::sub(const isl::multi_pw_aff &multi2) const
19404 {
19405   if (!ptr)
19406     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19407   return isl::pw_multi_aff(*this).sub(multi2);
19408 }
19409 
sub(const isl::multi_union_pw_aff & multi2)19410 isl::multi_union_pw_aff pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
19411 {
19412   if (!ptr)
19413     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19414   return isl::union_pw_aff(*this).sub(multi2);
19415 }
19416 
sub(isl::pw_aff pwaff2)19417 isl::pw_aff pw_aff::sub(isl::pw_aff pwaff2) const
19418 {
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);
19427 }
19428 
sub(const isl::pw_multi_aff & pma2)19429 isl::pw_multi_aff pw_aff::sub(const isl::pw_multi_aff &pma2) const
19430 {
19431   if (!ptr)
19432     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19433   return isl::pw_multi_aff(*this).sub(pma2);
19434 }
19435 
sub(const isl::union_pw_aff & upa2)19436 isl::union_pw_aff pw_aff::sub(const isl::union_pw_aff &upa2) const
19437 {
19438   if (!ptr)
19439     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19440   return isl::union_pw_aff(*this).sub(upa2);
19441 }
19442 
sub(const isl::union_pw_multi_aff & upma2)19443 isl::union_pw_multi_aff pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
19444 {
19445   if (!ptr)
19446     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19447   return isl::union_pw_aff(*this).sub(upma2);
19448 }
19449 
sub(const isl::aff & pwaff2)19450 isl::pw_aff pw_aff::sub(const isl::aff &pwaff2) const
19451 {
19452   if (!ptr)
19453     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19454   return this->sub(isl::pw_aff(pwaff2));
19455 }
19456 
subtract_domain(isl::set set)19457 isl::pw_aff pw_aff::subtract_domain(isl::set set) const
19458 {
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);
19467 }
19468 
subtract_domain(const isl::space & space)19469 isl::union_pw_aff pw_aff::subtract_domain(const isl::space &space) const
19470 {
19471   if (!ptr)
19472     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19473   return isl::union_pw_aff(*this).subtract_domain(space);
19474 }
19475 
subtract_domain(const isl::union_set & uset)19476 isl::union_pw_aff pw_aff::subtract_domain(const isl::union_set &uset) const
19477 {
19478   if (!ptr)
19479     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19480   return isl::union_pw_aff(*this).subtract_domain(uset);
19481 }
19482 
subtract_domain(const isl::basic_set & set)19483 isl::pw_aff pw_aff::subtract_domain(const isl::basic_set &set) const
19484 {
19485   if (!ptr)
19486     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19487   return this->subtract_domain(isl::set(set));
19488 }
19489 
subtract_domain(const isl::point & set)19490 isl::pw_aff pw_aff::subtract_domain(const isl::point &set) const
19491 {
19492   if (!ptr)
19493     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19494   return this->subtract_domain(isl::set(set));
19495 }
19496 
tdiv_q(isl::pw_aff pa2)19497 isl::pw_aff pw_aff::tdiv_q(isl::pw_aff pa2) const
19498 {
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);
19507 }
19508 
tdiv_r(isl::pw_aff pa2)19509 isl::pw_aff pw_aff::tdiv_r(isl::pw_aff pa2) const
19510 {
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);
19519 }
19520 
to_list()19521 isl::pw_aff_list pw_aff::to_list() const
19522 {
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);
19531 }
19532 
to_multi_pw_aff()19533 isl::multi_pw_aff pw_aff::to_multi_pw_aff() const
19534 {
19535   if (!ptr)
19536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19537   return isl::pw_multi_aff(*this).to_multi_pw_aff();
19538 }
19539 
to_union_pw_aff()19540 isl::union_pw_aff pw_aff::to_union_pw_aff() const
19541 {
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);
19550 }
19551 
to_union_pw_multi_aff()19552 isl::union_pw_multi_aff pw_aff::to_union_pw_multi_aff() const
19553 {
19554   if (!ptr)
19555     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19556   return isl::pw_multi_aff(*this).to_union_pw_multi_aff();
19557 }
19558 
unbind_params_insert_domain(const isl::multi_id & domain)19559 isl::multi_pw_aff pw_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
19560 {
19561   if (!ptr)
19562     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19563   return isl::pw_multi_aff(*this).unbind_params_insert_domain(domain);
19564 }
19565 
union_add(const isl::multi_pw_aff & mpa2)19566 isl::multi_pw_aff pw_aff::union_add(const isl::multi_pw_aff &mpa2) const
19567 {
19568   if (!ptr)
19569     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19570   return isl::pw_multi_aff(*this).union_add(mpa2);
19571 }
19572 
union_add(const isl::multi_union_pw_aff & mupa2)19573 isl::multi_union_pw_aff pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
19574 {
19575   if (!ptr)
19576     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19577   return isl::union_pw_aff(*this).union_add(mupa2);
19578 }
19579 
union_add(isl::pw_aff pwaff2)19580 isl::pw_aff pw_aff::union_add(isl::pw_aff pwaff2) const
19581 {
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);
19590 }
19591 
union_add(const isl::pw_multi_aff & pma2)19592 isl::pw_multi_aff pw_aff::union_add(const isl::pw_multi_aff &pma2) const
19593 {
19594   if (!ptr)
19595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19596   return isl::pw_multi_aff(*this).union_add(pma2);
19597 }
19598 
union_add(const isl::union_pw_aff & upa2)19599 isl::union_pw_aff pw_aff::union_add(const isl::union_pw_aff &upa2) const
19600 {
19601   if (!ptr)
19602     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19603   return isl::union_pw_aff(*this).union_add(upa2);
19604 }
19605 
union_add(const isl::union_pw_multi_aff & upma2)19606 isl::union_pw_multi_aff pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
19607 {
19608   if (!ptr)
19609     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19610   return isl::union_pw_aff(*this).union_add(upma2);
19611 }
19612 
union_add(const isl::aff & pwaff2)19613 isl::pw_aff pw_aff::union_add(const isl::aff &pwaff2) const
19614 {
19615   if (!ptr)
19616     exception::throw_invalid("NULL input", __FILE__, __LINE__);
19617   return this->union_add(isl::pw_aff(pwaff2));
19618 }
19619 
19620 inline std::ostream &operator<<(std::ostream &os, const pw_aff &obj)
19621 {
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;
19632 }
19633 
19634 // implementations for isl::pw_aff_list
manage(__isl_take isl_pw_aff_list * ptr)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);
19639 }
manage_copy(__isl_keep isl_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);
19649 }
19650 
pw_aff_list(__isl_take isl_pw_aff_list * ptr)19651 pw_aff_list::pw_aff_list(__isl_take isl_pw_aff_list *ptr)
19652     : ptr(ptr) {}
19653 
pw_aff_list()19654 pw_aff_list::pw_aff_list()
19655     : ptr(nullptr) {}
19656 
pw_aff_list(const pw_aff_list & obj)19657 pw_aff_list::pw_aff_list(const pw_aff_list &obj)
19658     : ptr(nullptr)
19659 {
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);
19667 }
19668 
pw_aff_list(isl::ctx ctx,int n)19669 pw_aff_list::pw_aff_list(isl::ctx ctx, int n)
19670 {
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;
19677 }
19678 
pw_aff_list(isl::pw_aff el)19679 pw_aff_list::pw_aff_list(isl::pw_aff el)
19680 {
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;
19689 }
19690 
pw_aff_list(isl::ctx ctx,const std::string & str)19691 pw_aff_list::pw_aff_list(isl::ctx ctx, const std::string &str)
19692 {
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;
19699 }
19700 
19701 pw_aff_list &pw_aff_list::operator=(pw_aff_list obj) {
19702   std::swap(this->ptr, obj.ptr);
19703   return *this;
19704 }
19705 
~pw_aff_list()19706 pw_aff_list::~pw_aff_list() {
19707   if (ptr)
19708     isl_pw_aff_list_free(ptr);
19709 }
19710 
copy()19711 __isl_give isl_pw_aff_list *pw_aff_list::copy() const & {
19712   return isl_pw_aff_list_copy(ptr);
19713 }
19714 
get()19715 __isl_keep isl_pw_aff_list *pw_aff_list::get() const {
19716   return ptr;
19717 }
19718 
release()19719 __isl_give isl_pw_aff_list *pw_aff_list::release() {
19720   isl_pw_aff_list *tmp = ptr;
19721   ptr = nullptr;
19722   return tmp;
19723 }
19724 
is_null()19725 bool pw_aff_list::is_null() const {
19726   return ptr == nullptr;
19727 }
19728 
ctx()19729 isl::ctx pw_aff_list::ctx() const {
19730   return isl::ctx(isl_pw_aff_list_get_ctx(ptr));
19731 }
19732 
add(isl::pw_aff el)19733 isl::pw_aff_list pw_aff_list::add(isl::pw_aff el) const
19734 {
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);
19743 }
19744 
at(int index)19745 isl::pw_aff pw_aff_list::at(int index) const
19746 {
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);
19755 }
19756 
get_at(int index)19757 isl::pw_aff pw_aff_list::get_at(int index) const
19758 {
19759   return at(index);
19760 }
19761 
clear()19762 isl::pw_aff_list pw_aff_list::clear() const
19763 {
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);
19772 }
19773 
concat(isl::pw_aff_list list2)19774 isl::pw_aff_list pw_aff_list::concat(isl::pw_aff_list list2) const
19775 {
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);
19784 }
19785 
drop(unsigned int first,unsigned int n)19786 isl::pw_aff_list pw_aff_list::drop(unsigned int first, unsigned int n) const
19787 {
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);
19796 }
19797 
foreach(const std::function<void (isl::pw_aff)> & fn)19798 void pw_aff_list::foreach(const std::function<void(isl::pw_aff)> &fn) const
19799 {
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;
19816     }
19817   };
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;
19824 }
19825 
foreach_scc(const std::function<bool (isl::pw_aff,isl::pw_aff)> & follows,const std::function<void (isl::pw_aff_list)> & fn)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
19827 {
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;
19844     }
19845   };
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;
19858     }
19859   };
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;
19868 }
19869 
insert(unsigned int pos,isl::pw_aff el)19870 isl::pw_aff_list pw_aff_list::insert(unsigned int pos, isl::pw_aff el) const
19871 {
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);
19880 }
19881 
set_at(int index,isl::pw_aff el)19882 isl::pw_aff_list pw_aff_list::set_at(int index, isl::pw_aff el) const
19883 {
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);
19892 }
19893 
size()19894 unsigned pw_aff_list::size() const
19895 {
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;
19904 }
19905 
19906 inline std::ostream &operator<<(std::ostream &os, const pw_aff_list &obj)
19907 {
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;
19918 }
19919 
19920 // implementations for isl::pw_multi_aff
manage(__isl_take isl_pw_multi_aff * ptr)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);
19925 }
manage_copy(__isl_keep isl_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);
19935 }
19936 
pw_multi_aff(__isl_take isl_pw_multi_aff * ptr)19937 pw_multi_aff::pw_multi_aff(__isl_take isl_pw_multi_aff *ptr)
19938     : ptr(ptr) {}
19939 
pw_multi_aff()19940 pw_multi_aff::pw_multi_aff()
19941     : ptr(nullptr) {}
19942 
pw_multi_aff(const pw_multi_aff & obj)19943 pw_multi_aff::pw_multi_aff(const pw_multi_aff &obj)
19944     : ptr(nullptr)
19945 {
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);
19953 }
19954 
pw_multi_aff(isl::multi_aff ma)19955 pw_multi_aff::pw_multi_aff(isl::multi_aff ma)
19956 {
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;
19965 }
19966 
pw_multi_aff(isl::pw_aff pa)19967 pw_multi_aff::pw_multi_aff(isl::pw_aff pa)
19968 {
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;
19977 }
19978 
pw_multi_aff(isl::ctx ctx,const std::string & str)19979 pw_multi_aff::pw_multi_aff(isl::ctx ctx, const std::string &str)
19980 {
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;
19987 }
19988 
19989 pw_multi_aff &pw_multi_aff::operator=(pw_multi_aff obj) {
19990   std::swap(this->ptr, obj.ptr);
19991   return *this;
19992 }
19993 
~pw_multi_aff()19994 pw_multi_aff::~pw_multi_aff() {
19995   if (ptr)
19996     isl_pw_multi_aff_free(ptr);
19997 }
19998 
copy()19999 __isl_give isl_pw_multi_aff *pw_multi_aff::copy() const & {
20000   return isl_pw_multi_aff_copy(ptr);
20001 }
20002 
get()20003 __isl_keep isl_pw_multi_aff *pw_multi_aff::get() const {
20004   return ptr;
20005 }
20006 
release()20007 __isl_give isl_pw_multi_aff *pw_multi_aff::release() {
20008   isl_pw_multi_aff *tmp = ptr;
20009   ptr = nullptr;
20010   return tmp;
20011 }
20012 
is_null()20013 bool pw_multi_aff::is_null() const {
20014   return ptr == nullptr;
20015 }
20016 
ctx()20017 isl::ctx pw_multi_aff::ctx() const {
20018   return isl::ctx(isl_pw_multi_aff_get_ctx(ptr));
20019 }
20020 
add(const isl::multi_pw_aff & multi2)20021 isl::multi_pw_aff pw_multi_aff::add(const isl::multi_pw_aff &multi2) const
20022 {
20023   if (!ptr)
20024     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20025   return isl::multi_pw_aff(*this).add(multi2);
20026 }
20027 
add(const isl::multi_union_pw_aff & multi2)20028 isl::multi_union_pw_aff pw_multi_aff::add(const isl::multi_union_pw_aff &multi2) const
20029 {
20030   if (!ptr)
20031     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20032   return isl::multi_pw_aff(*this).add(multi2);
20033 }
20034 
add(isl::pw_multi_aff pma2)20035 isl::pw_multi_aff pw_multi_aff::add(isl::pw_multi_aff pma2) const
20036 {
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);
20045 }
20046 
add(const isl::union_pw_multi_aff & upma2)20047 isl::union_pw_multi_aff pw_multi_aff::add(const isl::union_pw_multi_aff &upma2) const
20048 {
20049   if (!ptr)
20050     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20051   return isl::union_pw_multi_aff(*this).add(upma2);
20052 }
20053 
add(const isl::multi_aff & pma2)20054 isl::pw_multi_aff pw_multi_aff::add(const isl::multi_aff &pma2) const
20055 {
20056   if (!ptr)
20057     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20058   return this->add(isl::pw_multi_aff(pma2));
20059 }
20060 
add(const isl::pw_aff & pma2)20061 isl::pw_multi_aff pw_multi_aff::add(const isl::pw_aff &pma2) const
20062 {
20063   if (!ptr)
20064     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20065   return this->add(isl::pw_multi_aff(pma2));
20066 }
20067 
add_constant(isl::multi_val mv)20068 isl::pw_multi_aff pw_multi_aff::add_constant(isl::multi_val mv) const
20069 {
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);
20078 }
20079 
add_constant(isl::val v)20080 isl::pw_multi_aff pw_multi_aff::add_constant(isl::val v) const
20081 {
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);
20090 }
20091 
add_constant(long v)20092 isl::pw_multi_aff pw_multi_aff::add_constant(long v) const
20093 {
20094   if (!ptr)
20095     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20096   return this->add_constant(isl::val(ctx(), v));
20097 }
20098 
apply(const isl::union_pw_multi_aff & upma2)20099 isl::union_pw_multi_aff pw_multi_aff::apply(const isl::union_pw_multi_aff &upma2) const
20100 {
20101   if (!ptr)
20102     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20103   return isl::union_pw_multi_aff(*this).apply(upma2);
20104 }
20105 
as_map()20106 isl::map pw_multi_aff::as_map() const
20107 {
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);
20116 }
20117 
as_multi_aff()20118 isl::multi_aff pw_multi_aff::as_multi_aff() const
20119 {
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);
20128 }
20129 
as_multi_union_pw_aff()20130 isl::multi_union_pw_aff pw_multi_aff::as_multi_union_pw_aff() const
20131 {
20132   if (!ptr)
20133     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20134   return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
20135 }
20136 
as_pw_multi_aff()20137 isl::pw_multi_aff pw_multi_aff::as_pw_multi_aff() const
20138 {
20139   if (!ptr)
20140     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20141   return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
20142 }
20143 
as_set()20144 isl::set pw_multi_aff::as_set() const
20145 {
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);
20154 }
20155 
as_union_map()20156 isl::union_map pw_multi_aff::as_union_map() const
20157 {
20158   if (!ptr)
20159     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20160   return isl::union_pw_multi_aff(*this).as_union_map();
20161 }
20162 
at(int pos)20163 isl::pw_aff pw_multi_aff::at(int pos) const
20164 {
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);
20173 }
20174 
get_at(int pos)20175 isl::pw_aff pw_multi_aff::get_at(int pos) const
20176 {
20177   return at(pos);
20178 }
20179 
bind(const isl::multi_id & tuple)20180 isl::set pw_multi_aff::bind(const isl::multi_id &tuple) const
20181 {
20182   if (!ptr)
20183     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20184   return isl::multi_pw_aff(*this).bind(tuple);
20185 }
20186 
bind_domain(isl::multi_id tuple)20187 isl::pw_multi_aff pw_multi_aff::bind_domain(isl::multi_id tuple) const
20188 {
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);
20197 }
20198 
bind_domain_wrapped_domain(isl::multi_id tuple)20199 isl::pw_multi_aff pw_multi_aff::bind_domain_wrapped_domain(isl::multi_id tuple) const
20200 {
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);
20209 }
20210 
coalesce()20211 isl::pw_multi_aff pw_multi_aff::coalesce() const
20212 {
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);
20221 }
20222 
domain()20223 isl::set pw_multi_aff::domain() const
20224 {
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);
20233 }
20234 
domain_map(isl::space space)20235 isl::pw_multi_aff pw_multi_aff::domain_map(isl::space space)
20236 {
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);
20245 }
20246 
domain_reverse()20247 isl::pw_multi_aff pw_multi_aff::domain_reverse() const
20248 {
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);
20257 }
20258 
drop_unused_params()20259 isl::pw_multi_aff pw_multi_aff::drop_unused_params() const
20260 {
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);
20269 }
20270 
extract_pw_multi_aff(const isl::space & space)20271 isl::pw_multi_aff pw_multi_aff::extract_pw_multi_aff(const isl::space &space) const
20272 {
20273   if (!ptr)
20274     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20275   return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
20276 }
20277 
flat_range_product(const isl::multi_pw_aff & multi2)20278 isl::multi_pw_aff pw_multi_aff::flat_range_product(const isl::multi_pw_aff &multi2) const
20279 {
20280   if (!ptr)
20281     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20282   return isl::multi_pw_aff(*this).flat_range_product(multi2);
20283 }
20284 
flat_range_product(const isl::multi_union_pw_aff & multi2)20285 isl::multi_union_pw_aff pw_multi_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
20286 {
20287   if (!ptr)
20288     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20289   return isl::multi_pw_aff(*this).flat_range_product(multi2);
20290 }
20291 
flat_range_product(isl::pw_multi_aff pma2)20292 isl::pw_multi_aff pw_multi_aff::flat_range_product(isl::pw_multi_aff pma2) const
20293 {
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);
20302 }
20303 
flat_range_product(const isl::union_pw_multi_aff & upma2)20304 isl::union_pw_multi_aff pw_multi_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
20305 {
20306   if (!ptr)
20307     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20308   return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
20309 }
20310 
flat_range_product(const isl::multi_aff & pma2)20311 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::multi_aff &pma2) const
20312 {
20313   if (!ptr)
20314     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20315   return this->flat_range_product(isl::pw_multi_aff(pma2));
20316 }
20317 
flat_range_product(const isl::pw_aff & pma2)20318 isl::pw_multi_aff pw_multi_aff::flat_range_product(const isl::pw_aff &pma2) const
20319 {
20320   if (!ptr)
20321     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20322   return this->flat_range_product(isl::pw_multi_aff(pma2));
20323 }
20324 
foreach_piece(const std::function<void (isl::set,isl::multi_aff)> & fn)20325 void pw_multi_aff::foreach_piece(const std::function<void(isl::set, isl::multi_aff)> &fn) const
20326 {
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;
20343     }
20344   };
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;
20351 }
20352 
gist(isl::set set)20353 isl::pw_multi_aff pw_multi_aff::gist(isl::set set) const
20354 {
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);
20363 }
20364 
gist(const isl::union_set & context)20365 isl::union_pw_multi_aff pw_multi_aff::gist(const isl::union_set &context) const
20366 {
20367   if (!ptr)
20368     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20369   return isl::union_pw_multi_aff(*this).gist(context);
20370 }
20371 
gist(const isl::basic_set & set)20372 isl::pw_multi_aff pw_multi_aff::gist(const isl::basic_set &set) const
20373 {
20374   if (!ptr)
20375     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20376   return this->gist(isl::set(set));
20377 }
20378 
gist(const isl::point & set)20379 isl::pw_multi_aff pw_multi_aff::gist(const isl::point &set) const
20380 {
20381   if (!ptr)
20382     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20383   return this->gist(isl::set(set));
20384 }
20385 
gist_params(isl::set set)20386 isl::pw_multi_aff pw_multi_aff::gist_params(isl::set set) const
20387 {
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);
20396 }
20397 
has_range_tuple_id()20398 bool pw_multi_aff::has_range_tuple_id() const
20399 {
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;
20408 }
20409 
identity()20410 isl::multi_pw_aff pw_multi_aff::identity() const
20411 {
20412   if (!ptr)
20413     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20414   return isl::multi_pw_aff(*this).identity();
20415 }
20416 
identity_on_domain(isl::space space)20417 isl::pw_multi_aff pw_multi_aff::identity_on_domain(isl::space space)
20418 {
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);
20427 }
20428 
insert_domain(isl::space domain)20429 isl::pw_multi_aff pw_multi_aff::insert_domain(isl::space domain) const
20430 {
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);
20439 }
20440 
intersect_domain(isl::set set)20441 isl::pw_multi_aff pw_multi_aff::intersect_domain(isl::set set) const
20442 {
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);
20451 }
20452 
intersect_domain(const isl::space & space)20453 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::space &space) const
20454 {
20455   if (!ptr)
20456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20457   return isl::union_pw_multi_aff(*this).intersect_domain(space);
20458 }
20459 
intersect_domain(const isl::union_set & uset)20460 isl::union_pw_multi_aff pw_multi_aff::intersect_domain(const isl::union_set &uset) const
20461 {
20462   if (!ptr)
20463     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20464   return isl::union_pw_multi_aff(*this).intersect_domain(uset);
20465 }
20466 
intersect_domain(const isl::basic_set & set)20467 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::basic_set &set) const
20468 {
20469   if (!ptr)
20470     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20471   return this->intersect_domain(isl::set(set));
20472 }
20473 
intersect_domain(const isl::point & set)20474 isl::pw_multi_aff pw_multi_aff::intersect_domain(const isl::point &set) const
20475 {
20476   if (!ptr)
20477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20478   return this->intersect_domain(isl::set(set));
20479 }
20480 
intersect_domain_wrapped_domain(const isl::union_set & uset)20481 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_domain(const isl::union_set &uset) const
20482 {
20483   if (!ptr)
20484     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20485   return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_domain(uset);
20486 }
20487 
intersect_domain_wrapped_range(const isl::union_set & uset)20488 isl::union_pw_multi_aff pw_multi_aff::intersect_domain_wrapped_range(const isl::union_set &uset) const
20489 {
20490   if (!ptr)
20491     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20492   return isl::union_pw_multi_aff(*this).intersect_domain_wrapped_range(uset);
20493 }
20494 
intersect_params(isl::set set)20495 isl::pw_multi_aff pw_multi_aff::intersect_params(isl::set set) const
20496 {
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);
20505 }
20506 
involves_locals()20507 bool pw_multi_aff::involves_locals() const
20508 {
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;
20517 }
20518 
involves_nan()20519 bool pw_multi_aff::involves_nan() const
20520 {
20521   if (!ptr)
20522     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20523   return isl::multi_pw_aff(*this).involves_nan();
20524 }
20525 
involves_param(const isl::id & id)20526 bool pw_multi_aff::involves_param(const isl::id &id) const
20527 {
20528   if (!ptr)
20529     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20530   return isl::multi_pw_aff(*this).involves_param(id);
20531 }
20532 
involves_param(const std::string & id)20533 bool pw_multi_aff::involves_param(const std::string &id) const
20534 {
20535   if (!ptr)
20536     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20537   return this->involves_param(isl::id(ctx(), id));
20538 }
20539 
involves_param(const isl::id_list & list)20540 bool pw_multi_aff::involves_param(const isl::id_list &list) const
20541 {
20542   if (!ptr)
20543     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20544   return isl::multi_pw_aff(*this).involves_param(list);
20545 }
20546 
isa_multi_aff()20547 bool pw_multi_aff::isa_multi_aff() const
20548 {
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;
20557 }
20558 
isa_pw_multi_aff()20559 bool pw_multi_aff::isa_pw_multi_aff() const
20560 {
20561   if (!ptr)
20562     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20563   return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
20564 }
20565 
list()20566 isl::pw_aff_list pw_multi_aff::list() const
20567 {
20568   if (!ptr)
20569     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20570   return isl::multi_pw_aff(*this).list();
20571 }
20572 
max(const isl::multi_pw_aff & multi2)20573 isl::multi_pw_aff pw_multi_aff::max(const isl::multi_pw_aff &multi2) const
20574 {
20575   if (!ptr)
20576     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20577   return isl::multi_pw_aff(*this).max(multi2);
20578 }
20579 
max_multi_val()20580 isl::multi_val pw_multi_aff::max_multi_val() const
20581 {
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);
20590 }
20591 
min(const isl::multi_pw_aff & multi2)20592 isl::multi_pw_aff pw_multi_aff::min(const isl::multi_pw_aff &multi2) const
20593 {
20594   if (!ptr)
20595     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20596   return isl::multi_pw_aff(*this).min(multi2);
20597 }
20598 
min_multi_val()20599 isl::multi_val pw_multi_aff::min_multi_val() const
20600 {
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);
20609 }
20610 
multi_val_on_domain(isl::set domain,isl::multi_val mv)20611 isl::pw_multi_aff pw_multi_aff::multi_val_on_domain(isl::set domain, isl::multi_val mv)
20612 {
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);
20621 }
20622 
n_piece()20623 unsigned pw_multi_aff::n_piece() const
20624 {
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;
20633 }
20634 
neg()20635 isl::multi_pw_aff pw_multi_aff::neg() const
20636 {
20637   if (!ptr)
20638     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20639   return isl::multi_pw_aff(*this).neg();
20640 }
20641 
plain_is_empty()20642 bool pw_multi_aff::plain_is_empty() const
20643 {
20644   if (!ptr)
20645     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20646   return isl::union_pw_multi_aff(*this).plain_is_empty();
20647 }
20648 
plain_is_equal(const isl::multi_pw_aff & multi2)20649 bool pw_multi_aff::plain_is_equal(const isl::multi_pw_aff &multi2) const
20650 {
20651   if (!ptr)
20652     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20653   return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20654 }
20655 
plain_is_equal(const isl::multi_union_pw_aff & multi2)20656 bool pw_multi_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
20657 {
20658   if (!ptr)
20659     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20660   return isl::multi_pw_aff(*this).plain_is_equal(multi2);
20661 }
20662 
plain_is_equal(const isl::pw_multi_aff & pma2)20663 bool pw_multi_aff::plain_is_equal(const isl::pw_multi_aff &pma2) const
20664 {
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;
20673 }
20674 
plain_is_equal(const isl::union_pw_multi_aff & upma2)20675 bool pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
20676 {
20677   if (!ptr)
20678     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20679   return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
20680 }
20681 
plain_is_equal(const isl::multi_aff & pma2)20682 bool pw_multi_aff::plain_is_equal(const isl::multi_aff &pma2) const
20683 {
20684   if (!ptr)
20685     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20686   return this->plain_is_equal(isl::pw_multi_aff(pma2));
20687 }
20688 
plain_is_equal(const isl::pw_aff & pma2)20689 bool pw_multi_aff::plain_is_equal(const isl::pw_aff &pma2) const
20690 {
20691   if (!ptr)
20692     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20693   return this->plain_is_equal(isl::pw_multi_aff(pma2));
20694 }
20695 
preimage_domain_wrapped_domain(isl::pw_multi_aff pma2)20696 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(isl::pw_multi_aff pma2) const
20697 {
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);
20706 }
20707 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)20708 isl::union_pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
20709 {
20710   if (!ptr)
20711     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20712   return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
20713 }
20714 
preimage_domain_wrapped_domain(const isl::multi_aff & pma2)20715 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::multi_aff &pma2) const
20716 {
20717   if (!ptr)
20718     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20719   return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20720 }
20721 
preimage_domain_wrapped_domain(const isl::pw_aff & pma2)20722 isl::pw_multi_aff pw_multi_aff::preimage_domain_wrapped_domain(const isl::pw_aff &pma2) const
20723 {
20724   if (!ptr)
20725     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20726   return this->preimage_domain_wrapped_domain(isl::pw_multi_aff(pma2));
20727 }
20728 
product(const isl::multi_pw_aff & multi2)20729 isl::multi_pw_aff pw_multi_aff::product(const isl::multi_pw_aff &multi2) const
20730 {
20731   if (!ptr)
20732     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20733   return isl::multi_pw_aff(*this).product(multi2);
20734 }
20735 
product(isl::pw_multi_aff pma2)20736 isl::pw_multi_aff pw_multi_aff::product(isl::pw_multi_aff pma2) const
20737 {
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);
20746 }
20747 
product(const isl::multi_aff & pma2)20748 isl::pw_multi_aff pw_multi_aff::product(const isl::multi_aff &pma2) const
20749 {
20750   if (!ptr)
20751     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20752   return this->product(isl::pw_multi_aff(pma2));
20753 }
20754 
product(const isl::pw_aff & pma2)20755 isl::pw_multi_aff pw_multi_aff::product(const isl::pw_aff &pma2) const
20756 {
20757   if (!ptr)
20758     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20759   return this->product(isl::pw_multi_aff(pma2));
20760 }
20761 
pullback(const isl::multi_pw_aff & mpa2)20762 isl::multi_pw_aff pw_multi_aff::pullback(const isl::multi_pw_aff &mpa2) const
20763 {
20764   if (!ptr)
20765     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20766   return isl::multi_pw_aff(*this).pullback(mpa2);
20767 }
20768 
pullback(isl::multi_aff ma)20769 isl::pw_multi_aff pw_multi_aff::pullback(isl::multi_aff ma) const
20770 {
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);
20779 }
20780 
pullback(isl::pw_multi_aff pma2)20781 isl::pw_multi_aff pw_multi_aff::pullback(isl::pw_multi_aff pma2) const
20782 {
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);
20791 }
20792 
pullback(const isl::union_pw_multi_aff & upma2)20793 isl::union_pw_multi_aff pw_multi_aff::pullback(const isl::union_pw_multi_aff &upma2) const
20794 {
20795   if (!ptr)
20796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20797   return isl::union_pw_multi_aff(*this).pullback(upma2);
20798 }
20799 
pw_multi_aff_list()20800 isl::pw_multi_aff_list pw_multi_aff::pw_multi_aff_list() const
20801 {
20802   if (!ptr)
20803     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20804   return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
20805 }
20806 
range_factor_domain()20807 isl::pw_multi_aff pw_multi_aff::range_factor_domain() const
20808 {
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);
20817 }
20818 
range_factor_range()20819 isl::pw_multi_aff pw_multi_aff::range_factor_range() const
20820 {
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);
20829 }
20830 
range_map(isl::space space)20831 isl::pw_multi_aff pw_multi_aff::range_map(isl::space space)
20832 {
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);
20841 }
20842 
range_product(const isl::multi_pw_aff & multi2)20843 isl::multi_pw_aff pw_multi_aff::range_product(const isl::multi_pw_aff &multi2) const
20844 {
20845   if (!ptr)
20846     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20847   return isl::multi_pw_aff(*this).range_product(multi2);
20848 }
20849 
range_product(const isl::multi_union_pw_aff & multi2)20850 isl::multi_union_pw_aff pw_multi_aff::range_product(const isl::multi_union_pw_aff &multi2) const
20851 {
20852   if (!ptr)
20853     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20854   return isl::multi_pw_aff(*this).range_product(multi2);
20855 }
20856 
range_product(isl::pw_multi_aff pma2)20857 isl::pw_multi_aff pw_multi_aff::range_product(isl::pw_multi_aff pma2) const
20858 {
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);
20867 }
20868 
range_product(const isl::union_pw_multi_aff & upma2)20869 isl::union_pw_multi_aff pw_multi_aff::range_product(const isl::union_pw_multi_aff &upma2) const
20870 {
20871   if (!ptr)
20872     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20873   return isl::union_pw_multi_aff(*this).range_product(upma2);
20874 }
20875 
range_product(const isl::multi_aff & pma2)20876 isl::pw_multi_aff pw_multi_aff::range_product(const isl::multi_aff &pma2) const
20877 {
20878   if (!ptr)
20879     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20880   return this->range_product(isl::pw_multi_aff(pma2));
20881 }
20882 
range_product(const isl::pw_aff & pma2)20883 isl::pw_multi_aff pw_multi_aff::range_product(const isl::pw_aff &pma2) const
20884 {
20885   if (!ptr)
20886     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20887   return this->range_product(isl::pw_multi_aff(pma2));
20888 }
20889 
range_tuple_id()20890 isl::id pw_multi_aff::range_tuple_id() const
20891 {
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);
20900 }
20901 
get_range_tuple_id()20902 isl::id pw_multi_aff::get_range_tuple_id() const
20903 {
20904   return range_tuple_id();
20905 }
20906 
reset_range_tuple_id()20907 isl::multi_pw_aff pw_multi_aff::reset_range_tuple_id() const
20908 {
20909   if (!ptr)
20910     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20911   return isl::multi_pw_aff(*this).reset_range_tuple_id();
20912 }
20913 
scale(isl::multi_val mv)20914 isl::pw_multi_aff pw_multi_aff::scale(isl::multi_val mv) const
20915 {
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);
20924 }
20925 
scale(isl::val v)20926 isl::pw_multi_aff pw_multi_aff::scale(isl::val v) const
20927 {
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);
20936 }
20937 
scale(long v)20938 isl::pw_multi_aff pw_multi_aff::scale(long v) const
20939 {
20940   if (!ptr)
20941     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20942   return this->scale(isl::val(ctx(), v));
20943 }
20944 
scale_down(isl::multi_val mv)20945 isl::pw_multi_aff pw_multi_aff::scale_down(isl::multi_val mv) const
20946 {
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);
20955 }
20956 
scale_down(isl::val v)20957 isl::pw_multi_aff pw_multi_aff::scale_down(isl::val v) const
20958 {
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);
20967 }
20968 
scale_down(long v)20969 isl::pw_multi_aff pw_multi_aff::scale_down(long v) const
20970 {
20971   if (!ptr)
20972     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20973   return this->scale_down(isl::val(ctx(), v));
20974 }
20975 
set_at(int pos,const isl::pw_aff & el)20976 isl::multi_pw_aff pw_multi_aff::set_at(int pos, const isl::pw_aff &el) const
20977 {
20978   if (!ptr)
20979     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20980   return isl::multi_pw_aff(*this).set_at(pos, el);
20981 }
20982 
set_at(int pos,const isl::union_pw_aff & el)20983 isl::multi_union_pw_aff pw_multi_aff::set_at(int pos, const isl::union_pw_aff &el) const
20984 {
20985   if (!ptr)
20986     exception::throw_invalid("NULL input", __FILE__, __LINE__);
20987   return isl::multi_pw_aff(*this).set_at(pos, el);
20988 }
20989 
set_range_tuple(isl::id id)20990 isl::pw_multi_aff pw_multi_aff::set_range_tuple(isl::id id) const
20991 {
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);
21000 }
21001 
set_range_tuple(const std::string & id)21002 isl::pw_multi_aff pw_multi_aff::set_range_tuple(const std::string &id) const
21003 {
21004   if (!ptr)
21005     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21006   return this->set_range_tuple(isl::id(ctx(), id));
21007 }
21008 
size()21009 unsigned pw_multi_aff::size() const
21010 {
21011   if (!ptr)
21012     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21013   return isl::multi_pw_aff(*this).size();
21014 }
21015 
space()21016 isl::space pw_multi_aff::space() const
21017 {
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);
21026 }
21027 
get_space()21028 isl::space pw_multi_aff::get_space() const
21029 {
21030   return space();
21031 }
21032 
sub(const isl::multi_pw_aff & multi2)21033 isl::multi_pw_aff pw_multi_aff::sub(const isl::multi_pw_aff &multi2) const
21034 {
21035   if (!ptr)
21036     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21037   return isl::multi_pw_aff(*this).sub(multi2);
21038 }
21039 
sub(const isl::multi_union_pw_aff & multi2)21040 isl::multi_union_pw_aff pw_multi_aff::sub(const isl::multi_union_pw_aff &multi2) const
21041 {
21042   if (!ptr)
21043     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21044   return isl::multi_pw_aff(*this).sub(multi2);
21045 }
21046 
sub(isl::pw_multi_aff pma2)21047 isl::pw_multi_aff pw_multi_aff::sub(isl::pw_multi_aff pma2) const
21048 {
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);
21057 }
21058 
sub(const isl::union_pw_multi_aff & upma2)21059 isl::union_pw_multi_aff pw_multi_aff::sub(const isl::union_pw_multi_aff &upma2) const
21060 {
21061   if (!ptr)
21062     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21063   return isl::union_pw_multi_aff(*this).sub(upma2);
21064 }
21065 
sub(const isl::multi_aff & pma2)21066 isl::pw_multi_aff pw_multi_aff::sub(const isl::multi_aff &pma2) const
21067 {
21068   if (!ptr)
21069     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21070   return this->sub(isl::pw_multi_aff(pma2));
21071 }
21072 
sub(const isl::pw_aff & pma2)21073 isl::pw_multi_aff pw_multi_aff::sub(const isl::pw_aff &pma2) const
21074 {
21075   if (!ptr)
21076     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21077   return this->sub(isl::pw_multi_aff(pma2));
21078 }
21079 
subtract_domain(isl::set set)21080 isl::pw_multi_aff pw_multi_aff::subtract_domain(isl::set set) const
21081 {
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);
21090 }
21091 
subtract_domain(const isl::space & space)21092 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::space &space) const
21093 {
21094   if (!ptr)
21095     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21096   return isl::union_pw_multi_aff(*this).subtract_domain(space);
21097 }
21098 
subtract_domain(const isl::union_set & uset)21099 isl::union_pw_multi_aff pw_multi_aff::subtract_domain(const isl::union_set &uset) const
21100 {
21101   if (!ptr)
21102     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21103   return isl::union_pw_multi_aff(*this).subtract_domain(uset);
21104 }
21105 
subtract_domain(const isl::basic_set & set)21106 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::basic_set &set) const
21107 {
21108   if (!ptr)
21109     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21110   return this->subtract_domain(isl::set(set));
21111 }
21112 
subtract_domain(const isl::point & set)21113 isl::pw_multi_aff pw_multi_aff::subtract_domain(const isl::point &set) const
21114 {
21115   if (!ptr)
21116     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21117   return this->subtract_domain(isl::set(set));
21118 }
21119 
to_list()21120 isl::pw_multi_aff_list pw_multi_aff::to_list() const
21121 {
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);
21130 }
21131 
to_multi_pw_aff()21132 isl::multi_pw_aff pw_multi_aff::to_multi_pw_aff() const
21133 {
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);
21142 }
21143 
to_union_pw_multi_aff()21144 isl::union_pw_multi_aff pw_multi_aff::to_union_pw_multi_aff() const
21145 {
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);
21154 }
21155 
unbind_params_insert_domain(const isl::multi_id & domain)21156 isl::multi_pw_aff pw_multi_aff::unbind_params_insert_domain(const isl::multi_id &domain) const
21157 {
21158   if (!ptr)
21159     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21160   return isl::multi_pw_aff(*this).unbind_params_insert_domain(domain);
21161 }
21162 
union_add(const isl::multi_pw_aff & mpa2)21163 isl::multi_pw_aff pw_multi_aff::union_add(const isl::multi_pw_aff &mpa2) const
21164 {
21165   if (!ptr)
21166     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21167   return isl::multi_pw_aff(*this).union_add(mpa2);
21168 }
21169 
union_add(const isl::multi_union_pw_aff & mupa2)21170 isl::multi_union_pw_aff pw_multi_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
21171 {
21172   if (!ptr)
21173     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21174   return isl::multi_pw_aff(*this).union_add(mupa2);
21175 }
21176 
union_add(isl::pw_multi_aff pma2)21177 isl::pw_multi_aff pw_multi_aff::union_add(isl::pw_multi_aff pma2) const
21178 {
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);
21187 }
21188 
union_add(const isl::union_pw_multi_aff & upma2)21189 isl::union_pw_multi_aff pw_multi_aff::union_add(const isl::union_pw_multi_aff &upma2) const
21190 {
21191   if (!ptr)
21192     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21193   return isl::union_pw_multi_aff(*this).union_add(upma2);
21194 }
21195 
union_add(const isl::multi_aff & pma2)21196 isl::pw_multi_aff pw_multi_aff::union_add(const isl::multi_aff &pma2) const
21197 {
21198   if (!ptr)
21199     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21200   return this->union_add(isl::pw_multi_aff(pma2));
21201 }
21202 
union_add(const isl::pw_aff & pma2)21203 isl::pw_multi_aff pw_multi_aff::union_add(const isl::pw_aff &pma2) const
21204 {
21205   if (!ptr)
21206     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21207   return this->union_add(isl::pw_multi_aff(pma2));
21208 }
21209 
zero(isl::space space)21210 isl::pw_multi_aff pw_multi_aff::zero(isl::space space)
21211 {
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);
21220 }
21221 
21222 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff &obj)
21223 {
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;
21234 }
21235 
21236 // implementations for isl::pw_multi_aff_list
manage(__isl_take isl_pw_multi_aff_list * ptr)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);
21241 }
manage_copy(__isl_keep isl_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);
21251 }
21252 
pw_multi_aff_list(__isl_take isl_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) {}
21255 
pw_multi_aff_list()21256 pw_multi_aff_list::pw_multi_aff_list()
21257     : ptr(nullptr) {}
21258 
pw_multi_aff_list(const pw_multi_aff_list & obj)21259 pw_multi_aff_list::pw_multi_aff_list(const pw_multi_aff_list &obj)
21260     : ptr(nullptr)
21261 {
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);
21269 }
21270 
pw_multi_aff_list(isl::ctx ctx,int n)21271 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, int n)
21272 {
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;
21279 }
21280 
pw_multi_aff_list(isl::pw_multi_aff el)21281 pw_multi_aff_list::pw_multi_aff_list(isl::pw_multi_aff el)
21282 {
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;
21291 }
21292 
pw_multi_aff_list(isl::ctx ctx,const std::string & str)21293 pw_multi_aff_list::pw_multi_aff_list(isl::ctx ctx, const std::string &str)
21294 {
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;
21301 }
21302 
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;
21306 }
21307 
~pw_multi_aff_list()21308 pw_multi_aff_list::~pw_multi_aff_list() {
21309   if (ptr)
21310     isl_pw_multi_aff_list_free(ptr);
21311 }
21312 
copy()21313 __isl_give isl_pw_multi_aff_list *pw_multi_aff_list::copy() const & {
21314   return isl_pw_multi_aff_list_copy(ptr);
21315 }
21316 
get()21317 __isl_keep isl_pw_multi_aff_list *pw_multi_aff_list::get() const {
21318   return ptr;
21319 }
21320 
release()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;
21325 }
21326 
is_null()21327 bool pw_multi_aff_list::is_null() const {
21328   return ptr == nullptr;
21329 }
21330 
ctx()21331 isl::ctx pw_multi_aff_list::ctx() const {
21332   return isl::ctx(isl_pw_multi_aff_list_get_ctx(ptr));
21333 }
21334 
add(isl::pw_multi_aff el)21335 isl::pw_multi_aff_list pw_multi_aff_list::add(isl::pw_multi_aff el) const
21336 {
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);
21345 }
21346 
at(int index)21347 isl::pw_multi_aff pw_multi_aff_list::at(int index) const
21348 {
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);
21357 }
21358 
get_at(int index)21359 isl::pw_multi_aff pw_multi_aff_list::get_at(int index) const
21360 {
21361   return at(index);
21362 }
21363 
clear()21364 isl::pw_multi_aff_list pw_multi_aff_list::clear() const
21365 {
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);
21374 }
21375 
concat(isl::pw_multi_aff_list list2)21376 isl::pw_multi_aff_list pw_multi_aff_list::concat(isl::pw_multi_aff_list list2) const
21377 {
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);
21386 }
21387 
drop(unsigned int first,unsigned int n)21388 isl::pw_multi_aff_list pw_multi_aff_list::drop(unsigned int first, unsigned int n) const
21389 {
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);
21398 }
21399 
foreach(const std::function<void (isl::pw_multi_aff)> & fn)21400 void pw_multi_aff_list::foreach(const std::function<void(isl::pw_multi_aff)> &fn) const
21401 {
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;
21418     }
21419   };
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;
21426 }
21427 
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)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
21429 {
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;
21446     }
21447   };
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;
21460     }
21461   };
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;
21470 }
21471 
insert(unsigned int pos,isl::pw_multi_aff el)21472 isl::pw_multi_aff_list pw_multi_aff_list::insert(unsigned int pos, isl::pw_multi_aff el) const
21473 {
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);
21482 }
21483 
set_at(int index,isl::pw_multi_aff el)21484 isl::pw_multi_aff_list pw_multi_aff_list::set_at(int index, isl::pw_multi_aff el) const
21485 {
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);
21494 }
21495 
size()21496 unsigned pw_multi_aff_list::size() const
21497 {
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;
21506 }
21507 
21508 inline std::ostream &operator<<(std::ostream &os, const pw_multi_aff_list &obj)
21509 {
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;
21520 }
21521 
21522 // implementations for isl::schedule
manage(__isl_take isl_schedule * ptr)21523 schedule manage(__isl_take isl_schedule *ptr) {
21524   if (!ptr)
21525     exception::throw_invalid("NULL input", __FILE__, __LINE__);
21526   return schedule(ptr);
21527 }
manage_copy(__isl_keep isl_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);
21537 }
21538 
schedule(__isl_take isl_schedule * ptr)21539 schedule::schedule(__isl_take isl_schedule *ptr)
21540     : ptr(ptr) {}
21541 
schedule()21542 schedule::schedule()
21543     : ptr(nullptr) {}
21544 
schedule(const schedule & obj)21545 schedule::schedule(const schedule &obj)
21546     : ptr(nullptr)
21547 {
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);
21555 }
21556 
schedule(isl::ctx ctx,const std::string & str)21557 schedule::schedule(isl::ctx ctx, const std::string &str)
21558 {
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;
21565 }
21566 
21567 schedule &schedule::operator=(schedule obj) {
21568   std::swap(this->ptr, obj.ptr);
21569   return *this;
21570 }
21571 
~schedule()21572 schedule::~schedule() {
21573   if (ptr)
21574     isl_schedule_free(ptr);
21575 }
21576 
copy()21577 __isl_give isl_schedule *schedule::copy() const & {
21578   return isl_schedule_copy(ptr);
21579 }
21580 
get()21581 __isl_keep isl_schedule *schedule::get() const {
21582   return ptr;
21583 }
21584 
release()21585 __isl_give isl_schedule *schedule::release() {
21586   isl_schedule *tmp = ptr;
21587   ptr = nullptr;
21588   return tmp;
21589 }
21590 
is_null()21591 bool schedule::is_null() const {
21592   return ptr == nullptr;
21593 }
21594 
ctx()21595 isl::ctx schedule::ctx() const {
21596   return isl::ctx(isl_schedule_get_ctx(ptr));
21597 }
21598 
domain()21599 isl::union_set schedule::domain() const
21600 {
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);
21609 }
21610 
get_domain()21611 isl::union_set schedule::get_domain() const
21612 {
21613   return domain();
21614 }
21615 
from_domain(isl::union_set domain)21616 isl::schedule schedule::from_domain(isl::union_set domain)
21617 {
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);
21626 }
21627 
map()21628 isl::union_map schedule::map() const
21629 {
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);
21638 }
21639 
get_map()21640 isl::union_map schedule::get_map() const
21641 {
21642   return map();
21643 }
21644 
pullback(isl::union_pw_multi_aff upma)21645 isl::schedule schedule::pullback(isl::union_pw_multi_aff upma) const
21646 {
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);
21655 }
21656 
root()21657 isl::schedule_node schedule::root() const
21658 {
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);
21667 }
21668 
get_root()21669 isl::schedule_node schedule::get_root() const
21670 {
21671   return root();
21672 }
21673 
21674 inline std::ostream &operator<<(std::ostream &os, const schedule &obj)
21675 {
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;
21686 }
21687 
21688 // implementations for isl::schedule_constraints
manage(__isl_take isl_schedule_constraints * ptr)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);
21693 }
manage_copy(__isl_keep isl_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);
21703 }
21704 
schedule_constraints(__isl_take isl_schedule_constraints * ptr)21705 schedule_constraints::schedule_constraints(__isl_take isl_schedule_constraints *ptr)
21706     : ptr(ptr) {}
21707 
schedule_constraints()21708 schedule_constraints::schedule_constraints()
21709     : ptr(nullptr) {}
21710 
schedule_constraints(const schedule_constraints & obj)21711 schedule_constraints::schedule_constraints(const schedule_constraints &obj)
21712     : ptr(nullptr)
21713 {
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);
21721 }
21722 
schedule_constraints(isl::ctx ctx,const std::string & str)21723 schedule_constraints::schedule_constraints(isl::ctx ctx, const std::string &str)
21724 {
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;
21731 }
21732 
21733 schedule_constraints &schedule_constraints::operator=(schedule_constraints obj) {
21734   std::swap(this->ptr, obj.ptr);
21735   return *this;
21736 }
21737 
~schedule_constraints()21738 schedule_constraints::~schedule_constraints() {
21739   if (ptr)
21740     isl_schedule_constraints_free(ptr);
21741 }
21742 
copy()21743 __isl_give isl_schedule_constraints *schedule_constraints::copy() const & {
21744   return isl_schedule_constraints_copy(ptr);
21745 }
21746 
get()21747 __isl_keep isl_schedule_constraints *schedule_constraints::get() const {
21748   return ptr;
21749 }
21750 
release()21751 __isl_give isl_schedule_constraints *schedule_constraints::release() {
21752   isl_schedule_constraints *tmp = ptr;
21753   ptr = nullptr;
21754   return tmp;
21755 }
21756 
is_null()21757 bool schedule_constraints::is_null() const {
21758   return ptr == nullptr;
21759 }
21760 
ctx()21761 isl::ctx schedule_constraints::ctx() const {
21762   return isl::ctx(isl_schedule_constraints_get_ctx(ptr));
21763 }
21764 
coincidence()21765 isl::union_map schedule_constraints::coincidence() const
21766 {
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);
21775 }
21776 
get_coincidence()21777 isl::union_map schedule_constraints::get_coincidence() const
21778 {
21779   return coincidence();
21780 }
21781 
compute_schedule()21782 isl::schedule schedule_constraints::compute_schedule() const
21783 {
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);
21792 }
21793 
conditional_validity()21794 isl::union_map schedule_constraints::conditional_validity() const
21795 {
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);
21804 }
21805 
get_conditional_validity()21806 isl::union_map schedule_constraints::get_conditional_validity() const
21807 {
21808   return conditional_validity();
21809 }
21810 
conditional_validity_condition()21811 isl::union_map schedule_constraints::conditional_validity_condition() const
21812 {
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);
21821 }
21822 
get_conditional_validity_condition()21823 isl::union_map schedule_constraints::get_conditional_validity_condition() const
21824 {
21825   return conditional_validity_condition();
21826 }
21827 
context()21828 isl::set schedule_constraints::context() const
21829 {
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);
21838 }
21839 
get_context()21840 isl::set schedule_constraints::get_context() const
21841 {
21842   return context();
21843 }
21844 
domain()21845 isl::union_set schedule_constraints::domain() const
21846 {
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);
21855 }
21856 
get_domain()21857 isl::union_set schedule_constraints::get_domain() const
21858 {
21859   return domain();
21860 }
21861 
on_domain(isl::union_set domain)21862 isl::schedule_constraints schedule_constraints::on_domain(isl::union_set domain)
21863 {
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);
21872 }
21873 
proximity()21874 isl::union_map schedule_constraints::proximity() const
21875 {
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);
21884 }
21885 
get_proximity()21886 isl::union_map schedule_constraints::get_proximity() const
21887 {
21888   return proximity();
21889 }
21890 
set_coincidence(isl::union_map coincidence)21891 isl::schedule_constraints schedule_constraints::set_coincidence(isl::union_map coincidence) const
21892 {
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);
21901 }
21902 
set_conditional_validity(isl::union_map condition,isl::union_map validity)21903 isl::schedule_constraints schedule_constraints::set_conditional_validity(isl::union_map condition, isl::union_map validity) const
21904 {
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);
21913 }
21914 
set_context(isl::set context)21915 isl::schedule_constraints schedule_constraints::set_context(isl::set context) const
21916 {
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);
21925 }
21926 
set_proximity(isl::union_map proximity)21927 isl::schedule_constraints schedule_constraints::set_proximity(isl::union_map proximity) const
21928 {
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);
21937 }
21938 
set_validity(isl::union_map validity)21939 isl::schedule_constraints schedule_constraints::set_validity(isl::union_map validity) const
21940 {
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);
21949 }
21950 
validity()21951 isl::union_map schedule_constraints::validity() const
21952 {
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);
21961 }
21962 
get_validity()21963 isl::union_map schedule_constraints::get_validity() const
21964 {
21965   return validity();
21966 }
21967 
21968 inline std::ostream &operator<<(std::ostream &os, const schedule_constraints &obj)
21969 {
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;
21980 }
21981 
21982 // implementations for isl::schedule_node
manage(__isl_take isl_schedule_node * ptr)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);
21987 }
manage_copy(__isl_keep isl_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);
21997 }
21998 
schedule_node(__isl_take isl_schedule_node * ptr)21999 schedule_node::schedule_node(__isl_take isl_schedule_node *ptr)
22000     : ptr(ptr) {}
22001 
schedule_node()22002 schedule_node::schedule_node()
22003     : ptr(nullptr) {}
22004 
schedule_node(const schedule_node & obj)22005 schedule_node::schedule_node(const schedule_node &obj)
22006     : ptr(nullptr)
22007 {
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);
22015 }
22016 
22017 schedule_node &schedule_node::operator=(schedule_node obj) {
22018   std::swap(this->ptr, obj.ptr);
22019   return *this;
22020 }
22021 
~schedule_node()22022 schedule_node::~schedule_node() {
22023   if (ptr)
22024     isl_schedule_node_free(ptr);
22025 }
22026 
copy()22027 __isl_give isl_schedule_node *schedule_node::copy() const & {
22028   return isl_schedule_node_copy(ptr);
22029 }
22030 
get()22031 __isl_keep isl_schedule_node *schedule_node::get() const {
22032   return ptr;
22033 }
22034 
release()22035 __isl_give isl_schedule_node *schedule_node::release() {
22036   isl_schedule_node *tmp = ptr;
22037   ptr = nullptr;
22038   return tmp;
22039 }
22040 
is_null()22041 bool schedule_node::is_null() const {
22042   return ptr == nullptr;
22043 }
22044 
22045 template <typename T, typename>
isa_type(T subtype)22046 bool schedule_node::isa_type(T subtype) const
22047 {
22048   if (is_null())
22049     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22050   return isl_schedule_node_get_type(get()) == subtype;
22051 }
22052 template <class T>
isa()22053 bool schedule_node::isa() const
22054 {
22055   return isa_type<decltype(T::type)>(T::type);
22056 }
22057 template <class T>
as()22058 T schedule_node::as() const
22059 {
22060  if (!isa<T>())
22061     exception::throw_invalid("not an object of the requested subtype", __FILE__, __LINE__);
22062   return T(copy());
22063 }
22064 
ctx()22065 isl::ctx schedule_node::ctx() const {
22066   return isl::ctx(isl_schedule_node_get_ctx(ptr));
22067 }
22068 
ancestor(int generation)22069 isl::schedule_node schedule_node::ancestor(int generation) const
22070 {
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);
22079 }
22080 
ancestor_child_position(const isl::schedule_node & ancestor)22081 unsigned schedule_node::ancestor_child_position(const isl::schedule_node &ancestor) const
22082 {
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;
22091 }
22092 
get_ancestor_child_position(const isl::schedule_node & ancestor)22093 unsigned schedule_node::get_ancestor_child_position(const isl::schedule_node &ancestor) const
22094 {
22095   return ancestor_child_position(ancestor);
22096 }
22097 
child(int pos)22098 isl::schedule_node schedule_node::child(int pos) const
22099 {
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);
22108 }
22109 
child_position()22110 unsigned schedule_node::child_position() const
22111 {
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;
22120 }
22121 
get_child_position()22122 unsigned schedule_node::get_child_position() const
22123 {
22124   return child_position();
22125 }
22126 
every_descendant(const std::function<bool (isl::schedule_node)> & test)22127 bool schedule_node::every_descendant(const std::function<bool(isl::schedule_node)> &test) const
22128 {
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;
22145     }
22146   };
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;
22153 }
22154 
first_child()22155 isl::schedule_node schedule_node::first_child() const
22156 {
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);
22165 }
22166 
foreach_ancestor_top_down(const std::function<void (isl::schedule_node)> & fn)22167 void schedule_node::foreach_ancestor_top_down(const std::function<void(isl::schedule_node)> &fn) const
22168 {
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;
22185     }
22186   };
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;
22193 }
22194 
foreach_descendant_top_down(const std::function<bool (isl::schedule_node)> & fn)22195 void schedule_node::foreach_descendant_top_down(const std::function<bool(isl::schedule_node)> &fn) const
22196 {
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;
22213     }
22214   };
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;
22221 }
22222 
from_domain(isl::union_set domain)22223 isl::schedule_node schedule_node::from_domain(isl::union_set domain)
22224 {
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);
22233 }
22234 
from_extension(isl::union_map extension)22235 isl::schedule_node schedule_node::from_extension(isl::union_map extension)
22236 {
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);
22245 }
22246 
graft_after(isl::schedule_node graft)22247 isl::schedule_node schedule_node::graft_after(isl::schedule_node graft) const
22248 {
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);
22257 }
22258 
graft_before(isl::schedule_node graft)22259 isl::schedule_node schedule_node::graft_before(isl::schedule_node graft) const
22260 {
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);
22269 }
22270 
has_children()22271 bool schedule_node::has_children() const
22272 {
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;
22281 }
22282 
has_next_sibling()22283 bool schedule_node::has_next_sibling() const
22284 {
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;
22293 }
22294 
has_parent()22295 bool schedule_node::has_parent() const
22296 {
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;
22305 }
22306 
has_previous_sibling()22307 bool schedule_node::has_previous_sibling() const
22308 {
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;
22317 }
22318 
insert_context(isl::set context)22319 isl::schedule_node schedule_node::insert_context(isl::set context) const
22320 {
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);
22329 }
22330 
insert_filter(isl::union_set filter)22331 isl::schedule_node schedule_node::insert_filter(isl::union_set filter) const
22332 {
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);
22341 }
22342 
insert_guard(isl::set context)22343 isl::schedule_node schedule_node::insert_guard(isl::set context) const
22344 {
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);
22353 }
22354 
insert_mark(isl::id mark)22355 isl::schedule_node schedule_node::insert_mark(isl::id mark) const
22356 {
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);
22365 }
22366 
insert_mark(const std::string & mark)22367 isl::schedule_node schedule_node::insert_mark(const std::string &mark) const
22368 {
22369   if (!ptr)
22370     exception::throw_invalid("NULL input", __FILE__, __LINE__);
22371   return this->insert_mark(isl::id(ctx(), mark));
22372 }
22373 
insert_partial_schedule(isl::multi_union_pw_aff schedule)22374 isl::schedule_node schedule_node::insert_partial_schedule(isl::multi_union_pw_aff schedule) const
22375 {
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);
22384 }
22385 
insert_sequence(isl::union_set_list filters)22386 isl::schedule_node schedule_node::insert_sequence(isl::union_set_list filters) const
22387 {
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);
22396 }
22397 
insert_set(isl::union_set_list filters)22398 isl::schedule_node schedule_node::insert_set(isl::union_set_list filters) const
22399 {
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);
22408 }
22409 
is_equal(const isl::schedule_node & node2)22410 bool schedule_node::is_equal(const isl::schedule_node &node2) const
22411 {
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;
22420 }
22421 
is_subtree_anchored()22422 bool schedule_node::is_subtree_anchored() const
22423 {
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;
22432 }
22433 
map_descendant_bottom_up(const std::function<isl::schedule_node (isl::schedule_node)> & fn)22434 isl::schedule_node schedule_node::map_descendant_bottom_up(const std::function<isl::schedule_node(isl::schedule_node)> &fn) const
22435 {
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;
22452     }
22453   };
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);
22460 }
22461 
n_children()22462 unsigned schedule_node::n_children() const
22463 {
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;
22472 }
22473 
next_sibling()22474 isl::schedule_node schedule_node::next_sibling() const
22475 {
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);
22484 }
22485 
order_after(isl::union_set filter)22486 isl::schedule_node schedule_node::order_after(isl::union_set filter) const
22487 {
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);
22496 }
22497 
order_before(isl::union_set filter)22498 isl::schedule_node schedule_node::order_before(isl::union_set filter) const
22499 {
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);
22508 }
22509 
parent()22510 isl::schedule_node schedule_node::parent() const
22511 {
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);
22520 }
22521 
prefix_schedule_multi_union_pw_aff()22522 isl::multi_union_pw_aff schedule_node::prefix_schedule_multi_union_pw_aff() const
22523 {
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);
22532 }
22533 
get_prefix_schedule_multi_union_pw_aff()22534 isl::multi_union_pw_aff schedule_node::get_prefix_schedule_multi_union_pw_aff() const
22535 {
22536   return prefix_schedule_multi_union_pw_aff();
22537 }
22538 
prefix_schedule_union_map()22539 isl::union_map schedule_node::prefix_schedule_union_map() const
22540 {
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);
22549 }
22550 
get_prefix_schedule_union_map()22551 isl::union_map schedule_node::get_prefix_schedule_union_map() const
22552 {
22553   return prefix_schedule_union_map();
22554 }
22555 
prefix_schedule_union_pw_multi_aff()22556 isl::union_pw_multi_aff schedule_node::prefix_schedule_union_pw_multi_aff() const
22557 {
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);
22566 }
22567 
get_prefix_schedule_union_pw_multi_aff()22568 isl::union_pw_multi_aff schedule_node::get_prefix_schedule_union_pw_multi_aff() const
22569 {
22570   return prefix_schedule_union_pw_multi_aff();
22571 }
22572 
previous_sibling()22573 isl::schedule_node schedule_node::previous_sibling() const
22574 {
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);
22583 }
22584 
root()22585 isl::schedule_node schedule_node::root() const
22586 {
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);
22595 }
22596 
schedule()22597 isl::schedule schedule_node::schedule() const
22598 {
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);
22607 }
22608 
get_schedule()22609 isl::schedule schedule_node::get_schedule() const
22610 {
22611   return schedule();
22612 }
22613 
shared_ancestor(const isl::schedule_node & node2)22614 isl::schedule_node schedule_node::shared_ancestor(const isl::schedule_node &node2) const
22615 {
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);
22624 }
22625 
get_shared_ancestor(const isl::schedule_node & node2)22626 isl::schedule_node schedule_node::get_shared_ancestor(const isl::schedule_node &node2) const
22627 {
22628   return shared_ancestor(node2);
22629 }
22630 
tree_depth()22631 unsigned schedule_node::tree_depth() const
22632 {
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;
22641 }
22642 
get_tree_depth()22643 unsigned schedule_node::get_tree_depth() const
22644 {
22645   return tree_depth();
22646 }
22647 
22648 inline std::ostream &operator<<(std::ostream &os, const schedule_node &obj)
22649 {
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;
22660 }
22661 
22662 // implementations for isl::schedule_node_band
schedule_node_band(__isl_take isl_schedule_node * ptr)22663 schedule_node_band::schedule_node_band(__isl_take isl_schedule_node *ptr)
22664     : schedule_node(ptr) {}
22665 
schedule_node_band()22666 schedule_node_band::schedule_node_band()
22667     : schedule_node() {}
22668 
schedule_node_band(const schedule_node_band & obj)22669 schedule_node_band::schedule_node_band(const schedule_node_band &obj)
22670     : schedule_node(obj)
22671 {
22672 }
22673 
22674 schedule_node_band &schedule_node_band::operator=(schedule_node_band obj) {
22675   std::swap(this->ptr, obj.ptr);
22676   return *this;
22677 }
22678 
ctx()22679 isl::ctx schedule_node_band::ctx() const {
22680   return isl::ctx(isl_schedule_node_get_ctx(ptr));
22681 }
22682 
ast_build_options()22683 isl::union_set schedule_node_band::ast_build_options() const
22684 {
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);
22693 }
22694 
get_ast_build_options()22695 isl::union_set schedule_node_band::get_ast_build_options() const
22696 {
22697   return ast_build_options();
22698 }
22699 
ast_isolate_option()22700 isl::set schedule_node_band::ast_isolate_option() const
22701 {
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);
22710 }
22711 
get_ast_isolate_option()22712 isl::set schedule_node_band::get_ast_isolate_option() const
22713 {
22714   return ast_isolate_option();
22715 }
22716 
member_get_coincident(int pos)22717 bool schedule_node_band::member_get_coincident(int pos) const
22718 {
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;
22727 }
22728 
member_set_coincident(int pos,int coincident)22729 schedule_node_band schedule_node_band::member_set_coincident(int pos, int coincident) const
22730 {
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>();
22739 }
22740 
mod(isl::multi_val mv)22741 schedule_node_band schedule_node_band::mod(isl::multi_val mv) const
22742 {
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>();
22751 }
22752 
n_member()22753 unsigned schedule_node_band::n_member() const
22754 {
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;
22763 }
22764 
partial_schedule()22765 isl::multi_union_pw_aff schedule_node_band::partial_schedule() const
22766 {
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);
22775 }
22776 
get_partial_schedule()22777 isl::multi_union_pw_aff schedule_node_band::get_partial_schedule() const
22778 {
22779   return partial_schedule();
22780 }
22781 
permutable()22782 bool schedule_node_band::permutable() const
22783 {
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;
22792 }
22793 
get_permutable()22794 bool schedule_node_band::get_permutable() const
22795 {
22796   return permutable();
22797 }
22798 
scale(isl::multi_val mv)22799 schedule_node_band schedule_node_band::scale(isl::multi_val mv) const
22800 {
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>();
22809 }
22810 
scale_down(isl::multi_val mv)22811 schedule_node_band schedule_node_band::scale_down(isl::multi_val mv) const
22812 {
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>();
22821 }
22822 
set_ast_build_options(isl::union_set options)22823 schedule_node_band schedule_node_band::set_ast_build_options(isl::union_set options) const
22824 {
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>();
22833 }
22834 
set_permutable(int permutable)22835 schedule_node_band schedule_node_band::set_permutable(int permutable) const
22836 {
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>();
22845 }
22846 
shift(isl::multi_union_pw_aff shift)22847 schedule_node_band schedule_node_band::shift(isl::multi_union_pw_aff shift) const
22848 {
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>();
22857 }
22858 
split(int pos)22859 schedule_node_band schedule_node_band::split(int pos) const
22860 {
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>();
22869 }
22870 
tile(isl::multi_val sizes)22871 schedule_node_band schedule_node_band::tile(isl::multi_val sizes) const
22872 {
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>();
22881 }
22882 
member_set_ast_loop_default(int pos)22883 schedule_node_band schedule_node_band::member_set_ast_loop_default(int pos) const
22884 {
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>();
22893 }
22894 
member_set_ast_loop_atomic(int pos)22895 schedule_node_band schedule_node_band::member_set_ast_loop_atomic(int pos) const
22896 {
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>();
22905 }
22906 
member_set_ast_loop_unroll(int pos)22907 schedule_node_band schedule_node_band::member_set_ast_loop_unroll(int pos) const
22908 {
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>();
22917 }
22918 
member_set_ast_loop_separate(int pos)22919 schedule_node_band schedule_node_band::member_set_ast_loop_separate(int pos) const
22920 {
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>();
22929 }
22930 
22931 inline std::ostream &operator<<(std::ostream &os, const schedule_node_band &obj)
22932 {
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;
22943 }
22944 
22945 // implementations for isl::schedule_node_context
schedule_node_context(__isl_take isl_schedule_node * ptr)22946 schedule_node_context::schedule_node_context(__isl_take isl_schedule_node *ptr)
22947     : schedule_node(ptr) {}
22948 
schedule_node_context()22949 schedule_node_context::schedule_node_context()
22950     : schedule_node() {}
22951 
schedule_node_context(const schedule_node_context & obj)22952 schedule_node_context::schedule_node_context(const schedule_node_context &obj)
22953     : schedule_node(obj)
22954 {
22955 }
22956 
22957 schedule_node_context &schedule_node_context::operator=(schedule_node_context obj) {
22958   std::swap(this->ptr, obj.ptr);
22959   return *this;
22960 }
22961 
ctx()22962 isl::ctx schedule_node_context::ctx() const {
22963   return isl::ctx(isl_schedule_node_get_ctx(ptr));
22964 }
22965 
context()22966 isl::set schedule_node_context::context() const
22967 {
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);
22976 }
22977 
get_context()22978 isl::set schedule_node_context::get_context() const
22979 {
22980   return context();
22981 }
22982 
22983 inline std::ostream &operator<<(std::ostream &os, const schedule_node_context &obj)
22984 {
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;
22995 }
22996 
22997 // implementations for isl::schedule_node_domain
schedule_node_domain(__isl_take isl_schedule_node * ptr)22998 schedule_node_domain::schedule_node_domain(__isl_take isl_schedule_node *ptr)
22999     : schedule_node(ptr) {}
23000 
schedule_node_domain()23001 schedule_node_domain::schedule_node_domain()
23002     : schedule_node() {}
23003 
schedule_node_domain(const schedule_node_domain & obj)23004 schedule_node_domain::schedule_node_domain(const schedule_node_domain &obj)
23005     : schedule_node(obj)
23006 {
23007 }
23008 
23009 schedule_node_domain &schedule_node_domain::operator=(schedule_node_domain obj) {
23010   std::swap(this->ptr, obj.ptr);
23011   return *this;
23012 }
23013 
ctx()23014 isl::ctx schedule_node_domain::ctx() const {
23015   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23016 }
23017 
domain()23018 isl::union_set schedule_node_domain::domain() const
23019 {
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);
23028 }
23029 
get_domain()23030 isl::union_set schedule_node_domain::get_domain() const
23031 {
23032   return domain();
23033 }
23034 
23035 inline std::ostream &operator<<(std::ostream &os, const schedule_node_domain &obj)
23036 {
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;
23047 }
23048 
23049 // implementations for isl::schedule_node_expansion
schedule_node_expansion(__isl_take isl_schedule_node * ptr)23050 schedule_node_expansion::schedule_node_expansion(__isl_take isl_schedule_node *ptr)
23051     : schedule_node(ptr) {}
23052 
schedule_node_expansion()23053 schedule_node_expansion::schedule_node_expansion()
23054     : schedule_node() {}
23055 
schedule_node_expansion(const schedule_node_expansion & obj)23056 schedule_node_expansion::schedule_node_expansion(const schedule_node_expansion &obj)
23057     : schedule_node(obj)
23058 {
23059 }
23060 
23061 schedule_node_expansion &schedule_node_expansion::operator=(schedule_node_expansion obj) {
23062   std::swap(this->ptr, obj.ptr);
23063   return *this;
23064 }
23065 
ctx()23066 isl::ctx schedule_node_expansion::ctx() const {
23067   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23068 }
23069 
contraction()23070 isl::union_pw_multi_aff schedule_node_expansion::contraction() const
23071 {
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);
23080 }
23081 
get_contraction()23082 isl::union_pw_multi_aff schedule_node_expansion::get_contraction() const
23083 {
23084   return contraction();
23085 }
23086 
expansion()23087 isl::union_map schedule_node_expansion::expansion() const
23088 {
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);
23097 }
23098 
get_expansion()23099 isl::union_map schedule_node_expansion::get_expansion() const
23100 {
23101   return expansion();
23102 }
23103 
23104 inline std::ostream &operator<<(std::ostream &os, const schedule_node_expansion &obj)
23105 {
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;
23116 }
23117 
23118 // implementations for isl::schedule_node_extension
schedule_node_extension(__isl_take isl_schedule_node * ptr)23119 schedule_node_extension::schedule_node_extension(__isl_take isl_schedule_node *ptr)
23120     : schedule_node(ptr) {}
23121 
schedule_node_extension()23122 schedule_node_extension::schedule_node_extension()
23123     : schedule_node() {}
23124 
schedule_node_extension(const schedule_node_extension & obj)23125 schedule_node_extension::schedule_node_extension(const schedule_node_extension &obj)
23126     : schedule_node(obj)
23127 {
23128 }
23129 
23130 schedule_node_extension &schedule_node_extension::operator=(schedule_node_extension obj) {
23131   std::swap(this->ptr, obj.ptr);
23132   return *this;
23133 }
23134 
ctx()23135 isl::ctx schedule_node_extension::ctx() const {
23136   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23137 }
23138 
extension()23139 isl::union_map schedule_node_extension::extension() const
23140 {
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);
23149 }
23150 
get_extension()23151 isl::union_map schedule_node_extension::get_extension() const
23152 {
23153   return extension();
23154 }
23155 
23156 inline std::ostream &operator<<(std::ostream &os, const schedule_node_extension &obj)
23157 {
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;
23168 }
23169 
23170 // implementations for isl::schedule_node_filter
schedule_node_filter(__isl_take isl_schedule_node * ptr)23171 schedule_node_filter::schedule_node_filter(__isl_take isl_schedule_node *ptr)
23172     : schedule_node(ptr) {}
23173 
schedule_node_filter()23174 schedule_node_filter::schedule_node_filter()
23175     : schedule_node() {}
23176 
schedule_node_filter(const schedule_node_filter & obj)23177 schedule_node_filter::schedule_node_filter(const schedule_node_filter &obj)
23178     : schedule_node(obj)
23179 {
23180 }
23181 
23182 schedule_node_filter &schedule_node_filter::operator=(schedule_node_filter obj) {
23183   std::swap(this->ptr, obj.ptr);
23184   return *this;
23185 }
23186 
ctx()23187 isl::ctx schedule_node_filter::ctx() const {
23188   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23189 }
23190 
filter()23191 isl::union_set schedule_node_filter::filter() const
23192 {
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);
23201 }
23202 
get_filter()23203 isl::union_set schedule_node_filter::get_filter() const
23204 {
23205   return filter();
23206 }
23207 
23208 inline std::ostream &operator<<(std::ostream &os, const schedule_node_filter &obj)
23209 {
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;
23220 }
23221 
23222 // implementations for isl::schedule_node_guard
schedule_node_guard(__isl_take isl_schedule_node * ptr)23223 schedule_node_guard::schedule_node_guard(__isl_take isl_schedule_node *ptr)
23224     : schedule_node(ptr) {}
23225 
schedule_node_guard()23226 schedule_node_guard::schedule_node_guard()
23227     : schedule_node() {}
23228 
schedule_node_guard(const schedule_node_guard & obj)23229 schedule_node_guard::schedule_node_guard(const schedule_node_guard &obj)
23230     : schedule_node(obj)
23231 {
23232 }
23233 
23234 schedule_node_guard &schedule_node_guard::operator=(schedule_node_guard obj) {
23235   std::swap(this->ptr, obj.ptr);
23236   return *this;
23237 }
23238 
ctx()23239 isl::ctx schedule_node_guard::ctx() const {
23240   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23241 }
23242 
guard()23243 isl::set schedule_node_guard::guard() const
23244 {
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);
23253 }
23254 
get_guard()23255 isl::set schedule_node_guard::get_guard() const
23256 {
23257   return guard();
23258 }
23259 
23260 inline std::ostream &operator<<(std::ostream &os, const schedule_node_guard &obj)
23261 {
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;
23272 }
23273 
23274 // implementations for isl::schedule_node_leaf
schedule_node_leaf(__isl_take isl_schedule_node * ptr)23275 schedule_node_leaf::schedule_node_leaf(__isl_take isl_schedule_node *ptr)
23276     : schedule_node(ptr) {}
23277 
schedule_node_leaf()23278 schedule_node_leaf::schedule_node_leaf()
23279     : schedule_node() {}
23280 
schedule_node_leaf(const schedule_node_leaf & obj)23281 schedule_node_leaf::schedule_node_leaf(const schedule_node_leaf &obj)
23282     : schedule_node(obj)
23283 {
23284 }
23285 
23286 schedule_node_leaf &schedule_node_leaf::operator=(schedule_node_leaf obj) {
23287   std::swap(this->ptr, obj.ptr);
23288   return *this;
23289 }
23290 
ctx()23291 isl::ctx schedule_node_leaf::ctx() const {
23292   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23293 }
23294 
23295 inline std::ostream &operator<<(std::ostream &os, const schedule_node_leaf &obj)
23296 {
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;
23307 }
23308 
23309 // implementations for isl::schedule_node_mark
schedule_node_mark(__isl_take isl_schedule_node * ptr)23310 schedule_node_mark::schedule_node_mark(__isl_take isl_schedule_node *ptr)
23311     : schedule_node(ptr) {}
23312 
schedule_node_mark()23313 schedule_node_mark::schedule_node_mark()
23314     : schedule_node() {}
23315 
schedule_node_mark(const schedule_node_mark & obj)23316 schedule_node_mark::schedule_node_mark(const schedule_node_mark &obj)
23317     : schedule_node(obj)
23318 {
23319 }
23320 
23321 schedule_node_mark &schedule_node_mark::operator=(schedule_node_mark obj) {
23322   std::swap(this->ptr, obj.ptr);
23323   return *this;
23324 }
23325 
ctx()23326 isl::ctx schedule_node_mark::ctx() const {
23327   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23328 }
23329 
23330 inline std::ostream &operator<<(std::ostream &os, const schedule_node_mark &obj)
23331 {
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;
23342 }
23343 
23344 // implementations for isl::schedule_node_sequence
schedule_node_sequence(__isl_take isl_schedule_node * ptr)23345 schedule_node_sequence::schedule_node_sequence(__isl_take isl_schedule_node *ptr)
23346     : schedule_node(ptr) {}
23347 
schedule_node_sequence()23348 schedule_node_sequence::schedule_node_sequence()
23349     : schedule_node() {}
23350 
schedule_node_sequence(const schedule_node_sequence & obj)23351 schedule_node_sequence::schedule_node_sequence(const schedule_node_sequence &obj)
23352     : schedule_node(obj)
23353 {
23354 }
23355 
23356 schedule_node_sequence &schedule_node_sequence::operator=(schedule_node_sequence obj) {
23357   std::swap(this->ptr, obj.ptr);
23358   return *this;
23359 }
23360 
ctx()23361 isl::ctx schedule_node_sequence::ctx() const {
23362   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23363 }
23364 
23365 inline std::ostream &operator<<(std::ostream &os, const schedule_node_sequence &obj)
23366 {
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;
23377 }
23378 
23379 // implementations for isl::schedule_node_set
schedule_node_set(__isl_take isl_schedule_node * ptr)23380 schedule_node_set::schedule_node_set(__isl_take isl_schedule_node *ptr)
23381     : schedule_node(ptr) {}
23382 
schedule_node_set()23383 schedule_node_set::schedule_node_set()
23384     : schedule_node() {}
23385 
schedule_node_set(const schedule_node_set & obj)23386 schedule_node_set::schedule_node_set(const schedule_node_set &obj)
23387     : schedule_node(obj)
23388 {
23389 }
23390 
23391 schedule_node_set &schedule_node_set::operator=(schedule_node_set obj) {
23392   std::swap(this->ptr, obj.ptr);
23393   return *this;
23394 }
23395 
ctx()23396 isl::ctx schedule_node_set::ctx() const {
23397   return isl::ctx(isl_schedule_node_get_ctx(ptr));
23398 }
23399 
23400 inline std::ostream &operator<<(std::ostream &os, const schedule_node_set &obj)
23401 {
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;
23412 }
23413 
23414 // implementations for isl::set
manage(__isl_take isl_set * ptr)23415 set manage(__isl_take isl_set *ptr) {
23416   if (!ptr)
23417     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23418   return set(ptr);
23419 }
manage_copy(__isl_keep isl_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);
23429 }
23430 
set(__isl_take isl_set * ptr)23431 set::set(__isl_take isl_set *ptr)
23432     : ptr(ptr) {}
23433 
set()23434 set::set()
23435     : ptr(nullptr) {}
23436 
set(const set & obj)23437 set::set(const set &obj)
23438     : ptr(nullptr)
23439 {
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);
23447 }
23448 
set(isl::basic_set bset)23449 set::set(isl::basic_set bset)
23450 {
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;
23459 }
23460 
set(isl::point pnt)23461 set::set(isl::point pnt)
23462 {
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;
23471 }
23472 
set(isl::ctx ctx,const std::string & str)23473 set::set(isl::ctx ctx, const std::string &str)
23474 {
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;
23481 }
23482 
23483 set &set::operator=(set obj) {
23484   std::swap(this->ptr, obj.ptr);
23485   return *this;
23486 }
23487 
~set()23488 set::~set() {
23489   if (ptr)
23490     isl_set_free(ptr);
23491 }
23492 
copy()23493 __isl_give isl_set *set::copy() const & {
23494   return isl_set_copy(ptr);
23495 }
23496 
get()23497 __isl_keep isl_set *set::get() const {
23498   return ptr;
23499 }
23500 
release()23501 __isl_give isl_set *set::release() {
23502   isl_set *tmp = ptr;
23503   ptr = nullptr;
23504   return tmp;
23505 }
23506 
is_null()23507 bool set::is_null() const {
23508   return ptr == nullptr;
23509 }
23510 
ctx()23511 isl::ctx set::ctx() const {
23512   return isl::ctx(isl_set_get_ctx(ptr));
23513 }
23514 
affine_hull()23515 isl::basic_set set::affine_hull() const
23516 {
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);
23525 }
23526 
apply(isl::map map)23527 isl::set set::apply(isl::map map) const
23528 {
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);
23537 }
23538 
apply(const isl::union_map & umap)23539 isl::union_set set::apply(const isl::union_map &umap) const
23540 {
23541   if (!ptr)
23542     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23543   return isl::union_set(*this).apply(umap);
23544 }
23545 
apply(const isl::basic_map & map)23546 isl::set set::apply(const isl::basic_map &map) const
23547 {
23548   if (!ptr)
23549     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23550   return this->apply(isl::map(map));
23551 }
23552 
as_pw_multi_aff()23553 isl::pw_multi_aff set::as_pw_multi_aff() const
23554 {
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);
23563 }
23564 
as_set()23565 isl::set set::as_set() const
23566 {
23567   if (!ptr)
23568     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23569   return isl::union_set(*this).as_set();
23570 }
23571 
bind(isl::multi_id tuple)23572 isl::set set::bind(isl::multi_id tuple) const
23573 {
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);
23582 }
23583 
coalesce()23584 isl::set set::coalesce() const
23585 {
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);
23594 }
23595 
complement()23596 isl::set set::complement() const
23597 {
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);
23606 }
23607 
compute_divs()23608 isl::union_set set::compute_divs() const
23609 {
23610   if (!ptr)
23611     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23612   return isl::union_set(*this).compute_divs();
23613 }
23614 
detect_equalities()23615 isl::set set::detect_equalities() const
23616 {
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);
23625 }
23626 
dim_max_val(int pos)23627 isl::val set::dim_max_val(int pos) const
23628 {
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);
23637 }
23638 
dim_min_val(int pos)23639 isl::val set::dim_min_val(int pos) const
23640 {
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);
23649 }
23650 
drop_unused_params()23651 isl::set set::drop_unused_params() const
23652 {
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);
23661 }
23662 
empty(isl::space space)23663 isl::set set::empty(isl::space space)
23664 {
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);
23673 }
23674 
every_set(const std::function<bool (isl::set)> & test)23675 bool set::every_set(const std::function<bool(isl::set)> &test) const
23676 {
23677   if (!ptr)
23678     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23679   return isl::union_set(*this).every_set(test);
23680 }
23681 
extract_set(const isl::space & space)23682 isl::set set::extract_set(const isl::space &space) const
23683 {
23684   if (!ptr)
23685     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23686   return isl::union_set(*this).extract_set(space);
23687 }
23688 
flatten()23689 isl::set set::flatten() const
23690 {
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);
23699 }
23700 
foreach_basic_set(const std::function<void (isl::basic_set)> & fn)23701 void set::foreach_basic_set(const std::function<void(isl::basic_set)> &fn) const
23702 {
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;
23719     }
23720   };
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;
23727 }
23728 
foreach_point(const std::function<void (isl::point)> & fn)23729 void set::foreach_point(const std::function<void(isl::point)> &fn) const
23730 {
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;
23747     }
23748   };
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;
23755 }
23756 
foreach_set(const std::function<void (isl::set)> & fn)23757 void set::foreach_set(const std::function<void(isl::set)> &fn) const
23758 {
23759   if (!ptr)
23760     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23761   return isl::union_set(*this).foreach_set(fn);
23762 }
23763 
gist(isl::set context)23764 isl::set set::gist(isl::set context) const
23765 {
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);
23774 }
23775 
gist(const isl::union_set & context)23776 isl::union_set set::gist(const isl::union_set &context) const
23777 {
23778   if (!ptr)
23779     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23780   return isl::union_set(*this).gist(context);
23781 }
23782 
gist(const isl::basic_set & context)23783 isl::set set::gist(const isl::basic_set &context) const
23784 {
23785   if (!ptr)
23786     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23787   return this->gist(isl::set(context));
23788 }
23789 
gist(const isl::point & context)23790 isl::set set::gist(const isl::point &context) const
23791 {
23792   if (!ptr)
23793     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23794   return this->gist(isl::set(context));
23795 }
23796 
gist_params(isl::set context)23797 isl::set set::gist_params(isl::set context) const
23798 {
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);
23807 }
23808 
identity()23809 isl::map set::identity() const
23810 {
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);
23819 }
23820 
indicator_function()23821 isl::pw_aff set::indicator_function() const
23822 {
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);
23831 }
23832 
insert_domain(isl::space domain)23833 isl::map set::insert_domain(isl::space domain) const
23834 {
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);
23843 }
23844 
intersect(isl::set set2)23845 isl::set set::intersect(isl::set set2) const
23846 {
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);
23855 }
23856 
intersect(const isl::union_set & uset2)23857 isl::union_set set::intersect(const isl::union_set &uset2) const
23858 {
23859   if (!ptr)
23860     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23861   return isl::union_set(*this).intersect(uset2);
23862 }
23863 
intersect(const isl::basic_set & set2)23864 isl::set set::intersect(const isl::basic_set &set2) const
23865 {
23866   if (!ptr)
23867     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23868   return this->intersect(isl::set(set2));
23869 }
23870 
intersect(const isl::point & set2)23871 isl::set set::intersect(const isl::point &set2) const
23872 {
23873   if (!ptr)
23874     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23875   return this->intersect(isl::set(set2));
23876 }
23877 
intersect_params(isl::set params)23878 isl::set set::intersect_params(isl::set params) const
23879 {
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);
23888 }
23889 
involves_locals()23890 bool set::involves_locals() const
23891 {
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;
23900 }
23901 
is_disjoint(const isl::set & set2)23902 bool set::is_disjoint(const isl::set &set2) const
23903 {
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;
23912 }
23913 
is_disjoint(const isl::union_set & uset2)23914 bool set::is_disjoint(const isl::union_set &uset2) const
23915 {
23916   if (!ptr)
23917     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23918   return isl::union_set(*this).is_disjoint(uset2);
23919 }
23920 
is_disjoint(const isl::basic_set & set2)23921 bool set::is_disjoint(const isl::basic_set &set2) const
23922 {
23923   if (!ptr)
23924     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23925   return this->is_disjoint(isl::set(set2));
23926 }
23927 
is_disjoint(const isl::point & set2)23928 bool set::is_disjoint(const isl::point &set2) const
23929 {
23930   if (!ptr)
23931     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23932   return this->is_disjoint(isl::set(set2));
23933 }
23934 
is_empty()23935 bool set::is_empty() const
23936 {
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;
23945 }
23946 
is_equal(const isl::set & set2)23947 bool set::is_equal(const isl::set &set2) const
23948 {
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;
23957 }
23958 
is_equal(const isl::union_set & uset2)23959 bool set::is_equal(const isl::union_set &uset2) const
23960 {
23961   if (!ptr)
23962     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23963   return isl::union_set(*this).is_equal(uset2);
23964 }
23965 
is_equal(const isl::basic_set & set2)23966 bool set::is_equal(const isl::basic_set &set2) const
23967 {
23968   if (!ptr)
23969     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23970   return this->is_equal(isl::set(set2));
23971 }
23972 
is_equal(const isl::point & set2)23973 bool set::is_equal(const isl::point &set2) const
23974 {
23975   if (!ptr)
23976     exception::throw_invalid("NULL input", __FILE__, __LINE__);
23977   return this->is_equal(isl::set(set2));
23978 }
23979 
is_singleton()23980 bool set::is_singleton() const
23981 {
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;
23990 }
23991 
is_strict_subset(const isl::set & set2)23992 bool set::is_strict_subset(const isl::set &set2) const
23993 {
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;
24002 }
24003 
is_strict_subset(const isl::union_set & uset2)24004 bool set::is_strict_subset(const isl::union_set &uset2) const
24005 {
24006   if (!ptr)
24007     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24008   return isl::union_set(*this).is_strict_subset(uset2);
24009 }
24010 
is_strict_subset(const isl::basic_set & set2)24011 bool set::is_strict_subset(const isl::basic_set &set2) const
24012 {
24013   if (!ptr)
24014     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24015   return this->is_strict_subset(isl::set(set2));
24016 }
24017 
is_strict_subset(const isl::point & set2)24018 bool set::is_strict_subset(const isl::point &set2) const
24019 {
24020   if (!ptr)
24021     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24022   return this->is_strict_subset(isl::set(set2));
24023 }
24024 
is_subset(const isl::set & set2)24025 bool set::is_subset(const isl::set &set2) const
24026 {
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;
24035 }
24036 
is_subset(const isl::union_set & uset2)24037 bool set::is_subset(const isl::union_set &uset2) const
24038 {
24039   if (!ptr)
24040     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24041   return isl::union_set(*this).is_subset(uset2);
24042 }
24043 
is_subset(const isl::basic_set & set2)24044 bool set::is_subset(const isl::basic_set &set2) const
24045 {
24046   if (!ptr)
24047     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24048   return this->is_subset(isl::set(set2));
24049 }
24050 
is_subset(const isl::point & set2)24051 bool set::is_subset(const isl::point &set2) const
24052 {
24053   if (!ptr)
24054     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24055   return this->is_subset(isl::set(set2));
24056 }
24057 
is_wrapping()24058 bool set::is_wrapping() const
24059 {
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;
24068 }
24069 
isa_set()24070 bool set::isa_set() const
24071 {
24072   if (!ptr)
24073     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24074   return isl::union_set(*this).isa_set();
24075 }
24076 
lattice_tile()24077 isl::fixed_box set::lattice_tile() const
24078 {
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);
24087 }
24088 
get_lattice_tile()24089 isl::fixed_box set::get_lattice_tile() const
24090 {
24091   return lattice_tile();
24092 }
24093 
lexmax()24094 isl::set set::lexmax() const
24095 {
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);
24104 }
24105 
lexmax_pw_multi_aff()24106 isl::pw_multi_aff set::lexmax_pw_multi_aff() const
24107 {
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);
24116 }
24117 
lexmin()24118 isl::set set::lexmin() const
24119 {
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);
24128 }
24129 
lexmin_pw_multi_aff()24130 isl::pw_multi_aff set::lexmin_pw_multi_aff() const
24131 {
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);
24140 }
24141 
lower_bound(isl::multi_pw_aff lower)24142 isl::set set::lower_bound(isl::multi_pw_aff lower) const
24143 {
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);
24152 }
24153 
lower_bound(isl::multi_val lower)24154 isl::set set::lower_bound(isl::multi_val lower) const
24155 {
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);
24164 }
24165 
max_multi_pw_aff()24166 isl::multi_pw_aff set::max_multi_pw_aff() const
24167 {
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);
24176 }
24177 
max_val(const isl::aff & obj)24178 isl::val set::max_val(const isl::aff &obj) const
24179 {
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);
24188 }
24189 
min_multi_pw_aff()24190 isl::multi_pw_aff set::min_multi_pw_aff() const
24191 {
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);
24200 }
24201 
min_val(const isl::aff & obj)24202 isl::val set::min_val(const isl::aff &obj) const
24203 {
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);
24212 }
24213 
n_basic_set()24214 unsigned set::n_basic_set() const
24215 {
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;
24224 }
24225 
param_pw_aff_on_domain(isl::id id)24226 isl::pw_aff set::param_pw_aff_on_domain(isl::id id) const
24227 {
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);
24236 }
24237 
param_pw_aff_on_domain(const std::string & id)24238 isl::pw_aff set::param_pw_aff_on_domain(const std::string &id) const
24239 {
24240   if (!ptr)
24241     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24242   return this->param_pw_aff_on_domain(isl::id(ctx(), id));
24243 }
24244 
params()24245 isl::set set::params() const
24246 {
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);
24255 }
24256 
plain_multi_val_if_fixed()24257 isl::multi_val set::plain_multi_val_if_fixed() const
24258 {
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);
24267 }
24268 
get_plain_multi_val_if_fixed()24269 isl::multi_val set::get_plain_multi_val_if_fixed() const
24270 {
24271   return plain_multi_val_if_fixed();
24272 }
24273 
polyhedral_hull()24274 isl::basic_set set::polyhedral_hull() const
24275 {
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);
24284 }
24285 
preimage(isl::multi_aff ma)24286 isl::set set::preimage(isl::multi_aff ma) const
24287 {
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);
24296 }
24297 
preimage(isl::multi_pw_aff mpa)24298 isl::set set::preimage(isl::multi_pw_aff mpa) const
24299 {
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);
24308 }
24309 
preimage(isl::pw_multi_aff pma)24310 isl::set set::preimage(isl::pw_multi_aff pma) const
24311 {
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);
24320 }
24321 
preimage(const isl::union_pw_multi_aff & upma)24322 isl::union_set set::preimage(const isl::union_pw_multi_aff &upma) const
24323 {
24324   if (!ptr)
24325     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24326   return isl::union_set(*this).preimage(upma);
24327 }
24328 
product(isl::set set2)24329 isl::set set::product(isl::set set2) const
24330 {
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);
24339 }
24340 
project_out_all_params()24341 isl::set set::project_out_all_params() const
24342 {
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);
24351 }
24352 
project_out_param(isl::id id)24353 isl::set set::project_out_param(isl::id id) const
24354 {
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);
24363 }
24364 
project_out_param(const std::string & id)24365 isl::set set::project_out_param(const std::string &id) const
24366 {
24367   if (!ptr)
24368     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24369   return this->project_out_param(isl::id(ctx(), id));
24370 }
24371 
project_out_param(isl::id_list list)24372 isl::set set::project_out_param(isl::id_list list) const
24373 {
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);
24382 }
24383 
pw_aff_on_domain(isl::val v)24384 isl::pw_aff set::pw_aff_on_domain(isl::val v) const
24385 {
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);
24394 }
24395 
pw_aff_on_domain(long v)24396 isl::pw_aff set::pw_aff_on_domain(long v) const
24397 {
24398   if (!ptr)
24399     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24400   return this->pw_aff_on_domain(isl::val(ctx(), v));
24401 }
24402 
pw_multi_aff_on_domain(isl::multi_val mv)24403 isl::pw_multi_aff set::pw_multi_aff_on_domain(isl::multi_val mv) const
24404 {
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);
24413 }
24414 
sample()24415 isl::basic_set set::sample() const
24416 {
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);
24425 }
24426 
sample_point()24427 isl::point set::sample_point() const
24428 {
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);
24437 }
24438 
set_list()24439 isl::set_list set::set_list() const
24440 {
24441   if (!ptr)
24442     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24443   return isl::union_set(*this).set_list();
24444 }
24445 
simple_fixed_box_hull()24446 isl::fixed_box set::simple_fixed_box_hull() const
24447 {
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);
24456 }
24457 
get_simple_fixed_box_hull()24458 isl::fixed_box set::get_simple_fixed_box_hull() const
24459 {
24460   return simple_fixed_box_hull();
24461 }
24462 
space()24463 isl::space set::space() const
24464 {
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);
24473 }
24474 
get_space()24475 isl::space set::get_space() const
24476 {
24477   return space();
24478 }
24479 
stride(int pos)24480 isl::val set::stride(int pos) const
24481 {
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);
24490 }
24491 
get_stride(int pos)24492 isl::val set::get_stride(int pos) const
24493 {
24494   return stride(pos);
24495 }
24496 
subtract(isl::set set2)24497 isl::set set::subtract(isl::set set2) const
24498 {
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);
24507 }
24508 
subtract(const isl::union_set & uset2)24509 isl::union_set set::subtract(const isl::union_set &uset2) const
24510 {
24511   if (!ptr)
24512     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24513   return isl::union_set(*this).subtract(uset2);
24514 }
24515 
subtract(const isl::basic_set & set2)24516 isl::set set::subtract(const isl::basic_set &set2) const
24517 {
24518   if (!ptr)
24519     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24520   return this->subtract(isl::set(set2));
24521 }
24522 
subtract(const isl::point & set2)24523 isl::set set::subtract(const isl::point &set2) const
24524 {
24525   if (!ptr)
24526     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24527   return this->subtract(isl::set(set2));
24528 }
24529 
to_list()24530 isl::set_list set::to_list() const
24531 {
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);
24540 }
24541 
to_union_set()24542 isl::union_set set::to_union_set() const
24543 {
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);
24552 }
24553 
translation()24554 isl::map set::translation() const
24555 {
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);
24564 }
24565 
tuple_dim()24566 unsigned set::tuple_dim() const
24567 {
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;
24576 }
24577 
unbind_params(isl::multi_id tuple)24578 isl::set set::unbind_params(isl::multi_id tuple) const
24579 {
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);
24588 }
24589 
unbind_params_insert_domain(isl::multi_id domain)24590 isl::map set::unbind_params_insert_domain(isl::multi_id domain) const
24591 {
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);
24600 }
24601 
unite(isl::set set2)24602 isl::set set::unite(isl::set set2) const
24603 {
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);
24612 }
24613 
unite(const isl::union_set & uset2)24614 isl::union_set set::unite(const isl::union_set &uset2) const
24615 {
24616   if (!ptr)
24617     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24618   return isl::union_set(*this).unite(uset2);
24619 }
24620 
unite(const isl::basic_set & set2)24621 isl::set set::unite(const isl::basic_set &set2) const
24622 {
24623   if (!ptr)
24624     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24625   return this->unite(isl::set(set2));
24626 }
24627 
unite(const isl::point & set2)24628 isl::set set::unite(const isl::point &set2) const
24629 {
24630   if (!ptr)
24631     exception::throw_invalid("NULL input", __FILE__, __LINE__);
24632   return this->unite(isl::set(set2));
24633 }
24634 
universe(isl::space space)24635 isl::set set::universe(isl::space space)
24636 {
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);
24645 }
24646 
unshifted_simple_hull()24647 isl::basic_set set::unshifted_simple_hull() const
24648 {
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);
24657 }
24658 
unwrap()24659 isl::map set::unwrap() const
24660 {
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);
24669 }
24670 
upper_bound(isl::multi_pw_aff upper)24671 isl::set set::upper_bound(isl::multi_pw_aff upper) const
24672 {
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);
24681 }
24682 
upper_bound(isl::multi_val upper)24683 isl::set set::upper_bound(isl::multi_val upper) const
24684 {
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);
24693 }
24694 
wrapped_reverse()24695 isl::set set::wrapped_reverse() const
24696 {
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);
24705 }
24706 
24707 inline std::ostream &operator<<(std::ostream &os, const set &obj)
24708 {
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;
24719 }
24720 
24721 // implementations for isl::set_list
manage(__isl_take isl_set_list * ptr)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);
24726 }
manage_copy(__isl_keep isl_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);
24736 }
24737 
set_list(__isl_take isl_set_list * ptr)24738 set_list::set_list(__isl_take isl_set_list *ptr)
24739     : ptr(ptr) {}
24740 
set_list()24741 set_list::set_list()
24742     : ptr(nullptr) {}
24743 
set_list(const set_list & obj)24744 set_list::set_list(const set_list &obj)
24745     : ptr(nullptr)
24746 {
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);
24754 }
24755 
set_list(isl::ctx ctx,int n)24756 set_list::set_list(isl::ctx ctx, int n)
24757 {
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;
24764 }
24765 
set_list(isl::set el)24766 set_list::set_list(isl::set el)
24767 {
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;
24776 }
24777 
set_list(isl::ctx ctx,const std::string & str)24778 set_list::set_list(isl::ctx ctx, const std::string &str)
24779 {
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;
24786 }
24787 
24788 set_list &set_list::operator=(set_list obj) {
24789   std::swap(this->ptr, obj.ptr);
24790   return *this;
24791 }
24792 
~set_list()24793 set_list::~set_list() {
24794   if (ptr)
24795     isl_set_list_free(ptr);
24796 }
24797 
copy()24798 __isl_give isl_set_list *set_list::copy() const & {
24799   return isl_set_list_copy(ptr);
24800 }
24801 
get()24802 __isl_keep isl_set_list *set_list::get() const {
24803   return ptr;
24804 }
24805 
release()24806 __isl_give isl_set_list *set_list::release() {
24807   isl_set_list *tmp = ptr;
24808   ptr = nullptr;
24809   return tmp;
24810 }
24811 
is_null()24812 bool set_list::is_null() const {
24813   return ptr == nullptr;
24814 }
24815 
ctx()24816 isl::ctx set_list::ctx() const {
24817   return isl::ctx(isl_set_list_get_ctx(ptr));
24818 }
24819 
add(isl::set el)24820 isl::set_list set_list::add(isl::set el) const
24821 {
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);
24830 }
24831 
at(int index)24832 isl::set set_list::at(int index) const
24833 {
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);
24842 }
24843 
get_at(int index)24844 isl::set set_list::get_at(int index) const
24845 {
24846   return at(index);
24847 }
24848 
clear()24849 isl::set_list set_list::clear() const
24850 {
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);
24859 }
24860 
concat(isl::set_list list2)24861 isl::set_list set_list::concat(isl::set_list list2) const
24862 {
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);
24871 }
24872 
drop(unsigned int first,unsigned int n)24873 isl::set_list set_list::drop(unsigned int first, unsigned int n) const
24874 {
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);
24883 }
24884 
foreach(const std::function<void (isl::set)> & fn)24885 void set_list::foreach(const std::function<void(isl::set)> &fn) const
24886 {
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;
24903     }
24904   };
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;
24911 }
24912 
foreach_scc(const std::function<bool (isl::set,isl::set)> & follows,const std::function<void (isl::set_list)> & fn)24913 void set_list::foreach_scc(const std::function<bool(isl::set, isl::set)> &follows, const std::function<void(isl::set_list)> &fn) const
24914 {
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;
24931     }
24932   };
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;
24945     }
24946   };
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;
24955 }
24956 
insert(unsigned int pos,isl::set el)24957 isl::set_list set_list::insert(unsigned int pos, isl::set el) const
24958 {
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);
24967 }
24968 
set_at(int index,isl::set el)24969 isl::set_list set_list::set_at(int index, isl::set el) const
24970 {
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);
24979 }
24980 
size()24981 unsigned set_list::size() const
24982 {
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;
24991 }
24992 
24993 inline std::ostream &operator<<(std::ostream &os, const set_list &obj)
24994 {
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;
25005 }
25006 
25007 // implementations for isl::space
manage(__isl_take isl_space * ptr)25008 space manage(__isl_take isl_space *ptr) {
25009   if (!ptr)
25010     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25011   return space(ptr);
25012 }
manage_copy(__isl_keep isl_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);
25022 }
25023 
space(__isl_take isl_space * ptr)25024 space::space(__isl_take isl_space *ptr)
25025     : ptr(ptr) {}
25026 
space()25027 space::space()
25028     : ptr(nullptr) {}
25029 
space(const space & obj)25030 space::space(const space &obj)
25031     : ptr(nullptr)
25032 {
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);
25040 }
25041 
space(isl::ctx ctx,const std::string & str)25042 space::space(isl::ctx ctx, const std::string &str)
25043 {
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;
25050 }
25051 
25052 space &space::operator=(space obj) {
25053   std::swap(this->ptr, obj.ptr);
25054   return *this;
25055 }
25056 
~space()25057 space::~space() {
25058   if (ptr)
25059     isl_space_free(ptr);
25060 }
25061 
copy()25062 __isl_give isl_space *space::copy() const & {
25063   return isl_space_copy(ptr);
25064 }
25065 
get()25066 __isl_keep isl_space *space::get() const {
25067   return ptr;
25068 }
25069 
release()25070 __isl_give isl_space *space::release() {
25071   isl_space *tmp = ptr;
25072   ptr = nullptr;
25073   return tmp;
25074 }
25075 
is_null()25076 bool space::is_null() const {
25077   return ptr == nullptr;
25078 }
25079 
ctx()25080 isl::ctx space::ctx() const {
25081   return isl::ctx(isl_space_get_ctx(ptr));
25082 }
25083 
add_named_tuple(isl::id tuple_id,unsigned int dim)25084 isl::space space::add_named_tuple(isl::id tuple_id, unsigned int dim) const
25085 {
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);
25094 }
25095 
add_named_tuple(const std::string & tuple_id,unsigned int dim)25096 isl::space space::add_named_tuple(const std::string &tuple_id, unsigned int dim) const
25097 {
25098   if (!ptr)
25099     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25100   return this->add_named_tuple(isl::id(ctx(), tuple_id), dim);
25101 }
25102 
add_param(isl::id id)25103 isl::space space::add_param(isl::id id) const
25104 {
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);
25113 }
25114 
add_param(const std::string & id)25115 isl::space space::add_param(const std::string &id) const
25116 {
25117   if (!ptr)
25118     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25119   return this->add_param(isl::id(ctx(), id));
25120 }
25121 
add_unnamed_tuple(unsigned int dim)25122 isl::space space::add_unnamed_tuple(unsigned int dim) const
25123 {
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);
25132 }
25133 
curry()25134 isl::space space::curry() const
25135 {
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);
25144 }
25145 
domain()25146 isl::space space::domain() const
25147 {
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);
25156 }
25157 
domain_map_multi_aff()25158 isl::multi_aff space::domain_map_multi_aff() const
25159 {
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);
25168 }
25169 
domain_map_pw_multi_aff()25170 isl::pw_multi_aff space::domain_map_pw_multi_aff() const
25171 {
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);
25180 }
25181 
domain_reverse()25182 isl::space space::domain_reverse() const
25183 {
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);
25192 }
25193 
domain_tuple_id()25194 isl::id space::domain_tuple_id() const
25195 {
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);
25204 }
25205 
get_domain_tuple_id()25206 isl::id space::get_domain_tuple_id() const
25207 {
25208   return domain_tuple_id();
25209 }
25210 
drop_all_params()25211 isl::space space::drop_all_params() const
25212 {
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);
25221 }
25222 
flatten_domain()25223 isl::space space::flatten_domain() const
25224 {
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);
25233 }
25234 
flatten_range()25235 isl::space space::flatten_range() const
25236 {
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);
25245 }
25246 
has_domain_tuple_id()25247 bool space::has_domain_tuple_id() const
25248 {
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;
25257 }
25258 
has_range_tuple_id()25259 bool space::has_range_tuple_id() const
25260 {
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;
25269 }
25270 
identity_multi_aff_on_domain()25271 isl::multi_aff space::identity_multi_aff_on_domain() const
25272 {
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);
25281 }
25282 
identity_multi_pw_aff_on_domain()25283 isl::multi_pw_aff space::identity_multi_pw_aff_on_domain() const
25284 {
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);
25293 }
25294 
identity_pw_multi_aff_on_domain()25295 isl::pw_multi_aff space::identity_pw_multi_aff_on_domain() const
25296 {
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);
25305 }
25306 
is_equal(const isl::space & space2)25307 bool space::is_equal(const isl::space &space2) const
25308 {
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;
25317 }
25318 
is_wrapping()25319 bool space::is_wrapping() const
25320 {
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;
25329 }
25330 
map_from_set()25331 isl::space space::map_from_set() const
25332 {
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);
25341 }
25342 
multi_aff(isl::aff_list list)25343 isl::multi_aff space::multi_aff(isl::aff_list list) const
25344 {
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);
25353 }
25354 
multi_aff_on_domain(isl::multi_val mv)25355 isl::multi_aff space::multi_aff_on_domain(isl::multi_val mv) const
25356 {
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);
25365 }
25366 
multi_id(isl::id_list list)25367 isl::multi_id space::multi_id(isl::id_list list) const
25368 {
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);
25377 }
25378 
multi_pw_aff(isl::pw_aff_list list)25379 isl::multi_pw_aff space::multi_pw_aff(isl::pw_aff_list list) const
25380 {
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);
25389 }
25390 
multi_union_pw_aff(isl::union_pw_aff_list list)25391 isl::multi_union_pw_aff space::multi_union_pw_aff(isl::union_pw_aff_list list) const
25392 {
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);
25401 }
25402 
multi_val(isl::val_list list)25403 isl::multi_val space::multi_val(isl::val_list list) const
25404 {
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);
25413 }
25414 
param_aff_on_domain(isl::id id)25415 isl::aff space::param_aff_on_domain(isl::id id) const
25416 {
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);
25425 }
25426 
param_aff_on_domain(const std::string & id)25427 isl::aff space::param_aff_on_domain(const std::string &id) const
25428 {
25429   if (!ptr)
25430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25431   return this->param_aff_on_domain(isl::id(ctx(), id));
25432 }
25433 
params()25434 isl::space space::params() const
25435 {
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);
25444 }
25445 
product(isl::space right)25446 isl::space space::product(isl::space right) const
25447 {
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);
25456 }
25457 
range()25458 isl::space space::range() const
25459 {
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);
25468 }
25469 
range_map_multi_aff()25470 isl::multi_aff space::range_map_multi_aff() const
25471 {
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);
25480 }
25481 
range_map_pw_multi_aff()25482 isl::pw_multi_aff space::range_map_pw_multi_aff() const
25483 {
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);
25492 }
25493 
range_reverse()25494 isl::space space::range_reverse() const
25495 {
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);
25504 }
25505 
range_tuple_id()25506 isl::id space::range_tuple_id() const
25507 {
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);
25516 }
25517 
get_range_tuple_id()25518 isl::id space::get_range_tuple_id() const
25519 {
25520   return range_tuple_id();
25521 }
25522 
reverse()25523 isl::space space::reverse() const
25524 {
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);
25533 }
25534 
set_domain_tuple(isl::id id)25535 isl::space space::set_domain_tuple(isl::id id) const
25536 {
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);
25545 }
25546 
set_domain_tuple(const std::string & id)25547 isl::space space::set_domain_tuple(const std::string &id) const
25548 {
25549   if (!ptr)
25550     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25551   return this->set_domain_tuple(isl::id(ctx(), id));
25552 }
25553 
set_range_tuple(isl::id id)25554 isl::space space::set_range_tuple(isl::id id) const
25555 {
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);
25564 }
25565 
set_range_tuple(const std::string & id)25566 isl::space space::set_range_tuple(const std::string &id) const
25567 {
25568   if (!ptr)
25569     exception::throw_invalid("NULL input", __FILE__, __LINE__);
25570   return this->set_range_tuple(isl::id(ctx(), id));
25571 }
25572 
uncurry()25573 isl::space space::uncurry() const
25574 {
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);
25583 }
25584 
unit(isl::ctx ctx)25585 isl::space space::unit(isl::ctx ctx)
25586 {
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);
25593 }
25594 
universe_map()25595 isl::map space::universe_map() const
25596 {
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);
25605 }
25606 
universe_set()25607 isl::set space::universe_set() const
25608 {
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);
25617 }
25618 
unwrap()25619 isl::space space::unwrap() const
25620 {
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);
25629 }
25630 
wrap()25631 isl::space space::wrap() const
25632 {
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);
25641 }
25642 
wrapped_reverse()25643 isl::space space::wrapped_reverse() const
25644 {
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);
25653 }
25654 
zero_aff_on_domain()25655 isl::aff space::zero_aff_on_domain() const
25656 {
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);
25665 }
25666 
zero_multi_aff()25667 isl::multi_aff space::zero_multi_aff() const
25668 {
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);
25677 }
25678 
zero_multi_pw_aff()25679 isl::multi_pw_aff space::zero_multi_pw_aff() const
25680 {
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);
25689 }
25690 
zero_multi_union_pw_aff()25691 isl::multi_union_pw_aff space::zero_multi_union_pw_aff() const
25692 {
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);
25701 }
25702 
zero_multi_val()25703 isl::multi_val space::zero_multi_val() const
25704 {
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);
25713 }
25714 
25715 inline std::ostream &operator<<(std::ostream &os, const space &obj)
25716 {
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;
25727 }
25728 
25729 // implementations for isl::union_access_info
manage(__isl_take isl_union_access_info * ptr)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);
25734 }
manage_copy(__isl_keep isl_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);
25744 }
25745 
union_access_info(__isl_take isl_union_access_info * ptr)25746 union_access_info::union_access_info(__isl_take isl_union_access_info *ptr)
25747     : ptr(ptr) {}
25748 
union_access_info()25749 union_access_info::union_access_info()
25750     : ptr(nullptr) {}
25751 
union_access_info(const union_access_info & obj)25752 union_access_info::union_access_info(const union_access_info &obj)
25753     : ptr(nullptr)
25754 {
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);
25762 }
25763 
union_access_info(isl::union_map sink)25764 union_access_info::union_access_info(isl::union_map sink)
25765 {
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;
25774 }
25775 
25776 union_access_info &union_access_info::operator=(union_access_info obj) {
25777   std::swap(this->ptr, obj.ptr);
25778   return *this;
25779 }
25780 
~union_access_info()25781 union_access_info::~union_access_info() {
25782   if (ptr)
25783     isl_union_access_info_free(ptr);
25784 }
25785 
copy()25786 __isl_give isl_union_access_info *union_access_info::copy() const & {
25787   return isl_union_access_info_copy(ptr);
25788 }
25789 
get()25790 __isl_keep isl_union_access_info *union_access_info::get() const {
25791   return ptr;
25792 }
25793 
release()25794 __isl_give isl_union_access_info *union_access_info::release() {
25795   isl_union_access_info *tmp = ptr;
25796   ptr = nullptr;
25797   return tmp;
25798 }
25799 
is_null()25800 bool union_access_info::is_null() const {
25801   return ptr == nullptr;
25802 }
25803 
ctx()25804 isl::ctx union_access_info::ctx() const {
25805   return isl::ctx(isl_union_access_info_get_ctx(ptr));
25806 }
25807 
compute_flow()25808 isl::union_flow union_access_info::compute_flow() const
25809 {
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);
25818 }
25819 
set_kill(isl::union_map kill)25820 isl::union_access_info union_access_info::set_kill(isl::union_map kill) const
25821 {
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);
25830 }
25831 
set_may_source(isl::union_map may_source)25832 isl::union_access_info union_access_info::set_may_source(isl::union_map may_source) const
25833 {
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);
25842 }
25843 
set_must_source(isl::union_map must_source)25844 isl::union_access_info union_access_info::set_must_source(isl::union_map must_source) const
25845 {
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);
25854 }
25855 
set_schedule(isl::schedule schedule)25856 isl::union_access_info union_access_info::set_schedule(isl::schedule schedule) const
25857 {
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);
25866 }
25867 
set_schedule_map(isl::union_map schedule_map)25868 isl::union_access_info union_access_info::set_schedule_map(isl::union_map schedule_map) const
25869 {
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);
25878 }
25879 
25880 inline std::ostream &operator<<(std::ostream &os, const union_access_info &obj)
25881 {
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;
25892 }
25893 
25894 // implementations for isl::union_flow
manage(__isl_take isl_union_flow * ptr)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);
25899 }
manage_copy(__isl_keep isl_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);
25909 }
25910 
union_flow(__isl_take isl_union_flow * ptr)25911 union_flow::union_flow(__isl_take isl_union_flow *ptr)
25912     : ptr(ptr) {}
25913 
union_flow()25914 union_flow::union_flow()
25915     : ptr(nullptr) {}
25916 
union_flow(const union_flow & obj)25917 union_flow::union_flow(const union_flow &obj)
25918     : ptr(nullptr)
25919 {
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);
25927 }
25928 
25929 union_flow &union_flow::operator=(union_flow obj) {
25930   std::swap(this->ptr, obj.ptr);
25931   return *this;
25932 }
25933 
~union_flow()25934 union_flow::~union_flow() {
25935   if (ptr)
25936     isl_union_flow_free(ptr);
25937 }
25938 
copy()25939 __isl_give isl_union_flow *union_flow::copy() const & {
25940   return isl_union_flow_copy(ptr);
25941 }
25942 
get()25943 __isl_keep isl_union_flow *union_flow::get() const {
25944   return ptr;
25945 }
25946 
release()25947 __isl_give isl_union_flow *union_flow::release() {
25948   isl_union_flow *tmp = ptr;
25949   ptr = nullptr;
25950   return tmp;
25951 }
25952 
is_null()25953 bool union_flow::is_null() const {
25954   return ptr == nullptr;
25955 }
25956 
ctx()25957 isl::ctx union_flow::ctx() const {
25958   return isl::ctx(isl_union_flow_get_ctx(ptr));
25959 }
25960 
full_may_dependence()25961 isl::union_map union_flow::full_may_dependence() const
25962 {
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);
25971 }
25972 
get_full_may_dependence()25973 isl::union_map union_flow::get_full_may_dependence() const
25974 {
25975   return full_may_dependence();
25976 }
25977 
full_must_dependence()25978 isl::union_map union_flow::full_must_dependence() const
25979 {
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);
25988 }
25989 
get_full_must_dependence()25990 isl::union_map union_flow::get_full_must_dependence() const
25991 {
25992   return full_must_dependence();
25993 }
25994 
may_dependence()25995 isl::union_map union_flow::may_dependence() const
25996 {
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);
26005 }
26006 
get_may_dependence()26007 isl::union_map union_flow::get_may_dependence() const
26008 {
26009   return may_dependence();
26010 }
26011 
may_no_source()26012 isl::union_map union_flow::may_no_source() const
26013 {
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);
26022 }
26023 
get_may_no_source()26024 isl::union_map union_flow::get_may_no_source() const
26025 {
26026   return may_no_source();
26027 }
26028 
must_dependence()26029 isl::union_map union_flow::must_dependence() const
26030 {
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);
26039 }
26040 
get_must_dependence()26041 isl::union_map union_flow::get_must_dependence() const
26042 {
26043   return must_dependence();
26044 }
26045 
must_no_source()26046 isl::union_map union_flow::must_no_source() const
26047 {
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);
26056 }
26057 
get_must_no_source()26058 isl::union_map union_flow::get_must_no_source() const
26059 {
26060   return must_no_source();
26061 }
26062 
26063 inline std::ostream &operator<<(std::ostream &os, const union_flow &obj)
26064 {
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;
26075 }
26076 
26077 // implementations for isl::union_map
manage(__isl_take isl_union_map * ptr)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);
26082 }
manage_copy(__isl_keep isl_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);
26092 }
26093 
union_map(__isl_take isl_union_map * ptr)26094 union_map::union_map(__isl_take isl_union_map *ptr)
26095     : ptr(ptr) {}
26096 
union_map()26097 union_map::union_map()
26098     : ptr(nullptr) {}
26099 
union_map(const union_map & obj)26100 union_map::union_map(const union_map &obj)
26101     : ptr(nullptr)
26102 {
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);
26110 }
26111 
union_map(isl::basic_map bmap)26112 union_map::union_map(isl::basic_map bmap)
26113 {
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;
26122 }
26123 
union_map(isl::map map)26124 union_map::union_map(isl::map map)
26125 {
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;
26134 }
26135 
union_map(isl::ctx ctx,const std::string & str)26136 union_map::union_map(isl::ctx ctx, const std::string &str)
26137 {
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;
26144 }
26145 
26146 union_map &union_map::operator=(union_map obj) {
26147   std::swap(this->ptr, obj.ptr);
26148   return *this;
26149 }
26150 
~union_map()26151 union_map::~union_map() {
26152   if (ptr)
26153     isl_union_map_free(ptr);
26154 }
26155 
copy()26156 __isl_give isl_union_map *union_map::copy() const & {
26157   return isl_union_map_copy(ptr);
26158 }
26159 
get()26160 __isl_keep isl_union_map *union_map::get() const {
26161   return ptr;
26162 }
26163 
release()26164 __isl_give isl_union_map *union_map::release() {
26165   isl_union_map *tmp = ptr;
26166   ptr = nullptr;
26167   return tmp;
26168 }
26169 
is_null()26170 bool union_map::is_null() const {
26171   return ptr == nullptr;
26172 }
26173 
ctx()26174 isl::ctx union_map::ctx() const {
26175   return isl::ctx(isl_union_map_get_ctx(ptr));
26176 }
26177 
affine_hull()26178 isl::union_map union_map::affine_hull() const
26179 {
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);
26188 }
26189 
apply_domain(isl::union_map umap2)26190 isl::union_map union_map::apply_domain(isl::union_map umap2) const
26191 {
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);
26200 }
26201 
apply_range(isl::union_map umap2)26202 isl::union_map union_map::apply_range(isl::union_map umap2) const
26203 {
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);
26212 }
26213 
as_map()26214 isl::map union_map::as_map() const
26215 {
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);
26224 }
26225 
as_multi_union_pw_aff()26226 isl::multi_union_pw_aff union_map::as_multi_union_pw_aff() const
26227 {
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);
26236 }
26237 
as_union_pw_multi_aff()26238 isl::union_pw_multi_aff union_map::as_union_pw_multi_aff() const
26239 {
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);
26248 }
26249 
bind_range(isl::multi_id tuple)26250 isl::union_set union_map::bind_range(isl::multi_id tuple) const
26251 {
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);
26260 }
26261 
coalesce()26262 isl::union_map union_map::coalesce() const
26263 {
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);
26272 }
26273 
compute_divs()26274 isl::union_map union_map::compute_divs() const
26275 {
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);
26284 }
26285 
curry()26286 isl::union_map union_map::curry() const
26287 {
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);
26296 }
26297 
deltas()26298 isl::union_set union_map::deltas() const
26299 {
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);
26308 }
26309 
detect_equalities()26310 isl::union_map union_map::detect_equalities() const
26311 {
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);
26320 }
26321 
domain()26322 isl::union_set union_map::domain() const
26323 {
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);
26332 }
26333 
domain_factor_domain()26334 isl::union_map union_map::domain_factor_domain() const
26335 {
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);
26344 }
26345 
domain_factor_range()26346 isl::union_map union_map::domain_factor_range() const
26347 {
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);
26356 }
26357 
domain_map()26358 isl::union_map union_map::domain_map() const
26359 {
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);
26368 }
26369 
domain_map_union_pw_multi_aff()26370 isl::union_pw_multi_aff union_map::domain_map_union_pw_multi_aff() const
26371 {
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);
26380 }
26381 
domain_product(isl::union_map umap2)26382 isl::union_map union_map::domain_product(isl::union_map umap2) const
26383 {
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);
26392 }
26393 
domain_reverse()26394 isl::union_map union_map::domain_reverse() const
26395 {
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);
26404 }
26405 
drop_unused_params()26406 isl::union_map union_map::drop_unused_params() const
26407 {
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);
26416 }
26417 
empty(isl::ctx ctx)26418 isl::union_map union_map::empty(isl::ctx ctx)
26419 {
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);
26426 }
26427 
eq_at(isl::multi_union_pw_aff mupa)26428 isl::union_map union_map::eq_at(isl::multi_union_pw_aff mupa) const
26429 {
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);
26438 }
26439 
every_map(const std::function<bool (isl::map)> & test)26440 bool union_map::every_map(const std::function<bool(isl::map)> &test) const
26441 {
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;
26458     }
26459   };
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;
26466 }
26467 
extract_map(isl::space space)26468 isl::map union_map::extract_map(isl::space space) const
26469 {
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);
26478 }
26479 
factor_domain()26480 isl::union_map union_map::factor_domain() const
26481 {
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);
26490 }
26491 
factor_range()26492 isl::union_map union_map::factor_range() const
26493 {
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);
26502 }
26503 
fixed_power(isl::val exp)26504 isl::union_map union_map::fixed_power(isl::val exp) const
26505 {
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);
26514 }
26515 
fixed_power(long exp)26516 isl::union_map union_map::fixed_power(long exp) const
26517 {
26518   if (!ptr)
26519     exception::throw_invalid("NULL input", __FILE__, __LINE__);
26520   return this->fixed_power(isl::val(ctx(), exp));
26521 }
26522 
foreach_map(const std::function<void (isl::map)> & fn)26523 void union_map::foreach_map(const std::function<void(isl::map)> &fn) const
26524 {
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;
26541     }
26542   };
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;
26549 }
26550 
from(isl::multi_union_pw_aff mupa)26551 isl::union_map union_map::from(isl::multi_union_pw_aff mupa)
26552 {
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);
26561 }
26562 
from(isl::union_pw_multi_aff upma)26563 isl::union_map union_map::from(isl::union_pw_multi_aff upma)
26564 {
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);
26573 }
26574 
from_domain(isl::union_set uset)26575 isl::union_map union_map::from_domain(isl::union_set uset)
26576 {
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);
26585 }
26586 
from_domain_and_range(isl::union_set domain,isl::union_set range)26587 isl::union_map union_map::from_domain_and_range(isl::union_set domain, isl::union_set range)
26588 {
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);
26597 }
26598 
from_range(isl::union_set uset)26599 isl::union_map union_map::from_range(isl::union_set uset)
26600 {
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);
26609 }
26610 
gist(isl::union_map context)26611 isl::union_map union_map::gist(isl::union_map context) const
26612 {
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);
26621 }
26622 
gist_domain(isl::union_set uset)26623 isl::union_map union_map::gist_domain(isl::union_set uset) const
26624 {
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);
26633 }
26634 
gist_params(isl::set set)26635 isl::union_map union_map::gist_params(isl::set set) const
26636 {
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);
26645 }
26646 
gist_range(isl::union_set uset)26647 isl::union_map union_map::gist_range(isl::union_set uset) const
26648 {
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);
26657 }
26658 
intersect(isl::union_map umap2)26659 isl::union_map union_map::intersect(isl::union_map umap2) const
26660 {
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);
26669 }
26670 
intersect_domain(isl::space space)26671 isl::union_map union_map::intersect_domain(isl::space space) const
26672 {
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);
26681 }
26682 
intersect_domain(isl::union_set uset)26683 isl::union_map union_map::intersect_domain(isl::union_set uset) const
26684 {
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);
26693 }
26694 
intersect_domain_factor_domain(isl::union_map factor)26695 isl::union_map union_map::intersect_domain_factor_domain(isl::union_map factor) const
26696 {
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);
26705 }
26706 
intersect_domain_factor_range(isl::union_map factor)26707 isl::union_map union_map::intersect_domain_factor_range(isl::union_map factor) const
26708 {
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);
26717 }
26718 
intersect_domain_wrapped_domain(isl::union_set domain)26719 isl::union_map union_map::intersect_domain_wrapped_domain(isl::union_set domain) const
26720 {
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);
26729 }
26730 
intersect_params(isl::set set)26731 isl::union_map union_map::intersect_params(isl::set set) const
26732 {
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);
26741 }
26742 
intersect_range(isl::space space)26743 isl::union_map union_map::intersect_range(isl::space space) const
26744 {
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);
26753 }
26754 
intersect_range(isl::union_set uset)26755 isl::union_map union_map::intersect_range(isl::union_set uset) const
26756 {
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);
26765 }
26766 
intersect_range_factor_domain(isl::union_map factor)26767 isl::union_map union_map::intersect_range_factor_domain(isl::union_map factor) const
26768 {
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);
26777 }
26778 
intersect_range_factor_range(isl::union_map factor)26779 isl::union_map union_map::intersect_range_factor_range(isl::union_map factor) const
26780 {
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);
26789 }
26790 
intersect_range_wrapped_domain(isl::union_set domain)26791 isl::union_map union_map::intersect_range_wrapped_domain(isl::union_set domain) const
26792 {
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);
26801 }
26802 
is_bijective()26803 bool union_map::is_bijective() const
26804 {
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;
26813 }
26814 
is_disjoint(const isl::union_map & umap2)26815 bool union_map::is_disjoint(const isl::union_map &umap2) const
26816 {
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;
26825 }
26826 
is_empty()26827 bool union_map::is_empty() const
26828 {
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;
26837 }
26838 
is_equal(const isl::union_map & umap2)26839 bool union_map::is_equal(const isl::union_map &umap2) const
26840 {
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;
26849 }
26850 
is_injective()26851 bool union_map::is_injective() const
26852 {
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;
26861 }
26862 
is_single_valued()26863 bool union_map::is_single_valued() const
26864 {
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;
26873 }
26874 
is_strict_subset(const isl::union_map & umap2)26875 bool union_map::is_strict_subset(const isl::union_map &umap2) const
26876 {
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;
26885 }
26886 
is_subset(const isl::union_map & umap2)26887 bool union_map::is_subset(const isl::union_map &umap2) const
26888 {
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;
26897 }
26898 
isa_map()26899 bool union_map::isa_map() const
26900 {
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;
26909 }
26910 
lexmax()26911 isl::union_map union_map::lexmax() const
26912 {
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);
26921 }
26922 
lexmin()26923 isl::union_map union_map::lexmin() const
26924 {
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);
26933 }
26934 
map_list()26935 isl::map_list union_map::map_list() const
26936 {
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);
26945 }
26946 
get_map_list()26947 isl::map_list union_map::get_map_list() const
26948 {
26949   return map_list();
26950 }
26951 
params()26952 isl::set union_map::params() const
26953 {
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);
26962 }
26963 
polyhedral_hull()26964 isl::union_map union_map::polyhedral_hull() const
26965 {
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);
26974 }
26975 
preimage_domain(isl::multi_aff ma)26976 isl::union_map union_map::preimage_domain(isl::multi_aff ma) const
26977 {
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);
26986 }
26987 
preimage_domain(isl::multi_pw_aff mpa)26988 isl::union_map union_map::preimage_domain(isl::multi_pw_aff mpa) const
26989 {
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);
26998 }
26999 
preimage_domain(isl::pw_multi_aff pma)27000 isl::union_map union_map::preimage_domain(isl::pw_multi_aff pma) const
27001 {
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);
27010 }
27011 
preimage_domain(isl::union_pw_multi_aff upma)27012 isl::union_map union_map::preimage_domain(isl::union_pw_multi_aff upma) const
27013 {
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);
27022 }
27023 
preimage_range(isl::multi_aff ma)27024 isl::union_map union_map::preimage_range(isl::multi_aff ma) const
27025 {
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);
27034 }
27035 
preimage_range(isl::pw_multi_aff pma)27036 isl::union_map union_map::preimage_range(isl::pw_multi_aff pma) const
27037 {
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);
27046 }
27047 
preimage_range(isl::union_pw_multi_aff upma)27048 isl::union_map union_map::preimage_range(isl::union_pw_multi_aff upma) const
27049 {
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);
27058 }
27059 
product(isl::union_map umap2)27060 isl::union_map union_map::product(isl::union_map umap2) const
27061 {
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);
27070 }
27071 
project_out_all_params()27072 isl::union_map union_map::project_out_all_params() const
27073 {
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);
27082 }
27083 
project_out_param(isl::id id)27084 isl::union_map union_map::project_out_param(isl::id id) const
27085 {
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);
27094 }
27095 
project_out_param(const std::string & id)27096 isl::union_map union_map::project_out_param(const std::string &id) const
27097 {
27098   if (!ptr)
27099     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27100   return this->project_out_param(isl::id(ctx(), id));
27101 }
27102 
project_out_param(isl::id_list list)27103 isl::union_map union_map::project_out_param(isl::id_list list) const
27104 {
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);
27113 }
27114 
range()27115 isl::union_set union_map::range() const
27116 {
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);
27125 }
27126 
range_factor_domain()27127 isl::union_map union_map::range_factor_domain() const
27128 {
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);
27137 }
27138 
range_factor_range()27139 isl::union_map union_map::range_factor_range() const
27140 {
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);
27149 }
27150 
range_map()27151 isl::union_map union_map::range_map() const
27152 {
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);
27161 }
27162 
range_product(isl::union_map umap2)27163 isl::union_map union_map::range_product(isl::union_map umap2) const
27164 {
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);
27173 }
27174 
range_reverse()27175 isl::union_map union_map::range_reverse() const
27176 {
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);
27185 }
27186 
reverse()27187 isl::union_map union_map::reverse() const
27188 {
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);
27197 }
27198 
space()27199 isl::space union_map::space() const
27200 {
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);
27209 }
27210 
get_space()27211 isl::space union_map::get_space() const
27212 {
27213   return space();
27214 }
27215 
subtract(isl::union_map umap2)27216 isl::union_map union_map::subtract(isl::union_map umap2) const
27217 {
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);
27226 }
27227 
subtract_domain(isl::union_set dom)27228 isl::union_map union_map::subtract_domain(isl::union_set dom) const
27229 {
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);
27238 }
27239 
subtract_range(isl::union_set dom)27240 isl::union_map union_map::subtract_range(isl::union_set dom) const
27241 {
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);
27250 }
27251 
uncurry()27252 isl::union_map union_map::uncurry() const
27253 {
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);
27262 }
27263 
unite(isl::union_map umap2)27264 isl::union_map union_map::unite(isl::union_map umap2) const
27265 {
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);
27274 }
27275 
universe()27276 isl::union_map union_map::universe() const
27277 {
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);
27286 }
27287 
wrap()27288 isl::union_set union_map::wrap() const
27289 {
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);
27298 }
27299 
zip()27300 isl::union_map union_map::zip() const
27301 {
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);
27310 }
27311 
27312 inline std::ostream &operator<<(std::ostream &os, const union_map &obj)
27313 {
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;
27324 }
27325 
27326 // implementations for isl::union_pw_aff
manage(__isl_take isl_union_pw_aff * ptr)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);
27331 }
manage_copy(__isl_keep isl_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);
27341 }
27342 
union_pw_aff(__isl_take isl_union_pw_aff * ptr)27343 union_pw_aff::union_pw_aff(__isl_take isl_union_pw_aff *ptr)
27344     : ptr(ptr) {}
27345 
union_pw_aff()27346 union_pw_aff::union_pw_aff()
27347     : ptr(nullptr) {}
27348 
union_pw_aff(const union_pw_aff & obj)27349 union_pw_aff::union_pw_aff(const union_pw_aff &obj)
27350     : ptr(nullptr)
27351 {
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);
27359 }
27360 
union_pw_aff(isl::aff aff)27361 union_pw_aff::union_pw_aff(isl::aff aff)
27362 {
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;
27371 }
27372 
union_pw_aff(isl::pw_aff pa)27373 union_pw_aff::union_pw_aff(isl::pw_aff pa)
27374 {
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;
27383 }
27384 
union_pw_aff(isl::ctx ctx,const std::string & str)27385 union_pw_aff::union_pw_aff(isl::ctx ctx, const std::string &str)
27386 {
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;
27393 }
27394 
27395 union_pw_aff &union_pw_aff::operator=(union_pw_aff obj) {
27396   std::swap(this->ptr, obj.ptr);
27397   return *this;
27398 }
27399 
~union_pw_aff()27400 union_pw_aff::~union_pw_aff() {
27401   if (ptr)
27402     isl_union_pw_aff_free(ptr);
27403 }
27404 
copy()27405 __isl_give isl_union_pw_aff *union_pw_aff::copy() const & {
27406   return isl_union_pw_aff_copy(ptr);
27407 }
27408 
get()27409 __isl_keep isl_union_pw_aff *union_pw_aff::get() const {
27410   return ptr;
27411 }
27412 
release()27413 __isl_give isl_union_pw_aff *union_pw_aff::release() {
27414   isl_union_pw_aff *tmp = ptr;
27415   ptr = nullptr;
27416   return tmp;
27417 }
27418 
is_null()27419 bool union_pw_aff::is_null() const {
27420   return ptr == nullptr;
27421 }
27422 
ctx()27423 isl::ctx union_pw_aff::ctx() const {
27424   return isl::ctx(isl_union_pw_aff_get_ctx(ptr));
27425 }
27426 
add(const isl::multi_union_pw_aff & multi2)27427 isl::multi_union_pw_aff union_pw_aff::add(const isl::multi_union_pw_aff &multi2) const
27428 {
27429   if (!ptr)
27430     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27431   return isl::multi_union_pw_aff(*this).add(multi2);
27432 }
27433 
add(isl::union_pw_aff upa2)27434 isl::union_pw_aff union_pw_aff::add(isl::union_pw_aff upa2) const
27435 {
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);
27444 }
27445 
add(const isl::union_pw_multi_aff & upma2)27446 isl::union_pw_multi_aff union_pw_aff::add(const isl::union_pw_multi_aff &upma2) const
27447 {
27448   if (!ptr)
27449     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27450   return isl::union_pw_multi_aff(*this).add(upma2);
27451 }
27452 
add(const isl::aff & upa2)27453 isl::union_pw_aff union_pw_aff::add(const isl::aff &upa2) const
27454 {
27455   if (!ptr)
27456     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27457   return this->add(isl::union_pw_aff(upa2));
27458 }
27459 
add(const isl::pw_aff & upa2)27460 isl::union_pw_aff union_pw_aff::add(const isl::pw_aff &upa2) const
27461 {
27462   if (!ptr)
27463     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27464   return this->add(isl::union_pw_aff(upa2));
27465 }
27466 
apply(const isl::union_pw_multi_aff & upma2)27467 isl::union_pw_multi_aff union_pw_aff::apply(const isl::union_pw_multi_aff &upma2) const
27468 {
27469   if (!ptr)
27470     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27471   return isl::union_pw_multi_aff(*this).apply(upma2);
27472 }
27473 
as_multi_union_pw_aff()27474 isl::multi_union_pw_aff union_pw_aff::as_multi_union_pw_aff() const
27475 {
27476   if (!ptr)
27477     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27478   return isl::union_pw_multi_aff(*this).as_multi_union_pw_aff();
27479 }
27480 
as_pw_multi_aff()27481 isl::pw_multi_aff union_pw_aff::as_pw_multi_aff() const
27482 {
27483   if (!ptr)
27484     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27485   return isl::union_pw_multi_aff(*this).as_pw_multi_aff();
27486 }
27487 
as_union_map()27488 isl::union_map union_pw_aff::as_union_map() const
27489 {
27490   if (!ptr)
27491     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27492   return isl::union_pw_multi_aff(*this).as_union_map();
27493 }
27494 
at(int pos)27495 isl::union_pw_aff union_pw_aff::at(int pos) const
27496 {
27497   if (!ptr)
27498     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27499   return isl::multi_union_pw_aff(*this).at(pos);
27500 }
27501 
bind(const isl::multi_id & tuple)27502 isl::union_set union_pw_aff::bind(const isl::multi_id &tuple) const
27503 {
27504   if (!ptr)
27505     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27506   return isl::multi_union_pw_aff(*this).bind(tuple);
27507 }
27508 
bind(isl::id id)27509 isl::union_set union_pw_aff::bind(isl::id id) const
27510 {
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);
27519 }
27520 
bind(const std::string & id)27521 isl::union_set union_pw_aff::bind(const std::string &id) const
27522 {
27523   if (!ptr)
27524     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27525   return this->bind(isl::id(ctx(), id));
27526 }
27527 
coalesce()27528 isl::union_pw_aff union_pw_aff::coalesce() const
27529 {
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);
27538 }
27539 
domain()27540 isl::union_set union_pw_aff::domain() const
27541 {
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);
27550 }
27551 
drop_unused_params()27552 isl::union_pw_aff union_pw_aff::drop_unused_params() const
27553 {
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);
27562 }
27563 
extract_pw_multi_aff(const isl::space & space)27564 isl::pw_multi_aff union_pw_aff::extract_pw_multi_aff(const isl::space &space) const
27565 {
27566   if (!ptr)
27567     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27568   return isl::union_pw_multi_aff(*this).extract_pw_multi_aff(space);
27569 }
27570 
flat_range_product(const isl::multi_union_pw_aff & multi2)27571 isl::multi_union_pw_aff union_pw_aff::flat_range_product(const isl::multi_union_pw_aff &multi2) const
27572 {
27573   if (!ptr)
27574     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27575   return isl::multi_union_pw_aff(*this).flat_range_product(multi2);
27576 }
27577 
flat_range_product(const isl::union_pw_multi_aff & upma2)27578 isl::union_pw_multi_aff union_pw_aff::flat_range_product(const isl::union_pw_multi_aff &upma2) const
27579 {
27580   if (!ptr)
27581     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27582   return isl::union_pw_multi_aff(*this).flat_range_product(upma2);
27583 }
27584 
gist(isl::union_set context)27585 isl::union_pw_aff union_pw_aff::gist(isl::union_set context) const
27586 {
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);
27595 }
27596 
gist_params(const isl::set & context)27597 isl::multi_union_pw_aff union_pw_aff::gist_params(const isl::set &context) const
27598 {
27599   if (!ptr)
27600     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27601   return isl::multi_union_pw_aff(*this).gist_params(context);
27602 }
27603 
has_range_tuple_id()27604 bool union_pw_aff::has_range_tuple_id() const
27605 {
27606   if (!ptr)
27607     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27608   return isl::multi_union_pw_aff(*this).has_range_tuple_id();
27609 }
27610 
intersect_domain(isl::space space)27611 isl::union_pw_aff union_pw_aff::intersect_domain(isl::space space) const
27612 {
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);
27621 }
27622 
intersect_domain(isl::union_set uset)27623 isl::union_pw_aff union_pw_aff::intersect_domain(isl::union_set uset) const
27624 {
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);
27633 }
27634 
intersect_domain_wrapped_domain(isl::union_set uset)27635 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
27636 {
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);
27645 }
27646 
intersect_domain_wrapped_range(isl::union_set uset)27647 isl::union_pw_aff union_pw_aff::intersect_domain_wrapped_range(isl::union_set uset) const
27648 {
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);
27657 }
27658 
intersect_params(isl::set set)27659 isl::union_pw_aff union_pw_aff::intersect_params(isl::set set) const
27660 {
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);
27669 }
27670 
involves_locals()27671 bool union_pw_aff::involves_locals() const
27672 {
27673   if (!ptr)
27674     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27675   return isl::union_pw_multi_aff(*this).involves_locals();
27676 }
27677 
involves_nan()27678 bool union_pw_aff::involves_nan() const
27679 {
27680   if (!ptr)
27681     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27682   return isl::multi_union_pw_aff(*this).involves_nan();
27683 }
27684 
isa_pw_multi_aff()27685 bool union_pw_aff::isa_pw_multi_aff() const
27686 {
27687   if (!ptr)
27688     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27689   return isl::union_pw_multi_aff(*this).isa_pw_multi_aff();
27690 }
27691 
list()27692 isl::union_pw_aff_list union_pw_aff::list() const
27693 {
27694   if (!ptr)
27695     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27696   return isl::multi_union_pw_aff(*this).list();
27697 }
27698 
neg()27699 isl::multi_union_pw_aff union_pw_aff::neg() const
27700 {
27701   if (!ptr)
27702     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27703   return isl::multi_union_pw_aff(*this).neg();
27704 }
27705 
plain_is_empty()27706 bool union_pw_aff::plain_is_empty() const
27707 {
27708   if (!ptr)
27709     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27710   return isl::union_pw_multi_aff(*this).plain_is_empty();
27711 }
27712 
plain_is_equal(const isl::multi_union_pw_aff & multi2)27713 bool union_pw_aff::plain_is_equal(const isl::multi_union_pw_aff &multi2) const
27714 {
27715   if (!ptr)
27716     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27717   return isl::multi_union_pw_aff(*this).plain_is_equal(multi2);
27718 }
27719 
plain_is_equal(const isl::union_pw_aff & upa2)27720 bool union_pw_aff::plain_is_equal(const isl::union_pw_aff &upa2) const
27721 {
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;
27730 }
27731 
plain_is_equal(const isl::union_pw_multi_aff & upma2)27732 bool union_pw_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
27733 {
27734   if (!ptr)
27735     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27736   return isl::union_pw_multi_aff(*this).plain_is_equal(upma2);
27737 }
27738 
plain_is_equal(const isl::aff & upa2)27739 bool union_pw_aff::plain_is_equal(const isl::aff &upa2) const
27740 {
27741   if (!ptr)
27742     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27743   return this->plain_is_equal(isl::union_pw_aff(upa2));
27744 }
27745 
plain_is_equal(const isl::pw_aff & upa2)27746 bool union_pw_aff::plain_is_equal(const isl::pw_aff &upa2) const
27747 {
27748   if (!ptr)
27749     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27750   return this->plain_is_equal(isl::union_pw_aff(upa2));
27751 }
27752 
preimage_domain_wrapped_domain(const isl::union_pw_multi_aff & upma2)27753 isl::union_pw_multi_aff union_pw_aff::preimage_domain_wrapped_domain(const isl::union_pw_multi_aff &upma2) const
27754 {
27755   if (!ptr)
27756     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27757   return isl::union_pw_multi_aff(*this).preimage_domain_wrapped_domain(upma2);
27758 }
27759 
pullback(isl::union_pw_multi_aff upma)27760 isl::union_pw_aff union_pw_aff::pullback(isl::union_pw_multi_aff upma) const
27761 {
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);
27770 }
27771 
pw_multi_aff_list()27772 isl::pw_multi_aff_list union_pw_aff::pw_multi_aff_list() const
27773 {
27774   if (!ptr)
27775     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27776   return isl::union_pw_multi_aff(*this).pw_multi_aff_list();
27777 }
27778 
range_factor_domain()27779 isl::union_pw_multi_aff union_pw_aff::range_factor_domain() const
27780 {
27781   if (!ptr)
27782     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27783   return isl::union_pw_multi_aff(*this).range_factor_domain();
27784 }
27785 
range_factor_range()27786 isl::union_pw_multi_aff union_pw_aff::range_factor_range() const
27787 {
27788   if (!ptr)
27789     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27790   return isl::union_pw_multi_aff(*this).range_factor_range();
27791 }
27792 
range_product(const isl::multi_union_pw_aff & multi2)27793 isl::multi_union_pw_aff union_pw_aff::range_product(const isl::multi_union_pw_aff &multi2) const
27794 {
27795   if (!ptr)
27796     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27797   return isl::multi_union_pw_aff(*this).range_product(multi2);
27798 }
27799 
range_product(const isl::union_pw_multi_aff & upma2)27800 isl::union_pw_multi_aff union_pw_aff::range_product(const isl::union_pw_multi_aff &upma2) const
27801 {
27802   if (!ptr)
27803     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27804   return isl::union_pw_multi_aff(*this).range_product(upma2);
27805 }
27806 
range_tuple_id()27807 isl::id union_pw_aff::range_tuple_id() const
27808 {
27809   if (!ptr)
27810     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27811   return isl::multi_union_pw_aff(*this).range_tuple_id();
27812 }
27813 
reset_range_tuple_id()27814 isl::multi_union_pw_aff union_pw_aff::reset_range_tuple_id() const
27815 {
27816   if (!ptr)
27817     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27818   return isl::multi_union_pw_aff(*this).reset_range_tuple_id();
27819 }
27820 
scale(const isl::multi_val & mv)27821 isl::multi_union_pw_aff union_pw_aff::scale(const isl::multi_val &mv) const
27822 {
27823   if (!ptr)
27824     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27825   return isl::multi_union_pw_aff(*this).scale(mv);
27826 }
27827 
scale(const isl::val & v)27828 isl::multi_union_pw_aff union_pw_aff::scale(const isl::val &v) const
27829 {
27830   if (!ptr)
27831     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27832   return isl::multi_union_pw_aff(*this).scale(v);
27833 }
27834 
scale(long v)27835 isl::multi_union_pw_aff union_pw_aff::scale(long v) const
27836 {
27837   if (!ptr)
27838     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27839   return this->scale(isl::val(ctx(), v));
27840 }
27841 
scale_down(const isl::multi_val & mv)27842 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::multi_val &mv) const
27843 {
27844   if (!ptr)
27845     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27846   return isl::multi_union_pw_aff(*this).scale_down(mv);
27847 }
27848 
scale_down(const isl::val & v)27849 isl::multi_union_pw_aff union_pw_aff::scale_down(const isl::val &v) const
27850 {
27851   if (!ptr)
27852     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27853   return isl::multi_union_pw_aff(*this).scale_down(v);
27854 }
27855 
scale_down(long v)27856 isl::multi_union_pw_aff union_pw_aff::scale_down(long v) const
27857 {
27858   if (!ptr)
27859     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27860   return this->scale_down(isl::val(ctx(), v));
27861 }
27862 
set_at(int pos,const isl::union_pw_aff & el)27863 isl::multi_union_pw_aff union_pw_aff::set_at(int pos, const isl::union_pw_aff &el) const
27864 {
27865   if (!ptr)
27866     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27867   return isl::multi_union_pw_aff(*this).set_at(pos, el);
27868 }
27869 
set_range_tuple(const isl::id & id)27870 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const isl::id &id) const
27871 {
27872   if (!ptr)
27873     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27874   return isl::multi_union_pw_aff(*this).set_range_tuple(id);
27875 }
27876 
set_range_tuple(const std::string & id)27877 isl::multi_union_pw_aff union_pw_aff::set_range_tuple(const std::string &id) const
27878 {
27879   if (!ptr)
27880     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27881   return this->set_range_tuple(isl::id(ctx(), id));
27882 }
27883 
size()27884 unsigned union_pw_aff::size() const
27885 {
27886   if (!ptr)
27887     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27888   return isl::multi_union_pw_aff(*this).size();
27889 }
27890 
space()27891 isl::space union_pw_aff::space() const
27892 {
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);
27901 }
27902 
get_space()27903 isl::space union_pw_aff::get_space() const
27904 {
27905   return space();
27906 }
27907 
sub(const isl::multi_union_pw_aff & multi2)27908 isl::multi_union_pw_aff union_pw_aff::sub(const isl::multi_union_pw_aff &multi2) const
27909 {
27910   if (!ptr)
27911     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27912   return isl::multi_union_pw_aff(*this).sub(multi2);
27913 }
27914 
sub(isl::union_pw_aff upa2)27915 isl::union_pw_aff union_pw_aff::sub(isl::union_pw_aff upa2) const
27916 {
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);
27925 }
27926 
sub(const isl::union_pw_multi_aff & upma2)27927 isl::union_pw_multi_aff union_pw_aff::sub(const isl::union_pw_multi_aff &upma2) const
27928 {
27929   if (!ptr)
27930     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27931   return isl::union_pw_multi_aff(*this).sub(upma2);
27932 }
27933 
sub(const isl::aff & upa2)27934 isl::union_pw_aff union_pw_aff::sub(const isl::aff &upa2) const
27935 {
27936   if (!ptr)
27937     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27938   return this->sub(isl::union_pw_aff(upa2));
27939 }
27940 
sub(const isl::pw_aff & upa2)27941 isl::union_pw_aff union_pw_aff::sub(const isl::pw_aff &upa2) const
27942 {
27943   if (!ptr)
27944     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27945   return this->sub(isl::union_pw_aff(upa2));
27946 }
27947 
subtract_domain(isl::space space)27948 isl::union_pw_aff union_pw_aff::subtract_domain(isl::space space) const
27949 {
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);
27958 }
27959 
subtract_domain(isl::union_set uset)27960 isl::union_pw_aff union_pw_aff::subtract_domain(isl::union_set uset) const
27961 {
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);
27970 }
27971 
to_list()27972 isl::union_pw_aff_list union_pw_aff::to_list() const
27973 {
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);
27982 }
27983 
union_add(const isl::multi_union_pw_aff & mupa2)27984 isl::multi_union_pw_aff union_pw_aff::union_add(const isl::multi_union_pw_aff &mupa2) const
27985 {
27986   if (!ptr)
27987     exception::throw_invalid("NULL input", __FILE__, __LINE__);
27988   return isl::multi_union_pw_aff(*this).union_add(mupa2);
27989 }
27990 
union_add(isl::union_pw_aff upa2)27991 isl::union_pw_aff union_pw_aff::union_add(isl::union_pw_aff upa2) const
27992 {
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);
28001 }
28002 
union_add(const isl::union_pw_multi_aff & upma2)28003 isl::union_pw_multi_aff union_pw_aff::union_add(const isl::union_pw_multi_aff &upma2) const
28004 {
28005   if (!ptr)
28006     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28007   return isl::union_pw_multi_aff(*this).union_add(upma2);
28008 }
28009 
union_add(const isl::aff & upa2)28010 isl::union_pw_aff union_pw_aff::union_add(const isl::aff &upa2) const
28011 {
28012   if (!ptr)
28013     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28014   return this->union_add(isl::union_pw_aff(upa2));
28015 }
28016 
union_add(const isl::pw_aff & upa2)28017 isl::union_pw_aff union_pw_aff::union_add(const isl::pw_aff &upa2) const
28018 {
28019   if (!ptr)
28020     exception::throw_invalid("NULL input", __FILE__, __LINE__);
28021   return this->union_add(isl::union_pw_aff(upa2));
28022 }
28023 
28024 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff &obj)
28025 {
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;
28036 }
28037 
28038 // implementations for isl::union_pw_aff_list
manage(__isl_take isl_union_pw_aff_list * ptr)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);
28043 }
manage_copy(__isl_keep isl_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);
28053 }
28054 
union_pw_aff_list(__isl_take isl_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) {}
28057 
union_pw_aff_list()28058 union_pw_aff_list::union_pw_aff_list()
28059     : ptr(nullptr) {}
28060 
union_pw_aff_list(const union_pw_aff_list & obj)28061 union_pw_aff_list::union_pw_aff_list(const union_pw_aff_list &obj)
28062     : ptr(nullptr)
28063 {
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);
28071 }
28072 
union_pw_aff_list(isl::ctx ctx,int n)28073 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, int n)
28074 {
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;
28081 }
28082 
union_pw_aff_list(isl::union_pw_aff el)28083 union_pw_aff_list::union_pw_aff_list(isl::union_pw_aff el)
28084 {
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;
28093 }
28094 
union_pw_aff_list(isl::ctx ctx,const std::string & str)28095 union_pw_aff_list::union_pw_aff_list(isl::ctx ctx, const std::string &str)
28096 {
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;
28103 }
28104 
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;
28108 }
28109 
~union_pw_aff_list()28110 union_pw_aff_list::~union_pw_aff_list() {
28111   if (ptr)
28112     isl_union_pw_aff_list_free(ptr);
28113 }
28114 
copy()28115 __isl_give isl_union_pw_aff_list *union_pw_aff_list::copy() const & {
28116   return isl_union_pw_aff_list_copy(ptr);
28117 }
28118 
get()28119 __isl_keep isl_union_pw_aff_list *union_pw_aff_list::get() const {
28120   return ptr;
28121 }
28122 
release()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;
28127 }
28128 
is_null()28129 bool union_pw_aff_list::is_null() const {
28130   return ptr == nullptr;
28131 }
28132 
ctx()28133 isl::ctx union_pw_aff_list::ctx() const {
28134   return isl::ctx(isl_union_pw_aff_list_get_ctx(ptr));
28135 }
28136 
add(isl::union_pw_aff el)28137 isl::union_pw_aff_list union_pw_aff_list::add(isl::union_pw_aff el) const
28138 {
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);
28147 }
28148 
at(int index)28149 isl::union_pw_aff union_pw_aff_list::at(int index) const
28150 {
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);
28159 }
28160 
get_at(int index)28161 isl::union_pw_aff union_pw_aff_list::get_at(int index) const
28162 {
28163   return at(index);
28164 }
28165 
clear()28166 isl::union_pw_aff_list union_pw_aff_list::clear() const
28167 {
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);
28176 }
28177 
concat(isl::union_pw_aff_list list2)28178 isl::union_pw_aff_list union_pw_aff_list::concat(isl::union_pw_aff_list list2) const
28179 {
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);
28188 }
28189 
drop(unsigned int first,unsigned int n)28190 isl::union_pw_aff_list union_pw_aff_list::drop(unsigned int first, unsigned int n) const
28191 {
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);
28200 }
28201 
foreach(const std::function<void (isl::union_pw_aff)> & fn)28202 void union_pw_aff_list::foreach(const std::function<void(isl::union_pw_aff)> &fn) const
28203 {
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;
28220     }
28221   };
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;
28228 }
28229 
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)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
28231 {
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;
28248     }
28249   };
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;
28262     }
28263   };
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;
28272 }
28273 
insert(unsigned int pos,isl::union_pw_aff el)28274 isl::union_pw_aff_list union_pw_aff_list::insert(unsigned int pos, isl::union_pw_aff el) const
28275 {
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);
28284 }
28285 
set_at(int index,isl::union_pw_aff el)28286 isl::union_pw_aff_list union_pw_aff_list::set_at(int index, isl::union_pw_aff el) const
28287 {
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);
28296 }
28297 
size()28298 unsigned union_pw_aff_list::size() const
28299 {
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;
28308 }
28309 
28310 inline std::ostream &operator<<(std::ostream &os, const union_pw_aff_list &obj)
28311 {
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;
28322 }
28323 
28324 // implementations for isl::union_pw_multi_aff
manage(__isl_take isl_union_pw_multi_aff * ptr)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);
28329 }
manage_copy(__isl_keep isl_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);
28339 }
28340 
union_pw_multi_aff(__isl_take isl_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) {}
28343 
union_pw_multi_aff()28344 union_pw_multi_aff::union_pw_multi_aff()
28345     : ptr(nullptr) {}
28346 
union_pw_multi_aff(const union_pw_multi_aff & obj)28347 union_pw_multi_aff::union_pw_multi_aff(const union_pw_multi_aff &obj)
28348     : ptr(nullptr)
28349 {
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);
28357 }
28358 
union_pw_multi_aff(isl::multi_aff ma)28359 union_pw_multi_aff::union_pw_multi_aff(isl::multi_aff ma)
28360 {
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;
28369 }
28370 
union_pw_multi_aff(isl::pw_multi_aff pma)28371 union_pw_multi_aff::union_pw_multi_aff(isl::pw_multi_aff pma)
28372 {
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;
28381 }
28382 
union_pw_multi_aff(isl::union_pw_aff upa)28383 union_pw_multi_aff::union_pw_multi_aff(isl::union_pw_aff upa)
28384 {
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;
28393 }
28394 
union_pw_multi_aff(isl::ctx ctx,const std::string & str)28395 union_pw_multi_aff::union_pw_multi_aff(isl::ctx ctx, const std::string &str)
28396 {
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;
28403 }
28404 
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;
28408 }
28409 
~union_pw_multi_aff()28410 union_pw_multi_aff::~union_pw_multi_aff() {
28411   if (ptr)
28412     isl_union_pw_multi_aff_free(ptr);
28413 }
28414 
copy()28415 __isl_give isl_union_pw_multi_aff *union_pw_multi_aff::copy() const & {
28416   return isl_union_pw_multi_aff_copy(ptr);
28417 }
28418 
get()28419 __isl_keep isl_union_pw_multi_aff *union_pw_multi_aff::get() const {
28420   return ptr;
28421 }
28422 
release()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;
28427 }
28428 
is_null()28429 bool union_pw_multi_aff::is_null() const {
28430   return ptr == nullptr;
28431 }
28432 
ctx()28433 isl::ctx union_pw_multi_aff::ctx() const {
28434   return isl::ctx(isl_union_pw_multi_aff_get_ctx(ptr));
28435 }
28436 
add(isl::union_pw_multi_aff upma2)28437 isl::union_pw_multi_aff union_pw_multi_aff::add(isl::union_pw_multi_aff upma2) const
28438 {
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);
28447 }
28448 
apply(isl::union_pw_multi_aff upma2)28449 isl::union_pw_multi_aff union_pw_multi_aff::apply(isl::union_pw_multi_aff upma2) const
28450 {
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);
28459 }
28460 
as_multi_union_pw_aff()28461 isl::multi_union_pw_aff union_pw_multi_aff::as_multi_union_pw_aff() const
28462 {
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);
28471 }
28472 
as_pw_multi_aff()28473 isl::pw_multi_aff union_pw_multi_aff::as_pw_multi_aff() const
28474 {
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);
28483 }
28484 
as_union_map()28485 isl::union_map union_pw_multi_aff::as_union_map() const
28486 {
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);
28495 }
28496 
coalesce()28497 isl::union_pw_multi_aff union_pw_multi_aff::coalesce() const
28498 {
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);
28507 }
28508 
domain()28509 isl::union_set union_pw_multi_aff::domain() const
28510 {
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);
28519 }
28520 
drop_unused_params()28521 isl::union_pw_multi_aff union_pw_multi_aff::drop_unused_params() const
28522 {
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);
28531 }
28532 
empty(isl::ctx ctx)28533 isl::union_pw_multi_aff union_pw_multi_aff::empty(isl::ctx ctx)
28534 {
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);
28541 }
28542 
extract_pw_multi_aff(isl::space space)28543 isl::pw_multi_aff union_pw_multi_aff::extract_pw_multi_aff(isl::space space) const
28544 {
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);
28553 }
28554 
flat_range_product(isl::union_pw_multi_aff upma2)28555 isl::union_pw_multi_aff union_pw_multi_aff::flat_range_product(isl::union_pw_multi_aff upma2) const
28556 {
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);
28565 }
28566 
gist(isl::union_set context)28567 isl::union_pw_multi_aff union_pw_multi_aff::gist(isl::union_set context) const
28568 {
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);
28577 }
28578 
intersect_domain(isl::space space)28579 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::space space) const
28580 {
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);
28589 }
28590 
intersect_domain(isl::union_set uset)28591 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain(isl::union_set uset) const
28592 {
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);
28601 }
28602 
intersect_domain_wrapped_domain(isl::union_set uset)28603 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_domain(isl::union_set uset) const
28604 {
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);
28613 }
28614 
intersect_domain_wrapped_range(isl::union_set uset)28615 isl::union_pw_multi_aff union_pw_multi_aff::intersect_domain_wrapped_range(isl::union_set uset) const
28616 {
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);
28625 }
28626 
intersect_params(isl::set set)28627 isl::union_pw_multi_aff union_pw_multi_aff::intersect_params(isl::set set) const
28628 {
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);
28637 }
28638 
involves_locals()28639 bool union_pw_multi_aff::involves_locals() const
28640 {
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;
28649 }
28650 
isa_pw_multi_aff()28651 bool union_pw_multi_aff::isa_pw_multi_aff() const
28652 {
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;
28661 }
28662 
plain_is_empty()28663 bool union_pw_multi_aff::plain_is_empty() const
28664 {
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;
28673 }
28674 
plain_is_equal(const isl::union_pw_multi_aff & upma2)28675 bool union_pw_multi_aff::plain_is_equal(const isl::union_pw_multi_aff &upma2) const
28676 {
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;
28685 }
28686 
preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2)28687 isl::union_pw_multi_aff union_pw_multi_aff::preimage_domain_wrapped_domain(isl::union_pw_multi_aff upma2) const
28688 {
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);
28697 }
28698 
pullback(isl::union_pw_multi_aff upma2)28699 isl::union_pw_multi_aff union_pw_multi_aff::pullback(isl::union_pw_multi_aff upma2) const
28700 {
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);
28709 }
28710 
pw_multi_aff_list()28711 isl::pw_multi_aff_list union_pw_multi_aff::pw_multi_aff_list() const
28712 {
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);
28721 }
28722 
get_pw_multi_aff_list()28723 isl::pw_multi_aff_list union_pw_multi_aff::get_pw_multi_aff_list() const
28724 {
28725   return pw_multi_aff_list();
28726 }
28727 
range_factor_domain()28728 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_domain() const
28729 {
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);
28738 }
28739 
range_factor_range()28740 isl::union_pw_multi_aff union_pw_multi_aff::range_factor_range() const
28741 {
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);
28750 }
28751 
range_product(isl::union_pw_multi_aff upma2)28752 isl::union_pw_multi_aff union_pw_multi_aff::range_product(isl::union_pw_multi_aff upma2) const
28753 {
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);
28762 }
28763 
space()28764 isl::space union_pw_multi_aff::space() const
28765 {
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);
28774 }
28775 
get_space()28776 isl::space union_pw_multi_aff::get_space() const
28777 {
28778   return space();
28779 }
28780 
sub(isl::union_pw_multi_aff upma2)28781 isl::union_pw_multi_aff union_pw_multi_aff::sub(isl::union_pw_multi_aff upma2) const
28782 {
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);
28791 }
28792 
subtract_domain(isl::space space)28793 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::space space) const
28794 {
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);
28803 }
28804 
subtract_domain(isl::union_set uset)28805 isl::union_pw_multi_aff union_pw_multi_aff::subtract_domain(isl::union_set uset) const
28806 {
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);
28815 }
28816 
union_add(isl::union_pw_multi_aff upma2)28817 isl::union_pw_multi_aff union_pw_multi_aff::union_add(isl::union_pw_multi_aff upma2) const
28818 {
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);
28827 }
28828 
28829 inline std::ostream &operator<<(std::ostream &os, const union_pw_multi_aff &obj)
28830 {
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;
28841 }
28842 
28843 // implementations for isl::union_set
manage(__isl_take isl_union_set * ptr)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);
28848 }
manage_copy(__isl_keep isl_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);
28858 }
28859 
union_set(__isl_take isl_union_set * ptr)28860 union_set::union_set(__isl_take isl_union_set *ptr)
28861     : ptr(ptr) {}
28862 
union_set()28863 union_set::union_set()
28864     : ptr(nullptr) {}
28865 
union_set(const union_set & obj)28866 union_set::union_set(const union_set &obj)
28867     : ptr(nullptr)
28868 {
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);
28876 }
28877 
union_set(isl::basic_set bset)28878 union_set::union_set(isl::basic_set bset)
28879 {
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;
28888 }
28889 
union_set(isl::point pnt)28890 union_set::union_set(isl::point pnt)
28891 {
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;
28900 }
28901 
union_set(isl::set set)28902 union_set::union_set(isl::set set)
28903 {
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;
28912 }
28913 
union_set(isl::ctx ctx,const std::string & str)28914 union_set::union_set(isl::ctx ctx, const std::string &str)
28915 {
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;
28922 }
28923 
28924 union_set &union_set::operator=(union_set obj) {
28925   std::swap(this->ptr, obj.ptr);
28926   return *this;
28927 }
28928 
~union_set()28929 union_set::~union_set() {
28930   if (ptr)
28931     isl_union_set_free(ptr);
28932 }
28933 
copy()28934 __isl_give isl_union_set *union_set::copy() const & {
28935   return isl_union_set_copy(ptr);
28936 }
28937 
get()28938 __isl_keep isl_union_set *union_set::get() const {
28939   return ptr;
28940 }
28941 
release()28942 __isl_give isl_union_set *union_set::release() {
28943   isl_union_set *tmp = ptr;
28944   ptr = nullptr;
28945   return tmp;
28946 }
28947 
is_null()28948 bool union_set::is_null() const {
28949   return ptr == nullptr;
28950 }
28951 
ctx()28952 isl::ctx union_set::ctx() const {
28953   return isl::ctx(isl_union_set_get_ctx(ptr));
28954 }
28955 
affine_hull()28956 isl::union_set union_set::affine_hull() const
28957 {
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);
28966 }
28967 
apply(isl::union_map umap)28968 isl::union_set union_set::apply(isl::union_map umap) const
28969 {
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);
28978 }
28979 
as_set()28980 isl::set union_set::as_set() const
28981 {
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);
28990 }
28991 
coalesce()28992 isl::union_set union_set::coalesce() const
28993 {
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);
29002 }
29003 
compute_divs()29004 isl::union_set union_set::compute_divs() const
29005 {
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);
29014 }
29015 
detect_equalities()29016 isl::union_set union_set::detect_equalities() const
29017 {
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);
29026 }
29027 
drop_unused_params()29028 isl::union_set union_set::drop_unused_params() const
29029 {
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);
29038 }
29039 
empty(isl::ctx ctx)29040 isl::union_set union_set::empty(isl::ctx ctx)
29041 {
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);
29048 }
29049 
every_set(const std::function<bool (isl::set)> & test)29050 bool union_set::every_set(const std::function<bool(isl::set)> &test) const
29051 {
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;
29068     }
29069   };
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;
29076 }
29077 
extract_set(isl::space space)29078 isl::set union_set::extract_set(isl::space space) const
29079 {
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);
29088 }
29089 
foreach_point(const std::function<void (isl::point)> & fn)29090 void union_set::foreach_point(const std::function<void(isl::point)> &fn) const
29091 {
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;
29108     }
29109   };
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;
29116 }
29117 
foreach_set(const std::function<void (isl::set)> & fn)29118 void union_set::foreach_set(const std::function<void(isl::set)> &fn) const
29119 {
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;
29136     }
29137   };
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;
29144 }
29145 
gist(isl::union_set context)29146 isl::union_set union_set::gist(isl::union_set context) const
29147 {
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);
29156 }
29157 
gist_params(isl::set set)29158 isl::union_set union_set::gist_params(isl::set set) const
29159 {
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);
29168 }
29169 
identity()29170 isl::union_map union_set::identity() const
29171 {
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);
29180 }
29181 
intersect(isl::union_set uset2)29182 isl::union_set union_set::intersect(isl::union_set uset2) const
29183 {
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);
29192 }
29193 
intersect_params(isl::set set)29194 isl::union_set union_set::intersect_params(isl::set set) const
29195 {
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);
29204 }
29205 
is_disjoint(const isl::union_set & uset2)29206 bool union_set::is_disjoint(const isl::union_set &uset2) const
29207 {
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;
29216 }
29217 
is_empty()29218 bool union_set::is_empty() const
29219 {
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;
29228 }
29229 
is_equal(const isl::union_set & uset2)29230 bool union_set::is_equal(const isl::union_set &uset2) const
29231 {
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;
29240 }
29241 
is_strict_subset(const isl::union_set & uset2)29242 bool union_set::is_strict_subset(const isl::union_set &uset2) const
29243 {
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;
29252 }
29253 
is_subset(const isl::union_set & uset2)29254 bool union_set::is_subset(const isl::union_set &uset2) const
29255 {
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;
29264 }
29265 
isa_set()29266 bool union_set::isa_set() const
29267 {
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;
29276 }
29277 
lexmax()29278 isl::union_set union_set::lexmax() const
29279 {
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);
29288 }
29289 
lexmin()29290 isl::union_set union_set::lexmin() const
29291 {
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);
29300 }
29301 
params()29302 isl::set union_set::params() const
29303 {
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);
29312 }
29313 
polyhedral_hull()29314 isl::union_set union_set::polyhedral_hull() const
29315 {
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);
29324 }
29325 
preimage(isl::multi_aff ma)29326 isl::union_set union_set::preimage(isl::multi_aff ma) const
29327 {
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);
29336 }
29337 
preimage(isl::pw_multi_aff pma)29338 isl::union_set union_set::preimage(isl::pw_multi_aff pma) const
29339 {
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);
29348 }
29349 
preimage(isl::union_pw_multi_aff upma)29350 isl::union_set union_set::preimage(isl::union_pw_multi_aff upma) const
29351 {
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);
29360 }
29361 
project_out_all_params()29362 isl::union_set union_set::project_out_all_params() const
29363 {
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);
29372 }
29373 
sample_point()29374 isl::point union_set::sample_point() const
29375 {
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);
29384 }
29385 
set_list()29386 isl::set_list union_set::set_list() const
29387 {
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);
29396 }
29397 
get_set_list()29398 isl::set_list union_set::get_set_list() const
29399 {
29400   return set_list();
29401 }
29402 
space()29403 isl::space union_set::space() const
29404 {
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);
29413 }
29414 
get_space()29415 isl::space union_set::get_space() const
29416 {
29417   return space();
29418 }
29419 
subtract(isl::union_set uset2)29420 isl::union_set union_set::subtract(isl::union_set uset2) const
29421 {
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);
29430 }
29431 
to_list()29432 isl::union_set_list union_set::to_list() const
29433 {
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);
29442 }
29443 
unite(isl::union_set uset2)29444 isl::union_set union_set::unite(isl::union_set uset2) const
29445 {
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);
29454 }
29455 
universe()29456 isl::union_set union_set::universe() const
29457 {
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);
29466 }
29467 
unwrap()29468 isl::union_map union_set::unwrap() const
29469 {
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);
29478 }
29479 
29480 inline std::ostream &operator<<(std::ostream &os, const union_set &obj)
29481 {
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;
29492 }
29493 
29494 // implementations for isl::union_set_list
manage(__isl_take isl_union_set_list * ptr)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);
29499 }
manage_copy(__isl_keep isl_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);
29509 }
29510 
union_set_list(__isl_take isl_union_set_list * ptr)29511 union_set_list::union_set_list(__isl_take isl_union_set_list *ptr)
29512     : ptr(ptr) {}
29513 
union_set_list()29514 union_set_list::union_set_list()
29515     : ptr(nullptr) {}
29516 
union_set_list(const union_set_list & obj)29517 union_set_list::union_set_list(const union_set_list &obj)
29518     : ptr(nullptr)
29519 {
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);
29527 }
29528 
union_set_list(isl::ctx ctx,int n)29529 union_set_list::union_set_list(isl::ctx ctx, int n)
29530 {
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;
29537 }
29538 
union_set_list(isl::union_set el)29539 union_set_list::union_set_list(isl::union_set el)
29540 {
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;
29549 }
29550 
union_set_list(isl::ctx ctx,const std::string & str)29551 union_set_list::union_set_list(isl::ctx ctx, const std::string &str)
29552 {
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;
29559 }
29560 
29561 union_set_list &union_set_list::operator=(union_set_list obj) {
29562   std::swap(this->ptr, obj.ptr);
29563   return *this;
29564 }
29565 
~union_set_list()29566 union_set_list::~union_set_list() {
29567   if (ptr)
29568     isl_union_set_list_free(ptr);
29569 }
29570 
copy()29571 __isl_give isl_union_set_list *union_set_list::copy() const & {
29572   return isl_union_set_list_copy(ptr);
29573 }
29574 
get()29575 __isl_keep isl_union_set_list *union_set_list::get() const {
29576   return ptr;
29577 }
29578 
release()29579 __isl_give isl_union_set_list *union_set_list::release() {
29580   isl_union_set_list *tmp = ptr;
29581   ptr = nullptr;
29582   return tmp;
29583 }
29584 
is_null()29585 bool union_set_list::is_null() const {
29586   return ptr == nullptr;
29587 }
29588 
ctx()29589 isl::ctx union_set_list::ctx() const {
29590   return isl::ctx(isl_union_set_list_get_ctx(ptr));
29591 }
29592 
add(isl::union_set el)29593 isl::union_set_list union_set_list::add(isl::union_set el) const
29594 {
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);
29603 }
29604 
at(int index)29605 isl::union_set union_set_list::at(int index) const
29606 {
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);
29615 }
29616 
get_at(int index)29617 isl::union_set union_set_list::get_at(int index) const
29618 {
29619   return at(index);
29620 }
29621 
clear()29622 isl::union_set_list union_set_list::clear() const
29623 {
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);
29632 }
29633 
concat(isl::union_set_list list2)29634 isl::union_set_list union_set_list::concat(isl::union_set_list list2) const
29635 {
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);
29644 }
29645 
drop(unsigned int first,unsigned int n)29646 isl::union_set_list union_set_list::drop(unsigned int first, unsigned int n) const
29647 {
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);
29656 }
29657 
foreach(const std::function<void (isl::union_set)> & fn)29658 void union_set_list::foreach(const std::function<void(isl::union_set)> &fn) const
29659 {
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;
29676     }
29677   };
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;
29684 }
29685 
foreach_scc(const std::function<bool (isl::union_set,isl::union_set)> & follows,const std::function<void (isl::union_set_list)> & fn)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
29687 {
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;
29704     }
29705   };
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;
29718     }
29719   };
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;
29728 }
29729 
insert(unsigned int pos,isl::union_set el)29730 isl::union_set_list union_set_list::insert(unsigned int pos, isl::union_set el) const
29731 {
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);
29740 }
29741 
set_at(int index,isl::union_set el)29742 isl::union_set_list union_set_list::set_at(int index, isl::union_set el) const
29743 {
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);
29752 }
29753 
size()29754 unsigned union_set_list::size() const
29755 {
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;
29764 }
29765 
29766 inline std::ostream &operator<<(std::ostream &os, const union_set_list &obj)
29767 {
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;
29778 }
29779 
29780 // implementations for isl::val
manage(__isl_take isl_val * ptr)29781 val manage(__isl_take isl_val *ptr) {
29782   if (!ptr)
29783     exception::throw_invalid("NULL input", __FILE__, __LINE__);
29784   return val(ptr);
29785 }
manage_copy(__isl_keep isl_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);
29795 }
29796 
val(__isl_take isl_val * ptr)29797 val::val(__isl_take isl_val *ptr)
29798     : ptr(ptr) {}
29799 
val()29800 val::val()
29801     : ptr(nullptr) {}
29802 
val(const val & obj)29803 val::val(const val &obj)
29804     : ptr(nullptr)
29805 {
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);
29813 }
29814 
val(isl::ctx ctx,long i)29815 val::val(isl::ctx ctx, long i)
29816 {
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;
29823 }
29824 
val(isl::ctx ctx,const std::string & str)29825 val::val(isl::ctx ctx, const std::string &str)
29826 {
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;
29833 }
29834 
29835 val &val::operator=(val obj) {
29836   std::swap(this->ptr, obj.ptr);
29837   return *this;
29838 }
29839 
~val()29840 val::~val() {
29841   if (ptr)
29842     isl_val_free(ptr);
29843 }
29844 
copy()29845 __isl_give isl_val *val::copy() const & {
29846   return isl_val_copy(ptr);
29847 }
29848 
get()29849 __isl_keep isl_val *val::get() const {
29850   return ptr;
29851 }
29852 
release()29853 __isl_give isl_val *val::release() {
29854   isl_val *tmp = ptr;
29855   ptr = nullptr;
29856   return tmp;
29857 }
29858 
is_null()29859 bool val::is_null() const {
29860   return ptr == nullptr;
29861 }
29862 
ctx()29863 isl::ctx val::ctx() const {
29864   return isl::ctx(isl_val_get_ctx(ptr));
29865 }
29866 
abs()29867 isl::val val::abs() const
29868 {
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);
29877 }
29878 
abs_eq(const isl::val & v2)29879 bool val::abs_eq(const isl::val &v2) const
29880 {
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;
29889 }
29890 
abs_eq(long v2)29891 bool val::abs_eq(long v2) const
29892 {
29893   if (!ptr)
29894     exception::throw_invalid("NULL input", __FILE__, __LINE__);
29895   return this->abs_eq(isl::val(ctx(), v2));
29896 }
29897 
add(isl::val v2)29898 isl::val val::add(isl::val v2) const
29899 {
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);
29908 }
29909 
add(long v2)29910 isl::val val::add(long v2) const
29911 {
29912   if (!ptr)
29913     exception::throw_invalid("NULL input", __FILE__, __LINE__);
29914   return this->add(isl::val(ctx(), v2));
29915 }
29916 
ceil()29917 isl::val val::ceil() const
29918 {
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);
29927 }
29928 
cmp_si(long i)29929 int val::cmp_si(long i) const
29930 {
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;
29937 }
29938 
den_si()29939 long val::den_si() const
29940 {
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;
29947 }
29948 
get_den_si()29949 long val::get_den_si() const
29950 {
29951   return den_si();
29952 }
29953 
div(isl::val v2)29954 isl::val val::div(isl::val v2) const
29955 {
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);
29964 }
29965 
div(long v2)29966 isl::val val::div(long v2) const
29967 {
29968   if (!ptr)
29969     exception::throw_invalid("NULL input", __FILE__, __LINE__);
29970   return this->div(isl::val(ctx(), v2));
29971 }
29972 
eq(const isl::val & v2)29973 bool val::eq(const isl::val &v2) const
29974 {
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;
29983 }
29984 
eq(long v2)29985 bool val::eq(long v2) const
29986 {
29987   if (!ptr)
29988     exception::throw_invalid("NULL input", __FILE__, __LINE__);
29989   return this->eq(isl::val(ctx(), v2));
29990 }
29991 
floor()29992 isl::val val::floor() const
29993 {
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);
30002 }
30003 
gcd(isl::val v2)30004 isl::val val::gcd(isl::val v2) const
30005 {
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);
30014 }
30015 
gcd(long v2)30016 isl::val val::gcd(long v2) const
30017 {
30018   if (!ptr)
30019     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30020   return this->gcd(isl::val(ctx(), v2));
30021 }
30022 
ge(const isl::val & v2)30023 bool val::ge(const isl::val &v2) const
30024 {
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;
30033 }
30034 
ge(long v2)30035 bool val::ge(long v2) const
30036 {
30037   if (!ptr)
30038     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30039   return this->ge(isl::val(ctx(), v2));
30040 }
30041 
gt(const isl::val & v2)30042 bool val::gt(const isl::val &v2) const
30043 {
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;
30052 }
30053 
gt(long v2)30054 bool val::gt(long v2) const
30055 {
30056   if (!ptr)
30057     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30058   return this->gt(isl::val(ctx(), v2));
30059 }
30060 
infty(isl::ctx ctx)30061 isl::val val::infty(isl::ctx ctx)
30062 {
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);
30069 }
30070 
inv()30071 isl::val val::inv() const
30072 {
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);
30081 }
30082 
is_divisible_by(const isl::val & v2)30083 bool val::is_divisible_by(const isl::val &v2) const
30084 {
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;
30093 }
30094 
is_divisible_by(long v2)30095 bool val::is_divisible_by(long v2) const
30096 {
30097   if (!ptr)
30098     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30099   return this->is_divisible_by(isl::val(ctx(), v2));
30100 }
30101 
is_infty()30102 bool val::is_infty() const
30103 {
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;
30112 }
30113 
is_int()30114 bool val::is_int() const
30115 {
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;
30124 }
30125 
is_nan()30126 bool val::is_nan() const
30127 {
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;
30136 }
30137 
is_neg()30138 bool val::is_neg() const
30139 {
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;
30148 }
30149 
is_neginfty()30150 bool val::is_neginfty() const
30151 {
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;
30160 }
30161 
is_negone()30162 bool val::is_negone() const
30163 {
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;
30172 }
30173 
is_nonneg()30174 bool val::is_nonneg() const
30175 {
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;
30184 }
30185 
is_nonpos()30186 bool val::is_nonpos() const
30187 {
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;
30196 }
30197 
is_one()30198 bool val::is_one() const
30199 {
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;
30208 }
30209 
is_pos()30210 bool val::is_pos() const
30211 {
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;
30220 }
30221 
is_rat()30222 bool val::is_rat() const
30223 {
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;
30232 }
30233 
is_zero()30234 bool val::is_zero() const
30235 {
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;
30244 }
30245 
le(const isl::val & v2)30246 bool val::le(const isl::val &v2) const
30247 {
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;
30256 }
30257 
le(long v2)30258 bool val::le(long v2) const
30259 {
30260   if (!ptr)
30261     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30262   return this->le(isl::val(ctx(), v2));
30263 }
30264 
lt(const isl::val & v2)30265 bool val::lt(const isl::val &v2) const
30266 {
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;
30275 }
30276 
lt(long v2)30277 bool val::lt(long v2) const
30278 {
30279   if (!ptr)
30280     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30281   return this->lt(isl::val(ctx(), v2));
30282 }
30283 
max(isl::val v2)30284 isl::val val::max(isl::val v2) const
30285 {
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);
30294 }
30295 
max(long v2)30296 isl::val val::max(long v2) const
30297 {
30298   if (!ptr)
30299     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30300   return this->max(isl::val(ctx(), v2));
30301 }
30302 
min(isl::val v2)30303 isl::val val::min(isl::val v2) const
30304 {
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);
30313 }
30314 
min(long v2)30315 isl::val val::min(long v2) const
30316 {
30317   if (!ptr)
30318     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30319   return this->min(isl::val(ctx(), v2));
30320 }
30321 
mod(isl::val v2)30322 isl::val val::mod(isl::val v2) const
30323 {
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);
30332 }
30333 
mod(long v2)30334 isl::val val::mod(long v2) const
30335 {
30336   if (!ptr)
30337     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30338   return this->mod(isl::val(ctx(), v2));
30339 }
30340 
mul(isl::val v2)30341 isl::val val::mul(isl::val v2) const
30342 {
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);
30351 }
30352 
mul(long v2)30353 isl::val val::mul(long v2) const
30354 {
30355   if (!ptr)
30356     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30357   return this->mul(isl::val(ctx(), v2));
30358 }
30359 
nan(isl::ctx ctx)30360 isl::val val::nan(isl::ctx ctx)
30361 {
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);
30368 }
30369 
ne(const isl::val & v2)30370 bool val::ne(const isl::val &v2) const
30371 {
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;
30380 }
30381 
ne(long v2)30382 bool val::ne(long v2) const
30383 {
30384   if (!ptr)
30385     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30386   return this->ne(isl::val(ctx(), v2));
30387 }
30388 
neg()30389 isl::val val::neg() const
30390 {
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);
30399 }
30400 
neginfty(isl::ctx ctx)30401 isl::val val::neginfty(isl::ctx ctx)
30402 {
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);
30409 }
30410 
negone(isl::ctx ctx)30411 isl::val val::negone(isl::ctx ctx)
30412 {
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);
30419 }
30420 
num_si()30421 long val::num_si() const
30422 {
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;
30429 }
30430 
get_num_si()30431 long val::get_num_si() const
30432 {
30433   return num_si();
30434 }
30435 
one(isl::ctx ctx)30436 isl::val val::one(isl::ctx ctx)
30437 {
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);
30444 }
30445 
pow2()30446 isl::val val::pow2() const
30447 {
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);
30456 }
30457 
sgn()30458 int val::sgn() const
30459 {
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;
30466 }
30467 
sub(isl::val v2)30468 isl::val val::sub(isl::val v2) const
30469 {
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);
30478 }
30479 
sub(long v2)30480 isl::val val::sub(long v2) const
30481 {
30482   if (!ptr)
30483     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30484   return this->sub(isl::val(ctx(), v2));
30485 }
30486 
to_list()30487 isl::val_list val::to_list() const
30488 {
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);
30497 }
30498 
trunc()30499 isl::val val::trunc() const
30500 {
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);
30509 }
30510 
zero(isl::ctx ctx)30511 isl::val val::zero(isl::ctx ctx)
30512 {
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);
30519 }
30520 
30521 inline std::ostream &operator<<(std::ostream &os, const val &obj)
30522 {
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;
30533 }
30534 
30535 // implementations for isl::val_list
manage(__isl_take isl_val_list * ptr)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);
30540 }
manage_copy(__isl_keep isl_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);
30550 }
30551 
val_list(__isl_take isl_val_list * ptr)30552 val_list::val_list(__isl_take isl_val_list *ptr)
30553     : ptr(ptr) {}
30554 
val_list()30555 val_list::val_list()
30556     : ptr(nullptr) {}
30557 
val_list(const val_list & obj)30558 val_list::val_list(const val_list &obj)
30559     : ptr(nullptr)
30560 {
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);
30568 }
30569 
val_list(isl::ctx ctx,int n)30570 val_list::val_list(isl::ctx ctx, int n)
30571 {
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;
30578 }
30579 
val_list(isl::val el)30580 val_list::val_list(isl::val el)
30581 {
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;
30590 }
30591 
val_list(isl::ctx ctx,const std::string & str)30592 val_list::val_list(isl::ctx ctx, const std::string &str)
30593 {
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;
30600 }
30601 
30602 val_list &val_list::operator=(val_list obj) {
30603   std::swap(this->ptr, obj.ptr);
30604   return *this;
30605 }
30606 
~val_list()30607 val_list::~val_list() {
30608   if (ptr)
30609     isl_val_list_free(ptr);
30610 }
30611 
copy()30612 __isl_give isl_val_list *val_list::copy() const & {
30613   return isl_val_list_copy(ptr);
30614 }
30615 
get()30616 __isl_keep isl_val_list *val_list::get() const {
30617   return ptr;
30618 }
30619 
release()30620 __isl_give isl_val_list *val_list::release() {
30621   isl_val_list *tmp = ptr;
30622   ptr = nullptr;
30623   return tmp;
30624 }
30625 
is_null()30626 bool val_list::is_null() const {
30627   return ptr == nullptr;
30628 }
30629 
ctx()30630 isl::ctx val_list::ctx() const {
30631   return isl::ctx(isl_val_list_get_ctx(ptr));
30632 }
30633 
add(isl::val el)30634 isl::val_list val_list::add(isl::val el) const
30635 {
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);
30644 }
30645 
add(long el)30646 isl::val_list val_list::add(long el) const
30647 {
30648   if (!ptr)
30649     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30650   return this->add(isl::val(ctx(), el));
30651 }
30652 
at(int index)30653 isl::val val_list::at(int index) const
30654 {
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);
30663 }
30664 
get_at(int index)30665 isl::val val_list::get_at(int index) const
30666 {
30667   return at(index);
30668 }
30669 
clear()30670 isl::val_list val_list::clear() const
30671 {
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);
30680 }
30681 
concat(isl::val_list list2)30682 isl::val_list val_list::concat(isl::val_list list2) const
30683 {
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);
30692 }
30693 
drop(unsigned int first,unsigned int n)30694 isl::val_list val_list::drop(unsigned int first, unsigned int n) const
30695 {
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);
30704 }
30705 
foreach(const std::function<void (isl::val)> & fn)30706 void val_list::foreach(const std::function<void(isl::val)> &fn) const
30707 {
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;
30724     }
30725   };
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;
30732 }
30733 
foreach_scc(const std::function<bool (isl::val,isl::val)> & follows,const std::function<void (isl::val_list)> & fn)30734 void val_list::foreach_scc(const std::function<bool(isl::val, isl::val)> &follows, const std::function<void(isl::val_list)> &fn) const
30735 {
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;
30752     }
30753   };
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;
30766     }
30767   };
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;
30776 }
30777 
insert(unsigned int pos,isl::val el)30778 isl::val_list val_list::insert(unsigned int pos, isl::val el) const
30779 {
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);
30788 }
30789 
insert(unsigned int pos,long el)30790 isl::val_list val_list::insert(unsigned int pos, long el) const
30791 {
30792   if (!ptr)
30793     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30794   return this->insert(pos, isl::val(ctx(), el));
30795 }
30796 
set_at(int index,isl::val el)30797 isl::val_list val_list::set_at(int index, isl::val el) const
30798 {
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);
30807 }
30808 
set_at(int index,long el)30809 isl::val_list val_list::set_at(int index, long el) const
30810 {
30811   if (!ptr)
30812     exception::throw_invalid("NULL input", __FILE__, __LINE__);
30813   return this->set_at(index, isl::val(ctx(), el));
30814 }
30815 
size()30816 unsigned val_list::size() const
30817 {
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;
30826 }
30827 
30828 inline std::ostream &operator<<(std::ostream &os, const val_list &obj)
30829 {
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;
30840 }
30841 } // namespace isl
30842 
30843 #endif /* ISL_CPP */
30844